Commit b5a8624
refactor!: drop pkg-CLI mirror inputs, own only action-layer surface (#13)
* refactor!: drop pkg-CLI mirror inputs, own only action-layer surface
Pkg-specific knobs (mode, node-version, compress-node, fallback-to-source,
public, public-packages, options, no-bytecode, no-dict, debug, extra-args)
are removed from the action input surface. Users express them in their pkg
config (.pkgrc, pkg.config.{js,ts,json}, or package.json pkg field) instead.
The action keeps only action-layer concerns that do not exist in pkg config:
config path, entry, targets, pkg-version/pkg-path, plus the archive, signing,
windows-metadata, and performance groups.
Motivation: mirroring pkg's CLI forced the action to grow a new input each
time pkg added a flag, and to maintain back-compat on every pkg release. By
letting pkg own its own schema we decouple the action from pkg's evolution.
Docs updated: README gets a new "pkg configuration" section with a migration
example; architecture.md §3/§6 note the scoped surface; STATUS.yaml records
the dropped-inputs list and migration path.
BREAKING CHANGE: the listed inputs are no longer accepted. Setting them now
triggers the unknown-input warning and the value is ignored. Migrate into
your pkg config file.
* review: link STATUS from architecture, cover pkg-version/pkg-path in tests
Address PR-review suggestions:
- architecture.md §6 no longer duplicates the dropped-input list; points
readers at STATUS.yaml#input-surface-slim as the single source.
- inputs.test.ts: extend the defaults test with `pkgPath` and add a positive
round-trip test for `pkg-version` + `pkg-path`. These remain live inputs and
deserve the same explicit coverage the rest of BuildInputs has.
223/223 unit tests, lint clean.
* feat: add config-inline input for file-less pkg config
New optional input `config-inline` accepts a JSON string carrying the pkg
config directly in the workflow. The orchestrator writes it to
`${invocationDir}/pkg-config.inline.json` and forwards that path to pkg via
`--config`. Mutually exclusive with `config`; the pair is validated at parse
time alongside a JSON-object syntax check so a typo fails before pkg runs.
Motivation: users with a trivial pkg config (entry + a couple of knobs) no
longer need to commit a separate .pkgrc.json just to customize the build.
Keeps the "pkg owns its schema" property — users still write pkg config
keys (camelCase), we just let them write them inline.
Not masked as a secret — README adds a note warning users against embedding
secrets in the value.
Docs: README gains an "Inline config" subsection with an example; action.yml
+ docs/inputs.md regenerated.
Tests: four new unit tests cover the happy path, mutual exclusion, invalid
JSON, and non-object JSON (string/array/null). 227/227 pass.
* review(copilot): use correct camelCase pkg-config keys in warnings/docs
Three nits from the Copilot review on PR #13:
- targets.ts cross-compile warnings referenced `fallback-to-source` (kebab,
like the retired CLI flag); pkg config uses `fallbackToSource` (camelCase).
Reword both messages to point at the actual config key.
- README "pkg configuration" example was fenced as jsonc with a `//` comment
and trailing comma but labeled `.pkgrc.json` — .pkgrc.json is strict JSON,
so a copy/paste would fail. Move the filename into the prose, fence as
json, drop the comment + trailing comma.
Unit tests + lint green. Matrix bundle rebuilt to pick up the new warning
strings.
* e2e(claude-code): move pkg-layer knobs from action inputs to pkg config
Main (PR #12) wired the claude-code-smoke job through the action using
`mode: sea` and `compress-node: Zstd` inputs. Those inputs no longer exist
on this branch, so move both values into the package.json#pkg field that
the fixture-prep step already injects. No behavior change on main; on this
branch the e2e now exercises the pkg-config path the slim input surface
forces users onto.
* e2e(claude-code): use sea:true config, acknowledge CLI-only flag gap
The merge from main brought in the claude-code-smoke job, which previously
drove pkg via `mode: sea` + `compress-node: Zstd` action inputs. On this
branch those inputs are dropped. The prior merge-conflict resolution moved
both into `package.json#pkg` under the assumption that pkg config would pick
them up. That assumption was wrong:
- `mode: 'sea'` is not a pkg config key — the correct key is `sea: true`.
(This was a user-visible bug; pkg silently ignored `mode` and ran
standard-mode, which OOM'd trying to bytecode-compile claude-code's ESM
bundle on macos-arm64.)
- `compressNode` / `compress` is not a pkg config key at all. `--compress`
is CLI-only today on @yao-pkg/pkg. No config equivalent exists.
Fix the e2e:
- Write `sea: true` into package.json#pkg so SEA is actually enabled.
- Drop the Zstd request — there is no way to express it without the
dropped CLI input. The job now exercises SEA + tar.gz; the Zstd branch
is intentionally deferred until upstream lands config support.
- Rename + retone the job's comment block accordingly.
Also add an upstream-dependency note to STATUS.yaml and a draft issue
body at docs/upstream-pkg-config-issue.md. The draft asks yao-pkg/pkg to
accept the currently-CLI-only build flags (compress, fallbackToSource,
public, publicPackages, options, noBytecode, noDict, debug, signature)
in the config file — that's the piece that makes this PR's scope
defensible for the full input set, not just for SEA.
227 unit tests pass; lint + prettier clean.
* status: link upstream pkg-config tracking issue (yao-pkg/pkg#262)
Issue is open upstream asking @yao-pkg/pkg to accept the currently-CLI-only
build flags (compress, fallbackToSource, public, publicPackages, options,
noBytecode, noDict, debug, signature) in the config file — the piece that
makes this PR's drop-the-CLI-mirror direction fully viable.
Replace the local draft with the issue URL in STATUS.yaml#upstream-dependency.
* e2e(claude-code): enable Zstd via pkg config; bump pkg → ~6.19.0
pkg v6.19.0 (yao-pkg/pkg#263, closes #262) landed config support for
the CLI-only build flags, and ships the SEA-mode detector fix
(yao-pkg/pkg#268) that caused the prior OOM at bytecode-compile time.
- claude-code-smoke: add `compress: 'Zstd'` alongside `sea: true` in
package.json#pkg; bump pkg-version input ~6.18.0 → ~6.19.0.
- Default `pkg-version` input bumped ~6.16.0 → ~6.19.0 — the whole
config-as-source-of-truth direction of this branch requires it.
- Regenerated action.yml / packages/build/action.yml / docs/inputs.md.
- STATUS.yaml: upstream-dependency RESOLVED; Zstd gap dropped;
e2e-status lists claude-code-smoke; ci-status bumped to 227 tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
* chore: rebuild dist/ bundles after pkg-version bump
Rebuild packages/{build,windows-metadata}/dist/index.mjs so the
committed bundles match the ~6.19.0 default written into
packages/core/src/inputs.ts. Drift gate caught it.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
* review: correct pkg-config keys, mask config-inline, extract materialize helper
Address four items from the self-review on PR #13:
- README examples used `mode: "sea"` / `compressNode: "Brotli"` — neither
exists in @yao-pkg/pkg's config schema. The authoritative FLAG_SPECS in
lib/config.ts (and the docs-site configuration reference) show `sea: true`
and `compress: "..."`. Fixed both examples so a copy-paste works.
- `config-inline` carried user-authored JSON but was not masked. Mark the
spec with `secret: true` so parseInputs registers the raw value via
core.setSecret — exact-match redaction in logs costs nothing given pkg
doesn't echo the config blob. README warning softened accordingly (still
flags the on-disk temp file).
- Extract the config-inline "bytes to disk" step out of the orchestrator
into `materializePkgConfigInline` in fs-utils, alongside
`PKG_CONFIG_INLINE_FILENAME`. Four new unit tests cover pass-through,
both-undefined, inline-writes-and-returns-path, and inline-wins-over-config.
Orchestrator is now a two-liner that just logs the resulting path.
- BASE_BUILD fixture in pkg-runner.test.ts still pinned pkgVersion to the
old `~6.16.0` default; bump to `~6.19.0` to match parseInputs.
Regenerated action.yml + docs/inputs.md (secret flag on config-inline
doesn't affect the YAML shape but the description changed). Rebuilt
packages/{build,windows-metadata}/dist/index.mjs.
Tests 231/231 pass (was 227/227), typecheck + lint + prettier green.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>1 parent 2cb95b8 commit b5a8624
19 files changed
Lines changed: 451 additions & 480 deletions
File tree
- .github/workflows
- docs
- packages
- build
- dist
- src
- core
- src
- test/unit
- matrix/dist
- windows-metadata/dist
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
258 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
259 | 260 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
| |||
332 | 334 | | |
333 | 335 | | |
334 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
335 | 340 | | |
336 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
337 | 344 | | |
338 | 345 | | |
339 | 346 | | |
| |||
350 | 357 | | |
351 | 358 | | |
352 | 359 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
358 | 364 | | |
359 | 365 | | |
360 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
34 | 91 | | |
35 | 92 | | |
36 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
51 | 83 | | |
52 | 84 | | |
53 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 20 | | |
48 | | - | |
49 | | - | |
| 21 | + | |
| 22 | + | |
50 | 23 | | |
51 | 24 | | |
52 | 25 | | |
| |||
169 | 142 | | |
170 | 143 | | |
171 | 144 | | |
172 | | - | |
| 145 | + | |
173 | 146 | | |
174 | 147 | | |
175 | 148 | | |
| |||
182 | 155 | | |
183 | 156 | | |
184 | 157 | | |
| 158 | + | |
185 | 159 | | |
186 | 160 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | 161 | | |
199 | 162 | | |
200 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
159 | 170 | | |
160 | 171 | | |
161 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 15 | + | |
26 | 16 | | |
27 | 17 | | |
28 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 17 | | |
45 | | - | |
46 | | - | |
| 18 | + | |
| 19 | + | |
47 | 20 | | |
48 | 21 | | |
49 | 22 | | |
| |||
0 commit comments