-
-
Notifications
You must be signed in to change notification settings - Fork 1
fix(hub): harden release image dependencies #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -60,9 +60,12 @@ COPY --from=builder /build/patches/ patches/ | |||||||
|
|
||||||||
| RUN apk add --no-cache --virtual .build-deps python3 make g++ \ | ||||||||
| && corepack enable \ | ||||||||
| && pnpm install --frozen-lockfile --prod --ignore-scripts --filter @xnetjs/hub... \ | ||||||||
| && pnpm --filter @xnetjs/hub exec npm rebuild better-sqlite3 \ | ||||||||
| && apk del .build-deps | ||||||||
| # Keep the runtime image on patched Hono releases without auto-installing optional peer stacks like expo-sqlite. | ||||||||
| && corepack pnpm add @hono/node-server@1.19.10 hono@4.12.4 --prod --ignore-scripts --config.auto-install-peers=false --filter @xnetjs/hub \ | ||||||||
| && corepack pnpm --filter @xnetjs/hub exec npm rebuild better-sqlite3 \ | ||||||||
| && apk del .build-deps \ | ||||||||
| && rm -rf /root/.cache/node/corepack /usr/local/lib/node_modules/corepack /usr/local/lib/node_modules/npm \ | ||||||||
| && rm -f /usr/local/bin/corepack /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/pnpm /usr/local/bin/pnpx | ||||||||
|
Comment on lines
+67
to
+68
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pnpm global content store not cleaned up The cleanup removes the corepack cache and the npm/corepack module directories, but the pnpm content-addressable global store (typically at
Suggested change
|
||||||||
|
|
||||||||
| # Copy built artifacts | ||||||||
| COPY --from=builder /build/packages/hub/dist packages/hub/dist/ | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pnpm adddrops--frozen-lockfileand the workspace-recursive...filterThe original command used
pnpm install --frozen-lockfile --prod --filter @xnetjs/hub.... The new command drops two important guards:No
--frozen-lockfile—pnpm addis intentionally incompatible with--frozen-lockfilebecause it must update the lockfile for the two added packages. However, without this flag, pnpm is free to re-resolve any transitive dependency that has a version conflict with the newly pinned hono packages, potentially pulling in package versions that differ from what was tested.--filter @xnetjs/hub(no...) — The trailing...in the original filter tells pnpm to also set upnode_modulesfor every workspace package that hub depends on (@xnetjs/core,@xnetjs/crypto,@xnetjs/data, etc.). Without it, those workspace packages are linked as symlinks but their own transitive production dependencies may not be fully resolved through the workspace machinery, depending on the pnpm version. If any workspace package has prod deps that pnpm would otherwise hoist via the...traversal, they will be absent at runtime.A safer approach is to first do a full frozen install of all deps, then layer on only the two hono overrides as an explicit mutation step — or define pnpm overrides in the root
package.jsonso you can still usepnpm install --frozen-lockfile --prod --filter @xnetjs/hub...with the pinned versions baked into the lockfile.