forked from hyperdxio/hyperdx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnx.json
More file actions
83 lines (83 loc) · 2.98 KB
/
Copy pathnx.json
File metadata and controls
83 lines (83 loc) · 2.98 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
{
"analytics": false,
"affected": {
"defaultBase": "main"
},
"workspaceLayout": {
"appsDir": "packages",
"libsDir": "packages"
},
"targetDefaults": {
"build": {
"cache": true,
"dependsOn": ["^build"]
},
"ci:build": {
"cache": true,
"dependsOn": ["^ci:build"],
// The `runtime` input pairs with `.nvmrc` in sharedGlobals: the file
// catches a declared version bump, this catches an actual interpreter
// that disagrees with it (local shells, a runner image change).
"inputs": ["production", "^production", { "runtime": "node --version" }],
"outputs": ["{projectRoot}/dist"]
},
"ci:lint": {
"cache": true,
"dependsOn": ["^ci:build"],
"inputs": ["default", "^production", { "runtime": "node --version" }]
},
// Unit tests import the compiled `dist` of workspace dependencies (e.g.
// `@hyperdx/common-utils/dist/types`), so they need the same `^ci:build`
// that `ci:lint` has. Without it, `nx run-many -t ci:unit` can run jest
// against a stale or absent dist — which fails intermittently, because the
// nx cache usually leaves a usable dist behind and occasionally does not.
"ci:unit": {
"cache": true,
"dependsOn": ["^ci:build"],
"inputs": ["default", "^production", { "runtime": "node --version" }]
},
// `outputs` is not optional here. Without it nx caches only the terminal
// output, so a cache hit replays a convincing build log and leaves `dist`
// exactly as it found it — stale, or missing entirely. That bites because
// `ci:build` writes the same `dist` from a different command (tsup alone,
// no `tsc --emitDeclarationOnly`), so running unit tests and then `yarn dev`
// leaves you on whichever dist won the race, with no sign anything is off.
"dev:build": {
"cache": true,
"outputs": ["{projectRoot}/dist"]
},
"lint": {
"cache": true
},
"test": {
"cache": true
}
},
"namedInputs": {
"default": [
"{projectRoot}/**/*",
"sharedGlobals",
// `packages/api/openapi.json` is regenerated by `docgen` inside the api's
// own `ci:lint`, so leaving it in would make that task mutate its own
// input set. It has to be excluded here rather than on `ci:lint` itself:
// `@hyperdx/app` depends on the api, so the file also reaches app's lint
// hash via `^production`, which expands the *dependency's* named inputs.
"!{projectRoot}/openapi.json"
],
"production": [
"default",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/eslint.config.mjs"
],
"sharedGlobals": [
"{workspaceRoot}/tsconfig.base.json",
"{workspaceRoot}/.prettierrc",
"{workspaceRoot}/.prettierignore",
"{workspaceRoot}/package.json",
"{workspaceRoot}/yarn.lock",
"{workspaceRoot}/.nvmrc"
]
}
}