Skip to content

Commit

Permalink
npmignore: Don't include the source of tests (#5799)
Browse files Browse the repository at this point in the history
We know of no reason that including the source of tests in built npm
packages would be helpful, and we've heard reports that including the
RSA private key fixture as we do in apollo-server-core can trigger
security scans.

Change how we drop tests from "dist" to drop the whole test directory in
case some other files sneak in there.

Add a comment to the one npmignore file that differs from the others.

Fixes #5781.
  • Loading branch information
glasser authored Oct 8, 2021
1 parent 0d31e0c commit 61695f1
Show file tree
Hide file tree
Showing 23 changed files with 49 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The version headers in this history reflect the versions of Apollo Server itself
- `[email protected]`: When choosing whether or not to parse a response as JSON, treat any `content-type` ending in `+json` as JSON rather than just `application/hal+json` (in addition to `application/json`). [PR #5737](https://github.com/apollographql/apollo-server/pull/5737)
- `apollo-server`: You can now configure the health check URL path with the `healthCheckPath` constructor option, or disable serving health checks by passing `null` for this option. (This option is specific to the batteries-included `apollo-server` package; if you're using a framework integration package and want to serve a health check at a different path, just use your web framework directly.) [PR #5270](https://github.com/apollographql/apollo-server/pull/5270) [Issue #3577](https://github.com/apollographql/apollo-server/issues/3577)
- `apollo-server-azure-functions`: This package now supports health checks like all of the other supported Apollo Server packages; they are on by default and can be customized with `disableHealthCheck` and `onHealthCheck`. [PR #5003](https:// github.com/apollographql/apollo-server/pull/5003) [Issue #4925](https://github.com/apollographql/apollo-server/issues/4925)
- Tests are no longer distributed inside published npm modules. [PR #5799](https://github.com/apollographql/apollo-server/pull/5799) [Issue #5781](https://github.com/apollographql/apollo-server/issues/5781)

## v3.3.0

Expand Down
3 changes: 2 additions & 1 deletion packages/apollo-datasource-rest/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-datasource/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
7 changes: 6 additions & 1 deletion packages/apollo-reporting-protobuf/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Note that this npmignore file differs from the others because this package
# puts its generated files in "generated" and checks them in to git rather than
# unversioned in "dist".

*
!src/**/*
src/**/__tests__/**
!generated/**/*
generated/**/*.test.*
generated/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-azure-functions/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-cache-memcached/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-cache-redis/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-caching/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-cloud-functions/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-core/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-env/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-errors/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-express/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-fastify/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-hapi/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-integration-testsuite/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-koa/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-lambda/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-micro/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-plugin-base/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-plugin-response-cache/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server-types/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md
3 changes: 2 additions & 1 deletion packages/apollo-server/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*
!src/**/*
src/**/__tests__/**
!dist/**/*
dist/**/*.test.*
dist/**/__tests__/**
!package.json
!README.md

0 comments on commit 61695f1

Please sign in to comment.