fix(docker): symlink all @manacore packages in sveltekit-base image

pnpm skips workspace linking when glob patterns like apps/*/apps/* from
pnpm-workspace.yaml match no directories. This caused @manacore/feedback
and other packages to be copied but not linked in node_modules. Fix adds
a post-install step that creates symlinks for all packages/* entries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-30 21:49:46 +02:00
parent 4a5fe3bee8
commit 4f68215e68

View file

@ -71,6 +71,19 @@ COPY packages/wallpaper-generator ./packages/wallpaper-generator
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
pnpm install --no-frozen-lockfile --ignore-scripts
# Ensure all @manacore workspace packages are linked in node_modules
# (pnpm may skip linking when app/*/ dirs from pnpm-workspace.yaml don't exist)
RUN mkdir -p node_modules/@manacore && \
for pkg in packages/*/; do \
name=$(node -p "require('./${pkg}package.json').name" 2>/dev/null) || continue; \
scope=$(echo "$name" | sed -n 's|@\(.*\)/.*|\1|p'); \
base=$(echo "$name" | sed 's|.*/||'); \
if [ -n "$scope" ]; then \
mkdir -p "node_modules/@${scope}"; \
ln -sfn "../../${pkg}" "node_modules/@${scope}/${base}"; \
fi; \
done
# Build shared packages in dependency order
RUN cd packages/shared-vite-config && pnpm build \
&& cd /app/packages/shared-auth && pnpm build || true \