This package is published to npm as @thijsbroersen/vite-plugin-scalajs.
Releases use semantic versioning aligned with git tags:
| Git tag | npm dist-tag | Example |
|---|---|---|
vX.Y.Z |
latest |
v2.0.6 |
vX.Y.Z-beta.N |
beta |
v2.1.0-beta.1 |
vX.Y.Z-rc.N |
beta |
v2.1.0-rc.1 |
There are no automatic publishes from main. Only pushing a v* tag triggers .github/workflows/release.yml.
-
Bump
versioninpackage.jsononmain. -
Commit and push to
main. -
Create and push a matching tag:
git tag v2.0.6 git push origin v2.0.6
-
The release workflow will:
- Verify the tag matches
package.json(e.g. tagv2.0.6→ version2.0.6) - Run tests (including sbt 1.x and 2.x fixtures)
- Build TypeScript output
- Publish to npm with the
latestdist-tag
- Verify the tag matches
-
Set a pre-release version in
package.json, e.g.2.1.0-beta.1. -
Commit, push, and tag:
git tag v2.1.0-beta.1 git push origin v2.1.0-beta.1
-
The workflow publishes with
--tag betasolatestis unchanged.
Install pre-releases with:
pnpm add -D @thijsbroersen/vite-plugin-scalajs@betaScoped packages under your npm username are available without creating an organization:
- Package:
@thijsbroersen/vite-plugin-scalajs - Registry: https://registry.npmjs.org/
Trusted Publishing requires the package to exist on npm. Publish once locally:
pnpm install
pnpm build
pnpm publish --access public --no-git-checksYou must be logged in as thijsbroersen (npm login).
After the first publish, set up OIDC so GitHub Actions can publish without a long-lived NPM_TOKEN:
- Open the package on npmjs.com → Settings → Trusted Publisher
- Choose GitHub Actions
- Set:
- Organization or user:
thijsbroersen - Repository:
vite-plugin-scalajs - Workflow filename:
release.yml(must match exactly, including.yml) - Environment: leave empty unless you use a GitHub Environment
- Organization or user:
Requirements for CI publishes:
- GitHub-hosted runner (
ubuntu-latest) - Workflow permission
id-token: write - Publish step uses
npm publish— npm Trusted Publishing only supports the npm CLI, notpnpm publish - pnpm is still used for install, build, and test; only the final upload uses npm
- npm ≥ 11.5.1 (upgraded in
release.yml)
Verify your Trusted Publisher settings on npm match exactly:
| Field | Value |
|---|---|
| User/org | thijsbroersen |
| Repository | vite-plugin-scalajs |
| Workflow filename | release.yml |
| Environment | empty (unless you use a GitHub Environment) |
If Trusted Publishing fails, add an npm automation token as repository secret NPM_TOKEN and set it before publish:
pnpm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
pnpm publish --access public --no-git-checks --provenanceInspect what would be published without uploading:
pnpm pack
tar -tzf thijsbroersen-vite-plugin-scalajs-*.tgzThe tarball should contain dist/, package.json, README.md, and LICENSE only (no src/ or test/).
| Problem | Likely cause |
|---|---|
Tag vX.Y.Z does not match package.json |
Forgot to bump version before tagging |
grep: invalid option in release workflow |
Pattern `-(beta |
ERR_PNPM_AUTH_TOKEN_EXCHANGE / Skipped OIDC |
Use npm publish for CI — pnpm OIDC exchange is not supported by npm Trusted Publishing |
E404 / ENEEDAUTH on CI publish |
Trusted Publisher workflow/repo mismatch — see table in section 3 |
E422 provenance / repository.url mismatch |
package.json repository.url must match GitHub owner casing exactly (e.g. ThijsBroersen, not thijsbroersen) |