From bff7fe18cb29f19a4cd3f9e3d6d470141bba5c74 Mon Sep 17 00:00:00 2001 From: joshwooding <12938082+joshwooding@users.noreply.github.com> Date: Tue, 15 Nov 2022 00:15:28 +0000 Subject: [PATCH] Remove explicit README and LICENSE from files array --- .changeset/tall-turtles-think.md | 10 ++++++++++ packages/modular-scripts/src/__tests__/build.test.ts | 2 -- packages/modular-scripts/src/__tests__/index.test.ts | 6 ------ .../src/build/buildPackage/makeBundle.ts | 6 ++++-- packages/modular-template-app/package.json | 1 - packages/modular-template-esm-view/package.json | 1 - packages/modular-template-node-env-app/package.json | 1 - packages/modular-template-package/package.json | 1 - packages/modular-template-view/package.json | 1 - 9 files changed, 14 insertions(+), 15 deletions(-) create mode 100644 .changeset/tall-turtles-think.md diff --git a/.changeset/tall-turtles-think.md b/.changeset/tall-turtles-think.md new file mode 100644 index 000000000..2b01ad9b3 --- /dev/null +++ b/.changeset/tall-turtles-think.md @@ -0,0 +1,10 @@ +--- +'modular-scripts': patch +'modular-template-app': patch +'modular-template-esm-view': patch +'modular-template-node-env-app': patch +'modular-template-package': patch +'modular-template-view': patch +--- + +Remove explicit package.json and license entry in files array diff --git a/packages/modular-scripts/src/__tests__/build.test.ts b/packages/modular-scripts/src/__tests__/build.test.ts index 9bac999e5..a43f66b27 100644 --- a/packages/modular-scripts/src/__tests__/build.test.ts +++ b/packages/modular-scripts/src/__tests__/build.test.ts @@ -32,8 +32,6 @@ describe('WHEN building with preserve modules', () => { "dist-cjs", "dist-es", "dist-types", - "README.md", - "LICENSE", ], "main": "dist-cjs/index.js", "modular": Object { diff --git a/packages/modular-scripts/src/__tests__/index.test.ts b/packages/modular-scripts/src/__tests__/index.test.ts index b06ae202e..9fd13d49a 100644 --- a/packages/modular-scripts/src/__tests__/index.test.ts +++ b/packages/modular-scripts/src/__tests__/index.test.ts @@ -209,8 +209,6 @@ describe('modular-scripts', () => { "dist-cjs", "dist-es", "dist-types", - "README.md", - "LICENSE", ], "main": "dist-cjs/index.js", "modular": Object { @@ -363,8 +361,6 @@ describe('modular-scripts', () => { "dist-cjs", "dist-es", "dist-types", - "README.md", - "LICENSE", ], "main": "dist-cjs/index.js", "modular": Object { @@ -446,8 +442,6 @@ describe('modular-scripts', () => { "dist-cjs", "dist-es", "dist-types", - "README.md", - "LICENSE", ], "main": "dist-cjs/nested-sample-package.cjs.js", "modular": Object { diff --git a/packages/modular-scripts/src/build/buildPackage/makeBundle.ts b/packages/modular-scripts/src/build/buildPackage/makeBundle.ts index 6b74c6fc9..48e2c1b0b 100644 --- a/packages/modular-scripts/src/build/buildPackage/makeBundle.ts +++ b/packages/modular-scripts/src/build/buildPackage/makeBundle.ts @@ -307,13 +307,15 @@ export async function makeBundle( ...packageJson.dependencies, ...localImports, }, + /** + * Certain files are always included, regardless of settings. + * https://docs.npmjs.com/cli/v9/configuring-npm/package-json#files + */ files: distinct([ ...(packageJson.files || []), 'dist-cjs', 'dist-es', 'dist-types', - 'README.md', - 'LICENSE', ]), }; } diff --git a/packages/modular-template-app/package.json b/packages/modular-template-app/package.json index 073faa940..6b935206c 100644 --- a/packages/modular-template-app/package.json +++ b/packages/modular-template-app/package.json @@ -10,7 +10,6 @@ }, "license": "Apache-2.0", "files": [ - "README.md", "public", "src" ] diff --git a/packages/modular-template-esm-view/package.json b/packages/modular-template-esm-view/package.json index be8f8dfee..a88da6ac0 100644 --- a/packages/modular-template-esm-view/package.json +++ b/packages/modular-template-esm-view/package.json @@ -10,7 +10,6 @@ }, "license": "Apache-2.0", "files": [ - "README.md", "src" ] } diff --git a/packages/modular-template-node-env-app/package.json b/packages/modular-template-node-env-app/package.json index cda985f6e..d9bc62f93 100644 --- a/packages/modular-template-node-env-app/package.json +++ b/packages/modular-template-node-env-app/package.json @@ -14,7 +14,6 @@ }, "license": "Apache-2.0", "files": [ - "README.md", "public", "src" ] diff --git a/packages/modular-template-package/package.json b/packages/modular-template-package/package.json index 4ec33c070..3d4c74a80 100644 --- a/packages/modular-template-package/package.json +++ b/packages/modular-template-package/package.json @@ -11,7 +11,6 @@ }, "license": "Apache-2.0", "files": [ - "README.md", "src" ] } diff --git a/packages/modular-template-view/package.json b/packages/modular-template-view/package.json index 65ffb6443..f7010a9f1 100644 --- a/packages/modular-template-view/package.json +++ b/packages/modular-template-view/package.json @@ -11,7 +11,6 @@ "templateType": "view" }, "files": [ - "README.md", "src" ] }