@kamaras/venpm 0.1.0 → 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/README.md +163 -24
- 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 +31 -22
- package/dist/cli/config-cmd.js.map +1 -1
- package/dist/cli/context.d.ts +1 -4
- package/dist/cli/context.d.ts.map +1 -1
- package/dist/cli/context.js +28 -7
- package/dist/cli/context.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +22 -32
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +37 -23
- 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 +53 -68
- 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.js +37 -34
- 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 +17 -20
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +28 -40
- 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/builder.d.ts +1 -0
- package/dist/core/builder.d.ts.map +1 -1
- package/dist/core/builder.js +18 -7
- package/dist/core/builder.js.map +1 -1
- 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 +1 -0
- package/dist/core/prompt.d.ts.map +1 -1
- package/dist/core/prompt.js +73 -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 +48 -8
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.js +21 -2
- 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/README.md
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://venpm.dev/logo.svg" alt="venpm" width="80" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">venpm</h1>
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>The package manager for Vencord userplugins.</strong><br/>
|
|
9
|
+
Install, update, and manage plugins from decentralized JSON indexes.
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/@kamaras/venpm"><img src="https://img.shields.io/npm/v/@kamaras/venpm?color=f97316&label=npm" alt="npm version" /></a>
|
|
14
|
+
<a href="https://github.com/theokyr/venpm/actions"><img src="https://img.shields.io/github/actions/workflow/status/theokyr/venpm/ci.yml?label=tests&color=34d399" alt="CI" /></a>
|
|
15
|
+
<a href="https://venpm.dev"><img src="https://img.shields.io/badge/docs-venpm.dev-f97316" alt="docs" /></a>
|
|
16
|
+
<a href="https://github.com/theokyr/venpm/blob/master/LICENSE"><img src="https://img.shields.io/github/license/theokyr/venpm?color=94a3b8" alt="license" /></a>
|
|
17
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D18-94a3b8" alt="node >= 18" /></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Why venpm?
|
|
23
|
+
|
|
24
|
+
Vencord's userplugin ecosystem is powerful but fragmented. Plugin authors host code in personal repos, users manually clone and rebuild, and there's no dependency resolution, no update tracking, and no discoverability.
|
|
25
|
+
|
|
26
|
+
**venpm fixes this.** Authors publish a small `plugins.json` index alongside their code. Users install plugins with a single command. venpm handles dependencies, version pinning, sparse git checkouts, and Vencord rebuilds automatically.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
venpm install minimalCallBar
|
|
30
|
+
Resolved minimalCallBar@0.1.0 from kamaras-plugins
|
|
31
|
+
Optional: settingsHub, channelTabs (install with venpm install <name>)
|
|
32
|
+
Fetching via git (sparse checkout)...
|
|
33
|
+
Installed minimalCallBar@0.1.0
|
|
34
|
+
Rebuilding Vencord... done
|
|
35
|
+
```
|
|
6
36
|
|
|
7
37
|
## Install
|
|
8
38
|
|
|
@@ -16,50 +46,159 @@ Or run without installing:
|
|
|
16
46
|
npx @kamaras/venpm doctor
|
|
17
47
|
```
|
|
18
48
|
|
|
19
|
-
Requires Node.js 18+.
|
|
20
|
-
|
|
21
49
|
## Quick Start
|
|
22
50
|
|
|
23
51
|
```bash
|
|
24
|
-
|
|
52
|
+
# Check your environment
|
|
53
|
+
venpm doctor
|
|
54
|
+
|
|
55
|
+
# Point venpm at your Vencord install
|
|
25
56
|
venpm config set vencord.path ~/Vencord
|
|
26
57
|
|
|
27
|
-
|
|
28
|
-
venpm
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
venpm
|
|
58
|
+
# Add a plugin repository
|
|
59
|
+
venpm repo add https://example.com/plugins.json
|
|
60
|
+
|
|
61
|
+
# Find and install plugins
|
|
62
|
+
venpm search betterFolders
|
|
63
|
+
venpm install BetterFolders
|
|
64
|
+
venpm list
|
|
65
|
+
venpm update
|
|
66
|
+
venpm rebuild
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Commands
|
|
70
|
+
|
|
71
|
+
| Command | Description |
|
|
72
|
+
|---------|-------------|
|
|
73
|
+
| `venpm install <plugin>` | Install a plugin and its dependencies |
|
|
74
|
+
| `venpm uninstall <plugin>` | Remove a plugin (warns about reverse deps) |
|
|
75
|
+
| `venpm update [plugin]` | Update one or all plugins |
|
|
76
|
+
| `venpm list` | Show installed plugins |
|
|
77
|
+
| `venpm search <query>` | Search across all configured repos |
|
|
78
|
+
| `venpm info <plugin>` | Show plugin details |
|
|
79
|
+
| `venpm repo add\|remove\|list` | Manage plugin index repositories |
|
|
80
|
+
| `venpm config set\|get\|path` | View or edit venpm configuration |
|
|
81
|
+
| `venpm create <path>` | Scaffold a new plugin repo or plugin |
|
|
82
|
+
| `venpm rebuild` | Rebuild Vencord after changes |
|
|
83
|
+
| `venpm doctor` | Diagnose environment issues |
|
|
84
|
+
| `venpm validate [path]` | Validate a `plugins.json` index file |
|
|
85
|
+
|
|
86
|
+
**Global flags:** `--yes` (auto-confirm), `--verbose`, `--quiet`, `--json` (structured output)
|
|
87
|
+
|
|
88
|
+
## How It Works
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Author User
|
|
92
|
+
------ ----
|
|
93
|
+
plugins.json ──publish──> venpm repo add <url>
|
|
94
|
+
| |
|
|
95
|
+
v v
|
|
96
|
+
GitHub / any URL venpm install <plugin>
|
|
97
|
+
|
|
|
98
|
+
resolve deps
|
|
99
|
+
fetch (git sparse checkout / tarball)
|
|
100
|
+
update lockfile
|
|
101
|
+
rebuild Vencord
|
|
32
102
|
```
|
|
33
103
|
|
|
104
|
+
1. **Authors** publish a [`plugins.json`](https://venpm.dev/author/plugin-index) index file — a JSON document describing their plugins, versions, and sources.
|
|
105
|
+
2. **Users** register that URL with `venpm repo add`.
|
|
106
|
+
3. **venpm** resolves the full dependency graph, fetches via git (with sparse checkout for monorepos) or tarball, updates the lockfile, and optionally rebuilds Vencord.
|
|
107
|
+
|
|
34
108
|
## For Plugin Authors
|
|
35
109
|
|
|
36
110
|
```bash
|
|
37
|
-
|
|
38
|
-
venpm create my-plugins
|
|
39
|
-
|
|
111
|
+
# Scaffold a new plugin repository
|
|
112
|
+
venpm create my-plugins
|
|
113
|
+
|
|
114
|
+
# Scaffold a plugin inside an existing repo
|
|
115
|
+
venpm create my-plugins/MyPlugin
|
|
116
|
+
|
|
117
|
+
# Validate your index before publishing
|
|
118
|
+
venpm validate plugins.json --strict
|
|
40
119
|
```
|
|
41
120
|
|
|
42
|
-
|
|
121
|
+
venpm ships a **GitHub Action** for automated index publishing:
|
|
43
122
|
|
|
44
|
-
|
|
123
|
+
```yaml
|
|
124
|
+
- uses: theokyr/venpm/actions/publish-index@master
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
See the [Author Guide](https://venpm.dev/author/your-first-plugin) for the full walkthrough.
|
|
128
|
+
|
|
129
|
+
### Plugin Index Spec
|
|
130
|
+
|
|
131
|
+
The [JSON Schema](https://venpm.dev/schemas/v1/plugins.json) defines the index format. Key features:
|
|
132
|
+
|
|
133
|
+
- **Dependencies & optional dependencies** with automatic resolution
|
|
134
|
+
- **Monorepo support** via `source.git` + `source.path` (sparse checkout)
|
|
135
|
+
- **Multiple source types:** git, tarball, local symlink
|
|
136
|
+
- **Version pinning** with `versions` map of tag/tarball pairs
|
|
137
|
+
- **Informational constraints** for Discord and Vencord versions
|
|
138
|
+
|
|
139
|
+
## Architecture
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
src/
|
|
143
|
+
core/ Pure logic + I/O interfaces (never imports from cli/)
|
|
144
|
+
types.ts All interfaces: IOContext, PluginIndex, Config, Lockfile
|
|
145
|
+
resolver.ts Version resolution, dependency graph, topological sort
|
|
146
|
+
registry.ts Fetch + parse + cache plugin indexes
|
|
147
|
+
fetcher.ts Git clone (sparse checkout), tarball extract, local symlink
|
|
148
|
+
builder.ts Vencord pnpm build, deploy, Discord restart
|
|
149
|
+
... config, lockfile, schema, detect, cache, paths, prompt, log
|
|
150
|
+
cli/ Command handlers (compose core modules)
|
|
151
|
+
context.ts createRealIOContext() — wires real Node.js I/O
|
|
152
|
+
install.ts uninstall.ts update.ts list.ts search.ts ...
|
|
153
|
+
index.ts CLI entry point (commander)
|
|
154
|
+
schemas/v1/ JSON Schemas — the primary deliverable
|
|
155
|
+
actions/ GitHub Action for plugin repo authors
|
|
156
|
+
```
|
|
45
157
|
|
|
46
|
-
|
|
47
|
-
2. Users add that URL with `venpm repo add <url>`.
|
|
48
|
-
3. `venpm install <plugin>` resolves dependencies, fetches via git or tarball, and optionally rebuilds Vencord.
|
|
158
|
+
**Design principle:** All I/O is injected via `IOContext` — filesystem, HTTP, git, shell, prompts, logging. Core modules never import `fs`, `fetch`, or `child_process` directly. This makes the entire core testable with pure mocks.
|
|
49
159
|
|
|
50
160
|
## Development
|
|
51
161
|
|
|
52
162
|
```bash
|
|
53
163
|
git clone https://github.com/theokyr/venpm.git && cd venpm
|
|
54
|
-
node scripts/setup.mjs
|
|
164
|
+
node scripts/setup.mjs # install, build, link globally
|
|
55
165
|
```
|
|
56
166
|
|
|
57
167
|
```bash
|
|
58
|
-
npm run dev
|
|
59
|
-
npm test
|
|
60
|
-
npm run lint
|
|
168
|
+
npm run dev # watch mode (live global updates)
|
|
169
|
+
npm test # 240 tests
|
|
170
|
+
npm run lint # type check (tsc --noEmit)
|
|
171
|
+
npm run build # one-shot compile
|
|
61
172
|
```
|
|
62
173
|
|
|
174
|
+
### Test Suite
|
|
175
|
+
|
|
176
|
+
240 tests across three layers:
|
|
177
|
+
|
|
178
|
+
| Layer | What it tests |
|
|
179
|
+
|-------|---------------|
|
|
180
|
+
| **Unit** | Pure functions — resolver, registry, config, lockfile, schema, detect, cache |
|
|
181
|
+
| **Integration** | Full command flows with mocked IOContext |
|
|
182
|
+
| **E2E** | Compiled CLI as a subprocess against real temp directories |
|
|
183
|
+
|
|
184
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.
|
|
185
|
+
|
|
186
|
+
## Config & State
|
|
187
|
+
|
|
188
|
+
venpm stores configuration in a single XDG-compliant directory:
|
|
189
|
+
|
|
190
|
+
| OS | Path |
|
|
191
|
+
|----|------|
|
|
192
|
+
| Linux | `~/.config/venpm/` |
|
|
193
|
+
| macOS | `~/Library/Application Support/venpm/` |
|
|
194
|
+
| Windows | `%APPDATA%\venpm\` |
|
|
195
|
+
|
|
196
|
+
Files: `config.json`, `venpm-lock.json`, `index-cache.json`
|
|
197
|
+
|
|
198
|
+
## Documentation
|
|
199
|
+
|
|
200
|
+
Full documentation at **[venpm.dev](https://venpm.dev)** — guides, author documentation, API reference, and TypeDoc-generated internals.
|
|
201
|
+
|
|
63
202
|
## License
|
|
64
203
|
|
|
65
|
-
MIT
|
|
204
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/cli/completions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyDzC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyBjE"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ExitCode } from "../core/errors.js";
|
|
2
|
+
import { createRealIOContext } from "./context.js";
|
|
3
|
+
const BASH_COMPLETION = `_venpm_completions() {
|
|
4
|
+
local cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
5
|
+
local commands="install uninstall update list search info repo config create rebuild doctor validate completions"
|
|
6
|
+
if [ "\${COMP_CWORD}" -eq 1 ]; then
|
|
7
|
+
COMPREPLY=( $(compgen -W "\${commands}" -- "\${cur}") )
|
|
8
|
+
fi
|
|
9
|
+
}
|
|
10
|
+
complete -F _venpm_completions venpm`;
|
|
11
|
+
const ZSH_COMPLETION = `#compdef venpm
|
|
12
|
+
_venpm() {
|
|
13
|
+
local -a commands
|
|
14
|
+
commands=(
|
|
15
|
+
'install:Install a plugin and its dependencies'
|
|
16
|
+
'uninstall:Remove a plugin'
|
|
17
|
+
'update:Update one or all plugins'
|
|
18
|
+
'list:List installed plugins'
|
|
19
|
+
'search:Search available plugins'
|
|
20
|
+
'info:Show plugin details'
|
|
21
|
+
'repo:Manage plugin repositories'
|
|
22
|
+
'config:View or edit configuration'
|
|
23
|
+
'create:Scaffold a new plugin or repo'
|
|
24
|
+
'rebuild:Rebuild Vencord'
|
|
25
|
+
'doctor:Check environment health'
|
|
26
|
+
'validate:Validate a plugin index'
|
|
27
|
+
'completions:Output shell completion script'
|
|
28
|
+
)
|
|
29
|
+
_describe 'command' commands
|
|
30
|
+
}
|
|
31
|
+
_venpm`;
|
|
32
|
+
const FISH_COMPLETION = `complete -c venpm -n "__fish_use_subcommand" -a install -d "Install a plugin"
|
|
33
|
+
complete -c venpm -n "__fish_use_subcommand" -a uninstall -d "Remove a plugin"
|
|
34
|
+
complete -c venpm -n "__fish_use_subcommand" -a update -d "Update plugins"
|
|
35
|
+
complete -c venpm -n "__fish_use_subcommand" -a list -d "List installed plugins"
|
|
36
|
+
complete -c venpm -n "__fish_use_subcommand" -a search -d "Search plugins"
|
|
37
|
+
complete -c venpm -n "__fish_use_subcommand" -a info -d "Show plugin details"
|
|
38
|
+
complete -c venpm -n "__fish_use_subcommand" -a repo -d "Manage repositories"
|
|
39
|
+
complete -c venpm -n "__fish_use_subcommand" -a config -d "View/edit configuration"
|
|
40
|
+
complete -c venpm -n "__fish_use_subcommand" -a create -d "Scaffold plugin or repo"
|
|
41
|
+
complete -c venpm -n "__fish_use_subcommand" -a rebuild -d "Rebuild Vencord"
|
|
42
|
+
complete -c venpm -n "__fish_use_subcommand" -a doctor -d "Check environment"
|
|
43
|
+
complete -c venpm -n "__fish_use_subcommand" -a validate -d "Validate plugin index"
|
|
44
|
+
complete -c venpm -n "__fish_use_subcommand" -a completions -d "Output completion script"`;
|
|
45
|
+
function detectShell() {
|
|
46
|
+
const shell = process.env.SHELL ?? "";
|
|
47
|
+
if (shell.includes("zsh"))
|
|
48
|
+
return "zsh";
|
|
49
|
+
if (shell.includes("fish"))
|
|
50
|
+
return "fish";
|
|
51
|
+
return "bash";
|
|
52
|
+
}
|
|
53
|
+
export function registerCompletionsCommand(program) {
|
|
54
|
+
program
|
|
55
|
+
.command("completions [shell]")
|
|
56
|
+
.description("Output shell completion script (bash, zsh, fish)")
|
|
57
|
+
.action((shell) => {
|
|
58
|
+
const globalOpts = program.opts();
|
|
59
|
+
const ctx = createRealIOContext(globalOpts);
|
|
60
|
+
const target = shell ?? detectShell();
|
|
61
|
+
switch (target) {
|
|
62
|
+
case "bash":
|
|
63
|
+
ctx.renderer.write(BASH_COMPLETION + "\n");
|
|
64
|
+
break;
|
|
65
|
+
case "zsh":
|
|
66
|
+
ctx.renderer.write(ZSH_COMPLETION + "\n");
|
|
67
|
+
break;
|
|
68
|
+
case "fish":
|
|
69
|
+
ctx.renderer.write(FISH_COMPLETION + "\n");
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
ctx.renderer.text(`Unknown shell: ${target}. Supported: bash, zsh, fish`);
|
|
73
|
+
ctx.renderer.text(`Usage: eval "$(venpm completions zsh)"`);
|
|
74
|
+
process.exitCode = ExitCode.USAGE_ERROR;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=completions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completions.js","sourceRoot":"","sources":["../../src/cli/completions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,eAAe,GAAG;;;;;;;qCAOa,CAAC;AAEtC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;OAoBhB,CAAC;AAER,MAAM,eAAe,GAAG;;;;;;;;;;;;0FAYkE,CAAC;AAE3F,SAAS,WAAW;IAChB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;IACtC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAC1C,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,OAAgB;IACvD,OAAO;SACF,OAAO,CAAC,qBAAqB,CAAC;SAC9B,WAAW,CAAC,kDAAkD,CAAC;SAC/D,MAAM,CAAC,CAAC,KAAc,EAAE,EAAE;QACvB,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAiB,CAAC;QACjD,MAAM,GAAG,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAE5C,MAAM,MAAM,GAAG,KAAK,IAAI,WAAW,EAAE,CAAC;QACtC,QAAQ,MAAM,EAAE,CAAC;YACb,KAAK,MAAM;gBACP,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;gBAC3C,MAAM;YACV,KAAK,KAAK;gBACN,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;gBAC1C,MAAM;YACV,KAAK,MAAM;gBACP,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;gBAC3C,MAAM;YACV;gBACI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,MAAM,8BAA8B,CAAC,CAAC;gBAC1E,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;gBAC5D,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC;QAChD,CAAC;IACL,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-cmd.d.ts","sourceRoot":"","sources":["../../src/cli/config-cmd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"config-cmd.d.ts","sourceRoot":"","sources":["../../src/cli/config-cmd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyDzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0D5D"}
|
package/dist/cli/config-cmd.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { loadConfig, saveConfig } from "../core/config.js";
|
|
2
2
|
import { getConfigPath, getConfigDir } from "../core/paths.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ErrorCode, makeError, exitCodeForError } from "../core/errors.js";
|
|
4
|
+
import { findCandidates } from "../core/fuzzy.js";
|
|
4
5
|
import { createRealIOContext } from "./context.js";
|
|
5
6
|
function getNestedValue(obj, keys) {
|
|
6
7
|
let current = obj;
|
|
@@ -38,6 +39,20 @@ function coerceValue(raw) {
|
|
|
38
39
|
return raw;
|
|
39
40
|
}
|
|
40
41
|
}
|
|
42
|
+
/** Collect all dotted key paths from a config object for fuzzy matching. */
|
|
43
|
+
function collectConfigKeys(obj, prefix = "") {
|
|
44
|
+
if (obj === null || obj === undefined || typeof obj !== "object")
|
|
45
|
+
return [];
|
|
46
|
+
const keys = [];
|
|
47
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
48
|
+
const path = prefix ? `${prefix}.${k}` : k;
|
|
49
|
+
keys.push(path);
|
|
50
|
+
if (v !== null && typeof v === "object" && !Array.isArray(v)) {
|
|
51
|
+
keys.push(...collectConfigKeys(v, path));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return keys;
|
|
55
|
+
}
|
|
41
56
|
export function registerConfigCommand(program) {
|
|
42
57
|
const config = program
|
|
43
58
|
.command("config")
|
|
@@ -48,17 +63,15 @@ export function registerConfigCommand(program) {
|
|
|
48
63
|
.action(async (key, value) => {
|
|
49
64
|
const parentOpts = program.opts();
|
|
50
65
|
const ctx = createRealIOContext(parentOpts);
|
|
66
|
+
const { renderer } = ctx;
|
|
51
67
|
const configPath = parentOpts.config ?? getConfigPath();
|
|
52
68
|
const cfg = await loadConfig(ctx.fs, configPath);
|
|
53
69
|
const keys = key.split(".");
|
|
54
70
|
const coerced = coerceValue(value);
|
|
55
71
|
setNestedValue(cfg, keys, coerced);
|
|
56
72
|
await saveConfig(ctx.fs, configPath, cfg);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
ctx.logger.success(`Set ${key} = ${JSON.stringify(coerced)}`);
|
|
73
|
+
renderer.success(`Set ${key} = ${JSON.stringify(coerced)}`);
|
|
74
|
+
renderer.finish(true, { key, value: coerced });
|
|
62
75
|
});
|
|
63
76
|
config
|
|
64
77
|
.command("get <key>")
|
|
@@ -66,35 +79,31 @@ export function registerConfigCommand(program) {
|
|
|
66
79
|
.action(async (key) => {
|
|
67
80
|
const parentOpts = program.opts();
|
|
68
81
|
const ctx = createRealIOContext(parentOpts);
|
|
82
|
+
const { renderer } = ctx;
|
|
69
83
|
const configPath = parentOpts.config ?? getConfigPath();
|
|
70
84
|
const cfg = await loadConfig(ctx.fs, configPath);
|
|
71
85
|
const keys = key.split(".");
|
|
72
86
|
const value = getNestedValue(cfg, keys);
|
|
73
87
|
if (value === undefined) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
process.exitCode = 1;
|
|
88
|
+
const allKeys = collectConfigKeys(cfg);
|
|
89
|
+
const candidates = findCandidates(key, allKeys);
|
|
90
|
+
renderer.error(makeError(ErrorCode.PLUGIN_NOT_FOUND, `Key "${key}" not found in config`, { candidates }));
|
|
91
|
+
renderer.finish(false);
|
|
92
|
+
process.exitCode = exitCodeForError(ErrorCode.PLUGIN_NOT_FOUND);
|
|
80
93
|
return;
|
|
81
94
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
console.log(JSON.stringify(value, null, 2));
|
|
95
|
+
renderer.text(JSON.stringify(value, null, 2));
|
|
96
|
+
renderer.finish(true, { key, value });
|
|
87
97
|
});
|
|
88
98
|
config
|
|
89
99
|
.command("path")
|
|
90
100
|
.description("Print the venpm config directory path")
|
|
91
101
|
.action(() => {
|
|
92
102
|
const parentOpts = program.opts();
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
console.log(getConfigDir());
|
|
103
|
+
const ctx = createRealIOContext(parentOpts);
|
|
104
|
+
const { renderer } = ctx;
|
|
105
|
+
renderer.text(getConfigDir());
|
|
106
|
+
renderer.finish(true, { path: getConfigDir() });
|
|
98
107
|
});
|
|
99
108
|
}
|
|
100
109
|
//# sourceMappingURL=config-cmd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-cmd.js","sourceRoot":"","sources":["../../src/cli/config-cmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"config-cmd.js","sourceRoot":"","sources":["../../src/cli/config-cmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,SAAS,cAAc,CAAC,GAAY,EAAE,IAAc;IAChD,IAAI,OAAO,GAAY,GAAG,CAAC;IAC3B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,O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,OAAO,CAAC,CAAC;YAChD,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,gBAAgB,EAAE,QAAQ,GAAG,uBAAuB,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;YAC1G,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvB,OAAO,CAAC,QAAQ,GAAG,gBAAgB,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;YAChE,OAAO;QACX,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9C,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEP,MAAM;SACD,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,uCAAuC,CAAC;SACpD,MAAM,CAAC,GAAG,EAAE;QACT,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAiB,CAAC;QACjD,MAAM,GAAG,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC;QACzB,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAC9B,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACX,CAAC"}
|
package/dist/cli/context.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import type { IOContext, GlobalOptions } from "../core/types.js";
|
|
2
|
-
export declare function createRealIOContext(options: GlobalOptions
|
|
3
|
-
yes?: boolean;
|
|
4
|
-
quiet?: boolean;
|
|
5
|
-
}): IOContext;
|
|
2
|
+
export declare function createRealIOContext(options: GlobalOptions): IOContext;
|
|
6
3
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/cli/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/cli/context.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAkD,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,CA4KrE"}
|
package/dist/cli/context.js
CHANGED
|
@@ -2,7 +2,10 @@ import { execFile as _execFile, spawn as _spawn } from "node:child_process";
|
|
|
2
2
|
import { promisify } from "node:util";
|
|
3
3
|
import * as fsPromises from "node:fs/promises";
|
|
4
4
|
import { createPrompter } from "../core/prompt.js";
|
|
5
|
-
import {
|
|
5
|
+
import { shouldColorize } from "../core/ansi.js";
|
|
6
|
+
import { createPlainRenderer, createTtyRenderer } from "../core/renderer.js";
|
|
7
|
+
import { createJsonRenderer } from "../core/json-renderer.js";
|
|
8
|
+
import { createStreamRenderer } from "../core/stream-renderer.js";
|
|
6
9
|
const execFileAsync = promisify(_execFile);
|
|
7
10
|
export function createRealIOContext(options) {
|
|
8
11
|
const fs = {
|
|
@@ -121,7 +124,7 @@ export function createRealIOContext(options) {
|
|
|
121
124
|
cwd: spawnOptions?.cwd,
|
|
122
125
|
detached: spawnOptions?.detached,
|
|
123
126
|
env: spawnOptions?.env ? { ...process.env, ...spawnOptions.env } : undefined,
|
|
124
|
-
stdio: "
|
|
127
|
+
stdio: "ignore",
|
|
125
128
|
});
|
|
126
129
|
if (spawnOptions?.detached) {
|
|
127
130
|
child.unref();
|
|
@@ -139,11 +142,29 @@ export function createRealIOContext(options) {
|
|
|
139
142
|
});
|
|
140
143
|
},
|
|
141
144
|
};
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
const isJson = options.json ?? false;
|
|
146
|
+
const jsonStream = options.jsonStream ?? false;
|
|
147
|
+
const nonInteractive = !process.stdin.isTTY && !options.yes && !isJson && !jsonStream;
|
|
148
|
+
const prompter = createPrompter({
|
|
149
|
+
yes: options.yes || isJson || jsonStream || false,
|
|
150
|
+
nonInteractive,
|
|
146
151
|
});
|
|
147
|
-
|
|
152
|
+
let renderer;
|
|
153
|
+
if (jsonStream) {
|
|
154
|
+
renderer = createStreamRenderer();
|
|
155
|
+
}
|
|
156
|
+
else if (isJson) {
|
|
157
|
+
renderer = createJsonRenderer();
|
|
158
|
+
}
|
|
159
|
+
else if (process.env["FORCE_COLOR"]) {
|
|
160
|
+
renderer = createTtyRenderer({ verbose: options.verbose ?? false, quiet: options.quiet ?? false });
|
|
161
|
+
}
|
|
162
|
+
else if (!shouldColorize(process.stdout) || options.color === false) {
|
|
163
|
+
renderer = createPlainRenderer({ verbose: options.verbose ?? false, quiet: options.quiet ?? false });
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
renderer = createTtyRenderer({ verbose: options.verbose ?? false, quiet: options.quiet ?? false });
|
|
167
|
+
}
|
|
168
|
+
return { fs, http, git, shell, prompter, renderer };
|
|
148
169
|
}
|
|
149
170
|
//# sourceMappingURL=context.js.map
|
package/dist/cli/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/cli/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/cli/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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AAC;AACxD,CAAC"}
|
package/dist/cli/create.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/cli/create.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAM7E,MAAM,WAAW,aAAc,SAAQ,aAAa;IAChD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAID;;;GAGG;AACH,wBAAsB,iBAAiB,CACnC,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,IAAI,CAAC,CAoBjE;AAID;;;GAGG;AACH,wBAAsB,gBAAgB,CAClC,EAAE,EAAE,UAAU,EACd,UAAU,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,CAG5B;
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/cli/create.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAM7E,MAAM,WAAW,aAAc,SAAQ,aAAa;IAChD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAID;;;GAGG;AACH,wBAAsB,iBAAiB,CACnC,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,MAAM,GACl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