Publishing & releases
Subtly is the public JavaScript package subtly, hosted in the Subtly GitHub repository.
Install
npm install subtlyimport { createInteractions } from "subtly";import "subtly/styles.css"; // optionalconst interactions = createInteractions();interactions.start();For advanced positioning, install @floating-ui/dom separately and import subtly/floating. The main entry does not import Floating UI.
Release workflow
- Update the version in
package.jsonand add release notes toCHANGELOG.md. - Run
npm test,npm run check,npm pack --dry-run, and the documentation validation script. - Configure npm Trusted Publisher for the
publish-npm.ymlGitHub Actions workflow and run Publish npm release frommain. The workflow publishes with OIDC and creates the GitHub release after npm succeeds. - Verify the npm version, provenance, release tag and website examples.
In the library repository, GitHub Actions runs package tests and documentation checks. Its original Pages workflow regenerates and deploys docs/. The new website has an independent Next.js build and Vercel deployment, described below. The library’s original Pages site uses GitHub Actions. The separate website is configured for Vercel.
Licensing
No license has been selected for this release. Add a license file after choosing terms for reuse.
GitHub Packages mirror
The GitHub npm registry requires scoped package names. The library repository includes a manually triggered workflow to publish the same source separately as @afonsoocamacho/subtly; the npmjs.org package remains the simpler subtly name. Run Publish GitHub Packages npm mirror from the library repository's Actions tab to publish the current version. The first GitHub Packages publication is private by default, so change its package visibility to public in the package settings if you want others to install it. This is a separate registry workflow, not a requirement for npm install subtly.
For an authenticated GitHub Packages install, configure the scope in .npmrc:
@afonsoocamacho:registry=https://npm.pkg.github.com//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}Then install with npm install @afonsoocamacho/subtly. Keep the npmjs.org install command as npm install subtly.
Update the website
Edit content/docs/*.mdx in the private website repository. Each page is Markdown with a small metadata header. The sidebar lives in src/content/navigation.json, examples in src/examples/, and brand/syntax colors in src/styles/globals.css. The repository's EDITING.md explains how to add a page or change an example.
npm ci --ignore-scriptsnpm run devBefore merging, run the type check, tests, security check, build and generated-content check. The Website checks workflow repeats the checks. Vercel deploys the connected repository, with the required checks included in its build command. It does not contain an npm publishing step.
Legacy library website
The original static website remains in the library repository. Its source-generation commands are retained here for that older deployment:
npm run docs:buildgit add docs scriptsgit commit -m "docs: update Subtly documentation"git push