@contentrail/cli 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +81 -2
- package/bin/contentrail.js +5 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +203 -0
- package/dist/cli.js.map +1 -0
- package/dist/collections/load.d.ts +6 -0
- package/dist/collections/load.d.ts.map +1 -0
- package/dist/collections/load.js +57 -0
- package/dist/collections/load.js.map +1 -0
- package/dist/commands/build.d.ts +5 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +46 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/doctor.d.ts +4 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +136 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +11 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +129 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/status.d.ts +4 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +67 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/validate.d.ts +9 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +84 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/config/load.d.ts +11 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/load.js +33 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/schema.d.ts +3 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +34 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/types.d.ts +14 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +8 -0
- package/dist/config/types.js.map +1 -0
- package/dist/detect/framework.d.ts +13 -0
- package/dist/detect/framework.d.ts.map +1 -0
- package/dist/detect/framework.js +52 -0
- package/dist/detect/framework.js.map +1 -0
- package/dist/editor/validate-config.d.ts +10 -0
- package/dist/editor/validate-config.d.ts.map +1 -0
- package/dist/editor/validate-config.js +135 -0
- package/dist/editor/validate-config.js.map +1 -0
- package/dist/exit-codes.d.ts +9 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +8 -0
- package/dist/exit-codes.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/util/fs.d.ts +7 -0
- package/dist/util/fs.d.ts.map +1 -0
- package/dist/util/fs.js +27 -0
- package/dist/util/fs.js.map +1 -0
- package/dist/util/paths.d.ts +7 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +23 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/util/print.d.ts +7 -0
- package/dist/util/print.d.ts.map +1 -0
- package/dist/util/print.js +14 -0
- package/dist/util/print.js.map +1 -0
- package/dist/util/redact.d.ts +10 -0
- package/dist/util/redact.d.ts.map +1 -0
- package/dist/util/redact.js +19 -0
- package/dist/util/redact.js.map +1 -0
- package/dist/util/spawn.d.ts +11 -0
- package/dist/util/spawn.d.ts.map +1 -0
- package/dist/util/spawn.js +32 -0
- package/dist/util/spawn.js.map +1 -0
- package/package.json +52 -3
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { readJsonFile } from "../util/fs.js";
|
|
2
|
+
const WIDGETS = new Set([
|
|
3
|
+
"text",
|
|
4
|
+
"textarea",
|
|
5
|
+
"number",
|
|
6
|
+
"boolean",
|
|
7
|
+
"enum",
|
|
8
|
+
"object",
|
|
9
|
+
"array",
|
|
10
|
+
"unsupported",
|
|
11
|
+
]);
|
|
12
|
+
/**
|
|
13
|
+
* Structural validation of ADR 019 editor metadata JSON.
|
|
14
|
+
* Does not load Preact or @contentrail/editor.
|
|
15
|
+
*/
|
|
16
|
+
export async function validateEditorConfigFile(absolutePath) {
|
|
17
|
+
let raw;
|
|
18
|
+
try {
|
|
19
|
+
raw = await readJsonFile(absolutePath);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
path: absolutePath,
|
|
25
|
+
message: `Unable to read editor config: ${error instanceof Error ? error.message : String(error)}`,
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
30
|
+
return [
|
|
31
|
+
{ path: "(root)", message: "Editor config must be a JSON object." },
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
const root = raw;
|
|
35
|
+
const collections = root.collections;
|
|
36
|
+
if (!Array.isArray(collections)) {
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
path: "collections",
|
|
40
|
+
message: 'Editor config requires a "collections" array.',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
const issues = [];
|
|
45
|
+
collections.forEach((collection, index) => {
|
|
46
|
+
issues.push(...validateCollection(collection, `collections[${index}]`));
|
|
47
|
+
});
|
|
48
|
+
return issues;
|
|
49
|
+
}
|
|
50
|
+
function validateCollection(value, path) {
|
|
51
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
52
|
+
return [{ path, message: "Collection entry must be an object." }];
|
|
53
|
+
}
|
|
54
|
+
const record = value;
|
|
55
|
+
const issues = [];
|
|
56
|
+
if (typeof record.name !== "string" || record.name.trim() === "") {
|
|
57
|
+
issues.push({ path: `${path}.name`, message: "name is required." });
|
|
58
|
+
}
|
|
59
|
+
if (typeof record.label !== "string" || record.label.trim() === "") {
|
|
60
|
+
issues.push({ path: `${path}.label`, message: "label is required." });
|
|
61
|
+
}
|
|
62
|
+
if (!Array.isArray(record.fields)) {
|
|
63
|
+
issues.push({
|
|
64
|
+
path: `${path}.fields`,
|
|
65
|
+
message: "fields must be an array.",
|
|
66
|
+
});
|
|
67
|
+
return issues;
|
|
68
|
+
}
|
|
69
|
+
record.fields.forEach((field, index) => {
|
|
70
|
+
issues.push(...validateField(field, `${path}.fields[${index}]`));
|
|
71
|
+
});
|
|
72
|
+
return issues;
|
|
73
|
+
}
|
|
74
|
+
function validateField(value, path) {
|
|
75
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
76
|
+
return [{ path, message: "Field must be an object." }];
|
|
77
|
+
}
|
|
78
|
+
const field = value;
|
|
79
|
+
const issues = [];
|
|
80
|
+
if (typeof field.name !== "string" || field.name.trim() === "") {
|
|
81
|
+
issues.push({ path: `${path}.name`, message: "name is required." });
|
|
82
|
+
}
|
|
83
|
+
if (typeof field.label !== "string" || field.label.trim() === "") {
|
|
84
|
+
issues.push({ path: `${path}.label`, message: "label is required." });
|
|
85
|
+
}
|
|
86
|
+
if (typeof field.widget !== "string" || !WIDGETS.has(field.widget)) {
|
|
87
|
+
issues.push({
|
|
88
|
+
path: `${path}.widget`,
|
|
89
|
+
message: `widget must be one of: ${[...WIDGETS].join(", ")}.`,
|
|
90
|
+
});
|
|
91
|
+
return issues;
|
|
92
|
+
}
|
|
93
|
+
if (field.widget === "enum") {
|
|
94
|
+
if (!Array.isArray(field.options) || field.options.length === 0) {
|
|
95
|
+
issues.push({
|
|
96
|
+
path: `${path}.options`,
|
|
97
|
+
message: "enum fields require a non-empty options array.",
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (field.widget === "unsupported") {
|
|
102
|
+
if (typeof field.reason !== "string" || field.reason.trim() === "") {
|
|
103
|
+
issues.push({
|
|
104
|
+
path: `${path}.reason`,
|
|
105
|
+
message: "unsupported fields require a reason.",
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (field.widget === "object") {
|
|
110
|
+
if (!Array.isArray(field.fields)) {
|
|
111
|
+
issues.push({
|
|
112
|
+
path: `${path}.fields`,
|
|
113
|
+
message: "object fields require a fields array.",
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
field.fields.forEach((child, index) => {
|
|
118
|
+
issues.push(...validateField(child, `${path}.fields[${index}]`));
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (field.widget === "array") {
|
|
123
|
+
if (field.item === undefined) {
|
|
124
|
+
issues.push({
|
|
125
|
+
path: `${path}.item`,
|
|
126
|
+
message: "array fields require an item field spec.",
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
issues.push(...validateField(field.item, `${path}.item`));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return issues;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=validate-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-config.js","sourceRoot":"","sources":["../../src/editor/validate-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC;IACtB,MAAM;IACN,UAAU;IACV,QAAQ;IACR,SAAS;IACT,MAAM;IACN,QAAQ;IACR,OAAO;IACP,aAAa;CACd,CAAC,CAAC;AAOH;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,YAAoB;IAEpB,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL;gBACE,IAAI,EAAE,YAAY;gBAClB,OAAO,EAAE,iCAAiC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;aACnG;SACF,CAAC;IACJ,CAAC;IAED,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAA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E,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YACjC,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,GAAG,IAAI,SAAS;gBACtB,OAAO,EAAE,uCAAuC;aACjD,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;gBACpC,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,GAAG,IAAI,WAAW,KAAK,GAAG,CAAC,CAAC,CAAC;YACnE,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAC7B,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,GAAG,IAAI,OAAO;gBACpB,OAAO,EAAE,0CAA0C;aACpD,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Predictable CLI exit codes. */
|
|
2
|
+
export declare const ExitCode: {
|
|
3
|
+
readonly Success: 0;
|
|
4
|
+
readonly Failure: 1;
|
|
5
|
+
readonly Usage: 2;
|
|
6
|
+
readonly Config: 3;
|
|
7
|
+
};
|
|
8
|
+
export type ExitCode = (typeof ExitCode)[keyof typeof ExitCode];
|
|
9
|
+
//# sourceMappingURL=exit-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,eAAO,MAAM,QAAQ;;;;;CAKX,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;CACD,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @contentrail/cli — Node/build-time developer tooling.
|
|
3
|
+
* Do not import from browser bundles.
|
|
4
|
+
*/
|
|
5
|
+
export { runCli } from "./cli.js";
|
|
6
|
+
export { ExitCode } from "./exit-codes.js";
|
|
7
|
+
export { parseProjectConfig } from "./config/schema.js";
|
|
8
|
+
export { CONFIG_FILE_NAME, DEFAULT_CONFIG, type ContentRailProjectConfig, type FrameworkKind, } from "./config/types.js";
|
|
9
|
+
export { loadProject, type LoadedProject } from "./config/load.js";
|
|
10
|
+
export { redactSecrets, formatEnvPresence, isSecretEnvName, } from "./util/redact.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,KAAK,wBAAwB,EAC7B,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @contentrail/cli — Node/build-time developer tooling.
|
|
3
|
+
* Do not import from browser bundles.
|
|
4
|
+
*/
|
|
5
|
+
export { runCli } from "./cli.js";
|
|
6
|
+
export { ExitCode } from "./exit-codes.js";
|
|
7
|
+
export { parseProjectConfig } from "./config/schema.js";
|
|
8
|
+
export { CONFIG_FILE_NAME, DEFAULT_CONFIG, } from "./config/types.js";
|
|
9
|
+
export { loadProject } from "./config/load.js";
|
|
10
|
+
export { redactSecrets, formatEnvPresence, isSecretEnvName, } from "./util/redact.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,gBAAgB,EAChB,cAAc,GAGf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAsB,MAAM,kBAAkB,CAAC;AACnE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function pathExists(filePath: string): Promise<boolean>;
|
|
2
|
+
export declare function readJsonFile(filePath: string): Promise<unknown>;
|
|
3
|
+
export declare function writeFileSafe(filePath: string, contents: string, options?: {
|
|
4
|
+
force?: boolean | undefined;
|
|
5
|
+
}): Promise<"written" | "skipped">;
|
|
6
|
+
export declare function ensureDir(dirPath: string): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=fs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/util/fs.ts"],"names":[],"mappings":"AAGA,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnE;AAED,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGrE;AAED,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GAC5C,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAOhC;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D"}
|
package/dist/util/fs.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export async function pathExists(filePath) {
|
|
4
|
+
try {
|
|
5
|
+
await fs.access(filePath);
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export async function readJsonFile(filePath) {
|
|
13
|
+
const raw = await fs.readFile(filePath, "utf8");
|
|
14
|
+
return JSON.parse(raw);
|
|
15
|
+
}
|
|
16
|
+
export async function writeFileSafe(filePath, contents, options = {}) {
|
|
17
|
+
if ((await pathExists(filePath)) && options.force !== true) {
|
|
18
|
+
return "skipped";
|
|
19
|
+
}
|
|
20
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
21
|
+
await fs.writeFile(filePath, contents, "utf8");
|
|
22
|
+
return "written";
|
|
23
|
+
}
|
|
24
|
+
export async function ensureDir(dirPath) {
|
|
25
|
+
await fs.mkdir(dirPath, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/util/fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB;IAC/C,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAgB;IACjD,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAgB,EAChB,QAAgB,EAChB,UAA2C,EAAE;IAE7C,IAAI,CAAC,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QAC3D,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/C,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe;IAC7C,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a configured relative path under the project root.
|
|
3
|
+
* Rejects absolute paths and traversal that escapes the root.
|
|
4
|
+
*/
|
|
5
|
+
export declare function resolveProjectPath(projectRoot: string, configuredPath: string, label: string): string;
|
|
6
|
+
export declare function findProjectRoot(cwd: string): string;
|
|
7
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/util/paths.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,GACZ,MAAM,CAiBR;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a configured relative path under the project root.
|
|
4
|
+
* Rejects absolute paths and traversal that escapes the root.
|
|
5
|
+
*/
|
|
6
|
+
export function resolveProjectPath(projectRoot, configuredPath, label) {
|
|
7
|
+
if (path.isAbsolute(configuredPath)) {
|
|
8
|
+
throw new Error(`${label} must be a path relative to the project root (received absolute path).`);
|
|
9
|
+
}
|
|
10
|
+
const root = path.resolve(projectRoot);
|
|
11
|
+
const resolved = path.resolve(root, configuredPath);
|
|
12
|
+
const relative = path.relative(root, resolved);
|
|
13
|
+
if (relative === ".." ||
|
|
14
|
+
relative.startsWith(`..${path.sep}`) ||
|
|
15
|
+
path.isAbsolute(relative)) {
|
|
16
|
+
throw new Error(`${label} escapes the project root: ${configuredPath}`);
|
|
17
|
+
}
|
|
18
|
+
return resolved;
|
|
19
|
+
}
|
|
20
|
+
export function findProjectRoot(cwd) {
|
|
21
|
+
return path.resolve(cwd);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/util/paths.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,WAAmB,EACnB,cAAsB,EACtB,KAAa;IAEb,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,wEAAwE,CACjF,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/C,IACE,QAAQ,KAAK,IAAI;QACjB,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC;QACpC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EACzB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,8BAA8B,cAAc,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface Logger {
|
|
2
|
+
info(message: string): void;
|
|
3
|
+
warn(message: string): void;
|
|
4
|
+
error(message: string): void;
|
|
5
|
+
}
|
|
6
|
+
export declare function createLogger(stdout?: NodeJS.WritableStream, stderr?: NodeJS.WritableStream): Logger;
|
|
7
|
+
//# sourceMappingURL=print.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print.d.ts","sourceRoot":"","sources":["../../src/util/print.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,wBAAgB,YAAY,CAC1B,MAAM,GAAE,MAAM,CAAC,cAA+B,EAC9C,MAAM,GAAE,MAAM,CAAC,cAA+B,GAC7C,MAAM,CAYR"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function createLogger(stdout = process.stdout, stderr = process.stderr) {
|
|
2
|
+
return {
|
|
3
|
+
info(message) {
|
|
4
|
+
stdout.write(`${message}\n`);
|
|
5
|
+
},
|
|
6
|
+
warn(message) {
|
|
7
|
+
stderr.write(`${message}\n`);
|
|
8
|
+
},
|
|
9
|
+
error(message) {
|
|
10
|
+
stderr.write(`${message}\n`);
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=print.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print.js","sourceRoot":"","sources":["../../src/util/print.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,YAAY,CAC1B,SAAgC,OAAO,CAAC,MAAM,EAC9C,SAAgC,OAAO,CAAC,MAAM;IAE9C,OAAO;QACL,IAAI,CAAC,OAAO;YACV,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,IAAI,CAAC,OAAO;YACV,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,KAAK,CAAC,OAAO;YACX,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;QAC/B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** True when an environment variable name looks privileged. */
|
|
2
|
+
export declare function isSecretEnvName(name: string): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Format env presence without values.
|
|
5
|
+
* Example: `CONTENTRAIL_ACCESS_AUD=set`
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatEnvPresence(name: string, present: boolean): string;
|
|
8
|
+
/** Strip obvious secret-looking assignments from a string for safe logging. */
|
|
9
|
+
export declare function redactSecrets(text: string): string;
|
|
10
|
+
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/util/redact.ts"],"names":[],"mappings":"AAGA,+DAA+D;AAC/D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAExE;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOlD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const SECRET_ENV_PATTERN = /(TOKEN|SECRET|PASSWORD|CREDENTIAL|PRIVATE_KEY|API_KEY|ACCESS_KEY)/i;
|
|
2
|
+
/** True when an environment variable name looks privileged. */
|
|
3
|
+
export function isSecretEnvName(name) {
|
|
4
|
+
return SECRET_ENV_PATTERN.test(name);
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Format env presence without values.
|
|
8
|
+
* Example: `CONTENTRAIL_ACCESS_AUD=set`
|
|
9
|
+
*/
|
|
10
|
+
export function formatEnvPresence(name, present) {
|
|
11
|
+
return `${name}=${present ? "set" : "missing"}`;
|
|
12
|
+
}
|
|
13
|
+
/** Strip obvious secret-looking assignments from a string for safe logging. */
|
|
14
|
+
export function redactSecrets(text) {
|
|
15
|
+
return text
|
|
16
|
+
.replace(/(Authorization:\s*Bearer\s+)\S+/gi, "$1[redacted]")
|
|
17
|
+
.replace(/((?:TOKEN|SECRET|PASSWORD|CREDENTIAL|PRIVATE_KEY|API_KEY)\s*[=:]\s*)\S+/gi, "$1[redacted]");
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=redact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.js","sourceRoot":"","sources":["../../src/util/redact.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GACtB,oEAAoE,CAAC;AAEvE,+DAA+D;AAC/D,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,OAAgB;IAC9D,OAAO,GAAG,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AAClD,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI;SACR,OAAO,CAAC,mCAAmC,EAAE,cAAc,CAAC;SAC5D,OAAO,CACN,2EAA2E,EAC3E,cAAc,CACf,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SpawnResult {
|
|
2
|
+
readonly code: number | null;
|
|
3
|
+
readonly signal: NodeJS.Signals | null;
|
|
4
|
+
readonly stdout: string;
|
|
5
|
+
readonly stderr: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function runCommand(command: string, args: readonly string[], options: {
|
|
8
|
+
cwd: string;
|
|
9
|
+
env?: NodeJS.ProcessEnv;
|
|
10
|
+
}): Promise<SpawnResult>;
|
|
11
|
+
//# sourceMappingURL=spawn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../src/util/spawn.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE;IACP,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB,GACA,OAAO,CAAC,WAAW,CAAC,CA6BtB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { redactSecrets } from "./redact.js";
|
|
3
|
+
export function runCommand(command, args, options) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
const child = spawn(command, [...args], {
|
|
6
|
+
cwd: options.cwd,
|
|
7
|
+
env: options.env ?? process.env,
|
|
8
|
+
shell: false,
|
|
9
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
10
|
+
});
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
child.stdout.on("data", (chunk) => {
|
|
14
|
+
stdout += chunk.toString("utf8");
|
|
15
|
+
});
|
|
16
|
+
child.stderr.on("data", (chunk) => {
|
|
17
|
+
stderr += chunk.toString("utf8");
|
|
18
|
+
});
|
|
19
|
+
child.on("error", (error) => {
|
|
20
|
+
reject(error);
|
|
21
|
+
});
|
|
22
|
+
child.on("close", (code, signal) => {
|
|
23
|
+
resolve({
|
|
24
|
+
code,
|
|
25
|
+
signal,
|
|
26
|
+
stdout: redactSecrets(stdout),
|
|
27
|
+
stderr: redactSecrets(stderr),
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=spawn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../src/util/spawn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,MAAM,UAAU,UAAU,CACxB,OAAe,EACf,IAAuB,EACvB,OAGC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE;YACtC,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG;YAC/B,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;SAClC,CAAC,CAAC;QAEH,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAC1B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;YACjC,OAAO,CAAC;gBACN,IAAI;gBACJ,MAAM;gBACN,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC;gBAC7B,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC;aAC9B,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentrail/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "ContentRail developer CLI for init, validate, build, doctor and status.",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=22"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"contentrail": "./bin/contentrail.js"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"node": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin",
|
|
24
|
+
"dist",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"jiti": "^2.6.1",
|
|
30
|
+
"zod": "^3.25.76",
|
|
31
|
+
"@contentrail/core": "0.1.0",
|
|
32
|
+
"@contentrail/reader": "0.1.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^22.20.5",
|
|
36
|
+
"typescript": "5.9.3"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/Hridhin-k/contentrail.git",
|
|
41
|
+
"directory": "packages/cli"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/Hridhin-k/contentrail/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/Hridhin-k/contentrail#readme",
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsc -p tsconfig.json",
|
|
52
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
53
|
+
"test": "pnpm run build && tsc -p tsconfig.test.json && node --test test-dist/**/*.test.js"
|
|
54
|
+
}
|
|
6
55
|
}
|