@enke.dev/bumper 0.0.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/LICENSE +21 -0
- package/README.md +137 -0
- package/dist/cli.mjs +2924 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 enke.dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# bumper
|
|
2
|
+
|
|
3
|
+
Central, module-based repo updater that detects a repo's runtime + package manager and bumps everything: Node LTS,
|
|
4
|
+
`@types/node`, all dependencies, the package manager itself, GitHub Actions pins, and Node
|
|
5
|
+
versions in Docker/Compose files.
|
|
6
|
+
|
|
7
|
+
## tl;dr
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
# run bumper in the current repo, auto-detecting everything
|
|
11
|
+
npx @enke.dev/bumper update # with npm
|
|
12
|
+
pnpm dlx @enke.dev/bumper update # with pnpm
|
|
13
|
+
bunx --bun @enke.dev/bumper update # with Bun, no Node needed
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Works across **node/pnpm**, **node/npm** and **bun** repos, single-package or monorepo.
|
|
17
|
+
|
|
18
|
+
Dependencies are bumped by resolving each package's latest version via the repo's own package
|
|
19
|
+
manager (`pnpm view` / `npm view`, so private scoped registries + `.npmrc` auth just work),
|
|
20
|
+
rewriting `package.json` specs (preserving `^`/`~`), then letting the package manager reinstall.
|
|
21
|
+
|
|
22
|
+
Bumps are **peer-aware**: before rewriting, bumper reads the `peerDependencies` of every
|
|
23
|
+
installed dependency (from `node_modules`) and caps each shared dependency to the newest version
|
|
24
|
+
still satisfying every declared peer range. So a preset that peer-pins `typescript` to `6.0.3`
|
|
25
|
+
(e.g. [`@enke.dev/lint`](https://www.npmjs.com/package/@enke.dev/lint)) holds `typescript` at
|
|
26
|
+
`6.0.3` instead of jumping to a newer major that would break the preset — no per-repo config
|
|
27
|
+
needed, the declaration lives in the dependency itself.
|
|
28
|
+
|
|
29
|
+
> **Note** — network runs through subprocesses (`curl` for the Node dist index, `pnpm`/`npm view`
|
|
30
|
+
> for versions, `actions-up` via `bunx`), so private-registry auth is handled by the tools that
|
|
31
|
+
> own it — the repo's own `.npmrc` just works.
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
Published publicly to [npm](https://www.npmjs.com/package/@enke.dev/bumper) as `@enke.dev/bumper`.
|
|
36
|
+
The bin is a single bundled JS file (`dist/cli.mjs`) — no platform binaries — so it runs on
|
|
37
|
+
**Node ≥22** _or_ **Bun**.
|
|
38
|
+
|
|
39
|
+
### Run without installing
|
|
40
|
+
|
|
41
|
+
Use your package manager's runner to fetch + execute the latest version on the fly:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
npx @enke.dev/bumper … # npm
|
|
45
|
+
pnpm dlx @enke.dev/bumper … # pnpm
|
|
46
|
+
bunx --bun @enke.dev/bumper … # bun (--bun forces the Bun runtime, no Node needed)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Install globally
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
npm install -g @enke.dev/bumper
|
|
53
|
+
pnpm add -g @enke.dev/bumper
|
|
54
|
+
bun add -g @enke.dev/bumper
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Then invoke `bumper` (or `bmpr`) directly.
|
|
58
|
+
|
|
59
|
+
### From source
|
|
60
|
+
|
|
61
|
+
Requires [Bun](https://bun.sh) to build.
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
bun install # installs deps + builds ./dist/cli.mjs (prepare hook)
|
|
65
|
+
bun run dev … # run the CLI straight from source, no build needed
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
To get a global `bumper` on your `PATH` from the working tree (e.g. to dogfood it in other
|
|
69
|
+
repos), build and link once:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
bun run build # refresh ./dist/cli.mjs
|
|
73
|
+
bun link # symlinks it into ~/.bun/bin (on PATH for a standard Bun install)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The link tracks `dist/cli.mjs` live — re-run `bun run build` to update what `bumper` executes;
|
|
77
|
+
no need to link again. `bun link` writes the platform-appropriate shim, so this works on Windows too.
|
|
78
|
+
|
|
79
|
+
## Usage
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
bumper # no command → shows help
|
|
83
|
+
bumper help # show help (also: bumper --help)
|
|
84
|
+
bumper detect # show context + applicable modules for the cwd
|
|
85
|
+
bumper detect /path --json # machine-readable detection
|
|
86
|
+
bumper update # run every applicable module, in order
|
|
87
|
+
bumper update --dry-run # print intended steps, change nothing
|
|
88
|
+
bumper update --only node,pnpm
|
|
89
|
+
bumper update --skip github-actions
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Modules
|
|
93
|
+
|
|
94
|
+
Each concern is a self-detecting, self-updating unit behind a common `Module` interface, in one of
|
|
95
|
+
three families (mirrored by the `modules/` folder layout): **runtimes**, **package-managers** and
|
|
96
|
+
**features**. The update procedure just runs every module whose detector matches, in registry order
|
|
97
|
+
— runtimes first (pin versions), then dependency-pinning features, then package managers install,
|
|
98
|
+
then the remaining file-rewriting features:
|
|
99
|
+
|
|
100
|
+
| id | kind | detects | does |
|
|
101
|
+
| ---------------- | --------------- | ------------------------------- | ------------------------------------------------------- |
|
|
102
|
+
| `node` | runtime | node runtime / `.node-version` | install latest LTS via fnm/asdf, write `.node-version` |
|
|
103
|
+
| `types-node` | feature | `@types/node` in any package | pin spec to Node LTS major |
|
|
104
|
+
| `bun` | package-manager | bun packageManager / lockfile | self-upgrade, bump specs, pin `.bun-version`, reinstall |
|
|
105
|
+
| `npm` | package-manager | npm packageManager / lockfile | bump specs to latest, clean reinstall |
|
|
106
|
+
| `pnpm` | package-manager | pnpm packageManager / lockfile | self-update, bump specs to latest, clean reinstall |
|
|
107
|
+
| `docker` | feature | `Dockerfile*` / `compose*.yaml` | align `node:<ver>` / `NODE_VERSION=` to LTS |
|
|
108
|
+
| `github-actions` | feature | `.github/workflows/*.y{a,}ml` | pin actions via `actions-up` |
|
|
109
|
+
|
|
110
|
+
Adding a concern = adding one module (`*.runtime.ts` / `*.package-manager.ts` / `*.feature.ts`)
|
|
111
|
+
implementing the `Module` interface and registering it. `bumper detect` exposes per-module
|
|
112
|
+
detection, so a later multi-step CLI or GUI can build on top of the same registry.
|
|
113
|
+
|
|
114
|
+
## Config (`~/.bumperrc`)
|
|
115
|
+
|
|
116
|
+
Path-scoped overrides. Running in an unknown repo auto-detects everything and persists a default
|
|
117
|
+
(`mode: auto`) entry, so the next run is already scoped:
|
|
118
|
+
|
|
119
|
+
```jsonc
|
|
120
|
+
{
|
|
121
|
+
"repos": {
|
|
122
|
+
"/absolute/path/to/repository": {
|
|
123
|
+
"mode": "auto", // auto = re-detect; manual = respect stored toggles
|
|
124
|
+
"exclude": ["packages/vendored-pkg"], // repo-relative dirs skipped in workspace ops
|
|
125
|
+
"modules": { "docker": false }, // explicit per-module on/off overrides, keyed by module id
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
bumper config list
|
|
133
|
+
bumper config get /path/to/repo
|
|
134
|
+
bumper config set /path/to/repo exclude packages/a,packages/b
|
|
135
|
+
bumper config set /path/to/repo modules.docker false
|
|
136
|
+
bumper config set /path/to/repo mode manual
|
|
137
|
+
```
|