From 178b49ac0bef06cbf8915e7727a82c69a142372d Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Wed, 9 Feb 2022 09:43:14 +0100 Subject: [PATCH] Ignore script test files in published package When we publish a new version of the `@appsignal/nodejs` package the test files for the extension install script were also included. Some time ago there were no tests for this so it wasn't an issue, but now that we have tests we need to explicitly ignore them in `.npmignore` to not package them in the new published versions. The output of `npm pack` before this change: ``` 822B scripts/extension/__tests__/extension.failure.test.js 3.9kB scripts/extension/__tests__/extension.test.js 3.8kB scripts/extension/__tests__/report.test.js 7.1kB scripts/extension/extension.js 2.0kB scripts/extension/report.js 2.5kB scripts/extension/support/constants.js 1.3kB scripts/extension/support/helpers.js ``` The output of `npm pack` after this change: ``` 7.1kB scripts/extension/extension.js 2.0kB scripts/extension/report.js 2.5kB scripts/extension/support/constants.js 1.3kB scripts/extension/support/helpers.js ``` Fixes #596 --- packages/nodejs/.changesets/do-not-ship-test-files.md | 6 ++++++ packages/nodejs/.npmignore | 1 + 2 files changed, 7 insertions(+) create mode 100644 packages/nodejs/.changesets/do-not-ship-test-files.md diff --git a/packages/nodejs/.changesets/do-not-ship-test-files.md b/packages/nodejs/.changesets/do-not-ship-test-files.md new file mode 100644 index 00000000..eaf1763a --- /dev/null +++ b/packages/nodejs/.changesets/do-not-ship-test-files.md @@ -0,0 +1,6 @@ +--- +bump: "patch" +type: "remove" +--- + +Do not ship the extension install script test files in the published package. Reduces the package size a tiny bit. diff --git a/packages/nodejs/.npmignore b/packages/nodejs/.npmignore index b4549ed4..15186f27 100644 --- a/packages/nodejs/.npmignore +++ b/packages/nodejs/.npmignore @@ -1,6 +1,7 @@ * !/dist/**/* !/scripts/**/* +scripts/**/*.test.js !/ext/appsignal_extension.cpp !/cert/**/* !binding.gyp