From 0fd1d1f55c7a898ff0f8a4f7417b7227593c9432 Mon Sep 17 00:00:00 2001 From: Johan LEROY Date: Thu, 18 Jun 2026 13:13:48 +0200 Subject: [PATCH] =?UTF-8?q?fix(ci):=20ex=C3=A9cuter=20prepack=20explicitem?= =?UTF-8?q?ent=20avant=20npm=20pack=20(embarquement=20@arboretum/shared)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le job pack-smoke échouait sur le runner Gitea : « npm pack -w » n'y déclenche pas le hook prepack (contrairement à « npm publish -w », d'où la 1.2.0 publiée intacte). vendor-shared ne matérialisait donc pas @arboretum/shared, et npm retombait sur le symlink workspace (non bundlé) → tarball sans le runtime partagé. On lance désormais prepack explicitement, on vérifie la matérialisation de @arboretum/shared/dist/index.js, puis on packe en --ignore-scripts. On nettoie aussi /tmp/tarballs (runner persistant). Validé en repro locale (npm 10 et 11). Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27586af..be7fae8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,8 +46,18 @@ jobs: # et on l'installe seul, comme un vrai consommateur depuis le registre. - name: Pack tarball run: | - mkdir -p /tmp/tarballs - npm pack -w @johanleroy/git-arboretum --pack-destination /tmp/tarballs + rm -rf /tmp/tarballs && mkdir -p /tmp/tarballs + # Le hook prepack (copy-web + vendor-shared + copy-meta) matérialise + # @arboretum/shared comme VRAI dossier dans le node_modules du serveur — + # condition pour que npm l'embarque via bundleDependencies. Selon la version + # de npm du runner, « npm pack -w » ne déclenche PAS toujours ce lifecycle + # (contrairement à « npm publish -w », qui lance bien prepack). On l'exécute + # donc explicitement, on vérifie la matérialisation, puis on packe avec + # --ignore-scripts (prepack déjà fait, dossier physique présent → bundlé). + npm run prepack -w @johanleroy/git-arboretum + test -f packages/server/node_modules/@arboretum/shared/dist/index.js \ + || { echo "ERREUR: prepack n'a pas matérialisé @arboretum/shared/dist/index.js"; exit 1; } + npm pack -w @johanleroy/git-arboretum --pack-destination /tmp/tarballs --ignore-scripts ls -l /tmp/tarballs - name: Assert @arboretum/shared is bundled in the tarball run: |