-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnx.json
More file actions
439 lines (396 loc) · 11.4 KB
/
nx.json
File metadata and controls
439 lines (396 loc) · 11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
// Maximum parallel tasks - optimized for modern hardware
// Adjust based on your machine's CPU cores (recommended: cores - 2 to leave headroom)
// Override in CI via NX_PARALLEL environment variable if needed
"parallel": 8,
"cacheDirectory": ".nx/cache",
"defaultBase": "main",
// Enable daemon for faster task execution
"useDaemonProcess": true,
// Only mark projects as affected by lockfile changes if they actually depend on updated packages
"pluginsConfig": {
"@nx/js": {
"projectsAffectedByDependencyUpdates": "auto"
}
},
// ============================================
// PLUGINS - Auto-infer tasks from config files
// ============================================
"plugins": [
{
"plugin": "@nx/vite/plugin",
"exclude": [
"packages/dill-docs/**", // Astro site
"packages/repopo-docs/**" // Astro site
],
"options": {
"testTargetName": "test:vitest", // Avoid conflicts with existing test:unit
"serveTargetName": "serve:vite" // Avoid conflicts with existing dev targets
}
}
],
// ============================================
// NAMED INPUTS
// ============================================
// Reusable file pattern definitions for caching
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"production": [
"default",
"!{projectRoot}/esm/**",
"!{projectRoot}/dist/**",
"!{projectRoot}/**/*.spec.ts",
"!{projectRoot}/**/*.test.ts",
"!{projectRoot}/test/**/*",
"!{projectRoot}/**/*.md",
"!{projectRoot}/vitest.config.*"
],
// Shared config files that affect all packages
// Only truly global files here - task-specific configs belong in target inputs
"sharedGlobals": [
"{workspaceRoot}/pnpm-workspace.yaml",
// Exclude Claude Code config files - they don't affect builds
"!{workspaceRoot}/.claude/**",
"!{workspaceRoot}/CLAUDE.md",
"!{workspaceRoot}/.mcp.json"
]
},
// ============================================
// TARGET DEFAULTS
// ============================================
"targetDefaults": {
// ============================================
// ORCHESTRATION TARGETS
// ============================================
// CI target - centralizes task list for CI pipeline
// Dependencies: check, build, test:coverage
// Note: lint and check:format run at root level only (via root targets)
// Projects inherit this automatically if they have a "ci" script
"ci": {
"executor": "nx:noop",
"dependsOn": [
"tools-monorepo:check", // Root-level checks must pass first
"tools-monorepo:lint", // Root-level lint must pass first
"build",
"test:coverage"
],
"cache": true
},
"build": {
"dependsOn": [
"^build", // Inter-package dependencies
"tools-monorepo:lint", // Root-level lint must pass first
"tools-monorepo:check:format", // Root-level format check must pass first
"build:compile", // Intra-package: TypeScript compilation
"build:api", // Intra-package: API documentation
"build:docs", // Intra-package: TypeDoc documentation
"build:manifest", // Intra-package: OCLIF manifest
"build:readme", // Intra-package: OCLIF readme
"build:generate", // Intra-package: OCLIF snapshots
"build:site", // Intra-package: Astro/Vite sites
"build:vite", // Intra-package: Vite builds
"build:rust" // Intra-package: Rust compilation (repopo-core)
],
"inputs": ["production", "^production"], // Only source code changes affect build, not lint/format results
"cache": true
},
"test": {
"dependsOn": [
"build:compile", // Need compiled code before testing
"test:unit", // Intra-package: Unit tests
"test:vitest", // Intra-package: Vitest tests
"test:snapshots" // Intra-package: Snapshot tests (OCLIF)
],
"cache": true
},
"test:integration": {
"dependsOn": ["build:compile"],
"inputs": [
"default",
"^production",
"{projectRoot}/*.config.{ts,js,mjs,cjs}",
"{projectRoot}/test/fixtures/**"
],
"cache": false // Integration tests interact with filesystem and should not be cached
},
"lint": {
"inputs": [
"{projectRoot}/src/**",
"{projectRoot}/test/**",
"{projectRoot}/biome.jsonc",
"{workspaceRoot}/biome.jsonc",
"{workspaceRoot}/config/biome/*.jsonc"
],
"cache": true
},
"clean": {
"cache": false
},
"dev": {
"cache": false
},
"release": {
"dependsOn": ["build", "release:license"],
"cache": true
},
// ============================================
// BUILD IMPLEMENTATION TARGETS
// ============================================
// TypeScript compilation - optimized with production inputs
"build:compile": {
"dependsOn": ["^build:compile"],
"inputs": [
"production",
"^production",
"sharedGlobals",
"{workspaceRoot}/config/tsconfig*.json"
],
"outputs": [
"{projectRoot}/esm/**",
"{projectRoot}/dist/**",
"{projectRoot}/*.tsbuildinfo"
],
"cache": true
},
"build:api": {
"dependsOn": ["build:compile"],
"inputs": [
"{projectRoot}/src/**/*.ts", // Source files to ensure cache invalidates on code changes
"{projectRoot}/esm/**/*.d.ts",
"{projectRoot}/api-extractor*.{json,cjs}",
"{projectRoot}/package.json",
"{workspaceRoot}/config/api-extractor.base.json"
],
"outputs": [
"{projectRoot}/api-docs/**",
"{projectRoot}/_temp/**",
"{projectRoot}/esm/tsdoc-metadata.json"
],
"cache": true
},
"build:docs": {
"dependsOn": ["build:compile", "build:api"],
"inputs": [
"{projectRoot}/esm/**",
"{projectRoot}/src/**",
"{projectRoot}/typedoc.{json,js,cjs}",
"{projectRoot}/README.md"
],
"outputs": ["{projectRoot}/docs/**"],
"cache": true
},
// OCLIF-specific build targets (no plugin available)
"build:manifest": {
"dependsOn": ["build:compile"],
"inputs": ["production", "^production"],
"outputs": ["{projectRoot}/oclif.manifest.json"],
"cache": true
},
"build:readme": {
"dependsOn": ["build:manifest"],
"inputs": ["production", "{projectRoot}/oclif.manifest.json"],
"outputs": ["{projectRoot}/README.md", "{projectRoot}/docs/**"],
"cache": true
},
"build:generate": {
"dependsOn": ["build:compile", "build:manifest"],
"inputs": ["production", "{projectRoot}/oclif.manifest.json"],
"outputs": ["{projectRoot}/test/commands/__snapshots__/**"],
"cache": true
},
// Vite/Astro builds - plugins will infer these, but we provide defaults
"build:site": {
"dependsOn": ["^build:compile", "^build:api"],
"inputs": [
"{projectRoot}/src/**",
"{projectRoot}/*.config.{ts,js,mjs,cjs}",
"{projectRoot}/public/**"
],
"outputs": ["{projectRoot}/dist/**", "{projectRoot}/.astro/**"],
"cache": true
},
"build:vite": {
"dependsOn": ["^build:compile", "build:compile"],
"inputs": [
"{projectRoot}/src/**",
"^production",
"{projectRoot}/*.config.{ts,js,mjs,cjs}",
"{projectRoot}/public/**",
"{projectRoot}/index.html"
],
"outputs": ["{projectRoot}/dist/**"],
"cache": true
},
"build:tauri": {
"dependsOn": ["build:vite"],
"inputs": ["{projectRoot}/src-tauri/**", "{projectRoot}/dist/**"],
"outputs": ["{projectRoot}/src-tauri/target/**"],
"cache": true
},
"build:copy-templates": {
"dependsOn": ["build:compile"],
"inputs": ["{projectRoot}/src/**/templates/**"],
"outputs": ["{projectRoot}/esm/**/templates/**"],
"cache": true
},
"build:rust": {
"inputs": [
"{projectRoot}/crates/**/*.rs",
"{projectRoot}/crates/**/Cargo.toml",
"{projectRoot}/crates/**/Cargo.lock"
],
"outputs": ["{projectRoot}/crates/core/target/debug/repopo-core"],
"cache": true
},
"build:rust:release": {
"inputs": [
"{projectRoot}/crates/**/*.rs",
"{projectRoot}/crates/**/Cargo.toml",
"{projectRoot}/crates/**/Cargo.lock"
],
"outputs": ["{projectRoot}/crates/core/target/release/repopo-core"],
"cache": true
},
// ============================================
// TEST IMPLEMENTATION TARGETS
// ============================================
"test:unit": {
"dependsOn": ["build:compile"],
"inputs": [
"default",
"^production",
"{projectRoot}/*.config.{ts,js,mjs,cjs}"
],
"outputs": ["{projectRoot}/_temp/**", "{projectRoot}/.sonda/**"],
"cache": true
},
"test:coverage": {
"dependsOn": ["build:compile"],
"inputs": [
"default",
"^production",
"{projectRoot}/*.config.{ts,js,mjs,cjs}"
],
"outputs": [
"{projectRoot}/.coverage/**",
"{projectRoot}/.sonda/**",
"{projectRoot}/_temp/**"
],
"cache": true
},
"test:e2e": {
"dependsOn": ["build"],
"cache": false
},
// ============================================
// LINT IMPLEMENTATION TARGETS
// ============================================
"lint:biome": {
"inputs": [
"{projectRoot}/src/**",
"{projectRoot}/test/**",
"{projectRoot}/biome.jsonc",
"{workspaceRoot}/config/biome/*.jsonc",
"{workspaceRoot}/biome.jsonc"
],
"cache": true
},
// ============================================
// CHECK IMPLEMENTATION TARGETS
// ============================================
"check:format": {
"inputs": [
"{projectRoot}/src/**",
"{projectRoot}/test/**",
"{projectRoot}/*.{json,jsonc,md,ts,js,mjs,cjs}",
"{workspaceRoot}/config/biome/*.jsonc",
"{workspaceRoot}/biome.jsonc"
],
"cache": true
},
"check:types": {
"dependsOn": ["^build"],
"inputs": [
"production",
"{projectRoot}/*.config.{ts,js,mjs,cjs}",
"{projectRoot}/typedoc.{json,js,cjs}",
"{workspaceRoot}/config/tsconfig*.json"
],
"cache": true
},
// TypeScript Native (tsgo) shadow testing - runs alongside tsc for comparison
// Use: pnpm check:types:native to validate with the Go-based compiler
"check:types:native": {
"inputs": [
"production",
"{projectRoot}/tsconfig*.json",
"{workspaceRoot}/config/tsconfig*.json"
],
"cache": true
},
"check:deps": {
"inputs": [
"{projectRoot}/package.json",
"{workspaceRoot}/package.json",
"{workspaceRoot}/*syncpack*"
],
"cache": true
},
"check:policy": {
"dependsOn": ["repopo:build:compile"],
"inputs": ["{projectRoot}/**/*", "{workspaceRoot}/repopo.config.ts"],
"cache": true
},
"check:references": {
"inputs": [
"{projectRoot}/tsconfig*.json",
"{workspaceRoot}/tsconfig*.json",
"{workspaceRoot}/config/tsconfig*.json",
"{workspaceRoot}/package.json",
"{workspaceRoot}/pnpm-workspace.yaml"
],
"cache": true
},
"check:astro": {
"dependsOn": ["^build:compile"],
"inputs": [
"{projectRoot}/src/**",
"{projectRoot}/*.config.{ts,js,mjs,cjs}"
],
"cache": true
},
"check:svelte": {
"inputs": [
"{projectRoot}/src/**",
"{projectRoot}/*.config.{ts,js,mjs,cjs}"
],
"cache": true
},
// ============================================
// RELEASE IMPLEMENTATION TARGETS
// ============================================
"release:license": {
"dependsOn": ["^release:license"],
"inputs": [
"{projectRoot}/package.json",
"{workspaceRoot}/.generatelicensefile.cjs"
],
"outputs": ["{projectRoot}/THIRD-PARTY-LICENSES.txt"],
"cache": true
},
// ============================================
// CLEAN IMPLEMENTATION TARGETS
// ============================================
"clean:build": {
"cache": false
},
"clean:manifest": {
"cache": false
},
"clean:root": {
"cache": false
}
},
"nxCloudId": "68fa4834e4d66c5b22e74804"
}