Skip to content

Commit 0a92a6d

Browse files
👷 Reduce packages boilerplate a bit more (#3957)
* 👷 replace lerna with 'yarn workspace' for building packages * 👷 replace `lerna run` with `yarn workspace foreach` for pack
1 parent d64e874 commit 0a92a6d

File tree

12 files changed

+9
-16
lines changed

12 files changed

+9
-16
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
"type": "module",
1212
"scripts": {
1313
"postinstall": "scripts/cli init_submodule",
14-
"build": "lerna run build --stream",
15-
"build:bundle": "lerna run build:bundle --stream",
14+
"build": "yarn workspaces foreach --all --parallel --topological run build",
15+
"build:bundle": "yarn workspaces foreach --all --parallel run build:bundle",
1616
"build:apps": "node scripts/build/build-test-apps.ts",
1717
"build:docs:json": "typedoc --logLevel Verbose --json ./docs.json",
1818
"build:docs:html": "typedoc --out ./docs",
19+
"pack": "yarn workspaces foreach --all --parallel --include '@datadog/*' exec yarn pack",
1920
"format": "prettier --check .",
2021
"lint": "NODE_OPTIONS='--max-old-space-size=4096' eslint .",
2122
"typecheck": "tsc -b --noEmit true",

packages/core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"types": "cjs/index.d.ts",
88
"sideEffects": false,
99
"scripts": {
10-
"pack": "yarn pack",
1110
"build": "node ../../scripts/build/build-package.ts --modules"
1211
},
1312
"repository": {

packages/flagging/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"module": "esm/entries/main.js",
77
"types": "cjs/entries/main.d.ts",
88
"scripts": {
9-
"pack": "yarn pack",
109
"build": "node ../../scripts/build/build-package.ts --modules --bundle datadog-flagging.js",
1110
"build:bundle": "node ../../scripts/build/build-package.ts --bundle datadog-flagging.js"
1211
},

packages/logs/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"module": "esm/entries/main.js",
77
"types": "cjs/entries/main.d.ts",
88
"scripts": {
9-
"pack": "yarn pack",
109
"build": "node ../../scripts/build/build-package.ts --modules --bundle datadog-logs.js",
1110
"build:bundle": "node ../../scripts/build/build-package.ts --bundle datadog-logs.js"
1211
},

packages/rum-core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"module": "esm/index.js",
77
"types": "cjs/index.d.ts",
88
"scripts": {
9-
"pack": "yarn pack",
109
"build": "node ../../scripts/build/build-package.ts --modules"
1110
},
1211
"dependencies": {

packages/rum-react/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"module": "esm/entries/main.js",
77
"types": "cjs/entries/main.d.ts",
88
"scripts": {
9-
"pack": "yarn pack",
109
"build": "node ../../scripts/build/build-package.ts --modules",
1110
"prepack": "npm run build"
1211
},

packages/rum-slim/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"module": "esm/entries/main.js",
77
"types": "cjs/entries/main.d.ts",
88
"scripts": {
9-
"pack": "yarn pack",
109
"build": "node ../../scripts/build/build-package.ts --modules --bundle datadog-rum-slim.js",
1110
"build:bundle": "node ../../scripts/build/build-package.ts --bundle datadog-rum-slim.js"
1211
},

packages/rum/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"module": "esm/entries/main.js",
77
"types": "cjs/entries/main.d.ts",
88
"scripts": {
9-
"pack": "yarn pack",
109
"build": "node ../../scripts/build/build-package.ts --modules --bundle datadog-rum.js",
1110
"build:bundle": "node ../../scripts/build/build-package.ts --bundle datadog-rum.js"
1211
},

packages/worker/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"license": "Apache-2.0",
55
"main": "bundle/worker.js",
66
"scripts": {
7-
"pack": "yarn pack",
87
"build": "node ../../scripts/build/build-package.ts --bundle worker.js",
98
"build:bundle": "yarn build"
109
},

scripts/build/build-test-apps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const OTHER_EXTENSIONS: Array<{ name: string; options?: { runAt?: string } }> =
1212

1313
runMain(async () => {
1414
printLog('Packing packages...')
15-
command`yarn lerna run pack`.run()
15+
command`yarn run pack`.run()
1616

1717
buildApp('test/apps/vanilla')
1818
buildApp('test/apps/react-router-v6-app')

0 commit comments

Comments
 (0)