putitoutthere 0.2.18 → 0.2.20
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 +2 -0
- package/MIGRATIONS.md +52 -0
- package/dist/check.d.ts +49 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +276 -0
- package/dist/check.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +32 -1
- package/dist/cli.js.map +1 -1
- package/dist/normalize-artifacts.d.ts +32 -0
- package/dist/normalize-artifacts.d.ts.map +1 -0
- package/dist/normalize-artifacts.js +57 -0
- package/dist/normalize-artifacts.js.map +1 -0
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +5 -0
- package/dist/publish.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -35,6 +35,8 @@ are prefixed `**BREAKING**` and link to the matching section in
|
|
|
35
35
|
|
|
36
36
|
### Fixed
|
|
37
37
|
|
|
38
|
+
- **Single-artifact publish jobs no longer fail completeness with `missing artifact directory <name>/`.** `actions/download-artifact@v8` is count-sensitive: with `path: artifacts` and no `name`/`pattern` filter, multiple artifacts each get their own `artifacts/<name>/` subdir (the documented multi-case the engine relies on), but a single artifact extracts directly into `artifacts/` with no per-artifact subdir. Consumers whose plan emits exactly one expected artifact — canonical case: pure-Python `[[package]]` with `build = "hatch"`, which emits an sdist row only — therefore aborted at the engine's completeness check before any side effect ran. The reusable workflow's publish job now normalizes the layout in-process before completeness: when the plan expects a single staged artifact and the documented subdir is absent, files in `artifacts/` are moved into `artifacts/<artifact_name>/` so the rest of the engine sees the contract it was written against. No-op in the multi-artifact case, when the subdir already exists, or when nothing was downloaded (crates-only / vanilla-npm plans). No consumer-side change required. Hit in the wild on a pypi-only consumer with a single sdist row; multi-artifact consumers (pypi + npm, or sdist + wheels) were unaffected. See [MIGRATIONS.md](./MIGRATIONS.md#single-artifact-publish-layout-normalization). #311.
|
|
39
|
+
|
|
38
40
|
- **Bundled-CLI / napi npm consumers' `npm run build` step now sees `TARGET` and `BUILD` env vars on every matrix row.** The reusable workflow's `_matrix.yml` and `release.yml` previously ran the npm build step with no env block, so consumers' build scripts that read `process.env.TARGET` to know which triple to cross-compile saw `undefined` and either crashed or silently no-oped. Every per-platform matrix row then uploaded an empty `build/<triple>/` directory and `actions/upload-artifact@v7` flagged `No files were found with the provided path: ...`. The internal `e2e-fixture-job.yml` already passed `TARGET` / `BUILD` correctly — meaning the fixture suite passed but a real consumer's first publish still failed; an integration-tier divergence rather than a behavior bug per se. Both the build matrix step and the publish-job rebuild step in `release.yml` now set the env block. `_matrix.yml` exposes `TARGET=${{ matrix.target }}` / `BUILD=${{ matrix.build }}` per row; `release.yml`'s rebuild loop sets `TARGET=main BUILD=` per iteration (the publish-time rebuild only fires for the main package's row, since per-platform sub-packages stage from `artifacts/` via the engine's npm-platform handler). The README's [Bundled-CLI npm family](./README.md#bundled-cli-npm-family) recipe gained the consumer-side build-script contract that was previously missing — TARGET/BUILD vocabulary and a minimal `scripts/build.cjs` covering the simple single-workspace case. Hit in the wild on `thekevinscott/darkfactory`'s first release; tracked at #287. See [MIGRATIONS.md](./MIGRATIONS.md#npm-build-step-target-build-env-vars).
|
|
39
41
|
|
|
40
42
|
- **First-publish bundled-cli / napi npm builds no longer fail on lockfile drift.** Consumers of the bundled-cli / napi shape declare `optionalDependencies` for `<name>-<triple>@<version>` platform packages that this pipeline publishes. On the very first publish those entries 404 on the registry; pnpm 10 silently drops 404'd optionals from the lockfile when it is regenerated locally; a subsequent CI run with `pnpm install --frozen-lockfile` (or `npm ci`) refuses because lockfile and `package.json` disagree. Both install steps in the reusable workflow — `_matrix.yml`'s build-matrix install and `release.yml`'s publish-job rebuild step (added in #256) — now self-heal: a failed strict install falls back to its non-strict form (`pnpm install --no-frozen-lockfile` / `npm install`) with a `::warning::` line in the run log naming the recovery. No consumer-side change required; lockfiles can stay committed and `optionalDependencies` can stay declared. Hit in the wild on `thekevinscott/darkfactory`'s first release (#integration-2026-05-bundled-cli). The README's [Bundled-CLI npm family](./README.md#bundled-cli-npm-family) recipe grew a `[!NOTE]` callout documenting the chicken-and-egg and the workflow's transparent recovery. See [MIGRATIONS.md](./MIGRATIONS.md#first-publish-bundled-cli-lockfile-self-heal).
|
package/MIGRATIONS.md
CHANGED
|
@@ -21,6 +21,58 @@ Each section covers five things, in order:
|
|
|
21
21
|
|
|
22
22
|
## Unreleased
|
|
23
23
|
|
|
24
|
+
### Single-artifact publish layout normalization
|
|
25
|
+
|
|
26
|
+
**Summary.** The reusable workflow's publish job downloads build
|
|
27
|
+
artifacts with `actions/download-artifact@v8` configured as `path:
|
|
28
|
+
artifacts` and no `name`/`pattern` filter. That action is
|
|
29
|
+
count-sensitive: multiple artifacts land in `artifacts/<name>/...`
|
|
30
|
+
subdirs (the documented multi-case the engine's completeness check
|
|
31
|
+
and every handler are written against), but a *single* artifact
|
|
32
|
+
extracts directly into `artifacts/` with no per-artifact subdir.
|
|
33
|
+
Consumers whose plan emits exactly one expected artifact — pure-Python
|
|
34
|
+
packages with `build = "hatch"` (sdist row only) being the canonical
|
|
35
|
+
case — therefore failed at the completeness check with `missing
|
|
36
|
+
artifact directory <pkg>-sdist/` before the pypi handler ever ran.
|
|
37
|
+
Multi-artifact consumers (pypi+npm, sdist+wheels, polyglot) were
|
|
38
|
+
unaffected. The publish job now normalizes the layout in-process
|
|
39
|
+
before completeness: when the plan expects one staged artifact and
|
|
40
|
+
`artifacts/<artifact_name>/` is absent, files in `artifacts/` are
|
|
41
|
+
moved into that subdir so the engine's contract holds. Fully a
|
|
42
|
+
fix-in-place; no input shape, output shape, or config key changed.
|
|
43
|
+
Tracked in #311.
|
|
44
|
+
|
|
45
|
+
**Required changes.** None.
|
|
46
|
+
|
|
47
|
+
**Deprecations removed.** None.
|
|
48
|
+
|
|
49
|
+
**Behavior changes without code changes.**
|
|
50
|
+
|
|
51
|
+
- Pypi-only consumers with `build = "hatch"` (or any other
|
|
52
|
+
`[[package]]` whose plan emits a single artifact row) that
|
|
53
|
+
previously failed publish with `Artifact completeness check
|
|
54
|
+
failed: ... missing artifact directory <pkg>-sdist/` now reach the
|
|
55
|
+
pypi handler successfully and tag as expected. The wider release
|
|
56
|
+
flow — version-rewrite, tag creation, GitHub Release, caller-side
|
|
57
|
+
`pypi-publish` upload — was already correct; only the engine's
|
|
58
|
+
pre-publish completeness check was upstream of the bug.
|
|
59
|
+
- Multi-artifact plans (≥2 staged artifacts), crates-only plans, and
|
|
60
|
+
vanilla-npm plans (`[[package]] kind = "npm"` with no `build` /
|
|
61
|
+
`build = []`) see no observable difference. The normalization is
|
|
62
|
+
scoped to the exact case `download-artifact@v8` dumps into the
|
|
63
|
+
root.
|
|
64
|
+
|
|
65
|
+
**Verification.** A release-please / release-plz cascade against a
|
|
66
|
+
pure-Python `[[package]]` with `build = "hatch"` should:
|
|
67
|
+
|
|
68
|
+
1. Surface the planned matrix as a single row,
|
|
69
|
+
`target = sdist artifact = <pkg>-sdist`.
|
|
70
|
+
2. Reach the `pypi: <pkg>@<version> delegated to caller-side upload
|
|
71
|
+
step.` log line in the publish job.
|
|
72
|
+
3. Push a `<pkg>-v<version>` tag, kick off the caller's
|
|
73
|
+
`pypi-publish` job, and produce a GitHub Release. No
|
|
74
|
+
`missing artifact directory` error appears in the run log.
|
|
75
|
+
|
|
24
76
|
### `[package.bundle_cli]` features and `no_default_features`
|
|
25
77
|
|
|
26
78
|
**Summary.** `[package.bundle_cli]` previously only worked for crates
|
package/dist/check.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `putitoutthere check` — pre-merge configuration validation.
|
|
3
|
+
*
|
|
4
|
+
* Implements the "No release surprises" goal from
|
|
5
|
+
* `notes/design-commitments.md`: every check knowable from the
|
|
6
|
+
* consumer's repo state alone runs at PR time, before a release run
|
|
7
|
+
* could fail mid-publish on a precondition checkable in milliseconds.
|
|
8
|
+
*
|
|
9
|
+
* Each check function returns findings; the top-level `runChecks`
|
|
10
|
+
* aggregates them so the consumer fixes everything in one round-trip
|
|
11
|
+
* rather than chasing one error at a time across re-runs. `require-`
|
|
12
|
+
* style throwing helpers live in `preflight.ts` for the publish path;
|
|
13
|
+
* this file is read-only diagnostic.
|
|
14
|
+
*
|
|
15
|
+
* Non-goal #8 (parallel diagnostic surfaces): every check here either
|
|
16
|
+
* already runs at publish time via `preflight.ts` / `plan.ts` /
|
|
17
|
+
* `cascade.ts`, or — for the genuinely-new checks (path exists, globs
|
|
18
|
+
* match a tracked file, tag-template collisions, pyproject.toml +
|
|
19
|
+
* bundle_cli) — is a thin pre-pass of state the publish path already
|
|
20
|
+
* relies on. No parallel diagnostic code path; the engine entry point
|
|
21
|
+
* is shared with the publish phase.
|
|
22
|
+
*
|
|
23
|
+
* Issue #319.
|
|
24
|
+
*/
|
|
25
|
+
export interface CheckFinding {
|
|
26
|
+
/** The `[[package]].name` the finding is scoped to. Absent for
|
|
27
|
+
* file-level findings (missing config, root-level parse errors). */
|
|
28
|
+
package?: string;
|
|
29
|
+
/** Single-line, actionable message: failing artefact path or
|
|
30
|
+
* field, why it matters, what to change. */
|
|
31
|
+
message: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CheckOptions {
|
|
34
|
+
cwd: string;
|
|
35
|
+
/** Override for tests. Defaults to `${cwd}/putitoutthere.toml`. */
|
|
36
|
+
configPath?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Run every check that's knowable from the consumer's repo state
|
|
40
|
+
* alone. Returns an aggregated finding list; an empty list means a
|
|
41
|
+
* release run from this commit would not surface configuration-level
|
|
42
|
+
* surprises.
|
|
43
|
+
*
|
|
44
|
+
* Short-circuits when the config can't be loaded — every downstream
|
|
45
|
+
* check assumes a parsed `Config`, and a missing or malformed file
|
|
46
|
+
* would otherwise cascade into a noisy stack trace per package.
|
|
47
|
+
*/
|
|
48
|
+
export declare function runChecks(opts: CheckOptions): CheckFinding[];
|
|
49
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAiBH,MAAM,WAAW,YAAY;IAC3B;yEACqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;iDAC6C;IAC7C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,EAAE,CAqC5D"}
|
package/dist/check.js
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `putitoutthere check` — pre-merge configuration validation.
|
|
3
|
+
*
|
|
4
|
+
* Implements the "No release surprises" goal from
|
|
5
|
+
* `notes/design-commitments.md`: every check knowable from the
|
|
6
|
+
* consumer's repo state alone runs at PR time, before a release run
|
|
7
|
+
* could fail mid-publish on a precondition checkable in milliseconds.
|
|
8
|
+
*
|
|
9
|
+
* Each check function returns findings; the top-level `runChecks`
|
|
10
|
+
* aggregates them so the consumer fixes everything in one round-trip
|
|
11
|
+
* rather than chasing one error at a time across re-runs. `require-`
|
|
12
|
+
* style throwing helpers live in `preflight.ts` for the publish path;
|
|
13
|
+
* this file is read-only diagnostic.
|
|
14
|
+
*
|
|
15
|
+
* Non-goal #8 (parallel diagnostic surfaces): every check here either
|
|
16
|
+
* already runs at publish time via `preflight.ts` / `plan.ts` /
|
|
17
|
+
* `cascade.ts`, or — for the genuinely-new checks (path exists, globs
|
|
18
|
+
* match a tracked file, tag-template collisions, pyproject.toml +
|
|
19
|
+
* bundle_cli) — is a thin pre-pass of state the publish path already
|
|
20
|
+
* relies on. No parallel diagnostic code path; the engine entry point
|
|
21
|
+
* is shared with the publish phase.
|
|
22
|
+
*
|
|
23
|
+
* Issue #319.
|
|
24
|
+
*/
|
|
25
|
+
import { execFileSync } from 'node:child_process';
|
|
26
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
27
|
+
import { isAbsolute, join, resolve } from 'node:path';
|
|
28
|
+
import { parse as parseToml } from 'smol-toml';
|
|
29
|
+
import { assertNoCycles } from './cascade.js';
|
|
30
|
+
import { loadConfig } from './config.js';
|
|
31
|
+
import { ErrorCodes } from './error-codes.js';
|
|
32
|
+
import { matchesAny } from './glob.js';
|
|
33
|
+
import { assertTripleSupported } from './handlers/npm-platform.js';
|
|
34
|
+
import { checkCratesMetadata, checkProvenanceMetadata } from './preflight.js';
|
|
35
|
+
import { formatTag } from './tag-template.js';
|
|
36
|
+
import { normalizeTarget } from './types.js';
|
|
37
|
+
/**
|
|
38
|
+
* Run every check that's knowable from the consumer's repo state
|
|
39
|
+
* alone. Returns an aggregated finding list; an empty list means a
|
|
40
|
+
* release run from this commit would not surface configuration-level
|
|
41
|
+
* surprises.
|
|
42
|
+
*
|
|
43
|
+
* Short-circuits when the config can't be loaded — every downstream
|
|
44
|
+
* check assumes a parsed `Config`, and a missing or malformed file
|
|
45
|
+
* would otherwise cascade into a noisy stack trace per package.
|
|
46
|
+
*/
|
|
47
|
+
export function runChecks(opts) {
|
|
48
|
+
const findings = [];
|
|
49
|
+
const cwd = opts.cwd;
|
|
50
|
+
const cfgPath = opts.configPath ?? join(cwd, 'putitoutthere.toml');
|
|
51
|
+
if (!existsSync(cfgPath)) {
|
|
52
|
+
findings.push({
|
|
53
|
+
message: `putitoutthere.toml not found at ${cfgPath}. Drop one at the repo root; see https://github.com/thekevinscott/putitoutthere#2-drop-in-putitoutthere-toml`,
|
|
54
|
+
});
|
|
55
|
+
return findings;
|
|
56
|
+
}
|
|
57
|
+
let packages;
|
|
58
|
+
try {
|
|
59
|
+
const config = loadConfig(cfgPath);
|
|
60
|
+
// Anchor pkg.path to opts.cwd up front so per-kind fs ops point at
|
|
61
|
+
// the right tree even when the CLI is invoked with --cwd from
|
|
62
|
+
// outside the repo (mirrors publish.ts's loop).
|
|
63
|
+
packages = config.packages.map((p) => ({
|
|
64
|
+
...p,
|
|
65
|
+
path: isAbsolute(p.path) ? p.path : resolve(cwd, p.path),
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
findings.push({ message: err instanceof Error ? err.message : String(err) });
|
|
70
|
+
return findings;
|
|
71
|
+
}
|
|
72
|
+
checkPaths(packages, findings);
|
|
73
|
+
checkGlobsMatchTrackedFiles(packages, cwd, findings);
|
|
74
|
+
checkDependsOn(packages, findings);
|
|
75
|
+
checkTagTemplateCollisions(packages, findings);
|
|
76
|
+
checkNpmRepository(packages, findings);
|
|
77
|
+
checkCratesPackageMetadata(packages, findings);
|
|
78
|
+
checkPyprojectAndBundleCli(packages, cwd, findings);
|
|
79
|
+
checkNpmTargetTriples(packages, findings);
|
|
80
|
+
return findings;
|
|
81
|
+
}
|
|
82
|
+
/* ----------------------------- internals ----------------------------- */
|
|
83
|
+
function checkPaths(packages, findings) {
|
|
84
|
+
for (const p of packages) {
|
|
85
|
+
if (!existsSync(p.path) || !statSync(p.path).isDirectory()) {
|
|
86
|
+
findings.push({
|
|
87
|
+
package: p.name,
|
|
88
|
+
message: `path "${p.path}" does not exist or is not a directory in the worktree`,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function checkGlobsMatchTrackedFiles(packages, cwd, findings) {
|
|
94
|
+
const tracked = listTrackedFiles(cwd);
|
|
95
|
+
/* v8 ignore next -- tests always seed a git repo; defensive against
|
|
96
|
+
callers outside one */
|
|
97
|
+
if (tracked === null)
|
|
98
|
+
return;
|
|
99
|
+
for (const p of packages) {
|
|
100
|
+
const matched = tracked.some((f) => matchesAny(p.globs, f));
|
|
101
|
+
if (!matched) {
|
|
102
|
+
findings.push({
|
|
103
|
+
package: p.name,
|
|
104
|
+
message: `globs ${JSON.stringify(p.globs)} matched no tracked files. Empty globs mean the package will never cascade on a real commit.`,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function checkDependsOn(packages, findings) {
|
|
110
|
+
try {
|
|
111
|
+
assertNoCycles(packages);
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
findings.push({ message: err instanceof Error ? err.message : String(err) });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function checkTagTemplateCollisions(packages, findings) {
|
|
118
|
+
// Templates collide when they resolve to the same tag at the same
|
|
119
|
+
// version — typically when `{name}` is omitted and every package
|
|
120
|
+
// thereafter races for one tag slot. A sentinel version is enough:
|
|
121
|
+
// differing templates differ on every version, identical templates
|
|
122
|
+
// collide on every version.
|
|
123
|
+
const seen = new Map();
|
|
124
|
+
for (const p of packages) {
|
|
125
|
+
const sentinel = formatTag(p.tag_format, { name: p.name, version: '0.0.0' });
|
|
126
|
+
const prior = seen.get(sentinel);
|
|
127
|
+
if (prior !== undefined) {
|
|
128
|
+
findings.push({
|
|
129
|
+
message: `tag_format collision: "${p.name}" and "${prior}" both resolve to tag "${sentinel}" at the same version. Include {name} in tag_format to disambiguate.`,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
seen.set(sentinel, p.name);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function checkNpmRepository(packages, findings) {
|
|
138
|
+
for (const f of checkProvenanceMetadata(packages)) {
|
|
139
|
+
const reason = f.reason === 'missing'
|
|
140
|
+
? `${f.packageJsonPath} not found`
|
|
141
|
+
: `${f.packageJsonPath} has missing or empty \`repository\``;
|
|
142
|
+
findings.push({
|
|
143
|
+
package: f.package,
|
|
144
|
+
message: `[${ErrorCodes.NPM_MISSING_REPOSITORY}] ${reason}. \`npm publish --provenance\` hard-requires a non-empty repository.url.`,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function checkCratesPackageMetadata(packages, findings) {
|
|
149
|
+
for (const f of checkCratesMetadata(packages)) {
|
|
150
|
+
findings.push({
|
|
151
|
+
package: f.package,
|
|
152
|
+
message: `[${ErrorCodes.CRATES_MISSING_METADATA}] ${f.cargoTomlPath} missing required Cargo.toml [package] field(s): ${f.missing.join(', ')}. crates.io rejects the publish after cargo's verification build.`,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function checkPyprojectAndBundleCli(packages, cwd, findings) {
|
|
157
|
+
for (const p of packages) {
|
|
158
|
+
if (p.kind !== 'pypi')
|
|
159
|
+
continue;
|
|
160
|
+
const pyprojectPath = join(p.path, 'pyproject.toml');
|
|
161
|
+
if (!existsSync(pyprojectPath)) {
|
|
162
|
+
findings.push({
|
|
163
|
+
package: p.name,
|
|
164
|
+
message: `pyproject.toml not found at ${pyprojectPath}`,
|
|
165
|
+
});
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
if (p.build !== 'maturin' || p.bundle_cli === undefined)
|
|
169
|
+
continue;
|
|
170
|
+
const bundleCli = p.bundle_cli;
|
|
171
|
+
// `bundle_cli.crate_path` is documented as relative to the repo
|
|
172
|
+
// root (see config.ts: default = "."). Resolve against `cwd`,
|
|
173
|
+
// not the package path.
|
|
174
|
+
const cratePathAbs = isAbsolute(bundleCli.crate_path)
|
|
175
|
+
? bundleCli.crate_path
|
|
176
|
+
: resolve(cwd, bundleCli.crate_path);
|
|
177
|
+
const cargoTomlPath = join(cratePathAbs, 'Cargo.toml');
|
|
178
|
+
if (!existsSync(cratePathAbs) || !statSync(cratePathAbs).isDirectory()) {
|
|
179
|
+
findings.push({
|
|
180
|
+
package: p.name,
|
|
181
|
+
message: `bundle_cli.crate_path "${bundleCli.crate_path}" does not exist or is not a directory`,
|
|
182
|
+
});
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
if (!existsSync(cargoTomlPath)) {
|
|
186
|
+
findings.push({
|
|
187
|
+
package: p.name,
|
|
188
|
+
message: `bundle_cli.crate_path "${bundleCli.crate_path}" has no Cargo.toml`,
|
|
189
|
+
});
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
const declaredBins = readDeclaredBins(cargoTomlPath);
|
|
193
|
+
if (!declaredBins.includes(bundleCli.bin)) {
|
|
194
|
+
findings.push({
|
|
195
|
+
package: p.name,
|
|
196
|
+
message: `bundle_cli.bin "${bundleCli.bin}" is not declared as a [[bin]] in ${cargoTomlPath}. Declared bins: ${declaredBins.length === 0 ? '(none)' : declaredBins.join(', ')}.`,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function checkNpmTargetTriples(packages, findings) {
|
|
202
|
+
for (const p of packages) {
|
|
203
|
+
if (p.kind !== 'npm')
|
|
204
|
+
continue;
|
|
205
|
+
const targets = p.targets;
|
|
206
|
+
if (!targets)
|
|
207
|
+
continue;
|
|
208
|
+
for (const t of targets) {
|
|
209
|
+
const { triple } = normalizeTarget(t);
|
|
210
|
+
try {
|
|
211
|
+
assertTripleSupported(triple, p.name);
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
findings.push({
|
|
215
|
+
package: p.name,
|
|
216
|
+
message: err instanceof Error ? err.message : String(err),
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function listTrackedFiles(cwd) {
|
|
223
|
+
try {
|
|
224
|
+
const out = execFileSync('git', ['ls-files'], {
|
|
225
|
+
cwd,
|
|
226
|
+
encoding: 'utf8',
|
|
227
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
228
|
+
});
|
|
229
|
+
return out.split('\n').filter((l) => l.length > 0);
|
|
230
|
+
/* v8 ignore start -- defensive against callers outside a git repo */
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
/* v8 ignore stop */
|
|
236
|
+
}
|
|
237
|
+
function readDeclaredBins(cargoTomlPath) {
|
|
238
|
+
let raw;
|
|
239
|
+
try {
|
|
240
|
+
raw = readFileSync(cargoTomlPath, 'utf8');
|
|
241
|
+
/* v8 ignore next 3 -- existsSync gated the read above */
|
|
242
|
+
}
|
|
243
|
+
catch {
|
|
244
|
+
return [];
|
|
245
|
+
}
|
|
246
|
+
let parsed;
|
|
247
|
+
try {
|
|
248
|
+
parsed = parseToml(raw);
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
return [];
|
|
252
|
+
}
|
|
253
|
+
const result = [];
|
|
254
|
+
const bins = parsed.bin;
|
|
255
|
+
if (Array.isArray(bins)) {
|
|
256
|
+
for (const entry of bins) {
|
|
257
|
+
if (typeof entry === 'object' && entry !== null) {
|
|
258
|
+
const name = entry.name;
|
|
259
|
+
if (typeof name === 'string')
|
|
260
|
+
result.push(name);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// Cargo's implicit-binary rule: a crate without any explicit [[bin]]
|
|
265
|
+
// table ships a binary named after `[package].name` when
|
|
266
|
+
// `src/main.rs` exists. Include that name as a candidate so the
|
|
267
|
+
// common single-binary shape (one crate, one bin, no [[bin]] block)
|
|
268
|
+
// doesn't spuriously fail this check.
|
|
269
|
+
if (result.length === 0) {
|
|
270
|
+
const pkg = parsed.package;
|
|
271
|
+
if (pkg && typeof pkg.name === 'string')
|
|
272
|
+
result.push(pkg.name);
|
|
273
|
+
}
|
|
274
|
+
return result;
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oB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IAAI,EAAE,CAAC;YACzB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBAChD,MAAM,IAAI,GAAI,KAA4B,CAAC,IAAI,CAAC;gBAChD,IAAI,OAAO,IAAI,KAAK,QAAQ;oBAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;IACH,CAAC;IACD,qEAAqE;IACrE,yDAAyD;IACzD,gEAAgE;IAChE,oEAAoE;IACpE,sCAAsC;IACtC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,MAAM,CAAC,OAAyC,CAAC;QAC7D,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
* Commands:
|
|
8
8
|
* plan — compute and emit the release plan
|
|
9
9
|
* publish — execute the plan against the registries
|
|
10
|
+
* check — pre-merge configuration validation (#319). Runs every
|
|
11
|
+
* check knowable from the consumer's repo state alone.
|
|
12
|
+
* Internal — invoked by the pre-merge reusable workflow;
|
|
13
|
+
* not surfaced in user-facing docs per non-goal #7.
|
|
10
14
|
* write-version — bump a package's manifest to a planned version
|
|
11
15
|
* (pre-build hook for maturin; #276)
|
|
12
16
|
* version — print CLI version
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AA0CH,UAAU,WAAW;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,OAAO,CAAC;IAId,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW,CA8B/D;AAED,wBAAsB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAsIlE"}
|
package/dist/cli.js
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
* Commands:
|
|
8
8
|
* plan — compute and emit the release plan
|
|
9
9
|
* publish — execute the plan against the registries
|
|
10
|
+
* check — pre-merge configuration validation (#319). Runs every
|
|
11
|
+
* check knowable from the consumer's repo state alone.
|
|
12
|
+
* Internal — invoked by the pre-merge reusable workflow;
|
|
13
|
+
* not surfaced in user-facing docs per non-goal #7.
|
|
10
14
|
* write-version — bump a package's manifest to a planned version
|
|
11
15
|
* (pre-build hook for maturin; #276)
|
|
12
16
|
* version — print CLI version
|
|
@@ -26,11 +30,12 @@
|
|
|
26
30
|
* errors out.
|
|
27
31
|
*/
|
|
28
32
|
import { isAbsolute, resolve } from 'node:path';
|
|
33
|
+
import { runChecks } from './check.js';
|
|
29
34
|
import { plan } from './plan.js';
|
|
30
35
|
import { publish } from './publish.js';
|
|
31
36
|
import { writeVersionForBuild } from './write-version.js';
|
|
32
37
|
import { VERSION } from './version.js';
|
|
33
|
-
const COMMANDS = ['plan', 'publish', 'write-version', 'version'];
|
|
38
|
+
const COMMANDS = ['plan', 'publish', 'check', 'write-version', 'version'];
|
|
34
39
|
function isCommand(value) {
|
|
35
40
|
return COMMANDS.includes(value);
|
|
36
41
|
}
|
|
@@ -41,6 +46,7 @@ function printUsage() {
|
|
|
41
46
|
'Commands:',
|
|
42
47
|
' plan Compute and emit the release plan',
|
|
43
48
|
' publish Execute the plan',
|
|
49
|
+
' check Pre-merge configuration validation (#319)',
|
|
44
50
|
' write-version Bump a package manifest to the planned version (pre-build; #276)',
|
|
45
51
|
' version Print CLI version',
|
|
46
52
|
'',
|
|
@@ -144,6 +150,31 @@ export async function run(argv) {
|
|
|
144
150
|
}
|
|
145
151
|
return 0;
|
|
146
152
|
}
|
|
153
|
+
case 'check': {
|
|
154
|
+
// #319: pre-merge config validation. Aggregates every finding
|
|
155
|
+
// in one round-trip rather than failing on the first so a
|
|
156
|
+
// consumer fixes the whole config in one push. Exits non-zero
|
|
157
|
+
// when any finding lands; CI surfaces the same vocabulary the
|
|
158
|
+
// publish-phase `require*` helpers use.
|
|
159
|
+
const findings = runChecks({
|
|
160
|
+
cwd: flags.cwd,
|
|
161
|
+
...(flags.config !== undefined ? { configPath: flags.config } : {}),
|
|
162
|
+
});
|
|
163
|
+
if (flags.json) {
|
|
164
|
+
process.stdout.write(JSON.stringify({ findings }) + '\n');
|
|
165
|
+
}
|
|
166
|
+
else if (findings.length === 0) {
|
|
167
|
+
process.stdout.write('check: no findings\n');
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
process.stderr.write(`putitoutthere check: ${findings.length} finding${findings.length === 1 ? '' : 's'}.\n\n`);
|
|
171
|
+
for (const f of findings) {
|
|
172
|
+
const prefix = f.package ? ` - ${f.package}: ` : ' - ';
|
|
173
|
+
process.stderr.write(`${prefix}${f.message}\n`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return findings.length === 0 ? 0 : 1;
|
|
177
|
+
}
|
|
147
178
|
case 'write-version': {
|
|
148
179
|
// #276: pre-build hook used by `_matrix.yml`'s maturin steps.
|
|
149
180
|
// Maturin reads the version from disk at build time with no
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mapp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6D;YAC7D,KAAK,SAAS;gBACZ,OAAO,CAAC,CAAC;QACb,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,kBAAkB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CACvE,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAED,mEAAmE;AACnE,yBAAyB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-artifact layout normalization.
|
|
3
|
+
*
|
|
4
|
+
* `actions/download-artifact@v8` is count-sensitive when called with
|
|
5
|
+
* `path:` and no `name`/`pattern` filter: multiple artifacts get
|
|
6
|
+
* per-artifact subdirectories (the documented multi-case the engine
|
|
7
|
+
* relies on), but a *single* artifact extracts directly into the path
|
|
8
|
+
* with no `<artifact_name>/` subdir. The completeness check
|
|
9
|
+
* (`src/completeness.ts`) and every downstream handler reach for
|
|
10
|
+
* `artifacts/<artifact_name>/...`, so consumers whose plan emits one
|
|
11
|
+
* row — canonical case: pure-Python + `build = "hatch"`, sdist only —
|
|
12
|
+
* fail before any side effect runs.
|
|
13
|
+
*
|
|
14
|
+
* Rather than fight the action's per-count behavior in YAML (where the
|
|
15
|
+
* subdir-vs-flat decision lives in upstream code we don't control),
|
|
16
|
+
* normalize the layout in-process before completeness so the engine's
|
|
17
|
+
* own contract is the single source of truth. The reusable workflow
|
|
18
|
+
* calls into this via `publish.ts`; no consumer-facing surface.
|
|
19
|
+
*
|
|
20
|
+
* Issue #311.
|
|
21
|
+
*/
|
|
22
|
+
import type { MatrixRow } from './plan.js';
|
|
23
|
+
/**
|
|
24
|
+
* Move dumped-into-root artifact files into the documented
|
|
25
|
+
* `<artifactsRoot>/<artifact_name>/` subdir when the plan expects
|
|
26
|
+
* exactly one staged artifact and the download step did not create
|
|
27
|
+
* the subdir. No-op in every other case (multi-artifact, already
|
|
28
|
+
* subdir-shaped, nothing downloaded, crates-only / vanilla-npm plans
|
|
29
|
+
* that stage nothing).
|
|
30
|
+
*/
|
|
31
|
+
export declare function normalizeArtifactLayout(matrix: readonly MatrixRow[], artifactsRoot: string): void;
|
|
32
|
+
//# sourceMappingURL=normalize-artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-artifacts.d.ts","sourceRoot":"","sources":["../src/normalize-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,aAAa,EAAE,MAAM,GACpB,IAAI,CAyBN"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-artifact layout normalization.
|
|
3
|
+
*
|
|
4
|
+
* `actions/download-artifact@v8` is count-sensitive when called with
|
|
5
|
+
* `path:` and no `name`/`pattern` filter: multiple artifacts get
|
|
6
|
+
* per-artifact subdirectories (the documented multi-case the engine
|
|
7
|
+
* relies on), but a *single* artifact extracts directly into the path
|
|
8
|
+
* with no `<artifact_name>/` subdir. The completeness check
|
|
9
|
+
* (`src/completeness.ts`) and every downstream handler reach for
|
|
10
|
+
* `artifacts/<artifact_name>/...`, so consumers whose plan emits one
|
|
11
|
+
* row — canonical case: pure-Python + `build = "hatch"`, sdist only —
|
|
12
|
+
* fail before any side effect runs.
|
|
13
|
+
*
|
|
14
|
+
* Rather than fight the action's per-count behavior in YAML (where the
|
|
15
|
+
* subdir-vs-flat decision lives in upstream code we don't control),
|
|
16
|
+
* normalize the layout in-process before completeness so the engine's
|
|
17
|
+
* own contract is the single source of truth. The reusable workflow
|
|
18
|
+
* calls into this via `publish.ts`; no consumer-facing surface.
|
|
19
|
+
*
|
|
20
|
+
* Issue #311.
|
|
21
|
+
*/
|
|
22
|
+
import { existsSync, mkdirSync, readdirSync, renameSync } from 'node:fs';
|
|
23
|
+
import { join } from 'node:path';
|
|
24
|
+
/**
|
|
25
|
+
* Move dumped-into-root artifact files into the documented
|
|
26
|
+
* `<artifactsRoot>/<artifact_name>/` subdir when the plan expects
|
|
27
|
+
* exactly one staged artifact and the download step did not create
|
|
28
|
+
* the subdir. No-op in every other case (multi-artifact, already
|
|
29
|
+
* subdir-shaped, nothing downloaded, crates-only / vanilla-npm plans
|
|
30
|
+
* that stage nothing).
|
|
31
|
+
*/
|
|
32
|
+
export function normalizeArtifactLayout(matrix, artifactsRoot) {
|
|
33
|
+
// Only rows whose handler expects a staged artifact directory. crates
|
|
34
|
+
// publishes from the source tree (no upload step in the build job);
|
|
35
|
+
// vanilla npm packages the source on the publish runner. completeness
|
|
36
|
+
// already short-circuits both kinds — see `src/completeness.ts`.
|
|
37
|
+
const expected = matrix.filter((r) => r.kind !== 'crates' && !(r.kind === 'npm' && r.target === 'noarch'));
|
|
38
|
+
if (expected.length !== 1)
|
|
39
|
+
return;
|
|
40
|
+
const row = expected[0];
|
|
41
|
+
const targetDir = join(artifactsRoot, row.artifact_name);
|
|
42
|
+
// Already in the documented layout — either a multi-artifact run
|
|
43
|
+
// earlier in the same job, or a developer running locally with the
|
|
44
|
+
// engine's contract honored. Either way, leave it alone.
|
|
45
|
+
if (existsSync(targetDir))
|
|
46
|
+
return;
|
|
47
|
+
if (!existsSync(artifactsRoot))
|
|
48
|
+
return;
|
|
49
|
+
const dumped = readdirSync(artifactsRoot);
|
|
50
|
+
if (dumped.length === 0)
|
|
51
|
+
return;
|
|
52
|
+
mkdirSync(targetDir, { recursive: true });
|
|
53
|
+
for (const entry of dumped) {
|
|
54
|
+
renameSync(join(artifactsRoot, entry), join(targetDir, entry));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=normalize-artifacts.js.map
|
|
@@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K,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
|
package/dist/publish.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAeH,OAAO,EAA6B,KAAK,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAGzF,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC;CACjD;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,SAAS,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;CAC/E;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAoJ1E"}
|
package/dist/publish.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { isAbsolute, join, resolve } from 'node:path';
|
|
19
19
|
import { loadConfig } from './config.js';
|
|
20
20
|
import { checkCompleteness } from './completeness.js';
|
|
21
|
+
import { normalizeArtifactLayout } from './normalize-artifacts.js';
|
|
21
22
|
import { ErrorCodes } from './error-codes.js';
|
|
22
23
|
import { createTag, headCommit, pushTag } from './git.js';
|
|
23
24
|
import { handlerFor as defaultHandlerFor } from './handlers/index.js';
|
|
@@ -78,6 +79,10 @@ export async function publish(opts) {
|
|
|
78
79
|
// dep — same wasted-work argument as 2b. #290.
|
|
79
80
|
requireCratesMetadata(selectedPackages);
|
|
80
81
|
// 3. Artifact completeness.
|
|
82
|
+
// First normalize the layout in case actions/download-artifact@v8
|
|
83
|
+
// dumped a single artifact directly into `artifacts/` rather than
|
|
84
|
+
// creating `artifacts/<name>/`. #311.
|
|
85
|
+
normalizeArtifactLayout(matrix, artifactsRoot(cwd));
|
|
81
86
|
const completeness = checkCompleteness(matrix, artifactsRoot(cwd));
|
|
82
87
|
const incomplete = [...completeness.entries()].filter(([, r]) => !r.ok);
|
|
83
88
|
if (incomplete.length > 0) {
|
package/dist/publish.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAgB,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,IAAI,EAAkB,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,E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