opticore-cli 1.0.2 → 1.0.4

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/bin.cjs CHANGED
@@ -30,35 +30,75 @@ var import_cfonts = __toESM(require("cfonts"), 1);
30
30
  var import_cli = require("opticore-validator/cli");
31
31
  var import_cli2 = require("opticore-orm-orchestrator/cli");
32
32
  var import_cli3 = require("opticore-feature-component/cli");
33
+ var OPTICORE_CLI_VERSION = "1.0.2";
34
+ function printCommandList(program) {
35
+ const title = import_chalk.default.bold.hex("#427ff5");
36
+ const name = import_chalk.default.bold.hex("#003A9F");
37
+ const alias = import_chalk.default.dim;
38
+ const desc = import_chalk.default.dim;
39
+ const flag = import_chalk.default.hex("#427ff5");
40
+ console.log(`
41
+ ${title("Available Commands")}
42
+ `);
43
+ const walk = (cmd, path, depth) => {
44
+ for (const sub of cmd.commands) {
45
+ const fullPath = `${path} ${sub.name()}`;
46
+ const indent = " ".repeat(depth);
47
+ const aliases = sub.aliases();
48
+ const aliasText = aliases.length ? alias(` (${aliases.join(", ")})`) : "";
49
+ console.log(` ${indent}${name(fullPath)}${aliasText}`);
50
+ if (sub.description()) {
51
+ console.log(` ${indent} ${desc(sub.description())}`);
52
+ }
53
+ for (const opt of sub.options) {
54
+ console.log(` ${indent} ${flag(opt.flags.padEnd(22))}${desc(opt.description)}`);
55
+ }
56
+ walk(sub, fullPath, depth + 1);
57
+ }
58
+ };
59
+ walk(program, "opticore", 0);
60
+ console.log();
61
+ }
33
62
  function printBanner() {
34
63
  import_cfonts.default.say("OpticoreJs", {
35
64
  font: "block",
36
65
  align: "left",
37
- colors: ["yellow", "#FF6B35"],
66
+ colors: ["#D4E4FF", "#427ff5"],
38
67
  background: "transparent",
39
68
  letterSpacing: 1,
40
69
  lineHeight: 1,
41
70
  space: true,
42
71
  maxLength: "0"
43
72
  });
44
- const orange = import_chalk.default.bold.hex("#FF6B35");
45
- const dim = import_chalk.default.bold.yellow;
46
- console.log(` ${orange("O P T I C O R E")}`);
47
- console.log(` ${dim("Project CLI \u2014 validator, ORM, features")}
73
+ const blue = import_chalk.default.bold.hex("#427ff5");
74
+ const dim = import_chalk.default.bold.hex("#D4E4FF");
75
+ console.log(` ${blue("OPTICOREJS C L I")}`);
76
+ console.log(` ${dim("Validator \xB7 ORM Orchestrator \xB7 Feature Generator")}
77
+ `);
78
+ console.log(` ${import_chalk.default.bold.dim("Documentation")} ${import_chalk.default.underline.cyan("https://github.com/guyzoum77/opticore-cli#readme")}
48
79
  `);
49
80
  }
50
81
  function runOpticoreCli() {
51
82
  (0, import_cli.forceOpticoreColors)();
52
83
  printBanner();
53
84
  const program = new import_commander.Command();
54
- program.name("opticore").description(import_chalk.default.dim("Opticore CLI")).configureHelp(import_cli.helpConfig);
85
+ program.name("opticore").description(import_chalk.default.dim("Opticore CLI")).version(
86
+ OPTICORE_CLI_VERSION,
87
+ "-v, --version",
88
+ "Output the current version"
89
+ ).option("-l, --list", "List every command available across installed Opticore packages").configureHelp(import_cli.helpConfig);
55
90
  (0, import_cli.registerValidatorCommand)(program);
56
91
  (0, import_cli2.registerOrmCommand)(program);
57
92
  (0, import_cli3.registerFeatureCommand)(program);
58
- if (!process.argv.slice(2).length) {
93
+ const args = process.argv.slice(2);
94
+ if (!args.length) {
59
95
  program.outputHelp();
60
96
  process.exit(0);
61
97
  }
98
+ if (args.includes("-l") || args.includes("--list")) {
99
+ printCommandList(program);
100
+ process.exit(0);
101
+ }
62
102
  program.parse(process.argv);
63
103
  }
64
104
 
package/dist/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runOpticoreCli
4
- } from "./chunk-6DKVP6WN.js";
4
+ } from "./chunk-2KG2AC6E.js";
5
5
 
6
6
  // src/bin.ts
7
7
  runOpticoreCli();
@@ -0,0 +1,83 @@
1
+ // src/index.ts
2
+ import { Command } from "commander";
3
+ import chalk from "chalk";
4
+ import cfonts from "cfonts";
5
+ import { registerValidatorCommand, forceOpticoreColors, helpConfig } from "opticore-validator/cli";
6
+ import { registerOrmCommand } from "opticore-orm-orchestrator/cli";
7
+ import { registerFeatureCommand } from "opticore-feature-component/cli";
8
+ var OPTICORE_CLI_VERSION = "1.0.2";
9
+ function printCommandList(program) {
10
+ const title = chalk.bold.hex("#427ff5");
11
+ const name = chalk.bold.hex("#003A9F");
12
+ const alias = chalk.dim;
13
+ const desc = chalk.dim;
14
+ const flag = chalk.hex("#427ff5");
15
+ console.log(`
16
+ ${title("Available Commands")}
17
+ `);
18
+ const walk = (cmd, path, depth) => {
19
+ for (const sub of cmd.commands) {
20
+ const fullPath = `${path} ${sub.name()}`;
21
+ const indent = " ".repeat(depth);
22
+ const aliases = sub.aliases();
23
+ const aliasText = aliases.length ? alias(` (${aliases.join(", ")})`) : "";
24
+ console.log(` ${indent}${name(fullPath)}${aliasText}`);
25
+ if (sub.description()) {
26
+ console.log(` ${indent} ${desc(sub.description())}`);
27
+ }
28
+ for (const opt of sub.options) {
29
+ console.log(` ${indent} ${flag(opt.flags.padEnd(22))}${desc(opt.description)}`);
30
+ }
31
+ walk(sub, fullPath, depth + 1);
32
+ }
33
+ };
34
+ walk(program, "opticore", 0);
35
+ console.log();
36
+ }
37
+ function printBanner() {
38
+ cfonts.say("OpticoreJs", {
39
+ font: "block",
40
+ align: "left",
41
+ colors: ["#D4E4FF", "#427ff5"],
42
+ background: "transparent",
43
+ letterSpacing: 1,
44
+ lineHeight: 1,
45
+ space: true,
46
+ maxLength: "0"
47
+ });
48
+ const blue = chalk.bold.hex("#427ff5");
49
+ const dim = chalk.bold.hex("#D4E4FF");
50
+ console.log(` ${blue("OPTICOREJS C L I")}`);
51
+ console.log(` ${dim("Validator \xB7 ORM Orchestrator \xB7 Feature Generator")}
52
+ `);
53
+ console.log(` ${chalk.bold.dim("Documentation")} ${chalk.underline.cyan("https://github.com/guyzoum77/opticore-cli#readme")}
54
+ `);
55
+ }
56
+ function runOpticoreCli() {
57
+ forceOpticoreColors();
58
+ printBanner();
59
+ const program = new Command();
60
+ program.name("opticore").description(chalk.dim("Opticore CLI")).version(
61
+ OPTICORE_CLI_VERSION,
62
+ "-v, --version",
63
+ "Output the current version"
64
+ ).option("-l, --list", "List every command available across installed Opticore packages").configureHelp(helpConfig);
65
+ registerValidatorCommand(program);
66
+ registerOrmCommand(program);
67
+ registerFeatureCommand(program);
68
+ const args = process.argv.slice(2);
69
+ if (!args.length) {
70
+ program.outputHelp();
71
+ process.exit(0);
72
+ }
73
+ if (args.includes("-l") || args.includes("--list")) {
74
+ printCommandList(program);
75
+ process.exit(0);
76
+ }
77
+ program.parse(process.argv);
78
+ }
79
+
80
+ export {
81
+ OPTICORE_CLI_VERSION,
82
+ runOpticoreCli
83
+ };
package/dist/index.cjs CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ OPTICORE_CLI_VERSION: () => OPTICORE_CLI_VERSION,
33
34
  runOpticoreCli: () => runOpticoreCli
34
35
  });
35
36
  module.exports = __toCommonJS(index_exports);
@@ -39,38 +40,79 @@ var import_cfonts = __toESM(require("cfonts"), 1);
39
40
  var import_cli = require("opticore-validator/cli");
40
41
  var import_cli2 = require("opticore-orm-orchestrator/cli");
41
42
  var import_cli3 = require("opticore-feature-component/cli");
43
+ var OPTICORE_CLI_VERSION = "1.0.2";
44
+ function printCommandList(program) {
45
+ const title = import_chalk.default.bold.hex("#427ff5");
46
+ const name = import_chalk.default.bold.hex("#003A9F");
47
+ const alias = import_chalk.default.dim;
48
+ const desc = import_chalk.default.dim;
49
+ const flag = import_chalk.default.hex("#427ff5");
50
+ console.log(`
51
+ ${title("Available Commands")}
52
+ `);
53
+ const walk = (cmd, path, depth) => {
54
+ for (const sub of cmd.commands) {
55
+ const fullPath = `${path} ${sub.name()}`;
56
+ const indent = " ".repeat(depth);
57
+ const aliases = sub.aliases();
58
+ const aliasText = aliases.length ? alias(` (${aliases.join(", ")})`) : "";
59
+ console.log(` ${indent}${name(fullPath)}${aliasText}`);
60
+ if (sub.description()) {
61
+ console.log(` ${indent} ${desc(sub.description())}`);
62
+ }
63
+ for (const opt of sub.options) {
64
+ console.log(` ${indent} ${flag(opt.flags.padEnd(22))}${desc(opt.description)}`);
65
+ }
66
+ walk(sub, fullPath, depth + 1);
67
+ }
68
+ };
69
+ walk(program, "opticore", 0);
70
+ console.log();
71
+ }
42
72
  function printBanner() {
43
73
  import_cfonts.default.say("OpticoreJs", {
44
74
  font: "block",
45
75
  align: "left",
46
- colors: ["yellow", "#FF6B35"],
76
+ colors: ["#D4E4FF", "#427ff5"],
47
77
  background: "transparent",
48
78
  letterSpacing: 1,
49
79
  lineHeight: 1,
50
80
  space: true,
51
81
  maxLength: "0"
52
82
  });
53
- const orange = import_chalk.default.bold.hex("#FF6B35");
54
- const dim = import_chalk.default.bold.yellow;
55
- console.log(` ${orange("O P T I C O R E")}`);
56
- console.log(` ${dim("Project CLI \u2014 validator, ORM, features")}
83
+ const blue = import_chalk.default.bold.hex("#427ff5");
84
+ const dim = import_chalk.default.bold.hex("#D4E4FF");
85
+ console.log(` ${blue("OPTICOREJS C L I")}`);
86
+ console.log(` ${dim("Validator \xB7 ORM Orchestrator \xB7 Feature Generator")}
87
+ `);
88
+ console.log(` ${import_chalk.default.bold.dim("Documentation")} ${import_chalk.default.underline.cyan("https://github.com/guyzoum77/opticore-cli#readme")}
57
89
  `);
58
90
  }
59
91
  function runOpticoreCli() {
60
92
  (0, import_cli.forceOpticoreColors)();
61
93
  printBanner();
62
94
  const program = new import_commander.Command();
63
- program.name("opticore").description(import_chalk.default.dim("Opticore CLI")).configureHelp(import_cli.helpConfig);
95
+ program.name("opticore").description(import_chalk.default.dim("Opticore CLI")).version(
96
+ OPTICORE_CLI_VERSION,
97
+ "-v, --version",
98
+ "Output the current version"
99
+ ).option("-l, --list", "List every command available across installed Opticore packages").configureHelp(import_cli.helpConfig);
64
100
  (0, import_cli.registerValidatorCommand)(program);
65
101
  (0, import_cli2.registerOrmCommand)(program);
66
102
  (0, import_cli3.registerFeatureCommand)(program);
67
- if (!process.argv.slice(2).length) {
103
+ const args = process.argv.slice(2);
104
+ if (!args.length) {
68
105
  program.outputHelp();
69
106
  process.exit(0);
70
107
  }
108
+ if (args.includes("-l") || args.includes("--list")) {
109
+ printCommandList(program);
110
+ process.exit(0);
111
+ }
71
112
  program.parse(process.argv);
72
113
  }
73
114
  // Annotate the CommonJS export names for ESM import in node:
74
115
  0 && (module.exports = {
116
+ OPTICORE_CLI_VERSION,
75
117
  runOpticoreCli
76
118
  });
package/dist/index.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ declare const OPTICORE_CLI_VERSION = "1.0.2";
1
2
  declare function runOpticoreCli(): void;
2
3
 
3
- export { runOpticoreCli };
4
+ export { OPTICORE_CLI_VERSION, runOpticoreCli };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ declare const OPTICORE_CLI_VERSION = "1.0.2";
1
2
  declare function runOpticoreCli(): void;
2
3
 
3
- export { runOpticoreCli };
4
+ export { OPTICORE_CLI_VERSION, runOpticoreCli };
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import {
2
+ OPTICORE_CLI_VERSION,
2
3
  runOpticoreCli
3
- } from "./chunk-6DKVP6WN.js";
4
+ } from "./chunk-2KG2AC6E.js";
4
5
  export {
6
+ OPTICORE_CLI_VERSION,
5
7
  runOpticoreCli
6
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opticore-cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,42 +0,0 @@
1
- // src/index.ts
2
- import { Command } from "commander";
3
- import chalk from "chalk";
4
- import cfonts from "cfonts";
5
- import { registerValidatorCommand, forceOpticoreColors, helpConfig } from "opticore-validator/cli";
6
- import { registerOrmCommand } from "opticore-orm-orchestrator/cli";
7
- import { registerFeatureCommand } from "opticore-feature-component/cli";
8
- function printBanner() {
9
- cfonts.say("OpticoreJs", {
10
- font: "block",
11
- align: "left",
12
- colors: ["yellow", "#FF6B35"],
13
- background: "transparent",
14
- letterSpacing: 1,
15
- lineHeight: 1,
16
- space: true,
17
- maxLength: "0"
18
- });
19
- const orange = chalk.bold.hex("#FF6B35");
20
- const dim = chalk.bold.yellow;
21
- console.log(` ${orange("O P T I C O R E")}`);
22
- console.log(` ${dim("Project CLI \u2014 validator, ORM, features")}
23
- `);
24
- }
25
- function runOpticoreCli() {
26
- forceOpticoreColors();
27
- printBanner();
28
- const program = new Command();
29
- program.name("opticore").description(chalk.dim("Opticore CLI")).configureHelp(helpConfig);
30
- registerValidatorCommand(program);
31
- registerOrmCommand(program);
32
- registerFeatureCommand(program);
33
- if (!process.argv.slice(2).length) {
34
- program.outputHelp();
35
- process.exit(0);
36
- }
37
- program.parse(process.argv);
38
- }
39
-
40
- export {
41
- runOpticoreCli
42
- };