This document outlines the required tools and standards for the Spectrum Tokens project. All contributors must follow these guidelines to ensure consistency and maintainability across the codebase.
Status: Required for all JavaScript/TypeScript testing
- Usage: All test files must use AVA as the testing framework
- Configuration: Each package must include an
ava.config.jsfile - File Pattern: Test files must follow the pattern
test/**/*.test.js - Standards:
- Use ESM syntax (
export defaultconfig) - Set
verbose: truefor detailed output - Set
failFast: falseto run all tests - Set
failWithoutAssertions: trueto catch incomplete tests - Set
NODE_ENV: "test"in environment variables
- Use ESM syntax (
Example Configuration:
export default {
files: ["test/**/*.test.js"],
environmentVariables: {
NODE_ENV: "test",
},
verbose: true,
failFast: false,
failWithoutAssertions: true,
};Status: Required for all package management and workspace management
- Version:
pnpm@10.17.1(specified inpackageManagerfield) - Usage: All package installation, updates, and script execution must use pnpm
- Workspace: The project uses pnpm workspaces defined in
pnpm-workspace.yaml - Standards:
- Never use
npmoryarncommands - Use
pnpm installfor dependency installation - Use
pnpm runfor script execution - Use
pnpm addfor adding dependencies - Maintain the
pnpm-lock.yamlfile in version control
- Never use
Workspace Configuration:
packages:
- "packages/*"
- "docs/*"
- "tools/*"Status: Required for task management and CI/CD coordination
- Usage: All tasks must be defined in
moon.ymlfiles - Integration: moon works with pnpm workspace for efficient task execution
- Standards:
- Define tasks in
moon.ymlat root and package levels - Use
moon runfor task execution - Leverage moon's caching and dependency management
- Set appropriate
platform: nodefor Node.js tasks
- Define tasks in
Core Tasks:
tasks:
test:
command: [pnpm, ava, test]
platform: node
pre-commit:
command: [pnpm, lint-staged]
platform: node
local: true
prepare:
command: [pnpm, "husky || true"]
platform: node
local: true
release:
command: [pnpm, changeset publish]
platform: node
local: trueStatus: Required for all version bumps and releases
- Usage: All version changes must go through changesets workflow
- Configuration: Project uses GitHub changelog integration
- Standards:
- Create changesets for all breaking changes and new features
- Use
pnpm changesetto create new changesets - Use
pnpm changeset versionto bump versions - Use
pnpm changeset publishto publish releases - Follow conventional changelog format
Configuration:
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "adobe/spectrum-design-data" }
],
"commit": false,
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch"
}Status: Required for all git commit messages
- Usage: All commit messages must follow conventional commit format
- Configuration: Uses
@commitlint/config-conventionalwith custom ignore rules - Standards:
- Use conventional commit format:
type(scope): description - Types:
feat,fix,docs,style,refactor,test,chore - Scope is optional but recommended for clarity
- Description should be in present tense and lowercase
- Breaking changes must include
BREAKING CHANGE:in footer or!after type/scope
- Use conventional commit format:
Commit Message Examples:
feat(tokens): add new semantic color tokens
fix(diff-generator): handle edge case in token comparison
docs(readme): update installation instructions
chore(deps): update dependencies to latest versions
feat(tokens)!: remove deprecated color tokens
Configuration:
module.exports = {
extends: ["@commitlint/config-conventional"],
ignores: [
(message) => message.includes("[create-pull-request] automated change"),
],
};- moon + pnpm: All moon tasks must use pnpm commands
- AVA + moon: Test execution must go through moon's task system
- changesets + moon: Release tasks must be defined in moon configuration
- pnpm + workspaces: All packages must be part of the pnpm workspace
- commitlint + git: All commits must pass commitlint validation
- commitlint + husky: Pre-commit hooks validate commit messages
- Setup: Use
pnpm installto install dependencies - Testing: Use
moon run testto run tests - Pre-commit: Use
moon run pre-commitfor lint-staged checks - Committing: Use conventional commit format for all commits
- Versioning: Use
pnpm changesetfor version changes - Publishing: Use
moon run releasefor releases
- Must include
ava.config.jsfor testing - Must include
moon.ymlfor task definition - Must be added to
pnpm-workspace.yamlpackages array - Must follow the established patterns from existing packages
- All builds must use pnpm for dependency installation
- All tasks must be executed through moon
- All releases must use changesets workflow
- No direct npm/yarn usage allowed
- All tool dependencies are managed at the root level
- Package-specific configurations are allowed but must follow the standards
- Version pinning is enforced through
packageManagerfield
pnpm-workspace.yaml- Workspace configurationmoon.yml- Task definitions.changeset/config.json- Release configurationava.config.js- Testing configuration (per package)pnpm-lock.yaml- Lock file (maintained automatically)commitlint.config.cjs- Commit message formatting rules
- ❌ Using
npm installoryarn install - ❌ Using test frameworks other than AVA
- ❌ Manual version bumps without changesets
- ❌ Bypassing moon for defined tasks
- ❌ Publishing packages without changesets workflow
- ❌ Using non-conventional commit message formats
- ❌ Committing without proper type/scope information
- Required: Node.js
~20.12(specified in engines) - All tooling must be compatible with this version
Note: This document should be updated when tooling versions or configurations change. All changes to tooling standards must be reviewed and approved by the maintainers.