Skip to content

Commit

Permalink
Ignore script test files in published package
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tombruijn committed Feb 9, 2022
1 parent 6931eb0 commit 178b49a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/nodejs/.changesets/do-not-ship-test-files.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions packages/nodejs/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!/dist/**/*
!/scripts/**/*
scripts/**/*.test.js
!/ext/appsignal_extension.cpp
!/cert/**/*
!binding.gyp
Expand Down

0 comments on commit 178b49a

Please sign in to comment.