forgemap 0.4.1-dev-main.48-b1e759e โ 0.4.1
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 +41 -42
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
[](https://www.npmjs.com/package/forgemap)
|
|
12
12
|
[](LICENSE)
|
|
13
13
|
|
|
14
|
-

|
|
15
|
-
|
|
16
14
|
</div>
|
|
17
15
|
|
|
18
16
|
---
|
|
@@ -37,41 +35,53 @@ That's it. Every repo lands at a predictable `<root>/<forge.dir>/<owner>/<repo>`
|
|
|
37
35
|
- **๐งฐ Typed config** โ `forgemap.config.ts` with `defineForgeMapConfig()`, parent walk-up discovery, and a global fallback.
|
|
38
36
|
- **๐ Shell-friendly** โ `forgemap shell-init --install` wires up real `forgemap cd <slug>` **and** tab-completion in one step.
|
|
39
37
|
|
|
40
|
-
## ๐ฆ
|
|
41
|
-
|
|
42
|
-
> [!IMPORTANT]
|
|
43
|
-
> Needs **Node 24+** and **`git`** on `PATH`. [`gh`](https://cli.github.com/) (GitHub CLI) is only required when a `type: 'github'` forge is configured โ run `forgemap validate` for an exact rundown of what your config needs.
|
|
38
|
+
## ๐ฆ Installation
|
|
44
39
|
|
|
45
40
|
```bash
|
|
46
|
-
npm install -g forgemap
|
|
41
|
+
npm install -g forgemap
|
|
42
|
+
# or
|
|
43
|
+
pnpm add -g forgemap
|
|
44
|
+
```
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
forgemap config init # write a starter forgemap.config.ts
|
|
50
|
-
forgemap shell-init --install # cd wrapper + completion โ your rc file (idempotent)
|
|
51
|
-
source ~/.zshrc # re-source once, then it's automatic
|
|
46
|
+
**Requirements**
|
|
52
47
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
- Node 24+
|
|
49
|
+
- `git` on `PATH`
|
|
50
|
+
- [`gh`](https://cli.github.com/) (GitHub CLI) โ only when a `type: 'github'` forge is configured
|
|
56
51
|
|
|
57
|
-
`forgemap
|
|
52
|
+
Run `forgemap validate` after setup for an exact rundown of what's needed for your config.
|
|
58
53
|
|
|
59
|
-
|
|
60
|
-
<summary><strong>All commands</strong> โ clone, cd, search, open, sync/status, import, cleanup, validate, shell-init, config</summary>
|
|
54
|
+
Hacking on forgemap itself? See [CONTRIBUTING.md โ Trying the CLI locally](CONTRIBUTING.md#trying-the-cli-locally) โ covers `pnpm setup`, `pnpm link --global .` and the shell-wrapper source.
|
|
61
55
|
|
|
62
|
-
|
|
56
|
+
## ๐ Quick start
|
|
63
57
|
|
|
64
58
|
```bash
|
|
65
|
-
|
|
59
|
+
# 1. Pick a directory that should hold all your repos and drop a config there.
|
|
60
|
+
cd ~/projects
|
|
61
|
+
forgemap config init
|
|
62
|
+
|
|
63
|
+
# 2. Wire up the shell integration once โ real `forgemap cd` + tab-completion.
|
|
64
|
+
forgemap shell-init --install # appends loaders to ~/.zshrc (or bashrc/fish)
|
|
65
|
+
source ~/.zshrc # re-source once, then it's automatic
|
|
66
|
+
# Prefer manual? eval "$(forgemap shell-init)" ยท fish: forgemap shell-init fish | source
|
|
67
|
+
|
|
68
|
+
# 3. Clone โ any slug form works.
|
|
69
|
+
forgemap clone kirchDev/laravel-pbac
|
|
66
70
|
forgemap clone github:TitusKirch/forgemap
|
|
67
71
|
forgemap clone https://github.com/foo/bar
|
|
68
72
|
|
|
73
|
+
# 4. Jump into a repo from anywhere.
|
|
69
74
|
forgemap cd kirchDev/laravel-pbac # exact slug โ direct cd
|
|
70
75
|
forgemap cd laravel # fuzzy single match โ direct cd
|
|
71
76
|
forgemap cd kirch # multiple matches โ interactive picker
|
|
72
77
|
forgemap cd # no arg โ picker over every clone
|
|
73
78
|
```
|
|
74
79
|
|
|
80
|
+
`forgemap cd` resolves the slug, walks/picks across your cloned repos,
|
|
81
|
+
and actually changes directory because the shell wrapper from
|
|
82
|
+
`shell-init` intercepts it before the binary runs. Every other
|
|
83
|
+
subcommand falls through to the real binary unchanged.
|
|
84
|
+
|
|
75
85
|
### Search and pick on demand
|
|
76
86
|
|
|
77
87
|
```bash
|
|
@@ -144,7 +154,6 @@ Validates the schema, required CLI tools (`git` always, `gh` when a `type: 'gith
|
|
|
144
154
|
forgemap shell-init --install # cd wrapper + completion โ your rc file (idempotent)
|
|
145
155
|
forgemap completion --install # completion only, if you don't want the cd wrapper
|
|
146
156
|
forgemap shell-init # print the wrapper (manual: eval "$(โฆ)")
|
|
147
|
-
forgemap shell-init fish | source # fish: source the wrapper directly
|
|
148
157
|
forgemap completion bash # print the completion script for bash/zsh/fish
|
|
149
158
|
```
|
|
150
159
|
|
|
@@ -157,8 +166,6 @@ forgemap config init # write a starter forgemap.config.ts
|
|
|
157
166
|
forgemap config show # print the resolved config + which file it came from
|
|
158
167
|
```
|
|
159
168
|
|
|
160
|
-
</details>
|
|
161
|
-
|
|
162
169
|
## โ๏ธ Configuration
|
|
163
170
|
|
|
164
171
|
`forgemap config init` writes a `forgemap.config.ts` like this:
|
|
@@ -185,14 +192,6 @@ export default defineForgeMapConfig({
|
|
|
185
192
|
});
|
|
186
193
|
```
|
|
187
194
|
|
|
188
|
-
The config is discovered by walking **up** from your current directory (so `forgemap cd` works from inside any clone), then falling back to `~/.config/forgemap/`. Override with `--config <path>` or the `FORGEMAP_CONFIG` env var.
|
|
189
|
-
|
|
190
|
-
> [!TIP]
|
|
191
|
-
> Already have a directory full of repos? Skip writing this by hand โ `forgemap import <path>` derives `root` + `forges` from the existing layout.
|
|
192
|
-
|
|
193
|
-
<details>
|
|
194
|
-
<summary><strong>All configuration options</strong></summary>
|
|
195
|
-
|
|
196
195
|
| Key | What it controls |
|
|
197
196
|
| :------------------- | :-------------------------------------------------------------------------------------------------------- |
|
|
198
197
|
| `root` | Base directory for all clones. Relative paths resolve against the config file's directory. |
|
|
@@ -204,10 +203,10 @@ The config is discovered by walking **up** from your current directory (so `forg
|
|
|
204
203
|
|
|
205
204
|
The config file is discovered by walking **up** from your current directory (so `forgemap cd` works from inside any clone, not just the root), then falling back to a global `$XDG_CONFIG_HOME/forgemap/forgemap.config.*` (i.e. `~/.config/forgemap/`) so commands work from anywhere. Override with `--config <path>` or the `FORGEMAP_CONFIG` env var.
|
|
206
205
|
|
|
207
|
-
|
|
206
|
+
> [!TIP]
|
|
207
|
+
> Already have a directory full of repos? Skip writing this by hand โ `forgemap import <path>` derives `root` + `forges` from the existing layout.
|
|
208
208
|
|
|
209
|
-
|
|
210
|
-
<summary><strong>Repo layout & slug syntax</strong></summary>
|
|
209
|
+
## ๐๏ธ Layout
|
|
211
210
|
|
|
212
211
|
```
|
|
213
212
|
<root>/
|
|
@@ -228,6 +227,8 @@ Example with the default config rooted at `~/projects`:
|
|
|
228
227
|
โโโ forgemap/
|
|
229
228
|
```
|
|
230
229
|
|
|
230
|
+
## ๐ช Slug syntax
|
|
231
|
+
|
|
231
232
|
| Form | Resolves to |
|
|
232
233
|
| :---------------------------------- | :----------------------------------------------------- |
|
|
233
234
|
| `kirchDev/laravel-pbac` | Default forge, `kirchDev/laravel-pbac`. |
|
|
@@ -236,14 +237,7 @@ Example with the default config rooted at `~/projects`:
|
|
|
236
237
|
| `https://github.com/foo/bar.git` | Same, `.git` suffix stripped. |
|
|
237
238
|
| `git@github.com:foo/bar.git` | SSH form, host matched against `forges[].host`. |
|
|
238
239
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
## ๐ค Contributing
|
|
242
|
-
|
|
243
|
-
PRs welcome. Conventional Commits required (enforced via commitlint); Husky runs lint-staged on every commit. Run `pnpm check:fix` before pushing โ CI will catch what husky missed.
|
|
244
|
-
|
|
245
|
-
<details>
|
|
246
|
-
<summary><strong>Dev scripts</strong></summary>
|
|
240
|
+
## ๐งช Testing
|
|
247
241
|
|
|
248
242
|
```bash
|
|
249
243
|
pnpm install
|
|
@@ -255,7 +249,12 @@ pnpm bench # microbench scanRepos / cache hit / cache rebuild
|
|
|
255
249
|
|
|
256
250
|
Tune the bench layout via env vars (`FORGEMAP_BENCH_FORGES`, `FORGEMAP_BENCH_OWNERS`, `FORGEMAP_BENCH_REPOS`, `FORGEMAP_BENCH_RUNS`).
|
|
257
251
|
|
|
258
|
-
|
|
252
|
+
## ๐ค Contributing
|
|
253
|
+
|
|
254
|
+
PRs welcome. Conventional Commits required (enforced via commitlint). Husky runs lint-staged on every commit.
|
|
255
|
+
|
|
256
|
+
> [!TIP]
|
|
257
|
+
> Run `pnpm check:fix` before pushing โ CI will catch what husky missed.
|
|
259
258
|
|
|
260
259
|
## ๐ฃ๏ธ Versioning
|
|
261
260
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "forgemap",
|
|
4
|
-
"version": "0.4.1
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"description": "CLI that manages a local repo layout grouped by git server, organization and repository name.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cli",
|