Skip to content

Commit 29d5a16

Browse files
authored
ref(build): Rename pack npm scripts to build:npm (#4715)
* rename the `pack` npm scripts in all `package.json`s to `build:npm`. Previously, these `pack` scripts could cause confusion in connection with yarn, as `yarn pack` and `yarn run pack` would do different things: While running the former would trigger the pack command of yarn (as in `npm pack`), the latter would execute whatever is defined in the resp. `package.json` under `pack`. Up to recently, this difference was not noticeable in most SDKs because the `pack` npm script would simply be `npm pack`. However, given that we're moving everything build-related into its own `build` directory (#4688, #4641), the pack script must point to the `package.json` inside `build`. As a consequence, `yarn run pack` and `yarn pack` will behave differently which can cause confusion when creating a tarball. * `yarn (run) build:npm` will create an NPM package (tarball). Besides modifying all SDK `package.json`s, this PR also adjusts the packing script in the root-level `package.json` and hence in the the packaging command in the `build.yml` file. * The motivation for making this change emerged after a [conversation about adjusting `yarn pack` to `yarn run pack` ](#4641 (comment)) to get a correct tarball.
1 parent 2d26879 commit 29d5a16

File tree

22 files changed

+24
-30
lines changed

22 files changed

+24
-30
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ jobs:
298298
path: ${{ env.CACHED_BUILD_PATHS }}
299299
key: ${{ env.BUILD_CACHE_KEY }}
300300
- name: Pack
301-
run: yarn pack:changed
301+
run: yarn build:npm
302302
- name: Archive artifacts
303303
uses: actions/upload-artifact@v2
304304
with:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"build:watch": "lerna run --parallel build:watch",
1313
"build:dev:watch": "lerna run --parallel build:dev:watch",
1414
"build:types:watch": "ts-node scripts/build-types-watch.ts",
15+
"build:npm": "lerna run --parallel build:npm",
1516
"circularDepCheck": "lerna run --parallel circularDepCheck",
1617
"clean": "lerna run --parallel clean && lerna clean --yes",
1718
"codecov": "codecov",
1819
"fix": "lerna run --parallel fix",
1920
"link:yarn": "lerna run --stream --concurrency 1 link:yarn",
2021
"lint": "lerna run --parallel lint",
2122
"lint:eslint": "lerna run --parallel lint:eslint",
22-
"pack:changed": "lerna run pack --since",
2323
"prepublishOnly": "lerna run --stream --concurrency 1 prepublishOnly",
2424
"postpublish": "make publish-docs && lerna run --stream --concurrency 1 postpublish",
2525
"test": "lerna run --ignore @sentry-internal/browser-integration-tests --stream --concurrency 1 --sort test"

packages/angular/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
4646
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
4747
"build:types:watch": "tsc -p tsconfig.types.json --watch",
48+
"build:npm": "npm pack",
4849
"circularDepCheck": "madge --circular src/index.ts",
4950
"clean": "rimraf dist esm build coverage",
5051
"fix": "run-s fix:eslint fix:prettier",
@@ -53,8 +54,7 @@
5354
"link:yarn": "yarn link",
5455
"lint": "run-s lint:prettier lint:eslint",
5556
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
56-
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
57-
"pack": "npm pack"
57+
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\""
5858
},
5959
"volta": {
6060
"extends": "../../package.json"

packages/browser/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"build:dev:watch": "run-p build:cjs:watch build:esm:watch build:types:watch",
5959
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
6060
"build:types:watch": "tsc -p tsconfig.types.json --watch",
61+
"build:npm": "npm pack ./build",
6162
"circularDepCheck": "madge --circular src/index.ts",
6263
"clean": "rimraf build coverage .rpt2_cache",
6364
"fix": "run-s fix:eslint fix:prettier",
@@ -67,7 +68,6 @@
6768
"lint": "run-s lint:prettier lint:eslint",
6869
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
6970
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
70-
"pack": "npm pack ./build",
7171
"size:check": "run-p size:check:es5 size:check:es6",
7272
"size:check:es5": "cat build/bundles/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",
7373
"size:check:es6": "cat build/bundles/bundle.es6.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES6: \",$1,\"kB\";}'",

packages/core/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"build:dev:watch": "run-s build:watch",
3535
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
3636
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
37-
"build:types:watch": "tsc -p tsconfig.types.json --watch",
37+
"build:npm": "npm pack",
3838
"circularDepCheck": "madge --circular src/index.ts",
3939
"clean": "rimraf dist esm coverage",
4040
"fix": "run-s fix:eslint fix:prettier",
@@ -44,7 +44,6 @@
4444
"lint": "run-s lint:prettier lint:eslint",
4545
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
4646
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
47-
"pack": "npm pack",
4847
"test": "jest",
4948
"test:watch": "jest --watch",
5049
"version": "node ../../scripts/versionbump.js src/version.ts"

packages/ember/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@
1818
},
1919
"scripts": {
2020
"build": "ember build --environment=production",
21+
"build:npm": "ember ts:precompile && npm pack && ember ts:clean",
2122
"link:yarn": "yarn link",
2223
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
2324
"lint:hbs": "ember-template-lint .",
2425
"lint:js": "eslint . --cache --cache-location '../../eslintcache/'",
25-
"pack": "npm pack",
26-
"prepack": "ember ts:precompile",
27-
"postpack": "ember ts:clean",
2826
"start": "ember serve",
2927
"test": "ember try:each",
3028
"test:all": "node ./scripts/run-CI-tests.js"

packages/eslint-config-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"link:yarn": "yarn link",
4040
"lint": "prettier --check \"**/*.js\"",
4141
"fix": "prettier --write \"**/*.js\"",
42-
"pack": "npm pack",
42+
"build:npm": "npm pack",
4343
"circularDepCheck": "madge --circular src/index.js"
4444
},
4545
"volta": {

packages/eslint-plugin-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
3434
"lint:prettier": "prettier --check \"{src,test}/**/*.js\"",
3535
"test": "mocha test --recursive",
36-
"pack": "npm pack",
36+
"build:npm": "npm pack",
3737
"circularDepCheck": "madge --circular src/index.js"
3838
},
3939
"volta": {

packages/gatsby/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
5353
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
5454
"build:types:watch": "tsc -p tsconfig.types.json --watch",
55+
"build:npm": "npm pack",
5556
"circularDepCheck": "madge --circular src/index.ts",
5657
"clean": "rimraf dist esm build coverage",
5758
"fix": "run-s fix:eslint fix:prettier",
@@ -61,7 +62,6 @@
6162
"lint": "run-s lint:prettier lint:eslint",
6263
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
6364
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
64-
"pack": "npm pack",
6565
"test": "jest",
6666
"test:watch": "jest --watch"
6767
},

packages/hub/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"lint": "run-s lint:prettier lint:eslint",
4343
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
4444
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
45-
"pack": "npm pack",
45+
"build:npm": "npm pack",
4646
"test": "jest",
4747
"test:watch": "jest --watch"
4848
},

packages/integrations/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
3939
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
4040
"build:types:watch": "tsc -p tsconfig.types.json --watch",
41+
"build:npm": "npm pack",
4142
"circularDepCheck": "madge --circular src/index.ts",
4243
"clean": "rimraf dist esm build coverage .rpt2_cache",
4344
"fix": "run-s fix:eslint fix:prettier",
@@ -47,7 +48,6 @@
4748
"lint": "run-s lint:prettier lint:eslint",
4849
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
4950
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
50-
"pack": "npm pack",
5151
"test": "jest",
5252
"test:watch": "jest --watch"
5353
},

packages/minimal/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"lint": "run-s lint:prettier lint:eslint",
4343
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
4444
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
45-
"pack": "npm pack",
45+
"build:npm": "npm pack",
4646
"test": "jest",
4747
"test:watch": "jest --watch"
4848
},

packages/nextjs/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"build:dev:watch": "run-s build:watch",
5555
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
5656
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
57-
"build:types:watch": "tsc -p tsconfig.types.json --watch",
57+
"build:npm": "npm pack",
5858
"circularDepCheck": "madge --circular src/index.client.ts && madge --circular --exclude 'config/types\\.ts' src/index.server.ts # see https://github.com/pahen/madge/issues/306",
5959
"clean": "rimraf dist esm coverage *.js *.js.map *.d.ts",
6060
"fix": "run-s fix:eslint fix:prettier",
@@ -64,7 +64,6 @@
6464
"lint": "run-s lint:prettier lint:eslint",
6565
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
6666
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
67-
"pack": "npm pack",
6867
"test": "run-s test:unit",
6968
"test:all": "run-s test:unit test:integration",
7069
"test:unit": "jest",

packages/node/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
4747
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
4848
"build:types:watch": "tsc -p tsconfig.types.json --watch",
49+
"build:npm": "npm pack",
4950
"circularDepCheck": "madge --circular src/index.ts",
5051
"clean": "rimraf dist esm coverage",
5152
"fix": "run-s fix:eslint fix:prettier",
@@ -55,7 +56,6 @@
5556
"lint": "run-s lint:prettier lint:eslint",
5657
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
5758
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
58-
"pack": "npm pack",
5959
"test": "run-s test:jest test:express test:webpack test:release-health",
6060
"test:express": "node test/manual/express-scope-separation/start.js",
6161
"test:jest": "jest",

packages/react/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"build:dev:watch": "run-s build:watch",
6262
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
6363
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
64-
"build:types:watch": "tsc -p tsconfig.types.json --watch",
64+
"build:npm": "npm pack",
6565
"circularDepCheck": "madge --circular src/index.ts",
6666
"clean": "rimraf dist esm build coverage",
6767
"fix": "run-s fix:eslint fix:prettier",
@@ -71,7 +71,6 @@
7171
"lint": "run-s lint:prettier lint:eslint",
7272
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
7373
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
74-
"pack": "npm pack",
7574
"test": "jest",
7675
"test:watch": "jest --watch"
7776
},

packages/serverless/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"build:dev:watch": "run-s build:watch",
5252
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
5353
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
54-
"build:types:watch": "tsc -p tsconfig.types.json --watch",
54+
"build:npm": "npm pack",
5555
"circularDepCheck": "madge --circular src/index.ts",
5656
"clean": "rimraf dist esm build dist-awslambda-layer coverage",
5757
"fix": "run-s fix:eslint fix:prettier",
@@ -61,7 +61,6 @@
6161
"lint": "run-s lint:prettier lint:eslint",
6262
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
6363
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
64-
"pack": "npm pack",
6564
"test": "jest",
6665
"test:watch": "jest --watch"
6766
},

packages/tracing/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
4444
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
4545
"build:types:watch": "tsc -p tsconfig.types.json --watch",
46+
"build:npm": "npm pack",
4647
"clean": "rimraf dist esm build coverage",
4748
"circularDepCheck": "madge --circular src/index.ts",
4849
"fix": "run-s fix:eslint fix:prettier",
@@ -52,7 +53,6 @@
5253
"lint": "run-s lint:prettier lint:eslint",
5354
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
5455
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
55-
"pack": "npm pack",
5656
"test": "jest",
5757
"test:watch": "jest --watch"
5858
},

packages/types/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
2929
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
3030
"build:types:watch": "tsc -p tsconfig.types.json --watch",
31+
"build:npm": "npm pack",
3132
"link:yarn": "yarn link",
3233
"lint": "run-s lint:prettier lint:eslint",
3334
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
3435
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
3536
"fix": "run-s fix:eslint fix:prettier",
3637
"fix:eslint": "eslint . --format stylish --fix",
37-
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
38-
"pack": "npm pack"
38+
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\""
3939
},
4040
"volta": {
4141
"extends": "../../package.json"

packages/typescript/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"scripts": {
2222
"link:yarn": "yarn link",
23-
"pack": "npm pack"
23+
"build:npm": "npm pack"
2424
},
2525
"volta": {
2626
"extends": "../../package.json"

packages/utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
3737
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
3838
"build:types:watch": "tsc -p tsconfig.types.json --watch",
39+
"build:npm": "npm pack",
3940
"circularDepCheck": "madge --circular src/index.ts",
4041
"clean": "rimraf dist esm coverage *.js *.js.map *.d.ts",
4142
"fix": "run-s fix:eslint fix:prettier",
@@ -45,7 +46,6 @@
4546
"lint": "run-s lint:prettier lint:eslint",
4647
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
4748
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
48-
"pack": "npm pack",
4949
"test": "jest",
5050
"test:watch": "jest --watch",
5151
"test:package": "node test/types/index.js"

packages/vue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
4646
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
4747
"build:types:watch": "tsc -p tsconfig.types.json --watch",
48+
"build:npm": "npm pack",
4849
"circularDepCheck": "madge --circular src/index.ts",
4950
"clean": "rimraf dist esm build coverage",
5051
"fix": "run-s fix:eslint fix:prettier",
@@ -54,7 +55,6 @@
5455
"lint": "run-s lint:prettier lint:eslint",
5556
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
5657
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
57-
"pack": "npm pack",
5858
"test": "jest",
5959
"test:watch": "jest --watch"
6060
},

packages/wasm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
4343
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
4444
"build:types:watch": "tsc -p tsconfig.types.json --watch",
45+
"build:npm": "npm pack",
4546
"circularDepCheck": "madge --circular src/index.ts",
4647
"clean": "rimraf dist esm coverage *.js.map *.d.ts",
4748
"fix": "run-s fix:eslint fix:prettier",
@@ -51,7 +52,6 @@
5152
"lint": "run-s lint:prettier lint:eslint",
5253
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
5354
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
54-
"pack": "npm pack",
5555
"test": "node test/scripts/ensure-browser-bundle.js && cross-env PORT=1337 jest",
5656
"test:watch": "jest --watch"
5757
},

0 commit comments

Comments
 (0)