DocsResources
Get started

Search Subtly documentation

Search by a task, helper name or framework.

Resources

Publishing & releases

Subtly is the public JavaScript package subtly, hosted in the Subtly GitHub repository.

Install

Terminal
npm install subtly
JavaScript
import { createInteractions } from "subtly";
import "subtly/styles.css"; // optional
const 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

  1. Update the version in package.json and add release notes to CHANGELOG.md.
  2. Run npm test, npm run check, npm pack --dry-run, and the documentation validation script.
  3. Configure npm Trusted Publisher for the publish-npm.yml GitHub Actions workflow and run Publish npm release from main. The workflow publishes with OIDC and creates the GitHub release after npm succeeds.
  4. 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:

ini
@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.

Terminal
npm ci --ignore-scripts
npm run dev

Before 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:

Terminal
npm run docs:build
git add docs scripts
git commit -m "docs: update Subtly documentation"
git push