@cwygoda/service-catalog-cli 1.0.1

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
+ #!/usr/bin/env node
2
+ import '../dist/index.js';
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const buildCommand: Command;
3
+ //# sourceMappingURL=build.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.command.d.ts","sourceRoot":"","sources":["../../src/commands/build.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmDpC,eAAO,MAAM,YAAY,SAKT,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { Command } from 'commander';
2
+ import { resolve } from 'node:path';
3
+ import chalk from 'chalk';
4
+ import { createFilesystemLoader, createJsonWriter, buildServiceGraph, } from '@cwygoda/service-catalog-core';
5
+ async function build(options) {
6
+ const inputPath = resolve(options.input);
7
+ const outputPath = resolve(options.output, 'catalog.json');
8
+ console.log(chalk.blue('Building catalog...'));
9
+ console.log(chalk.gray(` Input: ${inputPath}`));
10
+ console.log(chalk.gray(` Output: ${outputPath}`));
11
+ const loader = createFilesystemLoader({ bpmnLint: options.bpmnLint });
12
+ const writer = createJsonWriter();
13
+ try {
14
+ const catalog = await loader.load(inputPath);
15
+ console.log(chalk.gray(` Found ${String(catalog.services.length)} service(s)`));
16
+ // Build service graph
17
+ const graph = buildServiceGraph(catalog);
18
+ console.log(chalk.gray(` Built graph: ${String(graph.nodes.length)} nodes, ${String(graph.edges.length)} edges`));
19
+ // Add graph to catalog output
20
+ const catalogWithGraph = { ...catalog, graph };
21
+ await writer.write(catalogWithGraph, outputPath);
22
+ console.log(chalk.green('✓ Catalog built successfully'));
23
+ }
24
+ catch (error) {
25
+ console.error(chalk.red('✗ Build failed:'));
26
+ console.error(chalk.red(` ${error instanceof Error ? error.message : String(error)}`));
27
+ process.exit(1);
28
+ }
29
+ }
30
+ export const buildCommand = new Command('build')
31
+ .description('Build the service catalog from source files')
32
+ .option('-i, --input <path>', 'Input directory containing service definitions', '.')
33
+ .option('-o, --output <path>', 'Output directory for built catalog', 'dist')
34
+ .option('--bpmn-lint <level>', 'BPMN lint level: error, warn, off', 'warn')
35
+ .action(build);
36
+ //# sourceMappingURL=build.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.command.js","sourceRoot":"","sources":["../../src/commands/build.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,+BAA+B,CAAC;AAQvC,KAAK,UAAU,KAAK,CAAC,OAAqB;IACxC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAE3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,SAAS,EAAE,CAAC,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,UAAU,EAAE,CAAC,CAAC,CAAC;IAEnD,MAAM,MAAM,GAAG,sBAAsB,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAElC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,K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EAAE,MAAM,CAAC;KAC1E,MAAM,CAAC,KAAK,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ import { Command } from 'commander';
2
+ import { buildCommand } from './commands/build.command.js';
3
+ const program = new Command();
4
+ program
5
+ .name('service-catalog')
6
+ .description('Build service catalogs from service descriptions')
7
+ .version('0.0.0');
8
+ program.addCommand(buildCommand);
9
+ program.parse();
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,iBAAiB,CAAC;KACvB,WAAW,CAAC,kDAAkD,CAAC;KAC/D,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAEjC,OAAO,CAAC,KAAK,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@cwygoda/service-catalog-cli",
3
+ "version": "1.0.1",
4
+ "type": "module",
5
+ "bin": {
6
+ "service-catalog": "./bin/service-catalog.js"
7
+ },
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "bin"
17
+ ],
18
+ "dependencies": {
19
+ "chalk": "^5.4.0",
20
+ "commander": "^13.0.0",
21
+ "@cwygoda/service-catalog-core": "1.0.1"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^22.0.0",
25
+ "typescript": "^5.7.0"
26
+ },
27
+ "scripts": {
28
+ "build": "tsc",
29
+ "typecheck": "tsc --noEmit"
30
+ }
31
+ }