@git.zone/cli 6.14.0 → 6.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_ts/00_commitinfo_data.js +3 -3
- package/dist_ts/helpers.workflow.d.ts +10 -0
- package/dist_ts/helpers.workflow.js +22 -1
- package/dist_ts/mod_config/index.js +41 -2
- package/dist_ts/mod_release/classes.releasejournal.d.ts +23 -13
- package/dist_ts/mod_release/classes.releasejournal.js +83 -35
- package/dist_ts/mod_release/helpers.npmartifact.d.ts +20 -0
- package/dist_ts/mod_release/helpers.npmartifact.js +50 -2
- package/dist_ts/mod_release/helpers.releasebranch.d.ts +6 -0
- package/dist_ts/mod_release/helpers.releasebranch.js +56 -1
- package/dist_ts/mod_release/helpers.releasepublication.d.ts +2 -0
- package/dist_ts/mod_release/helpers.releasepublication.js +68 -46
- package/dist_ts/mod_release/helpers.releaseversion.d.ts +59 -0
- package/dist_ts/mod_release/helpers.releaseversion.js +148 -0
- package/dist_ts/mod_release/index.d.ts +19 -0
- package/dist_ts/mod_release/index.js +97 -45
- package/package.json +6 -6
- package/readme.md +92 -12
- package/ts/00_commitinfo_data.ts +3 -3
- package/ts/helpers.workflow.ts +39 -0
- package/ts/mod_config/index.ts +45 -0
- package/ts/mod_release/classes.releasejournal.ts +141 -63
- package/ts/mod_release/helpers.npmartifact.ts +76 -1
- package/ts/mod_release/helpers.releasebranch.ts +114 -0
- package/ts/mod_release/helpers.releasepublication.ts +119 -61
- package/ts/mod_release/helpers.releaseversion.ts +261 -0
- package/ts/mod_release/index.ts +167 -57
package/readme.md
CHANGED
|
@@ -187,7 +187,7 @@ Before interactive confirmation or source mutation, a Docker release verifies th
|
|
|
187
187
|
The release core is not configurable plumbing. It always follows the same professional release transaction:
|
|
188
188
|
|
|
189
189
|
1. Verify the release branch, clean state, and `main` worktree ownership.
|
|
190
|
-
2. Read `changelog.md` `## Pending` entries and infer or accept a semver bump.
|
|
190
|
+
2. Read `changelog.md` `## Pending` entries and infer or accept a semver bump, raised to `release.versionFloor` when that is higher.
|
|
191
191
|
3. Run configured tests.
|
|
192
192
|
4. With `--merge`, fast-forward and lease-push `main` before release metadata is created.
|
|
193
193
|
5. Update version files and baked commit info.
|
|
@@ -242,12 +242,64 @@ Release flags:
|
|
|
242
242
|
| `--no-publish` | Remove Gitea assets, npm and Docker from the resolved target set without implicitly enabling Git |
|
|
243
243
|
| `--no-build` | Disable the separate post-metadata project build; Docker qualification still performs its required image build |
|
|
244
244
|
| `--merge` | Fast-forward and lease-push a cleanly rebased feature branch into `main`, then release from `main`; incompatible with Docker or Gitea assets |
|
|
245
|
-
| `--major`, `--minor`, `--patch` | Override inferred semver level
|
|
245
|
+
| `--major`, `--minor`, `--patch` | Override inferred semver level; `release.versionFloor` still applies |
|
|
246
246
|
| `--plan` | Show the resolved workflow without fetching or mutating refs, files, the index, or worktrees |
|
|
247
247
|
| `inspect [version]` | Read one or all durable release journals; add `--json` for machine-readable output |
|
|
248
248
|
| `resume <version>` | Resume journaled Git, npm, qualification, promotion, or cleanup work; fresh-release overrides are rejected, and `--json` remains inspect-only |
|
|
249
249
|
| `--recover-attempt <id>` | Recover the exact 32-character lowercase hexadecimal `attempt.id` shown by `inspect --json`, after independently proving its publisher stopped |
|
|
250
250
|
|
|
251
|
+
### Version floor
|
|
252
|
+
|
|
253
|
+
`release.versionFloor` sets a minimum for the next release version. Use it when a repository must join a common version line, for example when every serve.zone package moves to major 32:
|
|
254
|
+
|
|
255
|
+
```json
|
|
256
|
+
{
|
|
257
|
+
"@git.zone/cli": {
|
|
258
|
+
"release": {
|
|
259
|
+
"versionFloor": "32.0.0"
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
GitZone first infers the version as usual. It starts from the current `package.json` or `deno.json` version and applies the level from the Pending changelog or from `--major`, `--minor` or `--patch`. The release version is then the higher of that inferred version and the floor. The floor is committed configuration, so the plain `gitzone release -y` honours it without a flag, and nobody has to hand-edit `package.json` to a version that was never published.
|
|
266
|
+
|
|
267
|
+
`gitzone release --plan` states the outcome:
|
|
268
|
+
|
|
269
|
+
| Plan line | Meaning |
|
|
270
|
+
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
271
|
+
| `version floor: 32.0.0 applied (inferred 3.6.0 -> release 32.0.0)` | The floor is higher than the inferred version and becomes the release version |
|
|
272
|
+
| `version floor: 3.5.4 satisfied by inferred 3.6.0` | The inferred version already meets the floor; nothing changes |
|
|
273
|
+
| `version floor: 32.0.0 inert (current 32.0.0 already meets it); remove release.versionFloor` | The project has reached the floor; delete the setting |
|
|
274
|
+
| `version notice: the floor raises the major version above inferred 3.6.0, and Pending ...` | The floor raised the major version above the inferred version and Pending has no `### Breaking Changes` section; the line is informational and stays until such a section exists |
|
|
275
|
+
|
|
276
|
+
A floor does not require a `### Breaking Changes` Pending section. `--major` never required one, and the floor is the same kind of explicit maintainer decision, reviewed in a commit. Aligning a version line is often not an API break, so requiring the section would force a false changelog entry. A major release is also the safe direction for consumers, because `^3` ranges never resolve to `32.0.0`. The plan notice only makes that jump visible and never blocks the release. It appears only when the floor itself raises the major version; a major that `--major` produces prints no notice.
|
|
277
|
+
|
|
278
|
+
When the floor decides the version, the release journal records that decision with the release identity:
|
|
279
|
+
|
|
280
|
+
```json
|
|
281
|
+
"release": {
|
|
282
|
+
"version": "32.0.0",
|
|
283
|
+
"tag": "v32.0.0",
|
|
284
|
+
"mainOid": "...",
|
|
285
|
+
"tagOid": "...",
|
|
286
|
+
"versionFloor": { "floor": "32.0.0", "inferredVersion": "3.6.0" }
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
`gitzone release inspect` and `gitzone release resume` print the same `version floor: ... applied` line. The record is part of the journal's immutable identity. `resume` always publishes the journaled version and never resolves a new one. This matters because after the release commit the floor is inert, and a fresh resolution would infer `32.0.1`. `recover` takes its version from the existing tag and writes no floor record, because the failed run did not record its level override.
|
|
291
|
+
|
|
292
|
+
The floor must be a canonical `x.y.z` string whose components do not exceed `9007199254740991`. Every rejection throws `ReleaseVersionError`, and its `code` names the rule that failed. `malformed-version-floor` and `unsupported-prerelease-floor` are configuration errors that `--plan` and `gitzone config doctor` report. `--plan` and the release raise `noncanonical-version` when the current `package.json` or `deno.json` version is not canonical. `current-version-changed` is raised only while the release runs:
|
|
293
|
+
|
|
294
|
+
| Code | Cause |
|
|
295
|
+
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
296
|
+
| `malformed-version-floor` | Anything else, such as `"32"`, `"v32.0.0"`, `null`, a number, or a component above `9007199254740991` |
|
|
297
|
+
| `unsupported-prerelease-floor` | A prerelease or build suffix such as `"32.0.0-rc.1"`; GitZone releases only canonical versions |
|
|
298
|
+
| `noncanonical-version` | A floor is configured but the current `package.json` or `deno.json` version is not a canonical `x.y.z` version to compare against |
|
|
299
|
+
| `current-version-changed` | The release checkout's `package.json` or `deno.json` version differs from the version the release was resolved from |
|
|
300
|
+
|
|
301
|
+
`gitzone config show` lists the configured floor.
|
|
302
|
+
|
|
251
303
|
### Exact artifacts and release journals
|
|
252
304
|
|
|
253
305
|
Journal schema 1 supports Git and public npm publication. Schema 2 adds Docker qualification, promotion, and cleanup evidence without changing the storage path or schema-1 parsing and resume behavior. Fresh and resumed npm publication dynamically qualifies the active stable `pnpm` version; there is no version allowlist. GitZone reads `minimum-release-age` and `minimum-release-age-exclude` through that exact pnpm invocation in the release directory, so project configuration and global policy retain pnpm's normal precedence. It verifies the selected version's publication time through the configured registry unless the effective policy disables the age delay or excludes that version. Missing timestamps follow `minimum-release-age-ignore-missing-time`, including pnpm's default of `true`; malformed policy, metadata failures, immature versions, and prerelease versions stop qualification. GitZone also verifies the required pack/publish command contract and keeps every subsequent command bound to the qualified exact version. A new pnpm version with the same capabilities needs no GitZone update once it satisfies the policy. Registries must be unique canonical credential-free HTTP(S) URLs, and `release.targets.npm.accessLevel` must be `public` so verification does not depend on publisher credentials.
|
|
@@ -287,6 +339,37 @@ The canonical journal binds the release commit, annotated tag object, hashed Git
|
|
|
287
339
|
|
|
288
340
|
Packing must leave the release tree clean. Each registry receives that exact stored tarball through `pnpm publish <tarball> --ignore-scripts`, so publish lifecycle scripts do not run. Success is recorded only after anonymous no-redirect probes verify version metadata, SHA-1 and integrity fields, the downloaded tarball bytes, and the `latest` dist-tag. A matching pre-existing version follows `release.targets.npm.alreadyPublished`; conflicting bytes always stop the release, while transient responses and dist-tag propagation remain retryable.
|
|
289
341
|
|
|
342
|
+
#### Accepted npm uploads
|
|
343
|
+
|
|
344
|
+
A registry accepts an upload before it serves it, and npmjs can need minutes
|
|
345
|
+
or more than an hour to make the version readable. GitZone records that state
|
|
346
|
+
as `accepted`: the upload was taken, its bytes are proven locally, and only an
|
|
347
|
+
exact anonymous probe promotes it to `verified`. `accepted` is not `failed`.
|
|
348
|
+
`failed` means the registry rejected the submission or the publish command
|
|
349
|
+
itself failed.
|
|
350
|
+
|
|
351
|
+
After submitting, GitZone waits `release.targets.npm.verificationWindowMinutes`
|
|
352
|
+
(default 15) for the version to become readable, probing with doubling backoff
|
|
353
|
+
from two seconds up to twenty. If the window ends without a readable version,
|
|
354
|
+
the run reports the accepted target, exits successfully, and leaves the journal
|
|
355
|
+
incomplete; the release did not fail. A later `gitzone release resume <version>
|
|
356
|
+
-y` verifies the accepted target and never republishes it. An HTTP 409 during
|
|
357
|
+
any publish attempt, for a staged or an already published version, is read the
|
|
358
|
+
same way: the registry holds that version, so the target becomes `accepted` and
|
|
359
|
+
verification still has to prove the exact bytes.
|
|
360
|
+
|
|
361
|
+
Because Docker destinations follow verified npm publication, a Docker release
|
|
362
|
+
whose npm target is still `accepted` stops after npm and is resumed from the
|
|
363
|
+
release commit, because Docker promotion still has work to do. Only a resume
|
|
364
|
+
with no publication work left runs from a later `main`.
|
|
365
|
+
|
|
366
|
+
A resume whose remaining targets are only `accepted` or `verified` publishes
|
|
367
|
+
nothing, so it does not require the working tree to sit on the release commit.
|
|
368
|
+
It runs from any later `main` that still contains that commit and still carries
|
|
369
|
+
the release tag, both locally and on the unchanged remote; work can therefore
|
|
370
|
+
continue on `main` while a registry catches up. A resume that still has
|
|
371
|
+
publication work left continues to require the journaled release commit.
|
|
372
|
+
|
|
290
373
|
### Publishing independently installable components
|
|
291
374
|
|
|
292
375
|
Set `release.targets.npm.packageSource` to `"tspublish"` to release the named
|
|
@@ -332,13 +415,9 @@ reruns component discovery, preparation, builds, or packing.
|
|
|
332
415
|
npm can hold accepted uploads for publish-time scanning before they become
|
|
333
416
|
installable. Component releases submit the package set in dependency order,
|
|
334
417
|
then wait for availability across the submitted set so scans can overlap.
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
stop submission immediately. Availability verification allows approximately
|
|
339
|
-
15 minutes per pending target, and a later resume can continue if a registry
|
|
340
|
-
takes longer. Every package, tarball and `latest` tag must verify before the
|
|
341
|
-
release is complete. Root npm and Docker release ordering is unchanged.
|
|
418
|
+
Command failures and artifact conflicts still stop submission immediately.
|
|
419
|
+
Every package, tarball and `latest` tag must verify before the release is
|
|
420
|
+
complete. Root npm and Docker release ordering is unchanged.
|
|
342
421
|
|
|
343
422
|
See [npm's publish-time scanning announcement](https://github.blog/changelog/2026-07-28-npm-publish-time-malware-scanning-and-dual-use-metadata/)
|
|
344
423
|
for the registry's availability behavior.
|
|
@@ -452,9 +531,9 @@ gitzone release resume 6.0.0 -y
|
|
|
452
531
|
gitzone release resume 6.0.0 -y --recover-attempt="$ATTEMPT_ID"
|
|
453
532
|
```
|
|
454
533
|
|
|
455
|
-
Resume requires the
|
|
534
|
+
Resume requires the annotated release tag and each journaled destination setting to remain exact; the local `main` commit must be exact for any remaining publication work and must merely contain the release commit for a verification-only resume. The Git remote must still match when Git is journaled; npm registry, access, and already-published settings must still match when npm is journaled. Before any recovery or publication work, a nonterminal schema-2 resume canonical-compares the current Docker request with the journal, verifies every required project-local tSDocker protocol capability, and validates the journaled request; additive future capabilities are accepted. A completed schema-2 journal trusts its terminal cleanup evidence and does not require candidate state or current Docker configuration. Non-journaled target configuration is ignored, so releases created with a target subset remain resumable. Fresh-release overrides such as targets, integration, build, test, and version flags are rejected even in negated forms such as `--no-git`, `--no-publish`, and `--no-build`; JSON output is available only through `inspect --json`.
|
|
456
535
|
|
|
457
|
-
Resume probes remotely observable targets before acting. Exact state is accepted without republishing; positive byte, metadata, ref, or digest conflicts fail closed, while inconclusive results do not overwrite a previously verified state. A Git, npm, Docker qualification, promotion, or cleanup target left in `publishing` state retains authority until the exact recorded 32-character lowercase hexadecimal `attempt.id` is supplied after independently proving its publisher stopped. An interrupted tSDocker `preparing` record has no qualification evidence and cannot be promoted; when tSDocker reports `RECOVERY_REQUIRED`, the exact recovered qualification owner removes only that incomplete deterministic preparation before claiming a fresh qualification attempt. Promotion recovery first reclaims the retired owner's request files and probes the journaled destination; an exact qualified digest is accepted, pending state retires the old attempt and claims a fresh owner before retry, an inconclusive probe retains the old journal owner, and conflicts halt permanently. Final cleanup of a qualified candidate starts only after every promotion is verified and is itself idempotently recoverable. A terminal qualification destination conflict has no promotions, blocks Git/npm, and permits only exact qualified-candidate cleanup.
|
|
536
|
+
Resume probes remotely observable targets before acting. A published Git release is identified by its annotated tag and that tag's commit, so remote `main` carrying later commits is exact state rather than a conflict. Exact state is accepted without republishing; positive byte, metadata, ref, or digest conflicts fail closed, while inconclusive results do not overwrite a previously verified state. An npm target in `accepted` state is only ever verified: its bytes are never sent again, and a resume that still cannot read the version leaves it accepted and succeeds. A Git, npm, Docker qualification, promotion, or cleanup target left in `publishing` state retains authority until the exact recorded 32-character lowercase hexadecimal `attempt.id` is supplied after independently proving its publisher stopped. An interrupted tSDocker `preparing` record has no qualification evidence and cannot be promoted; when tSDocker reports `RECOVERY_REQUIRED`, the exact recovered qualification owner removes only that incomplete deterministic preparation before claiming a fresh qualification attempt. Promotion recovery first reclaims the retired owner's request files and probes the journaled destination; an exact qualified digest is accepted, pending state retires the old attempt and claims a fresh owner before retry, an inconclusive probe retains the old journal owner, and conflicts halt permanently. Final cleanup of a qualified candidate starts only after every promotion is verified and is itself idempotently recoverable. A terminal qualification destination conflict has no promotions, blocks Git/npm, and permits only exact qualified-candidate cleanup.
|
|
458
537
|
|
|
459
538
|
Schema 1 resumes final Git release-ref and npm publication after the journal is atomically installed. Schema 2 additionally resumes Docker qualification, ordered promotion, and cleanup. Schema 3 resumes the complete npm package set. `--merge` remains available only for non-Docker releases because its pre-release Git push would violate qualification-before-publication ordering.
|
|
460
539
|
|
|
@@ -559,7 +638,8 @@ CLI workflow config lives under `@git.zone/cli` in `.smartconfig.json`. Docker r
|
|
|
559
638
|
"enabled": true,
|
|
560
639
|
"registries": ["https://registry.npmjs.org"],
|
|
561
640
|
"accessLevel": "public",
|
|
562
|
-
"alreadyPublished": "success"
|
|
641
|
+
"alreadyPublished": "success",
|
|
642
|
+
"verificationWindowMinutes": 15
|
|
563
643
|
},
|
|
564
644
|
"docker": {
|
|
565
645
|
"enabled": false,
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* autocreated commitinfo by @push.rocks/commitinfo
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
|
-
name:
|
|
6
|
-
version:
|
|
7
|
-
description:
|
|
5
|
+
name: "@git.zone/cli",
|
|
6
|
+
version: "6.16.0",
|
|
7
|
+
description: "A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management."
|
|
8
8
|
}
|
package/ts/helpers.workflow.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { getCliConfigValue } from "./helpers.smartconfig.js";
|
|
2
2
|
import { getProcessUserArgv } from "./helpers.climode.js";
|
|
3
3
|
import { shouldCleanTestArtifactsOnRelease } from "./helpers.tstest.js";
|
|
4
|
+
import { parseReleaseVersionFloor } from "./mod_release/helpers.releaseversion.js";
|
|
5
|
+
import { defaultNpmVerificationWindowMinutes } from "./mod_release/helpers.npmartifact.js";
|
|
4
6
|
|
|
5
7
|
export type TConfirmationMode = "prompt" | "auto" | "plan";
|
|
6
8
|
|
|
@@ -45,6 +47,8 @@ export interface IReleaseNpmTargetConfig {
|
|
|
45
47
|
registries?: string[];
|
|
46
48
|
accessLevel?: "public" | "private";
|
|
47
49
|
alreadyPublished?: "success" | "error";
|
|
50
|
+
/** Minutes one accepted upload may stay unreadable before resume takes over. */
|
|
51
|
+
verificationWindowMinutes?: number;
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
export interface IReleaseGiteaAssetsTargetConfig {
|
|
@@ -156,6 +160,8 @@ export interface IReleaseWorkflowConfig {
|
|
|
156
160
|
strategy?: "semver";
|
|
157
161
|
source?: "pendingChangelog" | "manual";
|
|
158
162
|
};
|
|
163
|
+
/** Canonical x.y.z minimum for the next release version. */
|
|
164
|
+
versionFloor?: string;
|
|
159
165
|
preflight?: {
|
|
160
166
|
test?: boolean;
|
|
161
167
|
build?: boolean;
|
|
@@ -197,6 +203,7 @@ export interface IResolvedReleaseWorkflow {
|
|
|
197
203
|
changelogFile: "changelog.md";
|
|
198
204
|
changelogPendingSection: "Pending";
|
|
199
205
|
changelogVersionHeading: "## {{date}} - {{version}}";
|
|
206
|
+
versionFloor?: string;
|
|
200
207
|
gitEnabled: boolean;
|
|
201
208
|
gitRemote: string;
|
|
202
209
|
pushBranch: boolean;
|
|
@@ -206,6 +213,7 @@ export interface IResolvedReleaseWorkflow {
|
|
|
206
213
|
npmPackageSource: "root" | "tspublish";
|
|
207
214
|
npmAccessLevel: "public" | "private";
|
|
208
215
|
npmAlreadyPublished: "success" | "error";
|
|
216
|
+
npmVerificationWindowMinutes: number;
|
|
209
217
|
giteaAssets?: IResolvedReleaseGiteaAssetsConfiguration;
|
|
210
218
|
dockerEnabled: boolean;
|
|
211
219
|
dockerEngine: "tsdocker";
|
|
@@ -225,6 +233,8 @@ export interface IResolvedReleaseResumeConfiguration {
|
|
|
225
233
|
npmRegistries: string[];
|
|
226
234
|
npmAccessLevel: "public" | "private";
|
|
227
235
|
npmAlreadyPublished: "success" | "error";
|
|
236
|
+
npmVerificationWindowMinutes: number;
|
|
237
|
+
cleanTestArtifacts: boolean;
|
|
228
238
|
giteaAssets?: IResolvedReleaseGiteaAssetsConfiguration;
|
|
229
239
|
}
|
|
230
240
|
|
|
@@ -738,6 +748,24 @@ export const resolveCommitWorkflow = async (
|
|
|
738
748
|
};
|
|
739
749
|
};
|
|
740
750
|
|
|
751
|
+
/** One accepted upload may wait this long for the registry to serve it. */
|
|
752
|
+
export const resolveNpmVerificationWindowMinutes = (
|
|
753
|
+
valueArg: unknown,
|
|
754
|
+
): number => {
|
|
755
|
+
if (valueArg === undefined) return defaultNpmVerificationWindowMinutes;
|
|
756
|
+
if (
|
|
757
|
+
typeof valueArg !== "number" ||
|
|
758
|
+
!Number.isSafeInteger(valueArg) ||
|
|
759
|
+
valueArg < 1 ||
|
|
760
|
+
valueArg > 720
|
|
761
|
+
) {
|
|
762
|
+
throw new Error(
|
|
763
|
+
"release.targets.npm.verificationWindowMinutes must be a whole number of minutes between 1 and 720",
|
|
764
|
+
);
|
|
765
|
+
}
|
|
766
|
+
return valueArg;
|
|
767
|
+
};
|
|
768
|
+
|
|
741
769
|
const resolveNpmPackageSource = (valueArg: unknown): "root" | "tspublish" => {
|
|
742
770
|
if (valueArg === undefined || valueArg === "root") return "root";
|
|
743
771
|
if (valueArg === "tspublish") return valueArg;
|
|
@@ -751,6 +779,7 @@ export const resolveReleaseWorkflow = async (
|
|
|
751
779
|
): Promise<IResolvedReleaseWorkflow> => {
|
|
752
780
|
const cliConfig = await readCliWorkflowConfig();
|
|
753
781
|
const releaseConfig = cliConfig.release || {};
|
|
782
|
+
const versionFloor = parseReleaseVersionFloor(releaseConfig.versionFloor);
|
|
754
783
|
const targetConfig = releaseConfig.targets || {};
|
|
755
784
|
const gitConfig = targetConfig.git || {};
|
|
756
785
|
const npmConfig = targetConfig.npm || {};
|
|
@@ -892,6 +921,7 @@ export const resolveReleaseWorkflow = async (
|
|
|
892
921
|
changelogFile: "changelog.md",
|
|
893
922
|
changelogPendingSection: "Pending",
|
|
894
923
|
changelogVersionHeading: "## {{date}} - {{version}}",
|
|
924
|
+
...(versionFloor ? { versionFloor } : {}),
|
|
895
925
|
gitEnabled,
|
|
896
926
|
gitRemote: gitConfig.remote || "origin",
|
|
897
927
|
pushBranch,
|
|
@@ -903,6 +933,9 @@ export const resolveReleaseWorkflow = async (
|
|
|
903
933
|
: "root",
|
|
904
934
|
npmAccessLevel: npmConfig.accessLevel || "public",
|
|
905
935
|
npmAlreadyPublished: npmConfig.alreadyPublished || "success",
|
|
936
|
+
npmVerificationWindowMinutes: resolveNpmVerificationWindowMinutes(
|
|
937
|
+
npmConfig.verificationWindowMinutes,
|
|
938
|
+
),
|
|
906
939
|
...(giteaAssets ? { giteaAssets } : {}),
|
|
907
940
|
dockerEnabled,
|
|
908
941
|
dockerEngine: "tsdocker",
|
|
@@ -934,6 +967,7 @@ export const resolveReleaseResumeConfiguration = async (optionsArg: {
|
|
|
934
967
|
let npmRegistries: string[] = [];
|
|
935
968
|
let npmAccessLevel: "public" | "private" = "public";
|
|
936
969
|
let npmAlreadyPublished: "success" | "error" = "success";
|
|
970
|
+
let npmVerificationWindowMinutes = defaultNpmVerificationWindowMinutes;
|
|
937
971
|
if (optionsArg.npm) {
|
|
938
972
|
if (
|
|
939
973
|
npmConfig.registries !== undefined &&
|
|
@@ -972,6 +1006,9 @@ export const resolveReleaseResumeConfiguration = async (optionsArg: {
|
|
|
972
1006
|
}
|
|
973
1007
|
npmAccessLevel = npmConfig.accessLevel || "public";
|
|
974
1008
|
npmAlreadyPublished = npmConfig.alreadyPublished || "success";
|
|
1009
|
+
npmVerificationWindowMinutes = resolveNpmVerificationWindowMinutes(
|
|
1010
|
+
npmConfig.verificationWindowMinutes,
|
|
1011
|
+
);
|
|
975
1012
|
}
|
|
976
1013
|
|
|
977
1014
|
return {
|
|
@@ -982,6 +1019,8 @@ export const resolveReleaseResumeConfiguration = async (optionsArg: {
|
|
|
982
1019
|
: "root",
|
|
983
1020
|
npmAccessLevel,
|
|
984
1021
|
npmAlreadyPublished,
|
|
1022
|
+
npmVerificationWindowMinutes,
|
|
1023
|
+
cleanTestArtifacts: await shouldCleanTestArtifactsOnRelease(process.cwd()),
|
|
985
1024
|
...(optionsArg.giteaAssets
|
|
986
1025
|
? {
|
|
987
1026
|
giteaAssets: resolveGiteaAssetsConfiguration(
|
package/ts/mod_config/index.ts
CHANGED
|
@@ -22,9 +22,14 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
getDeclaredTsdockerRange,
|
|
24
24
|
resolveGiteaAssetsConfiguration,
|
|
25
|
+
resolveNpmVerificationWindowMinutes,
|
|
25
26
|
} from "../helpers.workflow.js";
|
|
26
27
|
import { hasInstalledProjectTsdockerBinary } from "../helpers.tsdocker.js";
|
|
27
28
|
import { TsdockerReleaseClient } from "../mod_release/helpers.tsdockerprotocol.js";
|
|
29
|
+
import {
|
|
30
|
+
ReleaseVersionError,
|
|
31
|
+
parseReleaseVersionFloor,
|
|
32
|
+
} from "../mod_release/helpers.releaseversion.js";
|
|
28
33
|
import { getSealedReleaseConfigError } from "../helpers.sealedrelease.js";
|
|
29
34
|
|
|
30
35
|
export { ReleaseConfig, CommitConfig };
|
|
@@ -298,6 +303,7 @@ async function handleShow(mode: ICliMode): Promise<void> {
|
|
|
298
303
|
const targets = release.targets || {};
|
|
299
304
|
printConfigSection("Release Workflow", [
|
|
300
305
|
["confirmation", formatValue(release.confirmation)],
|
|
306
|
+
["version floor", formatValue(release.versionFloor)],
|
|
301
307
|
["clean tree", "required"],
|
|
302
308
|
["run tests", formatValue(release.preflight?.test)],
|
|
303
309
|
["run build", formatValue(release.preflight?.build)],
|
|
@@ -1776,6 +1782,8 @@ async function validateReleaseConfig(
|
|
|
1776
1782
|
});
|
|
1777
1783
|
}
|
|
1778
1784
|
|
|
1785
|
+
findings.push(validateReleaseVersionFloor(releaseConfig.versionFloor));
|
|
1786
|
+
|
|
1779
1787
|
if (
|
|
1780
1788
|
releaseConfig.registries ||
|
|
1781
1789
|
releaseConfig.accessLevel ||
|
|
@@ -1842,6 +1850,25 @@ async function validateReleaseConfig(
|
|
|
1842
1850
|
await validateDockerTarget(targets.docker || {}, smartconfigData, findings);
|
|
1843
1851
|
}
|
|
1844
1852
|
|
|
1853
|
+
function validateReleaseVersionFloor(valueArg: unknown): IDoctorFinding {
|
|
1854
|
+
try {
|
|
1855
|
+
const versionFloor = parseReleaseVersionFloor(valueArg);
|
|
1856
|
+
return {
|
|
1857
|
+
level: "ok",
|
|
1858
|
+
message: versionFloor
|
|
1859
|
+
? `Release version floor ${versionFloor} is a canonical version`
|
|
1860
|
+
: "Release version floor is not configured",
|
|
1861
|
+
};
|
|
1862
|
+
} catch (error) {
|
|
1863
|
+
if (!(error instanceof ReleaseVersionError)) throw error;
|
|
1864
|
+
return {
|
|
1865
|
+
level: "error",
|
|
1866
|
+
message: error.message,
|
|
1867
|
+
fix: "Set release.versionFloor to a canonical x.y.z version or remove it.",
|
|
1868
|
+
};
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1845
1872
|
async function validateAssetsConfig(
|
|
1846
1873
|
rawAssetsConfig: unknown,
|
|
1847
1874
|
smartconfigData: Record<string, any>,
|
|
@@ -2059,6 +2086,24 @@ async function validateNpmTarget(
|
|
|
2059
2086
|
fix: "Use root or tspublish.",
|
|
2060
2087
|
});
|
|
2061
2088
|
}
|
|
2089
|
+
try {
|
|
2090
|
+
const windowMinutes = resolveNpmVerificationWindowMinutes(
|
|
2091
|
+
npmTarget.verificationWindowMinutes,
|
|
2092
|
+
);
|
|
2093
|
+
findings.push({
|
|
2094
|
+
level: "ok",
|
|
2095
|
+
message: `npm accepted uploads verify for up to ${windowMinutes} minutes`,
|
|
2096
|
+
});
|
|
2097
|
+
} catch (error) {
|
|
2098
|
+
findings.push({
|
|
2099
|
+
level: "error",
|
|
2100
|
+
message:
|
|
2101
|
+
error instanceof Error
|
|
2102
|
+
? error.message
|
|
2103
|
+
: "Invalid npm verification window",
|
|
2104
|
+
fix: "Set release.targets.npm.verificationWindowMinutes to a whole number of minutes between 1 and 720 or remove it.",
|
|
2105
|
+
});
|
|
2106
|
+
}
|
|
2062
2107
|
|
|
2063
2108
|
const smartNetwork = new plugins.smartnetwork.SmartNetwork();
|
|
2064
2109
|
await Promise.all(
|