From 6eb8a1cf1de6b0f30e59dd9ca5cb4eb61649ad50 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Sat, 28 Oct 2023 14:13:43 -0700 Subject: [PATCH] Use npmignore instead of package.json#files --- .github/workflows/tests.yml | 23 +++++++++++++++++++++++ .npmignore | 8 ++++++++ package.json | 14 -------------- 3 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 .npmignore diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4aa041df9e..34eafd1804 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,29 @@ jobs: # TODO: move this to its own action npm install @npmcli/arborist@7 semver@7 --no-save node .github/scripts/check-engines.js + Pack_Test: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Use Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: 20.x + - name: Update npm + run: npm install npm@latest -g + - name: Install Dependencies + run: npm install --no-progress + - name: Pack + run: | + DIR=${{ runner.temp }}/node-gyp + mkdir -p $DIR + npm pack + tar xzf *.tgz -C $DIR --strip-components=1 + cp -r test/ $DIR/test/ + - name: Test + run: npm test + working-directory: ${{ runner.temp }}/node-gyp Tests: needs: Lint_Python # Lint_Python takes ~5 seconds, so wait for it to pass before running the full matrix of tests. strategy: diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000000..100a9c0f2c --- /dev/null +++ b/.npmignore @@ -0,0 +1,8 @@ +/.github/ +/docs/ +/gyp/.github/ +/gyp/tools/ +/gyp/*.md +/gyp/AUTHORS +/test/ +*.tgz diff --git a/package.json b/package.json index e89b8314b3..dadbf1d25a 100644 --- a/package.json +++ b/package.json @@ -21,20 +21,6 @@ "preferGlobal": true, "bin": "./bin/node-gyp.js", "main": "./lib/node-gyp.js", - "files": [ - "/bin/", - "!/gyp/", - "/gyp/data/", - "/gyp/pylib/", - "/gyp/gyp", - "/gyp/gyp_main.py", - "/gyp.bat", - "/gyp/gyp", - "/lib/", - "/src/", - "/addon.gypi", - "macOS_Cataline_acid_test.sh" - ], "dependencies": { "env-paths": "^2.2.0", "exponential-backoff": "^3.1.1",