@git.zone/cli 7.2.7 → 7.3.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/assets/templates/npm/.package.json +1 -1
- package/assets/templates/service/.package.json +1 -1
- package/assets/templates/wcc/.package.json +1 -1
- package/assets/templates/website/.package.json +1 -1
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/helpers.climode.js +2 -1
- package/dist_ts/mod_release/classes.detachedrelease.d.ts +85 -0
- package/dist_ts/mod_release/classes.detachedrelease.js +506 -0
- package/dist_ts/mod_release/index.js +92 -3
- package/dist_ts/mod_services/classes.interprocesslock.d.ts +12 -0
- package/dist_ts/mod_services/classes.interprocesslock.js +35 -12
- package/dist_ts/paths.d.ts +6 -0
- package/dist_ts/paths.js +7 -1
- package/package.json +4 -4
- package/readme.md +78 -0
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/helpers.climode.ts +1 -0
- package/ts/mod_release/classes.detachedrelease.ts +655 -0
- package/ts/mod_release/index.ts +114 -2
- package/ts/mod_services/classes.interprocesslock.ts +44 -15
- package/ts/paths.ts +10 -0
package/dist_ts/paths.d.ts
CHANGED
|
@@ -2,3 +2,9 @@ export declare let packageDir: string;
|
|
|
2
2
|
export declare let assetsDir: string;
|
|
3
3
|
export declare let templatesDir: string;
|
|
4
4
|
export declare let cwd: string;
|
|
5
|
+
/**
|
|
6
|
+
* The executable that runs this build of gitzone: `cli.js` loads `dist_ts`, and
|
|
7
|
+
* `cli.ts.js` runs the TypeScript sources through tsrun. A process that starts
|
|
8
|
+
* another gitzone process uses it, so both run the same code.
|
|
9
|
+
*/
|
|
10
|
+
export declare let cliEntryPath: string;
|
package/dist_ts/paths.js
CHANGED
|
@@ -3,4 +3,10 @@ export let packageDir = plugins.path.join(plugins.smartpath.get.dirnameFromImpor
|
|
|
3
3
|
export let assetsDir = plugins.path.join(packageDir, './assets');
|
|
4
4
|
export let templatesDir = plugins.path.join(assetsDir, 'templates');
|
|
5
5
|
export let cwd = process.cwd();
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The executable that runs this build of gitzone: `cli.js` loads `dist_ts`, and
|
|
8
|
+
* `cli.ts.js` runs the TypeScript sources through tsrun. A process that starts
|
|
9
|
+
* another gitzone process uses it, so both run the same code.
|
|
10
|
+
*/
|
|
11
|
+
export let cliEntryPath = plugins.path.join(packageDir, import.meta.url.endsWith('.ts') ? 'cli.ts.js' : 'cli.js');
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF0aHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9wYXRocy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGNBQWMsQ0FBQztBQUV4QyxNQUFNLENBQUMsSUFBSSxVQUFVLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQ3ZDLE9BQU8sQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLHdCQUF3QixDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQy9ELEtBQUssQ0FDTixDQUFDO0FBQ0YsTUFBTSxDQUFDLElBQUksU0FBUyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxVQUFVLENBQUMsQ0FBQztBQUNqRSxNQUFNLENBQUMsSUFBSSxZQUFZLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLFdBQVcsQ0FBQyxDQUFDO0FBQ3BFLE1BQU0sQ0FBQyxJQUFJLEdBQUcsR0FBRyxPQUFPLENBQUMsR0FBRyxFQUFFLENBQUM7QUFFL0I7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxJQUFJLFlBQVksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FDekMsVUFBVSxFQUNWLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQ3pELENBQUMifQ==
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@git.zone/cli",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.3.0",
|
|
5
5
|
"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.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
|
7
7
|
"typings": "dist_ts/index.d.ts",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"@api.global/typedrequest": "^8.2.0",
|
|
43
43
|
"@git.zone/tsbuild": "^5.0.0",
|
|
44
44
|
"@git.zone/tspack": "^1.4.1",
|
|
45
|
-
"@git.zone/tsrun": "^3.0.
|
|
46
|
-
"@git.zone/tstest": "^6.3.
|
|
45
|
+
"@git.zone/tsrun": "^3.0.1",
|
|
46
|
+
"@git.zone/tstest": "^6.3.2",
|
|
47
47
|
"@types/node": "^26.6.2"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@aws-sdk/client-s3": "3.1095.0",
|
|
51
|
-
"@git.zone/tsdoc": "^2.2.
|
|
51
|
+
"@git.zone/tsdoc": "^2.2.2",
|
|
52
52
|
"@git.zone/tsdocker": "3.8.1",
|
|
53
53
|
"@git.zone/tspublish": "^2.0.1",
|
|
54
54
|
"@lossless.org/client": "1.5.1",
|
package/readme.md
CHANGED
|
@@ -300,6 +300,9 @@ gitzone release --no-publish
|
|
|
300
300
|
|
|
301
301
|
# Override inferred semver level
|
|
302
302
|
gitzone release --minor
|
|
303
|
+
|
|
304
|
+
# Run the release in its own session and return once it has started
|
|
305
|
+
gitzone release -y --detach
|
|
303
306
|
```
|
|
304
307
|
|
|
305
308
|
Release flags:
|
|
@@ -321,6 +324,7 @@ Release flags:
|
|
|
321
324
|
| `inspect [version]` | Read one or all durable release journals; add `--json` for machine-readable output |
|
|
322
325
|
| `resume <version>` | Resume journaled Git, npm, qualification, promotion, or cleanup work; fresh-release overrides are rejected, and `--json` remains inspect-only |
|
|
323
326
|
| `--recover-attempt <id>` | Recover the exact 32-character lowercase hexadecimal `attempt.id` shown by `inspect --json`, after independently proving its publisher stopped |
|
|
327
|
+
| `--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) |
|
|
324
328
|
|
|
325
329
|
### Version floor
|
|
326
330
|
|
|
@@ -785,6 +789,80 @@ deferred ancestry; execution fetches and verifies that history before writing th
|
|
|
785
789
|
preparation binding. Earlier version, changelog, commit or tag failures still
|
|
786
790
|
require explicit operator reconciliation.
|
|
787
791
|
|
|
792
|
+
### Running a release detached
|
|
793
|
+
|
|
794
|
+
A release runs its tests, build, push and every publication in one process,
|
|
795
|
+
which can take longer than the tool call or terminal that started it. With
|
|
796
|
+
`--detach`, `gitzone release -y` and `gitzone release resume <version> -y`
|
|
797
|
+
return once the release is running in a session of its own:
|
|
798
|
+
|
|
799
|
+
```bash
|
|
800
|
+
gitzone release -y --detach
|
|
801
|
+
gitzone release resume 6.0.0 -y --detach
|
|
802
|
+
```
|
|
803
|
+
|
|
804
|
+
In the foreground, `--detach` checks what `--plan` checks — arguments,
|
|
805
|
+
configuration, the release branch, a clean tree, the Git destination and the
|
|
806
|
+
version — plus pending changelog entries, or for `resume` the journal or
|
|
807
|
+
recorded intent of that version. It needs `-y` (or `release.confirmation:
|
|
808
|
+
"auto"` for a fresh release), because nothing can answer a prompt later, and it
|
|
809
|
+
cannot be combined with `--plan`. Any failure there exits non-zero and starts
|
|
810
|
+
nothing. Everything else — the pnpm and tSDocker capability checks, tests,
|
|
811
|
+
build, commit, tag and publication — runs in the detached release and appears
|
|
812
|
+
in its log and recorded outcome.
|
|
813
|
+
|
|
814
|
+
A fresh release prints its release plan there, as `--plan` does. The launcher
|
|
815
|
+
then starts a supervisor with `detached: true` — a new session and process
|
|
816
|
+
group without a controlling terminal, stdin `/dev/null` — and the supervisor
|
|
817
|
+
starts the release as its child with the same arguments minus `--detach`. Once
|
|
818
|
+
the supervisor reports the release running, the launcher prints one line and
|
|
819
|
+
exits 0:
|
|
820
|
+
|
|
821
|
+
```text
|
|
822
|
+
Release running detached: run <id>, process group <pid>, log <path>. Follow it with `tail -f <path>`; `gitzone release inspect` shows its outcome.
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
When the supervisor refuses to start the release, the launcher prints why and
|
|
826
|
+
exits 1. When the supervisor does not report within 60 seconds, the launcher
|
|
827
|
+
terminates its whole process group (`SIGTERM`, and `SIGKILL` after another 10
|
|
828
|
+
seconds), then exits 1 and says whether a release had started before it was
|
|
829
|
+
stopped; `gitzone release inspect` shows the outcome of such a run.
|
|
830
|
+
|
|
831
|
+
Everything lives beside the release journals:
|
|
832
|
+
|
|
833
|
+
```text
|
|
834
|
+
<git-common-dir>/gitzone/releases/v1/detached.lock held by the supervisor while the release runs
|
|
835
|
+
<git-common-dir>/gitzone/releases/v1/detached/<id>.json run record: command, version, pids, state, exit code or signal
|
|
836
|
+
<git-common-dir>/gitzone/releases/v1/detached/<id>.log stdout and stderr of the release
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
The supervisor records the run as `running`, and when the release ends, as
|
|
840
|
+
`succeeded` (exit code 0) or `failed` with its non-zero exit code or the signal
|
|
841
|
+
that killed it, and appends `Detached release finished: …` to the log. A crash
|
|
842
|
+
or kill of the release is recorded the same way. From the moment it holds the
|
|
843
|
+
lock, a `SIGHUP`, `SIGINT` or `SIGTERM` does not end the supervisor: before the
|
|
844
|
+
release has started, the signal cancels the launch, the lock is released and no
|
|
845
|
+
run is recorded; after that, the supervisor passes each signal on to the
|
|
846
|
+
release once and stays to record the outcome. `kill -- -<process group>` stops
|
|
847
|
+
the whole run: the release receives the signal directly as well, and the
|
|
848
|
+
supervisor passes nothing on to a release that has already ended.
|
|
849
|
+
`gitzone release inspect` lists the runs, latest first, before the journals,
|
|
850
|
+
and `inspect --json` adds them as `runs`. The run's state says how the process
|
|
851
|
+
ended; the journal of its version still says what was published, and a failed
|
|
852
|
+
run continues with `gitzone release resume <version> -y`, detached or not.
|
|
853
|
+
|
|
854
|
+
While the lock is held, every other release, `resume` or `recover` of the
|
|
855
|
+
project, detached or not, is refused; only the run's own release passes.
|
|
856
|
+
`--plan` runs and `inspect` stay allowed, since they change nothing. The
|
|
857
|
+
lock sits in the Git common directory, so all worktrees of a repository share
|
|
858
|
+
it. A release started without `--detach` does not take the lock, so a detached
|
|
859
|
+
launch cannot see it. When the supervisor itself is killed with `SIGKILL`, or
|
|
860
|
+
the machine stops, the run stays `running` and the lock stays held: prove the
|
|
861
|
+
recorded supervisor process no longer exists, then remove
|
|
862
|
+
`<git-common-dir>/gitzone/releases/v1/detached.lock`, as with every other
|
|
863
|
+
GitZone lock. Run records and logs are kept; remove old ones from
|
|
864
|
+
`detached/` when they are no longer needed.
|
|
865
|
+
|
|
788
866
|
## Standard Changelog
|
|
789
867
|
|
|
790
868
|
The changelog is convention-based and intentionally not configured.
|
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: '7.
|
|
6
|
+
version: '7.3.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
|
}
|