kimu-cli 0.1.1 ā 1.0.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/CHANGELOG.md +47 -2
- package/README.md +18 -7
- package/bin/kimu.js +7 -5
- package/dist/commands/install.d.ts +3 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +58 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +167 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/new.d.ts +16 -0
- package/dist/commands/new.d.ts.map +1 -0
- package/dist/commands/new.js +316 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/types/cli-types.d.ts +7 -0
- package/dist/types/cli-types.d.ts.map +1 -1
- package/dist/utils/module-installer.d.ts +11 -0
- package/dist/utils/module-installer.d.ts.map +1 -0
- package/dist/utils/module-installer.js +21 -0
- package/dist/utils/module-installer.js.map +1 -0
- package/dist/utils/registry.d.ts +8 -0
- package/dist/utils/registry.d.ts.map +1 -0
- package/dist/utils/registry.js +109 -0
- package/dist/utils/registry.js.map +1 -0
- package/docs/README.md +126 -0
- package/docs/command-kimu.md +14 -0
- package/docs/commands/create.md +60 -15
- package/docs/commands/install.md +52 -8
- package/docs/commands/list.md +39 -51
- package/docs/commands/new.md +626 -0
- package/docs/configuration-files.md +192 -0
- package/docs/getting-started.md +386 -0
- package/docs/index.md +57 -27
- package/docs/intro.md +30 -8
- package/docs/quick-reference.md +335 -0
- package/package.json +101 -101
- package/templates/generators/README.md +76 -0
- package/templates/generators/extension/config.json +45 -0
- package/templates/generators/extension/templates/component.ts.template +66 -0
- package/templates/generators/extension/templates/style.css.template +40 -0
- package/templates/generators/extension/templates/view.html.template +9 -0
- package/templates/generators/module/config.json +35 -0
- package/templates/generators/module/templates/README.md.template +62 -0
- package/templates/generators/module/templates/module.ts.template +36 -0
- package/templates/generators/module/templates/service.ts.template +41 -0
- package/docs/command-kimu-new.md +0 -207
- package/docs/command-kimu-old.md +0 -51
package/CHANGELOG.md
CHANGED
|
@@ -5,10 +5,55 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [
|
|
8
|
+
## [0.2.0] - 2025-01-XX
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
|
-
-
|
|
11
|
+
- **Template-Based Generator System**: Complete refactoring of `kimu new` command
|
|
12
|
+
- **Extensible Architecture**: Add new component types via JSON configuration without code changes
|
|
13
|
+
- **Generator Discovery**: Automatic detection of available generators in `templates/generators/`
|
|
14
|
+
- **Placeholder System**: Rich placeholder support ({{name}}, {{className}}, {{camelName}}, etc.)
|
|
15
|
+
- **`kimu new:list`**: New command to list all available component generators
|
|
16
|
+
- Template configurations for `extension` and `module` generators
|
|
17
|
+
- Comprehensive template files with examples and documentation
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- **Breaking**: Removed hardcoded component generation logic from `new` command
|
|
21
|
+
- Generators are now loaded dynamically from `templates/generators/` directory
|
|
22
|
+
- Improved error messages with suggestions to use `kimu new:list`
|
|
23
|
+
- Enhanced documentation for `kimu new` command with custom generator guide
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
- TypeScript type safety improvements in generator system
|
|
27
|
+
- Proper handling of nested configuration paths in registration
|
|
28
|
+
|
|
29
|
+
## [0.1.1] - 2025-01-13
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
- Fixed version command reading from package.json instead of hardcoded value
|
|
33
|
+
- Corrected CLI_VERSION constant to read dynamically
|
|
34
|
+
|
|
35
|
+
## [0.1.0] - 2025-01-13
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- **`kimu create`**: Project scaffolding using npm package (kimu-core)
|
|
39
|
+
- **`kimu new`**: Component generation (extension and module)
|
|
40
|
+
- **`kimu version`**: Display CLI and project versions
|
|
41
|
+
- **`kimu info`**: Project diagnostics and information
|
|
42
|
+
- Published to npm as `kimu-cli`
|
|
43
|
+
- Comprehensive documentation suite
|
|
44
|
+
- Getting started guide and quick reference
|
|
45
|
+
|
|
46
|
+
### Features
|
|
47
|
+
- npm-based project creation (no git clone required)
|
|
48
|
+
- Automatic project configuration generation
|
|
49
|
+
- Extension and module generators
|
|
50
|
+
- Component registration in manifest files
|
|
51
|
+
- Colored CLI output and loading indicators
|
|
52
|
+
|
|
53
|
+
## [0.0.1] - 2025-09-02
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
- Initial release of KIMU-CLI (internal version)
|
|
12
57
|
- Basic project structure and configuration
|
|
13
58
|
- `version` command with detailed information
|
|
14
59
|
- `info` command for project diagnostics
|
package/README.md
CHANGED
|
@@ -51,24 +51,30 @@ Your application will be available at `http://localhost:5173/`
|
|
|
51
51
|
## Features
|
|
52
52
|
|
|
53
53
|
- š **Project Creation**: Create new KIMU applications from templates with `kimu create`
|
|
54
|
-
-
|
|
55
|
-
-
|
|
54
|
+
- šØ **Component Generation**: Extensible template-based system with `kimu new`
|
|
55
|
+
- š **Custom Generators**: Add new component types via JSON configuration
|
|
56
|
+
- š¦ **Module Management**: Install and manage modules from kimu-modules registry (mock, real registry coming soon)
|
|
57
|
+
- š§© **Extension Management**: Install and manage UI extensions (mock, real registry coming soon)
|
|
58
|
+
- š **Package Discovery**: List and browse available modules and extensions
|
|
56
59
|
- š§ **Build Tools**: Build and serve KIMU applications with optimization (planned)
|
|
57
60
|
- š **Diagnostics**: Project health checks and compatibility validation (planned)
|
|
58
|
-
- š **Ecosystem Integration**: Discover and explore KIMU packages (planned)
|
|
59
61
|
|
|
60
62
|
## Current Status
|
|
61
63
|
|
|
62
64
|
ā
**Available Commands:**
|
|
63
|
-
- `kimu create` - Create new KIMU projects
|
|
65
|
+
- `kimu create` - Create new KIMU projects from npm package
|
|
66
|
+
- `kimu new <type> <name>` - Generate components from templates (extension, module, etc.)
|
|
67
|
+
- `kimu new:list` - List all available component generators
|
|
68
|
+
- `kimu install module <name>` - Install KIMU modules (mock, real registry coming soon)
|
|
69
|
+
- `kimu install extension <name>` - Install KIMU extensions (mock, real registry coming soon)
|
|
70
|
+
- `kimu list modules/extensions/installed` - Browse and discover packages
|
|
64
71
|
- `kimu info` - Show project information
|
|
65
72
|
- `kimu version` - Show version information
|
|
66
73
|
- `kimu help` - Command help system
|
|
67
74
|
|
|
68
75
|
ā³ **Planned Commands:**
|
|
69
|
-
- `kimu
|
|
76
|
+
- `kimu remove` - Package removal
|
|
70
77
|
- `kimu dev/build/serve` - Development workflow
|
|
71
|
-
- `kimu list` - Browse packages
|
|
72
78
|
- `kimu doctor` - Project diagnostics
|
|
73
79
|
|
|
74
80
|
|
|
@@ -101,14 +107,17 @@ If you use KIMU-CLI or want to improve it, open an issue or a pull request.
|
|
|
101
107
|
- [Command Reference: kimu](docs/command-kimu.md)
|
|
102
108
|
- [Distribution & Installation Guide](docs/distribution.md)
|
|
103
109
|
|
|
110
|
+
|
|
104
111
|
### Available Commands
|
|
105
112
|
- [Command: create](docs/commands/create.md)
|
|
113
|
+
- [Command: new](docs/commands/new.md) - **Extensible template-based generator system**
|
|
114
|
+
- [Command: install](docs/commands/install.md) ā
- **Install modules and extensions**
|
|
115
|
+
- [Command: list](docs/commands/list.md) ā
- **Browse and discover packages**
|
|
106
116
|
- [Command: info](docs/commands/info.md)
|
|
107
117
|
- [Command: help](docs/commands/help.md)
|
|
108
118
|
- [Command: version](docs/commands/version.md)
|
|
109
119
|
|
|
110
120
|
### Planned Commands
|
|
111
|
-
- [Command: install](docs/commands/install.md) ā³
|
|
112
121
|
- [Command: remove](docs/commands/remove.md) ā³
|
|
113
122
|
- [Command: list](docs/commands/list.md) ā³
|
|
114
123
|
- [Command: build](docs/commands/build.md) ā³
|
|
@@ -177,6 +186,8 @@ kimu create --help
|
|
|
177
186
|
|
|
178
187
|
### ā
Available Commands
|
|
179
188
|
- `kimu create <name>` - Create a new KIMU project with basic structure
|
|
189
|
+
- `kimu new <type> <name>` - Generate components from templates (extension, module, etc.)
|
|
190
|
+
- `kimu new:list` - List all available component generators
|
|
180
191
|
- `kimu info` - Show information about the current KIMU project
|
|
181
192
|
- `kimu version` - Show KIMU-CLI version and system information
|
|
182
193
|
- `kimu help` - Show help for all commands or specific command
|
package/bin/kimu.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* KIMU-CLI - Official command-line interface for the KIMU framework ecosystem
|
|
@@ -13,10 +13,11 @@ const { setupVersionCommand } = require('../dist/commands/version');
|
|
|
13
13
|
const { setupInfoCommand } = require('../dist/commands/info');
|
|
14
14
|
const { setupHelpCommand } = require('../dist/commands/help');
|
|
15
15
|
const { setupCreateCommand } = require('../dist/commands/create');
|
|
16
|
+
const { setupNewCommand } = require('../dist/commands/new');
|
|
16
17
|
// TODO: Import other commands as they are implemented
|
|
17
|
-
|
|
18
|
+
const { setupInstallCommand } = require('../dist/commands/install');
|
|
19
|
+
const { setupListCommand } = require('../dist/commands/list');
|
|
18
20
|
// const { setupBuildCommand } = require('../dist/commands/build');
|
|
19
|
-
// const { setupListCommand } = require('../dist/commands/list');
|
|
20
21
|
|
|
21
22
|
const program = new Command();
|
|
22
23
|
|
|
@@ -33,11 +34,12 @@ setupVersionCommand(program);
|
|
|
33
34
|
setupInfoCommand(program);
|
|
34
35
|
setupHelpCommand(program);
|
|
35
36
|
setupCreateCommand(program);
|
|
37
|
+
setupNewCommand(program);
|
|
36
38
|
|
|
37
39
|
// TODO: Setup other commands as they are implemented
|
|
38
|
-
|
|
40
|
+
setupInstallCommand(program);
|
|
41
|
+
setupListCommand(program);
|
|
39
42
|
// setupBuildCommand(program);
|
|
40
|
-
// setupListCommand(program);
|
|
41
43
|
|
|
42
44
|
// Parse command line arguments
|
|
43
45
|
program.parse(process.argv);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuD1D"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.setupInstallCommand = setupInstallCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const ora_1 = __importDefault(require("ora"));
|
|
9
|
+
const module_installer_1 = require("../utils/module-installer");
|
|
10
|
+
function setupInstallCommand(program) {
|
|
11
|
+
const install = program
|
|
12
|
+
.command('install')
|
|
13
|
+
.alias('i')
|
|
14
|
+
.description('Install modules or extensions for your KIMU project');
|
|
15
|
+
// kimu install module <name>
|
|
16
|
+
install
|
|
17
|
+
.command('module <name>')
|
|
18
|
+
.alias('m')
|
|
19
|
+
.description('Install a KIMU module from the registry')
|
|
20
|
+
.option('--save-dev', 'install as development dependency')
|
|
21
|
+
.option('--registry <url>', 'use custom registry URL')
|
|
22
|
+
.option('--version <version>', 'install specific version')
|
|
23
|
+
.option('--force', 'force reinstall if already installed')
|
|
24
|
+
.option('--verbose', 'show detailed installation progress')
|
|
25
|
+
.action(async (name, options) => {
|
|
26
|
+
const spinner = (0, ora_1.default)(`Installing module ${name}...`).start();
|
|
27
|
+
try {
|
|
28
|
+
await (0, module_installer_1.installModuleOrExtension)(name, { ...options, type: 'module' });
|
|
29
|
+
spinner.succeed(chalk_1.default.green(`ā
Module ${name} installed successfully!`));
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
spinner.fail(chalk_1.default.red(`ā Failed to install module ${name}: ${error.message}`));
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
// kimu install extension <name>
|
|
37
|
+
install
|
|
38
|
+
.command('extension <name>')
|
|
39
|
+
.alias('e')
|
|
40
|
+
.description('Install a KIMU extension from the registry')
|
|
41
|
+
.option('--save-dev', 'install as development dependency')
|
|
42
|
+
.option('--registry <url>', 'use custom registry URL')
|
|
43
|
+
.option('--version <version>', 'install specific version')
|
|
44
|
+
.option('--force', 'force reinstall if already installed')
|
|
45
|
+
.option('--verbose', 'show detailed installation progress')
|
|
46
|
+
.action(async (name, options) => {
|
|
47
|
+
const spinner = (0, ora_1.default)(`Installing extension ${name}...`).start();
|
|
48
|
+
try {
|
|
49
|
+
await (0, module_installer_1.installModuleOrExtension)(name, { ...options, type: 'extension' });
|
|
50
|
+
spinner.succeed(chalk_1.default.green(`ā
Extension ${name} installed successfully!`));
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
spinner.fail(chalk_1.default.red(`ā Failed to install extension ${name}: ${error.message}`));
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":";;;;;AAKA,kDAuDC;AA3DD,kDAA0B;AAC1B,8CAAsB;AACtB,gEAAqE;AAErE,SAAgB,mBAAmB,CAAC,OAAgB;IAClD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,SAAS,CAAC;SAClB,KAAK,CAAC,GAAG,CAAC;SACV,WAAW,CAAC,qDAAqD,CAAC,CAAC;IAEtE,6BAA6B;IAC7B,OAAO;SACJ,OAAO,CAAC,eAAe,CAAC;SACxB,KA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,CAAC;SAC1D,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,OAAY,EAAE,EAAE;QAC3C,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,wBAAwB,IAAI,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;QAC/D,IAAI,CAAC;YACH,MAAM,IAAA,2CAAwB,EAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;YACxE,OAAO,CAAC,OAAO,CACb,eAAK,CAAC,KAAK,CAAC,eAAe,IAAI,0BAA0B,CAAC,CAC3D,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CACV,eAAK,CAAC,GAAG,CAAC,iCAAiC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CACrE,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BpC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuHvD"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.setupListCommand = setupListCommand;
|
|
40
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
41
|
+
const ora_1 = __importDefault(require("ora"));
|
|
42
|
+
const fs = __importStar(require("fs-extra"));
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const registry_1 = require("../utils/registry");
|
|
45
|
+
async function getInstalledPackages() {
|
|
46
|
+
try {
|
|
47
|
+
const configPath = path.join(process.cwd(), 'kimu.config.json');
|
|
48
|
+
if (await fs.pathExists(configPath)) {
|
|
49
|
+
const config = await fs.readJson(configPath);
|
|
50
|
+
return {
|
|
51
|
+
modules: config.modules?.installed || [],
|
|
52
|
+
extensions: config.extensions?.installed || [],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
// Ignore errors, return empty
|
|
58
|
+
}
|
|
59
|
+
return { modules: [], extensions: [] };
|
|
60
|
+
}
|
|
61
|
+
function setupListCommand(program) {
|
|
62
|
+
const list = program
|
|
63
|
+
.command('list')
|
|
64
|
+
.alias('l')
|
|
65
|
+
.description('List available or installed modules and extensions');
|
|
66
|
+
// kimu list modules
|
|
67
|
+
list
|
|
68
|
+
.command('modules')
|
|
69
|
+
.alias('m')
|
|
70
|
+
.description('List available modules from the registry')
|
|
71
|
+
.option('--verbose', 'show detailed information')
|
|
72
|
+
.action(async (options) => {
|
|
73
|
+
const spinner = (0, ora_1.default)('Fetching available modules...').start();
|
|
74
|
+
try {
|
|
75
|
+
const registry = registry_1.KimuRegistry.getInstance();
|
|
76
|
+
const modules = await registry.listModules();
|
|
77
|
+
const installed = await getInstalledPackages();
|
|
78
|
+
spinner.succeed(chalk_1.default.green(`ā
Found ${modules.length} modules`));
|
|
79
|
+
console.log('\nš¦ Available Modules:\n');
|
|
80
|
+
modules.forEach((mod) => {
|
|
81
|
+
const isInstalled = installed.modules.includes(mod.name);
|
|
82
|
+
const statusIcon = isInstalled ? chalk_1.default.green('ā') : chalk_1.default.gray('ā');
|
|
83
|
+
const statusText = isInstalled ? chalk_1.default.green('[installed]') : '';
|
|
84
|
+
console.log(` ${statusIcon} ${chalk_1.default.cyan(mod.name)} ${chalk_1.default.gray(`v${mod.version}`)} ${statusText}`);
|
|
85
|
+
if (options.verbose) {
|
|
86
|
+
console.log(` ${chalk_1.default.dim(mod.description)}`);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
console.log('');
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
spinner.fail(chalk_1.default.red(`ā Failed to fetch modules: ${error.message}`));
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
// kimu list extensions
|
|
97
|
+
list
|
|
98
|
+
.command('extensions')
|
|
99
|
+
.alias('e')
|
|
100
|
+
.description('List available extensions from the registry')
|
|
101
|
+
.option('--verbose', 'show detailed information')
|
|
102
|
+
.action(async (options) => {
|
|
103
|
+
const spinner = (0, ora_1.default)('Fetching available extensions...').start();
|
|
104
|
+
try {
|
|
105
|
+
const registry = registry_1.KimuRegistry.getInstance();
|
|
106
|
+
const extensions = await registry.listExtensions();
|
|
107
|
+
const installed = await getInstalledPackages();
|
|
108
|
+
spinner.succeed(chalk_1.default.green(`ā
Found ${extensions.length} extensions`));
|
|
109
|
+
console.log('\nš§© Available Extensions:\n');
|
|
110
|
+
extensions.forEach((ext) => {
|
|
111
|
+
const isInstalled = installed.extensions.includes(ext.name);
|
|
112
|
+
const statusIcon = isInstalled ? chalk_1.default.green('ā') : chalk_1.default.gray('ā');
|
|
113
|
+
const statusText = isInstalled ? chalk_1.default.green('[installed]') : '';
|
|
114
|
+
console.log(` ${statusIcon} ${chalk_1.default.cyan(ext.name)} ${chalk_1.default.gray(`v${ext.version}`)} ${statusText}`);
|
|
115
|
+
if (options.verbose) {
|
|
116
|
+
console.log(` ${chalk_1.default.dim(ext.description)}`);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
console.log('');
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
spinner.fail(chalk_1.default.red(`ā Failed to fetch extensions: ${error.message}`));
|
|
123
|
+
process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
// kimu list installed
|
|
127
|
+
list
|
|
128
|
+
.command('installed')
|
|
129
|
+
.alias('i')
|
|
130
|
+
.description('List installed modules and extensions in your project')
|
|
131
|
+
.option('--verbose', 'show detailed information')
|
|
132
|
+
.action(async () => {
|
|
133
|
+
const spinner = (0, ora_1.default)('Checking installed packages...').start();
|
|
134
|
+
try {
|
|
135
|
+
const installed = await getInstalledPackages();
|
|
136
|
+
const total = installed.modules.length + installed.extensions.length;
|
|
137
|
+
if (total === 0) {
|
|
138
|
+
spinner.info(chalk_1.default.yellow('ā ļø No installed packages detected'));
|
|
139
|
+
console.log('\nš Installed Packages:\n');
|
|
140
|
+
console.log(' (No installed packages found in kimu.config.json)');
|
|
141
|
+
console.log('');
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
spinner.succeed(chalk_1.default.green(`ā
Found ${total} installed packages`));
|
|
145
|
+
console.log('\nš Installed Packages:\n');
|
|
146
|
+
if (installed.modules.length > 0) {
|
|
147
|
+
console.log(chalk_1.default.bold(' Modules:'));
|
|
148
|
+
installed.modules.forEach((name) => {
|
|
149
|
+
console.log(` ${chalk_1.default.green('ā')} ${chalk_1.default.cyan(name)}`);
|
|
150
|
+
});
|
|
151
|
+
console.log('');
|
|
152
|
+
}
|
|
153
|
+
if (installed.extensions.length > 0) {
|
|
154
|
+
console.log(chalk_1.default.bold(' Extensions:'));
|
|
155
|
+
installed.extensions.forEach((name) => {
|
|
156
|
+
console.log(` ${chalk_1.default.green('ā')} ${chalk_1.default.cyan(name)}`);
|
|
157
|
+
});
|
|
158
|
+
console.log('');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
spinner.fail(chalk_1.default.red(`ā Failed to check installed packages: ${error.message}`));
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,4CAuHC;AAhJD,kDAA0B;AAC1B,8CAAsB;AACtB,6CAA+B;AAC/B,2CAA6B;AAC7B,gDAAiD;AAEjD,KAAK,UAAU,oBAAoB;I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+
* New command implementation - Create components from templates
|
|
3
|
+
* Template-based generator system for extensibility
|
|
4
|
+
*/
|
|
5
|
+
import { Command } from 'commander';
|
|
6
|
+
import { Logger } from '../utils/logger';
|
|
7
|
+
import { NewOptions } from '../types/cli-types';
|
|
8
|
+
/**
|
|
9
|
+
* Setup new command
|
|
10
|
+
*/
|
|
11
|
+
export declare function setupNewCommand(program: Command): void;
|
|
12
|
+
/**
|
|
13
|
+
* Handle new command
|
|
14
|
+
*/
|
|
15
|
+
export declare function handleNewCommand(type: string, name: string, options: NewOptions, logger: Logger): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=new.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAwRhD;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6CtD;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAyCf"}
|