kaven-cli 0.4.1-alpha.0 → 0.6.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/README.md +154 -215
- package/dist/EnvManager-NMS3NMIE.js +15 -0
- package/dist/MarketplaceClient-YCFH2VU4.js +1 -0
- package/dist/chunk-JHLQ46NG.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +224 -301
- package/dist/tier-table-DQMPQSI2.js +6 -0
- package/package.json +26 -11
- package/dist/EnvManager-GQMEZ6NV.js +0 -158
- package/dist/MarketplaceClient-IJGRQRC4.js +0 -7
- package/dist/chunk-3RG5ZIWI.js +0 -10
- package/dist/chunk-GHZX5OAA.js +0 -455
- package/dist/commands/aiox/index.js +0 -20
- package/dist/commands/auth/login.js +0 -122
- package/dist/commands/auth/logout.js +0 -23
- package/dist/commands/auth/whoami.js +0 -36
- package/dist/commands/cache/index.js +0 -43
- package/dist/commands/config/features.js +0 -161
- package/dist/commands/config/index.js +0 -95
- package/dist/commands/index.js +0 -2
- package/dist/commands/init/aiox-bootstrap.js +0 -83
- package/dist/commands/init/index.js +0 -210
- package/dist/commands/init-ci/index.js +0 -153
- package/dist/commands/license/index.js +0 -10
- package/dist/commands/license/status.js +0 -44
- package/dist/commands/license/tier-table.js +0 -46
- package/dist/commands/marketplace/browse.js +0 -186
- package/dist/commands/marketplace/install.js +0 -263
- package/dist/commands/marketplace/list.js +0 -122
- package/dist/commands/module/activate.js +0 -245
- package/dist/commands/module/add.js +0 -69
- package/dist/commands/module/doctor.js +0 -175
- package/dist/commands/module/list.js +0 -51
- package/dist/commands/module/publish.js +0 -258
- package/dist/commands/module/remove.js +0 -58
- package/dist/commands/telemetry/view.js +0 -27
- package/dist/commands/upgrade/check.js +0 -162
- package/dist/commands/upgrade/index.js +0 -185
- package/dist/core/AuthService.js +0 -222
- package/dist/core/CacheManager.js +0 -154
- package/dist/core/ConfigManager.js +0 -166
- package/dist/core/EnvManager.js +0 -196
- package/dist/core/ErrorRecovery.js +0 -192
- package/dist/core/LicenseService.js +0 -83
- package/dist/core/ManifestParser.js +0 -52
- package/dist/core/MarkerService.js +0 -62
- package/dist/core/ModuleDoctor.js +0 -451
- package/dist/core/ModuleInstaller.js +0 -169
- package/dist/core/ProjectInitializer.js +0 -183
- package/dist/core/RegistryResolver.js +0 -95
- package/dist/core/SchemaActivator.js +0 -278
- package/dist/core/ScriptRunner.js +0 -73
- package/dist/core/SignatureVerifier.js +0 -75
- package/dist/core/index.js +0 -2
- package/dist/infrastructure/Container.js +0 -37
- package/dist/infrastructure/MarketplaceClient.js +0 -425
- package/dist/infrastructure/TelemetryBuffer.js +0 -73
- package/dist/infrastructure/TransactionalFileSystem.js +0 -77
- package/dist/infrastructure/errors.js +0 -63
- package/dist/infrastructure/index.js +0 -2
- package/dist/lib/capabilities-catalog.js +0 -73
- package/dist/lib/module-registry.js +0 -47
- package/dist/lib/schema-modifier.js +0 -40
- package/dist/tier-table-LAL6PAVW.js +0 -52
- package/dist/types/auth.js +0 -2
- package/dist/types/manifest.js +0 -45
- package/dist/types/markers.js +0 -10
- package/dist/types/marketplace.js +0 -2
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import i from"cli-table3";import e from"chalk";var l=[{name:"STARTER",price:"$149",projects:"1",tenants:"10",marketplace:!1},{name:"COMPLETE",price:"$399",projects:"1",tenants:"Unlimited",marketplace:!1},{name:"PRO",price:"$799",projects:"5",tenants:"Unlimited",marketplace:!0},{name:"ENTERPRISE",price:"Custom",projects:"Unlimited",tenants:"Unlimited",marketplace:!0}];function r(n){switch(n.toUpperCase()){case"STARTER":return e.green(n);case"COMPLETE":return e.yellow(n);case"PRO":return e.magenta(n);case"ENTERPRISE":return e.cyan(n);default:return n}}function R(n,a){console.log(e.red(`
|
|
2
|
+
\u2717 License tier insufficient
|
|
3
|
+
`)),console.log(` Your tier: ${r(n)}`),console.log(` Required tier: ${r(a)}
|
|
4
|
+
`);let o=new i({head:["Tier","Price","Projects","Tenants","Marketplace"],style:{head:["cyan"]}});for(let t of l){let s=t.name===n.toUpperCase(),c=t.name===a.toUpperCase()?e.yellow(" \u2190 required"):s?e.dim(" \u2190 you"):"";o.push([r(t.name)+c,t.price,t.projects,t.tenants,t.marketplace?e.green("\u2713"):e.dim("\u2717")])}console.log(o.toString()),console.log(e.dim(`
|
|
5
|
+
Upgrade at: https://kaven.dev/pricing
|
|
6
|
+
`))}export{R as printTierComparisonTable};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kaven-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"type": "module",
|
|
5
5
|
"description": "Kaven CLI - The official command line tool for Kaven",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -12,13 +12,14 @@
|
|
|
12
12
|
"README.md"
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "
|
|
15
|
+
"build": "tsup src/index.ts --format esm --clean --minify --shims --dts",
|
|
16
|
+
"dev": "tsup src/index.ts --format esm --watch --silent",
|
|
16
17
|
"prepublishOnly": "pnpm run build",
|
|
17
18
|
"lint": "eslint 'src/**/*.{ts,tsx}' --max-warnings 0",
|
|
18
19
|
"lint:fix": "eslint 'src/**/*.{ts,tsx}' --fix",
|
|
19
|
-
"test": "
|
|
20
|
-
"test:watch": "
|
|
21
|
-
"test:coverage": "
|
|
20
|
+
"test": "node scripts/run-tests.mjs",
|
|
21
|
+
"test:watch": "node --import tsx --test --watch 'src/**/*.test.ts' 'tests/**/*.test.ts'",
|
|
22
|
+
"test:coverage": "node --import tsx --test --experimental-test-coverage 'src/**/*.test.ts' 'tests/**/*.test.ts'",
|
|
22
23
|
"typecheck": "tsc --noEmit",
|
|
23
24
|
"quality": "pnpm run lint && pnpm run typecheck && pnpm run test",
|
|
24
25
|
"quality:gate": "./.agent/scripts/quality-gate.sh",
|
|
@@ -49,7 +50,8 @@
|
|
|
49
50
|
"@semantic-release/npm": "^13.1.5",
|
|
50
51
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
51
52
|
"@types/fs-extra": "^11.0.4",
|
|
52
|
-
"@types/
|
|
53
|
+
"@types/js-yaml": "^4.0.9",
|
|
54
|
+
"@types/node": "^25.6.0",
|
|
53
55
|
"@types/tar": "^6.1.13",
|
|
54
56
|
"@typescript-eslint/eslint-plugin": "^8.53.1",
|
|
55
57
|
"@typescript-eslint/parser": "^8.53.1",
|
|
@@ -57,29 +59,42 @@
|
|
|
57
59
|
"msw": "^2.12.10",
|
|
58
60
|
"semantic-release": "^25.0.3",
|
|
59
61
|
"tsup": "^8.5.1",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
+
"tsx": "^4.21.0",
|
|
63
|
+
"typescript": "^5.0.0"
|
|
62
64
|
},
|
|
63
65
|
"engines": {
|
|
64
66
|
"node": ">=20"
|
|
65
67
|
},
|
|
66
68
|
"dependencies": {
|
|
69
|
+
"@clack/prompts": "^1.2.0",
|
|
67
70
|
"@inquirer/prompts": "^7.5.2",
|
|
68
71
|
"chalk": "^5.6.2",
|
|
69
72
|
"cli-table3": "^0.6.5",
|
|
70
73
|
"commander": "^14.0.2",
|
|
71
74
|
"fs-extra": "^11.3.3",
|
|
72
75
|
"glob": "^13.0.0",
|
|
76
|
+
"i18next": "^26.0.6",
|
|
77
|
+
"js-yaml": "^4.1.1",
|
|
73
78
|
"open": "^10.1.0",
|
|
74
79
|
"ora": "^9.1.0",
|
|
80
|
+
"picocolors": "^1.1.1",
|
|
75
81
|
"tar": "^7.5.9",
|
|
76
82
|
"zod": "^4.3.6"
|
|
77
83
|
},
|
|
78
84
|
"pnpm": {
|
|
79
85
|
"overrides": {
|
|
80
|
-
"minimatch@<10.2.
|
|
86
|
+
"minimatch@<10.2.3": ">=10.2.3",
|
|
81
87
|
"@isaacs/brace-expansion@<=5.0.0": ">=5.0.1",
|
|
82
|
-
"esbuild@<=0.24.2": ">=0.25.0"
|
|
88
|
+
"esbuild@<=0.24.2": ">=0.25.0",
|
|
89
|
+
"handlebars@<=4.7.8": ">=4.7.9",
|
|
90
|
+
"tar@<=7.5.10": ">=7.5.11",
|
|
91
|
+
"lodash@<=4.17.23": ">=4.18.0",
|
|
92
|
+
"lodash-es@<=4.17.23": ">=4.18.0",
|
|
93
|
+
"rollup@<4.59.0": ">=4.59.0",
|
|
94
|
+
"vite@<=6.4.1": ">=6.4.2",
|
|
95
|
+
"flatted@<=3.4.1": ">=3.4.2",
|
|
96
|
+
"picomatch@<2.3.2": ">=2.3.2",
|
|
97
|
+
"picomatch@>=4.0.0 <4.0.4": ">=4.0.4"
|
|
83
98
|
}
|
|
84
99
|
}
|
|
85
100
|
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import "./chunk-3RG5ZIWI.js";
|
|
2
|
-
|
|
3
|
-
// src/core/EnvManager.ts
|
|
4
|
-
import * as fs from "fs";
|
|
5
|
-
import * as path from "path";
|
|
6
|
-
import * as readline from "readline";
|
|
7
|
-
import chalk from "chalk";
|
|
8
|
-
var EnvManager = class {
|
|
9
|
-
async injectEnvVars(moduleSlug, envVars, options) {
|
|
10
|
-
if (options.skipEnv || !envVars || envVars.length === 0) {
|
|
11
|
-
return { added: 0, skipped: 0 };
|
|
12
|
-
}
|
|
13
|
-
const envFilePath = path.join(options.projectDir, options.envFile ?? ".env");
|
|
14
|
-
const existingContent = this.readEnvFile(envFilePath);
|
|
15
|
-
const existingVars = this.parseEnvFile(existingContent);
|
|
16
|
-
const newVars = [];
|
|
17
|
-
let skipped = 0;
|
|
18
|
-
console.log(chalk.bold(`
|
|
19
|
-
Environment variables for '${moduleSlug}':
|
|
20
|
-
`));
|
|
21
|
-
for (const envDef of envVars) {
|
|
22
|
-
if (existingVars.has(envDef.name)) {
|
|
23
|
-
console.log(chalk.dim(` ${envDef.name} \u2014 already set, skipping`));
|
|
24
|
-
skipped++;
|
|
25
|
-
continue;
|
|
26
|
-
}
|
|
27
|
-
let value;
|
|
28
|
-
if (envDef.sensitive) {
|
|
29
|
-
value = await this.promptPassword(
|
|
30
|
-
` ${envDef.name} (${envDef.description})${envDef.default ? " [****]" : ""}: `
|
|
31
|
-
);
|
|
32
|
-
if (!value && envDef.default) value = envDef.default;
|
|
33
|
-
} else {
|
|
34
|
-
const defaultHint = envDef.default ? ` [${envDef.default}]` : "";
|
|
35
|
-
value = await this.promptInput(
|
|
36
|
-
` ${envDef.name} (${envDef.description})${defaultHint}: `,
|
|
37
|
-
envDef.default
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
if (envDef.required && !value) {
|
|
41
|
-
console.log(chalk.yellow(` ${envDef.name} is required.`));
|
|
42
|
-
value = envDef.sensitive ? await this.promptPassword(` ${envDef.name}: `) : await this.promptInput(` ${envDef.name}: `);
|
|
43
|
-
if (!value) {
|
|
44
|
-
console.log(chalk.yellow(` Skipping ${envDef.name} \u2014 set it manually in .env`));
|
|
45
|
-
skipped++;
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
newVars.push({ name: envDef.name, value });
|
|
50
|
-
}
|
|
51
|
-
if (newVars.length === 0) {
|
|
52
|
-
console.log(chalk.dim(" No new environment variables to add."));
|
|
53
|
-
return { added: 0, skipped };
|
|
54
|
-
}
|
|
55
|
-
const markerBlock = this.buildMarkerBlock(moduleSlug, newVars);
|
|
56
|
-
this.appendToEnvFile(envFilePath, existingContent, markerBlock);
|
|
57
|
-
console.log(
|
|
58
|
-
chalk.green(`
|
|
59
|
-
Added ${newVars.length} environment variable(s) to ${options.envFile ?? ".env"}`)
|
|
60
|
-
);
|
|
61
|
-
return { added: newVars.length, skipped };
|
|
62
|
-
}
|
|
63
|
-
removeEnvVars(moduleSlug, options) {
|
|
64
|
-
const envFiles = [".env", ".env.local", ".env.development", ".env.production"];
|
|
65
|
-
if (options.envFile) envFiles.unshift(options.envFile);
|
|
66
|
-
let totalRemoved = 0;
|
|
67
|
-
for (const envFile of envFiles) {
|
|
68
|
-
const envFilePath = path.join(options.projectDir, envFile);
|
|
69
|
-
if (!fs.existsSync(envFilePath)) continue;
|
|
70
|
-
const content = fs.readFileSync(envFilePath, "utf-8");
|
|
71
|
-
const beginMarker = `# [KAVEN_MODULE:${moduleSlug} BEGIN]`;
|
|
72
|
-
const endMarker = `# [KAVEN_MODULE:${moduleSlug} END]`;
|
|
73
|
-
const beginIdx = content.indexOf(beginMarker);
|
|
74
|
-
const endIdx = content.indexOf(endMarker);
|
|
75
|
-
if (beginIdx === -1 || endIdx === -1) continue;
|
|
76
|
-
const block = content.substring(beginIdx, endIdx + endMarker.length);
|
|
77
|
-
const varCount = block.split("\n").filter((l) => /^[A-Z_]+=/.test(l)).length;
|
|
78
|
-
const before = content.substring(0, beginIdx).replace(/\n+$/, "\n");
|
|
79
|
-
const after = content.substring(endIdx + endMarker.length + 1);
|
|
80
|
-
fs.writeFileSync(envFilePath, before + after);
|
|
81
|
-
totalRemoved += varCount;
|
|
82
|
-
if (varCount > 0) {
|
|
83
|
-
console.log(chalk.dim(` Removed ${varCount} env var(s) from ${envFile}`));
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return totalRemoved;
|
|
87
|
-
}
|
|
88
|
-
readEnvFile(filePath) {
|
|
89
|
-
try {
|
|
90
|
-
return fs.readFileSync(filePath, "utf-8");
|
|
91
|
-
} catch {
|
|
92
|
-
return "";
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
parseEnvFile(content) {
|
|
96
|
-
const vars = /* @__PURE__ */ new Map();
|
|
97
|
-
for (const line of content.split("\n")) {
|
|
98
|
-
const match = line.match(/^([A-Z_][A-Z0-9_]*)=(.*)$/);
|
|
99
|
-
if (match) vars.set(match[1], match[2]);
|
|
100
|
-
}
|
|
101
|
-
return vars;
|
|
102
|
-
}
|
|
103
|
-
buildMarkerBlock(moduleSlug, vars) {
|
|
104
|
-
return [
|
|
105
|
-
`# [KAVEN_MODULE:${moduleSlug} BEGIN]`,
|
|
106
|
-
...vars.map((v) => `${v.name}=${v.value}`),
|
|
107
|
-
`# [KAVEN_MODULE:${moduleSlug} END]`
|
|
108
|
-
].join("\n");
|
|
109
|
-
}
|
|
110
|
-
appendToEnvFile(filePath, existingContent, block) {
|
|
111
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
112
|
-
const separator = existingContent.endsWith("\n") || existingContent === "" ? "\n" : "\n\n";
|
|
113
|
-
fs.writeFileSync(filePath, existingContent + separator + block + "\n");
|
|
114
|
-
}
|
|
115
|
-
promptInput(message, defaultValue) {
|
|
116
|
-
return new Promise((resolve) => {
|
|
117
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
118
|
-
rl.question(message, (answer) => {
|
|
119
|
-
rl.close();
|
|
120
|
-
resolve(answer || defaultValue || "");
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
promptPassword(message) {
|
|
125
|
-
return new Promise((resolve) => {
|
|
126
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
127
|
-
process.stdout.write(message);
|
|
128
|
-
process.stdin.setRawMode?.(true);
|
|
129
|
-
process.stdin.resume();
|
|
130
|
-
let password = "";
|
|
131
|
-
const handler = (key) => {
|
|
132
|
-
const char = key.toString();
|
|
133
|
-
if (char === "\r" || char === "\n") {
|
|
134
|
-
process.stdin.setRawMode?.(false);
|
|
135
|
-
process.stdin.pause();
|
|
136
|
-
process.stdin.removeListener("data", handler);
|
|
137
|
-
process.stdout.write("\n");
|
|
138
|
-
rl.close();
|
|
139
|
-
resolve(password);
|
|
140
|
-
} else if (char === "") {
|
|
141
|
-
process.exit();
|
|
142
|
-
} else if (char === "\x7F") {
|
|
143
|
-
password = password.slice(0, -1);
|
|
144
|
-
process.stdout.clearLine(0);
|
|
145
|
-
process.stdout.cursorTo(0);
|
|
146
|
-
process.stdout.write(message + "*".repeat(password.length));
|
|
147
|
-
} else {
|
|
148
|
-
password += char;
|
|
149
|
-
process.stdout.write("*");
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
process.stdin.on("data", handler);
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
export {
|
|
157
|
-
EnvManager
|
|
158
|
-
};
|
package/dist/chunk-3RG5ZIWI.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
__require
|
|
10
|
-
};
|