kylon-cli 0.1.0-next.12 → 0.1.0-next.121
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/README.md +35 -120
- package/dist/kylon-bundle.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -286,9 +286,9 @@ shim. The shim execs `node --import tsx <src>`, so:
|
|
|
286
286
|
- On SIGINT/SIGTERM the tmpdir is wiped.
|
|
287
287
|
|
|
288
288
|
This flag is **only compiled into local (non-minified) builds**. The
|
|
289
|
-
npm package
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
npm package and any `bundle:release` output reject `--dev-cli-shim` as
|
|
290
|
+
an unknown argument and omit it from `--help`, so it can never
|
|
291
|
+
accidentally ship.
|
|
292
292
|
|
|
293
293
|
### Debugging both the daemon and `kylon workspace` calls
|
|
294
294
|
|
|
@@ -334,7 +334,7 @@ The release artifact is a single-file ESM bundle produced by
|
|
|
334
334
|
|---|---|---|---|
|
|
335
335
|
| `pnpm --filter kylon-cli bundle` | `dist/kylon-bundle.mjs` | _(none)_ | debugging the bundled shape while keeping readable names — not shipped |
|
|
336
336
|
| `pnpm --filter kylon-cli bundle:minify` | `dist/kylon-bundle.mjs` | `--minify` | reproducing the pre-obfuscation size and behavior for a bisect |
|
|
337
|
-
| `pnpm --filter kylon-cli bundle:release` | `dist/kylon-bundle.mjs` | `--minify --obfuscate` | what ships on npm
|
|
337
|
+
| `pnpm --filter kylon-cli bundle:release` | `dist/kylon-bundle.mjs` | `--minify --obfuscate` | what ships on npm |
|
|
338
338
|
|
|
339
339
|
The `bundle:release` path runs esbuild with `--minify`, then passes the
|
|
340
340
|
output through `javascript-obfuscator`. It's also what the `prepack` hook
|
|
@@ -418,14 +418,11 @@ API server is the security boundary.
|
|
|
418
418
|
|
|
419
419
|
## Release
|
|
420
420
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
> subsections below are a **legacy fallback being retired**, kept only until
|
|
427
|
-
> that removal lands; treat their specifics (`NPM_TOKEN`, `cli/vX.Y.Z` tags,
|
|
428
|
-
> `recommendedCliVersion`) as historical, not current.
|
|
421
|
+
The CLI ships via **npm dist-tags** — there is no server-side version policy.
|
|
422
|
+
`cli-verify.yml` validates on PRs and pushes; `cli-publish.yml` publishes via
|
|
423
|
+
OIDC (no token): a prerelease to the `next` tag on every merge to `main`, and a
|
|
424
|
+
stable to `latest` when a `kylon-cli-vX.Y.Z` tag is pushed. dev installs
|
|
425
|
+
`@next`, prd installs `@latest`.
|
|
429
426
|
|
|
430
427
|
### Versioning
|
|
431
428
|
|
|
@@ -437,121 +434,39 @@ Use explicit semver in `packages/cli/package.json`:
|
|
|
437
434
|
| minor (`0.1.x → 0.2.0`) | backward-compatible capability (new command, new flag) |
|
|
438
435
|
| major (`0.x.x → 1.0.0`) | breaking change to CLI contract or runtime behavior |
|
|
439
436
|
|
|
440
|
-
|
|
441
|
-
`cli
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
semver and let the publish workflow own version selection.
|
|
437
|
+
Prerelease builds are versioned `0.1.0-next.<run>` automatically by
|
|
438
|
+
`cli-publish.yml`; a stable release is whatever you tag — bump
|
|
439
|
+
`packages/cli/package.json` to the target semver, then push the matching
|
|
440
|
+
`kylon-cli-vX.Y.Z` tag.
|
|
445
441
|
|
|
446
|
-
###
|
|
442
|
+
### Publishing
|
|
447
443
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
`
|
|
444
|
+
- **Prerelease (automatic):** every merge to `main` touching the CLI publishes
|
|
445
|
+
`0.1.0-next.<run>` to the `next` tag via `cli-publish.yml` (OIDC, no
|
|
446
|
+
`NPM_TOKEN`). dev tracks this tag, so dev always dogfoods the newest build.
|
|
447
|
+
- **Stable (manual, when ready):** bump `packages/cli/package.json` to the
|
|
448
|
+
target version, merge, then tag the commit on `main`:
|
|
451
449
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
4. Creates a GitHub Release tagged `cli/v0.0.${run_number}` with both
|
|
459
|
-
`.mjs` files attached.
|
|
450
|
+
```bash
|
|
451
|
+
git pull
|
|
452
|
+
git tag kylon-cli-v0.1.1
|
|
453
|
+
git push origin kylon-cli-v0.1.1 # cli-publish.yml publishes it to `latest`
|
|
454
|
+
npm view kylon-cli dist-tags # verify
|
|
455
|
+
```
|
|
460
456
|
|
|
461
|
-
|
|
462
|
-
|
|
457
|
+
Do not `npm publish` ad-hoc — releases go through the workflow so the OIDC
|
|
458
|
+
provenance path is exercised end to end.
|
|
463
459
|
|
|
464
|
-
|
|
465
|
-
gh release download --repo fre-so/p2 --pattern 'kylon.mjs' --output /tmp/kylon
|
|
466
|
-
chmod +x /tmp/kylon
|
|
467
|
-
sudo mv /tmp/kylon /usr/local/bin/kylon
|
|
468
|
-
```
|
|
460
|
+
### Rollback
|
|
469
461
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
No npm token required; the workflow only needs `contents: write`.
|
|
474
|
-
|
|
475
|
-
### Rollback (GitHub channel)
|
|
476
|
-
|
|
477
|
-
If the most recent push produced a broken CLI:
|
|
478
|
-
|
|
479
|
-
1. Identify the last known good release under
|
|
480
|
-
<https://github.com/fre-so/p2/releases>.
|
|
481
|
-
2. Manually re-upload that release's bundle under the name
|
|
482
|
-
`kylon.mjs` on the most recent release — that's what the Web UI's
|
|
483
|
-
stable URL resolves against. (Alternatively, revert the bad commit
|
|
484
|
-
and let `release-cli.yml` cut a new release.)
|
|
485
|
-
3. Hosts with persistent installs re-run `curl -fsSL … -o
|
|
486
|
-
/usr/local/bin/kylon` to pull the rolled-back bundle.
|
|
487
|
-
|
|
488
|
-
There is no equivalent of `npm deprecate` on GitHub Releases, so a
|
|
489
|
-
broken bundle is "fixed" only by publishing a newer one.
|
|
490
|
-
|
|
491
|
-
### Planned: npm publish
|
|
492
|
-
|
|
493
|
-
This package is already wired for `npm publish` (metadata, `files`,
|
|
494
|
-
`prepack`, `publishConfig.access: public`). The only things missing
|
|
495
|
-
are the publish CI workflow and the owning npm account. The plan:
|
|
496
|
-
|
|
497
|
-
1. Someone claims `kylon-cli` on npm (the name is currently 404).
|
|
498
|
-
2. A granular publish token (Read + Write on `kylon-cli`) is stored
|
|
499
|
-
as the `NPM_TOKEN` GitHub Actions secret on `fre-so/p2`.
|
|
500
|
-
3. Split the release automation:
|
|
501
|
-
- **`cli-verify.yml`** — runs on PRs and pushes touching
|
|
502
|
-
`packages/cli/**`. Runs typecheck, lint, test, `bundle:release`,
|
|
503
|
-
and `npm pack`. Does not publish.
|
|
504
|
-
- **`cli-publish.yml`** — runs on push of tag `cli/vX.Y.Z`.
|
|
505
|
-
Verifies the tag matches `packages/cli/package.json#version`,
|
|
506
|
-
then `pnpm --filter kylon-cli publish --access public
|
|
507
|
-
--no-git-checks` with
|
|
508
|
-
`NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}`.
|
|
509
|
-
4. The API exposes `recommendedCliVersion`; the Web UI flips from
|
|
510
|
-
the `curl` shape above to `npx -y kylon-cli@<recommended> gateway
|
|
511
|
-
run …`.
|
|
512
|
-
|
|
513
|
-
Until (2) + (3) land, do **not** `npm publish` ad-hoc — the first
|
|
514
|
-
live release should come out through the paired CI workflow so the
|
|
515
|
-
token path is exercised end-to-end. Once the workflow exists, the
|
|
516
|
-
release ritual becomes:
|
|
462
|
+
npm publishes are immutable; roll back by re-pointing the tag, not by
|
|
463
|
+
unpublishing:
|
|
517
464
|
|
|
518
465
|
```bash
|
|
519
|
-
#
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
# 2. Merge to main via PR, verify CI is green
|
|
523
|
-
|
|
524
|
-
# 3. Tag the commit on main
|
|
525
|
-
git pull
|
|
526
|
-
git tag cli/v0.1.1
|
|
527
|
-
git push origin cli/v0.1.1
|
|
528
|
-
|
|
529
|
-
# 4. GitHub Actions publishes; verify
|
|
530
|
-
npm view kylon-cli@0.1.1 dist-tags
|
|
466
|
+
npm dist-tag add kylon-cli@<last-good> latest # move the channel back
|
|
467
|
+
npm deprecate kylon-cli@<bad> "Broken release — use <last-good>."
|
|
531
468
|
```
|
|
532
469
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
until they restart). If the pushed version is actively broken, also
|
|
537
|
-
`npm deprecate kylon-cli@<bad> "…"` so operators that ignore the
|
|
538
|
-
recommendation see a warning. Do not `npm unpublish`.
|
|
539
|
-
|
|
540
|
-
### Pre-release channel (npm-era, also planned)
|
|
541
|
-
|
|
542
|
-
Once npm is live, risky changes can go out under a `next` dist-tag so
|
|
543
|
-
the Web UI's recommended version is untouched:
|
|
544
|
-
|
|
545
|
-
```bash
|
|
546
|
-
# 1. Bump to a prerelease version
|
|
547
|
-
pnpm --filter kylon-cli version 0.2.0-next.0
|
|
548
|
-
|
|
549
|
-
# 2. Publish under the `next` dist-tag
|
|
550
|
-
cd packages/cli && pnpm publish --tag next --access public --no-git-checks
|
|
551
|
-
|
|
552
|
-
# 3. Operators can opt in explicitly
|
|
553
|
-
npx -y kylon-cli@next gateway run …
|
|
554
|
-
|
|
555
|
-
# 4. Promote to `latest` once validated
|
|
556
|
-
npm dist-tag add kylon-cli@0.2.0-next.0 latest
|
|
557
|
-
```
|
|
470
|
+
Operators on `@latest` pick up the re-pointed version the next time they
|
|
471
|
+
`npm install -g kylon-cli@latest`; in-flight daemons keep their current CLI
|
|
472
|
+
until they restart. Do not `npm unpublish`.
|