From 26e84f2ffd8594089e62e3cf4a366f1d4dbb4379 Mon Sep 17 00:00:00 2001 From: Colin Casey Date: Fri, 23 Feb 2024 13:04:47 -0400 Subject: [PATCH 1/2] Fix allow listed `files` for what to include in npm package When #296 was merged, the list of files to include in `package.json` was not updated. This PR fixes that. The `.npmignore` file is also removed because I find it causes some unexpected behaviors like ignoring the contents of `.gitignore`. It's a bit of extra work to maintain the allow listed `files` but it's generally safer. --- .npmignore | 5 ----- package.json | 4 +++- 2 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 .npmignore diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 460a9558..00000000 --- a/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -docker-compose.yml -Dockerfile -.nyc_output -coverage -package-lock.json diff --git a/package.json b/package.json index 74be9da4..366cb0a5 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,9 @@ "types": "./dist/cookie/index.d.ts", "files": [ "dist/*.js", - "dist/*.d.ts" + "dist/*.d.ts", + "dist/cookie/*.js", + "dist/cookie/*.d.ts" ], "scripts": { "build": "npm run clean && tsc", From 02f27cbaa5030359709db85c0e3ab4936c6fc0cc Mon Sep 17 00:00:00 2001 From: Colin Casey Date: Thu, 29 Feb 2024 10:20:12 -0400 Subject: [PATCH 2/2] Fix allow listed `files` for what to include in npm package When #296 was merged, the list of files to include in `package.json` was not updated. This PR fixes that. The `.npmignore` file is also removed because I find it causes some unexpected behaviors like ignoring the contents of `.gitignore`. It's a bit of extra work to maintain the allow listed `files` but it's generally safer. --- package.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 366cb0a5..9744d294 100644 --- a/package.json +++ b/package.json @@ -79,10 +79,9 @@ "main": "./dist/cookie/index.js", "types": "./dist/cookie/index.d.ts", "files": [ - "dist/*.js", - "dist/*.d.ts", - "dist/cookie/*.js", - "dist/cookie/*.d.ts" + "dist/**/*.js", + "dist/**/*.d.ts", + "!__tests__" ], "scripts": { "build": "npm run clean && tsc",