putitoutthere 0.2.1 → 0.2.3
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 +5 -0
- package/MIGRATIONS.md +114 -0
- package/README.md +61 -2
- package/dist/config.d.ts +22 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +99 -4
- package/dist/config.js.map +1 -1
- package/dist/handlers/crates.d.ts +1 -1
- package/dist/handlers/crates.d.ts.map +1 -1
- package/dist/handlers/crates.js +27 -2
- package/dist/handlers/crates.js.map +1 -1
- package/dist/handlers/npm-platform.d.ts +70 -13
- package/dist/handlers/npm-platform.d.ts.map +1 -1
- package/dist/handlers/npm-platform.js +122 -40
- package/dist/handlers/npm-platform.js.map +1 -1
- package/dist/handlers/npm.d.ts.map +1 -1
- package/dist/handlers/npm.js +15 -5
- package/dist/handlers/npm.js.map +1 -1
- package/dist/plan.d.ts.map +1 -1
- package/dist/plan.js +34 -21
- package/dist/plan.js.map +1 -1
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +6 -0
- package/dist/publish.js.map +1 -1
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,7 @@ are prefixed `**BREAKING**` and link to the matching section in
|
|
|
13
13
|
### Added
|
|
14
14
|
|
|
15
15
|
- **`PIOT_PUBLISH_EMPTY_PLAN` error code.** Surfaced when `publish` is invoked with an empty matrix. Joins `PIOT_AUTH_NO_TOKEN` in the stable error-code vocabulary; foreign agents debugging a failed publish can fingerprint on the code without parsing prose.
|
|
16
|
+
- **`kind = "npm"` `build` accepts an array of entries with consumer-defined platform-package name templates** (#dirsql). For packages that ship both a napi-rs Node addon and a CLI binary from the same npm package (the `@swc/core` / dirsql shape), declare `build = [{ mode = "napi", name = "@scope/lib-{triple}" }, { mode = "bundled-cli", name = "@scope/cli-{triple}" }]`. Each entry contributes its own per-platform package family; the main package's `optionalDependencies` spans both. Entries can be bare mode strings (`"napi"`, defaults to `{name}-{triple}` template) or `{ mode, name }` objects. Variables surfaced in `name` templates: `{name}`, `{scope}`, `{base}`, `{triple}`, `{mode}`. `{version}` is intentionally not surfaced. Single-mode string form (`build = "napi"`) preserved byte-for-byte — same artifact-name layout, same platform-package names, no migration pressure on existing consumers. See [README → Recipes → Multi-mode npm family](./README.md#multi-mode-npm-family) and [MIGRATIONS.md](./MIGRATIONS.md#npm-build-accepts-array-of-entries).
|
|
16
17
|
|
|
17
18
|
### Changed
|
|
18
19
|
|
|
@@ -28,6 +29,10 @@ are prefixed `**BREAKING**` and link to the matching section in
|
|
|
28
29
|
|
|
29
30
|
### Fixed
|
|
30
31
|
|
|
32
|
+
- **npm publish no longer fails red when npm CLI retries a successful PUT.** When the registry acks a publish but the response comes back flaky to the client (timeout / 502 / connection reset), the npm CLI retries with the same payload. The retry lands on a registry that already has the new version and exits `E403 "cannot publish over the previously published versions: <ver>"`. Both the platform-package handler (`src/handlers/npm-platform.ts:npmPublish`) and the main publish path (`src/handlers/npm.ts:publishImpl`) now detect that exact stderr shape and treat it as success — the package is already on the registry at the requested version. Hit in the wild on PR #257's polyglot-everything multi-mode publish (10 platform packages × ~1 in 10 chance per request meant the race was nearly guaranteed).
|
|
33
|
+
|
|
34
|
+
- **Crates publish no longer refuses on workflow-managed install state in sibling packages.** Before, the engine's pre-publish dirty-workspace check (`scanDirtyOutsideManifest`) flagged anything dirty outside the package's `Cargo.toml`. For polyglot consumers (rust + js in one repo), the reusable workflow's `Build npm packages` step (#256) creates `node_modules/`, `package-lock.json`, and `dist/` inside each npm package's path before cargo publish runs — these are workflow scratch, not stray edits, and cargo can't pack them anyway (it only packs files inside the crate's own dir). The check now whitelists every other configured package's path, similar to how it already whitelists `artifacts/`. Stray edits elsewhere in the repo (a `README.md` change, etc.) still fail the check. Hit in the wild on the polyglot-everything e2e fixture; would also have hit any consumer with the same shape.
|
|
35
|
+
|
|
31
36
|
- **Dogfood release workflow no longer silently downgrades `release: minor` to `patch`.** `release-npm.yml`'s "Fold action bundle into release commit" step now forwards the parent commit's body into the bundle commit, so any `release:` trailer the operator wrote in the merge commit survives into the new HEAD. Without the forward, `putitoutthere`'s publish-time plan re-derivation read HEAD (the bundle commit), saw no trailer on a single-parent commit, and defaulted the bump to `patch` — silently downgrading a `release: minor` to `0.x.(y+1)`. Hit in the wild on the 0.1.51 → 0.2.0 attempt that landed as 0.1.52. The reusable consumer-facing `release.yml` was unaffected (it never adds a commit between plan and publish). Internal-seam fix; no consumer-side action required.
|
|
32
37
|
|
|
33
38
|
## v0.1.51 → v0.2.0
|
package/MIGRATIONS.md
CHANGED
|
@@ -21,6 +21,50 @@ Each section covers five things, in order:
|
|
|
21
21
|
|
|
22
22
|
## Unreleased
|
|
23
23
|
|
|
24
|
+
### Crates dirty-check whitelists sibling package paths
|
|
25
|
+
|
|
26
|
+
**Summary.** The engine's pre-publish dirty-workspace check
|
|
27
|
+
(`scanDirtyOutsideManifest` in `src/handlers/crates.ts`) used to
|
|
28
|
+
flag any dirty file in the repo outside the package's own
|
|
29
|
+
`Cargo.toml`. For polyglot consumers (rust + js in one repo), the
|
|
30
|
+
reusable workflow's `Build npm packages` step (added in #256) runs
|
|
31
|
+
`npm install + npm run build` for each npm package in the plan
|
|
32
|
+
before the engine publishes anything. That creates `node_modules/`,
|
|
33
|
+
`package-lock.json`, and `dist/` inside each npm package's path as
|
|
34
|
+
untracked files. cargo's git-status check sees them and the engine
|
|
35
|
+
refuses with `cargo publish: refusing to proceed; unexpected dirty
|
|
36
|
+
files in the working tree outside <crate>/Cargo.toml`.
|
|
37
|
+
|
|
38
|
+
The check now whitelists every other configured package's path
|
|
39
|
+
(`siblingPackagePaths` in `Ctx`), the same way it already
|
|
40
|
+
whitelists the reusable workflow's `artifacts/` scratch dir. cargo
|
|
41
|
+
only packs files inside its own package directory, so dirty state
|
|
42
|
+
in sibling packages can't end up in the crate tarball regardless.
|
|
43
|
+
Stray edits elsewhere in the repo (a `README.md` change, an
|
|
44
|
+
unrelated source file mod) still fail the check.
|
|
45
|
+
|
|
46
|
+
**Required changes.** None for consumers calling the reusable
|
|
47
|
+
workflow at `thekevinscott/putitoutthere/.github/workflows/release.yml@v0`.
|
|
48
|
+
This is a pure relaxation: setups that previously published cleanly
|
|
49
|
+
continue to; setups that hit the false-positive failure now succeed.
|
|
50
|
+
|
|
51
|
+
**Deprecations removed.** None.
|
|
52
|
+
|
|
53
|
+
**Behavior changes without code changes.** A polyglot release run
|
|
54
|
+
that previously failed with the "unexpected dirty files" message
|
|
55
|
+
on `node_modules/` / `package-lock.json` / `dist/` in a sibling npm
|
|
56
|
+
package now proceeds. The published crate tarball is unchanged
|
|
57
|
+
(cargo always scoped its packing to the crate dir).
|
|
58
|
+
|
|
59
|
+
**Verification.** A polyglot repo with rust + js packages and a
|
|
60
|
+
crates row in the matrix now reaches `cargo publish` instead of
|
|
61
|
+
the dirty-check error. After a release, the crate tarball still
|
|
62
|
+
contains only files inside the crate's own dir:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
cargo package --list --manifest-path <crate>/Cargo.toml
|
|
66
|
+
```
|
|
67
|
+
|
|
24
68
|
### `publish` throws on empty matrix
|
|
25
69
|
|
|
26
70
|
**Summary.** `putitoutthere publish` previously logged
|
|
@@ -58,6 +102,76 @@ either bypass the workflow gate or invoke the CLI directly. Expect
|
|
|
58
102
|
exit 1, with `PIOT_PUBLISH_EMPTY_PLAN` in stderr. A healthy release
|
|
59
103
|
where the plan job's matrix is non-empty is unaffected.
|
|
60
104
|
|
|
105
|
+
### npm `build` accepts array of entries
|
|
106
|
+
|
|
107
|
+
**Summary.** `kind = "npm"` packages can now declare `build` as an array
|
|
108
|
+
of entries to publish multiple per-platform package families from a
|
|
109
|
+
single main package — for example, a napi-rs Node addon plus a CLI
|
|
110
|
+
binary, both selected via `optionalDependencies` on a shared top-level
|
|
111
|
+
package. Each entry has a `mode` (`napi` / `bundled-cli`) and an
|
|
112
|
+
optional `name` template (e.g. `"@dirsql/lib-{triple}"`) that the
|
|
113
|
+
consumer fully controls. The previous single-mode string form is
|
|
114
|
+
preserved.
|
|
115
|
+
|
|
116
|
+
**Required changes.** None. `build = "napi"` and `build = "bundled-cli"`
|
|
117
|
+
keep producing the same per-platform package names, the same artifact
|
|
118
|
+
directory layout, and the same matrix shape they did before. Adopt the
|
|
119
|
+
array form only if you need a multi-family npm package.
|
|
120
|
+
|
|
121
|
+
| Field | Before | After |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| `build` (single mode) | `build = "napi"` | unchanged — `build = "napi"` still valid |
|
|
124
|
+
| `build` (single mode, array form) | _new_ | `build = ["napi"]` — equivalent to the string form |
|
|
125
|
+
| `build` (single mode, custom name) | _new_ | `build = [{ mode = "napi", name = "@scope/lib-{triple}" }]` |
|
|
126
|
+
| `build` (multi mode) | _new_ | `build = [{ mode = "napi", name = "@scope/lib-{triple}" }, { mode = "bundled-cli", name = "@scope/cli-{triple}" }]` |
|
|
127
|
+
|
|
128
|
+
Variables in `name` templates: `{name}`, `{scope}`, `{base}`,
|
|
129
|
+
`{triple}`, `{mode}`. `{triple}` is required in every template.
|
|
130
|
+
`{version}` is not surfaced — platform package names are immutable
|
|
131
|
+
identifiers; the version is pinned via `optionalDependencies`.
|
|
132
|
+
|
|
133
|
+
**Validation rules** enforced at config load:
|
|
134
|
+
|
|
135
|
+
- Each `mode` value (`napi`, `bundled-cli`) appears at most once per package.
|
|
136
|
+
- Every `name` template must contain `{triple}`.
|
|
137
|
+
- Unknown placeholders are rejected.
|
|
138
|
+
- Templates across entries must be pairwise distinct (collision-free).
|
|
139
|
+
|
|
140
|
+
**Multi-mode artifact layout.** When `build` has more than one entry,
|
|
141
|
+
the build-side artifact directory and path get a mode infix to keep
|
|
142
|
+
families separate:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
artifacts/
|
|
146
|
+
dirsql-napi-linux-x64-gnu/ # napi family
|
|
147
|
+
dirsql-bundled-cli-linux-x64-gnu/ # bundled-cli family
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
The build job for a multi-mode row writes to
|
|
151
|
+
`<pkg.path>/build/<mode>-<triple>/`. Single-mode (string form or
|
|
152
|
+
length-1 array) still uses `<pkg.path>/build/<triple>/` —
|
|
153
|
+
byte-for-byte unchanged.
|
|
154
|
+
|
|
155
|
+
**Trusted-publisher registrations.** Each platform package across
|
|
156
|
+
*every* family needs its own npm trusted-publisher registration. A
|
|
157
|
+
multi-mode package with N families × M targets needs N×M registrations
|
|
158
|
+
plus one for the top-level. There's no shorthand on npm's side; this
|
|
159
|
+
is the cost of the dual-family install pattern.
|
|
160
|
+
|
|
161
|
+
**Deprecations removed.** None.
|
|
162
|
+
|
|
163
|
+
**Behavior changes without code changes.** None for single-mode
|
|
164
|
+
configs. Multi-mode is new surface — no prior behavior to compare
|
|
165
|
+
against.
|
|
166
|
+
|
|
167
|
+
**Verification.** For an existing single-mode config, `putitoutthere
|
|
168
|
+
plan` should emit identical matrix rows before and after the upgrade
|
|
169
|
+
(same `artifact_name`, same `artifact_path`, same `target`). For a
|
|
170
|
+
new multi-mode config, you should see one matrix row per `(mode,
|
|
171
|
+
triple)` plus a single `target = "main"` row, and the matrix
|
|
172
|
+
`artifact_name` should carry the mode infix
|
|
173
|
+
(`<name>-<mode>-<triple>`).
|
|
174
|
+
|
|
61
175
|
---
|
|
62
176
|
|
|
63
177
|
## v0.1.51 → v0.2.0
|
package/README.md
CHANGED
|
@@ -155,8 +155,8 @@ version = 1 # required; only 1 is valid today
|
|
|
155
155
|
| `npm` | string | Override `name` → npm name (for scoped packages). |
|
|
156
156
|
| `access` | enum | `public` \| `restricted`. Default `public`. |
|
|
157
157
|
| `tag` | string | dist-tag. Default `latest`. |
|
|
158
|
-
| `build` |
|
|
159
|
-
| `targets` | (string \| object)[] | Required when `build
|
|
158
|
+
| `build` | string \| array | `"napi"` \| `"bundled-cli"` (single mode), or an array of entries (each: a bare mode string or `{ mode, name }` with a [name template](#multi-mode-npm-family)). Omitted = vanilla. See [Recipes → Bundled-CLI npm family](#bundled-cli-npm-family). |
|
|
159
|
+
| `targets` | (string \| object)[] | Required when `build` is set. |
|
|
160
160
|
|
|
161
161
|
### Example: polyglot Rust library
|
|
162
162
|
|
|
@@ -384,6 +384,65 @@ Each per-platform sub-package needs its own npm trusted-publisher
|
|
|
384
384
|
registration (a policy on `my-cli` does not cover
|
|
385
385
|
`my-cli-x86_64-unknown-linux-gnu`).
|
|
386
386
|
|
|
387
|
+
### Multi-mode npm family
|
|
388
|
+
|
|
389
|
+
For a package that is both a napi-rs Node addon (a `.node` library) **and**
|
|
390
|
+
a CLI binary, declare `build` as an array. Each entry contributes its own
|
|
391
|
+
per-platform family; the main package's `optionalDependencies` spans both.
|
|
392
|
+
The `@swc/core` / dirsql distribution shape.
|
|
393
|
+
|
|
394
|
+
```toml
|
|
395
|
+
[[package]]
|
|
396
|
+
name = "dirsql"
|
|
397
|
+
kind = "npm"
|
|
398
|
+
path = "packages/ts"
|
|
399
|
+
globs = ["packages/ts/**", "crates/dirsql/**"]
|
|
400
|
+
build = [
|
|
401
|
+
{ mode = "napi", name = "@dirsql/lib-{triple}" },
|
|
402
|
+
{ mode = "bundled-cli", name = "@dirsql/cli-{triple}" },
|
|
403
|
+
]
|
|
404
|
+
targets = [
|
|
405
|
+
"linux-x64-gnu",
|
|
406
|
+
"darwin-arm64",
|
|
407
|
+
"win32-x64-msvc",
|
|
408
|
+
]
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
Each entry has a **mode** (`napi` or `bundled-cli`) and a **`name`
|
|
412
|
+
template** for its platform packages. Variables:
|
|
413
|
+
|
|
414
|
+
| Variable | Resolves to |
|
|
415
|
+
|-------------|-------------------------------------------------------------------|
|
|
416
|
+
| `{name}` | The main package's npm name (`pkg.npm` if set, else `pkg.name`). |
|
|
417
|
+
| `{scope}` | Scope without `@` for scoped names (e.g. `dirsql`); `""` if unscoped. |
|
|
418
|
+
| `{base}` | Name without scope (e.g. `core` for `@dirsql/core`). |
|
|
419
|
+
| `{triple}` | Target triple as written in `targets` — required in the template. |
|
|
420
|
+
| `{mode}` | The entry's mode (`napi` / `bundled-cli`). |
|
|
421
|
+
|
|
422
|
+
`{version}` is intentionally not surfaced — platform package names are
|
|
423
|
+
immutable identifiers; the version is pinned in `optionalDependencies`,
|
|
424
|
+
not the name.
|
|
425
|
+
|
|
426
|
+
**Single-mode (string) form is preserved.** `build = "napi"` and
|
|
427
|
+
`build = ["napi"]` are equivalent and produce the historical
|
|
428
|
+
`<name>-<triple>` platform-package names byte-for-byte. The mode-infix
|
|
429
|
+
artifact-directory naming (`<name>-napi-<triple>`, `<name>-bundled-cli-<triple>`)
|
|
430
|
+
only applies when `build` has more than one entry.
|
|
431
|
+
|
|
432
|
+
**Validation rules** enforced at config load:
|
|
433
|
+
|
|
434
|
+
- Each `mode` value (`napi`, `bundled-cli`) appears at most once per package.
|
|
435
|
+
- Every `name` template must contain `{triple}`.
|
|
436
|
+
- Unknown placeholders are rejected.
|
|
437
|
+
- All entries must produce distinct platform-package name templates.
|
|
438
|
+
|
|
439
|
+
Each platform package across **every** family needs its own npm
|
|
440
|
+
trusted-publisher registration. For the dirsql config above, that's
|
|
441
|
+
`@dirsql/lib-linux-x64-gnu`, `@dirsql/lib-darwin-arm64`,
|
|
442
|
+
`@dirsql/lib-win32-x64-msvc`, `@dirsql/cli-linux-x64-gnu`,
|
|
443
|
+
`@dirsql/cli-darwin-arm64`, `@dirsql/cli-win32-x64-msvc` — six total,
|
|
444
|
+
one per platform package, plus the top-level `dirsql`.
|
|
445
|
+
|
|
387
446
|
### Rust CLI inside a PyPI wheel
|
|
388
447
|
|
|
389
448
|
`pip install my-lib` on any platform gets a working CLI on `PATH` without
|
package/dist/config.d.ts
CHANGED
|
@@ -67,10 +67,19 @@ declare const NPM_PKG: z.ZodObject<{
|
|
|
67
67
|
restricted: "restricted";
|
|
68
68
|
}>>;
|
|
69
69
|
tag: z.ZodOptional<z.ZodString>;
|
|
70
|
-
build: z.ZodOptional<z.ZodEnum<{
|
|
70
|
+
build: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
71
71
|
napi: "napi";
|
|
72
72
|
"bundled-cli": "bundled-cli";
|
|
73
|
-
}
|
|
73
|
+
}>, z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
74
|
+
napi: "napi";
|
|
75
|
+
"bundled-cli": "bundled-cli";
|
|
76
|
+
}>, z.ZodObject<{
|
|
77
|
+
mode: z.ZodEnum<{
|
|
78
|
+
napi: "napi";
|
|
79
|
+
"bundled-cli": "bundled-cli";
|
|
80
|
+
}>;
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
}, z.core.$strict>]>>]>>;
|
|
74
83
|
targets: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
75
84
|
triple: z.ZodString;
|
|
76
85
|
runner: z.ZodOptional<z.ZodString>;
|
|
@@ -124,10 +133,19 @@ declare const PACKAGE: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
124
133
|
restricted: "restricted";
|
|
125
134
|
}>>;
|
|
126
135
|
tag: z.ZodOptional<z.ZodString>;
|
|
127
|
-
build: z.ZodOptional<z.ZodEnum<{
|
|
136
|
+
build: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
128
137
|
napi: "napi";
|
|
129
138
|
"bundled-cli": "bundled-cli";
|
|
130
|
-
}
|
|
139
|
+
}>, z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
140
|
+
napi: "napi";
|
|
141
|
+
"bundled-cli": "bundled-cli";
|
|
142
|
+
}>, z.ZodObject<{
|
|
143
|
+
mode: z.ZodEnum<{
|
|
144
|
+
napi: "napi";
|
|
145
|
+
"bundled-cli": "bundled-cli";
|
|
146
|
+
}>;
|
|
147
|
+
name: z.ZodString;
|
|
148
|
+
}, z.core.$strict>]>>]>>;
|
|
131
149
|
targets: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
132
150
|
triple: z.ZodString;
|
|
133
151
|
runner: z.ZodOptional<z.ZodString>;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAAE,CAAC,EAAiB,MAAM,KAAK,CAAC;AAgBvC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAID,QAAA,MAAM,KAAK;;kBAIA,CAAC;AA4EZ,QAAA,MAAM,UAAU;;;;;;;;;;;kBAQL,CAAC;AAIZ,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;kBA+BX,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAAE,CAAC,EAAiB,MAAM,KAAK,CAAC;AAgBvC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAID,QAAA,MAAM,KAAK;;kBAIA,CAAC;AA4EZ,QAAA,MAAM,UAAU;;;;;;;;;;;kBAQL,CAAC;AAIZ,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;kBA+BX,CAAC;AAkDJ,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+DT,CAAC;AAEL,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAAgE,CAAC;AAW9E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAC/C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACvD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AACnD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AACjD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAE9C,MAAM,WAAW,MAAM;IACrB,aAAa,EAAE,UAAU,CAAC;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAID,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAmBhD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAa/C"}
|
package/dist/config.js
CHANGED
|
@@ -145,7 +145,50 @@ const PYPI_PKG = z
|
|
|
145
145
|
// without `targets` would produce only an sdist, and the staged
|
|
146
146
|
// binary wouldn't end up in any wheel.
|
|
147
147
|
{ message: 'bundle_cli requires at least one entry in `targets`' });
|
|
148
|
-
const
|
|
148
|
+
const NPM_BUILD_MODE = z.enum(['napi', 'bundled-cli']);
|
|
149
|
+
// #dirsql: must mirror ALLOWED_NAME_VARIABLES in src/handlers/npm-platform.ts.
|
|
150
|
+
// `{version}` is intentionally excluded — see resolvePlatformName.
|
|
151
|
+
const NPM_NAME_TEMPLATE_VARS = ['name', 'scope', 'base', 'triple', 'mode'];
|
|
152
|
+
const NPM_NAME_TEMPLATE_PLACEHOLDER_RE = /\{([^}]+)\}/g;
|
|
153
|
+
function validateNameTemplate(template) {
|
|
154
|
+
if (template.length === 0)
|
|
155
|
+
return 'name template must not be empty';
|
|
156
|
+
if (!template.includes('{triple}')) {
|
|
157
|
+
return 'name template must contain {triple} (otherwise platform packages would collide)';
|
|
158
|
+
}
|
|
159
|
+
const allowed = new Set(NPM_NAME_TEMPLATE_VARS);
|
|
160
|
+
const unknown = [];
|
|
161
|
+
for (const match of template.matchAll(NPM_NAME_TEMPLATE_PLACEHOLDER_RE)) {
|
|
162
|
+
const v = match[1];
|
|
163
|
+
if (!allowed.has(v))
|
|
164
|
+
unknown.push(v);
|
|
165
|
+
}
|
|
166
|
+
if (unknown.length > 0) {
|
|
167
|
+
return `name template contains unknown placeholder(s): ${[...new Set(unknown)].map((u) => `{${u}}`).join(', ')} (allowed: ${NPM_NAME_TEMPLATE_VARS.map((v) => `{${v}}`).join(', ')})`;
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
// Object form of a build entry: explicit mode + a `name` template the
|
|
172
|
+
// consumer fully controls. String form (a bare mode) implies the
|
|
173
|
+
// historical `{name}-{triple}` template — backward-compat with the
|
|
174
|
+
// pre-multi-mode shape.
|
|
175
|
+
const NPM_BUILD_ENTRY_OBJ = z
|
|
176
|
+
.object({
|
|
177
|
+
mode: NPM_BUILD_MODE,
|
|
178
|
+
name: z.string(),
|
|
179
|
+
})
|
|
180
|
+
.strict()
|
|
181
|
+
.superRefine((entry, ctx) => {
|
|
182
|
+
const reason = validateNameTemplate(entry.name);
|
|
183
|
+
if (reason !== null) {
|
|
184
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: reason, path: ['name'] });
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
const NPM_BUILD_ENTRY = z.union([NPM_BUILD_MODE, NPM_BUILD_ENTRY_OBJ]);
|
|
188
|
+
// `build` accepts a single mode string ("napi" / "bundled-cli") for
|
|
189
|
+
// backward compat, OR a non-empty array of entries (each: a bare mode
|
|
190
|
+
// string or an object with `{mode, name}`).
|
|
191
|
+
const NPM_BUILD = z.union([NPM_BUILD_MODE, z.array(NPM_BUILD_ENTRY).min(1)]);
|
|
149
192
|
const NPM_PKG = z
|
|
150
193
|
.object({
|
|
151
194
|
...PACKAGE_BASE,
|
|
@@ -157,9 +200,61 @@ const NPM_PKG = z
|
|
|
157
200
|
targets: z.array(TARGET_ENTRY).optional(),
|
|
158
201
|
})
|
|
159
202
|
.strict()
|
|
160
|
-
.
|
|
161
|
-
// §12.2: targets only
|
|
162
|
-
|
|
203
|
+
.superRefine((p, ctx) => {
|
|
204
|
+
// §12.2: targets only when build is set on an npm package. Both
|
|
205
|
+
// string-mode and array forms count.
|
|
206
|
+
if (p.targets !== undefined && p.build === undefined) {
|
|
207
|
+
ctx.addIssue({
|
|
208
|
+
code: z.ZodIssueCode.custom,
|
|
209
|
+
message: 'targets is only valid when build = "napi" or "bundled-cli" on npm packages',
|
|
210
|
+
});
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if (Array.isArray(p.build)) {
|
|
214
|
+
// Each mode value can appear at most once. There's no meaningful
|
|
215
|
+
// "two napi build entries on the same package".
|
|
216
|
+
const seenModes = new Set();
|
|
217
|
+
const dupModes = [];
|
|
218
|
+
for (const e of p.build) {
|
|
219
|
+
const mode = typeof e === 'string' ? e : e.mode;
|
|
220
|
+
if (seenModes.has(mode))
|
|
221
|
+
dupModes.push(mode);
|
|
222
|
+
seenModes.add(mode);
|
|
223
|
+
}
|
|
224
|
+
if (dupModes.length > 0) {
|
|
225
|
+
ctx.addIssue({
|
|
226
|
+
code: z.ZodIssueCode.custom,
|
|
227
|
+
message: `build entries must have unique modes; duplicates: ${[...new Set(dupModes)].join(', ')}`,
|
|
228
|
+
path: ['build'],
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
// Resolved platform-package names must be pairwise distinct. Since
|
|
232
|
+
// `{triple}` is the only per-row varying placeholder, comparing the
|
|
233
|
+
// canonical templates is sufficient: identical templates collide on
|
|
234
|
+
// every triple, distinct templates differ on every triple. Bare-string
|
|
235
|
+
// entries default to '{name}-{triple}'.
|
|
236
|
+
const seenTemplates = new Map();
|
|
237
|
+
const collisions = [];
|
|
238
|
+
for (const e of p.build) {
|
|
239
|
+
const mode = typeof e === 'string' ? e : e.mode;
|
|
240
|
+
const tpl = typeof e === 'string' ? '{name}-{triple}' : e.name;
|
|
241
|
+
const prior = seenTemplates.get(tpl);
|
|
242
|
+
if (prior !== undefined) {
|
|
243
|
+
collisions.push(`"${tpl}" used by both ${prior} and ${mode}`);
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
seenTemplates.set(tpl, mode);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (collisions.length > 0) {
|
|
250
|
+
ctx.addIssue({
|
|
251
|
+
code: z.ZodIssueCode.custom,
|
|
252
|
+
message: `build entries must have distinct platform-package name templates; ${collisions.join('; ')}`,
|
|
253
|
+
path: ['build'],
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
});
|
|
163
258
|
const PACKAGE = z.discriminatedUnion('kind', [CRATES_PKG, PYPI_PKG, NPM_PKG]);
|
|
164
259
|
const FILE = z
|
|
165
260
|
.object({
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAiB,MAAM,KAAK,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,0FAA0F;AAE1F,+EAA+E;AAC/E,0EAA0E;AAC1E,4EAA4E;AAC5E,yEAAyE;AACzE,MAAM,4BAA4B,GAAG,aAAa,CAAC;AAEnD,yEAAyE;AACzE,+EAA+E;AAC/E,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;AAC7C,CAAC;AAED,2EAA2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AAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3E,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,KAAe;IACrC,OAAO,KAAK,CAAC,MAAM;SAChB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACb,uFAAuF;QACvF,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACrE,OAAO,GAAG,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;IACrC,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -40,6 +40,6 @@ export declare function replaceCargoVersion(source: string, version: string): st
|
|
|
40
40
|
* a git work tree, git command missing, etc) — callers treat null as
|
|
41
41
|
* "can't verify, fall through to cargo's own --allow-dirty behavior."
|
|
42
42
|
*/
|
|
43
|
-
export declare function scanDirtyOutsideManifest(cwd: string, pkgPath: string, artifactsRoot?: string): string[] | null;
|
|
43
|
+
export declare function scanDirtyOutsideManifest(cwd: string, pkgPath: string, artifactsRoot?: string, siblingPackagePaths?: readonly string[]): string[] | null;
|
|
44
44
|
export declare const crates: Handler;
|
|
45
45
|
//# sourceMappingURL=crates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crates.d.ts","sourceRoot":"","sources":["../../src/handlers/crates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,KAAK,EAAO,OAAO,EAAiB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"crates.d.ts","sourceRoot":"","sources":["../../src/handlers/crates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,KAAK,EAAO,OAAO,EAAiB,MAAM,aAAa,CAAC;AAoI/D;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAa3E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,MAAM,EACtB,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,GACtC,MAAM,EAAE,GAAG,IAAI,CA6FjB;AAQD,eAAO,MAAM,MAAM,EAAE,OAKpB,CAAC"}
|
package/dist/handlers/crates.js
CHANGED
|
@@ -83,7 +83,15 @@ async function publishImpl(pkg, version, ctx) {
|
|
|
83
83
|
// Reinstate a narrower check: only the Cargo.toml we just wrote may
|
|
84
84
|
// be dirty. Anything else = a bug or a stray edit that would end up
|
|
85
85
|
// in the crate tarball. Published crates can't be unpublished.
|
|
86
|
-
|
|
86
|
+
//
|
|
87
|
+
// Sibling package paths are whitelisted: a polyglot consumer with
|
|
88
|
+
// rust + js packages will have install state (node_modules/, dist/,
|
|
89
|
+
// package-lock.json) inside the js package's path during publish
|
|
90
|
+
// (the reusable workflow's `Build npm packages` step runs
|
|
91
|
+
// `npm install + npm run build` per npm package before the engine
|
|
92
|
+
// publishes). cargo only packs files inside its own package dir, so
|
|
93
|
+
// sibling-package state can't end up in the crate tarball anyway.
|
|
94
|
+
const unexpected = scanDirtyOutsideManifest(ctx.cwd, pkg.path, ctx.artifactsRoot, ctx.siblingPackagePaths);
|
|
87
95
|
if (unexpected !== null && unexpected.length > 0) {
|
|
88
96
|
throw new Error([
|
|
89
97
|
`cargo publish: refusing to proceed; unexpected dirty files in the working tree outside ${relativeOrSelf(ctx.cwd, join(pkg.path, 'Cargo.toml'))}:`,
|
|
@@ -155,7 +163,7 @@ export function replaceCargoVersion(source, version) {
|
|
|
155
163
|
* a git work tree, git command missing, etc) — callers treat null as
|
|
156
164
|
* "can't verify, fall through to cargo's own --allow-dirty behavior."
|
|
157
165
|
*/
|
|
158
|
-
export function scanDirtyOutsideManifest(cwd, pkgPath, artifactsRoot) {
|
|
166
|
+
export function scanDirtyOutsideManifest(cwd, pkgPath, artifactsRoot, siblingPackagePaths) {
|
|
159
167
|
// Confirm we're inside a git work tree. If not, bail and let cargo's
|
|
160
168
|
// own --allow-dirty handling take over.
|
|
161
169
|
try {
|
|
@@ -209,6 +217,18 @@ export function scanDirtyOutsideManifest(cwd, pkgPath, artifactsRoot) {
|
|
|
209
217
|
const r = relative(cwd, artifactsRoot);
|
|
210
218
|
artifactsRel = r === '' ? '' : r.replace(/\\/g, '/');
|
|
211
219
|
}
|
|
220
|
+
// Sibling package directories — anything inside them is workflow
|
|
221
|
+
// state from another handler (e.g. node_modules/ + package-lock.json
|
|
222
|
+
// + dist/ from the npm `Build npm packages` step). cargo only packs
|
|
223
|
+
// files inside its own package dir, so these can't end up in the
|
|
224
|
+
// crate tarball regardless of whether they're "dirty" by git's view.
|
|
225
|
+
const siblingRels = [];
|
|
226
|
+
for (const p of siblingPackagePaths ?? []) {
|
|
227
|
+
const r = relative(cwd, p);
|
|
228
|
+
if (r === '' || r.startsWith('..'))
|
|
229
|
+
continue;
|
|
230
|
+
siblingRels.push(r.replace(/\\/g, '/'));
|
|
231
|
+
}
|
|
212
232
|
const unexpected = [];
|
|
213
233
|
for (const raw of porcelain.split('\n')) {
|
|
214
234
|
if (raw.length < 4)
|
|
@@ -228,6 +248,11 @@ export function scanDirtyOutsideManifest(cwd, pkgPath, artifactsRoot) {
|
|
|
228
248
|
normalized.startsWith(`${artifactsRel}/`))) {
|
|
229
249
|
continue;
|
|
230
250
|
}
|
|
251
|
+
if (siblingRels.some((s) => normalized === s ||
|
|
252
|
+
normalized === `${s}/` ||
|
|
253
|
+
normalized.startsWith(`${s}/`))) {
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
231
256
|
unexpected.push(normalized);
|
|
232
257
|
}
|
|
233
258
|
return unexpected;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crates.js","sourceRoot":"","sources":["../../src/handlers/crates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,QAAQ,GAAG,mBAAmB,CAAC;AAErC,KAAK,UAAU,eAAe,CAC5B,GAAqC,EACrC,OAAe,EACf,IAAS;IAET,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,GAAG,QAAQ,kBAAkB,kBAAkB,CAAC,SAAS,CAAC,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;IACxG,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE;KACtC,CAAC,CAAC;IACH,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IACrC,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;QACtB,MAAM,IAAI,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