@jsonpages/cli 3.0.0 → 3.0.3
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/src_tenant_alpha.sh +3267 -0
- package/package.json +8 -2
- package/scripts/build-projection-manifest.mjs +0 -59
- package/tsconfig.json +0 -13
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsonpages/cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "JsonPages CLI - Sovereign Projection Engine",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"bin": {
|
|
6
|
+
"bin": {
|
|
7
|
+
"jsonpages": "./src/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"src",
|
|
11
|
+
"assets"
|
|
12
|
+
],
|
|
7
13
|
"scripts": {
|
|
8
14
|
"build": "tsc -p .",
|
|
9
15
|
"build:manifest": "node scripts/build-projection-manifest.mjs"
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Build-time script: parses src_tenant_alpha.sh (heredoc format) and emits
|
|
4
|
-
* projection-manifest.json for cross-platform CLI projection (Node-only, no shell).
|
|
5
|
-
* Run from repo root: node packages/cli/scripts/build-projection-manifest.mjs
|
|
6
|
-
*/
|
|
7
|
-
import fs from 'fs';
|
|
8
|
-
import path from 'path';
|
|
9
|
-
import { fileURLToPath } from 'url';
|
|
10
|
-
|
|
11
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
-
const ASSETS_DIR = path.resolve(__dirname, '../assets');
|
|
13
|
-
const SH_PATH = path.join(ASSETS_DIR, 'src_tenant_alpha.sh');
|
|
14
|
-
const MANIFEST_PATH = path.join(ASSETS_DIR, 'projection-manifest.json');
|
|
15
|
-
|
|
16
|
-
const HEREDOC_MARKER = 'END_OF_FILE_CONTENT';
|
|
17
|
-
const PATTERN = /cat << 'END_OF_FILE_CONTENT' > "([^"]+)"\n/g;
|
|
18
|
-
|
|
19
|
-
function parseShToManifest(shContent) {
|
|
20
|
-
const manifest = Object.create(null);
|
|
21
|
-
let match;
|
|
22
|
-
while ((match = PATTERN.exec(shContent)) !== null) {
|
|
23
|
-
const filePath = match[1];
|
|
24
|
-
const contentStart = match.index + match[0].length;
|
|
25
|
-
const contentEnd = findHeredocEnd(shContent, contentStart);
|
|
26
|
-
const content = contentEnd === -1
|
|
27
|
-
? shContent.slice(contentStart)
|
|
28
|
-
: shContent.slice(contentStart, contentEnd);
|
|
29
|
-
manifest[filePath] = content;
|
|
30
|
-
}
|
|
31
|
-
return manifest;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function findHeredocEnd(text, fromIndex) {
|
|
35
|
-
let i = fromIndex;
|
|
36
|
-
while (i < text.length) {
|
|
37
|
-
const lineEnd = text.indexOf('\n', i);
|
|
38
|
-
const line = lineEnd === -1 ? text.slice(i) : text.slice(i, lineEnd);
|
|
39
|
-
if (line.trim() === HEREDOC_MARKER) {
|
|
40
|
-
return i;
|
|
41
|
-
}
|
|
42
|
-
i = lineEnd === -1 ? text.length : lineEnd + 1;
|
|
43
|
-
}
|
|
44
|
-
return -1;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function main() {
|
|
48
|
-
if (!fs.existsSync(SH_PATH)) {
|
|
49
|
-
console.error('Missing asset:', SH_PATH);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
const shContent = fs.readFileSync(SH_PATH, 'utf8');
|
|
53
|
-
const manifest = parseShToManifest(shContent);
|
|
54
|
-
const count = Object.keys(manifest).length;
|
|
55
|
-
fs.writeFileSync(MANIFEST_PATH, JSON.stringify(manifest, null, 0), 'utf8');
|
|
56
|
-
console.log(`Wrote ${MANIFEST_PATH} (${count} files).`);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
main();
|
package/tsconfig.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"moduleResolution": "NodeNext",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
"noEmit": true
|
|
11
|
-
},
|
|
12
|
-
"include": ["src/**/*.ts", "src/**/*.js"]
|
|
13
|
-
}
|