Skip to content

Commit 88cd5ef

Browse files
committed
update scripts, lockfiles
1 parent fda7605 commit 88cd5ef

File tree

6 files changed

+27
-19
lines changed

6 files changed

+27
-19
lines changed

.github/workflows/docker-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Docker Image CI
22

33
on:
44
push:
5-
branches: [ "develop" ]
5+
branches: [ "develop", "c/bun-port" ]
66
pull_request:
77
branches: [ "develop" ]
88

Dockerfile

+12-11
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ ARG BUN_VERSION=1.1.13-alpine
66
# FROM node:${NODE_VERSION} as build
77
FROM oven/bun:${BUN_VERSION} as build
88

9-
RUN apk add git linux-headers build-base
10-
9+
# we need nodejs for node-gyp anyway :sob:
10+
RUN apk add git linux-headers build-base nodejs npm
11+
# RUN apt update && apt install -y git build-essential
1112
ENV PYTHONUNBUFFERED=1
1213
RUN apk add --update python3 && ln -sf python3 /usr/bin/python
14+
# RUN apt install -y python3 python3-pip
1315
RUN python3 -m ensurepip
1416
RUN pip3 install --no-cache --upgrade pip setuptools
1517

@@ -22,26 +24,25 @@ COPY --link . ./
2224
RUN git submodule update --init --recursive
2325
# RUN pnpm config set fetch-retries 5
2426
RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
25-
bun i --frozen-lockfile --aggregate-output --build_v8_with_gn=false
27+
bun i --aggregate-output
2628
RUN bun run --bun build
2729
RUN bun scripts/trim-deps.mjs
2830
RUN mv packages/frontend/assets sharkey-assets
29-
RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
30-
bun run --bun prune
31+
# RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
32+
# bun run --bun prune
3133
RUN rm -r node_modules packages/frontend packages/sw
3234
RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
33-
bun i --prod --frozen-lockfile --aggregate-output
35+
bun i --production --aggregate-output
3436
RUN rm -rf .git
3537

36-
FROM oven/bun:1.1.13-debian
38+
FROM oven/bun:${BUN_VERSION}
3739

3840
ARG UID="991"
3941
ARG GID="991"
4042

41-
RUN apt update && apt install -y ffmpeg tini
42-
43-
RUN groupadd -g ${GID} sharkey \
44-
&& useradd -u ${UID} -g ${GID} sharkey \
43+
RUN apk add ffmpeg tini jemalloc \
44+
&& addgroup -g "${GID}" sharkey \
45+
&& adduser -D -u "${UID}" -G sharkey -h /sharkey sharkey \
4546
&& find / -type d -path /sys -prune -o -type d -path /proc -prune -o -type f -perm /u+s -exec chmod u-s {} \; \
4647
&& find / -type d -path /sys -prune -o -type d -path /proc -prune -o -type f -perm /g+s -exec chmod g-s {} \;
4748

bun.lockb

20.6 KB
Binary file not shown.

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,15 @@
4343
"lodash": "4.17.21"
4444
},
4545
"dependencies": {
46+
"cssnano": "^7.0.2",
4647
"fast-glob": "3.3.2",
4748
"ignore-walk": "6.0.4",
4849
"js-yaml": "4.1.0",
49-
"tar": "6.2.0"
50+
"postcss": "^8.4.38",
51+
"re2": "^1.21.3",
52+
"tar": "6.2.0",
53+
"terser": "^5.31.1",
54+
"yaml": "^2.4.5"
5055
},
5156
"devDependencies": {
5257
"@typescript-eslint/eslint-plugin": "7.1.0",

scripts/build-assets.mjs

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ async function loadConfig() {
3434
return fs.readFile(configPath, 'utf-8').then(data => yaml.load(data)).catch(() => null);
3535
}
3636

37+
// We are now building with Bun, so these files will now be in the global node_modules folder
38+
3739
async function copyFrontendFonts() {
38-
await fs.cp('./packages/frontend/node_modules/three/examples/fonts', './built/_frontend_dist_/fonts', { dereference: true, recursive: true });
40+
await fs.cp('./node_modules/three/examples/fonts', './built/_frontend_dist_/fonts', { dereference: true, recursive: true });
3941
}
4042

4143
async function copyFrontendTablerIcons() {
42-
await fs.cp('./packages/frontend/node_modules/@phosphor-icons/web/src', './built/_frontend_dist_/phosphor-icons', { dereference: true, recursive: true });
44+
await fs.cp('./node_modules/@phosphor-icons/web/src', './built/_frontend_dist_/phosphor-icons', { dereference: true, recursive: true });
4345
}
4446

4547
async function copyFrontendLocales() {

scripts/clean-all.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const fs = require('fs');
3030
fs.rmSync(__dirname + '/../built', { recursive: true, force: true });
3131
fs.rmSync(__dirname + '/../node_modules', { recursive: true, force: true });
3232

33-
execSync('pnpm store prune', {
34-
cwd: __dirname + '/../',
35-
stdio: 'inherit',
36-
});
33+
// execSync('pnpm store prune', {
34+
// cwd: __dirname + '/../',
35+
// stdio: 'inherit',
36+
// });
3737
})();

0 commit comments

Comments
 (0)