@corsair-dev/cli 0.1.20 → 0.1.22

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/dist/index.js CHANGED
@@ -2486,7 +2486,7 @@ import { fileURLToPath } from "url";
2486
2486
  import { Command } from "commander";
2487
2487
 
2488
2488
  // package.json
2489
- var version = "0.1.20";
2489
+ var version = "0.1.22";
2490
2490
 
2491
2491
  // src/utils/subscription.ts
2492
2492
  async function runWebhookSubscription(cwd, pluginId) {
@@ -3266,6 +3266,27 @@ var WatchRenewCommand = class extends BaseCommand {
3266
3266
 
3267
3267
  // src/index.ts
3268
3268
  init_corsair_instance();
3269
+
3270
+ // src/utils/format-cli-error.ts
3271
+ var CLI_ERROR_PREFIX = "[#corsair]:";
3272
+ function formatCliError(err) {
3273
+ const raw = err instanceof Error ? err.message : String(err);
3274
+ const collapsed = raw.replace(/\s*[\r\n]+\s*/g, " ").trim();
3275
+ const body = collapsed.replace(/^\[#corsair\]:\s*/i, "").trim();
3276
+ return `${CLI_ERROR_PREFIX} ${body}`;
3277
+ }
3278
+
3279
+ // src/utils/run-cli.ts
3280
+ async function runCli(input) {
3281
+ try {
3282
+ await input.program.parseAsync(input.argv);
3283
+ } catch (err) {
3284
+ console.error(formatCliError(err));
3285
+ process.exit(1);
3286
+ }
3287
+ }
3288
+
3289
+ // src/index.ts
3269
3290
  function createProgram() {
3270
3291
  const program = new Command();
3271
3292
  program.name("corsair");
@@ -3309,7 +3330,10 @@ function detectIsMainModule() {
3309
3330
  }
3310
3331
  }
3311
3332
  if (detectIsMainModule()) {
3312
- createProgram().parse(normalizeLegacyArgs(process.argv));
3333
+ void runCli({
3334
+ program: createProgram(),
3335
+ argv: normalizeLegacyArgs(process.argv)
3336
+ });
3313
3337
  }
3314
3338
  export {
3315
3339
  createProgram,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,OAAO,EACN,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,0BAA0B,CAAC;AAElC,iBAAS,aAAa,IAAI,OAAO,CA0BhC;AA2BD,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,OAAO,EACN,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,0BAA0B,CAAC;AAGlC,iBAAS,aAAa,IAAI,OAAO,CA0BhC;AA8BD,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function formatCliError(err: unknown): string;
2
+ //# sourceMappingURL=format-cli-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-cli-error.d.ts","sourceRoot":"","sources":["../../../src/utils/format-cli-error.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAKnD"}
@@ -0,0 +1,6 @@
1
+ import type { Command } from 'commander';
2
+ export declare function runCli(input: {
3
+ program: Command;
4
+ argv: string[];
5
+ }): Promise<void>;
6
+ //# sourceMappingURL=run-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-cli.d.ts","sourceRoot":"","sources":["../../../src/utils/run-cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,wBAAsB,MAAM,CAAC,KAAK,EAAE;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;CACf,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@corsair-dev/cli",
3
- "version": "0.1.20",
4
- "description": "",
3
+ "version": "0.1.22",
4
+ "description": "Command-line tool for Corsair, the open-source integration layer. Scaffold a project, add integrations, and run your app.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "c12": "^3.3.3",
25
25
  "commander": "^14.0.3",
26
26
  "zod": "^4.1.13",
27
- "corsair": "0.1.117"
27
+ "corsair": "0.1.131"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/jest": "^29.5.14",
@@ -38,9 +38,21 @@
38
38
  "tsx": "^4.20.6",
39
39
  "typescript": "^5.3.3"
40
40
  },
41
- "keywords": [],
42
- "author": "",
41
+ "keywords": [
42
+ "corsair",
43
+ "cli",
44
+ "integrations",
45
+ "oauth",
46
+ "scaffold"
47
+ ],
48
+ "author": "Corsair (https://corsair.dev)",
43
49
  "license": "Apache-2.0",
50
+ "homepage": "https://corsair.dev",
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/corsairdev/corsair.git",
54
+ "directory": "packages/cli"
55
+ },
44
56
  "files": [
45
57
  "dist"
46
58
  ],