Skip to content

Commit 2a09fd6

Browse files
authored
chore: lerna optimizations (#7057)
1 parent 8ef71d1 commit 2a09fd6

File tree

29 files changed

+573
-1002
lines changed

29 files changed

+573
-1002
lines changed

.yarnrc

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
workspaces-experimental true
2-
env:
3-
NODE_OPTIONS --stack-trace-limit=10000
1+
env: NODE_OPTIONS --stack-trace-limit=10000

CONTRIBUTING.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ To run the test suite and our code linter, node.js and yarn are required.
1616
[`node` download](https://nodejs.org/download)
1717
[`yarn` download](https://yarnpkg.com/en/docs/install)
1818

19-
`sentry-javascript` is a monorepo containing several packages, and we use `lerna` to manage them. To get started, install all dependencies, use `lerna` to bootstrap the workspace, and then perform an initial build, so TypeScript can read all of the linked type definitions.
19+
`sentry-javascript` is a monorepo containing several packages, and we use `lerna` to manage them. To get started, install all dependencies, and then perform an initial build, so TypeScript can read all of the linked type definitions.
2020

2121
```
2222
$ yarn
23-
$ yarn lerna bootstrap
2423
$ yarn build
2524
```
2625

lerna.json

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
33
"version": "7.36.0",
4-
"packages": [
5-
"packages/*"
6-
],
74
"npmClient": "yarn",
85
"useWorkspaces": true
96
}

nx.json

+14-24
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,44 @@
66
"cacheableOperations": [
77
"build:bundle",
88
"build:transpile",
9-
"build:types"
9+
"build:types",
10+
"lint:eslint"
1011
]
1112
}
1213
}
1314
},
1415
"namedInputs": {
16+
"default": ["{projectRoot}/**/*", "sharedGlobals"],
1517
"sharedGlobals": [
1618
"{workspaceRoot}/*.js",
17-
"{workspaceRoot}/*.json",
18-
"{workspaceRoot}/yarn.lock"
19+
"{workspaceRoot}/*.json"
1920
],
20-
"default": [
21-
"{projectRoot}/**/*",
22-
"sharedGlobals",
21+
"production": [
22+
"default",
2323
"!{projectRoot}/test/**/*",
2424
"!{projectRoot}/**/*.md"
2525
]
2626
},
2727
"targetDefaults": {
2828
"build:bundle": {
29+
"inputs": ["production", "^production"],
2930
"dependsOn": [
30-
"^build:transpile",
3131
"build:transpile"
3232
],
3333
"outputs": [
3434
"{projectRoot}/build/bundles"
3535
]
3636
},
3737
"build:tarball": {
38+
"inputs": ["production", "^production"],
3839
"dependsOn": [
39-
"^build:transpile",
4040
"build:transpile",
41-
"^build:types",
4241
"build:types"
4342
],
4443
"outputs": []
4544
},
4645
"build:transpile": {
46+
"inputs": ["production", "^production"],
4747
"dependsOn": [
4848
"^build:transpile:uncached",
4949
"^build:transpile",
@@ -56,28 +56,18 @@
5656
]
5757
},
5858
"build:types": {
59+
"inputs": ["production", "^production"],
5960
"dependsOn": [
6061
"^build:types"
6162
],
6263
"outputs": [
6364
"{projectRoot}/build/types",
6465
"{projectRoot}/build/npm/types"
6566
]
66-
}
67-
},
68-
"targets": {
69-
"@sentry/serverless": {
70-
"build:bundle": {
71-
"dependsOn": [
72-
"^build:transpile",
73-
"build:transpile",
74-
"^build:types",
75-
"build:types"
76-
],
77-
"outputs": [
78-
"{projectRoot}/build/aws"
79-
]
80-
}
67+
},
68+
"lint:eslint": {
69+
"inputs": ["default"],
70+
"outputs": []
8171
}
8272
}
8373
}

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"private": true,
33
"scripts": {
4-
"build": "node ./scripts/verify-packages-versions.js && run-s build:types build:transpile build:bundle",
4+
"build": "node ./scripts/verify-packages-versions.js && lerna run build:types,build:transpile,build:bundle",
55
"build:bundle": "lerna run build:bundle",
6-
"build:dev": "run-s build:types build:transpile",
6+
"build:dev": "lerna run build:types,build:transpile",
77
"build:dev:filter": "lerna run build:dev --include-filtered-dependencies --include-filtered-dependents --scope",
88
"build:transpile": "lerna run build:transpile",
99
"build:types": "lerna run build:types",
@@ -85,7 +85,7 @@
8585
"jsdom": "^19.0.0",
8686
"karma-browserstack-launcher": "^1.5.1",
8787
"karma-firefox-launcher": "^1.1.0",
88-
"lerna": "^6.0.3",
88+
"lerna": "6.5.0-alpha.2",
8989
"madge": "4.0.2",
9090
"magic-string": "^0.27.0",
9191
"mocha": "^6.1.4",

packages/angular/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"fix:eslint": "eslint . --format stylish --fix",
5555
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
5656
"lint": "run-s lint:prettier lint:eslint",
57-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
57+
"lint:eslint": "eslint . --format stylish",
5858
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
5959
"test": "yarn test:unit",
6060
"test:unit": "jest",

packages/browser/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"fix:eslint": "eslint . --format stylish --fix",
6262
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
6363
"lint": "run-s lint:prettier lint:eslint",
64-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
64+
"lint:eslint": "eslint . --format stylish",
6565
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
6666
"size:check": "run-p size:check:es5 size:check:es6",
6767
"size:check:es5": "cat build/bundles/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",

packages/core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"fix:eslint": "eslint . --format stylish --fix",
3737
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
3838
"lint": "run-s lint:prettier lint:eslint",
39-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
39+
"lint:eslint": "eslint . --format stylish",
4040
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
4141
"test": "jest",
4242
"test:watch": "jest --watch",

packages/e2e-tests/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"fix:eslint": "eslint . --format stylish --fix",
1212
"fix:prettier": "prettier --config ../../.prettierrc.json --write . ",
1313
"lint": "run-s lint:prettier lint:eslint",
14-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
14+
"lint:eslint": "eslint . --format stylish",
1515
"lint:prettier": "prettier --config ../../.prettierrc.json --check .",
1616
"test:e2e": "run-s test:validate-configuration test:validate-test-app-setups test:run",
1717
"test:run": "ts-node run.ts",

packages/eslint-plugin-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"fix:eslint": "eslint . --format stylish --fix",
3131
"fix:prettier": "prettier --write \"{src,test}/**/*.js\"",
3232
"lint": "run-s lint:prettier lint:eslint",
33-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
33+
"lint:eslint": "eslint . --format stylish",
3434
"lint:prettier": "prettier --check \"{src,test}/**/*.js\"",
3535
"test": "mocha test --recursive",
3636
"build:tarball": "npm pack",

packages/gatsby/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"fix:eslint": "eslint . --format stylish --fix",
5353
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
5454
"lint": "run-s lint:prettier lint:eslint",
55-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
55+
"lint:eslint": "eslint . --format stylish",
5656
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
5757
"test": "yarn ts-node scripts/pretest.ts && yarn jest",
5858
"test:watch": "yarn ts-node scripts/pretest.ts && yarn jest --watch"

packages/hub/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"fix:eslint": "eslint . --format stylish --fix",
3838
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
3939
"lint": "run-s lint:prettier lint:eslint",
40-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
40+
"lint:eslint": "eslint . --format stylish",
4141
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
4242
"test": "jest",
4343
"test:watch": "jest --watch"

packages/integration-tests/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"clean": "rimraf -g suites/**/dist",
1212
"install-browsers": "playwright install --with-deps",
1313
"lint": "run-s lint:prettier lint:eslint",
14-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
14+
"lint:eslint": "eslint . --format stylish",
1515
"lint:prettier": "prettier --check \"{suites,utils}/**/*.ts\"",
1616
"fix": "run-s fix:eslint fix:prettier",
1717
"fix:eslint": "eslint . --format stylish --fix",

packages/integrations/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"fix:eslint": "eslint . --format stylish --fix",
4242
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
4343
"lint": "run-s lint:prettier lint:eslint",
44-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
44+
"lint:eslint": "eslint . --format stylish",
4545
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
4646
"test": "jest",
4747
"test:watch": "jest --watch"

packages/nextjs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"fix:eslint": "eslint . --format stylish --fix",
6262
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
6363
"lint": "run-s lint:prettier lint:eslint",
64-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
64+
"lint:eslint": "eslint . --format stylish",
6565
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
6666
"test": "yarn test:unit",
6767
"test:all": "run-s test:unit test:integration test:build",

packages/node-integration-tests/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"clean": "rimraf -g **/node_modules",
1111
"prisma:init": "(cd suites/tracing/prisma-orm && ts-node ./setup.ts)",
1212
"lint": "run-s lint:prettier lint:eslint",
13-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
13+
"lint:eslint": "eslint . --format stylish",
1414
"lint:prettier": "prettier --check \"{suites,utils}/**/*.ts\"",
1515
"fix": "run-s fix:eslint fix:prettier",
1616
"fix:eslint": "eslint . --format stylish --fix",

packages/node/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"fix:eslint": "eslint . --format stylish --fix",
4949
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
5050
"lint": "run-s lint:prettier lint:eslint",
51-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
51+
"lint:eslint": "eslint . --format stylish",
5252
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
5353
"test": "run-s test:jest test:express test:webpack test:release-health",
5454
"test:express": "node test/manual/express-scope-separation/start.js",

packages/opentelemetry-node/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"fix:eslint": "eslint . --format stylish --fix",
5252
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
5353
"lint": "run-s lint:prettier lint:eslint",
54-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
54+
"lint:eslint": "eslint . --format stylish",
5555
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
5656
"test": "yarn test:jest",
5757
"test:jest": "jest",

packages/react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"fix:eslint": "eslint . --format stylish --fix",
6767
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
6868
"lint": "run-s lint:prettier lint:eslint",
69-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
69+
"lint:eslint": "eslint . --format stylish",
7070
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
7171
"test": "jest",
7272
"test:watch": "jest --watch"

packages/remix/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"fix:eslint": "eslint . --format stylish --fix",
6060
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
6161
"lint": "run-s lint:prettier lint:eslint",
62-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
62+
"lint:eslint": "eslint . --format stylish",
6363
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
6464
"test": "yarn test:unit",
6565
"test:integration": "run-s test:integration:clean test:integration:prepare test:integration:client test:integration:server",

packages/replay/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"fix:eslint": "eslint . --format stylish --fix",
2828
"fix:prettier": "prettier --write \"{src,test,scripts,worker}/**/*.ts\"",
2929
"lint": "run-s lint:prettier lint:eslint",
30-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
30+
"lint:eslint": "eslint . --format stylish",
3131
"lint:prettier": "prettier --check \"{src,test,scripts,worker}/**/*.ts\"",
3232
"test": "jest",
3333
"test:watch": "jest --watch",

packages/serverless/package.json

+15-2
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,26 @@
5454
"fix:eslint": "eslint . --format stylish --fix",
5555
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
5656
"lint": "run-s lint:prettier lint:eslint",
57-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
57+
"lint:eslint": "eslint . --format stylish",
5858
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
5959
"test": "jest",
6060
"test:watch": "jest --watch"
6161
},
6262
"volta": {
6363
"extends": "../../package.json"
6464
},
65-
"sideEffects": false
65+
"sideEffects": false,
66+
"nx": {
67+
"targets": {
68+
"build:bundle": {
69+
"dependsOn": [
70+
"build:transpile",
71+
"build:types"
72+
],
73+
"outputs": [
74+
"{projectRoot}/build/aws"
75+
]
76+
}
77+
}
78+
}
6679
}

packages/svelte/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"fix:eslint": "eslint . --format stylish --fix",
4747
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
4848
"lint": "run-s lint:prettier lint:eslint",
49-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
49+
"lint:eslint": "eslint . --format stylish",
5050
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
5151
"test": "jest",
5252
"test:watch": "jest --watch"

packages/tracing/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"fix:eslint": "eslint . --format stylish --fix",
4444
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
4545
"lint": "run-s lint:prettier lint:eslint",
46-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
46+
"lint:eslint": "eslint . --format stylish",
4747
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
4848
"test": "jest",
4949
"test:watch": "jest --watch"

packages/types/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build",
2828
"clean": "rimraf build sentry-types-*.tgz",
2929
"lint": "run-s lint:prettier lint:eslint",
30-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
30+
"lint:eslint": "eslint . --format stylish",
3131
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
3232
"fix": "run-s fix:eslint fix:prettier",
3333
"fix:eslint": "eslint . --format stylish --fix",

packages/utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"fix:eslint": "eslint . --format stylish --fix",
4242
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
4343
"lint": "run-s lint:prettier lint:eslint",
44-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
44+
"lint:eslint": "eslint . --format stylish",
4545
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
4646
"test": "jest",
4747
"test:watch": "jest --watch",

packages/vue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"fix:eslint": "eslint . --format stylish --fix",
4747
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
4848
"lint": "run-s lint:prettier lint:eslint",
49-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
49+
"lint:eslint": "eslint . --format stylish",
5050
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
5151
"test": "jest",
5252
"test:watch": "jest --watch"

packages/wasm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"fix:eslint": "eslint . --format stylish --fix",
4747
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
4848
"lint": "run-s lint:prettier lint:eslint",
49-
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
49+
"lint:eslint": "eslint . --format stylish",
5050
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
5151
"test": "node test/scripts/ensure-bundles.js && cross-env PORT=1337 jest",
5252
"test:watch": "jest --watch"

0 commit comments

Comments
 (0)