@smoothbricks/cli 0.11.17 → 0.11.19
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 +45 -10
- package/dist/cli.js +10 -7
- package/dist/github-ci/index.d.ts.map +1 -1
- package/dist/github-ci/index.js +6 -20
- package/dist/lib/deploy-tags.d.ts +17 -3
- package/dist/lib/deploy-tags.d.ts.map +1 -1
- package/dist/lib/deploy-tags.js +23 -4
- package/dist/monorepo/ci-workflow.d.ts +56 -0
- package/dist/monorepo/ci-workflow.d.ts.map +1 -1
- package/dist/monorepo/ci-workflow.js +199 -2
- package/dist/monorepo/managed-files.d.ts +28 -2
- package/dist/monorepo/managed-files.d.ts.map +1 -1
- package/dist/monorepo/managed-files.js +74 -22
- package/dist/release/github-release.d.ts +10 -0
- package/dist/release/github-release.d.ts.map +1 -1
- package/dist/release/github-release.js +11 -5
- package/dist/release/index.d.ts.map +1 -1
- package/dist/release/index.js +4 -5
- package/dist/secrets/commands.d.ts +52 -13
- package/dist/secrets/commands.d.ts.map +1 -1
- package/dist/secrets/commands.js +220 -34
- package/dist/secrets/index.d.ts +21 -1
- package/dist/secrets/index.d.ts.map +1 -1
- package/dist/secrets/index.js +110 -4
- package/dist/secrets/repository.d.ts +60 -0
- package/dist/secrets/repository.d.ts.map +1 -0
- package/dist/secrets/repository.js +145 -0
- package/dist/wrangler/cloudflare.d.ts +7 -0
- package/dist/wrangler/cloudflare.d.ts.map +1 -1
- package/dist/wrangler/cloudflare.js +10 -0
- package/dist/wrangler/deploy-stage.d.ts.map +1 -1
- package/dist/wrangler/deploy-stage.js +50 -24
- package/dist/wrangler/stage-secrets.d.ts +57 -0
- package/dist/wrangler/stage-secrets.d.ts.map +1 -0
- package/dist/wrangler/stage-secrets.js +178 -0
- package/managed/raw/tooling/direnv/devenv.smoo.nix +9 -1
- package/managed/raw/tooling/git-hooks/pre-push.sh +30 -29
- package/package.json +2 -2
- package/src/cli.ts +33 -10
- package/src/github-ci/index.test.ts +6 -7
- package/src/github-ci/index.ts +11 -19
- package/src/lib/deploy-tags.ts +22 -4
- package/src/monorepo/__tests__/ci-workflow.test.ts +161 -0
- package/src/monorepo/ci-workflow.ts +277 -2
- package/src/monorepo/managed-files.test.ts +96 -37
- package/src/monorepo/managed-files.ts +94 -23
- package/src/monorepo/package-policy.test.ts +1 -1
- package/src/release/__tests__/github-release.test.ts +8 -4
- package/src/release/github-release.ts +13 -5
- package/src/release/index.ts +4 -4
- package/src/secrets/commands.test.ts +28 -0
- package/src/secrets/commands.ts +237 -35
- package/src/secrets/index.test.ts +118 -1
- package/src/secrets/index.ts +108 -4
- package/src/secrets/repository.test.ts +98 -0
- package/src/secrets/repository.ts +164 -0
- package/src/wrangler/cloudflare.ts +18 -0
- package/src/wrangler/deploy-stage.test.ts +258 -11
- package/src/wrangler/deploy-stage.ts +70 -38
- package/src/wrangler/stage-secrets.ts +146 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type NonEmptyArray, type PackageCargoCredentialsConfig, type PackagePrivateNpmConfig, type PackageRemoteCacheConfig, type PackageSmooGithub, type PackageSmooGithubEnvironments, type PackageSourceCheckoutConfig } from '../lib/json.js';
|
|
2
2
|
import { type NxProjects } from '../nx/index.js';
|
|
3
|
+
import type { DeploymentStage } from '../wrangler/stage.js';
|
|
4
|
+
import { type CiCrossTestArchive } from './ci-workflow.js';
|
|
3
5
|
/**
|
|
4
6
|
* Repos may append their own content to a managed file below this marker —
|
|
5
7
|
* e.g. extra merge drivers in .gitattributes. Everything from the marker
|
|
@@ -81,6 +83,12 @@ export interface ManagedFileContext {
|
|
|
81
83
|
cargoCredentials?: PackageCargoCredentialsConfig;
|
|
82
84
|
/** Declared self-hosted Nx remote cache from the root smoo config; absent means local caching only. */
|
|
83
85
|
remoteCache?: PackageRemoteCacheConfig;
|
|
86
|
+
/**
|
|
87
|
+
* Cross-built test archives the graph can produce, one per foreign target
|
|
88
|
+
* triple the cargo workspace declares. Empty for a repository that declares
|
|
89
|
+
* none, which renders a CI workflow with no cross steps and no macOS job.
|
|
90
|
+
*/
|
|
91
|
+
crossTestArchives: CiCrossTestArchive[];
|
|
84
92
|
}
|
|
85
93
|
interface DeployTargetInfo {
|
|
86
94
|
exists: boolean;
|
|
@@ -90,10 +98,28 @@ export declare const managedFileTargetsForTest: {
|
|
|
90
98
|
target: string;
|
|
91
99
|
executable: boolean | undefined;
|
|
92
100
|
}[];
|
|
101
|
+
/** Test seam: the managed targets a repository of this shape gets, in file order. */
|
|
102
|
+
export declare function managedFileTargetsForContext(context: ManagedFileContext): string[];
|
|
93
103
|
export declare function applyManagedFiles(root: string, mode: 'update' | 'check' | 'diff'): Promise<FileResult[]>;
|
|
94
104
|
/** Renders a generated workflow through its real managed-file descriptor, so the context wiring is covered. */
|
|
95
105
|
export declare function renderManagedWorkflowForTest(source: 'ci-workflow' | 'publish-workflow', context: ManagedFileContext): string;
|
|
96
106
|
export declare function hasExactTargetForTest(targetNames: Iterable<string>, target: string): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Test seam: the cross-built test archives this graph can produce, read back
|
|
109
|
+
* out of the inferred `cargo-cross-test-archive-<triple>` targets.
|
|
110
|
+
*
|
|
111
|
+
* Derived, not configured. The triple is declared exactly once — in the cargo
|
|
112
|
+
* workspace's own `[workspace.metadata.smoothbricks.test] cross-targets`, where
|
|
113
|
+
* a Rust target triple belongs — and both halves of the workflow are rendered
|
|
114
|
+
* from the targets that declaration produced. A second copy in `smoo.github`
|
|
115
|
+
* could name a triple the graph cannot build, and CI would discover that only
|
|
116
|
+
* on the runner.
|
|
117
|
+
*
|
|
118
|
+
* The path is the target's own output location, so the artifact the Linux job
|
|
119
|
+
* uploads and the file the macOS job's runner opens are the same string
|
|
120
|
+
* computed once.
|
|
121
|
+
*/
|
|
122
|
+
export declare function crossTestArchivesForTest(projects: NxProjects): CiCrossTestArchive[];
|
|
97
123
|
/**
|
|
98
124
|
* The platform families the release workflow produces: the graph's families
|
|
99
125
|
* minus the ones the repository excludes. Excluding a family the graph does not
|
|
@@ -111,8 +137,8 @@ export declare function platformTargetGlobsForTest(targetNames: Iterable<string>
|
|
|
111
137
|
* platform builds serialize no matter how many workers Nx is given.
|
|
112
138
|
*/
|
|
113
139
|
export declare function macosPlatformArchitecturesForTest(targetNames: Iterable<string>): string[];
|
|
114
|
-
/** Test seam:
|
|
115
|
-
export declare function deployTargetInfoFromProjects(projects: NxProjects,
|
|
140
|
+
/** Test seam: what the stage flow deploys, and with which provider, from graph nodes. */
|
|
141
|
+
export declare function deployTargetInfoFromProjects(projects: NxProjects, stage: DeploymentStage): DeployTargetInfo;
|
|
116
142
|
/** Test seam: whether any project in the graph carries the Nx tag. */
|
|
117
143
|
export declare function anyProjectHasTagForTest(projects: NxProjects, tag: string): boolean;
|
|
118
144
|
export declare function printResults(results: FileResult[]): void;
|
|
@@ -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":"AASA,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,6BAA6B,EAElC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAEjC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAEL,KAAK,UAAU,EAIhB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,KAAK,kBAAkB,EAAmD,MAAM,kBAAkB,CAAC;AAO5G;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,yEAAyE,CAAC;AAW3G,sFAAsF;AACtF,iBAAS,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,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AM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBxE"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { appendFileSync, existsSync, lstatSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { dirname, join, resolve } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { cargoCrossTestArchiveFile, cargoCrossTestTripleFromArchiveTarget, } from '@smoothbricks/nx-plugin/cross-check-policy';
|
|
4
5
|
import { MACOS_PLATFORM_TARGET_GLOBS, PLATFORM_TARGET_GLOBS } from '@smoothbricks/nx-plugin/workspace-config-policy';
|
|
5
|
-
import {
|
|
6
|
+
import { PRODUCTION_PUSH_DEPLOY_TAG, stageDeploysProject } from '../lib/deploy-tags.js';
|
|
6
7
|
import { ciPushBranches, readValidatedPackageJson, } from '../lib/json.js';
|
|
7
8
|
import { listReleasePackages, packageInfo } from '../lib/workspace.js';
|
|
8
|
-
import { loadNxProjects, targetNamesFromProjects } from '../nx/index.js';
|
|
9
|
+
import { loadNxProjects, projectRootFromNxProjectJson, targetNamesFromNxProjectJson, targetNamesFromProjects, } from '../nx/index.js';
|
|
9
10
|
import { resolvePrivateNpmWorkflowConfig } from '../release/private-npm.js';
|
|
10
11
|
import { privateNpmReadTokenJobEnv, renderCiWorkflowYaml } from './ci-workflow.js';
|
|
11
12
|
import { renderRunsOnLine } from './github-runs-on.js';
|
|
@@ -235,15 +236,27 @@ const managedFiles = [
|
|
|
235
236
|
];
|
|
236
237
|
export const managedFileTargetsForTest = managedFiles.map(({ target, executable }) => ({ target, executable }));
|
|
237
238
|
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
239
|
+
/**
|
|
240
|
+
* Whether a repository of this shape has the file at all. A repository that owns
|
|
241
|
+
* no packages has nothing to publish, and one the stage flow does not deploy to
|
|
242
|
+
* Cloudflare has no preview stage to clean up.
|
|
243
|
+
*/
|
|
244
|
+
function managedFileApplies(file, context) {
|
|
245
|
+
if (file.releasePackagesOnly === true && !context.hasReleasePackages && !context.hasProductionDeployTargets) {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
return file.cloudflareDeployOnly !== true || context.stagingDeployProvider === 'cloudflare';
|
|
249
|
+
}
|
|
250
|
+
/** Test seam: the managed targets a repository of this shape gets, in file order. */
|
|
251
|
+
export function managedFileTargetsForContext(context) {
|
|
252
|
+
return managedFiles.filter((file) => managedFileApplies(file, context)).map((file) => file.target);
|
|
253
|
+
}
|
|
238
254
|
export async function applyManagedFiles(root, mode) {
|
|
239
255
|
const context = await getManagedFileContext(root);
|
|
240
256
|
return managedFiles.map((file) => applyManagedFile(root, file, mode, context));
|
|
241
257
|
}
|
|
242
258
|
function applyManagedFile(root, file, mode, context) {
|
|
243
|
-
if (file
|
|
244
|
-
return { target: file.target, action: 'skipped' };
|
|
245
|
-
}
|
|
246
|
-
if (file.cloudflareDeployOnly === true && context.stagingDeployProvider !== 'cloudflare') {
|
|
259
|
+
if (!managedFileApplies(file, context)) {
|
|
247
260
|
return { target: file.target, action: 'skipped' };
|
|
248
261
|
}
|
|
249
262
|
const target = resolve(root, file.target);
|
|
@@ -305,6 +318,9 @@ function getManagedContent(file, context) {
|
|
|
305
318
|
deploySecrets: context.ciDeploySecrets,
|
|
306
319
|
e2eSecrets: context.ciE2eSecrets,
|
|
307
320
|
productionOnPush: context.hasProductionPushDeployTargets,
|
|
321
|
+
crossTestArchives: context.crossTestArchives,
|
|
322
|
+
macosRunsOn: context.macosRunsOn,
|
|
323
|
+
platformProducer: context.platformProducer,
|
|
308
324
|
});
|
|
309
325
|
}
|
|
310
326
|
if (file.source === 'publish-workflow') {
|
|
@@ -397,11 +413,45 @@ async function getManagedFileContext(root) {
|
|
|
397
413
|
? macosPlatformArchitecturesForTest(targetNames)
|
|
398
414
|
: [],
|
|
399
415
|
privateNpm,
|
|
416
|
+
crossTestArchives: crossTestArchivesForTest(nxProjects),
|
|
400
417
|
};
|
|
401
418
|
}
|
|
402
419
|
export function hasExactTargetForTest(targetNames, target) {
|
|
403
420
|
return [...targetNames].includes(target);
|
|
404
421
|
}
|
|
422
|
+
/**
|
|
423
|
+
* Test seam: the cross-built test archives this graph can produce, read back
|
|
424
|
+
* out of the inferred `cargo-cross-test-archive-<triple>` targets.
|
|
425
|
+
*
|
|
426
|
+
* Derived, not configured. The triple is declared exactly once — in the cargo
|
|
427
|
+
* workspace's own `[workspace.metadata.smoothbricks.test] cross-targets`, where
|
|
428
|
+
* a Rust target triple belongs — and both halves of the workflow are rendered
|
|
429
|
+
* from the targets that declaration produced. A second copy in `smoo.github`
|
|
430
|
+
* could name a triple the graph cannot build, and CI would discover that only
|
|
431
|
+
* on the runner.
|
|
432
|
+
*
|
|
433
|
+
* The path is the target's own output location, so the artifact the Linux job
|
|
434
|
+
* uploads and the file the macOS job's runner opens are the same string
|
|
435
|
+
* computed once.
|
|
436
|
+
*/
|
|
437
|
+
export function crossTestArchivesForTest(projects) {
|
|
438
|
+
const archives = [];
|
|
439
|
+
for (const project of Object.values(projects)) {
|
|
440
|
+
const projectRoot = projectRootFromNxProjectJson(project);
|
|
441
|
+
for (const targetName of targetNamesFromNxProjectJson(project)) {
|
|
442
|
+
const triple = cargoCrossTestTripleFromArchiveTarget(targetName);
|
|
443
|
+
if (triple === null) {
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
const file = cargoCrossTestArchiveFile(triple);
|
|
447
|
+
archives.push({
|
|
448
|
+
triple,
|
|
449
|
+
path: projectRoot === undefined || projectRoot === '.' ? file : `${projectRoot}/${file}`,
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return archives.sort((left, right) => left.triple.localeCompare(right.triple));
|
|
454
|
+
}
|
|
405
455
|
/**
|
|
406
456
|
* The platform families the release workflow produces: the graph's families
|
|
407
457
|
* minus the ones the repository excludes. Excluding a family the graph does not
|
|
@@ -445,12 +495,12 @@ export function macosPlatformArchitecturesForTest(targetNames) {
|
|
|
445
495
|
}
|
|
446
496
|
return [...architectures].sort((left, right) => left.localeCompare(right));
|
|
447
497
|
}
|
|
448
|
-
/** Test seam:
|
|
449
|
-
export function deployTargetInfoFromProjects(projects,
|
|
498
|
+
/** Test seam: what the stage flow deploys, and with which provider, from graph nodes. */
|
|
499
|
+
export function deployTargetInfoFromProjects(projects, stage) {
|
|
450
500
|
let exists = false;
|
|
451
501
|
let provider;
|
|
452
502
|
for (const project of Object.values(projects)) {
|
|
453
|
-
const info = deployTargetInfoFromProject(project,
|
|
503
|
+
const info = deployTargetInfoFromProject(project, stage);
|
|
454
504
|
if (!info.exists) {
|
|
455
505
|
continue;
|
|
456
506
|
}
|
|
@@ -463,22 +513,24 @@ export function deployTargetInfoFromProjects(projects, configuration) {
|
|
|
463
513
|
export function anyProjectHasTagForTest(projects, tag) {
|
|
464
514
|
return Object.values(projects).some((project) => project.tags?.includes(tag));
|
|
465
515
|
}
|
|
466
|
-
|
|
516
|
+
/**
|
|
517
|
+
* A generated deploy job exists for the projects CI would actually deploy, which
|
|
518
|
+
* is `stageDeploysProject` and nothing else — the same rule `smoo github-ci
|
|
519
|
+
* nx-deploy` selects by, so the job and its selection cannot disagree. Reading
|
|
520
|
+
* the target's presence instead would render a deploy job, with cloud
|
|
521
|
+
* credentials, into a repository whose only wrangler manifests document a
|
|
522
|
+
* Durable Object binding for a published library's consumers.
|
|
523
|
+
*
|
|
524
|
+
* The command is read for the PROVIDER only: which cloud CLI runs says which
|
|
525
|
+
* credentials the job needs, and says nothing about whether CI runs it.
|
|
526
|
+
*/
|
|
527
|
+
function deployTargetInfoFromProject(project, stage) {
|
|
467
528
|
const deploy = project.targets?.deploy;
|
|
468
|
-
if (!deploy) {
|
|
469
|
-
return { exists: false };
|
|
470
|
-
}
|
|
471
|
-
const baseCommandValue = deploy.options?.command ?? deploy.command;
|
|
472
|
-
const baseCommand = typeof baseCommandValue === 'string' ? baseCommandValue : '';
|
|
473
|
-
if (isStageDerivedDeploy(project.tags, baseCommand)) {
|
|
474
|
-
return { exists: true, provider: deployProvider(baseCommand) };
|
|
475
|
-
}
|
|
476
|
-
const config = deploy.configurations?.[configuration];
|
|
477
|
-
if (!config) {
|
|
529
|
+
if (!deploy || !stageDeploysProject(project.tags, stage)) {
|
|
478
530
|
return { exists: false };
|
|
479
531
|
}
|
|
480
|
-
const
|
|
481
|
-
return { exists: true, provider: deployProvider(typeof
|
|
532
|
+
const command = deploy.options?.command ?? deploy.command;
|
|
533
|
+
return { exists: true, provider: deployProvider(typeof command === 'string' ? command : '') };
|
|
482
534
|
}
|
|
483
535
|
function deployProvider(command) {
|
|
484
536
|
return command.includes('wrangler ') ? 'cloudflare' : undefined;
|
|
@@ -42,6 +42,16 @@ export declare function nxProjectChangelogArgs(pkg: ReleasePackageInfo, previous
|
|
|
42
42
|
dryRun: boolean;
|
|
43
43
|
firstRelease: boolean;
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* The release body for a version that carries no commits of its own.
|
|
47
|
+
*
|
|
48
|
+
* Nx bumps a project when a dependency it depends on was bumped, and reports
|
|
49
|
+
* that reason itself ("because a dependency was bumped"). Such a version has no
|
|
50
|
+
* commits touching the project, so Nx generates no changelog for it — which is
|
|
51
|
+
* correct, not a failure. Treating the absence as fatal made one dependency-only
|
|
52
|
+
* package abort a whole publish after the versions had already been written.
|
|
53
|
+
*/
|
|
54
|
+
export declare const DEPENDENCY_ONLY_RELEASE_NOTES = "_No changelog entries for this package: this version was released because one of its dependencies was bumped._";
|
|
45
55
|
export declare function projectChangelogContents(result: ProjectChangelogLookupResult, projectName: string): string;
|
|
46
56
|
export declare function githubReleaseLookupExists(tag: string, exitCode: number, stdout: string, stderr: string): boolean;
|
|
47
57
|
export declare function githubReleaseCommandArgs(tag: string, notesFile: string, releaseExists: boolean, version: string): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-release.d.ts","sourceRoot":"","sources":["../../src/release/github-release.ts"],"names":[],"mappings":"AAOA,O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tC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,OAAO,EACtB,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CAgBV;AAMD;;;;;;;;;GASG;AACH,UAAU,kBAAkB;IAC1B,6BAA6B,EAAE,cAAc,gCAAgC,CAAC,CAAC;IAC/E,qCAAqC,EAAE,cAAc,wCAAwC,CAAC,CAAC;IAC/F,uCAAuC,EAAE,cAAc,0CAA0C,CAAC,CAAC;CACpG;AAED,wBAAsB,iBAAiB,CAAC,OAAO,SAAS,MAAM,kBAAkB,EAC9E,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAMtC;AAED,wBAAsB,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAmB5F"}
|
|
@@ -49,12 +49,18 @@ export function nxProjectChangelogArgs(pkg, previousTag, dryRun) {
|
|
|
49
49
|
};
|
|
50
50
|
return previousTag ? { ...base, from: previousTag } : { ...base, firstRelease: true };
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* The release body for a version that carries no commits of its own.
|
|
54
|
+
*
|
|
55
|
+
* Nx bumps a project when a dependency it depends on was bumped, and reports
|
|
56
|
+
* that reason itself ("because a dependency was bumped"). Such a version has no
|
|
57
|
+
* commits touching the project, so Nx generates no changelog for it — which is
|
|
58
|
+
* correct, not a failure. Treating the absence as fatal made one dependency-only
|
|
59
|
+
* package abort a whole publish after the versions had already been written.
|
|
60
|
+
*/
|
|
61
|
+
export const DEPENDENCY_ONLY_RELEASE_NOTES = '_No changelog entries for this package: this version was released because one of its dependencies was bumped._';
|
|
52
62
|
export function projectChangelogContents(result, projectName) {
|
|
53
|
-
|
|
54
|
-
if (!changelog) {
|
|
55
|
-
throw new Error(`Nx did not generate a project changelog for ${projectName}.`);
|
|
56
|
-
}
|
|
57
|
-
return changelog.contents;
|
|
63
|
+
return result.projectChangelogs?.[projectName]?.contents ?? DEPENDENCY_ONLY_RELEASE_NOTES;
|
|
58
64
|
}
|
|
59
65
|
export function githubReleaseLookupExists(tag, exitCode, stdout, stderr) {
|
|
60
66
|
if (exitCode === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/release/index.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,WAAW,EACX,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,gBAAgB,IAAI,0BAA0B,EAC9C,yBAAyB,IAAI,mCAAmC,EAChE,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAClC,KAAK,iCAAiC,EACtC,KAAK,kBAAkB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,6BAA6B,EAC7B,KAAK,MAAM,IAAI,gBAAgB,EAC/B,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,KAAK,2BAA2B,EAIjC,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAQL,KAAK,kBAAkB,EAGxB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/release/index.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,WAAW,EACX,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,oBAAoB,EACpB,mBAAmB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B,EAAE,CAkB9F"}
|
package/dist/release/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import { bootstrapNpmPackages, NPM_BOOTSTRAP_DIST_TAG, NPM_BOOTSTRAP_VERSION, }
|
|
|
23
23
|
import { resolveBuildInputPatterns } from './build-inputs.js';
|
|
24
24
|
import { parseReleaseProjectSelection, releaseCandidatePackages, } from './candidates.js';
|
|
25
25
|
import { classifyReleaseBranchPush, collectOwnedReleaseTagRecords, divergedReleaseBranchMessage, pendingReleaseTargets, releaseTag, releaseTagAliases, } from './core.js';
|
|
26
|
-
import { createOrUpdateGithubRelease, githubReleaseLookupExists, importWorkspaceNx, renderNxProjectChangelogContents, withNxWorkspaceRoot, } from './github-release.js';
|
|
26
|
+
import { createOrUpdateGithubRelease, DEPENDENCY_ONLY_RELEASE_NOTES, githubReleaseLookupExists, importWorkspaceNx, renderNxProjectChangelogContents, withNxWorkspaceRoot, } from './github-release.js';
|
|
27
27
|
import { publishWithAuthDiagnostics } from './npm-auth.js';
|
|
28
28
|
import { bumpStableReleaseToNext, collectRepairPlatformOutputs, completeReleaseAtHead as completeReleaseAtHeadWithShell, prepareReleaseCandidate, repairPendingTargets, runReleaseTag, runReleaseVersion, } from './orchestration.js';
|
|
29
29
|
import { packReleaseTarball } from './pack.js';
|
|
@@ -1128,10 +1128,9 @@ async function writeReleasePreviewSummary(root, currentPackages, previewPackages
|
|
|
1128
1128
|
lines.push(` - \`${pkg.name}\`: \`${currentByName.get(pkg.name)?.version ?? 'unknown'}\` -> \`${pkg.version}\``);
|
|
1129
1129
|
}
|
|
1130
1130
|
for (const pkg of previewPackages) {
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
}
|
|
1131
|
+
// A dependency-only bump has no commits of its own, so Nx generates no
|
|
1132
|
+
// changelog for it. The preview says so rather than refusing to render.
|
|
1133
|
+
const contents = releasePreviewChangelogs.get(pkg.projectName) ?? DEPENDENCY_ONLY_RELEASE_NOTES;
|
|
1135
1134
|
lines.push('', `### ${pkg.name} ${pkg.version}`, '', contents.trim());
|
|
1136
1135
|
}
|
|
1137
1136
|
}
|
|
@@ -5,41 +5,80 @@
|
|
|
5
5
|
* world-readable) and never printed. Reading one from the terminal disables
|
|
6
6
|
* echo, so a pasted key does not end up in a scrollback buffer or a screen
|
|
7
7
|
* share.
|
|
8
|
+
*
|
|
9
|
+
* A value lives at repository scope or inside a named GitHub Environment, and
|
|
10
|
+
* a job bound to an environment resolves `secrets.X` from that environment
|
|
11
|
+
* first and from the repository second — which is how one name carries test
|
|
12
|
+
* credentials on a preview stage and live ones in production. Every scope the
|
|
13
|
+
* workflows bind is read before anything is called missing: reading only the
|
|
14
|
+
* repository reports values that do exist as absent, and sends an operator
|
|
15
|
+
* hunting for a secret that is already set.
|
|
16
|
+
*/
|
|
17
|
+
import { type SecretRow } from './index.js';
|
|
18
|
+
/**
|
|
19
|
+
* Every secret this checkout declares that the repository does not hold, in
|
|
20
|
+
* the order an operator should fix them: the ones a workflow already promises
|
|
21
|
+
* break a deploy today, the rest break the next one.
|
|
22
|
+
*/
|
|
23
|
+
export declare function secretsNeedingValues(rows: readonly SecretRow[]): SecretRow[];
|
|
24
|
+
/**
|
|
25
|
+
* Every secret this checkout declares that the named environment does not
|
|
26
|
+
* hold. A name the repository already holds is still offered: an environment
|
|
27
|
+
* value overrides the repository's for a job bound to it, and overriding one
|
|
28
|
+
* stage's credentials is the reason to write at environment scope at all. A
|
|
29
|
+
* repository secret no source declares is not offered — that is a stale value
|
|
30
|
+
* to review, not one to copy into an environment.
|
|
8
31
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
32
|
+
export declare function secretsMissingInEnvironment(rows: readonly SecretRow[], environment: string): SecretRow[];
|
|
33
|
+
/** Why a secret is wanted, so a prompt states what will break without it. */
|
|
34
|
+
export declare function describeNeed(row: SecretRow): string;
|
|
35
|
+
/**
|
|
36
|
+
* Secret names GitHub currently holds at the given scope, or a refusal naming
|
|
37
|
+
* what failed. With no environment that is repository scope; with one it is
|
|
38
|
+
* that environment's own secrets, which are the values a bound job reads
|
|
39
|
+
* first.
|
|
40
|
+
*/
|
|
41
|
+
export declare function readRepositorySecrets(repo: string | undefined, environment?: string): {
|
|
11
42
|
ok: true;
|
|
12
43
|
names: string[];
|
|
13
44
|
} | {
|
|
14
45
|
ok: false;
|
|
15
46
|
reason: string;
|
|
16
47
|
};
|
|
17
|
-
/** Write one secret, value over stdin so it never reaches argv. */
|
|
18
|
-
export declare function writeRepositorySecret(name: string, value: string, repo: string | undefined): Promise<{
|
|
48
|
+
/** Write one secret at the given scope, value over stdin so it never reaches argv. */
|
|
49
|
+
export declare function writeRepositorySecret(name: string, value: string, repo: string | undefined, environment?: string): Promise<{
|
|
19
50
|
ok: true;
|
|
20
51
|
} | {
|
|
21
52
|
ok: false;
|
|
22
53
|
reason: string;
|
|
23
54
|
}>;
|
|
24
55
|
/**
|
|
25
|
-
* Print every known secret
|
|
26
|
-
* promises a value
|
|
27
|
-
* that fails a deploy, and it fails talking about the
|
|
28
|
-
* missing secret.
|
|
56
|
+
* Print every known secret and the scopes holding it. Exit code 1 when a
|
|
57
|
+
* workflow promises a value no scope a bound job reads can supply — that
|
|
58
|
+
* combination is the one that fails a deploy, and it fails talking about the
|
|
59
|
+
* value rather than the missing secret.
|
|
29
60
|
*/
|
|
30
61
|
export declare function secretsStatus(root: string, options: {
|
|
31
62
|
repo?: string;
|
|
63
|
+
env?: string;
|
|
32
64
|
}): number;
|
|
33
|
-
/**
|
|
34
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Set one secret, or - with no name - walk every secret this checkout declares
|
|
67
|
+
* and the target scope does not hold, prompting once each. The walk is the
|
|
68
|
+
* point of the command: an operator should never have to transcribe names out
|
|
69
|
+
* of a status table to know what to paste.
|
|
70
|
+
*/
|
|
71
|
+
export declare function secretsSet(root: string, name: string | undefined, options: {
|
|
35
72
|
repo?: string;
|
|
73
|
+
env?: string;
|
|
36
74
|
}): Promise<number>;
|
|
37
75
|
/**
|
|
38
|
-
* Push every locally fetchable secret to the repository
|
|
39
|
-
* `smoo.secrets` declares a command for: everything else has no
|
|
40
|
-
* and must be pasted with `smoo secrets set`.
|
|
76
|
+
* Push every locally fetchable secret to the repository, or to one environment.
|
|
77
|
+
* Only names `smoo.secrets` declares a command for: everything else has no
|
|
78
|
+
* source here and must be pasted with `smoo secrets set`.
|
|
41
79
|
*/
|
|
42
80
|
export declare function secretsSync(root: string, options: {
|
|
43
81
|
repo?: string;
|
|
82
|
+
env?: string;
|
|
44
83
|
}): Promise<number>;
|
|
45
84
|
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/secrets/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/secrets/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAKL,KAAK,SAAS,EAOf,MAAM,YAAY,CAAC;AAGpB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EAAE,CAG5E;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,CAOxG;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAUnD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAwB/D;AAED,sFA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