@product-model/cli 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.
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,197 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { defineCommand as defineCommand3, runMain } from "citty";
5
+
6
+ // src/commands/build.ts
7
+ import { readFile, writeFile } from "fs/promises";
8
+ import { basename, resolve } from "path";
9
+ import { parse, parseWorkspace, validate, validateWorkspace } from "@product-model/core";
10
+ import { defineCommand } from "citty";
11
+ var buildCommand = defineCommand({
12
+ meta: {
13
+ name: "build",
14
+ description: "Parse, validate, and output a JSON AST from a .product.mdx file"
15
+ },
16
+ args: {
17
+ file: {
18
+ type: "positional",
19
+ description: "Path to the .product.mdx file",
20
+ required: false
21
+ },
22
+ workspaceRoot: {
23
+ type: "string",
24
+ description: "Workspace root directory for multi-file build"
25
+ },
26
+ output: {
27
+ type: "string",
28
+ alias: "o",
29
+ description: "Output file path (defaults to <filename>.json)"
30
+ },
31
+ title: {
32
+ type: "string",
33
+ description: "Document title",
34
+ default: "Untitled"
35
+ },
36
+ version: {
37
+ type: "string",
38
+ description: "Document version",
39
+ default: "0.1.0"
40
+ }
41
+ },
42
+ async run({ args }) {
43
+ if (args.workspaceRoot) {
44
+ const workspaceRoot = resolve(args.workspaceRoot);
45
+ const workspace = await parseWorkspace({
46
+ workspaceRoot,
47
+ version: args.version,
48
+ title: args.title
49
+ });
50
+ const result2 = validateWorkspace(workspace);
51
+ if (!result2.valid) {
52
+ console.error(`\u2717 Validation failed with ${result2.diagnostics.length} error(s):
53
+ `);
54
+ for (const d of result2.diagnostics) {
55
+ const prefix = d.severity === "error" ? "ERROR" : d.severity === "warning" ? "WARN" : "INFO";
56
+ const pathInfo = d.path ? ` (${d.path})` : "";
57
+ const blockInfo = d.blockId ? ` [${d.blockId}]` : "";
58
+ console.error(` ${prefix}${pathInfo}${blockInfo}: ${d.message}`);
59
+ }
60
+ process.exit(1);
61
+ }
62
+ const outputPath2 = args.output ? resolve(args.output) : resolve("workspace.json");
63
+ await writeFile(outputPath2, JSON.stringify(workspace, null, 2), "utf-8");
64
+ console.log(`\u2713 Built ${outputPath2}`);
65
+ return;
66
+ }
67
+ if (!args.file) {
68
+ console.error('\u2717 Missing required argument: <file> (or use --workspace-root "<dir>")');
69
+ process.exit(1);
70
+ }
71
+ const filePath = resolve(args.file);
72
+ const source = await readFile(filePath, "utf-8");
73
+ const document = await parse(source, {
74
+ version: args.version,
75
+ title: args.title
76
+ });
77
+ const result = validate(document);
78
+ if (!result.valid) {
79
+ console.error(`\u2717 Validation failed with ${result.diagnostics.length} error(s):
80
+ `);
81
+ for (const d of result.diagnostics) {
82
+ const prefix = d.severity === "error" ? "ERROR" : d.severity === "warning" ? "WARN" : "INFO";
83
+ const blockInfo = d.blockId ? ` [${d.blockId}]` : "";
84
+ console.error(` ${prefix}${blockInfo}: ${d.message}`);
85
+ }
86
+ process.exit(1);
87
+ }
88
+ const outputPath = args.output ? resolve(args.output) : resolve(basename(filePath).replace(/\.product\.mdx$/, ".json"));
89
+ await writeFile(outputPath, JSON.stringify(document, null, 2), "utf-8");
90
+ console.log(`\u2713 Built ${outputPath}`);
91
+ }
92
+ });
93
+
94
+ // src/commands/validate.ts
95
+ import { readFile as readFile2 } from "fs/promises";
96
+ import { resolve as resolve2 } from "path";
97
+ import { parse as parse2, parseWorkspace as parseWorkspace2, validate as validate2, validateWorkspace as validateWorkspace2 } from "@product-model/core";
98
+ import { defineCommand as defineCommand2 } from "citty";
99
+ var validateCommand = defineCommand2({
100
+ meta: {
101
+ name: "validate",
102
+ description: "Validate a .product.mdx file"
103
+ },
104
+ args: {
105
+ file: {
106
+ type: "positional",
107
+ description: "Path to the .product.mdx file",
108
+ required: false
109
+ },
110
+ workspaceRoot: {
111
+ type: "string",
112
+ description: "Workspace root directory for multi-file validation"
113
+ },
114
+ title: {
115
+ type: "string",
116
+ description: "Document title",
117
+ default: "Untitled"
118
+ },
119
+ version: {
120
+ type: "string",
121
+ description: "Document version",
122
+ default: "0.1.0"
123
+ }
124
+ },
125
+ async run({ args }) {
126
+ try {
127
+ if (args.workspaceRoot) {
128
+ const workspaceRoot = resolve2(args.workspaceRoot);
129
+ const workspace = await parseWorkspace2({
130
+ workspaceRoot,
131
+ version: args.version,
132
+ title: args.title
133
+ });
134
+ const result2 = validateWorkspace2(workspace);
135
+ if (result2.valid) {
136
+ console.log(
137
+ `\u2713 ${workspaceRoot} workspace is valid (${workspace.modules.length} file(s))`
138
+ );
139
+ } else {
140
+ console.error(`\u2717 ${workspaceRoot} has ${result2.diagnostics.length} issue(s):
141
+ `);
142
+ for (const d of result2.diagnostics) {
143
+ const prefix = d.severity === "error" ? "ERROR" : d.severity === "warning" ? "WARN" : "INFO";
144
+ const pathInfo = d.path ? ` (${d.path})` : "";
145
+ const blockInfo = d.blockId ? ` [${d.blockId}]` : "";
146
+ console.error(` ${prefix}${pathInfo}${blockInfo}: ${d.message}`);
147
+ }
148
+ process.exit(1);
149
+ }
150
+ return;
151
+ }
152
+ if (!args.file) {
153
+ console.error('\u2717 Missing required argument: <file> (or use --workspace-root "<dir>")');
154
+ process.exit(1);
155
+ }
156
+ const filePath = resolve2(args.file);
157
+ const source = await readFile2(filePath, "utf-8");
158
+ const document = await parse2(source, {
159
+ version: args.version,
160
+ title: args.title
161
+ });
162
+ const result = validate2(document);
163
+ if (!result.valid) {
164
+ console.error(`\u2717 ${filePath} has ${result.diagnostics.length} issue(s):
165
+ `);
166
+ for (const d of result.diagnostics) {
167
+ const prefix = d.severity === "error" ? "ERROR" : d.severity === "warning" ? "WARN" : "INFO";
168
+ const blockInfo = d.blockId ? ` [${d.blockId}]` : "";
169
+ console.error(` ${prefix}${blockInfo}: ${d.message}`);
170
+ }
171
+ process.exit(1);
172
+ } else {
173
+ console.log(`\u2713 ${filePath} is valid`);
174
+ }
175
+ } catch (error) {
176
+ const target = args.workspaceRoot ? resolve2(args.workspaceRoot) : resolve2(args.file ?? ".");
177
+ console.error(`\u2717 Parse error in ${target}:`);
178
+ console.error(` ${error instanceof Error ? error.message : String(error)}`);
179
+ process.exit(1);
180
+ }
181
+ }
182
+ });
183
+
184
+ // src/index.ts
185
+ var main = defineCommand3({
186
+ meta: {
187
+ name: "pm",
188
+ version: "0.1.0",
189
+ description: "Product Model CLI \u2014 validate and build .product.mdx files"
190
+ },
191
+ subCommands: {
192
+ validate: validateCommand,
193
+ build: buildCommand
194
+ }
195
+ });
196
+ runMain(main);
197
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/commands/build.ts","../src/commands/validate.ts"],"sourcesContent":["import { defineCommand, runMain } from \"citty\";\nimport { buildCommand } from \"./commands/build.js\";\nimport { validateCommand } from \"./commands/validate.js\";\n\nconst main = defineCommand({\n\tmeta: {\n\t\tname: \"pm\",\n\t\tversion: \"0.1.0\",\n\t\tdescription: \"Product Model CLI — validate and build .product.mdx files\",\n\t},\n\tsubCommands: {\n\t\tvalidate: validateCommand,\n\t\tbuild: buildCommand,\n\t},\n});\n\nrunMain(main);\n","import { readFile, writeFile } from \"node:fs/promises\";\nimport { basename, resolve } from \"node:path\";\nimport { parse, parseWorkspace, validate, validateWorkspace } from \"@product-model/core\";\nimport { defineCommand } from \"citty\";\n\nexport const buildCommand = defineCommand({\n\tmeta: {\n\t\tname: \"build\",\n\t\tdescription: \"Parse, validate, and output a JSON AST from a .product.mdx file\",\n\t},\n\targs: {\n\t\tfile: {\n\t\t\ttype: \"positional\",\n\t\t\tdescription: \"Path to the .product.mdx file\",\n\t\t\trequired: false,\n\t\t},\n\t\tworkspaceRoot: {\n\t\t\ttype: \"string\",\n\t\t\tdescription: \"Workspace root directory for multi-file build\",\n\t\t},\n\t\toutput: {\n\t\t\ttype: \"string\",\n\t\t\talias: \"o\",\n\t\t\tdescription: \"Output file path (defaults to <filename>.json)\",\n\t\t},\n\t\ttitle: {\n\t\t\ttype: \"string\",\n\t\t\tdescription: \"Document title\",\n\t\t\tdefault: \"Untitled\",\n\t\t},\n\t\tversion: {\n\t\t\ttype: \"string\",\n\t\t\tdescription: \"Document version\",\n\t\t\tdefault: \"0.1.0\",\n\t\t},\n\t},\n\tasync run({ args }) {\n\t\tif (args.workspaceRoot) {\n\t\t\tconst workspaceRoot = resolve(args.workspaceRoot);\n\t\t\tconst workspace = await parseWorkspace({\n\t\t\t\tworkspaceRoot,\n\t\t\t\tversion: args.version,\n\t\t\t\ttitle: args.title,\n\t\t\t});\n\t\t\tconst result = validateWorkspace(workspace);\n\n\t\t\tif (!result.valid) {\n\t\t\t\tconsole.error(`✗ Validation failed with ${result.diagnostics.length} error(s):\\n`);\n\t\t\t\tfor (const d of result.diagnostics) {\n\t\t\t\t\tconst prefix =\n\t\t\t\t\t\td.severity === \"error\" ? \"ERROR\" : d.severity === \"warning\" ? \"WARN\" : \"INFO\";\n\t\t\t\t\tconst pathInfo = d.path ? ` (${d.path})` : \"\";\n\t\t\t\t\tconst blockInfo = d.blockId ? ` [${d.blockId}]` : \"\";\n\t\t\t\t\tconsole.error(` ${prefix}${pathInfo}${blockInfo}: ${d.message}`);\n\t\t\t\t}\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\n\t\t\tconst outputPath = args.output ? resolve(args.output) : resolve(\"workspace.json\");\n\t\t\tawait writeFile(outputPath, JSON.stringify(workspace, null, 2), \"utf-8\");\n\t\t\tconsole.log(`✓ Built ${outputPath}`);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!args.file) {\n\t\t\tconsole.error('✗ Missing required argument: <file> (or use --workspace-root \"<dir>\")');\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\tconst filePath = resolve(args.file);\n\t\tconst source = await readFile(filePath, \"utf-8\");\n\t\tconst document = await parse(source, {\n\t\t\tversion: args.version,\n\t\t\ttitle: args.title,\n\t\t});\n\t\tconst result = validate(document);\n\n\t\tif (!result.valid) {\n\t\t\tconsole.error(`✗ Validation failed with ${result.diagnostics.length} error(s):\\n`);\n\t\t\tfor (const d of result.diagnostics) {\n\t\t\t\tconst prefix =\n\t\t\t\t\td.severity === \"error\" ? \"ERROR\" : d.severity === \"warning\" ? \"WARN\" : \"INFO\";\n\t\t\t\tconst blockInfo = d.blockId ? ` [${d.blockId}]` : \"\";\n\t\t\t\tconsole.error(` ${prefix}${blockInfo}: ${d.message}`);\n\t\t\t}\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\tconst outputPath = args.output\n\t\t\t? resolve(args.output)\n\t\t\t: resolve(basename(filePath).replace(/\\.product\\.mdx$/, \".json\"));\n\n\t\tawait writeFile(outputPath, JSON.stringify(document, null, 2), \"utf-8\");\n\t\tconsole.log(`✓ Built ${outputPath}`);\n\t},\n});\n","import { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { parse, parseWorkspace, validate, validateWorkspace } from \"@product-model/core\";\nimport { defineCommand } from \"citty\";\n\nexport const validateCommand = defineCommand({\n\tmeta: {\n\t\tname: \"validate\",\n\t\tdescription: \"Validate a .product.mdx file\",\n\t},\n\targs: {\n\t\tfile: {\n\t\t\ttype: \"positional\",\n\t\t\tdescription: \"Path to the .product.mdx file\",\n\t\t\trequired: false,\n\t\t},\n\t\tworkspaceRoot: {\n\t\t\ttype: \"string\",\n\t\t\tdescription: \"Workspace root directory for multi-file validation\",\n\t\t},\n\t\ttitle: {\n\t\t\ttype: \"string\",\n\t\t\tdescription: \"Document title\",\n\t\t\tdefault: \"Untitled\",\n\t\t},\n\t\tversion: {\n\t\t\ttype: \"string\",\n\t\t\tdescription: \"Document version\",\n\t\t\tdefault: \"0.1.0\",\n\t\t},\n\t},\n\tasync run({ args }) {\n\t\ttry {\n\t\t\tif (args.workspaceRoot) {\n\t\t\t\tconst workspaceRoot = resolve(args.workspaceRoot);\n\t\t\t\tconst workspace = await parseWorkspace({\n\t\t\t\t\tworkspaceRoot,\n\t\t\t\t\tversion: args.version,\n\t\t\t\t\ttitle: args.title,\n\t\t\t\t});\n\t\t\t\tconst result = validateWorkspace(workspace);\n\n\t\t\t\tif (result.valid) {\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t`✓ ${workspaceRoot} workspace is valid (${workspace.modules.length} file(s))`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`✗ ${workspaceRoot} has ${result.diagnostics.length} issue(s):\\n`);\n\t\t\t\t\tfor (const d of result.diagnostics) {\n\t\t\t\t\t\tconst prefix =\n\t\t\t\t\t\t\td.severity === \"error\" ? \"ERROR\" : d.severity === \"warning\" ? \"WARN\" : \"INFO\";\n\t\t\t\t\t\tconst pathInfo = d.path ? ` (${d.path})` : \"\";\n\t\t\t\t\t\tconst blockInfo = d.blockId ? ` [${d.blockId}]` : \"\";\n\t\t\t\t\t\tconsole.error(` ${prefix}${pathInfo}${blockInfo}: ${d.message}`);\n\t\t\t\t\t}\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!args.file) {\n\t\t\t\tconsole.error('✗ Missing required argument: <file> (or use --workspace-root \"<dir>\")');\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\n\t\t\tconst filePath = resolve(args.file);\n\t\t\tconst source = await readFile(filePath, \"utf-8\");\n\t\t\tconst document = await parse(source, {\n\t\t\t\tversion: args.version,\n\t\t\t\ttitle: args.title,\n\t\t\t});\n\t\t\tconst result = validate(document);\n\n\t\t\tif (!result.valid) {\n\t\t\t\tconsole.error(`✗ ${filePath} has ${result.diagnostics.length} issue(s):\\n`);\n\t\t\t\tfor (const d of result.diagnostics) {\n\t\t\t\t\tconst prefix =\n\t\t\t\t\t\td.severity === \"error\" ? \"ERROR\" : d.severity === \"warning\" ? \"WARN\" : \"INFO\";\n\t\t\t\t\tconst blockInfo = d.blockId ? ` [${d.blockId}]` : \"\";\n\t\t\t\t\tconsole.error(` ${prefix}${blockInfo}: ${d.message}`);\n\t\t\t\t}\n\t\t\t\tprocess.exit(1);\n\t\t\t} else {\n\t\t\t\tconsole.log(`✓ ${filePath} is valid`);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst target = args.workspaceRoot ? resolve(args.workspaceRoot) : resolve(args.file ?? \".\");\n\t\t\tconsole.error(`✗ Parse error in ${target}:`);\n\t\t\tconsole.error(` ${error instanceof Error ? error.message : String(error)}`);\n\t\t\tprocess.exit(1);\n\t\t}\n\t},\n});\n"],"mappings":";;;AAAA,SAAS,iBAAAA,gBAAe,eAAe;;;ACAvC,SAAS,UAAU,iBAAiB;AACpC,SAAS,UAAU,eAAe;AAClC,SAAS,OAAO,gBAAgB,UAAU,yBAAyB;AACnE,SAAS,qBAAqB;AAEvB,IAAM,eAAe,cAAc;AAAA,EACzC,MAAM;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,EACd;AAAA,EACA,MAAM;AAAA,IACL,MAAM;AAAA,MACL,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACX;AAAA,IACA,eAAe;AAAA,MACd,MAAM;AAAA,MACN,aAAa;AAAA,IACd;AAAA,IACA,QAAQ;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACR,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACV;AAAA,EACD;AAAA,EACA,MAAM,IAAI,EAAE,KAAK,GAAG;AACnB,QAAI,KAAK,eAAe;AACvB,YAAM,gBAAgB,QAAQ,KAAK,aAAa;AAChD,YAAM,YAAY,MAAM,eAAe;AAAA,QACtC;AAAA,QACA,SAAS,KAAK;AAAA,QACd,OAAO,KAAK;AAAA,MACb,CAAC;AACD,YAAMC,UAAS,kBAAkB,SAAS;AAE1C,UAAI,CAACA,QAAO,OAAO;AAClB,gBAAQ,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,GAAG;AAC1F,cAAQ,MAAM,yBAAoB,MAAM,GAAG;AAC3C,cAAQ,MAAM,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAC3E,cAAQ,KAAK,CAAC;AAAA,IACf;AAAA,EACD;AACD,CAAC;;;AFxFD,IAAM,OAAOO,eAAc;AAAA,EAC1B,MAAM;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,EACd;AAAA,EACA,aAAa;AAAA,IACZ,UAAU;AAAA,IACV,OAAO;AAAA,EACR;AACD,CAAC;AAED,QAAQ,IAAI;","names":["defineCommand","result","outputPath","readFile","resolve","parse","parseWorkspace","validate","validateWorkspace","defineCommand","result","defineCommand"]}
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@product-model/cli",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "pm": "./dist/index.js"
7
+ },
8
+ "files": ["dist"],
9
+ "scripts": {
10
+ "build": "tsup",
11
+ "typecheck": "tsc --noEmit"
12
+ },
13
+ "dependencies": {
14
+ "@product-model/core": "workspace:*",
15
+ "citty": "^0.1.6"
16
+ },
17
+ "devDependencies": {
18
+ "@types/node": "^25.3.2",
19
+ "tsup": "^8.3.6",
20
+ "typescript": "^5.7.3"
21
+ },
22
+ "engines": {
23
+ "node": ">=22"
24
+ },
25
+ "license": "MIT"
26
+ }