@r_masseater/vite-plus-adopt 0.14.0 → 0.16.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).
@@ -40,8 +40,9 @@ 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
+ `filterModules` takes textlint filter rules as modules, such as `{ comments: commentsFilter }`, and `filters: { comments: true }` turns one on, so the repository does not have to install them for textlint to find them. With `reportUnusedDirectives: true`, a `textlint-disable` comment that hides no message is an error. The check lints a file with a disable comment a second time without the filters.
45
46
 
46
47
  Write the Git hooks like this.
47
48
 
@@ -76,12 +77,50 @@ Fetched skills are stored read-only in `~/.cache/vpa/skills/` (under `XDG_CACHE_
76
77
 
77
78
  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
79
 
79
- Put `vpa --prepare` in `prepare`. To let Renovate update the commits, extend this preset in `renovate.json`.
80
+ Put `vpa --prepare` in `prepare`. To let Renovate update the commits and the tool versions, extend this preset in `renovate.json`.
80
81
 
81
82
  ```json
82
83
  { "extends": ["github>masseater/ecosystems//libs/vite-plus-adopt/renovate"] }
83
84
  ```
84
85
 
86
+ ## Command-line tools
87
+
88
+ 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.
89
+
90
+ ```ts
91
+ export default defineConfig({
92
+ tools: {
93
+ "open-telemetry/weaver": {
94
+ version: "0.28.0",
95
+ assets: {
96
+ "linux-x64": "weaver-x86_64-unknown-linux-gnu.tar.xz",
97
+ "darwin-arm64": "weaver-aarch64-apple-darwin.tar.xz",
98
+ "win32-x64": "weaver-x86_64-pc-windows-msvc.zip",
99
+ },
100
+ },
101
+ "open-telemetry/opentelemetry-collector-releases": {
102
+ version: "0.166.0",
103
+ bin: ["otelcol"],
104
+ assets: { "linux-x64": "otelcol_{version}_linux_amd64.tar.gz" },
105
+ },
106
+ dotnet: {
107
+ version: "11.0.100",
108
+ base: "https://builds.dotnet.microsoft.com/dotnet/Sdk/{version}",
109
+ assets: { "linux-x64": "dotnet-sdk-{version}-linux-x64.tar.gz" },
110
+ },
111
+ },
112
+ });
113
+ ```
114
+
115
+ - 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`.
116
+ - `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.
117
+ - `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.
118
+ - `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.
119
+ - 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.
120
+ - 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`.
121
+
122
+ 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.
123
+
85
124
  ## Replacement for @arethetypeswrong/core
86
125
 
87
126
  `@r_masseater/vite-plus-adopt/attw` provides the same API as [@arethetypeswrong/core][attw] 0.18.5, on TypeScript 7.1 alone.