VS Code's built-in default colour provider (editor.defaultColorDecorators, default auto since 1.78) pattern-matches CSS-style hex in languages where no extension provides document colours - so delay controls like #200 grew RGB swatches. The extension now ships the language-scoped configuration default "never" for [verilog] and [systemverilog]; user-overridable, invisible to every other language. Diagnosis verified on the reporting machine: no colour-provider extension installed, no server capability, no user override. Co-Authored-By: Claude Fable 5 <[email protected]>
164 lines
6.4 KiB
Markdown
164 lines
6.4 KiB
Markdown
# Releasing vfmt
|
||
|
||
Everything here runs on a normal developer machine with cargo, node and
|
||
`shasum`. Nothing in the main checklist needs an account anywhere: the
|
||
supported way to install the VS Code extension is to sideload the `.vsix` that
|
||
`tools/release.sh` produces. Marketplace publishing is optional and deferred —
|
||
it lives in the appendix at the bottom.
|
||
|
||
## 1. Bump the version
|
||
|
||
Four files, one number. Keep them identical.
|
||
|
||
| File | What to change |
|
||
|---|---|
|
||
| `Cargo.toml` | `[workspace.package] version` — **all eight crates inherit it** via `version.workspace = true`, so this is the only Rust edit |
|
||
| `Cargo.lock` | regenerated by any `cargo` command; run `cargo check --workspace` and commit the result |
|
||
| `editors/vscode/package.json` | `"version"` |
|
||
| `editors/vscode/package-lock.json` | `"version"` in **both** places (the top level and the `packages[""]` entry) |
|
||
|
||
Nothing hard-codes a version string in Rust: `vfmt --version` and the language
|
||
server's `initialize` → `serverInfo.version` both read `env!("CARGO_PKG_VERSION")`,
|
||
so the workspace bump reaches them for free. Verify after bumping:
|
||
|
||
```bash
|
||
cargo build --release
|
||
target/release/vfmt --version # vfmt X.Y.Z
|
||
```
|
||
|
||
## 2. Write the changelog
|
||
|
||
Add a section to `CHANGELOG.md`, newest first. It is a **user-facing**
|
||
changelog: one tight paragraph per area (formatter/safety net, CLI, linter,
|
||
language server, editors, corpus results), each linking to the feature READMEs
|
||
under `docs/features/` that hold the detail. Not a commit log, not a round log.
|
||
|
||
## 3. Gate
|
||
|
||
All three must be clean before anything is built for distribution:
|
||
|
||
```bash
|
||
cargo fmt --check
|
||
cargo clippy --all-targets
|
||
cargo test --workspace
|
||
```
|
||
|
||
Optionally re-run the real-world corpus check and quote the result in the
|
||
changelog (`tools/corpus_fetch.sh` once, then `tools/corpus_check.sh`); a
|
||
verification error or a crash there is a release blocker by definition.
|
||
|
||
## 4. Build the artifacts
|
||
|
||
```bash
|
||
tools/release.sh # or: tools/release.sh -o /some/other/dir
|
||
```
|
||
|
||
It builds `--release`, copies the two binaries into `dist/` under
|
||
version-and-host names, smoke-tests the server binary with
|
||
`editors/vscode/smoke.js`, packages the extension into `dist/vfmt-<version>.vsix`,
|
||
and writes `dist/SHA256SUMS`. `dist/` is gitignored and is deleted and
|
||
recreated on every run.
|
||
|
||
```
|
||
dist/
|
||
vfmt-0.4.2-aarch64-apple-darwin
|
||
vfmt-server-0.4.2-aarch64-apple-darwin
|
||
vfmt-0.4.2.vsix
|
||
SHA256SUMS
|
||
```
|
||
|
||
Verify the checksums the way a downloader would:
|
||
|
||
```bash
|
||
cd dist && shasum -a 256 -c SHA256SUMS
|
||
```
|
||
|
||
**The binaries are host-only.** `release.sh` does not cross-compile — it builds
|
||
for `rustc -vV`'s own host triple and names the files after it. Producing
|
||
Linux and Windows binaries means running the script on those machines (or
|
||
under a container) and collecting the `dist/` directories; that is deliberate,
|
||
because the alternative is a cross-compilation toolchain dependency for a
|
||
project that has none.
|
||
|
||
### The `.vsix`, in detail
|
||
|
||
The script runs, inside `editors/vscode/`:
|
||
|
||
```bash
|
||
npm ci # 8 packages, exact lockfile
|
||
npx @vscode/vsce package --out ../../dist/vfmt-<version>.vsix
|
||
```
|
||
|
||
- **No `--skip-license`.** `vsce` requires a `LICENSE` file next to
|
||
`package.json`; `editors/vscode/LICENSE` is a copy of the repo root's,
|
||
and `vsce` renames it to `LICENSE.txt` inside the package. If the root
|
||
license ever changes, copy it across again — there is no symlink, because
|
||
symlinks do not survive every checkout.
|
||
- **Known environment issue: `vsce` fails under some sandbox paths.** It shells
|
||
out to `npm list --parseable` and globs the paths that command prints. If the
|
||
working directory sits under a path segment the environment rewrites (an
|
||
agent session scratchpad with a UUID in it, for example), `vsce` globs a
|
||
directory that does not exist, collects zero files, and fails with
|
||
`ERROR Extension entrypoint(s) missing ... extension/extension.js`. It is not
|
||
a packaging regression — it reproduces with a two-file toy extension. The fix
|
||
is to package from a plain path, which is why `release.sh` packages inside the
|
||
repo and only writes its *output* to `-o`.
|
||
- `.vscodeignore` keeps `smoke.js`, `.vscode/**` and `.gitignore` out of the
|
||
package. Check that after any change to it:
|
||
`unzip -l dist/vfmt-<version>.vsix | grep smoke` must print nothing, and
|
||
`unzip -l dist/vfmt-<version>.vsix | grep syntaxes` must print the grammar —
|
||
without it, hover cards ship unhighlighted.
|
||
|
||
## 5. Install / distribute
|
||
|
||
```bash
|
||
# the CLI and the server: anywhere on PATH
|
||
install -m 755 dist/vfmt-0.4.2-aarch64-apple-darwin ~/.local/bin/vfmt
|
||
install -m 755 dist/vfmt-server-0.4.2-aarch64-apple-darwin ~/.local/bin/vfmt-server
|
||
|
||
# the editor extension: sideload, no marketplace involved
|
||
code --install-extension dist/vfmt-0.4.2.vsix
|
||
```
|
||
|
||
Publishing the artifacts is a matter of attaching `dist/`'s contents plus
|
||
`SHA256SUMS` to a git tag / release page on `git.luci.ooo`. Tag after the
|
||
gate is green:
|
||
|
||
```bash
|
||
git tag -a v0.4.2 -m 'vfmt 0.4.2'
|
||
git push origin v0.4.2
|
||
```
|
||
|
||
## Appendix — if the owner ever publishes to a marketplace
|
||
|
||
**Optional and deferred.** Sideloading covers every use vfmt has today, and
|
||
none of the steps below can be run by anyone but the repo owner: they need
|
||
accounts, tokens and a decision about the published identity. Recorded here so
|
||
the information is not lost, not as a checklist step.
|
||
|
||
What would have to change first:
|
||
|
||
- `editors/vscode/package.json`'s `publisher` is the literal string
|
||
`REPLACE-ME`. `vsce publish` fails until it is a real publisher id the owner
|
||
has created in the Visual Studio Marketplace.
|
||
- An **icon** (128×128 PNG, `"icon"` in `package.json`) and optionally a
|
||
`galleryBanner`. Deliberately not added: binary brand assets are the owner's
|
||
to choose, and a marketplace listing without them looks unfinished anyway.
|
||
- A marketplace-audience pass over `editors/vscode/README.md` — it becomes the
|
||
extension's listing page verbatim.
|
||
|
||
The commands themselves, once those exist:
|
||
|
||
```bash
|
||
# VS Code Marketplace: needs an Azure DevOps PAT for the publisher
|
||
npx @vscode/vsce publish -p "$VSCE_TOKEN"
|
||
# ... or publish an already-built package
|
||
npx @vscode/vsce publish --packagePath dist/vfmt-0.4.2.vsix -p "$VSCE_TOKEN"
|
||
|
||
# Open VSX (VSCodium, Gitpod, Cursor): needs an Eclipse Foundation account
|
||
npx ovsx publish dist/vfmt-0.4.2.vsix -p "$OVSX_TOKEN"
|
||
```
|
||
|
||
Both tokens are secrets. Neither belongs in this repo, in a shell history, or
|
||
in any file `release.sh` reads.
|