@smoothbricks/cli 0.10.6 → 0.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -0
- package/dist/github-ci/index.d.ts +1 -0
- package/dist/github-ci/index.d.ts.map +1 -1
- package/dist/github-ci/index.js +23 -2
- package/dist/lib/json.d.ts +1 -1
- package/dist/lib/json.d.ts.map +1 -1
- package/dist/lib/json.js +3 -18
- package/dist/lib/workspace.d.ts.map +1 -1
- package/dist/lib/workspace.js +1 -0
- package/dist/monorepo/managed-files.d.ts +6 -22
- package/dist/monorepo/managed-files.d.ts.map +1 -1
- package/dist/monorepo/managed-files.js +12 -47
- package/dist/monorepo/package-policy.js +2 -2
- package/dist/monorepo/packs/index.d.ts.map +1 -1
- package/dist/monorepo/packs/index.js +2 -0
- package/dist/monorepo/publish-workflow.js +1 -1
- package/dist/monorepo/runtime.d.ts +2 -2
- package/dist/monorepo/runtime.d.ts.map +1 -1
- package/dist/monorepo/runtime.js +11 -16
- package/dist/monorepo/tool-validation.d.ts.map +1 -1
- package/dist/monorepo/tool-validation.js +20 -23
- package/dist/nx/index.d.ts +7 -4
- package/dist/nx/index.d.ts.map +1 -1
- package/dist/nx/index.js +117 -56
- package/managed/raw/tooling/devenv +71 -0
- package/package.json +4 -4
- package/src/cli.ts +8 -1
- package/src/github-ci/index.test.ts +50 -1
- package/src/github-ci/index.ts +31 -2
- package/src/lib/json.ts +1 -1
- package/src/lib/workspace.ts +1 -0
- package/src/monorepo/__tests__/publish-workflow.test.ts +11 -3
- package/src/monorepo/managed-files.test.ts +31 -22
- package/src/monorepo/managed-files.ts +15 -68
- package/src/monorepo/package-policy.test.ts +31 -0
- package/src/monorepo/package-policy.ts +2 -2
- package/src/monorepo/packs/index.ts +2 -0
- package/src/monorepo/publish-workflow.ts +5 -0
- package/src/monorepo/runtime.test.ts +23 -17
- package/src/monorepo/runtime.ts +12 -17
- package/src/monorepo/tool-validation.test.ts +15 -8
- package/src/monorepo/tool-validation.ts +20 -25
- package/src/nx/index.test.ts +45 -14
- package/src/nx/index.ts +133 -64
- package/managed/raw/patches/ttsc@0.19.3.patch +0 -67
package/dist/cli.js
CHANGED
|
@@ -290,6 +290,7 @@ function buildProgram() {
|
|
|
290
290
|
.command('nx-run-many')
|
|
291
291
|
.requiredOption('--targets <targets>')
|
|
292
292
|
.option('--projects <projects>')
|
|
293
|
+
.option('--projects-with-targets <targets>', 'select projects owning any comma-separated target or target glob')
|
|
293
294
|
.option('--configuration <configuration>')
|
|
294
295
|
.option('--collect-outputs <directory>')
|
|
295
296
|
.action(async (options) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/github-ci/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,gBAAgB,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAmBhD,KAAK,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAKpD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBtE;AAmFD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAO3G;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GACpG,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB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
147
|
export function expandNxTargetRuns(projects, options) {
|
|
148
|
-
const
|
|
149
|
-
if (options.projects !== undefined &&
|
|
148
|
+
const namedProjects = selectProjects(projects, options.projects);
|
|
149
|
+
if (options.projects !== undefined && namedProjects.length === 0 && options.allowEmptyProjects !== true) {
|
|
150
150
|
throw new Error(`No Nx projects matched --projects ${options.projects}.`);
|
|
151
151
|
}
|
|
152
|
+
const selectedProjects = selectProjectsWithTargets(namedProjects, options.projectsWithTargets);
|
|
153
|
+
if (options.projectsWithTargets !== undefined &&
|
|
154
|
+
selectedProjects.length === 0 &&
|
|
155
|
+
options.allowEmptyProjects !== true) {
|
|
156
|
+
throw new Error(`No Nx projects own targets matching --projects-with-targets ${options.projectsWithTargets}.`);
|
|
157
|
+
}
|
|
152
158
|
const selectedTargetNames = [...new Set(selectedProjects.flatMap((project) => project.targets))].sort((a, b) => a.localeCompare(b));
|
|
153
159
|
const runs = [];
|
|
154
160
|
const unmatchedGlobs = [];
|
|
@@ -162,6 +168,14 @@ export function expandNxTargetRuns(projects, options) {
|
|
|
162
168
|
unmatchedGlobs.push(targetPattern);
|
|
163
169
|
}
|
|
164
170
|
for (const target of targets) {
|
|
171
|
+
if (!isGlob && options.projectsWithTargets !== undefined) {
|
|
172
|
+
const missingProjects = selectedProjects
|
|
173
|
+
.filter((project) => !project.targets.includes(target))
|
|
174
|
+
.map((project) => project.project);
|
|
175
|
+
if (missingProjects.length > 0) {
|
|
176
|
+
throw new Error(`Nx target ${target} is missing for project(s) selected by --projects-with-targets ${options.projectsWithTargets}: ${missingProjects.join(', ')}.`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
165
179
|
if (addedTargets.has(target)) {
|
|
166
180
|
continue;
|
|
167
181
|
}
|
|
@@ -273,6 +287,13 @@ function selectProjects(projects, selectors) {
|
|
|
273
287
|
.filter((project) => patterns.some((pattern) => new Bun.Glob(pattern).match(project.project)))
|
|
274
288
|
.sort((left, right) => left.project.localeCompare(right.project));
|
|
275
289
|
}
|
|
290
|
+
function selectProjectsWithTargets(projects, selectors) {
|
|
291
|
+
if (selectors === undefined) {
|
|
292
|
+
return projects;
|
|
293
|
+
}
|
|
294
|
+
const patterns = commaSeparatedValues(selectors);
|
|
295
|
+
return projects.filter((project) => project.targets.some((target) => patterns.some((pattern) => new Bun.Glob(pattern).match(target))));
|
|
296
|
+
}
|
|
276
297
|
function commaSeparatedValues(value) {
|
|
277
298
|
return value
|
|
278
299
|
.split(',')
|
package/dist/lib/json.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ export interface NxDependsOnObject {
|
|
|
65
65
|
export type NxDependsOn = string | NxDependsOnObject;
|
|
66
66
|
/** Nx target options are executor-specific open bags. */
|
|
67
67
|
export type NxTargetOptions = Record<string, unknown>;
|
|
68
|
-
export type NxInput = string |
|
|
68
|
+
export type NxInput = string | object;
|
|
69
69
|
export interface NxTargetConfig {
|
|
70
70
|
executor?: string;
|
|
71
71
|
dependsOn?: NxDependsOn[];
|
package/dist/lib/json.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/lib/json.ts"],"names":[],"mappings":"AAGA,sDAAsD;AACtD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA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AAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAM/F;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,gBAAgB,EAChE,KAAK,EAAE,MAAM,GACZ,OAAO,CAMT;AAED,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,gBAAgB,EAChE,KAAK,EAAE,MAAM,GACZ,OAAO,CAMT;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAMrE;AAED,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAM5F;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,iBAAiB,EAC7B,GAAG,EAAE,MAAM,GAAG,KAAK,GAAG,WAAW,EACjC,KAAK,EAAE,MAAM,GACZ,OAAO,CAMT;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,iBAAiB,EAC7B,GAAG,EAAE,MAAM,GAAG,KAAK,GAAG,WAAW,EACjC,KAAK,EAAE,MAAM,GACZ,OAAO,CAMT"}
|
package/dist/lib/json.js
CHANGED
|
@@ -30,12 +30,7 @@ export const parsePackageJsonText = (() => {
|
|
|
30
30
|
return true;
|
|
31
31
|
return "string" === typeof value;
|
|
32
32
|
});
|
|
33
|
-
const _io10 = (input, _vctx = {}) =>
|
|
34
|
-
const value = input[key];
|
|
35
|
-
if (undefined === value)
|
|
36
|
-
return true;
|
|
37
|
-
return true;
|
|
38
|
-
});
|
|
33
|
+
const _io10 = (input, _vctx = {}) => true;
|
|
39
34
|
const _io11 = (input, _vctx = {}) => Object.keys(input).every(key => {
|
|
40
35
|
const value = input[key];
|
|
41
36
|
if (undefined === value)
|
|
@@ -76,12 +71,7 @@ export const parseNxProjectJsonText = (() => {
|
|
|
76
71
|
})) || (_vctx.io1.delete(input), false));
|
|
77
72
|
const _io2 = (input, _vctx = {}) => (_vctx.io2 || (_vctx.io2 = new WeakSet())).has(input) ? true : (_vctx.io2.add(input), ((undefined === input.executor || "string" === typeof input.executor) && (undefined === input.dependsOn || Array.isArray(input.dependsOn) && input.dependsOn.every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && _io3(elem, _vctx)))) && (undefined === input.outputs || Array.isArray(input.outputs) && input.outputs.every(elem => "string" === typeof elem)) && (undefined === input.inputs || Array.isArray(input.inputs) && input.inputs.every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io4(elem, _vctx)))) && (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && _io5(input.options, _vctx)) && (undefined === input.configurations || "object" === typeof input.configurations && null !== input.configurations && false === Array.isArray(input.configurations) && _io1(input.configurations, _vctx)) && (undefined === input.cache || "boolean" === typeof input.cache) && (undefined === input.command || "string" === typeof input.command) && (undefined === input.parallelism || "boolean" === typeof input.parallelism)) || (_vctx.io2.delete(input), false));
|
|
78
73
|
const _io3 = (input, _vctx = {}) => "string" === typeof input.target && (null !== input.projects && (undefined === input.projects || "string" === typeof input.projects || Array.isArray(input.projects) && input.projects.every(elem => "string" === typeof elem)));
|
|
79
|
-
const _io4 = (input, _vctx = {}) =>
|
|
80
|
-
const value = input[key];
|
|
81
|
-
if (undefined === value)
|
|
82
|
-
return true;
|
|
83
|
-
return true;
|
|
84
|
-
});
|
|
74
|
+
const _io4 = (input, _vctx = {}) => true;
|
|
85
75
|
const _io5 = (input, _vctx = {}) => Object.keys(input).every(key => {
|
|
86
76
|
const value = input[key];
|
|
87
77
|
if (undefined === value)
|
|
@@ -143,12 +133,7 @@ const isPackageJsonValue = (() => {
|
|
|
143
133
|
return true;
|
|
144
134
|
return "string" === typeof value;
|
|
145
135
|
});
|
|
146
|
-
const _io10 = (input, _vctx = {}) =>
|
|
147
|
-
const value = input[key];
|
|
148
|
-
if (undefined === value)
|
|
149
|
-
return true;
|
|
150
|
-
return true;
|
|
151
|
-
});
|
|
136
|
+
const _io10 = (input, _vctx = {}) => true;
|
|
152
137
|
const _io11 = (input, _vctx = {}) => Object.keys(input).every(key => {
|
|
153
138
|
const value = input[key];
|
|
154
139
|
if (undefined === value)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/lib/workspace.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAGvB,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,CAAC;AAEhE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,yBAAyB,YACpC,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,CACd,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,O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AE,CASlE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAI3D;AAaD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAehE;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,GAAG,IAAI,CAa1F;AAMD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAEtE;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,EAAE,CAMpD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,cAAc,GAAG,IAAI,CAatE;AAED,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAErF;AA6BD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
package/dist/lib/workspace.js
CHANGED
|
@@ -74,6 +74,7 @@ function listWorkspacePackageJsonPaths(root, workspacePatterns) {
|
|
|
74
74
|
const paths = [];
|
|
75
75
|
for (const pattern of workspacePatterns) {
|
|
76
76
|
if (!pattern.endsWith('/*')) {
|
|
77
|
+
paths.push(join(root, pattern, 'package.json'));
|
|
77
78
|
continue;
|
|
78
79
|
}
|
|
79
80
|
const parent = join(root, pattern.slice(0, -2));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type NxProjects } from '../nx/index.js';
|
|
1
2
|
/**
|
|
2
3
|
* Repos may append their own content to a managed file below this marker —
|
|
3
4
|
* e.g. extra merge drivers in .gitattributes. Everything from the marker
|
|
@@ -51,31 +52,14 @@ interface DeployTargetInfo {
|
|
|
51
52
|
exists: boolean;
|
|
52
53
|
provider?: 'cloudflare';
|
|
53
54
|
}
|
|
55
|
+
export declare const managedFileTargetsForTest: {
|
|
56
|
+
target: string;
|
|
57
|
+
executable: boolean | undefined;
|
|
58
|
+
}[];
|
|
54
59
|
export declare function applyManagedFiles(root: string, mode: 'update' | 'check' | 'diff'): Promise<FileResult[]>;
|
|
55
60
|
export declare function platformTargetGlobsForTest(targetNames: Iterable<string>): string[];
|
|
56
|
-
/** Resolved Nx project node as returned under `graph.nodes` / project-graph.json. */
|
|
57
|
-
export type NxGraphProjectNode = {
|
|
58
|
-
data?: {
|
|
59
|
-
targets?: Record<string, NxGraphTarget>;
|
|
60
|
-
};
|
|
61
|
-
targets?: Record<string, NxGraphTarget>;
|
|
62
|
-
};
|
|
63
|
-
type NxGraphTarget = {
|
|
64
|
-
command?: string;
|
|
65
|
-
options?: {
|
|
66
|
-
command?: string;
|
|
67
|
-
};
|
|
68
|
-
configurations?: Record<string, {
|
|
69
|
-
command?: string;
|
|
70
|
-
options?: {
|
|
71
|
-
command?: string;
|
|
72
|
-
};
|
|
73
|
-
}>;
|
|
74
|
-
};
|
|
75
|
-
/** Test seam: collect target names from a graph.nodes map. */
|
|
76
|
-
export declare function targetNamesFromProjects(nodes: Record<string, NxGraphProjectNode>): string[];
|
|
77
61
|
/** Test seam: deploy configuration presence/provider from graph nodes. */
|
|
78
|
-
export declare function deployTargetInfoFromProjects(
|
|
62
|
+
export declare function deployTargetInfoFromProjects(projects: NxProjects, configuration: string): DeployTargetInfo;
|
|
79
63
|
export declare function printResults(results: FileResult[]): void;
|
|
80
64
|
export declare function validateManagedFiles(root: string): Promise<number>;
|
|
81
65
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-files.d.ts","sourceRoot":"","sources":["../../src/monorepo/managed-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"managed-files.d.ts","sourceRoot":"","sources":["../../src/monorepo/managed-files.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,UAAU,EAA2B,MAAM,gBAAgB,CAAC;AAM1F;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,yEAAyE,CAAC;AAU3G,sFAAs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AgB,0BAA0B,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAMlF;AAED,0EAA0E;AAC1E,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,GAAG,gBAAgB,CAY1G;AAsDD,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAIxD;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQxE;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBxE"}
|
|
@@ -2,9 +2,8 @@ import { appendFileSync, existsSync, lstatSync, mkdirSync, readFileSync, writeFi
|
|
|
2
2
|
import { dirname, join, resolve } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { PLATFORM_TARGET_GLOBS } from '@smoothbricks/nx-plugin/workspace-config-policy';
|
|
5
|
-
// Nx package exports are CLI-oriented; this is the module the CLI uses for graph + daemon IPC.
|
|
6
|
-
import { createProjectGraphAsync } from 'nx/src/project-graph/project-graph.js';
|
|
7
5
|
import { listReleasePackages, readPackageJson } from '../lib/workspace.js';
|
|
6
|
+
import { loadNxProjects, targetNamesFromProjects } from '../nx/index.js';
|
|
8
7
|
import { renderCiWorkflowYaml } from './ci-workflow.js';
|
|
9
8
|
import { renderPublishWorkflowYaml } from './publish-workflow.js';
|
|
10
9
|
/**
|
|
@@ -100,6 +99,12 @@ const managedFiles = [
|
|
|
100
99
|
source: 'envrc',
|
|
101
100
|
target: '.envrc',
|
|
102
101
|
},
|
|
102
|
+
{
|
|
103
|
+
kind: 'raw',
|
|
104
|
+
source: 'tooling/devenv',
|
|
105
|
+
target: 'tooling/devenv',
|
|
106
|
+
executable: true,
|
|
107
|
+
},
|
|
103
108
|
{
|
|
104
109
|
kind: 'raw',
|
|
105
110
|
source: 'tooling/direnv/repo-path',
|
|
@@ -146,11 +151,6 @@ const managedFiles = [
|
|
|
146
151
|
target: 'tooling/direnv/merge-newer-pins.sh',
|
|
147
152
|
executable: true,
|
|
148
153
|
},
|
|
149
|
-
{
|
|
150
|
-
kind: 'raw',
|
|
151
|
-
source: 'patches/ttsc@0.19.3.patch',
|
|
152
|
-
target: 'patches/ttsc@0.19.3.patch',
|
|
153
|
-
},
|
|
154
154
|
{
|
|
155
155
|
kind: 'generated',
|
|
156
156
|
source: 'ci-workflow',
|
|
@@ -198,6 +198,7 @@ const managedFiles = [
|
|
|
198
198
|
target: '.github/actions/cache-nx/action.yml',
|
|
199
199
|
},
|
|
200
200
|
];
|
|
201
|
+
export const managedFileTargetsForTest = managedFiles.map(({ target, executable }) => ({ target, executable }));
|
|
201
202
|
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
202
203
|
export async function applyManagedFiles(root, mode) {
|
|
203
204
|
const context = await getManagedFileContext(root);
|
|
@@ -272,7 +273,7 @@ async function getManagedFileContext(root) {
|
|
|
272
273
|
const ciPushBranches = getCiPushBranches(packageJson?.json);
|
|
273
274
|
const ciRunsOn = getCiRunsOn(packageJson?.json);
|
|
274
275
|
// In-process Nx API → daemon socket (no second Node/`nx` CLI process).
|
|
275
|
-
const nxProjects = await
|
|
276
|
+
const nxProjects = await loadNxProjects(root);
|
|
276
277
|
const stagingDeploy = deployTargetInfoFromProjects(nxProjects, 'staging');
|
|
277
278
|
const productionDeploy = deployTargetInfoFromProjects(nxProjects, 'production');
|
|
278
279
|
const platformTargetGlobs = platformTargetGlobsForTest(targetNamesFromProjects(nxProjects));
|
|
@@ -299,48 +300,12 @@ export function platformTargetGlobsForTest(targetNames) {
|
|
|
299
300
|
return names.some((name) => name.endsWith(suffix));
|
|
300
301
|
});
|
|
301
302
|
}
|
|
302
|
-
/**
|
|
303
|
-
* Load resolved project nodes via Nx's programmatic API.
|
|
304
|
-
*
|
|
305
|
-
* `createProjectGraphAsync` is what the CLI uses: with the daemon up it speaks the
|
|
306
|
-
* daemon unix socket instead of rebuilding the graph in a fresh Node process.
|
|
307
|
-
* Spawning `nx graph` / `nx show` only added CLI boot + plugin-worker overhead on
|
|
308
|
-
* top of that. smoo runs under Bun; Bun can import this CJS module directly.
|
|
309
|
-
*/
|
|
310
|
-
async function loadNxGraphProjects(root) {
|
|
311
|
-
const prevCwd = process.cwd();
|
|
312
|
-
process.chdir(root);
|
|
313
|
-
try {
|
|
314
|
-
const graph = (await createProjectGraphAsync());
|
|
315
|
-
const out = {};
|
|
316
|
-
for (const [name, node] of Object.entries(graph.nodes)) {
|
|
317
|
-
out[name] = { data: { targets: node.data?.targets ?? {} } };
|
|
318
|
-
}
|
|
319
|
-
return out;
|
|
320
|
-
}
|
|
321
|
-
finally {
|
|
322
|
-
process.chdir(prevCwd);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
function targetsOfProject(node) {
|
|
326
|
-
return node.data?.targets ?? node.targets ?? {};
|
|
327
|
-
}
|
|
328
|
-
/** Test seam: collect target names from a graph.nodes map. */
|
|
329
|
-
export function targetNamesFromProjects(nodes) {
|
|
330
|
-
const targetNames = new Set();
|
|
331
|
-
for (const node of Object.values(nodes)) {
|
|
332
|
-
for (const name of Object.keys(targetsOfProject(node))) {
|
|
333
|
-
targetNames.add(name);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
return [...targetNames];
|
|
337
|
-
}
|
|
338
303
|
/** Test seam: deploy configuration presence/provider from graph nodes. */
|
|
339
|
-
export function deployTargetInfoFromProjects(
|
|
304
|
+
export function deployTargetInfoFromProjects(projects, configuration) {
|
|
340
305
|
let exists = false;
|
|
341
306
|
let provider;
|
|
342
|
-
for (const
|
|
343
|
-
const info = deployTargetInfoFromTargets(
|
|
307
|
+
for (const project of Object.values(projects)) {
|
|
308
|
+
const info = deployTargetInfoFromTargets(project.targets ?? {}, configuration);
|
|
344
309
|
if (!info.exists) {
|
|
345
310
|
continue;
|
|
346
311
|
}
|
|
@@ -113,7 +113,7 @@ export function applyWorkspaceDependencyDefaults(root, options = {}) {
|
|
|
113
113
|
else {
|
|
114
114
|
console.log('unchanged tsconfig.test.json policy');
|
|
115
115
|
}
|
|
116
|
-
if (applyWorkspaceBoundedTestTargetPolicy(root)) {
|
|
116
|
+
if (applyWorkspaceBoundedTestTargetPolicy(root, options)) {
|
|
117
117
|
console.log('updated package test targets bounded execution policy');
|
|
118
118
|
}
|
|
119
119
|
else {
|
|
@@ -343,7 +343,7 @@ export function validateWorkspaceDependencies(root, options = {}) {
|
|
|
343
343
|
console.error(`${issue.path}: ${issue.message}`);
|
|
344
344
|
failures++;
|
|
345
345
|
}
|
|
346
|
-
for (const issue of checkWorkspaceBoundedTestTargetPolicy(root)) {
|
|
346
|
+
for (const issue of checkWorkspaceBoundedTestTargetPolicy(root, options)) {
|
|
347
347
|
console.error(`${issue.path}: ${issue.message}`);
|
|
348
348
|
failures++;
|
|
349
349
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/monorepo/packs/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,mBAAmB,CAAC;AAK5E,OAAO,EAKL,KAAK,sBAAsB,EAO5B,MAAM,sBAAsB,CAAC;AAU9B,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,C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B,EACjC,KAAK,GAAE,oBAAyB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CA0B7B;AAuMD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAexG"}
|
|
@@ -315,10 +315,12 @@ export function resolvedTargetsByProject(projects) {
|
|
|
315
315
|
return new Map(projects.map((project) => [
|
|
316
316
|
project.project,
|
|
317
317
|
{
|
|
318
|
+
...(project.root ? { root: project.root } : {}),
|
|
318
319
|
targets: new Set(project.targets),
|
|
319
320
|
...(project.buildDependsOn ? { buildDependsOn: project.buildDependsOn } : {}),
|
|
320
321
|
...(project.targetDependencies ? { targetDependencies: project.targetDependencies } : {}),
|
|
321
322
|
...(project.targetExecutors ? { targetExecutors: project.targetExecutors } : {}),
|
|
323
|
+
...(project.targetOptions ? { targetOptions: project.targetOptions } : {}),
|
|
322
324
|
...(project.targetScripts ? { targetScripts: project.targetScripts } : {}),
|
|
323
325
|
},
|
|
324
326
|
]));
|
|
@@ -557,7 +557,7 @@ function renderMacosPlatformSteps(options) {
|
|
|
557
557
|
if (isSmoothBricksCodebasePackageName(options.repoName)) {
|
|
558
558
|
lines.push('', ` # Step ${stepNumber++}`, ' - name: 🏗️ Build self-hosted smoo', ' # SmoothBricks self-hosts smoo from source for release commands.', ' run: nx build cli');
|
|
559
559
|
}
|
|
560
|
-
lines.push('', ` # Step ${stepNumber++}`, ' - name: 🍎 Build selected macOS and iOS release outputs', ' run:', ` smoo release build-platform-outputs --bump "${githubExpression('inputs.bump')}" --ref "${githubExpression('github.sha')}" --targets "${MACOS_PLATFORM_TARGET_GLOBS.join(',')}" --output`, ` "${githubExpression('runner.temp')}/macos-platform-outputs"`, '', ` # Step ${stepNumber++}`, ' - name: 📤 Upload macOS platform outputs', ' uses: actions/upload-artifact@v7.0.1', ' with:', ` name: publish-macos-outputs-${githubExpression('github.run_id')}`, ` path: ${githubExpression('runner.temp')}/macos-platform-outputs`, ' if-no-files-found: error', ' retention-days: 1', ' include-hidden-files: true', '', ' # --- Cleanup ------------------------------------------------------------', '', ` # Step ${stepNumber}`, ' - name: 🧹 Cleanup and cache Nix/devenv', ' # success() is default; always() still saves GH Nix cache after a red job.', ' if: always()', ' uses: ./.github/actions/save-nix-devenv', ' with:', ` nix-cache-hit: ${githubExpression('steps.setup.outputs.nix-cache-hit')}`, ` devenv-cache-hit: ${githubExpression('steps.setup.outputs.devenv-cache-hit')}`);
|
|
560
|
+
lines.push('', ` # Step ${stepNumber++}`, ' - name: 🍎 Build selected macOS and iOS release outputs', ' run:', ` smoo release build-platform-outputs --bump "${githubExpression('inputs.bump')}" --ref "${githubExpression('github.sha')}" --targets "${MACOS_PLATFORM_TARGET_GLOBS.join(',')}" --output`, ` "${githubExpression('runner.temp')}/macos-platform-outputs"`, '', ` # Step ${stepNumber++}`, ' - name: 🧪 Unit test macOS and iOS packages', ' run:', ` smoo github-ci nx-run-many --targets test --projects-with-targets "${MACOS_PLATFORM_TARGET_GLOBS.join(',')}"`, '', ` # Step ${stepNumber++}`, ' - name: 📤 Upload macOS platform outputs', ' uses: actions/upload-artifact@v7.0.1', ' with:', ` name: publish-macos-outputs-${githubExpression('github.run_id')}`, ` path: ${githubExpression('runner.temp')}/macos-platform-outputs`, ' if-no-files-found: error', ' retention-days: 1', ' include-hidden-files: true', '', ' # --- Cleanup ------------------------------------------------------------', '', ` # Step ${stepNumber}`, ' - name: 🧹 Cleanup and cache Nix/devenv', ' # success() is default; always() still saves GH Nix cache after a red job.', ' if: always()', ' uses: ./.github/actions/save-nix-devenv', ' with:', ` nix-cache-hit: ${githubExpression('steps.setup.outputs.nix-cache-hit')}`, ` devenv-cache-hit: ${githubExpression('steps.setup.outputs.devenv-cache-hit')}`);
|
|
561
561
|
return lines.join('\n').trimEnd();
|
|
562
562
|
}
|
|
563
563
|
function renderFinalLinuxPublishSteps(options) {
|
|
@@ -9,8 +9,8 @@ export declare function syncRootRuntimeVersions(root: string): Promise<void>;
|
|
|
9
9
|
/**
|
|
10
10
|
* Validate that package.json runtime pins agree with the LIVE PATH runtimes,
|
|
11
11
|
* never a stored template. Offline by design: structural alignment only
|
|
12
|
-
* (
|
|
13
|
-
* consulted. Repair: `smoo monorepo init --runtime-only` inside the devenv shell.
|
|
12
|
+
* (Node types float within the runtime major; Bun types stay exact) — the registry
|
|
13
|
+
* is not consulted. Repair: `smoo monorepo init --runtime-only` inside the devenv shell.
|
|
14
14
|
*/
|
|
15
15
|
export declare function validateRootRuntimeVersions(root: string): Promise<number>;
|
|
16
16
|
export declare function validateRuntimePins(packageJson: PackageJson, runtime: RuntimeVersions): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/monorepo/runtime.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,WAAW,EAMjB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,mGAAmG;AACnG,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAOpF;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCzE;AAED;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAO/E;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/monorepo/runtime.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,WAAW,EAMjB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,mGAAmG;AACnG,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAOpF;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCzE;AAED;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAO/E;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,GAAG,MAAM,CA8B9F;AAED,KAAK,mBAAmB,GAAG,OAAO,GAAG,OAAO,CAAC;AAgB7C,wBAAgB,qCAAqC,CACnD,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,MAAM,CA2BR"}
|
package/dist/monorepo/runtime.js
CHANGED
|
@@ -39,8 +39,8 @@ export async function syncRootRuntimeVersions(root) {
|
|
|
39
39
|
/**
|
|
40
40
|
* Validate that package.json runtime pins agree with the LIVE PATH runtimes,
|
|
41
41
|
* never a stored template. Offline by design: structural alignment only
|
|
42
|
-
* (
|
|
43
|
-
* consulted. Repair: `smoo monorepo init --runtime-only` inside the devenv shell.
|
|
42
|
+
* (Node types float within the runtime major; Bun types stay exact) — the registry
|
|
43
|
+
* is not consulted. Repair: `smoo monorepo init --runtime-only` inside the devenv shell.
|
|
44
44
|
*/
|
|
45
45
|
export async function validateRootRuntimeVersions(root) {
|
|
46
46
|
const packageJson = readJsonObject(join(root, 'package.json'));
|
|
@@ -68,13 +68,9 @@ export function validateRuntimePins(packageJson, runtime) {
|
|
|
68
68
|
failures++;
|
|
69
69
|
}
|
|
70
70
|
const typesNode = packageJson.devDependencies?.['@types/node'] ?? null;
|
|
71
|
-
const typesNodeParts = typesNode ?
|
|
71
|
+
const typesNodeParts = typesNode ? /^\^(\d+)\.(\d+)\.(\d+)$/.exec(typesNode) : null;
|
|
72
72
|
if (!typesNodeParts || typesNodeParts[1] !== nodeMajor) {
|
|
73
|
-
console.error(`package.json @types/node is ${typesNode ?? 'missing'} but the PATH node is v${runtime.node} —
|
|
74
|
-
failures++;
|
|
75
|
-
}
|
|
76
|
-
else if (typesNodeParts[2] === '0' && typesNodeParts[3] === '0') {
|
|
77
|
-
console.error(`package.json @types/node is pinned to the ~${nodeMajor}.0.0 floor — tilde locks the first patch line and strands the repo on early broken releases; ${repair} to repin to the newest published ${nodeMajor}.x`);
|
|
73
|
+
console.error(`package.json @types/node is ${typesNode ?? 'missing'} but the PATH node is v${runtime.node} — expected a caret range within the runtime major (^${nodeMajor}.x.y); ${repair}`);
|
|
78
74
|
failures++;
|
|
79
75
|
}
|
|
80
76
|
return failures;
|
|
@@ -94,16 +90,15 @@ export function runtimeTypesRangeForPublishedVersions(packageName, runtimeVersio
|
|
|
94
90
|
}
|
|
95
91
|
if (pinMode === 'major') {
|
|
96
92
|
const runtimeMajor = parsedRuntimeVersion[0].toString();
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
// broken early release (e.g. @types/node 24.0.x's URLPattern/DOM TS2403
|
|
100
|
-
// conflict, fixed in 24.13) with no path to the repaired minors.
|
|
93
|
+
// Anchor the range at the newest published types in the runtime major. The caret
|
|
94
|
+
// admits later patches and minors without crossing into a different Node major.
|
|
101
95
|
const latestInMajor = latestVersion(versions.filter((version) => versionMajor(version) === runtimeMajor));
|
|
102
|
-
if (latestInMajor) {
|
|
103
|
-
|
|
96
|
+
if (!latestInMajor) {
|
|
97
|
+
throw new Error(`Unable to find published ${packageName} versions for runtime major ${runtimeMajor}`);
|
|
104
98
|
}
|
|
99
|
+
return `^${latestInMajor}`;
|
|
105
100
|
}
|
|
106
|
-
|
|
101
|
+
if (versions.includes(runtimeVersion)) {
|
|
107
102
|
return runtimeVersion;
|
|
108
103
|
}
|
|
109
104
|
const latest = latestVersion(versions);
|
|
@@ -111,7 +106,7 @@ export function runtimeTypesRangeForPublishedVersions(packageName, runtimeVersio
|
|
|
111
106
|
throw new Error(`Unable to find any published ${packageName} versions`);
|
|
112
107
|
}
|
|
113
108
|
console.warn(`${packageName} has no published types for runtime ${runtimeVersion}; using ${latest}`);
|
|
114
|
-
return
|
|
109
|
+
return latest;
|
|
115
110
|
}
|
|
116
111
|
function latestVersion(versions) {
|
|
117
112
|
let latest = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-validation.d.ts","sourceRoot":"","sources":["../../src/monorepo/tool-validation.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,qBAAqB,CAAC;AAU9E,MAAM,WAAW,UAAU;IACzB,sBAAsB,EAAE,OAAO,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,UAAU,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"tool-validation.d.ts","sourceRoot":"","sources":["../../src/monorepo/tool-validation.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,qBAAqB,CAAC;AAU9E,MAAM,WAAW,UAAU;IACzB,sBAAsB,EAAE,OAAO,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,UAAU,CAAC;CACpB;AAgDD,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKzE;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAStE;AAED,wBAAsB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBtG;AAqCD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAkBlF;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAY/D;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CA0B7D;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,GAAG,MAAM,CAyBvG;AAyBD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,CAoB/E;AAED,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,GAAG,MAAM,CAWhF;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqB3D;AAsED,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAQxE"}
|
|
@@ -40,8 +40,7 @@ const rootDevDependencies = [
|
|
|
40
40
|
},
|
|
41
41
|
{ name: 'nx', fallbackVersion: '23.1.0', minimumVersion: '23.1.0' },
|
|
42
42
|
{ name: 'prettier', fallbackVersion: '^3.6.1', minimumVersion: '3.6.0', prefix: '^' },
|
|
43
|
-
|
|
44
|
-
{ name: 'ttsc', fallbackVersion: '0.19.3' },
|
|
43
|
+
{ name: 'ttsc', fallbackVersion: '0.25.0' },
|
|
45
44
|
// Nx and typescript-eslint still load the TypeScript JS API (6.x).
|
|
46
45
|
// Compilation is exclusively delegated to ttsc by the Nx plugin targets.
|
|
47
46
|
{ name: 'typescript', fallbackVersion: '^6.0.3', minimumVersion: '6.0.0', prefix: '^' },
|
|
@@ -56,8 +55,7 @@ const requiredDevenvPackages = ['bun', 'git', 'git-format-staged', 'jq', 'alejan
|
|
|
56
55
|
// with the runtime is validated against the live PATH (validateRootRuntimeVersions),
|
|
57
56
|
// never against a version template here.
|
|
58
57
|
const nodePackagePattern = /(^|\s)nodejs(_\d+|_latest)?(\s|#|$)/m;
|
|
59
|
-
const
|
|
60
|
-
const TTSC_PATCH_PATH = 'patches/ttsc@0.19.3.patch';
|
|
58
|
+
const obsoleteTtscPatchedDependencyKey = 'ttsc@0.19.3';
|
|
61
59
|
export async function applyToolConfigDefaults(root) {
|
|
62
60
|
const context = await readToolContext(root);
|
|
63
61
|
await applyRootPackageToolDefaults(root, context);
|
|
@@ -67,7 +65,7 @@ export async function applyToolConfigDefaults(root) {
|
|
|
67
65
|
export async function validateToolConfig(root) {
|
|
68
66
|
const context = await readToolContext(root);
|
|
69
67
|
return (validateRootDevDependencies(context.policy, context.rootPackage) +
|
|
70
|
-
|
|
68
|
+
validateObsoleteTtscPatchRemoved(context.rootPackage) +
|
|
71
69
|
validateToolingPackage(root, context.policy) +
|
|
72
70
|
validateToolingWorkspace(context.rootPackage) +
|
|
73
71
|
validateDevenvPackages(root));
|
|
@@ -89,7 +87,7 @@ export async function applyRootDevDependencyDefaults(root, context) {
|
|
|
89
87
|
if (delete devDependencies['@smoothbricks/cli']) {
|
|
90
88
|
changed = true;
|
|
91
89
|
}
|
|
92
|
-
changed =
|
|
90
|
+
changed = removeObsoleteTtscPatch(pkg) || changed;
|
|
93
91
|
if (changed) {
|
|
94
92
|
writeJsonObject(join(root, 'package.json'), pkg);
|
|
95
93
|
console.log('updated package.json workspace tool dependencies');
|
|
@@ -105,7 +103,6 @@ async function applyRootPackageToolDefaults(root, context) {
|
|
|
105
103
|
}
|
|
106
104
|
let dependencyChanged = false;
|
|
107
105
|
let workspaceChanged = false;
|
|
108
|
-
let patchChanged = false;
|
|
109
106
|
const devDependencies = ensureDependencyMap(pkg, 'devDependencies');
|
|
110
107
|
for (const dependency of rootDevDependencies) {
|
|
111
108
|
const current = devDependencies[dependency.name];
|
|
@@ -118,8 +115,8 @@ async function applyRootPackageToolDefaults(root, context) {
|
|
|
118
115
|
dependencyChanged = true;
|
|
119
116
|
}
|
|
120
117
|
workspaceChanged = addWorkspacePattern(pkg, 'tooling');
|
|
121
|
-
|
|
122
|
-
if (dependencyChanged || workspaceChanged
|
|
118
|
+
dependencyChanged = removeObsoleteTtscPatch(pkg) || dependencyChanged;
|
|
119
|
+
if (dependencyChanged || workspaceChanged) {
|
|
123
120
|
writeJsonObject(join(root, 'package.json'), pkg);
|
|
124
121
|
}
|
|
125
122
|
console.log(dependencyChanged
|
|
@@ -128,9 +125,6 @@ async function applyRootPackageToolDefaults(root, context) {
|
|
|
128
125
|
console.log(workspaceChanged
|
|
129
126
|
? 'updated package.json tooling workspace'
|
|
130
127
|
: 'unchanged package.json tooling workspace');
|
|
131
|
-
console.log(patchChanged
|
|
132
|
-
? 'updated package.json patchedDependencies for ttsc'
|
|
133
|
-
: 'unchanged package.json patchedDependencies for ttsc');
|
|
134
128
|
}
|
|
135
129
|
export function applyToolingPackageDefaults(root, policy) {
|
|
136
130
|
const path = join(root, 'tooling', 'package.json');
|
|
@@ -219,20 +213,23 @@ export function validateRootDevDependencies(policy, rootPackage) {
|
|
|
219
213
|
}
|
|
220
214
|
return failures;
|
|
221
215
|
}
|
|
222
|
-
function
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
function validateTtscPatchedDependency(rootPackage) {
|
|
227
|
-
if (!rootPackage) {
|
|
228
|
-
return 0;
|
|
216
|
+
function removeObsoleteTtscPatch(pkg) {
|
|
217
|
+
const patchedDependencies = pkg.patchedDependencies;
|
|
218
|
+
if (!patchedDependencies || !(obsoleteTtscPatchedDependencyKey in patchedDependencies)) {
|
|
219
|
+
return false;
|
|
229
220
|
}
|
|
230
|
-
|
|
231
|
-
if (
|
|
221
|
+
delete patchedDependencies[obsoleteTtscPatchedDependencyKey];
|
|
222
|
+
if (Object.keys(patchedDependencies).length === 0) {
|
|
223
|
+
delete pkg.patchedDependencies;
|
|
224
|
+
}
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
function validateObsoleteTtscPatchRemoved(rootPackage) {
|
|
228
|
+
const patchedDependencies = rootPackage?.patchedDependencies;
|
|
229
|
+
if (!patchedDependencies || !(obsoleteTtscPatchedDependencyKey in patchedDependencies)) {
|
|
232
230
|
return 0;
|
|
233
231
|
}
|
|
234
|
-
console.error(`package.json patchedDependencies.${
|
|
235
|
-
(typeof actual === 'string' ? `; found ${actual}` : ' (required for declaration-emit fix)'));
|
|
232
|
+
console.error(`package.json patchedDependencies.${obsoleteTtscPatchedDependencyKey} must be removed; ttsc 0.25.0 emits typia declarations without the obsolete patch`);
|
|
236
233
|
return 1;
|
|
237
234
|
}
|
|
238
235
|
export function validateToolingPackage(root, policy) {
|