Skip to content

Commit

Permalink
chore: lerna optimizations (#7057)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry authored Feb 8, 2023
1 parent 8ef71d1 commit 2a09fd6
Show file tree
Hide file tree
Showing 29 changed files with 573 additions and 1,002 deletions.
4 changes: 1 addition & 3 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
workspaces-experimental true
env:
NODE_OPTIONS --stack-trace-limit=10000
env: NODE_OPTIONS --stack-trace-limit=10000
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ To run the test suite and our code linter, node.js and yarn are required.
[`node` download](https://nodejs.org/download)
[`yarn` download](https://yarnpkg.com/en/docs/install)

`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.
`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.

```
$ yarn
$ yarn lerna bootstrap
$ yarn build
```

Expand Down
3 changes: 0 additions & 3 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "7.36.0",
"packages": [
"packages/*"
],
"npmClient": "yarn",
"useWorkspaces": true
}
38 changes: 14 additions & 24 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,44 @@
"cacheableOperations": [
"build:bundle",
"build:transpile",
"build:types"
"build:types",
"lint:eslint"
]
}
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": [
"{workspaceRoot}/*.js",
"{workspaceRoot}/*.json",
"{workspaceRoot}/yarn.lock"
"{workspaceRoot}/*.json"
],
"default": [
"{projectRoot}/**/*",
"sharedGlobals",
"production": [
"default",
"!{projectRoot}/test/**/*",
"!{projectRoot}/**/*.md"
]
},
"targetDefaults": {
"build:bundle": {
"inputs": ["production", "^production"],
"dependsOn": [
"^build:transpile",
"build:transpile"
],
"outputs": [
"{projectRoot}/build/bundles"
]
},
"build:tarball": {
"inputs": ["production", "^production"],
"dependsOn": [
"^build:transpile",
"build:transpile",
"^build:types",
"build:types"
],
"outputs": []
},
"build:transpile": {
"inputs": ["production", "^production"],
"dependsOn": [
"^build:transpile:uncached",
"^build:transpile",
Expand All @@ -56,28 +56,18 @@
]
},
"build:types": {
"inputs": ["production", "^production"],
"dependsOn": [
"^build:types"
],
"outputs": [
"{projectRoot}/build/types",
"{projectRoot}/build/npm/types"
]
}
},
"targets": {
"@sentry/serverless": {
"build:bundle": {
"dependsOn": [
"^build:transpile",
"build:transpile",
"^build:types",
"build:types"
],
"outputs": [
"{projectRoot}/build/aws"
]
}
},
"lint:eslint": {
"inputs": ["default"],
"outputs": []
}
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"private": true,
"scripts": {
"build": "node ./scripts/verify-packages-versions.js && run-s build:types build:transpile build:bundle",
"build": "node ./scripts/verify-packages-versions.js && lerna run build:types,build:transpile,build:bundle",
"build:bundle": "lerna run build:bundle",
"build:dev": "run-s build:types build:transpile",
"build:dev": "lerna run build:types,build:transpile",
"build:dev:filter": "lerna run build:dev --include-filtered-dependencies --include-filtered-dependents --scope",
"build:transpile": "lerna run build:transpile",
"build:types": "lerna run build:types",
Expand Down Expand Up @@ -85,7 +85,7 @@
"jsdom": "^19.0.0",
"karma-browserstack-launcher": "^1.5.1",
"karma-firefox-launcher": "^1.1.0",
"lerna": "^6.0.3",
"lerna": "6.5.0-alpha.2",
"madge": "4.0.2",
"magic-string": "^0.27.0",
"mocha": "^6.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "yarn test:unit",
"test:unit": "jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"size:check": "run-p size:check:es5 size:check:es6",
"size:check:es5": "cat build/bundles/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "jest",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --config ../../.prettierrc.json --write . ",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --config ../../.prettierrc.json --check .",
"test:e2e": "run-s test:validate-configuration test:validate-test-app-setups test:run",
"test:run": "ts-node run.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test}/**/*.js\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test}/**/*.js\"",
"test": "mocha test --recursive",
"build:tarball": "npm pack",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "yarn ts-node scripts/pretest.ts && yarn jest",
"test:watch": "yarn ts-node scripts/pretest.ts && yarn jest --watch"
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "jest",
"test:watch": "jest --watch"
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"clean": "rimraf -g suites/**/dist",
"install-browsers": "playwright install --with-deps",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{suites,utils}/**/*.ts\"",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "jest",
"test:watch": "jest --watch"
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "yarn test:unit",
"test:all": "run-s test:unit test:integration test:build",
Expand Down
2 changes: 1 addition & 1 deletion packages/node-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"clean": "rimraf -g **/node_modules",
"prisma:init": "(cd suites/tracing/prisma-orm && ts-node ./setup.ts)",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{suites,utils}/**/*.ts\"",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "run-s test:jest test:express test:webpack test:release-health",
"test:express": "node test/manual/express-scope-separation/start.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "yarn test:jest",
"test:jest": "jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "jest",
"test:watch": "jest --watch"
Expand Down
2 changes: 1 addition & 1 deletion packages/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "yarn test:unit",
"test:integration": "run-s test:integration:clean test:integration:prepare test:integration:client test:integration:server",
Expand Down
2 changes: 1 addition & 1 deletion packages/replay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts,worker}/**/*.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts,worker}/**/*.ts\"",
"test": "jest",
"test:watch": "jest --watch",
Expand Down
17 changes: 15 additions & 2 deletions packages/serverless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,26 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "jest",
"test:watch": "jest --watch"
},
"volta": {
"extends": "../../package.json"
},
"sideEffects": false
"sideEffects": false,
"nx": {
"targets": {
"build:bundle": {
"dependsOn": [
"build:transpile",
"build:types"
],
"outputs": [
"{projectRoot}/build/aws"
]
}
}
}
}
2 changes: 1 addition & 1 deletion packages/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "jest",
"test:watch": "jest --watch"
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "jest",
"test:watch": "jest --watch"
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build:tarball": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"clean": "rimraf build sentry-types-*.tgz",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "jest",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "jest",
"test:watch": "jest --watch"
Expand Down
2 changes: 1 addition & 1 deletion packages/wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/**.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"test": "node test/scripts/ensure-bundles.js && cross-env PORT=1337 jest",
"test:watch": "jest --watch"
Expand Down
Loading

0 comments on commit 2a09fd6

Please sign in to comment.