- Always use the latest stable version of npm packages. Do not pin to older versions.
- When adding a new dependency, use the package manager (e.g.
pnpm add <pkg>) to fetch the latest version. Do not manually write version numbers. - Periodically check for outdated packages with
pnpm outdatedand update them.
All apps and examples with dev servers use portless to avoid hardcoded ports. Portless assigns random ports and exposes each app via .localhost URLs.
Naming convention:
- Docs app:
docs.wterm→docs.wterm.localhost - Examples:
<name>.wterm→<name>.wterm.localhost
When adding a new app or example that runs a dev server, wrap its dev script with portless <name>:
{
"scripts": {
"predev": "command -v portless >/dev/null 2>&1 || (echo '\\nportless is required but not installed. Run: npm i -g portless\\nSee: https://github.com/vercel-labs/portless\\n' && exit 1)",
"dev": "portless my-example.wterm next dev --turbopack"
}
}Do not add --port flags — portless handles port assignment automatically. Do not add portless as a project dependency; it must be installed globally.
For any user-facing change (new feature, option, API change, bug fix, etc.), update all relevant documentation:
- Docs app (
apps/docs/src/app/): Update the corresponding MDX pages (e.g.get-started/page.mdx,vanilla/page.mdx,react/page.mdx,configuration/page.mdx,themes/page.mdx). Tables in MDX must use<table>HTML elements, not markdown table syntax. - Root README (
README.md): Keep the package table, features list, and development instructions current. - Package READMEs: Each package under
packages/@wterm/has its ownREADME.md. Update the relevant one when its API, options, or usage changes. @wterm/coreREADME: Must link to every other@wterm/*package. When adding or removing a package, update the "Related Packages" section inpackages/@wterm/core/README.md.- Navigation (
apps/docs/src/lib/docs-navigation.ts): Update if adding or renaming pages. - Page titles (
apps/docs/src/lib/page-titles.ts): Update if adding new pages. - Example READMEs: Each example under
examples/must have aREADME.mdcovering what it does, setup steps, how it works, and key files. - Code examples in docs: Ensure import paths match the current package structure (e.g.
@wterm/domfor vanilla JS,@wterm/reactfor React).
Releases are manual, single-PR affairs. The maintainer controls the changelog voice and format. All @wterm/* packages share a single version number.
To prepare a release:
- Create a branch (e.g.
prepare-v0.2.0) - Bump the version in
packages/@wterm/core/package.json - Run
pnpm sync-versionsto update all other@wterm/*packages - Write the changelog entry in
CHANGELOG.md, wrapped in<!-- release:start -->and<!-- release:end -->markers - Remove the
<!-- release:start -->and<!-- release:end -->markers from the previous release entry (only the latest release should have markers) - Open a PR and merge to
main
To publish (run locally after merging):
pnpm publish-packagesThis builds all packages and publishes every @wterm/* package to npm.