@@ -209,3 +209,91 @@ jobs:
209209 name : dashboard-test-screenshots-${{ matrix.os }}-${{ matrix.node-version }}
210210 path : /tmp/dashboard-test-*.png
211211 retention-days : 28
212+
213+ # Job 3: Verify `@vendure/create` works end-to-end when invoked via bun and pnpm.
214+ # The package manager is detected from npm_config_user_agent (which bunx / pnpm dlx
215+ # set), so the install step and generated project must use that manager rather than
216+ # hard-coding npm (#4390).
217+ test_package_managers :
218+ needs : build_and_publish
219+ runs-on : ubuntu-latest
220+ permissions :
221+ contents : read
222+ strategy :
223+ matrix :
224+ include :
225+ - pm : bun
226+ scaffold : bunx @vendure/create@ci test-app --ci --log-level info
227+ - pm : pnpm
228+ scaffold : pnpm dlx @vendure/create@ci test-app --ci --log-level info
229+ fail-fast : false
230+ steps :
231+ - uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
232+ - name : Use Node.js 22.x
233+ uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
234+ with :
235+ node-version : 22.x
236+ - uses : oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
237+ with :
238+ bun-version : ' 1.3.10'
239+ - name : Enable pnpm via corepack
240+ run : |
241+ corepack enable
242+ corepack prepare pnpm@9.15.9 --activate
243+ pnpm --version
244+ - name : Download Verdaccio storage
245+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
246+ with :
247+ name : verdaccio-storage
248+ path : ~/verdaccio-download
249+ - name : Setup Verdaccio with pre-built packages
250+ run : |
251+ npm install -g verdaccio
252+ npm install -g wait-on
253+ mkdir -p $HOME/.config/verdaccio
254+ cp -v ./.github/workflows/verdaccio/config.yaml $HOME/.config/verdaccio/config.yaml
255+ cd $HOME/.config/verdaccio
256+ tar -xzf ~/verdaccio-download/verdaccio-storage.tar.gz
257+ nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &
258+ wait-on http://localhost:4873
259+ # Register a Verdaccio user and capture an auth token.
260+ TOKEN_RES=$(curl -XPUT \
261+ -H "Content-type: application/json" \
262+ -d '{ "name": "test", "password": "test" }' \
263+ 'http://localhost:4873/-/user/org.couchdb.user:test')
264+ TOKEN=$(echo "$TOKEN_RES" | jq -r '.token')
265+ # npm + pnpm read ~/.npmrc; bun is pointed at Verdaccio via the
266+ # npm_config_registry env var on the install step (see below).
267+ npm set registry=http://localhost:4873
268+ npm set //localhost:4873/:_authToken $TOKEN
269+ - name : Install via @vendure/create using ${{ matrix.pm }}
270+ # bun ignores the home-directory ~/.npmrc (oven-sh/bun#22971) and does not walk
271+ # up to a parent .npmrc/bunfig, but it DOES honour the npm_config_registry env
272+ # var — and so does the scaffolded project's nested install (it inherits the
273+ # env). This is the one mechanism that reaches both bunx and the nested install.
274+ env :
275+ CI : true
276+ npm_config_registry : http://localhost:4873/
277+ run : |
278+ mkdir -p $HOME/install
279+ cd $HOME/install
280+ npm dist-tag ls @vendure/create
281+ # No --use-npm: the manager is detected from the invoking bunx / pnpm dlx.
282+ ${{ matrix.scaffold }}
283+ - name : Assert the generated project used ${{ matrix.pm }}
284+ run : |
285+ cd $HOME/install/test-app
286+ case "${{ matrix.pm }}" in
287+ bun) test -f bun.lock || { echo "Expected bun.lock to exist"; ls -la; exit 1; } ;;
288+ pnpm) test -f pnpm-lock.yaml || { echo "Expected pnpm-lock.yaml to exist"; ls -la; exit 1; } ;;
289+ esac
290+ echo "Lockfile for ${{ matrix.pm }} present ✓"
291+ - name : Server smoke tests
292+ run : |
293+ cd $HOME/install/test-app
294+ ${{ matrix.pm }} run dev &
295+ node $GITHUB_WORKSPACE/.github/workflows/scripts/smoke-tests
296+ - name : Kill dev server after smoke tests
297+ if : always()
298+ run : |
299+ lsof -ti:3000,5173 | xargs kill 2>/dev/null || true
0 commit comments