kaven-cli 0.1.0-alpha.1 → 0.3.5

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 (50) hide show
  1. package/README.md +284 -45
  2. package/README.pt-BR.md +334 -0
  3. package/dist/commands/auth/login.js +97 -19
  4. package/dist/commands/auth/logout.js +4 -6
  5. package/dist/commands/auth/whoami.js +12 -11
  6. package/dist/commands/cache/index.js +43 -0
  7. package/dist/commands/config/index.js +128 -0
  8. package/dist/commands/init/index.js +209 -0
  9. package/dist/commands/init-ci/index.js +153 -0
  10. package/dist/commands/license/index.js +10 -0
  11. package/dist/commands/license/status.js +44 -0
  12. package/dist/commands/license/tier-table.js +46 -0
  13. package/dist/commands/marketplace/browse.js +219 -0
  14. package/dist/commands/marketplace/install.js +233 -29
  15. package/dist/commands/marketplace/list.js +94 -16
  16. package/dist/commands/module/doctor.js +143 -38
  17. package/dist/commands/module/publish.js +291 -0
  18. package/dist/commands/upgrade/check.js +162 -0
  19. package/dist/commands/upgrade/index.js +218 -0
  20. package/dist/core/AuthService.js +207 -14
  21. package/dist/core/CacheManager.js +151 -0
  22. package/dist/core/ConfigManager.js +165 -0
  23. package/dist/core/EnvManager.js +196 -0
  24. package/dist/core/ErrorRecovery.js +191 -0
  25. package/dist/core/LicenseService.js +118 -0
  26. package/dist/core/ModuleDoctor.js +290 -4
  27. package/dist/core/ModuleInstaller.js +136 -2
  28. package/dist/core/ProjectInitializer.js +154 -0
  29. package/dist/core/RegistryResolver.js +94 -0
  30. package/dist/core/ScriptRunner.js +72 -0
  31. package/dist/core/SignatureVerifier.js +75 -0
  32. package/dist/index.js +265 -20
  33. package/dist/infrastructure/MarketplaceClient.js +388 -64
  34. package/dist/infrastructure/errors.js +61 -0
  35. package/dist/types/auth.js +2 -0
  36. package/dist/types/marketplace.js +2 -0
  37. package/package.json +23 -4
  38. package/dist/commands/modules/add.js +0 -53
  39. package/dist/commands/modules/list.js +0 -40
  40. package/dist/commands/modules/remove.js +0 -54
  41. package/dist/core/api/KavenApiClient.js +0 -61
  42. package/dist/core/auth/AuthManager.js +0 -91
  43. package/dist/core/modules/Injector.js +0 -86
  44. package/dist/core/modules/ModuleInstaller.js +0 -63
  45. package/dist/core/modules/ModuleManager.js +0 -59
  46. package/dist/core/modules/ModuleRemover.js +0 -60
  47. package/dist/lib/config.js +0 -66
  48. package/dist/lib/errors.js +0 -32
  49. package/dist/lib/logger.js +0 -70
  50. package/dist/types/module.js +0 -49
@@ -1,70 +0,0 @@
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.Logger = void 0;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const ora_1 = __importDefault(require("ora"));
9
- class Logger {
10
- static info(message) {
11
- console.log(chalk_1.default.blue('ℹ'), message);
12
- }
13
- static succeedSpinner(message) {
14
- this.success(message);
15
- }
16
- static success(message) {
17
- if (this.spinner) {
18
- this.spinner.succeed(chalk_1.default.green(message));
19
- this.spinner = null;
20
- }
21
- else {
22
- console.log(chalk_1.default.green('✔'), message);
23
- }
24
- }
25
- static warn(message) {
26
- console.log(chalk_1.default.yellow('⚠'), message);
27
- }
28
- static error(message, error) {
29
- if (this.spinner) {
30
- this.spinner.fail(chalk_1.default.red(message));
31
- this.spinner = null;
32
- }
33
- else {
34
- console.error(chalk_1.default.red('✖'), message);
35
- }
36
- if (error instanceof Error) {
37
- console.error(chalk_1.default.dim(error.stack));
38
- }
39
- else if (error) {
40
- console.error(chalk_1.default.dim(JSON.stringify(error)));
41
- }
42
- }
43
- static startSpinner(text) {
44
- if (this.spinner) {
45
- this.spinner.text = text;
46
- }
47
- else {
48
- this.spinner = (0, ora_1.default)(text).start();
49
- }
50
- }
51
- static stopSpinner() {
52
- if (this.spinner) {
53
- this.spinner.stop();
54
- this.spinner = null;
55
- }
56
- }
57
- static box(title, lines) {
58
- const width = Math.max(title.length + 4, ...lines.map(l => l.length + 4));
59
- const border = '─'.repeat(width);
60
- console.log(chalk_1.default.cyan(`┌${border}┐`));
61
- console.log(chalk_1.default.cyan(`│ ${chalk_1.default.bold(title.padEnd(width - 2))} │`));
62
- console.log(chalk_1.default.cyan(`│${border}│`));
63
- lines.forEach(line => {
64
- console.log(chalk_1.default.cyan(`│ ${line.padEnd(width - 2)} │`));
65
- });
66
- console.log(chalk_1.default.cyan(`└${border}┘`));
67
- }
68
- }
69
- exports.Logger = Logger;
70
- Logger.spinner = null;
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModuleManifestSchema = exports.InjectionSchema = void 0;
4
- const zod_1 = require("zod");
5
- exports.InjectionSchema = zod_1.z.object({
6
- targetFile: zod_1.z.string(), // relative to project root
7
- anchor: zod_1.z.string(), // e.g. "KAVEN_MODULE_IMPORTS"
8
- content: zod_1.z.string(), // content to inject
9
- strategy: zod_1.z.enum(['append', 'prepend', 'replace']).default('append'),
10
- });
11
- exports.ModuleManifestSchema = zod_1.z.object({
12
- id: zod_1.z.string().uuid().optional(), // optional for local dev
13
- slug: zod_1.z.string().min(3).regex(/^[a-z0-9-]+$/),
14
- version: zod_1.z.string().regex(/^\d+\.\d+\.\d+.*$/), // SemVer
15
- displayName: zod_1.z.string(),
16
- description: zod_1.z.string(),
17
- category: zod_1.z.string().default('features'),
18
- publisher: zod_1.z.string().default('kaven'),
19
- // Compatibility
20
- compat: zod_1.z.object({
21
- kaven: zod_1.z.string(), // SemVer range e.g. "^2.0.0"
22
- node: zod_1.z.string().optional(),
23
- }),
24
- // Dependencies
25
- dependencies: zod_1.z.record(zod_1.z.string()).optional(), // npm deps
26
- devDependencies: zod_1.z.record(zod_1.z.string()).optional(),
27
- peerModules: zod_1.z.record(zod_1.z.string()).optional(), // other kaven modules
28
- // Configuration Requirements (Env Vars)
29
- env: zod_1.z.array(zod_1.z.object({
30
- key: zod_1.z.string(),
31
- description: zod_1.z.string(),
32
- required: zod_1.z.boolean().default(true),
33
- defaultValue: zod_1.z.string().optional(),
34
- })).default([]),
35
- // File Copying mappings (TO-BE: flexible mappings)
36
- // For AS-IS compatibility, we assume standard structure (api/admin)
37
- // Injections
38
- injections: zod_1.z.array(exports.InjectionSchema).default([]),
39
- // Database
40
- database: zod_1.z.object({
41
- schemaPath: zod_1.z.string().optional(), // path to schema.prisma fragment
42
- migrations: zod_1.z.boolean().default(false),
43
- }).optional(),
44
- // Tasks (hooks)
45
- hooks: zod_1.z.object({
46
- postInstall: zod_1.z.array(zod_1.z.string()).default([]),
47
- preRemove: zod_1.z.array(zod_1.z.string()).default([]),
48
- }).optional(),
49
- });