@git.zone/cli 9.2.2 → 11.0.0
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/.smartconfig.json +5 -3
- package/assets/templates/asset_binary_installer/install.sh +109 -34
- package/assets/templates/asset_binary_release_gitea/.gitea/workflows/release.yml +17 -4
- package/assets/templates/ci_rust/.gitea/workflows/rust_nottags.yaml +29 -0
- package/assets/templates/ci_rust/.gitea/workflows/rust_tags.yaml +32 -0
- package/assets/templates/cli/cli.ts.js +1 -1
- package/assets/templates/gitignore/_gitignore +1 -1
- package/assets/templates/gitignore_rust/_gitignore +31 -0
- package/assets/templates/license_mit/license +4 -1
- package/assets/templates/npm/.package.json +4 -6
- package/assets/templates/npm/test/test.ts +1 -1
- package/assets/templates/rust/.smartscaf.yml +16 -0
- package/assets/templates/rust/_Cargo.toml +12 -0
- package/assets/templates/rust/_crate_Cargo.toml +10 -0
- package/assets/templates/rust/_crate_lib.rs +19 -0
- package/assets/templates/rust/_smartconfig.json +27 -0
- package/assets/templates/rust/readme.md +23 -0
- package/assets/templates/service/.package.json +3 -6
- package/assets/templates/wcc/.package.json +3 -6
- package/assets/templates/wcc_update/html/index.html +2 -2
- package/assets/templates/website/.package.json +3 -6
- package/assets/templates/website/npmextra.json +3 -1
- package/assets/templates/website_update/html/index.html +4 -4
- package/dist_ts/00_commitinfo_data.js +2 -2
- package/dist_ts/classes.gitzoneconfig.d.ts +3 -1
- package/dist_ts/classes.gitzoneconfig.js +9 -1
- package/dist_ts/helpers.managedassets.d.ts +1 -1
- package/dist_ts/helpers.managedassets.js +58 -14
- package/dist_ts/helpers.packagefiles.js +2 -2
- package/dist_ts/helpers.releasetargets.d.ts +6 -0
- package/dist_ts/helpers.releasetargets.js +13 -0
- package/dist_ts/helpers.smartconfigmigrations.js +42 -1
- package/dist_ts/helpers.toolconfig.d.ts +50 -0
- package/dist_ts/helpers.toolconfig.js +212 -0
- package/dist_ts/helpers.tssea.d.ts +11 -4
- package/dist_ts/helpers.tssea.js +47 -17
- package/dist_ts/helpers.tstest.d.ts +27 -8
- package/dist_ts/helpers.tstest.js +64 -26
- package/dist_ts/helpers.versionsource.d.ts +37 -0
- package/dist_ts/helpers.versionsource.js +112 -0
- package/dist_ts/helpers.workflow.d.ts +45 -1
- package/dist_ts/helpers.workflow.js +120 -5
- package/dist_ts/mod_commit/mod.helpers.d.ts +0 -24
- package/dist_ts/mod_commit/mod.helpers.js +1 -94
- package/dist_ts/mod_commit/mod.plugins.d.ts +1 -1
- package/dist_ts/mod_commit/mod.plugins.js +2 -2
- package/dist_ts/mod_config/index.js +131 -18
- package/dist_ts/mod_format/formatters/assets.formatter.js +30 -28
- package/dist_ts/mod_format/formatters/gitignore.formatter.d.ts +4 -2
- package/dist_ts/mod_format/formatters/gitignore.formatter.js +10 -7
- package/dist_ts/mod_format/formatters/license.formatter.d.ts +8 -0
- package/dist_ts/mod_format/formatters/license.formatter.js +25 -2
- package/dist_ts/mod_format/formatters/packagejson.formatter.js +14 -3
- package/dist_ts/mod_format/formatters/rustfmt.formatter.d.ts +19 -0
- package/dist_ts/mod_format/formatters/rustfmt.formatter.js +97 -0
- package/dist_ts/mod_format/formatters/smartconfig.formatter.js +5 -2
- package/dist_ts/mod_format/formatters/templates.formatter.d.ts +3 -2
- package/dist_ts/mod_format/formatters/templates.formatter.js +61 -14
- package/dist_ts/mod_format/formatters/tsconfig.formatter.js +2 -2
- package/dist_ts/mod_format/index.js +3 -1
- package/dist_ts/mod_format/interfaces.format.js +2 -1
- package/dist_ts/mod_release/classes.releasejournal.d.ts +38 -2
- package/dist_ts/mod_release/classes.releasejournal.js +238 -66
- package/dist_ts/mod_release/helpers.cargorelease.d.ts +52 -0
- package/dist_ts/mod_release/helpers.cargorelease.js +195 -0
- package/dist_ts/mod_release/helpers.npmpackages.d.ts +18 -0
- package/dist_ts/mod_release/helpers.npmpackages.js +40 -2
- package/dist_ts/mod_release/helpers.releasecheck.d.ts +73 -0
- package/dist_ts/mod_release/helpers.releasecheck.js +269 -0
- package/dist_ts/mod_release/helpers.releasepreparation.d.ts +22 -8
- package/dist_ts/mod_release/helpers.releasepreparation.js +74 -26
- package/dist_ts/mod_release/helpers.releasepublication.d.ts +21 -1
- package/dist_ts/mod_release/helpers.releasepublication.js +249 -4
- package/dist_ts/mod_release/helpers.releaseversionsource.d.ts +10 -0
- package/dist_ts/mod_release/helpers.releaseversionsource.js +18 -0
- package/dist_ts/mod_release/helpers.rsrepoengine.d.ts +192 -0
- package/dist_ts/mod_release/helpers.rsrepoengine.js +457 -0
- package/dist_ts/mod_release/index.d.ts +3 -0
- package/dist_ts/mod_release/index.js +177 -65
- package/dist_ts/mod_template/index.js +6 -2
- package/dist_ts/mod_tools/index.js +3 -8
- package/dist_ts/plugins.d.ts +1 -1
- package/dist_ts/plugins.js +2 -2
- package/package.json +6 -11
- package/readme.md +244 -26
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.gitzoneconfig.ts +10 -1
- package/ts/helpers.managedassets.ts +64 -14
- package/ts/helpers.packagefiles.ts +1 -1
- package/ts/helpers.releasetargets.ts +13 -0
- package/ts/helpers.smartconfigmigrations.ts +48 -0
- package/ts/helpers.toolconfig.ts +280 -0
- package/ts/helpers.tssea.ts +62 -19
- package/ts/helpers.tstest.ts +105 -35
- package/ts/helpers.versionsource.ts +169 -0
- package/ts/helpers.workflow.ts +197 -5
- package/ts/mod_commit/mod.helpers.ts +0 -119
- package/ts/mod_commit/mod.plugins.ts +1 -1
- package/ts/mod_config/index.ts +169 -19
- package/ts/mod_format/formatters/assets.formatter.ts +29 -28
- package/ts/mod_format/formatters/gitignore.formatter.ts +10 -6
- package/ts/mod_format/formatters/license.formatter.ts +26 -1
- package/ts/mod_format/formatters/packagejson.formatter.ts +14 -2
- package/ts/mod_format/formatters/rustfmt.formatter.ts +107 -0
- package/ts/mod_format/formatters/smartconfig.formatter.ts +8 -1
- package/ts/mod_format/formatters/templates.formatter.ts +80 -14
- package/ts/mod_format/formatters/tsconfig.formatter.ts +1 -1
- package/ts/mod_format/index.ts +2 -0
- package/ts/mod_format/interfaces.format.ts +1 -0
- package/ts/mod_release/classes.releasejournal.ts +312 -39
- package/ts/mod_release/helpers.cargorelease.ts +289 -0
- package/ts/mod_release/helpers.npmpackages.ts +76 -1
- package/ts/mod_release/helpers.releasecheck.ts +409 -0
- package/ts/mod_release/helpers.releasepreparation.ts +116 -36
- package/ts/mod_release/helpers.releasepublication.ts +462 -1
- package/ts/mod_release/helpers.releaseversionsource.ts +29 -0
- package/ts/mod_release/helpers.rsrepoengine.ts +790 -0
- package/ts/mod_release/index.ts +277 -84
- package/ts/mod_template/index.ts +5 -1
- package/ts/mod_tools/index.ts +2 -7
- package/ts/plugins.ts +1 -1
package/readme.md
CHANGED
|
@@ -83,6 +83,8 @@ gitzone tools update -y
|
|
|
83
83
|
gitzone tools install
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
+
The managed tools include `@git.zone/tsrepo` and `@git.zone/rsrepo`, not the retired single tools they replace (tsbuild, tstest, tsbundle, tswatch, tsdoc, tspublish, tsrust), which `gitzone tools` neither installs nor updates; a global rsrepo is the engine a Rust project's release finds on the PATH when its package.json does not declare one.
|
|
87
|
+
|
|
86
88
|
`gitzone tools update` checks `@git.zone/cli` first. If the CLI itself needs an update, it updates `@git.zone/cli` and asks you to rerun the command before updating the rest of the toolchain.
|
|
87
89
|
|
|
88
90
|
## Commit Workflow
|
|
@@ -190,15 +192,15 @@ The release core is not configurable plumbing. It always follows the same profes
|
|
|
190
192
|
2. Read `changelog.md` `## Pending` entries and infer or accept a semver bump, raised to `release.versionFloor` when that is higher.
|
|
191
193
|
3. Run configured tests.
|
|
192
194
|
4. With `--merge`, fast-forward and lease-push `main` before release metadata is created.
|
|
193
|
-
5. Update version
|
|
195
|
+
5. Update the version through the project's version source (`package.json`, or the Cargo workspace of a `projectType: "rust"` project, see [Rust workspaces and the cargo target](#rust-workspaces-and-the-cargo-target)) and, in TypeScript projects, the baked commit info.
|
|
194
196
|
6. Move pending changelog entries into the new version section.
|
|
195
197
|
7. Create the local release commit and tag on `main`, and record the release intent, so any later failure is resumable (see [Resuming a release that failed before its journal](#resuming-a-release-that-failed-before-its-journal)).
|
|
196
|
-
8. Create a disposable detached checkout of that release commit, install its locked dependencies when the commit carries a `package.json
|
|
198
|
+
8. Create a disposable detached checkout of that release commit, install its locked dependencies when the commit carries a `package.json` (and run `cargo fetch --locked` in a Rust project), and run the configured release build there. An active Docker target additionally builds the release worktree its qualification reads.
|
|
197
199
|
9. When npm is selected, prepare every named tspublish module outside the repository, then pack each module and the public root package once into an exact tarball from that checkout. Every tarball must then carry each entry point its packed `package.json` names (`core.packNpmArtifact.entryPoints`), and its estimated publish body must fit each registry's `maxPublishBytes` (`core.packNpmArtifact.publishSize`, planned only when a limit is configured); the packed size and the body per registry are printed either way. See [Package contents](#package-contents).
|
|
198
200
|
10. Atomically install a durable journal before final publication. A release that publishes only the root package to npm uses journal schema 1, one that also or only publishes tspublish modules uses schema 3, a Docker release uses schema 2 with or without modules, and a Gitea asset release uses schema 4, all in the same storage tree.
|
|
199
201
|
11. For schema 2, run the project-local tSDocker qualification build and configured image tests, then durably record the candidate digest graph and complete ordered promotion set.
|
|
200
202
|
12. Publish and verify Git, then every npm package at every registry, modules first and the root package last, then each Docker destination. Remove only the exact qualified candidate after every destination is verified, or after a terminal qualification destination conflict before Git/npm publication.
|
|
201
|
-
13. Remove the test artifacts tstest wrote, so a machine does not accumulate test output release after release. This runs only after a successful publication, leaving the logs in place when a release fails. It is skipped when the project has
|
|
203
|
+
13. Remove the test artifacts tstest wrote, so a machine does not accumulate test output release after release. This runs only after a successful publication, leaving the logs in place when a release fails. It runs the project's `node_modules/.bin/tsrepo test clean` when the project installs `@git.zone/tsrepo`, otherwise its `node_modules/.bin/tstest clean` (tstest 6.1.0 or later). It is skipped when the project has neither, and a project opts out with `{"@git.zone/tsrepo": {"test": {"cleanup": {"onRelease": false}}}}`, or the legacy `{"@git.zone/tstest": {"cleanup": {"onRelease": false}}}`, in `.smartconfig.json`; both at once is an error. See the tstest readme for what it removes; snapshots are kept.
|
|
202
204
|
|
|
203
205
|
### The release builds and packs the release commit
|
|
204
206
|
|
|
@@ -293,6 +295,9 @@ Targets decide what happens after that:
|
|
|
293
295
|
# Preview the resolved release plan
|
|
294
296
|
gitzone release --plan
|
|
295
297
|
|
|
298
|
+
# Build and pack HEAD like a release, without creating or publishing anything
|
|
299
|
+
gitzone release check
|
|
300
|
+
|
|
296
301
|
# Release to configured targets
|
|
297
302
|
gitzone release
|
|
298
303
|
|
|
@@ -320,7 +325,7 @@ Release flags:
|
|
|
320
325
|
| `-t`, `--test` | Enable preflight tests |
|
|
321
326
|
| `-b`, `--build` | Enable the release build after local release metadata is created |
|
|
322
327
|
| `-p`, `--push` | Explicitly select the `git` target; combine with other target flags as needed |
|
|
323
|
-
| `--target <csv>` | Select `git`, `giteaAssets`, `npm`, and/or `docker`; npm cannot omit a configured enabled Gitea asset target
|
|
328
|
+
| `--target <csv>` | Select `git`, `giteaAssets`, `npm`, `cargo`, and/or `docker`; npm cannot omit a configured enabled Gitea asset target |
|
|
324
329
|
| `--npm` | Explicitly select the `npm` target; combine with other target flags as needed |
|
|
325
330
|
| `--docker` | Explicitly select digest-qualified Docker publication; requires project-local `@git.zone/tsdocker >= 3.5.1` with protocol v1 |
|
|
326
331
|
| `--no-publish` | Remove Gitea assets, npm and Docker from the resolved target set without implicitly enabling Git |
|
|
@@ -328,11 +333,53 @@ Release flags:
|
|
|
328
333
|
| `--merge` | Fast-forward and lease-push a cleanly rebased feature branch into `main`, then release from `main`; incompatible with Docker or Gitea assets |
|
|
329
334
|
| `--major`, `--minor`, `--patch` | Override inferred semver level; `release.versionFloor` still applies |
|
|
330
335
|
| `--plan` | Show the resolved workflow without fetching or mutating refs, files, the index, or worktrees |
|
|
336
|
+
| `check` | Build and pack HEAD of a clean tree in a disposable checkout, print the artifacts and every problem, and remove everything; see [Checking a release without publishing](#checking-a-release-without-publishing) |
|
|
331
337
|
| `inspect [version]` | Read one or all durable release journals; add `--json` for machine-readable output |
|
|
332
338
|
| `resume <version>` | Resume journaled Git, npm, qualification, promotion, or cleanup work; fresh-release overrides are rejected, and `--json` remains inspect-only |
|
|
333
339
|
| `--recover-attempt <id>` | Recover the exact 32-character lowercase hexadecimal `attempt.id` shown by `inspect --json`, after independently proving its publisher stopped |
|
|
334
340
|
| `--detach` | With `-y`, run a release or `resume` in its own session after the foreground checks; see [Running a release detached](#running-a-release-detached) |
|
|
335
341
|
|
|
342
|
+
### Checking a release without publishing
|
|
343
|
+
|
|
344
|
+
`gitzone release check` runs the build and pack half of a release on HEAD and
|
|
345
|
+
creates nothing:
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
gitzone release check
|
|
349
|
+
gitzone release check --json
|
|
350
|
+
gitzone release check --target cargo --no-build
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
It needs a clean working tree, because a release packs only committed files,
|
|
354
|
+
and a version source the release accepts: a project that `gitzone release
|
|
355
|
+
--plan` refuses for its version source (a `Cargo.toml` without
|
|
356
|
+
`projectType: "rust"`, a Rust workspace outside the repository root,
|
|
357
|
+
independent crate versions) is reported with the plan's message before
|
|
358
|
+
anything is checked out. It checks out HEAD into a disposable detached worktree exactly as a release
|
|
359
|
+
checks out its release commit (`pnpm install --frozen-lockfile` when the commit
|
|
360
|
+
carries a `package.json`, `cargo fetch --locked` in a Rust project), runs the
|
|
361
|
+
configured release build there, and then, for the active targets:
|
|
362
|
+
|
|
363
|
+
- **npm:** packs every named tspublish module and the public root package with
|
|
364
|
+
the qualified pnpm, runs the release's tarball checks (entry points and the
|
|
365
|
+
configured `maxPublishBytes`), and lists every packed file.
|
|
366
|
+
- **cargo:** reads the workspace plan through `rsrepo engine plan`, prints the
|
|
367
|
+
same plan lines as `gitzone release --plan` with every problem a release
|
|
368
|
+
would refuse, and packs the crates the release would publish through
|
|
369
|
+
`rsrepo engine package`, listing each crate's files and sha256. It probes no
|
|
370
|
+
registry.
|
|
371
|
+
|
|
372
|
+
Docker and Gitea assets are named as not checked: tSDocker qualifies images
|
|
373
|
+
and the asset manifest is frozen only during a release. The checkout and every
|
|
374
|
+
artifact are removed afterwards, also after a failure. The check never changes
|
|
375
|
+
the version, commits, tags, writes a journal or publishes, and it takes no
|
|
376
|
+
`--plan`, `--merge` or `--detach`. Targets and the build resolve as for
|
|
377
|
+
`gitzone release --plan`, so `--target`, `--cargo`, `--npm` and `--no-build`
|
|
378
|
+
apply. It exits 1 when it finds a problem, such as a dirty tree, a failed
|
|
379
|
+
install or build, a tarball check, a blocking crate problem or a failed
|
|
380
|
+
package. `--json` prints the report (`ok`, `sourceOid`, `targets`, `build`,
|
|
381
|
+
`npm.packages`, `cargo.order`, `cargo.crates`, `notChecked`, `problems`).
|
|
382
|
+
|
|
336
383
|
### Version floor
|
|
337
384
|
|
|
338
385
|
`release.versionFloor` sets a minimum for the next release version. Use it when a repository must join a common version line, for example when every serve.zone package moves to major 32:
|
|
@@ -679,7 +726,7 @@ The pnpm release tests cover known command dialects and dynamic version qualific
|
|
|
679
726
|
and qualify actual packaging and script-free tarball publication with the active
|
|
680
727
|
version. Run `testUnit` with each maturity-eligible standalone version and a matching
|
|
681
728
|
project pin in an isolated checkout. For a focused matrix, invoke the project-local
|
|
682
|
-
`
|
|
729
|
+
`tsrepo test` on `test/test.pnpmrelease.node.ts` from a disposable directory whose
|
|
683
730
|
`package.json` pins that row. Do not wrap these invocations in another `pnpm with`:
|
|
684
731
|
pnpm rejects nested use. Keep the normal release-age policy for every row.
|
|
685
732
|
|
|
@@ -890,7 +937,10 @@ configuration:
|
|
|
890
937
|
dependency and `order` sequence;
|
|
891
938
|
- then the root package, unless `package.json` sets `"private": true`. A
|
|
892
939
|
private root manifest stays the shared version and dependency catalog, and
|
|
893
|
-
only its modules publish.
|
|
940
|
+
only its modules publish. `gitzone format` adds `"private": true` to a
|
|
941
|
+
`package.json` without `private` only when npm is not a release target;
|
|
942
|
+
with an npm target the choice stays yours, so formatting never stops the
|
|
943
|
+
root package from publishing.
|
|
894
944
|
|
|
895
945
|
Descriptors without a `name` stay build-order-only folders for TsBuild. Every
|
|
896
946
|
named module must declare `"registries": ["useBase"]`: GitZone publishes it to
|
|
@@ -970,6 +1020,132 @@ runs the standalone `tspublish` publisher (without the `plan` or `prepare`
|
|
|
970
1020
|
subcommand) fails every release and resume that publishes npm packages, because
|
|
971
1021
|
it would upload different bytes for the same version outside the journal.
|
|
972
1022
|
|
|
1023
|
+
### Rust workspaces and the cargo target
|
|
1024
|
+
|
|
1025
|
+
A pure Rust repository sets `"projectType": "rust"` under `@git.zone/cli` in
|
|
1026
|
+
`.smartconfig.json`. Its root Cargo workspace carries the version; the
|
|
1027
|
+
repository never needs or gets a `package.json`, and its default test and build
|
|
1028
|
+
commands are `rsrepo test` and `rsrepo build`. Only TypeScript projects get a
|
|
1029
|
+
baked `00_commitinfo_data.ts`.
|
|
1030
|
+
|
|
1031
|
+
Every release reads and writes the version through one version source:
|
|
1032
|
+
|
|
1033
|
+
| Version source | Project | What the release versions |
|
|
1034
|
+
| --- | --- | --- |
|
|
1035
|
+
| `npm` | a TypeScript project | `package.json` |
|
|
1036
|
+
| `npm+internal-rust` | a TypeScript project with an internal `rust/` or `ts_rust/` Cargo workspace | `package.json` only; the internal crates keep their own versions |
|
|
1037
|
+
| `cargo` | `projectType: "rust"` | `[workspace.package].version` (or the single package's version) and every internal path dependency's `version` requirement, through `rsrepo engine set-version`, which also updates `Cargo.lock` offline |
|
|
1038
|
+
|
|
1039
|
+
A workspace whose crates carry independent versions is refused: gitzone
|
|
1040
|
+
releases one shared version. Every Cargo operation runs through the rsrepo
|
|
1041
|
+
release engine (protocol version 1). gitzone uses the project's
|
|
1042
|
+
`node_modules/.bin/rsrepo` when `package.json` declares `@git.zone/rsrepo`
|
|
1043
|
+
(a declared but missing install is an error), and otherwise `rsrepo` on PATH.
|
|
1044
|
+
gitzone has no dependency on rsrepo; it checks the protocol version and the
|
|
1045
|
+
engine commands before use.
|
|
1046
|
+
|
|
1047
|
+
The release checkout of a Rust project needs a committed `Cargo.lock`. It runs
|
|
1048
|
+
`cargo fetch --locked` and installs npm dependencies only when the release
|
|
1049
|
+
commit carries a `package.json`.
|
|
1050
|
+
|
|
1051
|
+
Crates publish only through the `cargo` target. Without one, a release tags
|
|
1052
|
+
and pushes the workspace but publishes no crate:
|
|
1053
|
+
|
|
1054
|
+
```json
|
|
1055
|
+
{
|
|
1056
|
+
"@git.zone/cli": {
|
|
1057
|
+
"projectType": "rust",
|
|
1058
|
+
"release": {
|
|
1059
|
+
"targets": {
|
|
1060
|
+
"git": { "enabled": true, "remote": "origin" },
|
|
1061
|
+
"cargo": {
|
|
1062
|
+
"registries": ["crates-io"],
|
|
1063
|
+
"members": ["mycrate-core", "mycrate"],
|
|
1064
|
+
"verificationWindowMinutes": 15
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
```
|
|
1071
|
+
|
|
1072
|
+
- `registries` names `crates-io` or registries defined in cargo config.
|
|
1073
|
+
Credentials stay with cargo; gitzone and rsrepo never read them.
|
|
1074
|
+
- `members` is optional. Without it, the release publishes every member whose
|
|
1075
|
+
Cargo `publish` field allows every listed registry.
|
|
1076
|
+
- `verificationWindowMinutes` (1 to 720, default 15) is how long the release
|
|
1077
|
+
waits for an accepted crate to appear in the registry index.
|
|
1078
|
+
- `enabled: false` turns the target off; `--cargo` or `--target cargo` selects
|
|
1079
|
+
it for one release.
|
|
1080
|
+
|
|
1081
|
+
The cargo target needs `projectType: "rust"`, and a Rust project refuses the
|
|
1082
|
+
npm target, because it has no `package.json` version to publish. Docker and
|
|
1083
|
+
Gitea assets cannot join a cargo release yet.
|
|
1084
|
+
|
|
1085
|
+
A cargo release then works like this:
|
|
1086
|
+
|
|
1087
|
+
1. Before it creates anything, it reads the workspace plan from
|
|
1088
|
+
`rsrepo engine plan` and refuses the release on a missing `Cargo.lock`,
|
|
1089
|
+
independent versions, an unknown `members` entry, no publishable member, a
|
|
1090
|
+
blocking problem on a published crate (such as a missing license or
|
|
1091
|
+
description, a path dependency without a version, a wildcard dependency, or
|
|
1092
|
+
a dependency that cannot be published), and a published crate whose
|
|
1093
|
+
dependency the release does not publish. Because the release moves every
|
|
1094
|
+
internal requirement to the new version, such a dependency would have no
|
|
1095
|
+
matching version in the registry. Each crate's new version must also be
|
|
1096
|
+
absent from every registry (step `preflight.cargoRegistries`).
|
|
1097
|
+
2. After the release commit, it packs the published crates in the release
|
|
1098
|
+
checkout through `rsrepo engine package` and stores each one in the journal
|
|
1099
|
+
as `crate.<sha256(name)>.crate` (step `core.packageCrates`). The cargo cells
|
|
1100
|
+
are an optional `cargo` section of journal schema 1 or 3, one cell per
|
|
1101
|
+
registry and crate.
|
|
1102
|
+
3. After Git is verified, it publishes the crates dependencies first through
|
|
1103
|
+
`rsrepo engine publish` (`cargo publish --locked --no-verify`), from a fresh
|
|
1104
|
+
checkout of the release commit. A crate is published to a registry only
|
|
1105
|
+
after its dependencies are verified there, because crates.io refuses a crate
|
|
1106
|
+
whose dependency version it has not indexed yet. The release probes the
|
|
1107
|
+
sparse index from 2 s, doubling up to 20 s between probes, within the
|
|
1108
|
+
verification window.
|
|
1109
|
+
4. A crate whose index entry carries the packed sha256 is `verified`. An
|
|
1110
|
+
accepted crate is never uploaded again; a crate still unindexed after its
|
|
1111
|
+
window stops the run, and `gitzone release resume <version> -y` probes it
|
|
1112
|
+
later, skips verified crates and publishes the rest. A registry that serves
|
|
1113
|
+
other bytes for the version becomes a terminal `conflict`, because a
|
|
1114
|
+
published crate version is immutable.
|
|
1115
|
+
|
|
1116
|
+
`gitzone release --plan` prints the registries, the publication order, the
|
|
1117
|
+
members it does not publish and every problem the engine reports. When a
|
|
1118
|
+
problem would make the release refuse (step 1 above), the plan ends with
|
|
1119
|
+
`The release would be refused: <n> blocking cargo problem(s), listed above.`
|
|
1120
|
+
and exits 1, as it does for its other refusals:
|
|
1121
|
+
|
|
1122
|
+
```text
|
|
1123
|
+
targets: git, cargo
|
|
1124
|
+
version: 0.3.0 -> 0.4.0
|
|
1125
|
+
cargo registries: crates-io
|
|
1126
|
+
cargo workspace: /work/fx (workspace version 0.3.0, Cargo.lock tracked)
|
|
1127
|
+
cargo publication order: fx-core -> fx-util -> fx-cli
|
|
1128
|
+
cargo index wait: 15 min per accepted crate
|
|
1129
|
+
cargo member fx-internal: not published (publish = false)
|
|
1130
|
+
cargo member fx-internal: problem publish-disabled: fx-internal sets publish = false and is never published
|
|
1131
|
+
```
|
|
1132
|
+
|
|
1133
|
+
`gitzone release check` packs the same crates without publishing anything (see
|
|
1134
|
+
[Checking a release without publishing](#checking-a-release-without-publishing)).
|
|
1135
|
+
|
|
1136
|
+
`gitzone template rust` scaffolds such a repository: a root virtual workspace
|
|
1137
|
+
whose `[workspace.package]` carries the version, edition (2024), license (MIT)
|
|
1138
|
+
and repository, one library crate in `crates/<name>/` that inherits them, the
|
|
1139
|
+
`Cargo.lock` that `cargo generate-lockfile` writes, a `.smartconfig.json` with
|
|
1140
|
+
`projectType: "rust"`, the Git target and a disabled cargo target, Gitea
|
|
1141
|
+
workflows that run `rsrepo check`, a readme and `license.md`. `gitzone format`
|
|
1142
|
+
treats a Rust project as described in [Formatting](#formatting).
|
|
1143
|
+
|
|
1144
|
+
Limits of this version: one release cannot version both `package.json` and a
|
|
1145
|
+
Cargo workspace, `gitzone release recover` refuses a cargo project (a cargo
|
|
1146
|
+
release always records its intent, so `gitzone release resume` continues it),
|
|
1147
|
+
and an older gitzone that does not know the `cargo` target ignores it.
|
|
1148
|
+
|
|
973
1149
|
### Gitea release attachments before npm
|
|
974
1150
|
|
|
975
1151
|
Enable `release.targets.giteaAssets` when public source archives, native executables,
|
|
@@ -1232,7 +1408,7 @@ gitzone release resume 6.0.0 -y
|
|
|
1232
1408
|
gitzone release resume 6.0.0 -y --recover-attempt="$ATTEMPT_ID"
|
|
1233
1409
|
```
|
|
1234
1410
|
|
|
1235
|
-
Resume requires the annotated release tag and each journaled destination setting to remain exact; the local `main` commit must be exact for any remaining publication work and must merely contain the release commit for a verification-only resume. The Git remote must still match when Git is journaled; npm registry, access, and already-published settings must still match when npm is journaled. Before any recovery or publication work, a nonterminal schema-2 resume canonical-compares the current Docker request with the journal, verifies every required project-local tSDocker protocol capability, and validates the journaled request; additive future capabilities are accepted. A completed schema-2 journal trusts its terminal cleanup evidence and does not require candidate state or current Docker configuration. Non-journaled target configuration is ignored, so releases created with a target subset remain resumable. Fresh-release overrides such as targets, integration, build, test, and version flags are rejected even in negated forms such as `--no-git`, `--no-publish`, and `--no-build`; JSON output is available only through `inspect --json` and `
|
|
1411
|
+
Resume requires the annotated release tag and each journaled destination setting to remain exact; the local `main` commit must be exact for any remaining publication work and must merely contain the release commit for a verification-only resume. The Git remote must still match when Git is journaled; npm registry, access, and already-published settings must still match when npm is journaled. Before any recovery or publication work, a nonterminal schema-2 resume canonical-compares the current Docker request with the journal, verifies every required project-local tSDocker protocol capability, and validates the journaled request; additive future capabilities are accepted. A completed schema-2 journal trusts its terminal cleanup evidence and does not require candidate state or current Docker configuration. Non-journaled target configuration is ignored, so releases created with a target subset remain resumable. Fresh-release overrides such as targets, integration, build, test, and version flags are rejected even in negated forms such as `--no-git`, `--no-publish`, and `--no-build`; JSON output is available only through `inspect --json`, `prune --json` and `check --json`.
|
|
1236
1412
|
|
|
1237
1413
|
Resume probes remotely observable targets before acting. A published Git release is identified by its annotated tag and that tag's commit, so remote `main` carrying later commits is exact state rather than a conflict. Exact state is accepted without republishing; positive byte, metadata, ref, or digest conflicts fail closed, while inconclusive results do not overwrite a previously verified state. An npm target in `accepted` state is only ever verified: its bytes are never sent again, and a resume that still cannot read the version leaves it accepted and succeeds. A Git, npm, Docker qualification, promotion, or cleanup target left in `publishing` state retains authority until the exact recorded 32-character lowercase hexadecimal `attempt.id` is supplied after independently proving its publisher stopped. An interrupted tSDocker `preparing` record has no qualification evidence and cannot be promoted; when tSDocker reports `RECOVERY_REQUIRED`, the exact recovered qualification owner removes only that incomplete deterministic preparation before claiming a fresh qualification attempt. Promotion recovery first reclaims the retired owner's request files and probes the journaled destination; an exact qualified digest is accepted, pending state retires the old attempt and claims a fresh owner before retry, an inconclusive probe retains the old journal owner, and conflicts halt permanently. Final cleanup of a qualified candidate starts only after every promotion is verified and is itself idempotently recoverable. A terminal qualification destination conflict has no promotions, blocks Git/npm, and permits only exact qualified-candidate cleanup.
|
|
1238
1414
|
|
|
@@ -1575,6 +1751,28 @@ gitzone config migrate 2
|
|
|
1575
1751
|
|
|
1576
1752
|
`@ship.zone/szci` belongs to szci, which GitZone no longer uses or reads. `gitzone config migrate` and `gitzone format` remove only an empty `npmGlobalTools` list, szci's default, and delete a block left empty; every other key stays. szci still reads two keys, and no migration deletes or moves them. `npmRegistryUrl` is the registry `szci npm prepare` installs from, for example in a Dockerfile that installs private packages. It is not a publish registry, even when `release.targets.npm.registries` lists the same URL, so no migration, the one from schema 1 included, moves or copies it into the publish registries: a registry list alone enables the npm target. `npmAccessLevel` is the access level `szci git mirror` checks. GitZone publishes with `release.targets.npm.accessLevel`, so the migration copies `npmAccessLevel` there when that key is absent and keeps it in the block: the duplicate is deliberate. `gitzone config doctor` names the current home of each kept key GitZone once read, for example `@git.zone/tsdocker.registryRepoMap` for `dockerRegistryRepoMap` and `@git.zone/tsdocker.buildArgEnvMap` for `dockerBuildargEnvMap`, and reports `npmRegistryUrl` and `npmAccessLevel` as szci's own. A block that holds only these two keys needs no step once `release.targets.npm.accessLevel` is set.
|
|
1577
1753
|
|
|
1754
|
+
`gitzone config doctor` also reports unknown `release.targets.*` keys, which a
|
|
1755
|
+
release ignores, validates `release.targets.cargo`, and checks the sections of
|
|
1756
|
+
the consolidated build tools:
|
|
1757
|
+
|
|
1758
|
+
- `@git.zone/tsrepo` takes the subsections `build`, `test`, `bundle`, `docs`,
|
|
1759
|
+
`watch` and `sea`, each shaped like the section of the single tool it
|
|
1760
|
+
replaces (`@git.zone/tstest`, `@git.zone/tsbundle`, `@git.zone/tsdoc`,
|
|
1761
|
+
`@git.zone/tswatch`, `@git.zone/tssea`; `build` has none). A subsection beside
|
|
1762
|
+
its legacy section is an error: tsrepo never merges the two. A tsrepo section
|
|
1763
|
+
in a project whose `package.json` does not declare `@git.zone/tsrepo` is a
|
|
1764
|
+
warning, because the single tools do not read it.
|
|
1765
|
+
- `@git.zone/rsrepo` takes the tsrust fields (`targets`, `targetsByHost`,
|
|
1766
|
+
`locked`, `static`, `rustflags`, `targetDir`, `pruneAfterBuild`, `matrix`,
|
|
1767
|
+
`notices`) plus `features`, `toolchains` and `members`. Keeping it beside the
|
|
1768
|
+
legacy `@git.zone/tsrust` section is an error.
|
|
1769
|
+
|
|
1770
|
+
`gitzone config fix` moves the legacy tool sections into their
|
|
1771
|
+
`@git.zone/tsrepo` subsections, but only when `package.json` declares
|
|
1772
|
+
`@git.zone/tsrepo` (as a dependency or devDependency), because older tools do
|
|
1773
|
+
not read the new key. A legacy section whose subsection already exists stays
|
|
1774
|
+
where it is, and the fix names it so you can merge the two by hand.
|
|
1775
|
+
|
|
1578
1776
|
### Package contents
|
|
1579
1777
|
|
|
1580
1778
|
`gitzone format` writes the `files` list of `package.json`, and nothing else
|
|
@@ -1646,7 +1844,7 @@ Then fix the package and release again. `gitzone config doctor` validates
|
|
|
1646
1844
|
|
|
1647
1845
|
### Managed Assets
|
|
1648
1846
|
|
|
1649
|
-
Projects can opt into generated, updateable repository assets through `@git.zone/cli.assets`. The kind `binaryCli` manages installer scripts, npm binary wrappers, postinstall downloaders, and Gitea release workflows for CLI executables that [`@git.zone/
|
|
1847
|
+
Projects can opt into generated, updateable repository assets through `@git.zone/cli.assets`. The kind `binaryCli` manages installer scripts, npm binary wrappers, postinstall downloaders, and Gitea release workflows for CLI executables that `tsrepo sea` from [`@git.zone/tsrepo`](https://code.foss.global/git.zone/tsrepo) builds as Node.js single executable applications.
|
|
1650
1848
|
|
|
1651
1849
|
```json
|
|
1652
1850
|
{
|
|
@@ -1659,8 +1857,7 @@ Projects can opt into generated, updateable repository assets through `@git.zone
|
|
|
1659
1857
|
"displayName": "Onebox",
|
|
1660
1858
|
"repository": {
|
|
1661
1859
|
"host": "code.foss.global",
|
|
1662
|
-
"path": "serve.zone/onebox"
|
|
1663
|
-
"branch": "main"
|
|
1860
|
+
"path": "serve.zone/onebox"
|
|
1664
1861
|
},
|
|
1665
1862
|
"installer": {
|
|
1666
1863
|
"enabled": true,
|
|
@@ -1705,11 +1902,13 @@ Projects can opt into generated, updateable repository assets through `@git.zone
|
|
|
1705
1902
|
}
|
|
1706
1903
|
```
|
|
1707
1904
|
|
|
1708
|
-
The executables come from the project's
|
|
1905
|
+
The executables come from the project's SEA configuration; GitZone keeps no target list of its own. The project declares `@git.zone/tsrepo` ^1.0.0 in `dependencies` or `devDependencies` and has it installed (`pnpm install --save-dev @git.zone/tsrepo`, then `pnpm install`); GitZone reads the configuration through `@git.zone/tsrepo/sea/config` from the project's own install, so the project's tsrepo version interprets its own configuration and GitZone has no runtime dependency on it. tsrepo's configuration rule applies: `@git.zone/tsrepo.sea`, else the legacy `@git.zone/tssea` section, and both at once is an error. A project still on the deprecated `@git.zone/tssea` (^1.1.0, without tsrepo) is read through `@git.zone/tssea/config`; it must move to tsrepo as the tsrepo readme's "Migrating from the single tools" describes, or set `releaseWorkflow.compileCommand` to its tssea build, because the default `compileCommand` runs tsrepo; `gitzone format` and `gitzone config doctor` say which step is missing, and they refuse an installed tssea outside ^1.1.0 and an `outDir` outside the project.
|
|
1709
1906
|
|
|
1710
|
-
- **Asset names:** each target's `name` is the executable's file name and its release asset name, used exactly as given. A Windows name carries its `.exe`. The installer maps `uname` to `linux
|
|
1711
|
-
- **
|
|
1712
|
-
- **
|
|
1907
|
+
- **Asset names:** each target's `name` is the executable's file name and its release asset name, used exactly as given. A Windows name carries its `.exe`. The installer maps `uname` to `linux` or `macos` and `x64` or `arm64`; the npm wrapper maps `process.platform:process.arch`; both download `releases/download/<version>/<name>`.
|
|
1908
|
+
- **Windows:** `install.sh` installs on Linux and macOS only. Under Git Bash, MSYS2 or Cygwin it stops before any download, also with `--dry-run`, and names the release's Windows executables (`releases/download/<version or latest>/<name>`) and `SHA256SUMS.txt` to check them against: there it has no root user for its `sudo bash` usage, no systemd, and its `binDir` lies inside the Git installation, outside the Windows `PATH`. The npm wrapper does install on Windows.
|
|
1909
|
+
- **Runtime dependencies:** the executables carry the bundled application, and the npm wrapper and postinstall use Node.js built-ins only, so neither needs the project's `dependencies`. npm and pnpm still install every package listed there for each user of the npm package. Keep packages that are only bundled into the executable in `devDependencies`; `releaseWorkflow.installCommand` installs both, so the build is unaffected. GitZone does not move them for you.
|
|
1910
|
+
- **Release workflow:** `releaseWorkflow.installCommand` (default `pnpm install --frozen-lockfile --ignore-scripts`) installs the dependencies and `releaseWorkflow.compileCommand` (default `pnpm exec tsrepo bundle && pnpm exec tsrepo sea build`, the `@git.zone/tsrepo` bundle and SEA build) builds; set either when the project needs another command, for example `pnpm exec tsbundle && pnpm exec tssea build` in a project not yet moved from tsbundle and tssea to tsrepo. The workflow sets up Node.js 22, the runtime of its tooling (`tsrepo sea` runs on Node.js 22 or later and builds and smoke-runs every executable with the `nodeVersion` it pins, never with the Node.js that runs it; a `compileCommand` that runs the project's own code runs it on Node.js 22), installs dependencies, checks that the `package.json` version equals the tag, builds, and then checksums and uploads exactly the configured executables, the notice files `tsrepo sea` writes next to each, the staged installer (when the installer is enabled), the extra release assets and `SHA256SUMS.txt`. A missing file or a Gitea API error fails the job, and nothing else in the output directory is uploaded. A published asset is never replaced: when the release already has an asset of the same name, the job fails before uploading anything and names each such asset; delete them in Gitea before rerunning. An asset list that is not a JSON array of named assets fails the job as well, never counting as "no such asset". With `packNpmArtifact` it also packs and uploads the npm tarball.
|
|
1911
|
+
- **Extra release assets:** `releaseWorkflow.extraAssets` lists further repository files the release publishes, such as an uninstaller or the changelog: exact `/`-separated paths whose segments consist of letters, digits, `.`, `_` and `-` and start with a letter or digit (no globs, no `..`, no leading `/` or `./`, no backslash). Each file is published under its last path segment, which must differ from every other release asset (the executables, their notice files, the name of an enabled installer, `SHA256SUMS.txt`, and with `packNpmArtifact` any `.tgz` name); a path inside the tssea output directory is refused, since extras are repository files, not build outputs. After the build and before the release is created, the workflow checks that every extra is a regular file whose real path lies inside the checkout, then stages them; any failure ends the job with no release and no upload. Extras are listed in `SHA256SUMS.txt` and uploaded like every other asset. `installer.extraFiles` names the extras (by asset name) that `install.sh` installs into `installDir` beside the executable; each must be tracked by Git, and the installer applies the file's mode from the Git index (`100755` installs as `0755`, everything else as `0644`), so a committed mode change shows as asset drift in `gitzone format check`. A name must not be the executable's file name (`binary.installFileName`, default `cliName`). Only `install.sh` installs extras, in binary and in source mode; the npm postinstall installs none, so a program that uses such a file must cope with its absence in an npm install.
|
|
1713
1912
|
- **Release notes:** the release description is the tag's section of `changelog.md`, the `## <date> - <version>` heading `gitzone release` writes, up to the next `## ` heading. Generic notes with the install command are used only when the changelog has no section for the version. The workflow extracts it with the managed `scripts/gitzone-binary-release.mjs`, which the release workflow template also writes.
|
|
1714
1913
|
- **Old releases:** `releaseWorkflow.keepReleases` (default 0) is how many published releases stay. With N above 0, the workflow deletes, after this release's assets are uploaded, every published Gitea release older than the newest N (by creation time) together with its assets. Tags are never deleted, drafts are neither counted nor deleted, and the release of the running tag always stays. 0 keeps every release; a value that is not a non-negative integer fails `gitzone format`. A Gitea API error fails the job.
|
|
1715
1914
|
- **npm postinstall:** with `npmWrapper.enabled`, the postinstall downloads `releases/download/v<version>/<name>` for the running platform, where `<version>` is the `version` in the package's own `package.json`. It runs only when the package is installed as a dependency, that is when its directory lies inside a `node_modules` directory (npm, pnpm, Yarn and Bun install every package, local or global, there). In the project's own checkout, for development or a release build, it skips the download, because that version is not released yet and the project builds its binaries itself. The release asset is the only source, and it is verified like the installer does: the postinstall reads the release's `SHA256SUMS.txt`, downloads the binary and its notice files next to the target, and moves them into place under their release asset names only when every SHA-256 matches; a mismatch, a missing entry, a missing file or missing checksums fail and install nothing. An existing binary is not downloaded again, but missing notice files are. It follows 301, 302, 303, 307 and 308 redirects (relative locations included) up to 10 hops and only to HTTPS, and gives up after 30 s without data or 15 minutes per file. Every failure stops the install with the URL, the version and the cause. The wrapper in `bin/` runs the binary as a child process and, on Linux and macOS, forwards SIGTERM and SIGHUP to it while it runs. SIGINT is forwarded only when the wrapper has no controlling terminal (opening `/dev/tty` fails with `ENXIO`: under `setsid`, `docker run` without `-t`, or a `detached: true` spawn). With a terminal, a Ctrl+C reaches the binary directly through the process group, so the wrapper ignores SIGINT until the binary ends; a parent's `child.kill('SIGINT')` on the wrapper is then ignored as well, because Node does not name the sender: send SIGTERM, or spawn the wrapper with `detached: true`. The wrapper passes on the binary's exit status, and when a signal ended the binary it ends with the same signal (or 128 + its number if Node ignores it). The wrapper is the entry point for `pnpm add -g` and `npx`; under systemd or another supervisor, point the service at the installed native binary instead. A wrapper run as a systemd main process should use `KillMode=mixed`: with the default `control-group`, systemd sends SIGTERM to the binary as well and the wrapper forwards another. For the same reason, signal the wrapper's pid, not its process group: without a terminal, a group-wide SIGINT (`tini -g`, `KillSignal=SIGINT`, `kill -INT -<pgid>`) also reaches the binary twice.
|
|
@@ -1726,11 +1925,13 @@ gitzone format --only assets --write --yes
|
|
|
1726
1925
|
|
|
1727
1926
|
If `npmWrapper.enabled` is set, `gitzone format --only packagejson --write` also keeps `package.json` `bin`, `scripts.postinstall`, and npm package `files` entries in sync.
|
|
1728
1927
|
|
|
1729
|
-
|
|
1928
|
+
The installer is published as a release asset only: the release workflow stages `install.sh` into the release artifact directory, lists it in `SHA256SUMS.txt` and uploads it with the executables. Its usage text shows `<repository>/releases/download/latest/install.sh` (Gitea, like GitHub, resolves `latest` to the newest published release; a pinned install adds `--version vX.Y.Z`), and the release notes show the release's own `releases/download/<tag>/install.sh`; Gitea serves both without an account, like the executables. No generated file points at a `raw/` or `src/` URL, which code.foss.global serves to signed-in users only. The release uploads the installer exactly when `installer.enabled` is not `false`. A repository that starts publishing the installer has no `latest/install.sh` until its next release uploads one; until then that URL answers 404. The whole script is one function that only its last line calls, so a download that ends early runs nothing.
|
|
1929
|
+
|
|
1930
|
+
GitZone 10 removed `installer.distribution`, `releaseWorkflow.includeInstallerAsset` and `repository.branch`. `gitzone format` (like `gitzone config migrate` and `gitzone config fix`) removes them from `.smartconfig.json` where removing them changes nothing: `repository.branch` always, since nothing reads it, `installer.distribution: "releaseAsset"`, and an `includeInstallerAsset` equal to whether the installer is enabled; an object left empty goes with them. Every other value fails `gitzone format` and `gitzone config doctor` with an error that names the step: `installer.distribution: "rawBranch"` (a `raw/branch/` URL) or another value, remove the key; `includeInstallerAsset: false` with an enabled installer, remove the key or disable the installer; `includeInstallerAsset: true` with a disabled installer, list the installer file in `releaseWorkflow.extraAssets` instead (a disabled installer's file name is free for an extra asset).
|
|
1730
1931
|
|
|
1731
1932
|
Set `installer.service.removeLegacyUnits` to a list of systemd unit names when an installer must disable and remove older service units during upgrades.
|
|
1732
1933
|
|
|
1733
|
-
`installer.versionSelection` lists the ways a user picks the version (default `["latest", "version"]`): with neither flag the installer takes the newest Gitea release, `--version vX.Y.Z` a given tag, and adding `"major"` enables `--major N`, the newest release of that major.
|
|
1934
|
+
`installer.versionSelection` lists the ways a user picks the version (default `["latest", "version"]`): with neither flag the installer takes the newest Gitea release, `--version vX.Y.Z` a given tag, and adding `"major"` enables `--major N` (`N` or `vN`, no leading zero), the newest release of that major. `--major` reads the releases API's list without drafts and pre-releases (`?draft=false&pre-release=false`), newest first, 50 per page, and takes the first tag that starts with `vN.` or `N.`; it reads at most 100 pages and fails when none matches. Without `"major"` the installer has no `--major` option.
|
|
1734
1935
|
|
|
1735
1936
|
A version is a SemVer 2.0 version with an optional `v` (`v1.2.3`, `1.2.3`, `v1.2.3-beta.1`, `1.2.3+build.5`); the installer adds the `v` of the release tag, so `--version 1.2.3` installs `v1.2.3`. `--version latest` is the same as no `--version`. The tag the releases API names for the newest release, or for `--major N`, must have the same form. Anything else fails before the installer builds a download URL. Every download uses `curl` with HTTPS only (also on redirects), at most 10 redirects, and the postinstall's limits: 30 s to connect or without data, 15 minutes per transfer. The npm postinstall likewise refuses a `package.json` version that is not SemVer.
|
|
1736
1937
|
|
|
@@ -1738,14 +1939,16 @@ A version is a SemVer 2.0 version with an optional `v` (`v1.2.3`, `1.2.3`, `v1.2
|
|
|
1738
1939
|
|
|
1739
1940
|
The installer installs and updates in this order, and an update that fails leaves the previous installation running:
|
|
1740
1941
|
|
|
1741
|
-
1. **Verify before touching anything.** In binary mode it downloads the platform's asset, the third-party notice files tssea wrote for it (`<name>.third-party-notices.txt` and `.json`, the target's `noticeFiles`) and `SHA256SUMS.txt` of the same release, refuses a file the release lacks or whose digest differs or is missing (with `sha256sum` or `shasum`; neither present is an error), and runs the new binary with `--version`. In source mode (`installer.modes.source`) it clones the tag and runs `commands` and `validate
|
|
1742
|
-
2. **Stop and move aside.** It stops the running `installer.service.detectNames` units and moves `installDir`
|
|
1942
|
+
1. **Verify before touching anything.** In binary mode it downloads the platform's asset, the third-party notice files tssea wrote for it (`<name>.third-party-notices.txt` and `.json`, the target's `noticeFiles`) and `SHA256SUMS.txt` of the same release, refuses a file the release lacks or whose digest differs or is missing (with `sha256sum` or `shasum`; neither present is an error), and runs the new binary with `--version`. In source mode (`installer.modes.source`) it clones the tag and runs `commands` and `validate`, each a shell command line run with `eval` exactly as written; the first that fails stops the installation. Any failure here exits non-zero with the running installation and service untouched.
|
|
1943
|
+
2. **Stop and move aside.** It stops the running `installer.service.detectNames` units and moves `installDir` into a new directory beside it, `installDir.previous.XXXXXX` (from `mktemp -d`); it never overwrites the old installation in place. A backup an interrupted earlier run left behind is never reused, merged into or deleted. Data under `installer.preservePaths` lives outside `installDir` and is not touched.
|
|
1743
1944
|
3. **Install and check.** It installs the binary with its notice files and `installer.extraFiles`, which keep their release asset names (or the source build, where every `executableFiles` entry must exist), into `installDir`, links it into `binDir`, creates `ensureDirs`, and runs the installed CLI with `--version`.
|
|
1744
|
-
4. **Restart.** If a service was running, it runs `installer.service.refreshCommand` (when set) and restarts `installer.service.restartName`.
|
|
1945
|
+
4. **Restart.** If a service was running, it runs `installer.service.refreshCommand` (when set) and restarts `installer.service.restartName`. The refresh command is a shell command line, written into the installer as one quoted word and run with `eval` in a subshell, with `binDir` first on `PATH` so a bare CLI name runs the CLI just installed, also when the installer's `PATH` lacks `binDir` (a `sudo` `secure_path` can leave it out) or names another copy first. It may use the installer's variables, such as `"$BIN_DIR/<cli>"`; its exit status, that of its last command, decides whether the update succeeded. `startHint` and `successHints` are printed exactly as written.
|
|
1745
1946
|
5. **Clean up.** Only after the restart succeeded it deletes the moved-aside installation.
|
|
1746
1947
|
|
|
1747
1948
|
If any step from 2 on fails, the installer removes the new files, moves the previous installation back, relinks it, restarts the service it stopped, and exits non-zero with the failed step and whether the previous state was fully restored. A failed first installation leaves nothing behind.
|
|
1748
1949
|
|
|
1950
|
+
The installer links the CLI into `binDir` only and never picks another directory. When the `PATH` it runs with (under `sudo`, root's `PATH`) finds no `<cliName>`, or finds another copy before `binDir/<cliName>`, it ends with a warning on stderr that names `binDir` or the other copy; the installation stands and the exit status stays 0.
|
|
1951
|
+
|
|
1749
1952
|
#### Migrating from `denoBinaryCli`
|
|
1750
1953
|
|
|
1751
1954
|
GitZone 9 refuses the removed keys with an error that names the replacement:
|
|
@@ -1757,8 +1960,8 @@ GitZone 9 refuses the removed keys with an error that names the replacement:
|
|
|
1757
1960
|
| `binary.targets`, `binary.outDir` | `@git.zone/tssea.targets`, `@git.zone/tssea.outDir` |
|
|
1758
1961
|
| `releaseWorkflow.assetGlobs`, `releaseWorkflow.include` | `releaseWorkflow.extraAssets` for further repository files (exact paths, no globs); the executables and their notice files are always released |
|
|
1759
1962
|
| `releaseAssets` | `releaseWorkflow` |
|
|
1760
|
-
| `rawBranch`, `repository.rawBranch` |
|
|
1761
|
-
| `installer.delivery` |
|
|
1963
|
+
| `rawBranch`, `repository.rawBranch` | none: the installer is a release asset; remove the key |
|
|
1964
|
+
| `installer.delivery` | none: the installer is a release asset; remove the key |
|
|
1762
1965
|
| `installer.defaultMode` | `installer.modes.default` |
|
|
1763
1966
|
| `installer.source` | `installer.modes.source` |
|
|
1764
1967
|
| `installer.modes.source.validateCommand` | `installer.modes.source.validate` |
|
|
@@ -1902,7 +2105,7 @@ gitzone format fix
|
|
|
1902
2105
|
|
|
1903
2106
|
Formatters include cleanup, smartconfig normalization, dependency license checks, package metadata normalization, template updates, `.gitignore`, TypeScript config, Prettier, README existence checks, and configured copy operations.
|
|
1904
2107
|
|
|
1905
|
-
The `packagejson` formatter writes the `files` list of `package.json`. It ships the `ts/` and `ts_web/` sources without their `tsconfig.json`:
|
|
2108
|
+
The `packagejson` formatter writes the `files` list of `package.json`. It ships the `ts/` and `ts_web/` sources without their `tsconfig.json`: `tsrepo build` (formerly `tsbuild`) reads a folder's compiler options from `<folder>/tsconfig.json`, which extends the root `tsconfig.json`, and the package does not ship the root file. The list therefore ends with `!ts/tsconfig.json` and `!ts_web/tsconfig.json`; pnpm 10 and 12 apply an exclusion only after the entries that include the file.
|
|
1906
2109
|
|
|
1907
2110
|
The owner npm scopes are an exported constant, so no repository keeps a hand-copied list:
|
|
1908
2111
|
|
|
@@ -1911,12 +2114,26 @@ import { ownerNpmScopes } from '@git.zone/cli';
|
|
|
1911
2114
|
// ownerNpmScopes: ['@api.global', '@apiclient.xyz', ..., '@push.rocks', '@serve.zone', ...]
|
|
1912
2115
|
```
|
|
1913
2116
|
|
|
1914
|
-
`--only`, `--skip` and `@git.zone/cli.format.modules.only`/`skip` accept the module names `cleanup`, `smartconfig`, `license`, `packagejson`, `templates`, `assets`, `gitignore`, `tsconfig`, `prettier`, `readme` and `
|
|
2117
|
+
`--only`, `--skip` and `@git.zone/cli.format.modules.only`/`skip` accept the module names `cleanup`, `smartconfig`, `license`, `packagejson`, `templates`, `assets`, `gitignore`, `tsconfig`, `prettier`, `readme`, `copy` and `rustfmt`; any other name is refused with that list. `gitzone format --write` writes nothing while the plan carries an error.
|
|
1915
2118
|
|
|
1916
|
-
The template formatter owns `.vscode/settings.json` and `.vscode/launch.json` in every project, and the Gitea workflows, CLI entry points and HTML entry files of the project types that declare them. Workflow and entry files are written from the template as a whole. The formatter never creates or changes a `Dockerfile` or `.dockerignore`: they describe the project's own image. `gitzone template service` and `gitzone template website` scaffold a first pnpm-based Dockerfile.
|
|
2119
|
+
The template formatter owns `.vscode/settings.json` and `.vscode/launch.json` in every project, and the Gitea workflows, CLI entry points and HTML entry files of the project types that declare them. Workflow and entry files are written from the template as a whole. The `html/index.html` of a website loads its fonts from `https://<module.assetbrokerUrl>/fonts/fonts.css` and links `https://<module.legalUrl>` and its `/privacy` page; a wcc project's page loads the same fonts. Both keys live under `@git.zone/cli.module` in `.smartconfig.json` and hold a host (`host[:port][/path]`, without `https://` or a trailing slash), for example `"assetbrokerUrl": "assetbroker.example.com"`. When a page needs a key that is missing, empty or not a host, the plan carries an error that names it, and the page is left alone. The formatter never creates or changes a `Dockerfile` or `.dockerignore`: they describe the project's own image. `gitzone template service` and `gitzone template website` scaffold a first pnpm-based Dockerfile.
|
|
1917
2120
|
|
|
1918
2121
|
The Gitea workflows verify and never publish. npm and wcc projects get `default_nottags.yaml` and `default_tags.yaml`, service and website projects `docker_nottags.yaml` and `docker_tags.yaml`. Each runs in `code.foss.global/host.today/ht-docker-node:latest`: a pinned checkout that keeps no credentials, then `pnpm --version`, `pnpm install --frozen-lockfile`, `pnpm build`, `pnpm test` and `pnpm audit --prod --audit-level=high --registry=https://registry.npmjs.org`. The audit fails the workflow when a production dependency has a high or critical advisory; development dependencies do not ship and are not audited. It asks registry.npmjs.org because a private registry may not serve the advisory endpoint, and it runs last, so a newly published advisory never hides a test result. pnpm 12 skips an advisory you have reviewed and accepted when `pnpm-workspace.yaml` lists its GHSA ID under `auditConfig.ignoreGhsas`. No setup action installs pnpm: the image's pnpm switches to the version that `package.json` pins in `packageManager`, pnpm 10 included, so the printed version is the one that installs, builds, tests and audits. The switch downloads that version from the npm registry, so the runner needs registry access, which the install needs anyway. They use no secrets and build no images; a tag workflow verifies the tagged commit, and `gitzone release` publishes packages and images. The two `.vscode` files are merged at the top level instead: every key the template declares is refreshed, and every other top-level key — an editor setting only your project has, such as `deno.enable` — is kept. Two limits follow from that. A key the template itself declares is taken as a whole, so an array such as `json.schemas` or `configurations` is replaced rather than unioned, and a merged file is re-serialized with two-space indentation, so a project that keeps its own key loses hand-made formatting in those two files. A `.vscode` file that is not valid JSON cannot be merged and is replaced by the template as a whole. That never happens silently: the plan line reads `Replace .vscode/settings.json: the current file is not valid JSON (…)` instead of the usual `Apply template …`, and the run prints a warning that keys only your project declares are lost. Both appear in `gitzone format`, `gitzone format check` and `gitzone format plan --json`, so you see them before confirming a write.
|
|
1919
2122
|
|
|
2123
|
+
A `projectType: "rust"` repository is formatted for Cargo:
|
|
2124
|
+
|
|
2125
|
+
- `rustfmt` runs `rsrepo fmt --check` (rsrepo resolved as for releases: the
|
|
2126
|
+
project's `node_modules/.bin/rsrepo` when `package.json` declares
|
|
2127
|
+
`@git.zone/rsrepo`, otherwise `rsrepo` on PATH) and plans each file rustfmt
|
|
2128
|
+
would change; `--write` runs `rsrepo fmt` once. A failing check without a
|
|
2129
|
+
formatting diff, such as a missing rustfmt or an unparsable file, is a plan
|
|
2130
|
+
error. Other project types skip the module.
|
|
2131
|
+
- The `.gitignore` standard also ignores Cargo's root `/target/`.
|
|
2132
|
+
- `license` reports an error when the repository root carries no license text
|
|
2133
|
+
(`license`, `license.md`, `LICENSE-MIT`, `COPYING` and the like, any case).
|
|
2134
|
+
- `packagejson` leaves a `package.json` alone, and `smartconfig` does not ask
|
|
2135
|
+
for `module.npmPackagename`.
|
|
2136
|
+
|
|
1920
2137
|
`gitzone format fix` intentionally lives outside the default format path. Normal format runs stay deterministic; the fix command uses opencode only after deterministic formatters have done what they can.
|
|
1921
2138
|
|
|
1922
2139
|
## Development Services
|
|
@@ -2481,9 +2698,10 @@ gitzone template npm
|
|
|
2481
2698
|
gitzone template service
|
|
2482
2699
|
gitzone template website
|
|
2483
2700
|
gitzone template wcc
|
|
2701
|
+
gitzone template rust
|
|
2484
2702
|
```
|
|
2485
2703
|
|
|
2486
|
-
Templates are rendered through SmartScaf and then can be normalized with `gitzone format`.
|
|
2704
|
+
Templates are rendered through SmartScaf and then can be normalized with `gitzone format`. The TypeScript templates (`npm`, `service`, `website`, `wcc`) develop with `@git.zone/tsrepo`: they declare it as their one development tool and call `tsrepo build`, `tsrepo test`, `tsrepo bundle`, `tsrepo watch` and `tsrepo docs` instead of tsbuild, tstest, tsbundle, tswatch and tsdoc (`tsrepo watch` asks for its preset, such as `website` or `element`, on the first run and stores it in `.smartconfig.json`); test files import `tap` from `@git.zone/tsrepo/tapbundle`, and a scaffolded `cli.ts.js` runs through `@git.zone/tsrepo/run`. The `rust` template scaffolds a Cargo workspace for `@git.zone/rsrepo` and gitzone releases; see [Rust workspaces and the cargo target](#rust-workspaces-and-the-cargo-target). It runs `cargo generate-lockfile` after writing the files, so commit the resulting `Cargo.lock`.
|
|
2487
2705
|
|
|
2488
2706
|
## Meta Repositories
|
|
2489
2707
|
|
|
@@ -2565,7 +2783,7 @@ deprecations are not submitted again. `--json` prints the plan without changing
|
|
|
2565
2783
|
## Developing GitZone
|
|
2566
2784
|
|
|
2567
2785
|
From this repository, `cli.ts.js` runs the TypeScript sources through the
|
|
2568
|
-
project's `@git.zone/
|
|
2786
|
+
project's `@git.zone/tsrepo/run`. `cli.js` runs the built `dist_ts` output. Child
|
|
2569
2787
|
GitZone processes retain the same entry point as their parent.
|
|
2570
2788
|
|
|
2571
2789
|
After committing and verifying a CLI correction on clean, integrated `main`,
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@git.zone/cli',
|
|
6
|
-
version: '
|
|
6
|
+
version: '11.0.0',
|
|
7
7
|
description: 'A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.'
|
|
8
8
|
}
|
|
@@ -2,7 +2,16 @@ import * as plugins from './plugins.js';
|
|
|
2
2
|
import * as paths from './paths.js';
|
|
3
3
|
import type { IPackageFilesConfig } from './helpers.packagefiles.js';
|
|
4
4
|
|
|
5
|
-
export type TGitzoneProjectType = 'npm' | 'service' | 'wcc' | 'website';
|
|
5
|
+
export type TGitzoneProjectType = 'npm' | 'service' | 'wcc' | 'website' | 'rust';
|
|
6
|
+
|
|
7
|
+
/** Every project type, in the order prompts offer them. */
|
|
8
|
+
export const gitzoneProjectTypes: readonly TGitzoneProjectType[] = [
|
|
9
|
+
'npm',
|
|
10
|
+
'service',
|
|
11
|
+
'wcc',
|
|
12
|
+
'website',
|
|
13
|
+
'rust',
|
|
14
|
+
];
|
|
6
15
|
|
|
7
16
|
/**
|
|
8
17
|
* type of the actual gitzone data
|