@darkhorseprojects/circuitry 0.3.8 → 0.3.9

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.
Files changed (2) hide show
  1. package/dist/cli.js +12 -7
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -253,13 +253,18 @@ var usage = () => {
253
253
  if (!command || !filename) usage();
254
254
  try {
255
255
  if (command === "parse") {
256
- const text = filename === "--stdin" ? await new Promise((resolve, reject) => {
257
- let data = "";
258
- process.stdin.on("data", (chunk) => data += chunk);
259
- process.stdin.on("end", () => resolve(data));
260
- process.stdin.on("error", reject);
261
- }) : await readFile2(filename, "utf8");
262
- process.stdout.write(JSON.stringify(parseYamlData(text)));
256
+ if (filename.endsWith(".circuitry.yaml") || filename.endsWith(".circuitry.yml")) {
257
+ const loaded = await loadCircuitryGraphFile(filename);
258
+ process.stdout.write(JSON.stringify({ graph: loaded.graph, origins: loaded.origins }));
259
+ } else {
260
+ const text = filename === "--stdin" ? await new Promise((resolve, reject) => {
261
+ let data = "";
262
+ process.stdin.on("data", (chunk) => data += chunk);
263
+ process.stdin.on("end", () => resolve(data));
264
+ process.stdin.on("error", reject);
265
+ }) : await readFile2(filename, "utf8");
266
+ process.stdout.write(JSON.stringify(parseYamlData(text)));
267
+ }
263
268
  } else if (command === "check") {
264
269
  const loaded = await loadCircuitryGraphFile(filename);
265
270
  const result = validateCircuitryExecutionGraphWithStandard(loaded.graph);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darkhorseprojects/circuitry",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",