@smoothbricks/nx-plugin 0.4.15 → 0.4.16

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.
Files changed (114) hide show
  1. package/README.md +17 -0
  2. package/dist/deploy-policy.d.ts +26 -0
  3. package/dist/deploy-policy.d.ts.map +1 -0
  4. package/dist/deploy-policy.js +36 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +153 -14
  7. package/dist/managed-assets.d.ts +3 -0
  8. package/dist/managed-assets.d.ts.map +1 -0
  9. package/dist/managed-assets.js +3 -0
  10. package/dist/managed-files/ci-workflow.d.ts +215 -0
  11. package/dist/managed-files/ci-workflow.d.ts.map +1 -0
  12. package/dist/managed-files/ci-workflow.js +1082 -0
  13. package/dist/managed-files/context.d.ts +51 -0
  14. package/dist/managed-files/context.d.ts.map +1 -0
  15. package/dist/managed-files/context.js +206 -0
  16. package/dist/managed-files/files.d.ts +53 -0
  17. package/dist/managed-files/files.d.ts.map +1 -0
  18. package/dist/managed-files/files.js +248 -0
  19. package/dist/managed-files/generator.d.ts +16 -0
  20. package/dist/managed-files/generator.d.ts.map +1 -0
  21. package/dist/managed-files/generator.js +41 -0
  22. package/dist/managed-files/github-runs-on.d.ts +19 -0
  23. package/dist/managed-files/github-runs-on.d.ts.map +1 -0
  24. package/dist/managed-files/github-runs-on.js +48 -0
  25. package/dist/managed-files/managed-content.d.ts +45 -0
  26. package/dist/managed-files/managed-content.d.ts.map +1 -0
  27. package/dist/managed-files/managed-content.js +102 -0
  28. package/dist/managed-files/managed-format.d.ts +37 -0
  29. package/dist/managed-files/managed-format.d.ts.map +1 -0
  30. package/dist/managed-files/managed-format.js +94 -0
  31. package/dist/managed-files/paths.d.ts +8 -0
  32. package/dist/managed-files/paths.d.ts.map +1 -0
  33. package/dist/managed-files/paths.js +46 -0
  34. package/dist/managed-files/pr-preview-cleanup-workflow.d.ts +5 -0
  35. package/dist/managed-files/pr-preview-cleanup-workflow.d.ts.map +1 -0
  36. package/dist/managed-files/pr-preview-cleanup-workflow.js +38 -0
  37. package/dist/managed-files/private-npm-policy.d.ts +7 -0
  38. package/dist/managed-files/private-npm-policy.d.ts.map +1 -0
  39. package/dist/managed-files/private-npm-policy.js +51 -0
  40. package/dist/managed-files/publish-workflow.d.ts +150 -0
  41. package/dist/managed-files/publish-workflow.d.ts.map +1 -0
  42. package/dist/managed-files/publish-workflow.js +989 -0
  43. package/dist/managed-files/tree.d.ts +30 -0
  44. package/dist/managed-files/tree.d.ts.map +1 -0
  45. package/dist/managed-files/tree.js +91 -0
  46. package/dist/platform-targets.d.ts +5 -0
  47. package/dist/platform-targets.d.ts.map +1 -0
  48. package/dist/platform-targets.js +4 -0
  49. package/dist/typecheck-test-policy.d.ts +5 -9
  50. package/dist/typecheck-test-policy.d.ts.map +1 -1
  51. package/dist/typecheck-test-policy.js +69 -99
  52. package/dist/workspace-config-policy.d.ts +2 -3
  53. package/dist/workspace-config-policy.d.ts.map +1 -1
  54. package/dist/workspace-config-policy.js +8 -3
  55. package/dist/workspace-manifest.d.ts +291 -0
  56. package/dist/workspace-manifest.d.ts.map +1 -0
  57. package/dist/workspace-manifest.js +6 -0
  58. package/dist/workspace-package-policy.d.ts +13 -0
  59. package/dist/workspace-package-policy.d.ts.map +1 -0
  60. package/dist/workspace-package-policy.js +24 -0
  61. package/generators.json +5 -0
  62. package/managed/raw/envrc +20 -0
  63. package/managed/raw/git-format-staged.yml +82 -0
  64. package/managed/raw/gitattributes +8 -0
  65. package/managed/raw/tooling/devenv +83 -0
  66. package/managed/raw/tooling/direnv/devenv.smoo.nix +422 -0
  67. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +251 -0
  68. package/managed/raw/tooling/direnv/merge-newer-pins.sh +48 -0
  69. package/managed/raw/tooling/direnv/repo-path +34 -0
  70. package/managed/raw/tooling/direnv/secret-references.ts +636 -0
  71. package/managed/raw/tooling/direnv/setup-environment.ts +585 -0
  72. package/managed/raw/tooling/direnv/toolchain-stamp.ts +88 -0
  73. package/managed/raw/tooling/git-hooks/commit-msg.sh +9 -0
  74. package/managed/raw/tooling/git-hooks/post-commit.sh +71 -0
  75. package/managed/raw/tooling/git-hooks/pre-commit.sh +18 -0
  76. package/managed/raw/tooling/git-hooks/pre-push.sh +48 -0
  77. package/managed/raw/tsconfig.lib.json +28 -0
  78. package/managed/templates/github/actions/cache-nix-devenv/action.yml +45 -0
  79. package/managed/templates/github/actions/cache-node-modules/action.yml +17 -0
  80. package/managed/templates/github/actions/cache-nx/action.yml +21 -0
  81. package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +19 -0
  82. package/managed/templates/github/actions/save-nix-devenv/action.yml +32 -0
  83. package/managed/templates/github/actions/setup-devenv/action.yml +241 -0
  84. package/managed/templates/github/workflows/managed-files.yml +127 -0
  85. package/package.json +89 -5
  86. package/src/bun-bootstrap.test.ts +0 -6
  87. package/src/deploy-policy.ts +40 -0
  88. package/src/index.test.ts +225 -2
  89. package/src/index.ts +180 -14
  90. package/src/managed-assets.ts +4 -0
  91. package/src/managed-files/ci-workflow.ts +1365 -0
  92. package/src/managed-files/context.ts +240 -0
  93. package/src/managed-files/files.ts +324 -0
  94. package/src/managed-files/generator.test.ts +151 -0
  95. package/src/managed-files/generator.ts +60 -0
  96. package/src/managed-files/github-runs-on.ts +51 -0
  97. package/src/managed-files/managed-content.test.ts +147 -0
  98. package/src/managed-files/managed-content.ts +121 -0
  99. package/src/managed-files/managed-format.ts +102 -0
  100. package/src/managed-files/paths.ts +44 -0
  101. package/src/managed-files/pr-preview-cleanup-workflow.ts +44 -0
  102. package/src/managed-files/private-npm-policy.ts +62 -0
  103. package/src/managed-files/publish-workflow.ts +1523 -0
  104. package/src/managed-files/schema.json +8 -0
  105. package/src/managed-files/tree-permissions.test.ts +109 -0
  106. package/src/managed-files/tree.test.ts +123 -0
  107. package/src/managed-files/tree.ts +118 -0
  108. package/src/platform-targets.ts +4 -0
  109. package/src/typecheck-test-policy.test.ts +28 -3
  110. package/src/typecheck-test-policy.ts +46 -121
  111. package/src/workspace-config-policy.test.ts +14 -2
  112. package/src/workspace-config-policy.ts +9 -3
  113. package/src/workspace-manifest.ts +327 -0
  114. package/src/workspace-package-policy.ts +32 -0
@@ -0,0 +1,51 @@
1
+ import { type DeploymentStage } from '../deploy-policy.js';
2
+ import { type NxProjectJson, type PackageJson } from '../workspace-manifest.js';
3
+ import type { CiCrossTestArchive } from './ci-workflow.js';
4
+ import type { ManagedFileContext } from './files.js';
5
+ export type WorkspaceProjects = Record<string, NxProjectJson>;
6
+ interface DeployTargetInfo {
7
+ exists: boolean;
8
+ provider?: 'cloudflare';
9
+ }
10
+ /** Pure derivation from the caller's resolved Nx graph and manifest contents. */
11
+ export declare function deriveManagedFileContext(manifest: PackageJson, packages: readonly PackageJson[], nxProjects: WorkspaceProjects, hasBunLock: boolean, npmrc: string): ManagedFileContext;
12
+ export declare function hasExactTargetForTest(targetNames: Iterable<string>, target: string): boolean;
13
+ /**
14
+ * Test seam: the cross-built test archives this graph can produce, read back
15
+ * out of the inferred `cargo-cross-test-archive-<triple>` targets.
16
+ *
17
+ * Derived, not configured. The triple is declared exactly once — in the cargo
18
+ * workspace's own `[workspace.metadata.smoothbricks.test] cross-targets`, where
19
+ * a Rust target triple belongs — and both halves of the workflow are rendered
20
+ * from the targets that declaration produced. A second copy in `smoo.github`
21
+ * could name a triple the graph cannot build, and CI would discover that only
22
+ * on the runner.
23
+ *
24
+ * The path is the target's own output location, so the artifact the Linux job
25
+ * uploads and the file the macOS job's runner opens are the same string
26
+ * computed once.
27
+ */
28
+ export declare function crossTestArchivesForTest(projects: WorkspaceProjects): CiCrossTestArchive[];
29
+ /**
30
+ * The platform families the release workflow produces: the graph's families
31
+ * minus the ones the repository excludes. Excluding a family the graph does not
32
+ * have is not an error — a repository states what it does not release, and the
33
+ * statement stays true when the target is added later.
34
+ */
35
+ export declare function releasePlatformTargetGlobsFor(platformTargetGlobs: readonly string[], excluded: readonly string[] | undefined): string[];
36
+ export declare function platformTargetGlobsForTest(targetNames: Iterable<string>): string[];
37
+ /**
38
+ * Test seam: the architectures the macOS platform job must fan out over,
39
+ * derived from the target names themselves so a repository that ships one
40
+ * architecture renders one matrix leg. Each leg owns one architecture's
41
+ * targets, which is what lets them build on separate runners: cargo takes an
42
+ * exclusive lock on a package's whole `target/` directory, so same-runner
43
+ * platform builds serialize no matter how many workers Nx is given.
44
+ */
45
+ export declare function macosPlatformArchitecturesForTest(targetNames: Iterable<string>): string[];
46
+ /** Test seam: what the stage flow deploys, and with which provider, from graph nodes. */
47
+ export declare function deployTargetInfoFromProjects(projects: WorkspaceProjects, stage: DeploymentStage): DeployTargetInfo;
48
+ /** Test seam: whether any project in the graph carries the Nx tag. */
49
+ export declare function anyProjectHasTagForTest(projects: WorkspaceProjects, tag: string): boolean;
50
+ export {};
51
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/managed-files/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAmD,MAAM,qBAAqB,CAAC;AAE5G,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,WAAW,EAA0B,MAAM,0BAA0B,CAAC;AAExH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGrD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAC9D,UAAU,gBAAgB;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,iFAAiF;AACjF,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,UAAU,EAAE,iBAAiB,EAC7B,UAAU,EAAE,OAAO,EACnB,KAAK,EAAE,MAAM,GACZ,kBAAkB,CA+DpB;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5F;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,kBAAkB,EAAE,CAiB1F;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,mBAAmB,EAAE,SAAS,MAAM,EAAE,EACtC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GACtC,MAAM,EAAE,CAIV;AAED,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAMlF;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAezF;AAED,yFAAyF;AACzF,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAYlH;AAED,sEAAsE;AACtE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzF"}
@@ -0,0 +1,206 @@
1
+ import { cargoCrossTestArchiveFile, cargoCrossTestTripleFromArchiveTarget } from '../cross-check-policy.js';
2
+ import { PRODUCTION_PUSH_DEPLOY_TAG, stageDeploysProject } from '../deploy-policy.js';
3
+ import { MACOS_PLATFORM_TARGET_GLOBS, PLATFORM_TARGET_GLOBS } from '../platform-targets.js';
4
+ import { ciPushBranches } from '../workspace-manifest.js';
5
+ import { isPublishablePackage, repositoryInfo } from '../workspace-package-policy.js';
6
+ import { privateNpmWorkflowConfig } from './private-npm-policy.js';
7
+ /** Pure derivation from the caller's resolved Nx graph and manifest contents. */
8
+ export function deriveManagedFileContext(manifest, packages, nxProjects, hasBunLock, npmrc) {
9
+ const rootRepository = repositoryInfo(manifest);
10
+ const github = manifest?.smoo?.github;
11
+ const macosRunsOn = getMacosRunsOn(manifest);
12
+ const sourceCheckouts = github?.sourceCheckouts;
13
+ const cargoCredentials = github?.cargoCredentials;
14
+ const stagingDeploy = deployTargetInfoFromProjects(nxProjects, 'staging');
15
+ const productionDeploy = deployTargetInfoFromProjects(nxProjects, 'production');
16
+ const targetNames = Object.values(nxProjects).flatMap((project) => Object.keys(project.targets ?? {}));
17
+ const platformTargetGlobs = platformTargetGlobsForTest(targetNames);
18
+ // The release workflow produces every platform family the graph carries
19
+ // EXCEPT the ones the repository excludes. An excluded family renders no job
20
+ // at all rather than a job whose failure blocks every release; the workflow
21
+ // that does own it says so itself.
22
+ const releasePlatformTargetGlobs = releasePlatformTargetGlobsFor(platformTargetGlobs, github?.releasePlatformFamiliesExcluded);
23
+ const privateNpm = privateNpmWorkflowConfig(manifest.smoo?.privateNpm, manifest, packages, npmrc);
24
+ // Cache registry identity plus the lockfile, never token values: a scope
25
+ // URL change in the committed .npmrc must invalidate the dependency cache,
26
+ // and the cache key must stay free of secrets. Shell entry never requires
27
+ // registry configuration; only actual registry operations resolve one.
28
+ const nodeModulesCacheKey = hasBunLock
29
+ ? `$${"{{ hashFiles('.npmrc', 'bun.lock', 'package.json', 'packages/*/package.json') }}"}`
30
+ : `$${"{{ hashFiles('.npmrc', 'bun.lockb', 'package.json', 'packages/*/package.json') }}"}`;
31
+ return {
32
+ hasReleasePackages: packages.some((pkg) => !!pkg.name &&
33
+ !!pkg.version &&
34
+ isPublishablePackage({ private: pkg.private === true, tags: pkg.nx?.tags ?? [] }) &&
35
+ rootRepository !== null &&
36
+ repositoryInfo(pkg)?.url === rootRepository.url),
37
+ hasStagingDeployTargets: stagingDeploy.exists,
38
+ hasProductionDeployTargets: productionDeploy.exists,
39
+ hasBrowserTestTargets: hasExactTargetForTest(targetNames, 'test-browser'),
40
+ hasE2eDeploymentTargets: hasExactTargetForTest(targetNames, 'e2e-deployment'),
41
+ hasProductionPushDeployTargets: anyProjectHasTagForTest(nxProjects, PRODUCTION_PUSH_DEPLOY_TAG),
42
+ stagingDeployProvider: stagingDeploy.provider,
43
+ productionDeployProvider: productionDeploy.provider,
44
+ ciPushBranches: ciPushBranches(github),
45
+ ciRunsOn: getCiRunsOn(github),
46
+ macosRunsOn,
47
+ platformProducer: github?.platformProducer,
48
+ actionsProvider: github?.actionsProvider,
49
+ ciEnvironments: github?.environments,
50
+ ciDeploySecrets: github?.deploySecrets ?? {},
51
+ ciE2eSecrets: github?.e2eSecrets ?? {},
52
+ nodeModulesCacheKey,
53
+ repoName: manifest.name ?? 'monorepo',
54
+ platformTargetGlobs,
55
+ releasePlatformTargetGlobs,
56
+ sourceCheckouts,
57
+ cargoCredentials,
58
+ remoteCache: manifest?.smoo?.remoteCache,
59
+ macosPlatformArchitectures: MACOS_PLATFORM_TARGET_GLOBS.some((glob) => releasePlatformTargetGlobs.includes(glob))
60
+ ? macosPlatformArchitecturesForTest(targetNames)
61
+ : [],
62
+ privateNpm,
63
+ crossTestArchives: crossTestArchivesForTest(nxProjects),
64
+ };
65
+ }
66
+ export function hasExactTargetForTest(targetNames, target) {
67
+ return [...targetNames].includes(target);
68
+ }
69
+ /**
70
+ * Test seam: the cross-built test archives this graph can produce, read back
71
+ * out of the inferred `cargo-cross-test-archive-<triple>` targets.
72
+ *
73
+ * Derived, not configured. The triple is declared exactly once — in the cargo
74
+ * workspace's own `[workspace.metadata.smoothbricks.test] cross-targets`, where
75
+ * a Rust target triple belongs — and both halves of the workflow are rendered
76
+ * from the targets that declaration produced. A second copy in `smoo.github`
77
+ * could name a triple the graph cannot build, and CI would discover that only
78
+ * on the runner.
79
+ *
80
+ * The path is the target's own output location, so the artifact the Linux job
81
+ * uploads and the file the macOS job's runner opens are the same string
82
+ * computed once.
83
+ */
84
+ export function crossTestArchivesForTest(projects) {
85
+ const archives = [];
86
+ for (const project of Object.values(projects)) {
87
+ const projectRoot = project.root;
88
+ for (const targetName of Object.keys(project.targets ?? {})) {
89
+ const triple = cargoCrossTestTripleFromArchiveTarget(targetName);
90
+ if (triple === null) {
91
+ continue;
92
+ }
93
+ const file = cargoCrossTestArchiveFile(triple);
94
+ archives.push({
95
+ triple,
96
+ path: projectRoot === undefined || projectRoot === '.' ? file : `${projectRoot}/${file}`,
97
+ });
98
+ }
99
+ }
100
+ return archives.sort((left, right) => left.triple.localeCompare(right.triple));
101
+ }
102
+ /**
103
+ * The platform families the release workflow produces: the graph's families
104
+ * minus the ones the repository excludes. Excluding a family the graph does not
105
+ * have is not an error — a repository states what it does not release, and the
106
+ * statement stays true when the target is added later.
107
+ */
108
+ export function releasePlatformTargetGlobsFor(platformTargetGlobs, excluded) {
109
+ if (!excluded || excluded.length === 0)
110
+ return [...platformTargetGlobs];
111
+ const drop = new Set(excluded);
112
+ return platformTargetGlobs.filter((glob) => !drop.has(glob));
113
+ }
114
+ export function platformTargetGlobsForTest(targetNames) {
115
+ const names = [...targetNames];
116
+ return PLATFORM_TARGET_GLOBS.filter((glob) => {
117
+ const suffix = glob.startsWith('*') ? glob.slice(1) : glob;
118
+ return names.some((name) => name.endsWith(suffix));
119
+ });
120
+ }
121
+ /**
122
+ * Test seam: the architectures the macOS platform job must fan out over,
123
+ * derived from the target names themselves so a repository that ships one
124
+ * architecture renders one matrix leg. Each leg owns one architecture's
125
+ * targets, which is what lets them build on separate runners: cargo takes an
126
+ * exclusive lock on a package's whole `target/` directory, so same-runner
127
+ * platform builds serialize no matter how many workers Nx is given.
128
+ */
129
+ export function macosPlatformArchitecturesForTest(targetNames) {
130
+ const families = MACOS_PLATFORM_TARGET_GLOBS.map((glob) => glob.slice(1));
131
+ const architectures = new Set();
132
+ for (const name of targetNames) {
133
+ for (const family of families) {
134
+ if (!name.endsWith(family)) {
135
+ continue;
136
+ }
137
+ const architecture = name.slice(0, -family.length).split('-').pop();
138
+ if (architecture) {
139
+ architectures.add(architecture);
140
+ }
141
+ }
142
+ }
143
+ return [...architectures].sort((left, right) => left.localeCompare(right));
144
+ }
145
+ /** Test seam: what the stage flow deploys, and with which provider, from graph nodes. */
146
+ export function deployTargetInfoFromProjects(projects, stage) {
147
+ let exists = false;
148
+ let provider;
149
+ for (const project of Object.values(projects)) {
150
+ const info = deployTargetInfoFromProject(project, stage);
151
+ if (!info.exists) {
152
+ continue;
153
+ }
154
+ exists = true;
155
+ provider ??= info.provider;
156
+ }
157
+ return { exists, provider };
158
+ }
159
+ /** Test seam: whether any project in the graph carries the Nx tag. */
160
+ export function anyProjectHasTagForTest(projects, tag) {
161
+ return Object.values(projects).some((project) => project.tags?.includes(tag));
162
+ }
163
+ /**
164
+ * A generated deploy job exists for the projects CI would actually deploy, which
165
+ * is `stageDeploysProject` and nothing else — the same rule `smoo github-ci
166
+ * nx-deploy` selects by, so the job and its selection cannot disagree. Reading
167
+ * the target's presence instead would render a deploy job, with cloud
168
+ * credentials, into a repository whose only wrangler manifests document a
169
+ * Durable Object binding for a published library's consumers.
170
+ *
171
+ * The command is read for the PROVIDER only: which cloud CLI runs says which
172
+ * credentials the job needs, and says nothing about whether CI runs it.
173
+ */
174
+ function deployTargetInfoFromProject(project, stage) {
175
+ const deploy = project.targets?.deploy;
176
+ if (!deploy || !stageDeploysProject(project.tags, stage)) {
177
+ return { exists: false };
178
+ }
179
+ const command = deploy.options?.command ?? deploy.command;
180
+ return { exists: true, provider: deployProvider(typeof command === 'string' ? command : '') };
181
+ }
182
+ function deployProvider(command) {
183
+ return command.includes('wrangler ') ? 'cloudflare' : undefined;
184
+ }
185
+ function getCiRunsOn(github) {
186
+ const configured = github?.runsOn;
187
+ if (configured === undefined) {
188
+ return 'ubuntu-latest';
189
+ }
190
+ if (typeof configured === 'string') {
191
+ return configured.length > 0 ? configured : 'ubuntu-latest';
192
+ }
193
+ const labels = configured.filter((label) => label.length > 0);
194
+ return labels.length > 0 ? labels : 'ubuntu-latest';
195
+ }
196
+ function getMacosRunsOn(packageJson) {
197
+ const configured = packageJson?.smoo?.github?.macosRunsOn;
198
+ if (configured === undefined) {
199
+ return 'macos-latest';
200
+ }
201
+ if (typeof configured === 'string') {
202
+ return configured.length > 0 ? configured : 'macos-latest';
203
+ }
204
+ const labels = configured.filter((label) => label.length > 0);
205
+ return labels.length > 0 ? labels : 'macos-latest';
206
+ }
@@ -0,0 +1,53 @@
1
+ import type { NonEmptyArray, PackageCargoCredentialsConfig, PackagePrivateNpmConfig, PackageRemoteCacheConfig, PackageSmooGithub, PackageSmooGithubEnvironments, PackageSourceCheckoutConfig } from '../workspace-manifest.js';
2
+ import { type CiCrossTestArchive } from './ci-workflow.js';
3
+ import type { ManagedFile } from './tree.js';
4
+ export interface ManagedFileContext {
5
+ hasReleasePackages: boolean;
6
+ hasStagingDeployTargets: boolean;
7
+ hasProductionDeployTargets: boolean;
8
+ hasBrowserTestTargets: boolean;
9
+ hasE2eDeploymentTargets: boolean;
10
+ hasProductionPushDeployTargets: boolean;
11
+ stagingDeployProvider?: 'cloudflare';
12
+ productionDeployProvider?: 'cloudflare';
13
+ ciPushBranches: NonEmptyArray<string>;
14
+ ciRunsOn: string | string[];
15
+ /** macOS platform job runs-on labels from the root smoo config; default macos-latest. */
16
+ macosRunsOn: string | string[];
17
+ platformProducer?: PackageSmooGithub['platformProducer'];
18
+ actionsProvider?: PackageSmooGithub['actionsProvider'];
19
+ ciEnvironments?: PackageSmooGithubEnvironments;
20
+ ciDeploySecrets: Record<string, string>;
21
+ ciE2eSecrets: Record<string, string>;
22
+ nodeModulesCacheKey: string;
23
+ repoName: string;
24
+ platformTargetGlobs: string[];
25
+ /** Platform families the release workflow produces; excluded families are absent. */
26
+ releasePlatformTargetGlobs: string[];
27
+ macosPlatformArchitectures: string[];
28
+ /** Declared private-npm opt-in from the root smoo config; absent means fully public. */
29
+ privateNpm?: PackagePrivateNpmConfig;
30
+ /** Declared sibling source checkouts from the root smoo config; absent means none. */
31
+ sourceCheckouts?: PackageSourceCheckoutConfig[];
32
+ /** Declared Cargo private-dependency credentials from the root smoo config; absent means none. */
33
+ cargoCredentials?: PackageCargoCredentialsConfig;
34
+ /** Declared self-hosted Nx remote cache from the root smoo config; absent means local caching only. */
35
+ remoteCache?: PackageRemoteCacheConfig;
36
+ /**
37
+ * Cross-built test archives the graph can produce, one per foreign target
38
+ * triple the cargo workspace declares. Empty for a repository that declares
39
+ * none, which renders a CI workflow with no cross steps and no macOS job.
40
+ */
41
+ crossTestArchives: CiCrossTestArchive[];
42
+ }
43
+ export declare const managedFileTargetsForTest: {
44
+ target: string;
45
+ executable: boolean | undefined;
46
+ }[];
47
+ /** Test seam: the managed targets a repository of this shape gets, in file order. */
48
+ export declare function managedFileTargetsForContext(context: ManagedFileContext): string[];
49
+ /** Render all packaged templates before staging any workspace changes. */
50
+ export declare function renderManagedFiles(context: ManagedFileContext): ManagedFile[];
51
+ /** Renders a generated workflow through its real managed-file descriptor, so the context wiring is covered. */
52
+ export declare function renderManagedWorkflowForTest(source: 'ci-workflow' | 'publish-workflow', context: ManagedFileContext): string;
53
+ //# sourceMappingURL=files.d.ts.map
@@ -0,0 +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,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACvD,cAAc,CAAC,EAAE,6BAA6B,CAAC;IAC/C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,qFAAqF;IACrF,0BAA0B,EAAE,MAAM,EAAE,CAAC;IACrC,0BAA0B,EAAE,MAAM,EAAE,CAAC;IACrC,wFAAwF;IACxF,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,sFAAsF;IACtF,eAAe,CAAC,EAAE,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;AA8ID,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,EAC1C,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CAMR"}
@@ -0,0 +1,248 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { managedAssetsRoot } from '../managed-assets.js';
4
+ import { privateNpmReadTokenJobEnv, renderCiWorkflowYaml } from './ci-workflow.js';
5
+ import { renderRunsOnLine } from './github-runs-on.js';
6
+ import { renderPrPreviewCleanupWorkflowYaml } from './pr-preview-cleanup-workflow.js';
7
+ import { renderPublishWorkflowYaml } from './publish-workflow.js';
8
+ const managedFiles = [
9
+ {
10
+ kind: 'raw',
11
+ source: 'envrc',
12
+ target: '.envrc',
13
+ },
14
+ {
15
+ kind: 'raw',
16
+ source: 'tooling/devenv',
17
+ target: 'tooling/devenv',
18
+ executable: true,
19
+ },
20
+ {
21
+ kind: 'raw',
22
+ source: 'tooling/direnv/repo-path',
23
+ target: 'tooling/direnv/repo-path',
24
+ executable: true,
25
+ },
26
+ {
27
+ kind: 'raw',
28
+ source: 'tooling/direnv/github-actions-bootstrap.sh',
29
+ target: 'tooling/direnv/github-actions-bootstrap.sh',
30
+ executable: true,
31
+ },
32
+ {
33
+ kind: 'raw',
34
+ source: 'tooling/direnv/setup-environment.ts',
35
+ target: 'tooling/direnv/setup-environment.ts',
36
+ executable: true,
37
+ },
38
+ {
39
+ kind: 'raw',
40
+ source: 'tooling/direnv/secret-references.ts',
41
+ target: 'tooling/direnv/secret-references.ts',
42
+ },
43
+ {
44
+ kind: 'raw',
45
+ source: 'tooling/direnv/toolchain-stamp.ts',
46
+ target: 'tooling/direnv/toolchain-stamp.ts',
47
+ executable: true,
48
+ },
49
+ {
50
+ kind: 'raw',
51
+ source: 'tooling/direnv/devenv.smoo.nix',
52
+ target: 'tooling/direnv/devenv.smoo.nix',
53
+ },
54
+ {
55
+ kind: 'raw',
56
+ source: 'tooling/git-hooks/pre-commit.sh',
57
+ target: 'tooling/git-hooks/pre-commit.sh',
58
+ executable: true,
59
+ },
60
+ {
61
+ kind: 'raw',
62
+ source: 'tooling/git-hooks/post-commit.sh',
63
+ target: 'tooling/git-hooks/post-commit.sh',
64
+ executable: true,
65
+ },
66
+ {
67
+ kind: 'raw',
68
+ source: 'tooling/git-hooks/commit-msg.sh',
69
+ target: 'tooling/git-hooks/commit-msg.sh',
70
+ executable: true,
71
+ },
72
+ {
73
+ kind: 'raw',
74
+ source: 'tooling/git-hooks/pre-push.sh',
75
+ target: 'tooling/git-hooks/pre-push.sh',
76
+ executable: true,
77
+ },
78
+ {
79
+ kind: 'raw',
80
+ source: 'git-format-staged.yml',
81
+ target: '.git-format-staged.yml',
82
+ },
83
+ {
84
+ kind: 'raw',
85
+ source: 'gitattributes',
86
+ target: '.gitattributes',
87
+ },
88
+ {
89
+ kind: 'raw',
90
+ source: 'tooling/direnv/merge-newer-pins.sh',
91
+ target: 'tooling/direnv/merge-newer-pins.sh',
92
+ executable: true,
93
+ },
94
+ {
95
+ kind: 'generated',
96
+ source: 'ci-workflow',
97
+ target: '.github/workflows/ci.yml',
98
+ },
99
+ {
100
+ kind: 'generated',
101
+ source: 'pr-preview-cleanup-workflow',
102
+ target: '.github/workflows/pr-preview-cleanup.yml',
103
+ cloudflareDeployOnly: true,
104
+ },
105
+ {
106
+ kind: 'generated',
107
+ source: 'publish-workflow',
108
+ target: '.github/workflows/publish.yml',
109
+ releasePackagesOnly: true,
110
+ },
111
+ {
112
+ kind: 'template',
113
+ source: 'github/workflows/managed-files.yml',
114
+ target: '.github/workflows/managed-files.yml',
115
+ },
116
+ {
117
+ kind: 'template',
118
+ source: 'github/actions/cache-nix-devenv/action.yml',
119
+ target: '.github/actions/cache-nix-devenv/action.yml',
120
+ },
121
+ {
122
+ kind: 'template',
123
+ source: 'github/actions/setup-devenv/action.yml',
124
+ target: '.github/actions/setup-devenv/action.yml',
125
+ },
126
+ {
127
+ kind: 'template',
128
+ source: 'github/actions/save-nix-devenv/action.yml',
129
+ target: '.github/actions/save-nix-devenv/action.yml',
130
+ },
131
+ {
132
+ kind: 'template',
133
+ source: 'github/actions/cache-node-modules/action.yml',
134
+ target: '.github/actions/cache-node-modules/action.yml',
135
+ },
136
+ {
137
+ kind: 'template',
138
+ source: 'github/actions/cache-ttsc-plugins/action.yml',
139
+ target: '.github/actions/cache-ttsc-plugins/action.yml',
140
+ },
141
+ {
142
+ kind: 'template',
143
+ source: 'github/actions/cache-nx/action.yml',
144
+ target: '.github/actions/cache-nx/action.yml',
145
+ },
146
+ ];
147
+ export const managedFileTargetsForTest = managedFiles.map(({ target, executable }) => ({ target, executable }));
148
+ /**
149
+ * Whether a repository of this shape has the file at all. A repository that owns
150
+ * no packages has nothing to publish, and one the stage flow does not deploy to
151
+ * Cloudflare has no preview stage to clean up.
152
+ */
153
+ function managedFileApplies(file, context) {
154
+ if (file.releasePackagesOnly === true && !context.hasReleasePackages && !context.hasProductionDeployTargets) {
155
+ return false;
156
+ }
157
+ return file.cloudflareDeployOnly !== true || context.stagingDeployProvider === 'cloudflare';
158
+ }
159
+ /** Test seam: the managed targets a repository of this shape gets, in file order. */
160
+ export function managedFileTargetsForContext(context) {
161
+ return managedFiles.filter((file) => managedFileApplies(file, context)).map((file) => file.target);
162
+ }
163
+ /** Render all packaged templates before staging any workspace changes. */
164
+ export function renderManagedFiles(context) {
165
+ return managedFiles.map((file) => ({
166
+ target: file.target,
167
+ content: managedFileApplies(file, context) ? getManagedContent(file, context) : null,
168
+ executable: file.executable,
169
+ }));
170
+ }
171
+ /** Renders a generated workflow through its real managed-file descriptor, so the context wiring is covered. */
172
+ export function renderManagedWorkflowForTest(source, context) {
173
+ const file = managedFiles.find((candidate) => candidate.kind === 'generated' && candidate.source === source);
174
+ if (!file) {
175
+ throw new Error(`${source} is no longer a managed file`);
176
+ }
177
+ return getManagedContent(file, context);
178
+ }
179
+ function getManagedContent(file, context) {
180
+ if (file.kind === 'generated') {
181
+ if (file.source === 'ci-workflow') {
182
+ return renderCiWorkflowYaml({
183
+ actionsProvider: context.actionsProvider,
184
+ deploy: context.hasStagingDeployTargets,
185
+ // The production job's Cloudflare env pair keys off this too: it can only select stage-derived projects,
186
+ // whose provider is computed identically for staging and production.
187
+ deployProvider: context.stagingDeployProvider,
188
+ browserTests: context.hasBrowserTestTargets,
189
+ e2eDeployment: context.hasStagingDeployTargets && context.hasE2eDeploymentTargets,
190
+ pushBranches: context.ciPushBranches,
191
+ runsOn: context.ciRunsOn,
192
+ privateNpm: context.privateNpm,
193
+ sourceCheckouts: context.sourceCheckouts,
194
+ cargoCredentials: context.cargoCredentials,
195
+ remoteCache: context.remoteCache,
196
+ environments: context.ciEnvironments,
197
+ deploySecrets: context.ciDeploySecrets,
198
+ e2eSecrets: context.ciE2eSecrets,
199
+ productionOnPush: context.hasProductionPushDeployTargets,
200
+ crossTestArchives: context.crossTestArchives,
201
+ macosRunsOn: context.macosRunsOn,
202
+ platformProducer: context.platformProducer,
203
+ });
204
+ }
205
+ if (file.source === 'publish-workflow') {
206
+ return renderPublishWorkflowYaml({
207
+ deploy: context.hasProductionDeployTargets,
208
+ // A repo reaches this file on deploy targets alone. Without owned
209
+ // packages every release step throws, so render the deploy-only shape.
210
+ release: context.hasReleasePackages,
211
+ deployProvider: context.productionDeployProvider,
212
+ repoName: context.repoName,
213
+ platformTargetGlobs: context.releasePlatformTargetGlobs,
214
+ macosPlatformArchitectures: context.macosPlatformArchitectures,
215
+ runsOn: context.ciRunsOn,
216
+ macosRunsOn: context.macosRunsOn,
217
+ platformProducer: context.platformProducer,
218
+ actionsProvider: context.actionsProvider,
219
+ privateNpm: context.privateNpm,
220
+ sourceCheckouts: context.sourceCheckouts,
221
+ cargoCredentials: context.cargoCredentials,
222
+ remoteCache: context.remoteCache,
223
+ deploySecrets: context.ciDeploySecrets,
224
+ });
225
+ }
226
+ if (file.source === 'pr-preview-cleanup-workflow') {
227
+ return renderPrPreviewCleanupWorkflowYaml({ runsOn: context.ciRunsOn });
228
+ }
229
+ throw new Error(`Unknown generated managed file source ${file.source}`);
230
+ }
231
+ const sourcePath = join(managedAssetsRoot, file.kind === 'raw' ? 'raw' : 'templates', file.source);
232
+ const content = readFileSync(sourcePath, 'utf8');
233
+ if (file.kind === 'raw') {
234
+ return content;
235
+ }
236
+ return renderTemplate(context, content);
237
+ }
238
+ function renderTemplate(context, template) {
239
+ return template
240
+ .replaceAll('{{REPO_NAME}}', context.repoName)
241
+ .replaceAll('__SMOO_CI_PUSH_BRANCHES__', renderYamlFlowList(context.ciPushBranches))
242
+ .replaceAll('__SMOO_CI_RUNS_ON__', renderRunsOnLine(context.ciRunsOn))
243
+ .replaceAll('__SMOO_PRIVATE_INSTALL_ENV__', context.privateNpm ? ` env:\n${privateNpmReadTokenJobEnv(context)}` : '')
244
+ .replaceAll('{{NODE_MODULES_CACHE_KEY}}', context.nodeModulesCacheKey);
245
+ }
246
+ function renderYamlFlowList(values) {
247
+ return JSON.stringify(values);
248
+ }
@@ -0,0 +1,16 @@
1
+ import { type Tree } from 'nx/src/devkit-exports.js';
2
+ import { type WorkspaceProjects } from './context.js';
3
+ import { type ManagedFileContext } from './files.js';
4
+ import { type FileResult, type ManagedPathInfo } from './tree.js';
5
+ /**
6
+ * All workspace content comes from Tree. The supplied graph is Nx's resolved
7
+ * graph, not getProjects(Tree), which intentionally omits plugin-inferred targets.
8
+ * The shared test-config renderer reads staged manifests too; no generation
9
+ * installs dependencies or resolves secrets.
10
+ */
11
+ export declare function generateManagedFiles(tree: Tree, projects: WorkspaceProjects, pathInfo?: ReadonlyMap<string, ManagedPathInfo>): Promise<FileResult[]>;
12
+ /** Shared rendering boundary; stage only after every consumer formatter has succeeded. */
13
+ export declare function generateManagedFilesForContext(tree: Tree, context: ManagedFileContext, pathInfo?: ReadonlyMap<string, ManagedPathInfo>): Promise<FileResult[]>;
14
+ /** Native Nx generate/sync entry point. CLI calls the same transformation with its already-loaded graph. */
15
+ export default function generator(tree: Tree): Promise<void>;
16
+ //# sourceMappingURL=generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/managed-files/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqE,KAAK,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGxH,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,YAAY,CAAC;AAGzE,OAAO,EAA4B,KAAK,UAAU,EAAE,KAAK,eAAe,EAAqB,MAAM,WAAW,CAAC;AAE/G;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,GAC9C,OAAO,CAAC,UAAU,EAAE,CAAC,CAcvB;AAED,0FAA0F;AAC1F,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,GAC9C,OAAO,CAAC,UAAU,EAAE,CAAC,CAYvB;AAED,4GAA4G;AAC5G,wBAA8B,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAIjE"}
@@ -0,0 +1,41 @@
1
+ import { createProjectGraphAsync, getProjects, joinPathFragments, readJson } from 'nx/src/devkit-exports.js';
2
+ import { renderTypecheckTestFiles } from '../typecheck-test-policy.js';
3
+ import { deriveManagedFileContext } from './context.js';
4
+ import { renderManagedFiles } from './files.js';
5
+ import { formatManagedContent } from './managed-format.js';
6
+ import { inspectManagedPaths } from './paths.js';
7
+ import { assertNoManagedConflicts, stageManagedFiles } from './tree.js';
8
+ /**
9
+ * All workspace content comes from Tree. The supplied graph is Nx's resolved
10
+ * graph, not getProjects(Tree), which intentionally omits plugin-inferred targets.
11
+ * The shared test-config renderer reads staged manifests too; no generation
12
+ * installs dependencies or resolves secrets.
13
+ */
14
+ export async function generateManagedFiles(tree, projects, pathInfo) {
15
+ const manifest = tree.exists('package.json') ? readJson(tree, 'package.json') : {};
16
+ const packageRoots = new Set([...getProjects(tree).values()].map((project) => project.root));
17
+ const packages = [...packageRoots]
18
+ .filter((root) => root !== '.' && root !== '')
19
+ .flatMap((root) => {
20
+ const path = joinPathFragments(root, 'package.json');
21
+ return tree.exists(path) ? [readJson(tree, path)] : [];
22
+ });
23
+ return generateManagedFilesForContext(tree, deriveManagedFileContext(manifest, packages, projects, tree.exists('bun.lock'), tree.read('.npmrc', 'utf8') ?? ''), pathInfo);
24
+ }
25
+ /** Shared rendering boundary; stage only after every consumer formatter has succeeded. */
26
+ export async function generateManagedFilesForContext(tree, context, pathInfo) {
27
+ const files = [...renderManagedFiles(context), ...renderTypecheckTestFiles(tree)];
28
+ for (const file of files) {
29
+ if (file.content !== null)
30
+ file.content = await formatManagedContent(tree.root, file.target, file.content);
31
+ }
32
+ const paths = pathInfo ??
33
+ inspectManagedPaths(tree.root, files.filter((file) => file.content !== null).map((file) => file.target));
34
+ return stageManagedFiles(tree, files, paths);
35
+ }
36
+ /** Native Nx generate/sync entry point. CLI calls the same transformation with its already-loaded graph. */
37
+ export default async function generator(tree) {
38
+ const graph = await createProjectGraphAsync();
39
+ const projects = Object.fromEntries(Object.entries(graph.nodes).map(([name, node]) => [name, node.data]));
40
+ assertNoManagedConflicts(await generateManagedFiles(tree, projects));
41
+ }
@@ -0,0 +1,19 @@
1
+ /** Shared `runs-on:` emission for generated GitHub workflow YAML. */
2
+ export type WorkflowRunsOn = string | string[] | undefined;
3
+ /**
4
+ * The GitHub-hosted Linux runner. Also the fork-PR fallback of every gated
5
+ * self-hosted label, and the only runner class npmjs accepts provenance from.
6
+ */
7
+ export declare const GITHUB_HOSTED_LINUX_RUNNER = "ubuntu-latest";
8
+ export declare function isNixosRunner(runsOn: WorkflowRunsOn): boolean;
9
+ /**
10
+ * Trusted jobs use configured nixos self-hosted labels; fork PRs stay on
11
+ * ubuntu-latest (no access to the private runner fleet).
12
+ */
13
+ export declare function githubUsesNixosRunnerExpr(): string;
14
+ /**
15
+ * Full ` runs-on: …` line(s), indented for a job under `jobs.<id>:`.
16
+ * Nixos labels emit the multiline prettier-stable fork-gate expression.
17
+ */
18
+ export declare function renderRunsOnLine(runsOn: WorkflowRunsOn): string;
19
+ //# sourceMappingURL=github-runs-on.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-runs-on.d.ts","sourceRoot":"","sources":["../../src/managed-files/github-runs-on.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,0BAA0B,kBAAkB,CAAC;AAE1D,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAG7D;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAuB/D"}