@kamaras/venpm 0.1.1 → 0.2.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/cli/completions.d.ts +3 -0
- package/dist/cli/completions.d.ts.map +1 -0
- package/dist/cli/completions.js +78 -0
- package/dist/cli/completions.js.map +1 -0
- package/dist/cli/config-cmd.d.ts.map +1 -1
- package/dist/cli/config-cmd.js +30 -22
- package/dist/cli/config-cmd.js.map +1 -1
- package/dist/cli/context.d.ts.map +1 -1
- package/dist/cli/context.js +26 -9
- package/dist/cli/context.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +20 -22
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +37 -24
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/first-run.d.ts +4 -0
- package/dist/cli/first-run.d.ts.map +1 -0
- package/dist/cli/first-run.js +51 -0
- package/dist/cli/first-run.js.map +1 -0
- package/dist/cli/help.d.ts +3 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +42 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/info.d.ts.map +1 -1
- package/dist/cli/info.js +48 -53
- package/dist/cli/info.js.map +1 -1
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +52 -67
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/list.d.ts.map +1 -1
- package/dist/cli/list.js +20 -20
- package/dist/cli/list.js.map +1 -1
- package/dist/cli/rebuild.d.ts.map +1 -1
- package/dist/cli/rebuild.js +19 -26
- package/dist/cli/rebuild.js.map +1 -1
- package/dist/cli/repo.d.ts.map +1 -1
- package/dist/cli/repo.js +22 -32
- package/dist/cli/repo.js.map +1 -1
- package/dist/cli/search.d.ts.map +1 -1
- package/dist/cli/search.js +19 -20
- package/dist/cli/search.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +14 -16
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +26 -33
- package/dist/cli/update.js.map +1 -1
- package/dist/cli/validate.d.ts.map +1 -1
- package/dist/cli/validate.js +14 -21
- package/dist/cli/validate.js.map +1 -1
- package/dist/core/ansi.d.ts +14 -0
- package/dist/core/ansi.d.ts.map +1 -0
- package/dist/core/ansi.js +36 -0
- package/dist/core/ansi.js.map +1 -0
- package/dist/core/errors.d.ts +36 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +70 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/fuzzy.d.ts +3 -0
- package/dist/core/fuzzy.d.ts.map +1 -0
- package/dist/core/fuzzy.js +30 -0
- package/dist/core/fuzzy.js.map +1 -0
- package/dist/core/json-renderer.d.ts +5 -0
- package/dist/core/json-renderer.d.ts.map +1 -0
- package/dist/core/json-renderer.js +48 -0
- package/dist/core/json-renderer.js.map +1 -0
- package/dist/core/json.d.ts +5 -3
- package/dist/core/json.d.ts.map +1 -1
- package/dist/core/json.js +8 -4
- package/dist/core/json.js.map +1 -1
- package/dist/core/progress.d.ts +11 -0
- package/dist/core/progress.d.ts.map +1 -0
- package/dist/core/progress.js +53 -0
- package/dist/core/progress.js.map +1 -0
- package/dist/core/prompt.d.ts.map +1 -1
- package/dist/core/prompt.js +62 -4
- package/dist/core/prompt.js.map +1 -1
- package/dist/core/renderer.d.ts +13 -0
- package/dist/core/renderer.d.ts.map +1 -0
- package/dist/core/renderer.js +157 -0
- package/dist/core/renderer.js.map +1 -0
- package/dist/core/stream-renderer.d.ts +5 -0
- package/dist/core/stream-renderer.d.ts.map +1 -0
- package/dist/core/stream-renderer.js +71 -0
- package/dist/core/stream-renderer.js.map +1 -0
- package/dist/core/types.d.ts +46 -8
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/core/log.d.ts +0 -8
- package/dist/core/log.d.ts.map +0 -1
- package/dist/core/log.js +0 -24
- package/dist/core/log.js.map +0 -1
package/dist/cli/list.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { loadLockfile } from "../core/lockfile.js";
|
|
2
2
|
import { getLockfilePath } from "../core/paths.js";
|
|
3
|
-
import { jsonSuccess, writeJson } from "../core/json.js";
|
|
4
3
|
import { createRealIOContext } from "./context.js";
|
|
5
4
|
export async function executeList(ctx, options = {}) {
|
|
5
|
+
const { renderer } = ctx;
|
|
6
6
|
const lockfile = await loadLockfile(ctx.fs, getLockfilePath());
|
|
7
7
|
const installed = Object.entries(lockfile.installed);
|
|
8
|
-
if (options.json) {
|
|
9
|
-
writeJson(jsonSuccess({
|
|
10
|
-
plugins: installed.map(([name, info]) => ({
|
|
11
|
-
name,
|
|
12
|
-
version: info.version,
|
|
13
|
-
repo: info.repo,
|
|
14
|
-
method: info.method,
|
|
15
|
-
pinned: info.pinned,
|
|
16
|
-
})),
|
|
17
|
-
}));
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
8
|
if (installed.length === 0) {
|
|
21
|
-
|
|
9
|
+
renderer.text("No plugins installed");
|
|
10
|
+
renderer.finish(true, { plugins: [] });
|
|
22
11
|
return;
|
|
23
12
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
renderer.heading(`Installed plugins (${installed.length})`);
|
|
14
|
+
renderer.table(["Name", "Version", "Repo", "Method", "Pinned"], installed.map(([name, info]) => [
|
|
15
|
+
name,
|
|
16
|
+
info.version,
|
|
17
|
+
info.repo,
|
|
18
|
+
info.method,
|
|
19
|
+
info.pinned ? "yes" : "no",
|
|
20
|
+
]));
|
|
21
|
+
renderer.finish(true, {
|
|
22
|
+
plugins: installed.map(([name, info]) => ({
|
|
23
|
+
name,
|
|
24
|
+
version: info.version,
|
|
25
|
+
repo: info.repo,
|
|
26
|
+
method: info.method,
|
|
27
|
+
pinned: info.pinned,
|
|
28
|
+
})),
|
|
29
|
+
});
|
|
30
30
|
}
|
|
31
31
|
export function registerListCommand(program) {
|
|
32
32
|
program
|
package/dist/cli/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/cli/list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/cli/list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAc,EAAE,UAAyB,EAAE;IACzE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC;IACzB,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAErD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACtC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;QACvC,OAAO;IACX,CAAC;IAED,QAAQ,CAAC,OAAO,CAAC,sBAAsB,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5D,QAAQ,CAAC,KAAK,CACV,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAA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":"rebuild.d.ts","sourceRoot":"","sources":["../../src/cli/rebuild.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyE7D"}
|
package/dist/cli/rebuild.js
CHANGED
|
@@ -2,7 +2,7 @@ import { loadConfig } from "../core/config.js";
|
|
|
2
2
|
import { getConfigPath } from "../core/paths.js";
|
|
3
3
|
import { detectVencordPath, detectDiscordBinary } from "../core/detect.js";
|
|
4
4
|
import { buildAndDeploy } from "../core/builder.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ErrorCode, makeError, exitCodeForError } from "../core/errors.js";
|
|
6
6
|
import { createRealIOContext } from "./context.js";
|
|
7
7
|
export function registerRebuildCommand(program) {
|
|
8
8
|
program
|
|
@@ -13,17 +13,15 @@ export function registerRebuildCommand(program) {
|
|
|
13
13
|
.action(async (cmdOptions) => {
|
|
14
14
|
const globalOpts = program.opts();
|
|
15
15
|
const ctx = createRealIOContext(globalOpts);
|
|
16
|
+
const { renderer } = ctx;
|
|
16
17
|
const configPath = globalOpts.config ?? getConfigPath();
|
|
17
18
|
const config = await loadConfig(ctx.fs, configPath);
|
|
18
19
|
// Resolve Vencord path
|
|
19
20
|
const vencordPath = config.vencord.path ?? await detectVencordPath(ctx.fs);
|
|
20
21
|
if (!vencordPath) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
ctx.logger.error("Vencord path not found. Set vencord.path in config or $VENPM_VENCORD_PATH.");
|
|
26
|
-
process.exitCode = 1;
|
|
22
|
+
renderer.error(makeError(ErrorCode.VENCORD_NOT_FOUND, "Vencord path not found. Set vencord.path in config or $VENPM_VENCORD_PATH."));
|
|
23
|
+
renderer.finish(false);
|
|
24
|
+
process.exitCode = exitCodeForError(ErrorCode.VENCORD_NOT_FOUND);
|
|
27
25
|
return;
|
|
28
26
|
}
|
|
29
27
|
// Resolve Discord binary for optional restart
|
|
@@ -45,38 +43,33 @@ export function registerRebuildCommand(program) {
|
|
|
45
43
|
shouldRestart = await ctx.prompter.confirm("Restart Discord after rebuild?", false);
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
|
-
|
|
46
|
+
const p = renderer.progress("rebuild", `Building Vencord at ${vencordPath}...`);
|
|
49
47
|
try {
|
|
50
48
|
const result = await buildAndDeploy(ctx.fs, ctx.shell, vencordPath, {
|
|
51
49
|
restart: shouldRestart,
|
|
52
50
|
discordBinary: discordBinary ?? undefined,
|
|
53
51
|
});
|
|
54
|
-
|
|
55
|
-
writeJson(jsonSuccess({
|
|
56
|
-
built: true,
|
|
57
|
-
deployed: result.deployed,
|
|
58
|
-
restarted: result.restarted,
|
|
59
|
-
}));
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
ctx.logger.success("Build complete");
|
|
52
|
+
p.succeed("Build complete");
|
|
63
53
|
if (result.deployed && result.deployPath) {
|
|
64
|
-
|
|
54
|
+
renderer.text(`Deployed to ${result.deployPath}`);
|
|
65
55
|
}
|
|
66
56
|
else if (!result.deployed) {
|
|
67
|
-
|
|
57
|
+
renderer.warn("Deploy target not found — skipped copy step");
|
|
68
58
|
}
|
|
69
59
|
if (result.restarted) {
|
|
70
|
-
|
|
60
|
+
renderer.text("Discord restarted");
|
|
71
61
|
}
|
|
62
|
+
renderer.finish(true, {
|
|
63
|
+
built: true,
|
|
64
|
+
deployed: result.deployed,
|
|
65
|
+
restarted: result.restarted,
|
|
66
|
+
});
|
|
72
67
|
}
|
|
73
68
|
catch (err) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
ctx.logger.error(`Build failed: ${err.message}`);
|
|
79
|
-
process.exitCode = 1;
|
|
69
|
+
p.fail("Build failed");
|
|
70
|
+
renderer.error(makeError(ErrorCode.BUILD_FAILED, `Build failed: ${err.message}`));
|
|
71
|
+
renderer.finish(false);
|
|
72
|
+
process.exitCode = exitCodeForError(ErrorCode.BUILD_FAILED);
|
|
80
73
|
return;
|
|
81
74
|
}
|
|
82
75
|
});
|
package/dist/cli/rebuild.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rebuild.js","sourceRoot":"","sources":["../../src/cli/rebuild.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"rebuild.js","sourceRoot":"","sources":["../../src/cli/rebuild.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACnD,OAAO;SACF,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,cAAc,EAAE,wCAAwC,CAAC;SAChE,MAAM,CAAC,WAAW,EAAE,mCAAmC,CAAC;SACxD,MAAM,CAAC,KAAK,EAAE,UAAsD,EAAE,EAAE;QACrE,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAiB,CAAC;QACjD,MAAM,GAAG,GAAG,mBAAmB,CAAC,U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K,CAAC,CAAC;YACvB,OAAO,CAAC,QAAQ,GAAG,gBAAgB,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;YAC5D,OAAO;QACX,CAAC;IACL,CAAC,CAAC,CAAC;AACX,CAAC"}
|
package/dist/cli/repo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/cli/repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/cli/repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4F1D"}
|
package/dist/cli/repo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { loadConfig, saveConfig } from "../core/config.js";
|
|
2
2
|
import { getConfigPath } from "../core/paths.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ErrorCode, makeError, exitCodeForError } from "../core/errors.js";
|
|
4
4
|
import { createRealIOContext } from "./context.js";
|
|
5
5
|
export function registerRepoCommand(program) {
|
|
6
6
|
const repo = program
|
|
@@ -13,6 +13,7 @@ export function registerRepoCommand(program) {
|
|
|
13
13
|
.action(async (url, options) => {
|
|
14
14
|
const parentOpts = program.opts();
|
|
15
15
|
const ctx = createRealIOContext(parentOpts);
|
|
16
|
+
const { renderer } = ctx;
|
|
16
17
|
const configPath = parentOpts.config ?? getConfigPath();
|
|
17
18
|
const config = await loadConfig(ctx.fs, configPath);
|
|
18
19
|
let name = options.name;
|
|
@@ -26,21 +27,15 @@ export function registerRepoCommand(program) {
|
|
|
26
27
|
}
|
|
27
28
|
const existing = config.repos.find(r => r.name === name);
|
|
28
29
|
if (existing) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
ctx.logger.error(`Repository with name "${name}" already exists (${existing.url})`);
|
|
34
|
-
process.exitCode = 1;
|
|
30
|
+
renderer.error(makeError(ErrorCode.REPO_FETCH_FAILED, `Repository with name "${name}" already exists (${existing.url})`));
|
|
31
|
+
renderer.finish(false);
|
|
32
|
+
process.exitCode = exitCodeForError(ErrorCode.REPO_FETCH_FAILED);
|
|
35
33
|
return;
|
|
36
34
|
}
|
|
37
35
|
config.repos.push({ name, url });
|
|
38
36
|
await saveConfig(ctx.fs, configPath, config);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
ctx.logger.success(`Added repository "${name}" → ${url}`);
|
|
37
|
+
renderer.success(`Added repository "${name}" → ${url}`);
|
|
38
|
+
renderer.finish(true, { name, url });
|
|
44
39
|
});
|
|
45
40
|
repo
|
|
46
41
|
.command("remove <name>")
|
|
@@ -48,25 +43,23 @@ export function registerRepoCommand(program) {
|
|
|
48
43
|
.action(async (name) => {
|
|
49
44
|
const parentOpts = program.opts();
|
|
50
45
|
const ctx = createRealIOContext(parentOpts);
|
|
46
|
+
const { renderer } = ctx;
|
|
51
47
|
const configPath = parentOpts.config ?? getConfigPath();
|
|
52
48
|
const config = await loadConfig(ctx.fs, configPath);
|
|
53
49
|
const index = config.repos.findIndex(r => r.name === name);
|
|
54
50
|
if (index === -1) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
process.exitCode =
|
|
51
|
+
const repoNames = config.repos.map(r => r.name);
|
|
52
|
+
renderer.error(makeError(ErrorCode.REPO_FETCH_FAILED, `Repository "${name}" not found`, {
|
|
53
|
+
candidates: repoNames.length > 0 ? repoNames : undefined,
|
|
54
|
+
}));
|
|
55
|
+
renderer.finish(false);
|
|
56
|
+
process.exitCode = exitCodeForError(ErrorCode.REPO_FETCH_FAILED);
|
|
61
57
|
return;
|
|
62
58
|
}
|
|
63
59
|
config.repos.splice(index, 1);
|
|
64
60
|
await saveConfig(ctx.fs, configPath, config);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
ctx.logger.success(`Removed repository "${name}"`);
|
|
61
|
+
renderer.success(`Removed repository "${name}"`);
|
|
62
|
+
renderer.finish(true, { removed: name });
|
|
70
63
|
});
|
|
71
64
|
repo
|
|
72
65
|
.command("list")
|
|
@@ -74,20 +67,17 @@ export function registerRepoCommand(program) {
|
|
|
74
67
|
.action(async () => {
|
|
75
68
|
const parentOpts = program.opts();
|
|
76
69
|
const ctx = createRealIOContext(parentOpts);
|
|
70
|
+
const { renderer } = ctx;
|
|
77
71
|
const configPath = parentOpts.config ?? getConfigPath();
|
|
78
72
|
const config = await loadConfig(ctx.fs, configPath);
|
|
79
|
-
if (parentOpts.json) {
|
|
80
|
-
writeJson(jsonSuccess({ repos: config.repos.map(r => ({ name: r.name, url: r.url })) }));
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
73
|
if (config.repos.length === 0) {
|
|
84
|
-
|
|
74
|
+
renderer.text("No repositories configured");
|
|
75
|
+
renderer.finish(true, { repos: [] });
|
|
85
76
|
return;
|
|
86
77
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
78
|
+
renderer.heading(`Configured repositories (${config.repos.length})`);
|
|
79
|
+
renderer.table(["Name", "URL"], config.repos.map(r => [r.name, r.url]));
|
|
80
|
+
renderer.finish(true, { repos: config.repos.map(r => ({ name: r.name, url: r.url })) });
|
|
91
81
|
});
|
|
92
82
|
}
|
|
93
83
|
//# sourceMappingURL=repo.js.map
|
package/dist/cli/repo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../../src/cli/repo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU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AAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/cli/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOjE,wBAAsB,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwC7G;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAS5D"}
|
package/dist/cli/search.js
CHANGED
|
@@ -2,40 +2,39 @@ import { loadConfig } from "../core/config.js";
|
|
|
2
2
|
import { getConfigPath } from "../core/paths.js";
|
|
3
3
|
import { fetchAllIndexes, searchPlugins } from "../core/registry.js";
|
|
4
4
|
import { loadCache, saveCache } from "../core/cache.js";
|
|
5
|
-
import { jsonSuccess, writeJson } from "../core/json.js";
|
|
6
5
|
import { createRealIOContext } from "./context.js";
|
|
7
6
|
export async function executeSearch(ctx, query, options = {}) {
|
|
7
|
+
const { renderer } = ctx;
|
|
8
8
|
const config = await loadConfig(ctx.fs, options.config ?? getConfigPath());
|
|
9
9
|
const cache = await loadCache(ctx.fs);
|
|
10
10
|
const { results: indexes, updatedCache } = await fetchAllIndexes(ctx.http, config.repos, { cache });
|
|
11
11
|
await saveCache(ctx.fs, updatedCache);
|
|
12
12
|
for (const fi of indexes) {
|
|
13
13
|
if (fi.error) {
|
|
14
|
-
|
|
14
|
+
renderer.warn(`Failed to fetch index from "${fi.repoName}": ${fi.error}`);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
const results = searchPlugins(indexes, query);
|
|
18
|
-
if (options.json) {
|
|
19
|
-
writeJson(jsonSuccess({
|
|
20
|
-
results: results.map(r => ({
|
|
21
|
-
name: r.name,
|
|
22
|
-
version: r.entry.version,
|
|
23
|
-
description: r.entry.description ?? null,
|
|
24
|
-
repo: r.repoName,
|
|
25
|
-
})),
|
|
26
|
-
}));
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
18
|
if (results.length === 0) {
|
|
30
|
-
|
|
19
|
+
renderer.text(`No plugins found matching "${query}"`);
|
|
20
|
+
renderer.finish(true, { results: [] });
|
|
31
21
|
return;
|
|
32
22
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
renderer.heading(`Search results for "${query}" (${results.length} found)`);
|
|
24
|
+
renderer.table(["Name", "Version", "Description", "Repo"], results.map(r => [
|
|
25
|
+
r.name,
|
|
26
|
+
r.entry.version,
|
|
27
|
+
r.entry.description ?? "",
|
|
28
|
+
r.repoName,
|
|
29
|
+
]));
|
|
30
|
+
renderer.finish(true, {
|
|
31
|
+
results: results.map(r => ({
|
|
32
|
+
name: r.name,
|
|
33
|
+
version: r.entry.version,
|
|
34
|
+
description: r.entry.description ?? null,
|
|
35
|
+
repo: r.repoName,
|
|
36
|
+
})),
|
|
37
|
+
});
|
|
39
38
|
}
|
|
40
39
|
export function registerSearchCommand(program) {
|
|
41
40
|
program
|
package/dist/cli/search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/cli/search.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"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C;AACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../src/cli/uninstall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../src/cli/uninstall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAUjE,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA+ChH;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAc/D"}
|
package/dist/cli/uninstall.js
CHANGED
|
@@ -4,21 +4,21 @@ import { loadLockfile, saveLockfile, isInstalled, removeInstalled } from "../cor
|
|
|
4
4
|
import { getConfigPath, getLockfilePath } from "../core/paths.js";
|
|
5
5
|
import { fetchAllIndexes, resolvePlugin } from "../core/registry.js";
|
|
6
6
|
import { loadCache, saveCache } from "../core/cache.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ErrorCode, makeError, exitCodeForError } from "../core/errors.js";
|
|
8
|
+
import { findCandidates } from "../core/fuzzy.js";
|
|
8
9
|
import { createRealIOContext } from "./context.js";
|
|
9
10
|
export async function executeUninstall(ctx, pluginName, options) {
|
|
11
|
+
const { renderer } = ctx;
|
|
10
12
|
const configPath = options.config ?? getConfigPath();
|
|
11
13
|
const lockfilePath = getLockfilePath();
|
|
12
14
|
const config = await loadConfig(ctx.fs, configPath);
|
|
13
15
|
let lockfile = await loadLockfile(ctx.fs, lockfilePath);
|
|
14
16
|
if (!isInstalled(lockfile, pluginName)) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
ctx.logger.error(`Plugin "${pluginName}" is not installed.`);
|
|
21
|
-
process.exitCode = 1;
|
|
17
|
+
const installedNames = Object.keys(lockfile.installed);
|
|
18
|
+
const candidates = findCandidates(pluginName, installedNames);
|
|
19
|
+
renderer.error(makeError(ErrorCode.PLUGIN_NOT_INSTALLED, `Plugin "${pluginName}" is not installed.`, { candidates }));
|
|
20
|
+
renderer.finish(false);
|
|
21
|
+
process.exitCode = exitCodeForError(ErrorCode.PLUGIN_NOT_INSTALLED);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
// Warn if other installed plugins depend on this one
|
|
@@ -29,26 +29,24 @@ export async function executeUninstall(ctx, pluginName, options) {
|
|
|
29
29
|
for (const other of otherInstalled) {
|
|
30
30
|
const match = resolvePlugin(fetchedIndexes, other);
|
|
31
31
|
if (match?.entry.dependencies?.includes(pluginName)) {
|
|
32
|
-
|
|
32
|
+
renderer.warn(`"${other}" depends on this plugin`);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
const confirmed = await ctx.prompter.confirm(`Remove plugin "${pluginName}"?`, true);
|
|
36
36
|
if (!confirmed) {
|
|
37
|
-
|
|
37
|
+
renderer.text("Uninstall cancelled.");
|
|
38
|
+
renderer.finish(false);
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
41
|
if (config.vencord.path !== null) {
|
|
41
42
|
const pluginDir = join(config.vencord.path, "src", "userplugins", pluginName);
|
|
42
43
|
await ctx.fs.rm(pluginDir, { recursive: true, force: true });
|
|
43
|
-
|
|
44
|
+
renderer.success(`Removed plugin directory: ${pluginDir}`);
|
|
44
45
|
}
|
|
45
46
|
lockfile = removeInstalled(lockfile, pluginName);
|
|
46
47
|
await saveLockfile(ctx.fs, lockfilePath, lockfile);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
ctx.logger.success(`Uninstalled "${pluginName}".`);
|
|
48
|
+
renderer.success(`Uninstalled "${pluginName}".`);
|
|
49
|
+
renderer.finish(true, { removed: pluginName });
|
|
52
50
|
}
|
|
53
51
|
export function registerUninstallCommand(program) {
|
|
54
52
|
program
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../src/cli/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../src/cli/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,C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CAAC;IACjD,MAAM,YAAY,CAAC,GAAG,CAAC,EAAE,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;IAEnD,QAAQ,CAAC,OAAO,CAAC,gBAAgB,UAAU,IAAI,CAAC,CAAC;IACjD,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACrD,OAAO;SACF,OAAO,CAAC,oBAAoB,CAAC;SAC7B,WAAW,CAAC,oBAAoB,CAAC;SACjC,MAAM,CAAC,WAAW,EAAE,0BAA0B,CAAC;SAC/C,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,UAA6B,EAAE,EAAE;QAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAiB,CAAC;QACjD,MAAM,aAAa,GAAkB;YACjC,GAAG,UAAU;YACb,GAAG,EAAE,UAAU,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG;SACxC,CAAC;QACF,MAAM,GAAG,GAAG,mBAAmB,CAAC,aAAa,CAAC,CAAC;QAC/C,MAAM,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACX,CAAC"}
|
package/dist/cli/update.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/cli/update.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAoB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/cli/update.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAoB,MAAM,kBAAkB,CAAC;AAYnF,wBAAsB,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAoJzH;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAS5D"}
|
package/dist/cli/update.js
CHANGED
|
@@ -5,21 +5,20 @@ import { getConfigPath, getLockfilePath } from "../core/paths.js";
|
|
|
5
5
|
import { fetchAllIndexes, resolvePlugin } from "../core/registry.js";
|
|
6
6
|
import { loadCache, saveCache } from "../core/cache.js";
|
|
7
7
|
import { fetchPlugin } from "../core/fetcher.js";
|
|
8
|
-
import {
|
|
8
|
+
import { ErrorCode, makeError, exitCodeForError } from "../core/errors.js";
|
|
9
|
+
import { findCandidates } from "../core/fuzzy.js";
|
|
9
10
|
import { createRealIOContext } from "./context.js";
|
|
10
11
|
import { selectMethodFromSource } from "../core/resolver.js";
|
|
11
12
|
export async function executeUpdate(ctx, pluginName, options) {
|
|
13
|
+
const { renderer } = ctx;
|
|
12
14
|
const configPath = options.config ?? getConfigPath();
|
|
13
15
|
const lockfilePath = getLockfilePath();
|
|
14
16
|
const config = await loadConfig(ctx.fs, configPath);
|
|
15
17
|
let lockfile = await loadLockfile(ctx.fs, lockfilePath);
|
|
16
18
|
const installedEntries = Object.entries(lockfile.installed);
|
|
17
19
|
if (installedEntries.length === 0) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
ctx.logger.info("No plugins installed.");
|
|
20
|
+
renderer.text("No plugins installed.");
|
|
21
|
+
renderer.finish(true, { updated: [], skipped: [] });
|
|
23
22
|
return;
|
|
24
23
|
}
|
|
25
24
|
// Determine which plugins to update
|
|
@@ -27,13 +26,11 @@ export async function executeUpdate(ctx, pluginName, options) {
|
|
|
27
26
|
if (pluginName !== undefined) {
|
|
28
27
|
const info = getInstalled(lockfile, pluginName);
|
|
29
28
|
if (!info) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
ctx.logger.error(`Plugin "${pluginName}" is not installed.`);
|
|
36
|
-
process.exitCode = 1;
|
|
29
|
+
const installedNames = Object.keys(lockfile.installed);
|
|
30
|
+
const candidates = findCandidates(pluginName, installedNames);
|
|
31
|
+
renderer.error(makeError(ErrorCode.PLUGIN_NOT_INSTALLED, `Plugin "${pluginName}" is not installed.`, { candidates }));
|
|
32
|
+
renderer.finish(false);
|
|
33
|
+
process.exitCode = exitCodeForError(ErrorCode.PLUGIN_NOT_INSTALLED);
|
|
37
34
|
return;
|
|
38
35
|
}
|
|
39
36
|
targets = [pluginName];
|
|
@@ -45,50 +42,49 @@ export async function executeUpdate(ctx, pluginName, options) {
|
|
|
45
42
|
const updateable = targets.filter(name => {
|
|
46
43
|
const info = getInstalled(lockfile, name);
|
|
47
44
|
if (info.pinned) {
|
|
48
|
-
|
|
45
|
+
renderer.verbose(`Skipping pinned plugin: ${name}`);
|
|
49
46
|
return false;
|
|
50
47
|
}
|
|
51
48
|
if (info.method === "local") {
|
|
52
|
-
|
|
49
|
+
renderer.verbose(`Skipping local plugin: ${name}`);
|
|
53
50
|
return false;
|
|
54
51
|
}
|
|
55
52
|
return true;
|
|
56
53
|
});
|
|
57
54
|
if (updateable.length === 0) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
ctx.logger.info("Nothing to update.");
|
|
55
|
+
renderer.text("Nothing to update.");
|
|
56
|
+
renderer.finish(true, { updated: [], skipped: [] });
|
|
63
57
|
return;
|
|
64
58
|
}
|
|
59
|
+
const p = renderer.progress("fetch-indexes", "Fetching indexes...");
|
|
65
60
|
const cache = await loadCache(ctx.fs);
|
|
66
61
|
const { results: indexes, updatedCache } = await fetchAllIndexes(ctx.http, config.repos, { cache });
|
|
67
62
|
await saveCache(ctx.fs, updatedCache);
|
|
63
|
+
p.succeed(`${indexes.filter(fi => fi.index).length} repo(s) fetched`);
|
|
68
64
|
for (const fi of indexes) {
|
|
69
65
|
if (fi.error) {
|
|
70
|
-
|
|
66
|
+
renderer.warn(`Failed to fetch index from "${fi.repoName}": ${fi.error}`);
|
|
71
67
|
}
|
|
72
68
|
}
|
|
73
69
|
const gitAvailable = await ctx.git.available();
|
|
74
70
|
let updatedCount = 0;
|
|
75
|
-
const
|
|
71
|
+
const updatedResults = [];
|
|
76
72
|
const skippedNames = [];
|
|
77
73
|
for (const name of updateable) {
|
|
78
74
|
const installedInfo = getInstalled(lockfile, name);
|
|
79
75
|
const match = resolvePlugin(indexes, name, installedInfo.repo);
|
|
80
76
|
if (!match) {
|
|
81
|
-
|
|
77
|
+
renderer.warn(`Plugin "${name}" not found in repo "${installedInfo.repo}" — skipping`);
|
|
82
78
|
skippedNames.push(name);
|
|
83
79
|
continue;
|
|
84
80
|
}
|
|
85
81
|
const latestVersion = match.entry.version;
|
|
86
82
|
if (latestVersion === installedInfo.version) {
|
|
87
|
-
|
|
83
|
+
renderer.verbose(`${name} is up to date (${installedInfo.version})`);
|
|
88
84
|
skippedNames.push(name);
|
|
89
85
|
continue;
|
|
90
86
|
}
|
|
91
|
-
|
|
87
|
+
const up = renderer.progress(`update-${name}`, `Updating ${name}: ${installedInfo.version} → ${latestVersion}`);
|
|
92
88
|
// Remove old plugin directory if vencord.path is configured
|
|
93
89
|
if (config.vencord.path !== null) {
|
|
94
90
|
const oldDir = join(config.vencord.path, "src", "userplugins", name);
|
|
@@ -127,21 +123,18 @@ export async function executeUpdate(ctx, pluginName, options) {
|
|
|
127
123
|
version: latestVersion,
|
|
128
124
|
});
|
|
129
125
|
}
|
|
130
|
-
|
|
131
|
-
|
|
126
|
+
up.succeed(`${name}: ${installedInfo.version} → ${latestVersion}`);
|
|
127
|
+
updatedResults.push({ name, from: installedInfo.version, to: latestVersion });
|
|
132
128
|
updatedCount++;
|
|
133
129
|
}
|
|
134
130
|
await saveLockfile(ctx.fs, lockfilePath, lockfile);
|
|
135
|
-
if (options.json) {
|
|
136
|
-
writeJson(jsonSuccess({ updated: updatedEntries, skipped: skippedNames }));
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
131
|
if (updatedCount === 0) {
|
|
140
|
-
|
|
132
|
+
renderer.text("All plugins are up to date.");
|
|
141
133
|
}
|
|
142
134
|
else {
|
|
143
|
-
|
|
135
|
+
renderer.success(`Updated ${updatedCount} plugin(s).`);
|
|
144
136
|
}
|
|
137
|
+
renderer.finish(true, { updated: updatedResults, skipped: skippedNames });
|
|
145
138
|
}
|
|
146
139
|
export function registerUpdateCommand(program) {
|
|
147
140
|
program
|