putitoutthere 0.2.29 → 0.2.31
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/CHANGELOG.md +41 -0
- package/MIGRATIONS.md +1311 -0
- package/README.md +373 -41
- package/action.yml +9 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +28 -6
- package/dist/action.js.map +1 -1
- package/dist/cascade.js +14 -7
- package/dist/cascade.js.map +1 -1
- package/dist/check-crate-size.d.ts +26 -0
- package/dist/check-crate-size.d.ts.map +1 -0
- package/dist/check-crate-size.js +99 -0
- package/dist/check-crate-size.js.map +1 -0
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +116 -16
- package/dist/check.js.map +1 -1
- package/dist/cli.d.ts +17 -4
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +173 -22
- package/dist/cli.js.map +1 -1
- package/dist/completeness.js +6 -3
- package/dist/completeness.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +20 -5
- package/dist/config.js.map +1 -1
- package/dist/ensure-tag.d.ts +17 -0
- package/dist/ensure-tag.d.ts.map +1 -0
- package/dist/ensure-tag.js +28 -0
- package/dist/ensure-tag.js.map +1 -0
- package/dist/env.js +6 -3
- package/dist/env.js.map +1 -1
- package/dist/error-codes.d.ts +89 -0
- package/dist/error-codes.d.ts.map +1 -1
- package/dist/error-codes.js +102 -0
- package/dist/error-codes.js.map +1 -1
- package/dist/git.d.ts +5 -0
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js +19 -6
- package/dist/git.js.map +1 -1
- package/dist/glob.d.ts +9 -0
- package/dist/glob.d.ts.map +1 -1
- package/dist/glob.js +29 -1
- package/dist/glob.js.map +1 -1
- package/dist/handlers/crates.d.ts +15 -0
- package/dist/handlers/crates.d.ts.map +1 -1
- package/dist/handlers/crates.js +84 -9
- package/dist/handlers/crates.js.map +1 -1
- package/dist/handlers/npm-platform.d.ts +11 -0
- package/dist/handlers/npm-platform.d.ts.map +1 -1
- package/dist/handlers/npm-platform.js +91 -8
- package/dist/handlers/npm-platform.js.map +1 -1
- package/dist/handlers/npm.d.ts.map +1 -1
- package/dist/handlers/npm.js +59 -9
- package/dist/handlers/npm.js.map +1 -1
- package/dist/handlers/pypi.d.ts +0 -6
- package/dist/handlers/pypi.d.ts.map +1 -1
- package/dist/handlers/pypi.js +28 -10
- package/dist/handlers/pypi.js.map +1 -1
- package/dist/log.js +16 -8
- package/dist/log.js.map +1 -1
- package/dist/normalize-artifacts.js +8 -4
- package/dist/normalize-artifacts.js.map +1 -1
- package/dist/plan-skew.d.ts +14 -0
- package/dist/plan-skew.d.ts.map +1 -0
- package/dist/plan-skew.js +28 -0
- package/dist/plan-skew.js.map +1 -0
- package/dist/plan-status-types.d.ts +42 -0
- package/dist/plan-status-types.d.ts.map +1 -0
- package/dist/plan-status-types.js +10 -0
- package/dist/plan-status-types.js.map +1 -0
- package/dist/plan-status.d.ts +23 -0
- package/dist/plan-status.d.ts.map +1 -0
- package/dist/plan-status.js +66 -0
- package/dist/plan-status.js.map +1 -0
- package/dist/plan.d.ts +8 -0
- package/dist/plan.d.ts.map +1 -1
- package/dist/plan.js +125 -25
- package/dist/plan.js.map +1 -1
- package/dist/preflight.d.ts +79 -0
- package/dist/preflight.d.ts.map +1 -1
- package/dist/preflight.js +715 -33
- package/dist/preflight.js.map +1 -1
- package/dist/publish.d.ts +7 -0
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +49 -18
- package/dist/publish.js.map +1 -1
- package/dist/python-versions.d.ts +40 -0
- package/dist/python-versions.d.ts.map +1 -0
- package/dist/python-versions.js +142 -0
- package/dist/python-versions.js.map +1 -0
- package/dist/reconcile-types.d.ts +36 -0
- package/dist/reconcile-types.d.ts.map +1 -0
- package/dist/reconcile-types.js +9 -0
- package/dist/reconcile-types.js.map +1 -0
- package/dist/reconcile.d.ts +21 -0
- package/dist/reconcile.d.ts.map +1 -0
- package/dist/reconcile.js +54 -0
- package/dist/reconcile.js.map +1 -0
- package/dist/release-packages.d.ts +33 -0
- package/dist/release-packages.d.ts.map +1 -0
- package/dist/release-packages.js +74 -0
- package/dist/release-packages.js.map +1 -0
- package/dist/resolve-tag-commit.d.ts +22 -0
- package/dist/resolve-tag-commit.d.ts.map +1 -0
- package/dist/resolve-tag-commit.js +26 -0
- package/dist/resolve-tag-commit.js.map +1 -0
- package/dist/retry.js +14 -7
- package/dist/retry.js.map +1 -1
- package/dist/status-classify.d.ts +17 -0
- package/dist/status-classify.d.ts.map +1 -0
- package/dist/status-classify.js +37 -0
- package/dist/status-classify.js.map +1 -0
- package/dist/status-format.d.ts +9 -0
- package/dist/status-format.d.ts.map +1 -0
- package/dist/status-format.js +19 -0
- package/dist/status-format.js.map +1 -0
- package/dist/status-types.d.ts +31 -0
- package/dist/status-types.d.ts.map +1 -0
- package/dist/status-types.js +8 -0
- package/dist/status-types.js.map +1 -0
- package/dist/status.d.ts +28 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +72 -0
- package/dist/status.js.map +1 -0
- package/dist/tag-template.js +2 -1
- package/dist/tag-template.js.map +1 -1
- package/dist/trailer.js +16 -9
- package/dist/trailer.js.map +1 -1
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -2
- package/dist/types.js.map +1 -1
- package/dist/verbose.js +7 -4
- package/dist/verbose.js.map +1 -1
- package/dist/wheel-abi.d.ts +37 -0
- package/dist/wheel-abi.d.ts.map +1 -0
- package/dist/wheel-abi.js +118 -0
- package/dist/wheel-abi.js.map +1 -0
- package/dist/write-crate-version.d.ts +32 -0
- package/dist/write-crate-version.d.ts.map +1 -0
- package/dist/write-crate-version.js +52 -0
- package/dist/write-crate-version.js.map +1 -0
- package/dist/write-launcher.d.ts +82 -0
- package/dist/write-launcher.d.ts.map +1 -0
- package/dist/write-launcher.js +236 -0
- package/dist/write-launcher.js.map +1 -0
- package/dist/write-version.js +2 -1
- package/dist/write-version.js.map +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `release_packages` manual-release spec parser.
|
|
3
|
+
*
|
|
4
|
+
* The spec is the value of the reusable workflow's `release_packages`
|
|
5
|
+
* input. It lets a consumer trigger a release of explicitly named
|
|
6
|
+
* packages without any new code — the motivating case being a
|
|
7
|
+
* re-release after a putitoutthere bug fix, where the consumer's repo
|
|
8
|
+
* has no new commits but the packages still need to ship again.
|
|
9
|
+
*
|
|
10
|
+
* Grammar:
|
|
11
|
+
* spec = entry *( "," entry )
|
|
12
|
+
* entry = package-name [ "@" version-spec ]
|
|
13
|
+
* version-spec = "patch" | "minor" | "major" | semver
|
|
14
|
+
*
|
|
15
|
+
* A bare package name defaults to a `patch` bump. `semver` is strict
|
|
16
|
+
* `X.Y.Z` (see `version.ts`). Whitespace around entries and the comma
|
|
17
|
+
* separator is tolerated.
|
|
18
|
+
*/
|
|
19
|
+
import type { Bump } from './types.js';
|
|
20
|
+
export interface ReleasePackagesEntry {
|
|
21
|
+
name: string;
|
|
22
|
+
/** Set when the entry gave a bump keyword (or a bare name → patch). */
|
|
23
|
+
bump?: Bump;
|
|
24
|
+
/** Set when the entry gave an explicit semver. */
|
|
25
|
+
version?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Parse a `release_packages` spec into a name→entry map. Returns `null`
|
|
29
|
+
* when the spec is absent or empty (the caller falls back to normal
|
|
30
|
+
* change-detected planning). Throws on any malformed entry.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseReleasePackages(spec: string | undefined): Map<string, ReleasePackagesEntry> | null;
|
|
33
|
+
//# sourceMappingURL=release-packages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-packages.d.ts","sourceRoot":"","sources":["../src/release-packages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAMD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,IAAI,CAiD1C"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `release_packages` manual-release spec parser.
|
|
3
|
+
*
|
|
4
|
+
* The spec is the value of the reusable workflow's `release_packages`
|
|
5
|
+
* input. It lets a consumer trigger a release of explicitly named
|
|
6
|
+
* packages without any new code — the motivating case being a
|
|
7
|
+
* re-release after a putitoutthere bug fix, where the consumer's repo
|
|
8
|
+
* has no new commits but the packages still need to ship again.
|
|
9
|
+
*
|
|
10
|
+
* Grammar:
|
|
11
|
+
* spec = entry *( "," entry )
|
|
12
|
+
* entry = package-name [ "@" version-spec ]
|
|
13
|
+
* version-spec = "patch" | "minor" | "major" | semver
|
|
14
|
+
*
|
|
15
|
+
* A bare package name defaults to a `patch` bump. `semver` is strict
|
|
16
|
+
* `X.Y.Z` (see `version.ts`). Whitespace around entries and the comma
|
|
17
|
+
* separator is tolerated.
|
|
18
|
+
*/
|
|
19
|
+
import { parseSemver } from './version.js';
|
|
20
|
+
// Same identifier shape the trailer parser and config loader accept.
|
|
21
|
+
const PACKAGE_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
22
|
+
const BUMPS = new Set(['patch', 'minor', 'major']);
|
|
23
|
+
/**
|
|
24
|
+
* Parse a `release_packages` spec into a name→entry map. Returns `null`
|
|
25
|
+
* when the spec is absent or empty (the caller falls back to normal
|
|
26
|
+
* change-detected planning). Throws on any malformed entry.
|
|
27
|
+
*/
|
|
28
|
+
export function parseReleasePackages(spec) {
|
|
29
|
+
if (spec === undefined) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const trimmed = spec.trim();
|
|
33
|
+
if (trimmed === '') {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
const out = new Map();
|
|
37
|
+
for (const raw of trimmed.split(',')) {
|
|
38
|
+
const part = raw.trim();
|
|
39
|
+
if (part === '') {
|
|
40
|
+
throw new Error(`release-packages: empty entry in "${spec}" — remove the stray comma`);
|
|
41
|
+
}
|
|
42
|
+
const at = part.indexOf('@');
|
|
43
|
+
const name = at === -1 ? part : part.slice(0, at);
|
|
44
|
+
const versionSpec = at === -1 ? undefined : part.slice(at + 1).trim();
|
|
45
|
+
if (!PACKAGE_NAME.test(name)) {
|
|
46
|
+
throw new Error(`release-packages: invalid package name "${name}"`);
|
|
47
|
+
}
|
|
48
|
+
if (out.has(name)) {
|
|
49
|
+
throw new Error(`release-packages: duplicate package "${name}"`);
|
|
50
|
+
}
|
|
51
|
+
if (versionSpec === undefined) {
|
|
52
|
+
out.set(name, { name, bump: 'patch' });
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (versionSpec === '') {
|
|
56
|
+
throw new Error(`release-packages: "${name}@" has an empty version spec — ` +
|
|
57
|
+
`drop the @ for a default patch bump, or give patch|minor|major or X.Y.Z`);
|
|
58
|
+
}
|
|
59
|
+
if (BUMPS.has(versionSpec)) {
|
|
60
|
+
out.set(name, { name, bump: versionSpec });
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
parseSemver(versionSpec);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
throw new Error(`release-packages: "${name}@${versionSpec}" — version spec must be ` +
|
|
68
|
+
`patch, minor, major, or a strict semver (X.Y.Z)`);
|
|
69
|
+
}
|
|
70
|
+
out.set(name, { name, version: versionSpec });
|
|
71
|
+
}
|
|
72
|
+
return out;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=release-packages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-packages.js","sourceRoot":"","sources":["../src/release-packages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAW3C,qEAAqE;AACrE,MAAM,YAAY,GAAG,8BAA8B,CAAC;AACpD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAEzD;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAwB;IAExB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QAAA,OAAO,IAAI,CAAC;IAAA,CAAC;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QAAA,OAAO,IAAI,CAAC;IAAA,CAAC;IAElC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAgC,CAAC;IACpD,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QACxB,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACb,qCAAqC,IAAI,4BAA4B,CACtE,CAAC;QACJ,CAAC;QACD,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7B,MAAM,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAClD,MAAM,WAAW,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAA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*
|
|
4
|
+
* piot reads "changed since last release" from a tag's commit, so the
|
|
5
|
+
* commit matters: tagging an old, already-published version at HEAD would
|
|
6
|
+
* hide every change made since it actually shipped. Prefer a sibling
|
|
7
|
+
* package already tagged at the same version — that tag marks the real
|
|
8
|
+
* release commit (the canonical incident: npm/py tagged `v0.0.1` at the
|
|
9
|
+
* merge the crate also published from). Fall back to HEAD only when no
|
|
10
|
+
* sibling tag exists, matching the publish-path auto-heal, which tags the
|
|
11
|
+
* run's HEAD.
|
|
12
|
+
*
|
|
13
|
+
* Issue #410, #403 slice 3.
|
|
14
|
+
*/
|
|
15
|
+
import type { Package } from './config.js';
|
|
16
|
+
export declare function resolveTagCommit(version: string, siblings: readonly Package[], opts: {
|
|
17
|
+
cwd: string;
|
|
18
|
+
}): {
|
|
19
|
+
commit: string;
|
|
20
|
+
source: 'sibling' | 'head';
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=resolve-tag-commit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-tag-commit.d.ts","sourceRoot":"","sources":["../src/resolve-tag-commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAI3C,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GACpB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,CAQhD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pick the commit a backfilled tag should point at.
|
|
3
|
+
*
|
|
4
|
+
* piot reads "changed since last release" from a tag's commit, so the
|
|
5
|
+
* commit matters: tagging an old, already-published version at HEAD would
|
|
6
|
+
* hide every change made since it actually shipped. Prefer a sibling
|
|
7
|
+
* package already tagged at the same version — that tag marks the real
|
|
8
|
+
* release commit (the canonical incident: npm/py tagged `v0.0.1` at the
|
|
9
|
+
* merge the crate also published from). Fall back to HEAD only when no
|
|
10
|
+
* sibling tag exists, matching the publish-path auto-heal, which tags the
|
|
11
|
+
* run's HEAD.
|
|
12
|
+
*
|
|
13
|
+
* Issue #410, #403 slice 3.
|
|
14
|
+
*/
|
|
15
|
+
import { headCommit, tagCommit, tagList } from './git.js';
|
|
16
|
+
import { formatTag } from './tag-template.js';
|
|
17
|
+
export function resolveTagCommit(version, siblings, opts) {
|
|
18
|
+
for (const sib of siblings) {
|
|
19
|
+
const sibTag = formatTag(sib.tag_format, { name: sib.name, version });
|
|
20
|
+
if (tagList(sibTag, { cwd: opts.cwd }).length > 0) {
|
|
21
|
+
return { commit: tagCommit(sibTag, { cwd: opts.cwd }), source: 'sibling' };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return { commit: headCommit({ cwd: opts.cwd }), source: 'head' };
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=resolve-tag-commit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-tag-commit.js","sourceRoot":"","sources":["../src/resolve-tag-commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,UAAU,gBAAgB,CAC9B,OAAe,EACf,QAA4B,EAC5B,IAAqB;IAErB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACtE,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClD,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;QAC7E,CAAC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACnE,CAAC"}
|
package/dist/retry.js
CHANGED
|
@@ -48,28 +48,34 @@ export async function withRetry(fn, opts = {}) {
|
|
|
48
48
|
throw lastErr;
|
|
49
49
|
}
|
|
50
50
|
function isRetryable(err) {
|
|
51
|
-
if (err instanceof AuthError)
|
|
51
|
+
if (err instanceof AuthError) {
|
|
52
52
|
return false;
|
|
53
|
-
|
|
53
|
+
}
|
|
54
|
+
if (err instanceof TransientError) {
|
|
54
55
|
return true;
|
|
56
|
+
}
|
|
55
57
|
// Network-ish error codes used by Node's net/http stack.
|
|
56
58
|
const code = extractProp(err, 'code');
|
|
57
|
-
if (code === 'ECONNRESET' || code === 'ETIMEDOUT')
|
|
59
|
+
if (code === 'ECONNRESET' || code === 'ETIMEDOUT') {
|
|
58
60
|
return true;
|
|
61
|
+
}
|
|
59
62
|
// HTTP-status-tagged errors: retry 5xx and 429.
|
|
60
63
|
const status = extractProp(err, 'status');
|
|
61
64
|
if (typeof status === 'number') {
|
|
62
|
-
if (status === 429)
|
|
65
|
+
if (status === 429) {
|
|
63
66
|
return true;
|
|
64
|
-
|
|
67
|
+
}
|
|
68
|
+
if (status >= 500 && status < 600) {
|
|
65
69
|
return true;
|
|
70
|
+
}
|
|
66
71
|
}
|
|
67
72
|
return false;
|
|
68
73
|
}
|
|
69
74
|
function retryAfterMs(err) {
|
|
70
75
|
const ra = extractProp(err, 'retryAfter');
|
|
71
|
-
if (typeof ra === 'number' && ra > 0)
|
|
76
|
+
if (typeof ra === 'number' && ra > 0) {
|
|
72
77
|
return ra * 1000;
|
|
78
|
+
}
|
|
73
79
|
return 0;
|
|
74
80
|
}
|
|
75
81
|
function extractProp(err, key) {
|
|
@@ -80,8 +86,9 @@ function extractProp(err, key) {
|
|
|
80
86
|
}
|
|
81
87
|
function jitterOffset(baseDelay, fraction) {
|
|
82
88
|
/* v8 ignore next -- default jitter is 0.25; the <=0 guard isn't exercised */
|
|
83
|
-
if (fraction <= 0)
|
|
89
|
+
if (fraction <= 0) {
|
|
84
90
|
return 0;
|
|
91
|
+
}
|
|
85
92
|
// ±fraction of the base delay.
|
|
86
93
|
const amp = baseDelay * fraction;
|
|
87
94
|
return (Math.random() * 2 - 1) * amp;
|
package/dist/retry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AASvD,MAAM,QAAQ,GAA2B;IACvC,OAAO,EAAE,CAAC;IACV,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,CAAC;IACb,MAAM,EAAE,IAAI;CACb,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,EAAoB,EACpB,OAAqB,EAAE;IAEvB,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,EAAE,CAAC;IAEjF,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,OAAgB,CAAC;IACrB,OAAO,OAAO,GAAG,OAAO,EAAE,CAAC;QACzB,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAA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registry/tag reads happen in
|
|
4
|
+
* `computeStatus`. `DRIFT_STATES` is the subset a `status --check` gate
|
|
5
|
+
* fails on.
|
|
6
|
+
*
|
|
7
|
+
* Issue #403.
|
|
8
|
+
*/
|
|
9
|
+
import type { StatusState } from './status-types.js';
|
|
10
|
+
/** States a `status --check` gate treats as failing drift. */
|
|
11
|
+
export declare const DRIFT_STATES: ReadonlySet<StatusState>;
|
|
12
|
+
/**
|
|
13
|
+
* `registryUnreachable` short-circuits to a non-drift "unreachable"
|
|
14
|
+
* state so a registry blip never trips a `--check` gate.
|
|
15
|
+
*/
|
|
16
|
+
export declare function classify(tagVersion: string | null, registry: string | null, registryUnreachable: boolean): StatusState;
|
|
17
|
+
//# sourceMappingURL=status-classify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-classify.d.ts","sourceRoot":"","sources":["../src/status-classify.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,8DAA8D;AAC9D,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,WAAW,CAIhD,CAAC;AAEH;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,mBAAmB,EAAE,OAAO,GAC3B,WAAW,CAOb"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classify one package's drift state from its {latest tag version,
|
|
3
|
+
* registry latest}. Pure — the registry/tag reads happen in
|
|
4
|
+
* `computeStatus`. `DRIFT_STATES` is the subset a `status --check` gate
|
|
5
|
+
* fails on.
|
|
6
|
+
*
|
|
7
|
+
* Issue #403.
|
|
8
|
+
*/
|
|
9
|
+
/** States a `status --check` gate treats as failing drift. */
|
|
10
|
+
export const DRIFT_STATES = new Set([
|
|
11
|
+
'published, untagged',
|
|
12
|
+
'tagged, unpublished',
|
|
13
|
+
'version mismatch',
|
|
14
|
+
]);
|
|
15
|
+
/**
|
|
16
|
+
* `registryUnreachable` short-circuits to a non-drift "unreachable"
|
|
17
|
+
* state so a registry blip never trips a `--check` gate.
|
|
18
|
+
*/
|
|
19
|
+
export function classify(tagVersion, registry, registryUnreachable) {
|
|
20
|
+
if (registryUnreachable) {
|
|
21
|
+
return 'registry unreachable';
|
|
22
|
+
}
|
|
23
|
+
if (tagVersion === null && registry === null) {
|
|
24
|
+
return 'unreleased';
|
|
25
|
+
}
|
|
26
|
+
if (tagVersion === null) {
|
|
27
|
+
return 'published, untagged';
|
|
28
|
+
}
|
|
29
|
+
if (registry === null) {
|
|
30
|
+
return 'tagged, unpublished';
|
|
31
|
+
}
|
|
32
|
+
if (tagVersion === registry) {
|
|
33
|
+
return 'in sync';
|
|
34
|
+
}
|
|
35
|
+
return 'version mismatch';
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=status-classify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-classify.js","sourceRoot":"","sources":["../src/status-classify.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,YAAY,GAA6B,IAAI,GAAG,CAAc;IACzE,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB;CACnB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,UAAU,QAAQ,CACtB,UAAyB,EACzB,QAAuB,EACvB,mBAA4B;IAE5B,IAAI,mBAAmB,EAAE,CAAC;QAAA,OAAO,sBAAsB,CAAC;IAAA,CAAC;IACzD,IAAI,UAAU,KAAK,IAAI,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QAAA,OAAO,YAAY,CAAC;IAAA,CAAC;IACpE,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QAAA,OAAO,qBAAqB,CAAC;IAAA,CAAC;IACxD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QAAA,OAAO,qBAAqB,CAAC;IAAA,CAAC;IACtD,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;QAAA,OAAO,SAAS,CAAC;IAAA,CAAC;IAChD,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-line, monospace-friendly render of one status row, used by the
|
|
3
|
+
* CLI's non-`--json` output.
|
|
4
|
+
*
|
|
5
|
+
* Issue #403.
|
|
6
|
+
*/
|
|
7
|
+
import type { StatusRow } from './status-types.js';
|
|
8
|
+
export declare function formatStatusRow(row: StatusRow): string;
|
|
9
|
+
//# sourceMappingURL=status-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-format.d.ts","sourceRoot":"","sources":["../src/status-format.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAOtD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-line, monospace-friendly render of one status row, used by the
|
|
3
|
+
* CLI's non-`--json` output.
|
|
4
|
+
*
|
|
5
|
+
* Issue #403.
|
|
6
|
+
*/
|
|
7
|
+
export function formatStatusRow(row) {
|
|
8
|
+
const tagCol = row.tagVersion ?? '—';
|
|
9
|
+
const registryCol = row.registryUnreachable ? 'unreachable' : (row.registry ?? '—');
|
|
10
|
+
let mark = '✓';
|
|
11
|
+
if (row.registryUnreachable) {
|
|
12
|
+
mark = '?';
|
|
13
|
+
}
|
|
14
|
+
if (row.drift) {
|
|
15
|
+
mark = '⚠';
|
|
16
|
+
}
|
|
17
|
+
return `${row.package} tag=${tagCol} registry=${registryCol} ${mark} ${row.state}`;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=status-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-format.js","sourceRoot":"","sources":["../src/status-format.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,UAAU,eAAe,CAAC,GAAc;IAC5C,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC;IACrC,MAAM,WAAW,GAAG,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC;IACpF,IAAI,IAAI,GAAG,GAAG,CAAC;IACf,IAAI,GAAG,CAAC,mBAAmB,EAAE,CAAC;QAAA,IAAI,GAAG,GAAG,CAAC;IAAA,CAAC;IAC1C,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;QAAA,IAAI,GAAG,GAAG,CAAC;IAAA,CAAC;IAC5B,OAAO,GAAG,GAAG,CAAC,OAAO,SAAS,MAAM,cAAc,WAAW,KAAK,IAAI,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `status` shared types: the drift-state vocabulary plus the row and
|
|
3
|
+
* options shapes the status command and its renderer pass around.
|
|
4
|
+
*
|
|
5
|
+
* Issue #403.
|
|
6
|
+
*/
|
|
7
|
+
import type { Handler, Kind } from './types.js';
|
|
8
|
+
export type StatusState = 'in sync' | 'unreleased' | 'published, untagged' | 'tagged, unpublished' | 'version mismatch' | 'registry unreachable';
|
|
9
|
+
export interface StatusRow {
|
|
10
|
+
package: string;
|
|
11
|
+
kind: Kind;
|
|
12
|
+
/** Highest-semver git tag for this package, or null when none exists. */
|
|
13
|
+
tag: string | null;
|
|
14
|
+
/** Version parsed out of `tag`, or null when there is no tag. */
|
|
15
|
+
tagVersion: string | null;
|
|
16
|
+
/** Registry's latest published version, or null when never published. */
|
|
17
|
+
registry: string | null;
|
|
18
|
+
/** True when the registry could not be reached (rendered, not gated). */
|
|
19
|
+
registryUnreachable: boolean;
|
|
20
|
+
state: StatusState;
|
|
21
|
+
/** Convenience: does `state` represent drift a `--check` gate fails on? */
|
|
22
|
+
drift: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface StatusOptions {
|
|
25
|
+
cwd: string;
|
|
26
|
+
/** Defaults to `${cwd}/putitoutthere.toml`. */
|
|
27
|
+
configPath?: string;
|
|
28
|
+
/** Override for tests. Defaults to the real per-kind dispatcher. */
|
|
29
|
+
handlerFor?: (kind: Kind) => Handler;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=status-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-types.d.ts","sourceRoot":"","sources":["../src/status-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,YAAY,GACZ,qBAAqB,GACrB,qBAAqB,GACrB,kBAAkB,GAClB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC;IACX,yEAAyE;IACzE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,iEAAiE;IACjE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,yEAAyE;IACzE,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,WAAW,CAAC;IACnB,2EAA2E;IAC3E,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-types.js","sourceRoot":"","sources":["../src/status-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/dist/status.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `putitoutthere status` — read-only registry-vs-tag drift report.
|
|
3
|
+
*
|
|
4
|
+
* The registry is the source of truth; git tags are a cache. For each
|
|
5
|
+
* configured package this reconciles the latest git tag (via the same
|
|
6
|
+
* `lastTag` resolver the planner and the publish path use) against the
|
|
7
|
+
* registry's latest published version (via the same per-kind handler the
|
|
8
|
+
* publish path dispatches through), and classifies any drift. No auth,
|
|
9
|
+
* no side effects — git + public registry metadata only.
|
|
10
|
+
*
|
|
11
|
+
* Shared engine, no parallel logic (design-commitments #7): a thin
|
|
12
|
+
* reader over `lastTag` + `handler.latestVersion` + `classify`. It
|
|
13
|
+
* carries no copy of the tag, version, or registry logic the release
|
|
14
|
+
* path owns, so `status` and a real release can never disagree.
|
|
15
|
+
*
|
|
16
|
+
* Issue #403, phase 1. v1 reports the drift-defining pair only — latest
|
|
17
|
+
* tag vs registry latest; the `manifest` and `publisher` columns from
|
|
18
|
+
* the issue mockup are later enrichments. The drift taxonomy lives in
|
|
19
|
+
* `status-classify.ts`; rendering in `status-format.ts`.
|
|
20
|
+
*/
|
|
21
|
+
import type { StatusOptions, StatusRow } from './status-types.js';
|
|
22
|
+
/**
|
|
23
|
+
* Reconcile every configured package's latest tag against its registry
|
|
24
|
+
* latest. Read-only; makes one unauthenticated registry request per
|
|
25
|
+
* package and never mutates anything.
|
|
26
|
+
*/
|
|
27
|
+
export declare function computeStatus(opts: StatusOptions): Promise<StatusRow[]>;
|
|
28
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAWH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAElE;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAwC7E"}
|
package/dist/status.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `putitoutthere status` — read-only registry-vs-tag drift report.
|
|
3
|
+
*
|
|
4
|
+
* The registry is the source of truth; git tags are a cache. For each
|
|
5
|
+
* configured package this reconciles the latest git tag (via the same
|
|
6
|
+
* `lastTag` resolver the planner and the publish path use) against the
|
|
7
|
+
* registry's latest published version (via the same per-kind handler the
|
|
8
|
+
* publish path dispatches through), and classifies any drift. No auth,
|
|
9
|
+
* no side effects — git + public registry metadata only.
|
|
10
|
+
*
|
|
11
|
+
* Shared engine, no parallel logic (design-commitments #7): a thin
|
|
12
|
+
* reader over `lastTag` + `handler.latestVersion` + `classify`. It
|
|
13
|
+
* carries no copy of the tag, version, or registry logic the release
|
|
14
|
+
* path owns, so `status` and a real release can never disagree.
|
|
15
|
+
*
|
|
16
|
+
* Issue #403, phase 1. v1 reports the drift-defining pair only — latest
|
|
17
|
+
* tag vs registry latest; the `manifest` and `publisher` columns from
|
|
18
|
+
* the issue mockup are later enrichments. The drift taxonomy lives in
|
|
19
|
+
* `status-classify.ts`; rendering in `status-format.ts`.
|
|
20
|
+
*/
|
|
21
|
+
import { join } from 'node:path';
|
|
22
|
+
import { loadConfig } from './config.js';
|
|
23
|
+
import { lastTag } from './git.js';
|
|
24
|
+
import { handlerFor as defaultHandlerFor } from './handlers/index.js';
|
|
25
|
+
import { createLogger } from './log.js';
|
|
26
|
+
import { classify, DRIFT_STATES } from './status-classify.js';
|
|
27
|
+
import { parseTagVersion } from './tag-template.js';
|
|
28
|
+
/**
|
|
29
|
+
* Reconcile every configured package's latest tag against its registry
|
|
30
|
+
* latest. Read-only; makes one unauthenticated registry request per
|
|
31
|
+
* package and never mutates anything.
|
|
32
|
+
*/
|
|
33
|
+
export async function computeStatus(opts) {
|
|
34
|
+
const cwd = opts.cwd;
|
|
35
|
+
const cfgPath = opts.configPath ?? join(cwd, 'putitoutthere.toml');
|
|
36
|
+
const handlerFor = opts.handlerFor ?? defaultHandlerFor;
|
|
37
|
+
const config = loadConfig(cfgPath);
|
|
38
|
+
const ctx = {
|
|
39
|
+
cwd,
|
|
40
|
+
log: createLogger(),
|
|
41
|
+
env: process.env,
|
|
42
|
+
artifacts: { get: () => '', has: () => false },
|
|
43
|
+
};
|
|
44
|
+
const rows = [];
|
|
45
|
+
for (const pkg of config.packages) {
|
|
46
|
+
const tag = lastTag(pkg.name, pkg.tag_format, { cwd });
|
|
47
|
+
const tagVersion = tag === null ? null : parseTagVersion(pkg.tag_format, pkg.name, tag);
|
|
48
|
+
let registry = null;
|
|
49
|
+
let registryUnreachable = false;
|
|
50
|
+
try {
|
|
51
|
+
registry = await handlerFor(pkg.kind).latestVersion(pkg, ctx);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// 5xx / network / timeout / malformed response: a read-only report
|
|
55
|
+
// surfaces "unreachable" rather than aborting or claiming drift.
|
|
56
|
+
registryUnreachable = true;
|
|
57
|
+
}
|
|
58
|
+
const state = classify(tagVersion, registry, registryUnreachable);
|
|
59
|
+
rows.push({
|
|
60
|
+
package: pkg.name,
|
|
61
|
+
kind: pkg.kind,
|
|
62
|
+
tag,
|
|
63
|
+
tagVersion,
|
|
64
|
+
registry,
|
|
65
|
+
registryUnreachable,
|
|
66
|
+
state,
|
|
67
|
+
drift: DRIFT_STATES.has(state),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return rows;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"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,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAExF,IAAI,QAAQ,GAAkB,IAAI,CAAC;QACnC,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC;YACH,QAAQ,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAChE,CAAC;QAAC,MAAM,CAAC;YACP,mEAAmE;YACnE,iEAAiE;YACjE,mBAAmB,GAAG,IAAI,CAAC;QAC7B,CAAC;QAED,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;QAClE,IAAI,CAAC,IAAI,CAAC;YACR,OAAO,EAAE,GAAG,CAAC,IAAI;YACjB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,GAAG;YACH,UAAU;YACV,QAAQ;YACR,mBAAmB;YACnB,KAAK;YACL,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC;SAC/B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/tag-template.js
CHANGED
|
@@ -35,8 +35,9 @@ export function tagGlob(template, name) {
|
|
|
35
35
|
export function parseTagVersion(template, name, tag) {
|
|
36
36
|
const re = templateToRegex(template, name);
|
|
37
37
|
const m = re.exec(tag);
|
|
38
|
-
if (!m)
|
|
38
|
+
if (!m) {
|
|
39
39
|
return null;
|
|
40
|
+
}
|
|
40
41
|
const versionPart = m[1];
|
|
41
42
|
try {
|
|
42
43
|
parseSemver(versionPart);
|
package/dist/tag-template.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-template.js","sourceRoot":"","sources":["../src/tag-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAE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SAC3C,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;IACvC,OAAO,IAAI,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,WAAW,CAAC,CAAS;IAC5B,OAAO,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC"}
|
package/dist/trailer.js
CHANGED
|
@@ -31,8 +31,9 @@ export function parseTrailer(commitBody) {
|
|
|
31
31
|
for (let i = lines.length - 1; i >= 0; i--) {
|
|
32
32
|
const line = lines[i];
|
|
33
33
|
const match = TRAILER_LINE.exec(line);
|
|
34
|
-
if (!match)
|
|
34
|
+
if (!match) {
|
|
35
35
|
continue;
|
|
36
|
+
}
|
|
36
37
|
const payload = match[1];
|
|
37
38
|
if (payload === undefined || payload === '') {
|
|
38
39
|
// `release:` with no value — malformed.
|
|
@@ -54,8 +55,9 @@ function parsePayload(payload) {
|
|
|
54
55
|
}
|
|
55
56
|
const listText = payload.slice(bracketIdx);
|
|
56
57
|
const packages = parsePackageList(listText);
|
|
57
|
-
if (packages === null)
|
|
58
|
+
if (packages === null) {
|
|
58
59
|
return null;
|
|
60
|
+
}
|
|
59
61
|
return { bump: valueText, packages };
|
|
60
62
|
}
|
|
61
63
|
function isValidValue(s) {
|
|
@@ -64,21 +66,26 @@ function isValidValue(s) {
|
|
|
64
66
|
function parsePackageList(s) {
|
|
65
67
|
// Must open with `[` and close with `]`; nothing after the close.
|
|
66
68
|
/* v8 ignore next -- only called when bracketIdx is defined; defensive */
|
|
67
|
-
if (!s.startsWith('['))
|
|
69
|
+
if (!s.startsWith('[')) {
|
|
68
70
|
return null;
|
|
71
|
+
}
|
|
69
72
|
const closeIdx = s.indexOf(']');
|
|
70
|
-
if (closeIdx === -1)
|
|
73
|
+
if (closeIdx === -1) {
|
|
71
74
|
return null;
|
|
75
|
+
}
|
|
72
76
|
const tail = s.slice(closeIdx + 1).trim();
|
|
73
|
-
if (tail.length > 0)
|
|
74
|
-
return null;
|
|
77
|
+
if (tail.length > 0) {
|
|
78
|
+
return null;
|
|
79
|
+
} // stray text after list
|
|
75
80
|
const inner = s.slice(1, closeIdx).trim();
|
|
76
|
-
if (inner === '')
|
|
77
|
-
return [];
|
|
81
|
+
if (inner === '') {
|
|
82
|
+
return [];
|
|
83
|
+
} // `release: minor []` → no packages
|
|
78
84
|
const parts = inner.split(',').map((p) => p.trim());
|
|
79
85
|
for (const name of parts) {
|
|
80
|
-
if (name === '' || !PACKAGE_NAME.test(name))
|
|
86
|
+
if (name === '' || !PACKAGE_NAME.test(name)) {
|
|
81
87
|
return null;
|
|
88
|
+
}
|
|
82
89
|
}
|
|
83
90
|
return parts;
|
|
84
91
|
}
|
package/dist/trailer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trailer.js","sourceRoot":"","sources":["../src/trailer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAEzE,wEAAwE;AACxE,0EAA0E;AAC1E,uEAAuE;AACvE,MAAM,YAAY,GAAG,8BAA8B,CAAC;AAEpD,wEAAwE;AACxE,2DAA2D;AAC3D,MAAM,YAAY,GAAG,8BAA8B,CAAC;AAEpD,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxC,gDAAgD;IAChD,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;QACvB,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;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C,wBAAwB;IAC5D,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QAAA,OAAO,EAAE,CAAC;IAAA,CAAC,CAAC,oCAAoC;IACnE,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACpD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAAA,OAAO,IAAI,CAAC;QAAA,CAAC;IAC7D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -98,6 +98,17 @@ export interface SmokeResult {
|
|
|
98
98
|
export interface Handler {
|
|
99
99
|
kind: Kind;
|
|
100
100
|
isPublished(pkg: PackageConfig, version: string, ctx: Ctx): Promise<boolean>;
|
|
101
|
+
/**
|
|
102
|
+
* Latest version published to the registry for this package, or null
|
|
103
|
+
* when it has never been published (registry 404). Reads the registry's
|
|
104
|
+
* "newest version" endpoint — distinct from `isPublished`, which probes
|
|
105
|
+
* one specific version. Throws TransientError on a registry error so a
|
|
106
|
+
* read-only caller (`status`) can render "unreachable" rather than a
|
|
107
|
+
* bogus version. Shares each handler's registry-name resolution with
|
|
108
|
+
* `isPublished`, so diagnostics and the publish path can never disagree
|
|
109
|
+
* on which registry name a package maps to.
|
|
110
|
+
*/
|
|
111
|
+
latestVersion(pkg: PackageConfig, ctx: Ctx): Promise<string | null>;
|
|
101
112
|
writeVersion(pkg: PackageConfig, version: string, ctx: Ctx): Promise<string[]>;
|
|
102
113
|
publish(pkg: PackageConfig, version: string, ctx: Ctx): Promise<PublishResult>;
|
|
103
114
|
smokeTest?(pkg: PackageConfig, version: string, ctx: Ctx): Promise<SmokeResult>;
|