@lenso/cli 0.2.15 → 0.2.17
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 +24 -53
- package/bin/lenso.js +62 -63
- package/package.json +15 -17
- package/vendor/darwin-arm64/lenso +0 -0
- package/vendor/darwin-x64/lenso +0 -0
- package/vendor/linux-x64/lenso +0 -0
- package/vendor/win32-x64/lenso.exe +0 -0
package/README.md
CHANGED
|
@@ -38,8 +38,8 @@ lenso console doctor --root /srv/lenso-console \
|
|
|
38
38
|
--live-url https://console.example.com --json
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
The manifest must be attested by the repository's
|
|
42
|
-
`.github/workflows/
|
|
41
|
+
The manifest must be attested by the `LioRael/lenso-console` repository's
|
|
42
|
+
repository-owned `.github/workflows/release-oci.yml` signer and must pin an OCI image by digest. The
|
|
43
43
|
CLI rejects attestations from any other workflow and from self-hosted runners.
|
|
44
44
|
The apply environment must set `CONSOLE_RECOVERY_MODE=normal` explicitly. The
|
|
45
45
|
adapter pulls that image, runs its migration workload, starts the Console
|
|
@@ -216,11 +216,11 @@ running until Ctrl-C. New hosts run them in one local process; pass
|
|
|
216
216
|
lenso module create billing
|
|
217
217
|
```
|
|
218
218
|
|
|
219
|
-
Add `--with-console` when the
|
|
220
|
-
|
|
219
|
+
Add `--with-console-ui` when the Module Release should also contain its isolated
|
|
220
|
+
Console UI artifact:
|
|
221
221
|
|
|
222
222
|
```sh
|
|
223
|
-
lenso module create billing --with-console
|
|
223
|
+
lenso module create billing --with-console-ui
|
|
224
224
|
```
|
|
225
225
|
|
|
226
226
|
For a standalone service provider:
|
|
@@ -384,16 +384,14 @@ lenso service install dist/lenso-service/support-suite-provider/lenso.service-pa
|
|
|
384
384
|
--base-url http://127.0.0.1:4100/lenso/service/v1
|
|
385
385
|
```
|
|
386
386
|
|
|
387
|
-
Install
|
|
387
|
+
Install and manage a Module through the stable lifecycle commands:
|
|
388
388
|
|
|
389
389
|
```sh
|
|
390
|
-
lenso module release inspect dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json
|
|
391
|
-
lenso module release check dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json \
|
|
392
|
-
--base-url http://127.0.0.1:4100/lenso/service/v1
|
|
393
390
|
lenso module install dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json \
|
|
394
391
|
--base-url http://127.0.0.1:4100/lenso/service/v1
|
|
395
|
-
lenso module enable support-ticket
|
|
396
392
|
lenso module disable support-ticket
|
|
393
|
+
lenso module remove support-ticket
|
|
394
|
+
lenso module doctor support-ticket
|
|
397
395
|
```
|
|
398
396
|
|
|
399
397
|
`lenso.module-release.v1` is the module release channel. It records the module
|
|
@@ -408,48 +406,25 @@ name, version, capabilities, source, and optional provider pointer. V11 keeps
|
|
|
408
406
|
connects a service, but it does not mean every module inside that service is
|
|
409
407
|
the user-facing install target.
|
|
410
408
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
dependencies so `cargo check` or `pnpm install` can run before the packages are
|
|
414
|
-
published. Outside that checkout it keeps the future-publish version
|
|
415
|
-
dependencies and prints a note to replace them with local paths until
|
|
416
|
-
`lenso-service` and `@lenso/service-kit` are published.
|
|
417
|
-
|
|
418
|
-
The older standalone module package generator is still available as:
|
|
419
|
-
|
|
420
|
-
```sh
|
|
421
|
-
lenso module create billing --remote --output-dir ../module-packages
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
The Runtime Console package generator is available directly as:
|
|
425
|
-
|
|
426
|
-
```sh
|
|
427
|
-
lenso console package create billing
|
|
428
|
-
```
|
|
409
|
+
The Service scaffold consumes `@lenso/service-kit` from the framework SDK when
|
|
410
|
+
used in a sibling checkout. Outside that checkout it uses the published SDK.
|
|
429
411
|
|
|
430
|
-
###
|
|
412
|
+
### Console and Module UI development
|
|
431
413
|
|
|
432
|
-
|
|
414
|
+
Run the complete local Console Service from its repository:
|
|
433
415
|
|
|
434
416
|
```sh
|
|
435
|
-
lenso console dev --
|
|
417
|
+
lenso console dev --console-root ../lenso-console
|
|
436
418
|
```
|
|
437
419
|
|
|
438
|
-
|
|
420
|
+
Run the Console UI artifact owned by the current Module:
|
|
439
421
|
|
|
440
422
|
```sh
|
|
441
|
-
lenso module dev --console
|
|
423
|
+
lenso module dev --console-ui
|
|
442
424
|
```
|
|
443
425
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
```sh
|
|
448
|
-
lenso module dev --console --host http://localhost:3000
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
Set `LENSO_RUNTIME_CONSOLE_ROOT=/path/to/lenso-runtime-console` when the Runtime
|
|
452
|
-
Console checkout is not a sibling of the current repository.
|
|
426
|
+
The UI artifact remains bound to the same immutable Module Release. The CLI no
|
|
427
|
+
longer copies packages into a Console checkout or maintains extension registries.
|
|
453
428
|
|
|
454
429
|
## Install a module
|
|
455
430
|
|
|
@@ -489,9 +464,9 @@ also infer `--base-url`; package artifacts outside that workspace still need
|
|
|
489
464
|
`--base-url` so the host records the runtime service endpoint rather than the
|
|
490
465
|
file path.
|
|
491
466
|
|
|
492
|
-
Service installs update `
|
|
493
|
-
|
|
494
|
-
and
|
|
467
|
+
Service installs update `SERVICE_MODULES` and record `.lenso/module-installs.json`
|
|
468
|
+
in one step. Console UI artifacts remain immutable members of their Module
|
|
469
|
+
Release and are bound only by an applied Console Service Composition. Linked modules update the
|
|
495
470
|
host `Cargo.toml`, `src/lib.rs`, `.env` toggle, and the same install receipt
|
|
496
471
|
from the descriptor's `linked` section. `module add` remains a compatibility
|
|
497
472
|
alias for service installs.
|
|
@@ -522,13 +497,9 @@ lenso module update auth
|
|
|
522
497
|
lenso module update billing --base-url https://example.com/lenso/module/v1
|
|
523
498
|
```
|
|
524
499
|
|
|
525
|
-
`module update` reuses the recorded `manifestReference` and
|
|
526
|
-
updates refresh
|
|
527
|
-
|
|
528
|
-
builtin module entry.
|
|
529
|
-
|
|
530
|
-
Use `--no-console-extension` when you want to skip Runtime Console extension
|
|
531
|
-
registration.
|
|
500
|
+
`module update` reuses the recorded `manifestReference` and delivery form.
|
|
501
|
+
Service-backed updates refresh provider state and install receipts; Linked
|
|
502
|
+
updates reapply the recorded descriptor or builtin Module entry.
|
|
532
503
|
|
|
533
504
|
Service module manifests may also declare `install.env` values and
|
|
534
505
|
`install.commands`. Env values are written to `.env`; commands are run only when
|
|
@@ -599,7 +570,7 @@ lenso service doctor billing --json
|
|
|
599
570
|
lenso service check billing --json
|
|
600
571
|
```
|
|
601
572
|
|
|
602
|
-
The doctor reads `
|
|
573
|
+
The doctor reads `SERVICE_MODULES`, `.lenso/module-installs.json`, and
|
|
603
574
|
`.lenso/module-services.json`. It reports whether the service is
|
|
604
575
|
installed, configured, whether an HTTP manifest is reachable, whether managed
|
|
605
576
|
service `readyUrl` endpoints are ready, and which stale `.lock`/`.pid` files
|
package/bin/lenso.js
CHANGED
|
@@ -1,75 +1,74 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.platformTag = platformTag;
|
|
8
|
+
exports.binaryPath = binaryPath;
|
|
9
|
+
exports.forwardTerminationSignals = forwardTerminationSignals;
|
|
10
|
+
const node_child_process_1 = require("node:child_process");
|
|
11
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
12
|
+
const SUPPORTED_PLATFORMS = new Set(["darwin", "linux", "win32"]);
|
|
13
|
+
const SUPPORTED_ARCHES = new Set(["arm64", "x64"]);
|
|
7
14
|
function platformTag(platform = process.platform, arch = process.arch) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
}
|
|
13
|
-
return `${platform}-${arch}`;
|
|
15
|
+
if (!SUPPORTED_PLATFORMS.has(platform) || !SUPPORTED_ARCHES.has(arch)) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return `${platform}-${arch}`;
|
|
14
19
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return path.join(baseDir, 'vendor', tag, exe);
|
|
20
|
+
function binaryPath(baseDir = node_path_1.default.join(__dirname, ".."), platform = process.platform, arch = process.arch) {
|
|
21
|
+
const tag = platformTag(platform, arch);
|
|
22
|
+
if (!tag) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const exe = platform === "win32" ? "lenso.exe" : "lenso";
|
|
26
|
+
return node_path_1.default.join(baseDir, "vendor", tag, exe);
|
|
23
27
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
]));
|
|
34
|
-
for (const [signal, handler] of handlers) {
|
|
35
|
-
parent.on(signal, handler);
|
|
36
|
-
}
|
|
37
|
-
return () => {
|
|
28
|
+
function forwardTerminationSignals(parent, child, signals = ["SIGINT", "SIGTERM"]) {
|
|
29
|
+
const handlers = new Map(signals.map((signal) => [
|
|
30
|
+
signal,
|
|
31
|
+
() => {
|
|
32
|
+
if (child.exitCode === null && child.signalCode === null) {
|
|
33
|
+
child.kill(signal);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
]));
|
|
38
37
|
for (const [signal, handler] of handlers) {
|
|
39
|
-
|
|
38
|
+
parent.on(signal, handler);
|
|
40
39
|
}
|
|
41
|
-
|
|
40
|
+
return () => {
|
|
41
|
+
for (const [signal, handler] of handlers) {
|
|
42
|
+
parent.off(signal, handler);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
42
45
|
}
|
|
43
|
-
|
|
44
46
|
function run() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const child = spawn(exe, process.argv.slice(2), { stdio: 'inherit' });
|
|
52
|
-
const stopForwardingSignals = forwardTerminationSignals(process, child);
|
|
53
|
-
child.on('error', (error) => {
|
|
54
|
-
if (error.code === 'ENOENT') {
|
|
55
|
-
console.error(`lenso: bundled binary is missing for ${process.platform}/${process.arch}`);
|
|
56
|
-
} else {
|
|
57
|
-
console.error(`lenso: ${error.message}`);
|
|
58
|
-
}
|
|
59
|
-
process.exit(1);
|
|
60
|
-
});
|
|
61
|
-
child.on('exit', (code, signal) => {
|
|
62
|
-
stopForwardingSignals();
|
|
63
|
-
if (signal) {
|
|
64
|
-
process.kill(process.pid, signal);
|
|
65
|
-
return;
|
|
47
|
+
const exe = binaryPath();
|
|
48
|
+
if (!exe) {
|
|
49
|
+
console.error(`lenso: unsupported platform ${process.platform}/${process.arch}`);
|
|
50
|
+
process.exit(1);
|
|
66
51
|
}
|
|
67
|
-
process.
|
|
68
|
-
|
|
52
|
+
const child = (0, node_child_process_1.spawn)(exe, process.argv.slice(2), { stdio: "inherit" });
|
|
53
|
+
const stopForwardingSignals = forwardTerminationSignals(process, child);
|
|
54
|
+
child.on("error", (error) => {
|
|
55
|
+
if (error.code === "ENOENT") {
|
|
56
|
+
console.error(`lenso: bundled binary is missing for ${process.platform}/${process.arch}`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
console.error(`lenso: ${error.message}`);
|
|
60
|
+
}
|
|
61
|
+
process.exit(1);
|
|
62
|
+
});
|
|
63
|
+
child.on("exit", (code, signal) => {
|
|
64
|
+
stopForwardingSignals();
|
|
65
|
+
if (signal) {
|
|
66
|
+
process.kill(process.pid, signal);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
process.exit(code ?? 1);
|
|
70
|
+
});
|
|
69
71
|
}
|
|
70
|
-
|
|
71
72
|
if (require.main === module) {
|
|
72
|
-
|
|
73
|
+
run();
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
-
module.exports = { binaryPath, forwardTerminationSignals, platformTag };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenso/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.17",
|
|
4
4
|
"description": "Lenso command-line interface for scaffolding and operating Lenso backend projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/LioRael/lenso-cli",
|
|
@@ -15,21 +15,10 @@
|
|
|
15
15
|
"bin",
|
|
16
16
|
"vendor"
|
|
17
17
|
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"check:npm-publish": "node scripts/check-npm-publish.mjs",
|
|
20
|
-
"check:reviewed-publisher": "node scripts/check-reviewed-publisher.mjs",
|
|
21
|
-
"check:npm-shim": "node scripts/check-npm-shim.mjs",
|
|
22
|
-
"check:release-versions": "node scripts/check-release-versions.mjs",
|
|
23
|
-
"install:hosted-console": "node scripts/install-hosted-console.mjs",
|
|
24
|
-
"package:npm": "node scripts/package-npm.mjs",
|
|
25
|
-
"prepack": "node scripts/package-npm.mjs",
|
|
26
|
-
"prepublishOnly": "node scripts/check-npm-publish.mjs",
|
|
27
|
-
"release:intent-check": "node scripts/release-plan.mjs --check-intent",
|
|
28
|
-
"release:plan": "node scripts/release-plan.mjs",
|
|
29
|
-
"release:verify": "npm run check:release-versions && node scripts/release-plan.mjs --verify"
|
|
30
|
-
},
|
|
31
18
|
"devDependencies": {
|
|
32
|
-
"
|
|
19
|
+
"@changesets/cli": "2.31.1",
|
|
20
|
+
"@types/node": "25.9.4",
|
|
21
|
+
"typescript": "7.0.2"
|
|
33
22
|
},
|
|
34
23
|
"publishConfig": {
|
|
35
24
|
"access": "public"
|
|
@@ -37,5 +26,14 @@
|
|
|
37
26
|
"engines": {
|
|
38
27
|
"node": ">=18"
|
|
39
28
|
},
|
|
40
|
-
"
|
|
41
|
-
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build:shim": "node node_modules/typescript/bin/tsc -p tsconfig.json",
|
|
31
|
+
"changeset": "changeset",
|
|
32
|
+
"check:npm-publish": "node scripts/check-npm-publish.mjs",
|
|
33
|
+
"check:shim-generated": "pnpm build:shim && node scripts/check-shim-generated.mjs",
|
|
34
|
+
"check:npm-shim": "pnpm check:shim-generated && node scripts/check-npm-shim.mjs",
|
|
35
|
+
"package:npm": "pnpm build:shim && node scripts/package-npm.mjs",
|
|
36
|
+
"release": "npm run check:npm-publish && changeset publish",
|
|
37
|
+
"version": "changeset version"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
Binary file
|
package/vendor/darwin-x64/lenso
CHANGED
|
Binary file
|
package/vendor/linux-x64/lenso
CHANGED
|
Binary file
|
|
Binary file
|