@r_masseater/vite-plus-adopt 0.13.0 → 0.15.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @r_masseater/vite-plus-adopt
2
2
 
3
- `vpa` is a CLI that brings secret scanning with h56m, commitlint, textlint, fallow and agent skill installation into Vite+. Write their settings and your dependency rules in `vite.config.ts`, and `vpa` reads them from there.
3
+ `vpa` is a CLI that brings secret scanning with h56m, commitlint, textlint, fallow, agent skill installation and pinned command-line tools into Vite+. Write their settings and your dependency rules in `vite.config.ts`, and `vpa` reads them from there.
4
4
  Running `vpa` once with no arguments runs every configured check in parallel and prints the results together.
5
5
  It also bundles @arethetypeswrong/core running on TypeScript 7 alone.
6
6
  For Feature-Sliced Design and other structure rules, use [wism](https://www.npmjs.com/package/@r_masseater/wism).
@@ -12,11 +12,11 @@ For Feature-Sliced Design and other structure rules, use [wism](https://www.npmj
12
12
  ## Usage
13
13
 
14
14
  ```sh
15
- vp add -D @r_masseater/vite-plus-adopt @r_masseater/h56m-presets
15
+ vp add -D @r_masseater/vite-plus-adopt @r_masseater/h56m/presets
16
16
  ```
17
17
 
18
18
  ```ts
19
- import { betterleaks } from "@r_masseater/h56m-presets";
19
+ import { betterleaks } from "@r_masseater/h56m/presets";
20
20
  import type {} from "@r_masseater/vite-plus-adopt";
21
21
  import { defineConfig } from "vite-plus";
22
22
 
@@ -40,7 +40,7 @@ export default defineConfig({
40
40
  });
41
41
  ```
42
42
 
43
- `import type {} from "@r_masseater/vite-plus-adopt"` types the keys vpa reads (`commitlint`, `dependencyRules`, `fallow`, `h56m`, `skills` and `textlint`) on `defineConfig`.
43
+ `import type {} from "@r_masseater/vite-plus-adopt"` types the keys vpa reads (`commitlint`, `dependencyRules`, `fallow`, `h56m`, `skills`, `textlint` and `tools`) on `defineConfig`.
44
44
  textlint checks the Markdown files Git tracks. To check other files too, list their globs (`files`) and the settings for them in `textlint.sources`. `presets` work there as well.
45
45
 
46
46
  Write the Git hooks like this.
@@ -76,12 +76,50 @@ Fetched skills are stored read-only in `~/.cache/vpa/skills/` (under `XDG_CACHE_
76
76
 
77
77
  A key starting with `./` is a folder in this repository. It takes no commit and points directly to the folders under it that contain `SKILL.md`.
78
78
 
79
- Put `vpa --prepare` in `prepare`. To let Renovate update the commits, extend this preset in `renovate.json`.
79
+ Put `vpa --prepare` in `prepare`. To let Renovate update the commits and the tool versions, extend this preset in `renovate.json`.
80
80
 
81
81
  ```json
82
82
  { "extends": ["github>masseater/ecosystems//libs/vite-plus-adopt/renovate"] }
83
83
  ```
84
84
 
85
+ ## Command-line tools
86
+
87
+ List release assets in `tools`, and `vpa --prepare` downloads them, checks their sha256 and links their binaries into `node_modules/.bin`, where `vp run` and `vp exec` find them. This replaces mise for tools that ship as archives.
88
+
89
+ ```ts
90
+ export default defineConfig({
91
+ tools: {
92
+ "open-telemetry/weaver": {
93
+ version: "0.28.0",
94
+ assets: {
95
+ "linux-x64": "weaver-x86_64-unknown-linux-gnu.tar.xz",
96
+ "darwin-arm64": "weaver-aarch64-apple-darwin.tar.xz",
97
+ "win32-x64": "weaver-x86_64-pc-windows-msvc.zip",
98
+ },
99
+ },
100
+ "open-telemetry/opentelemetry-collector-releases": {
101
+ version: "0.166.0",
102
+ bin: ["otelcol"],
103
+ assets: { "linux-x64": "otelcol_{version}_linux_amd64.tar.gz" },
104
+ },
105
+ dotnet: {
106
+ version: "11.0.100",
107
+ base: "https://builds.dotnet.microsoft.com/dotnet/Sdk/{version}",
108
+ assets: { "linux-x64": "dotnet-sdk-{version}-linux-x64.tar.gz" },
109
+ },
110
+ },
111
+ });
112
+ ```
113
+
114
+ - The key is `owner/repo` of the GitHub release, which is downloaded from `https://github.com/<owner>/<repo>/releases/download/v<version>/<asset>`. Any other key needs `base`, the URL that holds the assets. `{version}` in `base` and in an asset name is replaced by `version`.
115
+ - `assets` maps a platform (`linux-x64`, `linux-arm64`, `darwin-x64`, `darwin-arm64`, `win32-x64`) to an asset name. A tool with no asset for the current platform is skipped.
116
+ - `bin` lists the executables to link. It defaults to the repository name. Windows gets `.cmd` launchers, because linking an `.exe` there needs the symbolic link privilege. Archives are unpacked with `tar`, which is bsdtar on Windows and reads `.zip` and `.tar.xz` too.
117
+ - `vpa-lock.json` next to `vite.config.ts` pins the sha256 of each asset by its URL. A URL without an entry is recorded when it is first downloaded, and a download that no longer matches its entry fails. Commit the file.
118
+ - Tools are stored in `~/.cache/vpa/tools/`, keyed by version, platform and checksum, and shared by every worktree. Set `VPA_TOOLS=false` to skip them, for a job that needs none.
119
+ - A `tools` section in the `vite.config.ts` of a workspace works with `vpa --prepare` run in that workspace. It links into that workspace's `node_modules/.bin`.
120
+
121
+ The Renovate preset updates `version` of each GitHub key and of `dotnet`. A new version has no entry in `vpa-lock.json` yet, so `vpa --prepare` records it.
122
+
85
123
  ## Replacement for @arethetypeswrong/core
86
124
 
87
125
  `@r_masseater/vite-plus-adopt/attw` provides the same API as [@arethetypeswrong/core][attw] 0.18.5, on TypeScript 7.1 alone.