@cleocode/cleo 2026.4.91 → 2026.4.94
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/dist/cli/index.js +2899 -794
- package/dist/cli/index.js.map +4 -4
- package/package.json +11 -8
- package/scripts/assert-shebang.mjs +63 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/cleo",
|
|
3
|
-
"version": "2026.4.
|
|
3
|
+
"version": "2026.4.94",
|
|
4
4
|
"description": "CLEO CLI — the assembled product consuming @cleocode/core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cli/index.js",
|
|
@@ -29,13 +29,14 @@
|
|
|
29
29
|
"tree-sitter-ruby": "^0.23.1",
|
|
30
30
|
"tree-sitter-rust": "0.23.1",
|
|
31
31
|
"tree-sitter-typescript": "^0.23.2",
|
|
32
|
-
"@cleocode/caamp": "2026.4.
|
|
33
|
-
"@cleocode/cant": "2026.4.
|
|
34
|
-
"@cleocode/contracts": "2026.4.
|
|
35
|
-
"@cleocode/core": "2026.4.
|
|
36
|
-
"@cleocode/lafs": "2026.4.
|
|
37
|
-
"@cleocode/nexus": "2026.4.
|
|
38
|
-
"@cleocode/
|
|
32
|
+
"@cleocode/caamp": "2026.4.94",
|
|
33
|
+
"@cleocode/cant": "2026.4.94",
|
|
34
|
+
"@cleocode/contracts": "2026.4.94",
|
|
35
|
+
"@cleocode/core": "2026.4.94",
|
|
36
|
+
"@cleocode/lafs": "2026.4.94",
|
|
37
|
+
"@cleocode/nexus": "2026.4.94",
|
|
38
|
+
"@cleocode/playbooks": "2026.4.94",
|
|
39
|
+
"@cleocode/runtime": "2026.4.94"
|
|
39
40
|
},
|
|
40
41
|
"engines": {
|
|
41
42
|
"node": ">=24.0.0"
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
"migrations",
|
|
50
51
|
"completions",
|
|
51
52
|
"bin",
|
|
53
|
+
"scripts",
|
|
52
54
|
"templates"
|
|
53
55
|
],
|
|
54
56
|
"devDependencies": {
|
|
@@ -62,6 +64,7 @@
|
|
|
62
64
|
},
|
|
63
65
|
"scripts": {
|
|
64
66
|
"build": "tsc",
|
|
67
|
+
"postbuild": "node scripts/assert-shebang.mjs",
|
|
65
68
|
"typecheck": "tsc --noEmit",
|
|
66
69
|
"test": "cd ../.. && vitest run packages/cleo/src",
|
|
67
70
|
"postinstall": "node bin/postinstall.js"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post-build assertion: every bin target declared in package.json MUST have
|
|
3
|
+
* `#!/usr/bin/env node` as its first line and MUST be owner-executable.
|
|
4
|
+
*
|
|
5
|
+
* Exits non-zero (failing the build) if any bin file is missing its shebang
|
|
6
|
+
* or lacks the executable bit. Also applies `chmod +x` so the assertion is
|
|
7
|
+
* idempotent on platforms where tsc does not set execute permissions.
|
|
8
|
+
*
|
|
9
|
+
* Run automatically via the `postbuild` npm lifecycle hook.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { readFileSync, chmodSync, statSync, existsSync } from "node:fs";
|
|
13
|
+
import { resolve, dirname } from "node:path";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
|
|
16
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const PKG_ROOT = resolve(__dirname, "..");
|
|
18
|
+
const SHEBANG = "#!/usr/bin/env node";
|
|
19
|
+
|
|
20
|
+
/** @type {{ bin?: Record<string, string> }} */
|
|
21
|
+
const pkg = JSON.parse(readFileSync(resolve(PKG_ROOT, "package.json"), "utf-8"));
|
|
22
|
+
|
|
23
|
+
const binEntries = Object.entries(pkg.bin ?? {});
|
|
24
|
+
|
|
25
|
+
if (binEntries.length === 0) {
|
|
26
|
+
console.log("assert-shebang: no bin targets declared — nothing to check.");
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let failed = false;
|
|
31
|
+
|
|
32
|
+
for (const [name, relPath] of binEntries) {
|
|
33
|
+
const absPath = resolve(PKG_ROOT, relPath);
|
|
34
|
+
|
|
35
|
+
if (!existsSync(absPath)) {
|
|
36
|
+
console.error(`assert-shebang: MISSING bin target '${name}' → ${absPath}`);
|
|
37
|
+
failed = true;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const content = readFileSync(absPath, "utf-8");
|
|
42
|
+
const firstLine = content.split("\n")[0];
|
|
43
|
+
|
|
44
|
+
if (firstLine !== SHEBANG) {
|
|
45
|
+
console.error(
|
|
46
|
+
`assert-shebang: FAIL '${name}' (${relPath}) — first line is: ${JSON.stringify(firstLine)}\n` +
|
|
47
|
+
` Expected: ${JSON.stringify(SHEBANG)}`
|
|
48
|
+
);
|
|
49
|
+
failed = true;
|
|
50
|
+
} else {
|
|
51
|
+
// Ensure owner-executable bit is set (0o100 = owner execute)
|
|
52
|
+
const stat = statSync(absPath);
|
|
53
|
+
if ((stat.mode & 0o100) === 0) {
|
|
54
|
+
chmodSync(absPath, stat.mode | 0o111);
|
|
55
|
+
console.log(`assert-shebang: chmod +x applied to '${name}' (${relPath})`);
|
|
56
|
+
}
|
|
57
|
+
console.log(`assert-shebang: OK '${name}' (${relPath})`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (failed) {
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|