Skip to content

Commit b9a1267

Browse files
authored
Ensure all NPM packages have readmes included in their builds (#2156)
## Motivation for the change, related issues This PR ensures all public package builds include a README.md file, because some of our NPM packages don't include a readme on the npmjs.com package page. The readmes exist in project folders, but before this PR they were not added to the built version of the package. ## Implementation details Add `build:README` step to these public packages: - @php-wasm/cli - @php-wasm/progress - @php-wasm/scopes - @php-wasm/web-service-worker - @wp-playground/blueprints - @wp-playground/cli - @wp-playground/client - @wp-playground/components - @wp-playground/remote - @wp-playground/sync ## Testing Instructions (or ideally a Blueprint) - Remove the `dist` folder if it exists - Run `npm run build` - Check that all PHP-wasm builds have a README.md ``` find dist/packages/php-wasm -mindepth 1 -maxdepth 1 -type d '!' -exec test -e '{}/README.md' \; -print ``` - The above command should only return `dist/packages/php-wasm/out-tsc-phpwasm-node` which isn't a package - Check that all Playground builds have a README.md ``` find dist/packages/playground -mindepth 1 -maxdepth 1 -type d '!' -exec test -e '{}/README.md' \; -print ``` - The above command should only return `dist/packages/playground/website` which isn't a published package
1 parent 9b76ef5 commit b9a1267

File tree

10 files changed

+128
-15
lines changed

10 files changed

+128
-15
lines changed

packages/php-wasm/cli/project.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
"projectType": "library",
66
"targets": {
77
"build": {
8+
"executor": "nx:noop",
9+
"dependsOn": ["build:README"]
10+
},
11+
"build:README": {
12+
"executor": "nx:run-commands",
13+
"options": {
14+
"commands": [
15+
"cp packages/php-wasm/cli/README.md dist/packages/php-wasm/cli"
16+
]
17+
},
18+
"dependsOn": ["build:package-json"]
19+
},
20+
"build:package-json": {
821
"executor": "@wp-playground/nx-extensions:package-json",
922
"options": {
1023
"tsConfig": "packages/php-wasm/cli/tsconfig.lib.json",

packages/php-wasm/progress/project.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
"projectType": "library",
66
"targets": {
77
"build": {
8+
"executor": "nx:noop",
9+
"dependsOn": ["build:README"]
10+
},
11+
"build:README": {
12+
"executor": "nx:run-commands",
13+
"options": {
14+
"commands": [
15+
"cp packages/php-wasm/progress/README.md dist/packages/php-wasm/progress"
16+
]
17+
},
18+
"dependsOn": ["build:package-json"]
19+
},
20+
"build:package-json": {
821
"executor": "@wp-playground/nx-extensions:package-json",
922
"options": {
1023
"tsConfig": "packages/php-wasm/progress/tsconfig.lib.json",

packages/php-wasm/scopes/project.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
"projectType": "library",
66
"targets": {
77
"build": {
8+
"executor": "nx:noop",
9+
"dependsOn": ["build:README"]
10+
},
11+
"build:README": {
12+
"executor": "nx:run-commands",
13+
"options": {
14+
"commands": [
15+
"cp packages/php-wasm/scopes/README.md dist/packages/php-wasm/scopes"
16+
]
17+
},
18+
"dependsOn": ["build:package-json"]
19+
},
20+
"build:package-json": {
821
"executor": "@wp-playground/nx-extensions:package-json",
922
"options": {
1023
"tsConfig": "packages/php-wasm/scopes/tsconfig.lib.json",

packages/php-wasm/web-service-worker/project.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55
"projectType": "library",
66
"targets": {
77
"build": {
8-
"executor": "@wp-playground/nx-extensions:package-json",
8+
"executor": "nx:noop",
9+
"dependsOn": ["build:README"]
10+
},
11+
"build:README": {
12+
"executor": "nx:run-commands",
913
"options": {
10-
"tsConfig": "packages/php-wasm/web-service-worker/tsconfig.lib.json",
11-
"outputPath": "dist/packages/php-wasm/web-service-worker",
12-
"buildTarget": "php-wasm-web-service-worker:build:bundle:production"
13-
}
14+
"commands": [
15+
"cp packages/php-wasm/web-service-worker/README.md dist/packages/php-wasm/web-service-worker"
16+
]
17+
},
18+
"dependsOn": ["build:package-json"]
1419
},
1520
"build:package-json": {
1621
"executor": "@wp-playground/nx-extensions:package-json",

packages/playground/blueprints/project.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
"projectType": "library",
66
"targets": {
77
"build": {
8+
"executor": "nx:noop",
9+
"dependsOn": ["build:README"]
10+
},
11+
"build:README": {
12+
"executor": "nx:run-commands",
13+
"options": {
14+
"commands": [
15+
"cp packages/playground/blueprints/README.md dist/packages/playground/blueprints"
16+
]
17+
},
18+
"dependsOn": ["build:package-json"]
19+
},
20+
"build:package-json": {
821
"executor": "@wp-playground/nx-extensions:package-json",
922
"options": {
1023
"tsConfig": "packages/playground/blueprints/tsconfig.lib.json",

packages/playground/cli/project.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
"projectType": "library",
66
"targets": {
77
"build": {
8+
"executor": "nx:noop",
9+
"dependsOn": ["build:README"]
10+
},
11+
"build:README": {
12+
"executor": "nx:run-commands",
13+
"options": {
14+
"commands": [
15+
"cp packages/playground/cli/README.md dist/packages/playground/cli"
16+
]
17+
},
18+
"dependsOn": ["build:package-json"]
19+
},
20+
"build:package-json": {
821
"executor": "@wp-playground/nx-extensions:package-json",
922
"options": {
1023
"tsConfig": "packages/playground/cli/tsconfig.lib.json",

packages/playground/client/project.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,26 @@
55
"projectType": "library",
66
"targets": {
77
"build": {
8+
"executor": "nx:noop",
9+
"dependsOn": ["build:README"]
10+
},
11+
"build:README": {
12+
"executor": "nx:run-commands",
13+
"options": {
14+
"commands": [
15+
"cp packages/playground/client/README.md dist/packages/playground/client"
16+
]
17+
},
18+
"dependsOn": ["build:package-json"]
19+
},
20+
"build:package-json": {
821
"executor": "@wp-playground/nx-extensions:package-json",
922
"options": {
1023
"tsConfig": "packages/playground/client/tsconfig.lib.json",
1124
"outputPath": "dist/packages/playground/client",
1225
"buildTarget": "playground-client:build:bundle:production"
1326
},
14-
"dependsOn": ["build:README", "build:rollup-declarations"]
27+
"dependsOn": ["build:rollup-declarations"]
1528
},
1629
"build:rollup-declarations": {
1730
"executor": "nx:run-commands",
@@ -26,15 +39,6 @@
2639
},
2740
"dependsOn": ["build:bundle"]
2841
},
29-
"build:README": {
30-
"executor": "nx:run-commands",
31-
"options": {
32-
"commands": [
33-
"cp packages/playground/client/README.md dist/packages/playground/client"
34-
]
35-
},
36-
"dependsOn": ["build:bundle"]
37-
},
3842
"build:bundle": {
3943
"executor": "@nx/vite:build",
4044
"outputs": ["{options.outputPath}"],

packages/playground/components/project.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
"projectType": "library",
66
"targets": {
77
"build": {
8+
"executor": "nx:noop",
9+
"dependsOn": ["build:README"]
10+
},
11+
"build:README": {
12+
"executor": "nx:run-commands",
13+
"options": {
14+
"commands": [
15+
"cp packages/playground/components/README.md dist/packages/playground/components"
16+
]
17+
},
18+
"dependsOn": ["build:vite"]
19+
},
20+
"build:vite": {
821
"executor": "@nx/vite:build",
922
"outputs": ["{options.outputPath}"],
1023
"defaultConfiguration": "production",

packages/playground/remote/project.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
"projectType": "library",
66
"targets": {
77
"build": {
8+
"executor": "nx:noop",
9+
"dependsOn": ["build:README"]
10+
},
11+
"build:README": {
12+
"executor": "nx:run-commands",
13+
"options": {
14+
"commands": [
15+
"cp packages/playground/remote/README.md dist/packages/playground/remote"
16+
]
17+
},
18+
"dependsOn": ["build:vite"]
19+
},
20+
"build:vite": {
821
"executor": "@nx/vite:build",
922
"outputs": ["{options.outputPath}"],
1023
"options": {

packages/playground/sync/project.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
"tags": ["scope:web-client"],
77
"targets": {
88
"build": {
9+
"executor": "nx:noop",
10+
"dependsOn": ["build:README"]
11+
},
12+
"build:README": {
13+
"executor": "nx:run-commands",
14+
"options": {
15+
"commands": [
16+
"cp packages/playground/sync/README.md dist/packages/playground/sync"
17+
]
18+
},
19+
"dependsOn": ["build:vite"]
20+
},
21+
"build:vite": {
922
"executor": "@nx/vite:build",
1023
"outputs": ["{options.outputPath}"],
1124
"defaultConfiguration": "production",

0 commit comments

Comments
 (0)