opticore-feature-component 1.0.7 → 1.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.
- package/dist/{core-TFP6J3AE.js → chunk-X2ZHQ6T5.js} +421 -430
- package/dist/cli.cjs +3062 -0
- package/dist/cli.d.cts +13 -0
- package/dist/cli.d.ts +13 -0
- package/dist/cli.js +28 -0
- package/dist/index.cjs +1452 -1788
- package/dist/index.js +4 -1
- package/package.json +13 -1
package/dist/cli.d.cts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
|
|
3
|
+
declare function handleFeatureCliError(err: unknown): void;
|
|
4
|
+
/**
|
|
5
|
+
* Embeds this package's CLI as a `feature` command on a host program (e.g.
|
|
6
|
+
* a project's unified `opticore` CLI). Unlike validator/orm-orchestrator
|
|
7
|
+
* this tool has no sub-actions of its own — running `opticore feature`
|
|
8
|
+
* launches the same interactive architecture-choice flow as the standalone
|
|
9
|
+
* `create-feature-module` bin.
|
|
10
|
+
*/
|
|
11
|
+
declare function registerFeatureCommand(program: Command): Command;
|
|
12
|
+
|
|
13
|
+
export { handleFeatureCliError, registerFeatureCommand };
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
|
|
3
|
+
declare function handleFeatureCliError(err: unknown): void;
|
|
4
|
+
/**
|
|
5
|
+
* Embeds this package's CLI as a `feature` command on a host program (e.g.
|
|
6
|
+
* a project's unified `opticore` CLI). Unlike validator/orm-orchestrator
|
|
7
|
+
* this tool has no sub-actions of its own — running `opticore feature`
|
|
8
|
+
* launches the same interactive architecture-choice flow as the standalone
|
|
9
|
+
* `create-feature-module` bin.
|
|
10
|
+
*/
|
|
11
|
+
declare function registerFeatureCommand(program: Command): Command;
|
|
12
|
+
|
|
13
|
+
export { handleFeatureCliError, registerFeatureCommand };
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runFeatureCommand
|
|
3
|
+
} from "./chunk-X2ZHQ6T5.js";
|
|
4
|
+
|
|
5
|
+
// src/cli/registerFeatureCommand.ts
|
|
6
|
+
import chalk from "chalk";
|
|
7
|
+
function handleFeatureCliError(err) {
|
|
8
|
+
const msg = err instanceof Error ? err.message : "An unexpected error occurred";
|
|
9
|
+
console.error("");
|
|
10
|
+
console.error(
|
|
11
|
+
chalk.bgRed.white.bold(" ERROR ") + chalk.red(` ${msg}`)
|
|
12
|
+
);
|
|
13
|
+
console.error("");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
function registerFeatureCommand(program) {
|
|
17
|
+
return program.command("feature").description(chalk.dim("Interactively scaffold a new feature module (clean/MVC/layered/custom architecture)")).action(async () => {
|
|
18
|
+
try {
|
|
19
|
+
await runFeatureCommand();
|
|
20
|
+
} catch (e) {
|
|
21
|
+
handleFeatureCliError(e);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
handleFeatureCliError,
|
|
27
|
+
registerFeatureCommand
|
|
28
|
+
};
|