Skip to content

Commit 16003eb

Browse files
authored
internal: More parallelism for build types (#3325)
1 parent 226f5b4 commit 16003eb

File tree

6 files changed

+43
-58
lines changed

6 files changed

+43
-58
lines changed

.circleci/config.yml

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- checkout:
2929
depth: 1
3030
- run:
31-
name: examples use local packages
31+
name: Add examples/* to yarn workspace
3232
command: |
3333
npm pkg set 'workspaces[]'='examples/*'
3434
- restore_cache:
@@ -46,7 +46,7 @@ jobs:
4646
- .yarn/install-state.gz
4747
key: v13-dependencies-{{ checksum "yarn.lock" }}-{{ checksum "examples/github-app/package.json" }}-{{ checksum "examples/todo-app/package.json" }}
4848
- run: yarn run ci:build:types
49-
- run: yarn run ci:build
49+
- run: yarn run ci:build-test-lib
5050
- persist_to_workspace:
5151
root: ~/
5252
paths:
@@ -69,7 +69,7 @@ jobs:
6969

7070
lint:
7171
executor: node
72-
resource_class: medium+
72+
resource_class: medium
7373
steps:
7474
- attach_workspace:
7575
at: ~/
@@ -127,6 +127,7 @@ jobs:
127127
parameters:
128128
node-version:
129129
type: string
130+
executor: node
130131
docker:
131132
- image: cimg/node:<< parameters.node-version >>
132133
steps:
@@ -140,16 +141,20 @@ jobs:
140141
command: |
141142
ANANSI_JEST_TYPECHECK=false npm test --ci --maxWorkers=2 --selectProjects Node
142143
143-
non-app-examples:
144+
setup-esmodule-types:
144145
executor: node
145-
resource_class: small
146+
resource_class: large
146147
steps:
147148
- attach_workspace:
148149
at: ~/
149150
- run:
150-
command: |
151-
cd examples/normalizr-relationships
152-
yarn run start
151+
name: Build Legacy Types
152+
command: yarn run ci:build:legacy-types
153+
- persist_to_workspace:
154+
root: ~/
155+
paths:
156+
# explicitly list so we can ignore some directories that are not needed
157+
- project/packages/*/ts*
153158

154159
esmodule-types:
155160
parameters:
@@ -162,51 +167,43 @@ jobs:
162167
- run:
163168
name: Install TypeScript Version
164169
command: |
165-
if [ "<< parameters.typescript-version >>" != "latest" ]; then
166-
yarn up typescript@~<< parameters.typescript-version >>
167-
fi
170+
yarn up typescript@~<< parameters.typescript-version >>
168171
if [[ "<< parameters.typescript-version >>" == "4.0" || \
169172
"<< parameters.typescript-version >>" == "4.1" || \
170173
"<< parameters.typescript-version >>" == "4.3" ]]; then
171-
sed -i '/"@types\/react":/d' package.json
172-
sed -i '/"@types\/react-dom":/d' package.json
173174
yarn up @types/react@ts<< parameters.typescript-version >>
174175
fi
175176
- run:
176177
name: Run Typecheck
177178
command: |
178-
if [ "<< parameters.typescript-version >>" == "latest" ] || [ "<< parameters.typescript-version >>" == "5.3" ] || [ "<< parameters.typescript-version >>" == "4.8" ]; then
179+
if [ "<< parameters.typescript-version >>" == "5.3" ] || [ "<< parameters.typescript-version >>" == "4.8" ]; then
179180
yarn run tsc --project examples/todo-app/tsconfig.json
180181
yarn run tsc --project examples/github-app/tsconfig.json
181182
fi
182-
yarn run tsc --project examples/todo-app/tsconfig.typetest.json
183-
yarn run tsc --project examples/github-app/tsconfig.typetest.json
184183
if [ "<< parameters.typescript-version >>" != "4.0" ]; then
185184
yarn run tsc --project examples/todo-app/tsconfig.typetest41.json
186185
fi
186+
yarn run tsc --project examples/todo-app/tsconfig.typetest.json
187+
yarn run tsc --project examples/github-app/tsconfig.typetest.json
187188
188-
esmodule-loosenulltypes:
189+
esmodule-types-latest:
189190
executor: node
190191
steps:
191192
- attach_workspace:
192193
at: ~/
193194
- run:
194195
name: Run Typecheck
195196
command: |
197+
yarn run tsc --project examples/todo-app/tsconfig.json
198+
yarn run tsc --project examples/github-app/tsconfig.json
199+
yarn run tsc --project examples/todo-app/tsconfig.typetest.json
200+
yarn run tsc --project examples/github-app/tsconfig.typetest.json
201+
yarn run tsc --project examples/todo-app/tsconfig.typetest41.json
196202
yarn run tsc --project examples/todo-app/tsconfig.json --strictNullChecks false
197203
yarn run tsc --project examples/github-app/tsconfig.json --strictNullChecks false
198204
yarn run tsc --project examples/todo-app/tsconfig.typetest.json --strictNullChecks false
199205
yarn run tsc --project examples/github-app/tsconfig.typetest.json --strictNullChecks false
200206
yarn run tsc --project examples/todo-app/tsconfig.typetest41.json --strictNullChecks false
201-
202-
esmodule-exactOptionalPropertyTypes:
203-
executor: node
204-
steps:
205-
- attach_workspace:
206-
at: ~/
207-
- run:
208-
name: Run Typecheck
209-
command: |
210207
yarn run tsc --project examples/todo-app/tsconfig.typetest.json --exactOptionalPropertyTypes true
211208
yarn run tsc --project examples/github-app/tsconfig.typetest.json --exactOptionalPropertyTypes true
212209
yarn run tsc --project examples/todo-app/tsconfig.typetest41.json --exactOptionalPropertyTypes true
@@ -216,10 +213,15 @@ jobs:
216213
steps:
217214
- attach_workspace:
218215
at: ~/
216+
- run: yarn run ci:build:esmodule
219217
- run:
220218
command: |
221219
cd examples/todo-app
222220
npm run build:browser -- --env readable
221+
- run:
222+
command: |
223+
cd examples/normalizr-relationships
224+
yarn run start
223225
224226
workflows:
225227
version: 2
@@ -244,10 +246,13 @@ workflows:
244246
- typecheck:
245247
requires:
246248
- setup
247-
- non-app-examples:
249+
- validate-esmodule-browser-build:
248250
requires:
249251
- setup
250-
- validate-esmodule-browser-build:
252+
- esmodule-types-latest:
253+
requires:
254+
- setup
255+
- setup-esmodule-types:
251256
requires:
252257
- setup
253258
- esmodule-types:
@@ -258,12 +263,6 @@ workflows:
258263
# 4.1 is min version for rest package working well
259264
# 4.3
260265
# 4.7 (but its broken so we do 4.8) lets you apply a generic type to a function type to see its return value
261-
typescript-version: ["4.0", "4.1", "4.3", "4.8", "5.3", "latest"]
266+
typescript-version: ["4.0", "4.1", "4.3", "4.8", "5.3"]
262267
requires:
263-
- setup
264-
- esmodule-loosenulltypes:
265-
requires:
266-
- setup
267-
- esmodule-exactOptionalPropertyTypes:
268-
requires:
269-
- setup
268+
- setup-esmodule-types

examples/github-app/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"esModuleInterop": true,
1515
"experimentalDecorators": true,
1616
"emitDecoratorMetadata": true,
17-
1817
"types": ["@anansi/webpack-config/types","./src/types/remark-remove-comments"],
1918
"paths": {
2019
"@/*": ["./src/*"],

examples/github-app/tsconfig.typetest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "./tsconfig",
33
"compilerOptions": {
44
"skipLibCheck": true,
5+
"skipDefaultLibCheck": true
56
},
67
"include": ["typetest.ts"],
78
}

examples/normalizr-relationships/package.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,11 @@
1212
"devDependencies": {
1313
"@babel/core": "7.26.0",
1414
"@babel/node": "7.26.0",
15-
"@types/babel__core": "^7",
16-
"mockdate": "^3.0.5",
17-
"rollup": "2.79.2",
18-
"rollup-plugin-babel": "^4.4.0",
19-
"rollup-plugin-commonjs": "^10.1.0",
20-
"rollup-plugin-filesize": "^9.1.2",
21-
"rollup-plugin-json": "^4.0.0",
22-
"rollup-plugin-node-resolve": "^5.2.0",
23-
"rollup-plugin-replace": "^2.2.0",
24-
"rollup-plugin-terser": "^7.0.2"
15+
"@types/babel__core": "^7"
2516
},
2617
"dependencies": {
2718
"@data-client/endpoint": "workspace:^",
28-
"@data-client/normalizr": "workspace:^"
19+
"@data-client/normalizr": "workspace:^",
20+
"mockdate": "^3.0.5"
2921
}
3022
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
"build:bundle": "yarn workspaces foreach -Wptiv --no-private run build:bundle",
1818
"build:clean": "yarn workspaces foreach -Wpti --no-private run build:clean",
1919
"build:types": "yarn build:copy:ambient && tsc --build && yarn workspaces foreach -Wpti --no-private run build:legacy-types",
20-
"ci:build:types": "yarn build:copy:ambient && tsc --build && yarn workspaces foreach -WptivR --from @data-client/react --from @data-client/rest --from @data-client/graphql run build:legacy-types",
21-
"ci:build": "yarn workspaces foreach -WptivR --from @data-client/react --from @data-client/rest --from @data-client/graphql --from @data-client/test run build:lib && yarn workspace @data-client/test run build:bundle && yarn workspace @data-client/normalizr run build:js:node && yarn workspace @data-client/endpoint run build:js:node",
20+
"ci:build:types": "yarn build:copy:ambient && tsc --build",
21+
"ci:build:legacy-types": "yarn workspaces foreach -WptivR -j 10 --from @data-client/react --from @data-client/rest --from @data-client/graphql run build:legacy-types",
22+
"ci:build-test-lib": "yarn workspace @data-client/test run build:lib && yarn workspace @data-client/test run build:bundle",
23+
"ci:build:esmodule": "yarn workspaces foreach -WptivR --from @data-client/react --from @data-client/rest --from @data-client/graphql run build:lib && yarn workspace @data-client/normalizr run build:js:node && yarn workspace @data-client/endpoint run build:js:node",
2224
"build:copy:ambient": "mkdirp ./packages/endpoint/lib && copyfiles --flat ./packages/endpoint/src/schema.d.ts ./packages/endpoint/lib/ && copyfiles --flat ./packages/endpoint/src/endpoint.d.ts ./packages/endpoint/lib/ && mkdirp ./packages/rest/lib && copyfiles --flat ./packages/rest/src/RestEndpoint.d.ts ./packages/rest/lib && copyfiles --flat ./packages/rest/src/next/RestEndpoint.d.ts ./packages/rest/lib/next && mkdirp ./packages/react/lib && copyfiles --flat ./packages/react/src/server/redux/redux.d.ts ./packages/react/lib/server/redux",
2325
"copy:websitetypes": "./scripts/copywebsitetypes.sh",
2426
"test": "NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest",

yarn.lock

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21795,14 +21795,6 @@ __metadata:
2179521795
"@data-client/normalizr": "workspace:^"
2179621796
"@types/babel__core": "npm:^7"
2179721797
mockdate: "npm:^3.0.5"
21798-
rollup: "npm:2.79.2"
21799-
rollup-plugin-babel: "npm:^4.4.0"
21800-
rollup-plugin-commonjs: "npm:^10.1.0"
21801-
rollup-plugin-filesize: "npm:^9.1.2"
21802-
rollup-plugin-json: "npm:^4.0.0"
21803-
rollup-plugin-node-resolve: "npm:^5.2.0"
21804-
rollup-plugin-replace: "npm:^2.2.0"
21805-
rollup-plugin-terser: "npm:^7.0.2"
2180621798
languageName: unknown
2180721799
linkType: soft
2180821800

0 commit comments

Comments
 (0)