@decaf-ts/cli 0.4.17 → 0.5.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.
Files changed (83) hide show
  1. package/dist/cli.cjs +1 -1
  2. package/dist/cli.cjs.map +1 -1
  3. package/dist/cli.js +1 -1
  4. package/dist/cli.js.map +1 -1
  5. package/lib/{CliWrapper.cjs → cjs/CliWrapper.cjs} +1 -1
  6. package/lib/cjs/CliWrapper.js.map +1 -0
  7. package/lib/cjs/banners.js.map +1 -0
  8. package/lib/cjs/bin/cli.js.map +1 -0
  9. package/lib/cjs/build-module/cli-module.js.map +1 -0
  10. package/lib/cjs/constants.js.map +1 -0
  11. package/lib/cjs/environment.js.map +1 -0
  12. package/lib/cjs/index.js.map +1 -0
  13. package/lib/cjs/logging.js.map +1 -0
  14. package/lib/cjs/release-module/cli-module.js.map +1 -0
  15. package/lib/cjs/slogans.js.map +1 -0
  16. package/lib/cjs/types.js.map +1 -0
  17. package/lib/cjs/utils/command-forwarder.js.map +1 -0
  18. package/lib/cjs/utils-module/cli-module.js.map +1 -0
  19. package/lib/cjs/utils.js.map +1 -0
  20. package/lib/{version.cjs → cjs/version.cjs} +1 -1
  21. package/lib/cjs/version.js.map +1 -0
  22. package/lib/esm/CliWrapper.js +1 -1
  23. package/lib/esm/CliWrapper.js.map +1 -1
  24. package/lib/esm/version.js +1 -1
  25. package/lib/{version.d.ts → types/version.d.ts} +1 -1
  26. package/package.json +15 -12
  27. package/lib/CliWrapper.js.map +0 -1
  28. package/lib/banners.js.map +0 -1
  29. package/lib/bin/cli.js.map +0 -1
  30. package/lib/build-module/cli-module.js.map +0 -1
  31. package/lib/constants.js.map +0 -1
  32. package/lib/environment.js.map +0 -1
  33. package/lib/esm/CliWrapper.d.ts +0 -156
  34. package/lib/esm/banners.d.ts +0 -3
  35. package/lib/esm/bin/cli.d.ts +0 -25
  36. package/lib/esm/build-module/cli-module.d.ts +0 -2
  37. package/lib/esm/constants.d.ts +0 -8
  38. package/lib/esm/environment.d.ts +0 -7
  39. package/lib/esm/version.d.ts +0 -14
  40. package/lib/index.d.ts +0 -16
  41. package/lib/index.js.map +0 -1
  42. package/lib/logging.d.ts +0 -3
  43. package/lib/logging.js.map +0 -1
  44. package/lib/release-module/cli-module.d.ts +0 -2
  45. package/lib/release-module/cli-module.js.map +0 -1
  46. package/lib/slogans.d.ts +0 -40
  47. package/lib/slogans.js.map +0 -1
  48. package/lib/types.d.ts +0 -11
  49. package/lib/types.js.map +0 -1
  50. package/lib/utils/command-forwarder.d.ts +0 -10
  51. package/lib/utils/command-forwarder.js.map +0 -1
  52. package/lib/utils-module/cli-module.d.ts +0 -2
  53. package/lib/utils-module/cli-module.js.map +0 -1
  54. package/lib/utils.d.ts +0 -70
  55. package/lib/utils.js.map +0 -1
  56. package/lib/version.js.map +0 -1
  57. /package/lib/{banners.cjs → cjs/banners.cjs} +0 -0
  58. /package/lib/{bin → cjs/bin}/cli.cjs +0 -0
  59. /package/lib/{build-module → cjs/build-module}/cli-module.cjs +0 -0
  60. /package/lib/{constants.cjs → cjs/constants.cjs} +0 -0
  61. /package/lib/{environment.cjs → cjs/environment.cjs} +0 -0
  62. /package/lib/{index.cjs → cjs/index.cjs} +0 -0
  63. /package/lib/{logging.cjs → cjs/logging.cjs} +0 -0
  64. /package/lib/{release-module → cjs/release-module}/cli-module.cjs +0 -0
  65. /package/lib/{slogans.cjs → cjs/slogans.cjs} +0 -0
  66. /package/lib/{types.cjs → cjs/types.cjs} +0 -0
  67. /package/lib/{utils → cjs/utils}/command-forwarder.cjs +0 -0
  68. /package/lib/{utils-module → cjs/utils-module}/cli-module.cjs +0 -0
  69. /package/lib/{utils.cjs → cjs/utils.cjs} +0 -0
  70. /package/lib/{CliWrapper.d.ts → types/CliWrapper.d.ts} +0 -0
  71. /package/lib/{banners.d.ts → types/banners.d.ts} +0 -0
  72. /package/lib/{bin → types/bin}/cli.d.ts +0 -0
  73. /package/lib/{build-module → types/build-module}/cli-module.d.ts +0 -0
  74. /package/lib/{constants.d.ts → types/constants.d.ts} +0 -0
  75. /package/lib/{environment.d.ts → types/environment.d.ts} +0 -0
  76. /package/lib/{esm → types}/index.d.ts +0 -0
  77. /package/lib/{esm → types}/logging.d.ts +0 -0
  78. /package/lib/{esm → types}/release-module/cli-module.d.ts +0 -0
  79. /package/lib/{esm → types}/slogans.d.ts +0 -0
  80. /package/lib/{esm → types}/types.d.ts +0 -0
  81. /package/lib/{esm → types}/utils/command-forwarder.d.ts +0 -0
  82. /package/lib/{esm → types}/utils-module/cli-module.d.ts +0 -0
  83. /package/lib/{esm → types}/utils.d.ts +0 -0
@@ -1,156 +0,0 @@
1
- import { Command } from "commander";
2
- import { LoggedClass } from "@decaf-ts/logging";
3
- /**
4
- * @description Utility class to handle CLI functionality from all Decaf modules
5
- * @summary This class provides a wrapper around Commander.js to handle CLI commands from different Decaf modules.
6
- * It crawls the filesystem to find CLI modules, loads them, and registers their commands.
7
- *
8
- * @param {string} [basePath] The base path to look for modules in. Defaults to `./`
9
- * @param {number} [crawlLevels] Number of folder levels to crawl to find modules from the basePath. Defaults to 4
10
- *
11
- * @example
12
- * // Create a new CLI wrapper and run it with custom options
13
- * const cli = new CliWrapper('./src', 2);
14
- * cli.run(process.argv).then(() => {
15
- * console.log('CLI commands executed successfully');
16
- * });
17
- *
18
- * @class CliWrapper
19
- */
20
- export declare class CliWrapper extends LoggedClass {
21
- private basePath;
22
- private crawlLevels;
23
- private _command?;
24
- private modules;
25
- private includedModuleNames;
26
- private readonly rootPath;
27
- private moduleSlogans;
28
- private globalSlogans;
29
- private readonly logLevelAttached;
30
- private bannerPrinted;
31
- private static env;
32
- constructor(basePath?: string, crawlLevels?: number);
33
- /**
34
- * @description Retrieves and initializes the Commander Command object
35
- * @summary Lazy-loads the Command object, initializing it with the package name, description, and version
36
- * @return {Command} The initialized Command object
37
- * @private
38
- */
39
- private get command();
40
- /**
41
- * @description Loads and registers a module from a file
42
- * @summary Dynamically imports a CLI module from the specified file path, initializes it, and registers it in the modules collection
43
- *
44
- * @param {string} filePath Path to the module file to load
45
- * @param {string} rootPath Repository root path to find the package.json
46
- * @return {Promise<string>} A promise that resolves to the module name
47
- *
48
- * @private
49
- * @mermaid
50
- * sequenceDiagram
51
- * participant CliWrapper
52
- * participant CLIUtils
53
- * participant Module
54
- *
55
- * CliWrapper->>CLIUtils: loadFromFile(filePath)
56
- * CLIUtils-->>CliWrapper: module
57
- * CliWrapper->>CliWrapper: Get module name
58
- * CliWrapper->>Command: new Command()
59
- * Command-->>CliWrapper: cmd
60
- * CliWrapper->>CLIUtils: initialize(cmd, path.dirname(rootPath))
61
- * CliWrapper->>Module: module()
62
- * Note over CliWrapper,Module: Handle Promise if needed
63
- * Module-->>CliWrapper: Command instance
64
- * CliWrapper->>CliWrapper: Store in modules[name]
65
- * CliWrapper-->>CliWrapper: Return name
66
- */
67
- private load;
68
- private registerModule;
69
- /**
70
- * @description Finds and loads all CLI modules in the basePath
71
- * @summary Uses the crawl method to find all CLI modules in the specified base path,
72
- * then loads and registers each module as a subcommand
73
- *
74
- * @return {Promise<void>} A promise that resolves when all modules are loaded
75
- *
76
- * @private
77
- * @mermaid
78
- * sequenceDiagram
79
- * participant CliWrapper
80
- * participant Filesystem
81
- * participant Module
82
- *
83
- * CliWrapper->>Filesystem: Join basePath with cwd
84
- * CliWrapper->>CliWrapper: crawl(basePath, crawlLevels)
85
- * CliWrapper-->>CliWrapper: modules[]
86
- * loop For each module
87
- * alt Not @decaf-ts/cli
88
- * CliWrapper->>CliWrapper: load(module, cwd)
89
- * CliWrapper-->>CliWrapper: name
90
- * CliWrapper->>CliWrapper: Check if command exists
91
- * alt Command doesn't exist
92
- * CliWrapper->>Command: command(name).addCommand(modules[name])
93
- * end
94
- * end
95
- * end
96
- * CliWrapper->>Console: Log loaded modules
97
- */
98
- private boot;
99
- private loadIncludedModules;
100
- private loadModulesFromPath;
101
- private getScopePackageRoots;
102
- private findEnclosingNodeModules;
103
- private getSiblingPackageRoots;
104
- private getHostPath;
105
- private getPackageNameFromRoot;
106
- private ensureLogLevelSupport;
107
- private updateLogLevel;
108
- private resolveLogLevel;
109
- /**
110
- * @description Recursively searches for CLI module files in the directory structure
111
- * @summary Crawls the basePath up to the specified number of folder levels to find files named according to CLI_FILE_NAME
112
- *
113
- * @param {string} basePath The absolute base path to start searching in
114
- * @param {number} [levels=2] The maximum number of directory levels to crawl
115
- * @return {string[]} An array of file paths to CLI modules
116
- *
117
- * @private
118
- */
119
- private crawl;
120
- private findModuleRoot;
121
- protected getSlogan(priorityModule?: string): string;
122
- private otherSlogans;
123
- private buildBalancedSloganPool;
124
- private repeatToLength;
125
- private ensureGlobalSlogans;
126
- private collectSlogansFromPath;
127
- private collectSlogansFromScope;
128
- private collectSlogansFromSiblingPackages;
129
- private extractSloganStrings;
130
- private isCommandInstance;
131
- protected printBanner(args?: string[]): () => void;
132
- private getPriorityModule;
133
- /**
134
- * @description Executes the CLI with the provided arguments
135
- * @summary Boots the CLI by loading all modules, then parses and executes the command specified in the arguments
136
- *
137
- * @param {string[]} [args=process.argv] Command line arguments to parse and execute
138
- * @return {Promise<void>} A promise that resolves when the command execution is complete
139
- *
140
- * @mermaid
141
- * sequenceDiagram
142
- * participant Client
143
- * participant CliWrapper
144
- * participant Command
145
- *
146
- * Client->>CliWrapper: run(args)
147
- * CliWrapper->>CliWrapper: boot()
148
- * Note over CliWrapper: Loads all modules
149
- * CliWrapper->>Command: parseAsync(args)
150
- * Command-->>CliWrapper: result
151
- * CliWrapper-->>Client: result
152
- */
153
- run(args?: string[]): Promise<Command>;
154
- static accumulateEnvironment(obj: object): void;
155
- static getEnv(): any;
156
- }
@@ -1,3 +0,0 @@
1
- export declare const mainBanner = "";
2
- export declare const banners: string[];
3
- export declare const colorPalettes: Record<string, string[]>;
@@ -1,25 +0,0 @@
1
- /**
2
- * BIN_CALL_PLACEHOLDER - DO NOT REMOVE
3
- */
4
- /**
5
- * @description Decaf-ts' CLI entry point
6
- * @summary This file serves as the main executable entry point for the Decaf CLI. It creates a CliWrapper instance
7
- * and runs it with the process arguments. The CLI will crawl the current working directory for files called
8
- * CLI_FILE_NAME within the @decaf-ts namespace and load them as subcommands.
9
- *
10
- * @example
11
- * // Run a module command
12
- * $ npx decaf <module name> <module command> ...<module command options>
13
- *
14
- * // Get help for a specific module
15
- * $ npx decaf help <module name>
16
- *
17
- * // List all imported modules
18
- * $ npx decaf list
19
- *
20
- * // Get general CLI help
21
- * $ npx decaf help
22
- *
23
- * @memberOf module:CLI
24
- */
25
- export {};
@@ -1,2 +0,0 @@
1
- import { Command } from "commander";
2
- export default function buildModule(): Command;
@@ -1,8 +0,0 @@
1
- /**
2
- * @description The filename that identifies Decaf CLI modules
3
- * @summary The standard filename for CLI module files where each library must export a single CliModule function
4
- *
5
- * @const CLI_FILE_NAME
6
- * @memberOf module:CLI
7
- */
8
- export declare const CLI_FILE_NAME = "cli-module";
@@ -1,7 +0,0 @@
1
- import { LoggingConfig } from "@decaf-ts/logging";
2
- export type DecafCliEnvironment = LoggingConfig & {
3
- banner: boolean;
4
- cliModuleRoot: string;
5
- };
6
- export declare const DefaultCliEnvironment: DecafCliEnvironment;
7
- export declare const DecafCLieEnvironment: any;
@@ -1,14 +0,0 @@
1
- /**
2
- * @description Stores the current package version
3
- * @summary A constant that holds the version string of the package, which is replaced during build
4
- * @const VERSION
5
- * @memberOf module:CLI
6
- */
7
- export declare const VERSION = "0.4.16";
8
- /**
9
- * @description Stores the current package version
10
- * @summary A constant that holds the version string of the package, which is replaced during build
11
- * @const VERSION
12
- * @memberOf module:CLI
13
- */
14
- export declare const PACKAGE_NAME = "@decaf-ts/cli";
package/lib/index.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export * from "./CliWrapper";
2
- export * from "./environment";
3
- /**
4
- * @description Decaf-ts' CLI module
5
- * @summary This file will crawl the current working directory for files called {@link CLI_FILE_NAME}
6
- * within the @decaf-ts namespace and load them as subcommands. It serves as the main entry point
7
- * for the CLI functionality, exporting the CliWrapper class and VERSION constant.
8
- *
9
- * @example
10
- * run module command - $ npx decaf <module name> <module command> ...<module command options>
11
- * get module help - $ npx decaf help <module name>;
12
- * list imported modules - $ npx decaf list;
13
- * get cli help - $ npx decaf help;
14
- *
15
- * @module CLI
16
- */
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAA6B;AAC7B,oDAA8B;AAC9B;;;;;;;;;;;;;GAaG"}
package/lib/logging.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- import { Logger } from "@decaf-ts/logging";
3
- export declare function getCmdLogger(cmd: Command): Logger;
@@ -1 +0,0 @@
1
- {"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":";;AAGA,oCAWC;AAbD,+CAAoD;AAEpD,SAAgB,YAAY,CAAC,GAAY;IACvC,MAAM,WAAW,GAAU,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IACxB,OAAO,MAAM,EAAE,CAAC;QACd,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACzB,CAAC;IACD,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,KAAa,EAAE,EAAE,EAAE,EAAE;QAC7D,OAAO,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,EAAE,iBAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAClB,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1,2 +0,0 @@
1
- import { Command } from "commander";
2
- export default function releaseModule(): Command;
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-module.js","sourceRoot":"","sources":["../../src/release-module/cli-module.ts"],"names":[],"mappings":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AAI,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/lib/slogans.d.ts DELETED
@@ -1,40 +0,0 @@
1
- import { Logger } from "@decaf-ts/logging";
2
- /**
3
- * @description Reads and parses slogans from workdocs/assets/slogans.json.
4
- * @summary Attempts to read a slogans.json file from the workdocs/assets directory at the given base path and returns its parsed contents as an array.
5
- *
6
- * @param {string} basePath - The base directory path where workdocs/assets/slogans.json should exist.
7
- * @return {any[] | undefined} The parsed array from slogans.json, or undefined if the file doesn't exist.
8
- *
9
- * @function readSlogans
10
- *
11
- * @memberOf module:utils
12
- */
13
- export declare function readSlogans(log: Logger, basePath: string): {
14
- Slogan: string;
15
- }[] | undefined;
16
- /**
17
- * @description Collects slogans from a base path and all @decaf scoped packages.
18
- * @summary Recursively collects slogans.json files from the given base path and all subdirectories under node_modules/@decaf/*. Results are stored in an object keyed by the package name (from package.json).
19
- *
20
- * @param {string} basePath - The base directory path to start collecting from.
21
- * @return {Record<string, any[]>} An object mapping package names to their slogans arrays.
22
- *
23
- * @function collectSlogans
24
- *
25
- * @memberOf module:utils
26
- */
27
- export declare function collectSlogans(log: Logger, basePath: string): Record<string, any[]>;
28
- /**
29
- * @description Flattens collected slogans with weighted selection for a priority package.
30
- * @summary Given a collection of slogans and a priority package name, returns a flat array where slogans from the priority package have a 30-40% chance of appearing at any given position.
31
- *
32
- * @param {Record<string, any[]>} slogansMap - Object mapping package names to slogan arrays.
33
- * @param {string} priorityPackage - The package name whose slogans should be prioritized.
34
- * @return {any[]} A flat array of all slogans with weighted distribution.
35
- *
36
- * @function flattenSlogansWithPriority
37
- *
38
- * @memberOf module:utils
39
- */
40
- export declare function flattenSlogansWithPriority(log: Logger, slogansMap: Record<string, any[]>, priorityPackage: string): any[];
@@ -1 +0,0 @@
1
- {"version":3,"file":"slogans.js","sourceRoot":"","sources":["../src/slogans.ts"],"names":[],"mappings":";;;;;AAeA,kCAkBC;AAaD,wCAmDC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AAC;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC;QAEnD,IAAI,WAAW,IAAI,aAAa,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;YAC1D,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;QAChD,CAAC;aAAM,IAAI,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;YAC5C,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QAC1C,CAAC;aAAM,IAAI,aAAa,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;YAClD,6BAA6B;YAC7B,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,GAAG,CAAC,KAAK,CACP,aAAa,MAAM,CAAC,MAAM,+BAA+B,eAAe,GAAG,CAC5E,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/lib/types.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { Command } from "commander";
2
- /**
3
- * @description Function type for Decaf CLI modules
4
- * @summary Defines the signature for CLI module functions that each Decaf module must export under the CLI_FILE_NAME file
5
- * The function should return a Command object or a Promise that resolves to a Command object
6
- *
7
- * @typedef {Function} CliModule
8
- * @return {Command|Promise<Command>} A Command object or Promise that resolves to a Command object
9
- * @memberOf module:CLI
10
- */
11
- export type CliModule = () => Command | Promise<Command>;
package/lib/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- import { Command } from "commander";
2
- export type OptionSpec = {
3
- name: string;
4
- flag: string;
5
- type: "boolean" | "string";
6
- allowFalse?: boolean;
7
- };
8
- export declare function parseOptionalBoolean(value?: string): boolean;
9
- export declare function buildValueMap(command: Command, specs: OptionSpec[]): Record<string, unknown>;
10
- export declare function runUtilsCommand(utilsCommand: object, values: Record<string, unknown>, invoker: Command): Promise<void>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-forwarder.js","sourceRoot":"","sources":["../../src/utils/command-forwarder.ts"],"names":[],"mappings":";;AAWA,oDAGC;AAED,sCAgBC;AAED,0CAkBC;AAnDD,2CAAgF;AAChF,8CAA0C;AAS1C,SAAgB,oBAAoB,CAAC,KAAc;IACjD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;AACnD,CAAC;AAED,SAAgB,aAAa,CAC3B,OAAgB,EAChB,KAAmB;IAEnB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAA6B,CAAC;IACvD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,KAAK,KAAK,KAAK,CAAC,EAAE,CAAC;gBAC3D,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;YACzB,CAAC;QACH,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnF,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAA6B,CAAC,CAAC;AACpC,CAAC;AAEM,KAAK,UAAU,eAAe,CACnC,YAAoB,EACpB,MAA+B,EAC/B,OAAgB;IAEhB,MAAM,GAAG,GAAG,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,4BAAoB,EAAE,MAAM,CAAC,CAAC;IAChE,MAAM,SAAS,GAAI,YAAwC,CAAC,KAAK,CAAC,CAAC;IACnE,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IAED,GAAG,CAAC,KAAK,CAAC,aAAa,YAAY,CAAC,WAAW,CAAC,IAAI,+BAA+B,CAAC,CAAC;IACrF,IAAK,OAAmC,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,eAAY,CAAC,CAAC;QAC1B,OAAO;IACT,CAAC;IACD,MAAM,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC"}
@@ -1,2 +0,0 @@
1
- import { Command } from "commander";
2
- export default function utils(): Command;
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-module.js","sourceRoot":"","sources":["../../src/utils-module/cli-module.ts"],"names":[],"mappings":";;;;;AAuFA,wBAQC;AA/FD,yCAAoC;AACpC,4CAAoB;AACpB,gDAAwB;AACxB,8CAA0C;AAC1C,qDAAgD;AAChD,oDAA2C;AAC3C,+CAAgD;AAEhD,MAAM,SAAS,GAAG,IAAI,mBAAO,EAAE;KAC5B,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,6DAA6D,CAAC;KAC1E,MAAM,CAAC,mBAAmB,EAAE,uCAAuC,CAAC;KACpE,MAAM,CAAC,KAAK,EAAE,OAAY,EAAE,EAAE;IAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC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,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC1C,MAAM;QACR,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,MAAM,GAAG,GAAa,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC5B,MAAM;QACR,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,GAAG,GAAa,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAClB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,SAAwB,KAAK;IAC3B,MAAM,QAAQ,GAAG,IAAI,mBAAO,EAAE;SAC3B,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,qDAAqD,CAAC,CAAC;IAEtE,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;IACvC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
package/lib/utils.d.ts DELETED
@@ -1,70 +0,0 @@
1
- import { Command } from "commander";
2
- import { CliModule } from "./types";
3
- /**
4
- * @description Utility class for CLI operations
5
- * @summary A static utility class that provides methods for loading modules, retrieving package information, and initializing CLI commands
6
- *
7
- * @example
8
- * // Initialize a Command object with package information
9
- * const command = new Command();
10
- * CLIUtils.initialize(command, './path/to/package');
11
- *
12
- * // Load a CLI module from a file
13
- * const module = await CLIUtils.loadFromFile('./path/to/cli-module.js');
14
- *
15
- * @class CLIUtils
16
- */
17
- export declare class CLIUtils {
18
- /**
19
- * @description Dynamically imports a module file
20
- * @summary Loads a JavaScript file and returns it as a CliModule, handling both ESM and CommonJS formats
21
- *
22
- * @param {string} path The file path to the module to load
23
- * @return {Promise<CliModule>} A promise that resolves to the loaded CliModule
24
- */
25
- static loadFromFile(path: string): Promise<CliModule>;
26
- /**
27
- * @description Normalizes module imports to handle both ESM and CommonJS formats
28
- * @summary Properly imports JavaScript files regardless of their module format by handling the ESM wrapper for CommonJS modules
29
- *
30
- * @template T The type of the imported module
31
- * @param {Promise<T>} importPromise The promise returned by the dynamic import
32
- * @return {Promise<T>} A promise that resolves to the normalized module
33
- * @private
34
- */
35
- static normalizeImport<T>(importPromise: Promise<T>): Promise<T>;
36
- /**
37
- * @description Initializes a Command object with package information
38
- * @summary Sets up a Commander Command object with the package name, description, and version from the package.json file
39
- *
40
- * @param {Command} command The Command object to initialize
41
- * @param {string} [basePath] The base path where the package.json file is located, defaults to the current working directory
42
- * @return {void}
43
- */
44
- static initialize(command: Command, basePath: string): void;
45
- /**
46
- * @description Retrieves and parses the package.json file
47
- * @summary Reads the package.json file from the specified path and parses it into a JavaScript object
48
- *
49
- * @param {string} basePath The base path where the package.json file is located
50
- * @return {Record<string, unknown>} The parsed package.json content as an object
51
- * @private
52
- */
53
- private static getPackage;
54
- /**
55
- * @description Returns the version from package.json
56
- * @summary Retrieves the version field from the package.json file at the specified path
57
- *
58
- * @param {string} basePath The base path where the package.json file is located
59
- * @return {string} The package version string
60
- */
61
- static packageVersion(basePath: string): string;
62
- /**
63
- * @description Returns the name from package.json
64
- * @summary Retrieves the name field from the package.json file at the specified path and extracts the package name without the scope
65
- *
66
- * @param {string} basePath The base path where the package.json file is located
67
- * @return {string} The package name without the scope (e.g., "cli" from "@decaf-ts/cli")
68
- */
69
- static packageName(basePath: string): string;
70
- }
package/lib/utils.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;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KAAK,CAAC,EAAE,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,CAAC,QAAgB;QACpC,OAAO,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAW,CAAC;IAC5D,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,QAAgB;QACjC,MAAM,IAAI,GAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC1E,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/B,CAAC;CACF;AA1FD,4BA0FC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAEhD;;;;;GAKG;AACU,QAAA,OAAO,GAAG,aAAa,CAAC;AAErC;;;;;GAKG;AACU,QAAA,YAAY,GAAG,aAAa,CAAC;AAE1C,qBAAQ,CAAC,eAAe,CAAC,oBAAY,EAAE,eAAO,CAAC,CAAC"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes