Skip to content

Commit

Permalink
fix(publish): fix files field in package.json files to ensure app…
Browse files Browse the repository at this point in the history
…ropriate files are published (#311)

There is a difference between the file published by the `pnpm publish` command and the `npm publish` command.
For this reason, fixed the `files` field in `package.json` files.

+ Include `CHANGELOG.md` files
    The `npm publish` command will always be included, but the `pnpm publish` command will be excluded if not specified.
+ Don't include `*.tsbuildinfo` files
    The Glob pattern parsing of the `pnpm publish` command seems to be broken and will not exclude files in subdirectories unless globstar ( `**/...` ) is added.
  • Loading branch information
sounisi5011 authored Dec 9, 2021
1 parent 004318d commit 99fc7fe
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/check-pid-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"types": "./dist/index.d.ts",
"files": [
"dist/",
"!*.tsbuildinfo"
"**/CHANGELOG.md",
"!**/*.tsbuildinfo"
],
"scripts": {
"build": "tsc -p ./src/",
Expand Down
3 changes: 2 additions & 1 deletion packages/cli-utils/top-level-await-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"files": [
"dist/",
"src/",
"!*.tsbuildinfo",
"**/CHANGELOG.md",
"!**/*.tsbuildinfo",
"!tsconfig.json"
],
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/run-if-supported/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@
},
"files": [
"dist/",
"**/CHANGELOG.md",
"cli.js",
"!*.d.ts",
"!*.tsbuildinfo"
"!**/*.d.ts",
"!**/*.tsbuildinfo"
],
"scripts": {
"build": "tsc -p ./src/",
Expand Down
3 changes: 2 additions & 1 deletion packages/encrypted-archive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@
},
"files": [
"dist/",
"**/CHANGELOG.md",
"runkit-example.js",
"!*.tsbuildinfo"
"!**/*.tsbuildinfo"
],
"scripts": {
"build": "run-p build:*",
Expand Down
3 changes: 2 additions & 1 deletion packages/jest-matchers/binary-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"types": "./dist/index.d.ts",
"files": [
"dist/",
"!*.tsbuildinfo"
"**/CHANGELOG.md",
"!**/*.tsbuildinfo"
],
"scripts": {
"build": "tsc -p ./src/",
Expand Down
1 change: 1 addition & 0 deletions packages/stream-transform-from/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"files": [
"dist/",
"src/",
"**/CHANGELOG.md",
"examples/index.js"
],
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions packages/ts-type-utils/has-own-property/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"author": "sounisi5011",
"types": "./index.d.ts",
"files": [
"**/CHANGELOG.md",
"index.d.ts"
],
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions packages/ts-type-utils/is-readonly-array/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"author": "sounisi5011",
"types": "./index.d.ts",
"files": [
"**/CHANGELOG.md",
"index.d.ts"
],
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion packages/ts-utils/is-property-accessible/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"types": "./dist/index.d.ts",
"files": [
"dist/",
"!*.tsbuildinfo"
"**/CHANGELOG.md",
"!**/*.tsbuildinfo"
],
"scripts": {
"build": "run-p build:*",
Expand Down

0 comments on commit 99fc7fe

Please sign in to comment.