@smoothbricks/nx-plugin 0.4.20 → 0.4.21
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/README.md +68 -18
- package/dist/bin/smoo-nx-cargo-hash.js +5 -3
- package/dist/cargo-source-hash.d.ts +3 -1
- package/dist/cargo-source-hash.d.ts.map +1 -1
- package/dist/cargo-source-hash.js +16 -12
- package/dist/cargo-workspace.d.ts +0 -1
- package/dist/cargo-workspace.d.ts.map +1 -1
- package/dist/cargo-workspace.js +9 -2
- package/dist/ensure-built.d.ts +6 -5
- package/dist/ensure-built.d.ts.map +1 -1
- package/dist/ensure-built.js +227 -30
- package/dist/index.js +18 -10
- package/dist/managed-files/ci-workflow.d.ts +20 -0
- package/dist/managed-files/ci-workflow.d.ts.map +1 -1
- package/dist/managed-files/ci-workflow.js +42 -13
- package/dist/managed-files/files.d.ts +1 -1
- package/dist/managed-files/files.d.ts.map +1 -1
- package/dist/managed-files/files.js +8 -1
- package/dist/managed-files/pr-preview-cleanup-workflow.d.ts +37 -0
- package/dist/managed-files/pr-preview-cleanup-workflow.d.ts.map +1 -1
- package/dist/managed-files/pr-preview-cleanup-workflow.js +34 -6
- package/dist/workspace-manifest.d.ts +3 -1
- package/dist/workspace-manifest.d.ts.map +1 -1
- package/managed/raw/tooling/direnv/setup-environment.ts +23 -91
- package/managed/raw/tooling/git-hooks/commit-msg.sh +6 -0
- package/managed/raw/tooling/git-hooks/pre-commit.sh +6 -0
- package/managed/raw/tooling/git-hooks/pre-push.sh +6 -0
- package/managed/templates/github/actions/setup-devenv/action.yml +19 -7
- package/package.json +1 -1
- package/src/bin/smoo-nx-cargo-hash.ts +7 -3
- package/src/cargo-source-hash.test.ts +196 -1
- package/src/cargo-source-hash.ts +22 -14
- package/src/cargo-workspace.test.ts +17 -10
- package/src/cargo-workspace.ts +9 -3
- package/src/ensure-built.test.ts +87 -29
- package/src/ensure-built.ts +274 -29
- package/src/index.test.ts +117 -20
- package/src/index.ts +18 -11
- package/src/managed-files/ci-workflow.ts +45 -14
- package/src/managed-files/files.ts +9 -2
- package/src/managed-files/generator.test.ts +5 -1
- package/src/managed-files/github-host-cache-isolation.test.ts +32 -6
- package/src/managed-files/pr-preview-cleanup-workflow.ts +87 -6
- package/src/workspace-manifest.ts +3 -1
package/dist/index.js
CHANGED
|
@@ -1361,20 +1361,26 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
|
|
|
1361
1361
|
options: { command: WRANGLER_DEPLOY_COMMAND, cwd: projectRoot },
|
|
1362
1362
|
};
|
|
1363
1363
|
}
|
|
1364
|
-
//
|
|
1365
|
-
// under dist belongs to the concrete target that
|
|
1366
|
-
// `{projectRoot}/dist` here would cache the children's
|
|
1367
|
-
// under the aggregate's hash, and would make `smoo
|
|
1368
|
-
// --collect-outputs` attribute to `build` whatever sits
|
|
1369
|
-
// platform-target artifacts the collect excludes on
|
|
1370
|
-
// artifacts of targets that never ran. Two collected trees
|
|
1371
|
-
// binary and `apply-outputs` rejects the overlap.
|
|
1364
|
+
// Empty `outputs`, deliberately and explicitly: this aggregate runs no
|
|
1365
|
+
// command, so every file under dist belongs to the concrete target that
|
|
1366
|
+
// emitted it. Claiming `{projectRoot}/dist` here would cache the children's
|
|
1367
|
+
// bytes a second time under the aggregate's hash, and would make `smoo
|
|
1368
|
+
// github-ci nx-run-many --collect-outputs` attribute to `build` whatever sits
|
|
1369
|
+
// under dist — including platform-target artifacts the collect excludes on
|
|
1370
|
+
// purpose and stale artifacts of targets that never ran. Two collected trees
|
|
1371
|
+
// then claim one binary and `apply-outputs` rejects the overlap. Omitting the
|
|
1372
|
+
// key is not the same thing: Nx gives a `build` or `prepare` target without
|
|
1373
|
+
// `outputs` its legacy defaults (`{projectRoot}/dist`, `/build`, `/public`,
|
|
1374
|
+
// `dist/{projectRoot}`), so a cache hit on the aggregate — whose key does
|
|
1375
|
+
// not move when only a child's own inputs do — restored the children's
|
|
1376
|
+
// previous dist over what they had just emitted. `lint` and `test` are
|
|
1372
1377
|
// aggregates on the same terms. Same reason nx.json must not put `outputs` in
|
|
1373
1378
|
// targetDefaults.build (see validateBuildTargetDefault).
|
|
1374
1379
|
if (hasOrdinaryBuildOutputTarget) {
|
|
1375
1380
|
targets.build = {
|
|
1376
1381
|
executor: 'nx:noop',
|
|
1377
1382
|
cache: true,
|
|
1383
|
+
outputs: [],
|
|
1378
1384
|
// `cargo-napi` is both an output family and a serialized cargo writer, so
|
|
1379
1385
|
// the two sources overlap; the Set keeps one edge per target while holding
|
|
1380
1386
|
// the order the families are listed in.
|
|
@@ -1967,7 +1973,10 @@ async function addCargoTestTargets(targets, currentProjectName, projectRoot, wor
|
|
|
1967
1973
|
if (plan.package.projectRoot !== projectRoot) {
|
|
1968
1974
|
continue;
|
|
1969
1975
|
}
|
|
1970
|
-
|
|
1976
|
+
// Workspace-anchored for the reason `cargoPackageTestInputs` gives: a
|
|
1977
|
+
// `{projectRoot}` glob hashes only files this project owns, and sibling
|
|
1978
|
+
// manifests belong to whichever nested project holds them.
|
|
1979
|
+
const inputRoot = posix.join('{workspaceRoot}', workspace.projectRoot);
|
|
1971
1980
|
// A workspace nextest build unifies features across every selected member.
|
|
1972
1981
|
// A sibling manifest can therefore change this crate's tests without being
|
|
1973
1982
|
// a path dependency. Track those manifests, not unrelated sibling sources.
|
|
@@ -1981,7 +1990,6 @@ async function addCargoTestTargets(targets, currentProjectName, projectRoot, wor
|
|
|
1981
1990
|
workspaceRoot,
|
|
1982
1991
|
absoluteProjectRoot: join(workspaceRoot, workspace.projectRoot),
|
|
1983
1992
|
memberDir: plan.package.dir,
|
|
1984
|
-
inputRoot,
|
|
1985
1993
|
cache: workspace.inputsCache,
|
|
1986
1994
|
})),
|
|
1987
1995
|
...workspace.packages.map((member) => posix.join(inputRoot, member.package.dir, 'Cargo.toml')),
|
|
@@ -133,6 +133,17 @@ export interface CiWorkflowDefinitionOptions extends DeployStepSecretConfig {
|
|
|
133
133
|
platformProducer?: PackageSmooGithub['platformProducer'];
|
|
134
134
|
}
|
|
135
135
|
export declare function defineCiWorkflow(options: CiWorkflowDefinitionOptions): CiWorkflowStep[];
|
|
136
|
+
/**
|
|
137
|
+
* CI's concurrency group: one per pull request, by its number, and one per ref
|
|
138
|
+
* for pushes. The PR preview cleanup joins the same group, so a pull request's
|
|
139
|
+
* close cancels its running CI and the cleanup starts only after that run's
|
|
140
|
+
* stage deploy has stopped. The number, not `github.ref`, names a pull
|
|
141
|
+
* request's group: a close that merged it carries the base branch's ref, which
|
|
142
|
+
* would put the cleanup in the base branch's own group, and a forge may spell a
|
|
143
|
+
* pull request's ref after its merge or after its head. Spelled literally
|
|
144
|
+
* rather than from `github.workflow`, which a forge may fill with the file name.
|
|
145
|
+
*/
|
|
146
|
+
export declare const CI_CONCURRENCY_GROUP = "CI-${{ github.event.pull_request.number || github.ref }}";
|
|
136
147
|
export declare function renderCiWorkflowYaml(options: CiWorkflowDefinitionOptions): string;
|
|
137
148
|
/** Job env for `.npmrc` token expansion. Registry URL is not a GitHub variable. */
|
|
138
149
|
export declare function privateNpmReadTokenJobEnv(options: Pick<CiWorkflowDefinitionOptions, 'privateNpm'>): string;
|
|
@@ -199,6 +210,8 @@ export declare function normalizeCargoCredentials(config: PackageCargoCredential
|
|
|
199
210
|
* checked-in managed output byte-identical across regeneration and hooks.
|
|
200
211
|
*/
|
|
201
212
|
export declare const SAME_REPO_GATE_FOLDED: string[];
|
|
213
|
+
/** A job's `environment:` line, or nothing when no GitHub Environment is declared. */
|
|
214
|
+
export declare function environmentLine(name: string | undefined): string;
|
|
202
215
|
/**
|
|
203
216
|
* The step-scoped `env:` block for a deploy step. Step scope is the property
|
|
204
217
|
* being rendered, not an accident of indentation: job env would hand the
|
|
@@ -211,5 +224,12 @@ export declare const SAME_REPO_GATE_FOLDED: string[];
|
|
|
211
224
|
* once in `deploySecrets` instead of being overridden here.
|
|
212
225
|
*/
|
|
213
226
|
export declare function deployStepSecretEnvLines(config: DeployStepSecretConfig): string[];
|
|
227
|
+
/**
|
|
228
|
+
* The step env for a step that acts on Cloudflare as the stage deploy did: the
|
|
229
|
+
* two Cloudflare credentials, read from the secrets `deployStepSecretEnvLines`
|
|
230
|
+
* names for them, and none of the other deploy secrets, which such a step
|
|
231
|
+
* never uses.
|
|
232
|
+
*/
|
|
233
|
+
export declare function cloudflareCredentialEnvLines(deploySecrets: Record<string, string> | undefined): string[];
|
|
214
234
|
export declare function artifactStepLines(provider: PackageSmooGithub['actionsProvider'], name: string, kind: 'upload' | 'download', inputs: readonly string[], condition?: string): string[];
|
|
215
235
|
//# sourceMappingURL=ci-workflow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-workflow.d.ts","sourceRoot":"","sources":["../../src/managed-files/ci-workflow.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,aAAa,EACb,6BAA6B,EAE7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAGlC,oBAAY,kBAAkB;IAC5B,QAAQ,aAAa;IACrB,eAAe,qBAAqB;IACpC,WAAW,iBAAiB;IAC5B,gBAAgB,sBAAsB;IACtC,SAAS,gBAAgB;IACzB,cAAc,qBAAqB;IACnC,KAAK,UAAU;IACf,YAAY,kBAAkB;IAC9B,IAAI,SAAS;IACb,SAAS,eAAe;IACxB,uBAAuB,8BAA8B;IACrD,iBAAiB,wBAAwB;IACzC,uBAAuB,+BAA+B;IACtD,yBAAyB,iCAAiC;IAC1D,UAAU,gBAAgB;IAC1B,iBAAiB,wBAAwB;IACzC,oBAAoB,2BAA2B;IAC/C,MAAM,WAAW;IACjB,WAAW,kBAAkB;IAC7B,cAAc,qBAAqB;IACnC,aAAa,oBAAoB;CAClC;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;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,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,EAC9C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,GAAG,UAAU,EAC3B,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,SAAS,SAAc,GACtB,MAAM,EAAE,CAmBV"}
|
|
@@ -63,6 +63,17 @@ export function defineCiWorkflow(options) {
|
|
|
63
63
|
steps.push({ kind: CiWorkflowStepKind.ManagedFilesCheck, name: '🩺 Check managed-file drift' }, { kind: CiWorkflowStepKind.ManagedFilesDispatch, name: '🔁 Dispatch managed-file drift healing' }, { kind: CiWorkflowStepKind.SaveNxCache, name: '💾 Save Nx cache' }, { kind: CiWorkflowStepKind.UploadTraceDbs, name: '📎 Upload trace DBs' }, { kind: CiWorkflowStepKind.SaveNixDevenv, name: '🧹 Cleanup and cache Nix/devenv' });
|
|
64
64
|
return steps.map((step, index) => ({ ...step, number: index + 2 }));
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* CI's concurrency group: one per pull request, by its number, and one per ref
|
|
68
|
+
* for pushes. The PR preview cleanup joins the same group, so a pull request's
|
|
69
|
+
* close cancels its running CI and the cleanup starts only after that run's
|
|
70
|
+
* stage deploy has stopped. The number, not `github.ref`, names a pull
|
|
71
|
+
* request's group: a close that merged it carries the base branch's ref, which
|
|
72
|
+
* would put the cleanup in the base branch's own group, and a forge may spell a
|
|
73
|
+
* pull request's ref after its merge or after its head. Spelled literally
|
|
74
|
+
* rather than from `github.workflow`, which a forge may fill with the file name.
|
|
75
|
+
*/
|
|
76
|
+
export const CI_CONCURRENCY_GROUP = 'CI-${{ github.event.pull_request.number || github.ref }}';
|
|
66
77
|
export function renderCiWorkflowYaml(options) {
|
|
67
78
|
const steps = defineCiWorkflow(options);
|
|
68
79
|
return [
|
|
@@ -90,17 +101,18 @@ ${options.deploy ? ' deployments: write\n' : ''} statuses: write
|
|
|
90
101
|
|
|
91
102
|
concurrency:
|
|
92
103
|
${options.deploy
|
|
93
|
-
? ` # One in-flight run per
|
|
94
|
-
# running workflow instead of canceling it,
|
|
95
|
-
# deploy job mid-flight. Pull requests and
|
|
96
|
-
# superseded runs.
|
|
97
|
-
group:
|
|
104
|
+
? ` # One in-flight run per pull request, and per ref for pushes. Pushes to the
|
|
105
|
+
# staging push branch queue behind a running workflow instead of canceling it,
|
|
106
|
+
# so a newer push never cancels the deploy job mid-flight. Pull requests and
|
|
107
|
+
# other branches keep canceling superseded runs.
|
|
108
|
+
group: ${CI_CONCURRENCY_GROUP}
|
|
98
109
|
cancel-in-progress: \${{ github.ref != ${stagingRefLiteral(options)} }}`
|
|
99
110
|
: ` # This workflow validates and never deploys, so there is no in-flight
|
|
100
|
-
# deployment for a newer push to protect: every
|
|
101
|
-
# runs. Queuing them instead serializes
|
|
102
|
-
#
|
|
103
|
-
|
|
111
|
+
# deployment for a newer push to protect: every pull request, and every ref
|
|
112
|
+
# for pushes, cancels its superseded runs. Queuing them instead serializes
|
|
113
|
+
# the staging branch, and a burst of pushes then reports the newest commit
|
|
114
|
+
# one full run per queued push late.
|
|
115
|
+
group: ${CI_CONCURRENCY_GROUP}
|
|
104
116
|
cancel-in-progress: true`}
|
|
105
117
|
|
|
106
118
|
defaults:
|
|
@@ -806,9 +818,15 @@ function yamlScalar(value) {
|
|
|
806
818
|
function stagingRefLiteral(options) {
|
|
807
819
|
return `'refs/heads/${stagingPushBranch(options).replaceAll("'", "''")}'`;
|
|
808
820
|
}
|
|
809
|
-
|
|
821
|
+
/** A job's `environment:` line, or nothing when no GitHub Environment is declared. */
|
|
822
|
+
export function environmentLine(name) {
|
|
810
823
|
return name ? ` environment: ${yamlScalar(name)}\n` : '';
|
|
811
824
|
}
|
|
825
|
+
/** The Cloudflare credentials a deploy step carries, env var name → default repository secret name. */
|
|
826
|
+
const CLOUDFLARE_DEPLOY_SECRETS = {
|
|
827
|
+
CLOUDFLARE_API_TOKEN: 'CLOUDFLARE_API_TOKEN',
|
|
828
|
+
CLOUDFLARE_ACCOUNT_ID: 'CLOUDFLARE_ACCOUNT_ID',
|
|
829
|
+
};
|
|
812
830
|
/**
|
|
813
831
|
* The step-scoped `env:` block for a deploy step. Step scope is the property
|
|
814
832
|
* being rendered, not an accident of indentation: job env would hand the
|
|
@@ -821,11 +839,22 @@ function environmentLine(name) {
|
|
|
821
839
|
* once in `deploySecrets` instead of being overridden here.
|
|
822
840
|
*/
|
|
823
841
|
export function deployStepSecretEnvLines(config) {
|
|
824
|
-
const cloudflare = config.deployProvider === 'cloudflare'
|
|
825
|
-
? { CLOUDFLARE_API_TOKEN: 'CLOUDFLARE_API_TOKEN', CLOUDFLARE_ACCOUNT_ID: 'CLOUDFLARE_ACCOUNT_ID' }
|
|
826
|
-
: {};
|
|
842
|
+
const cloudflare = config.deployProvider === 'cloudflare' ? CLOUDFLARE_DEPLOY_SECRETS : {};
|
|
827
843
|
return secretEnvLines({ ...cloudflare, ...config.deploySecrets });
|
|
828
844
|
}
|
|
845
|
+
/**
|
|
846
|
+
* The step env for a step that acts on Cloudflare as the stage deploy did: the
|
|
847
|
+
* two Cloudflare credentials, read from the secrets `deployStepSecretEnvLines`
|
|
848
|
+
* names for them, and none of the other deploy secrets, which such a step
|
|
849
|
+
* never uses.
|
|
850
|
+
*/
|
|
851
|
+
export function cloudflareCredentialEnvLines(deploySecrets) {
|
|
852
|
+
const credentials = Object.entries(CLOUDFLARE_DEPLOY_SECRETS).map(([name, secret]) => [
|
|
853
|
+
name,
|
|
854
|
+
deploySecrets?.[name] ?? secret,
|
|
855
|
+
]);
|
|
856
|
+
return secretEnvLines(Object.fromEntries(credentials));
|
|
857
|
+
}
|
|
829
858
|
/** A step-level `env:` block mapping env var names to repository secrets; nothing when there are none. */
|
|
830
859
|
function secretEnvLines(secrets) {
|
|
831
860
|
const entries = Object.entries(secrets);
|
|
@@ -55,5 +55,5 @@ export declare function managedFileTargetsForContext(context: ManagedFileContext
|
|
|
55
55
|
/** Render all packaged templates before staging any workspace changes. */
|
|
56
56
|
export declare function renderManagedFiles(context: ManagedFileContext): ManagedFile[];
|
|
57
57
|
/** Renders a generated workflow through its real managed-file descriptor, so the context wiring is covered. */
|
|
58
|
-
export declare function renderManagedWorkflowForTest(source: 'ci-workflow' | 'publish-workflow', context: ManagedFileContext): string;
|
|
58
|
+
export declare function renderManagedWorkflowForTest(source: 'ci-workflow' | 'publish-workflow' | 'pr-preview-cleanup-workflow', context: ManagedFileContext): string;
|
|
59
59
|
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/managed-files/files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,kBAAkB,EAAmD,MAAM,kBAAkB,CAAC;AAI5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAa7C,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,uBAAuB,EAAE,OAAO,CAAC;IACjC,0BAA0B,EAAE,OAAO,CAAC;IACpC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,uBAAuB,EAAE,OAAO,CAAC;IACjC,8BAA8B,EAAE,OAAO,CAAC;IACxC,qBAAqB,CAAC,EAAE,YAAY,CAAC;IACrC,wBAAwB,CAAC,EAAE,YAAY,CAAC;IACxC,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,yFAAyF;IACzF,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IACzD,eAAe,CAAC,EAAE,iBA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AE,2BAA2B,EAAE,CAAC;IAChD,kGAAkG;IAClG,gBAAgB,CAAC,EAAE,6BAA6B,CAAC;IACjD,uGAAuG;IACvG,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC;;;;OAIG;IACH,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;CACzC;AAED,sFAAsF;AACtF,eAAO,MAAM,gBAAgB;aAC3B,OAAO,EAAE,QAAQ;aACjB,GAAG,EAAE,aAAa;aAClB,IAAI,EAAE,2BAA2B;CACzB,CAAC;AAmJX,eAAO,MAAM,yBAAyB;;;GAAyE,CAAC;AAchH,qFAAqF;AACrF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAElF;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,EAAE,CAM7E;AAED,+GAA+G;AAC/G,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,aAAa,GAAG,kBAAkB,GAAG,6BAA6B,EAC1E,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CAMR"}
|
|
@@ -235,7 +235,14 @@ function getManagedContent(file, context) {
|
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
if (file.source === 'pr-preview-cleanup-workflow') {
|
|
238
|
-
return renderPrPreviewCleanupWorkflowYaml({
|
|
238
|
+
return renderPrPreviewCleanupWorkflowYaml({
|
|
239
|
+
runsOn: context.ciRunsOn,
|
|
240
|
+
privateNpm: context.privateNpm,
|
|
241
|
+
sourceCheckouts: context.sourceCheckouts,
|
|
242
|
+
cargoCredentials: context.cargoCredentials,
|
|
243
|
+
environments: context.ciEnvironments,
|
|
244
|
+
deploySecrets: context.ciDeploySecrets,
|
|
245
|
+
});
|
|
239
246
|
}
|
|
240
247
|
throw new Error(`Unknown generated managed file source ${file.source}`);
|
|
241
248
|
}
|
|
@@ -1,5 +1,42 @@
|
|
|
1
|
+
import type { PackageCargoCredentialsConfig, PackagePrivateNpmConfig, PackageSmooGithubEnvironments, PackageSourceCheckoutConfig } from '../workspace-manifest.js';
|
|
1
2
|
export interface PrPreviewCleanupWorkflowOptions {
|
|
2
3
|
runsOn?: string | string[];
|
|
4
|
+
/**
|
|
5
|
+
* Declared private-npm opt-in. The job runs setup-devenv, whose dependency
|
|
6
|
+
* install refuses in CI when a declared registry credential is absent from
|
|
7
|
+
* the job environment, so the read token rides the job env exactly as it
|
|
8
|
+
* does on every CI job that runs setup-devenv. The remote-cache token stays
|
|
9
|
+
* out: shell entry defers it, and nothing in this job runs Nx.
|
|
10
|
+
*/
|
|
11
|
+
privateNpm?: PackagePrivateNpmConfig;
|
|
12
|
+
/**
|
|
13
|
+
* Declared sibling source checkouts, cloned before setup-devenv as on every
|
|
14
|
+
* CI job that runs it: the devenv shell and the install resolve path
|
|
15
|
+
* dependencies on them.
|
|
16
|
+
*/
|
|
17
|
+
sourceCheckouts?: PackageSourceCheckoutConfig[];
|
|
18
|
+
/**
|
|
19
|
+
* Declared Cargo credentials, rendered as on every CI job that runs
|
|
20
|
+
* setup-devenv: the tokens at job level, where setup resolves the declared
|
|
21
|
+
* secrets, and the credential step before the sibling clones. That step is
|
|
22
|
+
* not only for Cargo: later git commands in the job read the git
|
|
23
|
+
* configuration it writes to GITHUB_ENV (the credential helper, the runner
|
|
24
|
+
* proxy, the rewrite from each origin to its internal mirror), so a sibling
|
|
25
|
+
* clone declared without `tokenEnv` takes the mirror as it does in CI. One
|
|
26
|
+
* declared with `tokenEnv` sets GIT_CONFIG_COUNT=1 for its own auth header,
|
|
27
|
+
* which replaces that configuration: it gets no helper, proxy or rewrite.
|
|
28
|
+
*/
|
|
29
|
+
cargoCredentials?: PackageCargoCredentialsConfig;
|
|
30
|
+
/**
|
|
31
|
+
* The cleanup deletes what the stage deploy created, in the account the
|
|
32
|
+
* deploy's CLOUDFLARE_ACCOUNT_ID names, so it must read the credentials
|
|
33
|
+
* that deploy read. The job therefore runs in the staging Environment the
|
|
34
|
+
* stage deploy runs in, whose secrets shadow the repository's, and reads
|
|
35
|
+
* the Cloudflare credentials through the same `deploySecrets` mapping.
|
|
36
|
+
*/
|
|
37
|
+
environments?: PackageSmooGithubEnvironments;
|
|
38
|
+
/** Deploy-step secrets; only the two Cloudflare credentials reach the cleanup. */
|
|
39
|
+
deploySecrets?: Record<string, string>;
|
|
3
40
|
}
|
|
4
41
|
export declare function renderPrPreviewCleanupWorkflowYaml(options?: PrPreviewCleanupWorkflowOptions): string;
|
|
5
42
|
//# sourceMappingURL=pr-preview-cleanup-workflow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-preview-cleanup-workflow.d.ts","sourceRoot":"","sources":["../../src/managed-files/pr-preview-cleanup-workflow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pr-preview-cleanup-workflow.d.ts","sourceRoot":"","sources":["../../src/managed-files/pr-preview-cleanup-workflow.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAalC,MAAM,WAAW,+BAA+B;IAC9C,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC;;;;OAIG;IACH,eAAe,CAAC,EAAE,2BAA2B,EAAE,CAAC;IAChD;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,6BAA6B,CAAC;IACjD;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,6BAA6B,CAAC;IAC7C,kFAAkF;IAClF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED,wBAAgB,kCAAkC,CAAC,OAAO,GAAE,+BAAoC,GAAG,MAAM,CAwCxG"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* biome-ignore-all lint/suspicious/noTemplateCurlyInString: GitHub Actions expressions are emitted literally. */
|
|
2
|
+
import { CI_CONCURRENCY_GROUP, CiWorkflowStepKind, cargoCredentialJobEnvLines, cargoCredentialStepLines, cloudflareCredentialEnvLines, environmentLine, privateNpmReadTokenJobEnv, sourceCheckoutsStepLines, } from './ci-workflow.js';
|
|
2
3
|
import { renderRunsOnLine } from './github-runs-on.js';
|
|
3
4
|
export function renderPrPreviewCleanupWorkflowYaml(options = {}) {
|
|
4
5
|
return `name: PR Preview Cleanup
|
|
@@ -10,29 +11,56 @@ on:
|
|
|
10
11
|
permissions:
|
|
11
12
|
contents: read
|
|
12
13
|
|
|
14
|
+
# The pull request's CI group, named by its number whether the close merged it
|
|
15
|
+
# or not: closing it cancels its running CI run, so the cleanup starts only
|
|
16
|
+
# after that run's stage deploy has stopped.
|
|
17
|
+
concurrency:
|
|
18
|
+
group: ${CI_CONCURRENCY_GROUP}
|
|
19
|
+
cancel-in-progress: true
|
|
20
|
+
|
|
13
21
|
jobs:
|
|
14
22
|
cleanup:
|
|
15
23
|
name: Cleanup PR environment
|
|
16
24
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
|
17
25
|
${renderRunsOnLine(options.runsOn)}
|
|
18
26
|
timeout-minutes: 15
|
|
19
|
-
defaults:
|
|
27
|
+
${environmentLine(options.environments?.staging)} defaults:
|
|
20
28
|
run:
|
|
21
29
|
working-directory: tooling/direnv
|
|
22
|
-
steps:
|
|
30
|
+
${setupJobEnv(options)} steps:
|
|
23
31
|
- name: Checkout
|
|
24
32
|
uses: actions/checkout@v6.0.2
|
|
25
33
|
with:
|
|
26
34
|
filter: blob:none
|
|
27
35
|
fetch-depth: 1
|
|
28
|
-
|
|
36
|
+
${preflightSteps(options)}
|
|
29
37
|
- name: Setup Nix/devenv
|
|
30
38
|
uses: ./.github/actions/setup-devenv
|
|
31
39
|
|
|
32
40
|
- name: Cleanup PR environment
|
|
33
|
-
|
|
34
|
-
CLOUDFLARE_API_TOKEN: \${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
35
|
-
CLOUDFLARE_ACCOUNT_ID: \${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
41
|
+
${cloudflareCredentialEnvLines(options.deploySecrets).join('\n')}
|
|
36
42
|
run: smoo wrangler cleanup-pr --pr \${{ github.event.pull_request.number }}
|
|
37
43
|
`;
|
|
38
44
|
}
|
|
45
|
+
/** The job env setup-devenv needs, as the CI jobs spell it; nothing for a repository that declares no credential. */
|
|
46
|
+
function setupJobEnv(options) {
|
|
47
|
+
const tokenLines = `${cargoCredentialJobEnvLines(options.cargoCredentials)}${privateNpmReadTokenJobEnv(options)}`;
|
|
48
|
+
return tokenLines === '' ? '' : ` env:\n${tokenLines}`;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The CI jobs' steps between checkout and setup-devenv, in their order and each
|
|
52
|
+
* set off by blank lines: the Cargo credential step, then the sibling-source
|
|
53
|
+
* clones. Nothing when neither is declared.
|
|
54
|
+
*/
|
|
55
|
+
function preflightSteps(options) {
|
|
56
|
+
const steps = [];
|
|
57
|
+
if (options.cargoCredentials !== undefined) {
|
|
58
|
+
const step = { kind: CiWorkflowStepKind.CargoCredentials, name: 'Prepare Cargo credentials', number: 0 };
|
|
59
|
+
steps.push(cargoCredentialStepLines(step, options.cargoCredentials));
|
|
60
|
+
}
|
|
61
|
+
if (options.sourceCheckouts?.length) {
|
|
62
|
+
const step = { kind: CiWorkflowStepKind.SourceCheckouts, name: 'Check out sibling sources', number: 0 };
|
|
63
|
+
steps.push(sourceCheckoutsStepLines(step, options.sourceCheckouts));
|
|
64
|
+
}
|
|
65
|
+
return steps.map((lines) => `\n${lines.join('\n')}\n`).join('');
|
|
66
|
+
}
|
|
@@ -32,7 +32,7 @@ export interface PackagePublishConfig {
|
|
|
32
32
|
registry?: string;
|
|
33
33
|
}
|
|
34
34
|
export interface PackageSmooGithubEnvironments {
|
|
35
|
-
/** GitHub Environment for the staging deploy and
|
|
35
|
+
/** GitHub Environment for the staging deploy, e2e and PR preview cleanup jobs. */
|
|
36
36
|
staging?: string;
|
|
37
37
|
/** GitHub Environment for the production-on-push deploy job. */
|
|
38
38
|
production?: string;
|
|
@@ -247,6 +247,8 @@ export interface PackageJson {
|
|
|
247
247
|
optionalDependencies?: StringMap;
|
|
248
248
|
/** Bun patchedDependencies map (package@version → patch path). */
|
|
249
249
|
patchedDependencies?: StringMap;
|
|
250
|
+
overrides?: StringMap;
|
|
251
|
+
resolutions?: StringMap;
|
|
250
252
|
engines?: StringMap;
|
|
251
253
|
scripts?: StringMap;
|
|
252
254
|
publishConfig?: PackagePublishConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-manifest.d.ts","sourceRoot":"","sources":["../src/workspace-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,sDAAsD;AACtD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/C,2DAA2D;AAC3D,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAE3C,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,aAAa,CAAC,CAAC,CAAC,CAEnE;AAED,mHAAmH;AACnH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GACvC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GACvB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;AAEvD,oEAAoE;AACpE,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAEhE,qGAAqG;AAC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AM,CAAC;AAEtC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAChD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,MAAM;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;CAChF;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB,GAAG,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,CAE3F"}
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
symlinkSync,
|
|
11
11
|
writeFileSync,
|
|
12
12
|
} from 'node:fs';
|
|
13
|
-
import { mkdir, rmdir, stat } from 'node:fs/promises';
|
|
14
13
|
import { createRequire } from 'node:module';
|
|
15
14
|
import path from 'node:path';
|
|
16
15
|
import { $ } from 'bun';
|
|
@@ -78,12 +77,6 @@ async function resolveProjectRoot(): Promise<string> {
|
|
|
78
77
|
|
|
79
78
|
const projectRoot = await resolveProjectRoot();
|
|
80
79
|
|
|
81
|
-
// A legitimate concurrent setup finishes well within this; anything older is a
|
|
82
|
-
// leftover from an interrupted run (CTRL-C/kill before the finally-cleanup) and
|
|
83
|
-
// would otherwise wedge every future shell load behind the 120s spin + EEXIST.
|
|
84
|
-
// NOTE: must be declared ABOVE the top-level setup block below — module consts
|
|
85
|
-
// are not hoisted, and the lock loop runs during that block.
|
|
86
|
-
const STALE_LOCK_MS = 10 * 60_000;
|
|
87
80
|
// Unscoped require("typescript") must expose the TS6 compiler API for Nx.
|
|
88
81
|
// @typescript/native installs another package also named "typescript" (TS7). Bun's
|
|
89
82
|
// isolated linker RACES the node_modules/.bun/node_modules/typescript fallback link
|
|
@@ -124,28 +117,24 @@ try {
|
|
|
124
117
|
// and package resolution/Typia transforms are not available yet.
|
|
125
118
|
if (process.env.CI) {
|
|
126
119
|
await resolveSecrets();
|
|
127
|
-
//
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
// skips the finally that releases the lock and strands it, so failures
|
|
132
|
-
// are captured inside and reported outside.
|
|
120
|
+
// Failures are captured and reported below. Exiting in the catch would
|
|
121
|
+
// skip the git-diff diagnostic that follows a frozen-lockfile miss.
|
|
122
|
+
// bun install already races concurrent installs with an atomic cache
|
|
123
|
+
// rename; this script does not add a second mutex around it.
|
|
133
124
|
let frozenError: unknown;
|
|
134
125
|
let fallbackError: unknown;
|
|
135
|
-
|
|
126
|
+
try {
|
|
127
|
+
await runSetupCommand('bun install --frozen-lockfile', $`bun install --frozen-lockfile`, { quiet: false });
|
|
128
|
+
} catch (error) {
|
|
129
|
+
frozenError = error;
|
|
130
|
+
console.error('! Failed to install dependencies with frozen lockfile');
|
|
131
|
+
replayCapturedOutput(error);
|
|
136
132
|
try {
|
|
137
|
-
await runSetupCommand('bun install
|
|
138
|
-
} catch (
|
|
139
|
-
|
|
140
|
-
console.error('! Failed to install dependencies with frozen lockfile');
|
|
141
|
-
replayCapturedOutput(error);
|
|
142
|
-
try {
|
|
143
|
-
await runSetupCommand('bun install', $`bun install`, { quiet: false });
|
|
144
|
-
} catch (fallback) {
|
|
145
|
-
fallbackError = fallback;
|
|
146
|
-
}
|
|
133
|
+
await runSetupCommand('bun install', $`bun install`, { quiet: false });
|
|
134
|
+
} catch (fallback) {
|
|
135
|
+
fallbackError = fallback;
|
|
147
136
|
}
|
|
148
|
-
}
|
|
137
|
+
}
|
|
149
138
|
if (fallbackError !== undefined) {
|
|
150
139
|
reportSetupFailure(fallbackError);
|
|
151
140
|
}
|
|
@@ -214,19 +203,15 @@ async function installLocalDependencies(): Promise<unknown> {
|
|
|
214
203
|
} catch (error) {
|
|
215
204
|
return error;
|
|
216
205
|
}
|
|
217
|
-
//
|
|
218
|
-
//
|
|
219
|
-
//
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
installError = error;
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
return installError;
|
|
206
|
+
// Returned, not thrown: the caller still wires git config, then reports a
|
|
207
|
+
// degraded shell. Same reason as the CI branch — bun install's own rename
|
|
208
|
+
// is the concurrency control, not a lock in this script.
|
|
209
|
+
try {
|
|
210
|
+
await runSetupCommand('bun install --no-summary', $`bun install --no-summary`);
|
|
211
|
+
} catch (error) {
|
|
212
|
+
return error;
|
|
213
|
+
}
|
|
214
|
+
return undefined;
|
|
230
215
|
}
|
|
231
216
|
|
|
232
217
|
function ensureTypeScriptApiPackage(root: string): void {
|
|
@@ -457,59 +442,6 @@ async function runSetupCommand(
|
|
|
457
442
|
}
|
|
458
443
|
}
|
|
459
444
|
|
|
460
|
-
async function withSetupLock<T>(fn: () => Promise<T>): Promise<T> {
|
|
461
|
-
const lockDir = path.join(projectRoot, 'tooling/direnv/.devenv/setup-environment.lock');
|
|
462
|
-
await acquireLock(lockDir);
|
|
463
|
-
try {
|
|
464
|
-
return await fn();
|
|
465
|
-
} finally {
|
|
466
|
-
await rmdir(lockDir).catch(() => undefined);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
async function acquireLock(lockDir: string): Promise<void> {
|
|
471
|
-
const deadline = Date.now() + 120_000;
|
|
472
|
-
while (true) {
|
|
473
|
-
try {
|
|
474
|
-
await mkdir(lockDir, { recursive: false });
|
|
475
|
-
return;
|
|
476
|
-
} catch (error) {
|
|
477
|
-
if (!isFileExistsError(error) || Date.now() > deadline) {
|
|
478
|
-
throw error;
|
|
479
|
-
}
|
|
480
|
-
if (await isStaleLock(lockDir)) {
|
|
481
|
-
// Surface the self-heal so an interrupted-run leftover is visible in
|
|
482
|
-
// the direnv log rather than silently absorbed.
|
|
483
|
-
console.error(`! Breaking stale setup lock (${lockDir}) left by an interrupted run`);
|
|
484
|
-
// Best-effort: if a concurrent process breaks it first, the rmdir
|
|
485
|
-
// fails silently and the next mkdir attempt settles the race.
|
|
486
|
-
await rmdir(lockDir).catch(() => undefined);
|
|
487
|
-
continue;
|
|
488
|
-
}
|
|
489
|
-
await Bun.sleep(100);
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
async function isStaleLock(lockDir: string): Promise<boolean> {
|
|
495
|
-
try {
|
|
496
|
-
const info = await stat(lockDir);
|
|
497
|
-
return Date.now() - info.mtimeMs > STALE_LOCK_MS;
|
|
498
|
-
} catch (error) {
|
|
499
|
-
// Only "lock vanished" is expected here (a concurrent process released
|
|
500
|
-
// it); anything else must surface — a swallowed ReferenceError in this
|
|
501
|
-
// exact spot once disabled stale detection entirely.
|
|
502
|
-
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
|
|
503
|
-
return false; // gone — let the mkdir retry acquire it
|
|
504
|
-
}
|
|
505
|
-
throw error;
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
function isFileExistsError(error: unknown): boolean {
|
|
510
|
-
return error instanceof Error && 'code' in error && error.code === 'EEXIST';
|
|
511
|
-
}
|
|
512
|
-
|
|
513
445
|
function reportSetupFailure(error: unknown): never {
|
|
514
446
|
describeFailure('ERROR', error);
|
|
515
447
|
process.exit(1);
|
|
@@ -3,6 +3,12 @@ cd "$(git rev-parse --show-toplevel)"
|
|
|
3
3
|
TOOLING="$PWD/tooling"
|
|
4
4
|
|
|
5
5
|
export PATH="$("$TOOLING/direnv/repo-path")"
|
|
6
|
+
# ttsc compiles with the native TypeScript compiler, which the dev shell names in
|
|
7
|
+
# TTSC_TSGO_BINARY. A hook runs outside that shell, where ttsc would resolve the
|
|
8
|
+
# JavaScript compiler a package's `typescript` dependency names and refuse to run.
|
|
9
|
+
if [ -z "${TTSC_TSGO_BINARY:-}" ] && [ -x "$PWD/node_modules/@typescript/native/bin/tsc" ]; then
|
|
10
|
+
export TTSC_TSGO_BINARY="$PWD/node_modules/@typescript/native/bin/tsc"
|
|
11
|
+
fi
|
|
6
12
|
|
|
7
13
|
set -e -o pipefail
|
|
8
14
|
|
|
@@ -3,6 +3,12 @@ cd "$(git rev-parse --show-toplevel)"
|
|
|
3
3
|
TOOLING="$PWD/tooling"
|
|
4
4
|
|
|
5
5
|
export PATH="$("$TOOLING/direnv/repo-path")"
|
|
6
|
+
# ttsc compiles with the native TypeScript compiler, which the dev shell names in
|
|
7
|
+
# TTSC_TSGO_BINARY. A hook runs outside that shell, where ttsc would resolve the
|
|
8
|
+
# JavaScript compiler a package's `typescript` dependency names and refuse to run.
|
|
9
|
+
if [ -z "${TTSC_TSGO_BINARY:-}" ] && [ -x "$PWD/node_modules/@typescript/native/bin/tsc" ]; then
|
|
10
|
+
export TTSC_TSGO_BINARY="$PWD/node_modules/@typescript/native/bin/tsc"
|
|
11
|
+
fi
|
|
6
12
|
|
|
7
13
|
set -e -o pipefail
|
|
8
14
|
|
|
@@ -25,6 +25,12 @@ cd "$(git rev-parse --show-toplevel)"
|
|
|
25
25
|
TOOLING="$PWD/tooling"
|
|
26
26
|
|
|
27
27
|
export PATH="$("$TOOLING/direnv/repo-path")"
|
|
28
|
+
# ttsc compiles with the native TypeScript compiler, which the dev shell names in
|
|
29
|
+
# TTSC_TSGO_BINARY. A hook runs outside that shell, where ttsc would resolve the
|
|
30
|
+
# JavaScript compiler a package's `typescript` dependency names and refuse to run.
|
|
31
|
+
if [ -z "${TTSC_TSGO_BINARY:-}" ] && [ -x "$PWD/node_modules/@typescript/native/bin/tsc" ]; then
|
|
32
|
+
export TTSC_TSGO_BINARY="$PWD/node_modules/@typescript/native/bin/tsc"
|
|
33
|
+
fi
|
|
28
34
|
|
|
29
35
|
case "$(uname -s)" in
|
|
30
36
|
Darwin) ;;
|