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: |