This document outlines the architectural and stylistic conventions for the accessibility-devkit family of projects. Adhering to these conventions ensures consistency, maintainability, and a cohesive developer experience across the ecosystem.
- Core Toolkit:
accessibility-devkit - Extensions:
accessibility-devkit-<area>(e.g.,accessibility-devkit-llm,accessibility-devkit-mobile)
All packages will be scoped under @accessibility-devkit.
- Core/Main Package:
@accessibility-devkit/core(if a primary, framework-agnostic package exists) - Sub-packages:
@accessibility-devkit/<name>(e.g.,@accessibility-devkit/audit,@accessibility-devkit/components,@accessibility-devkit/react,@accessibility-devkit/llm)
The project will be structured as a monorepo managed by a workspace tool like pnpm, Lerna, or Turborepo.
accessibility-devkit/
├── CONVENTIONS.md # This file
├── README.md # High-level project overview
├── LICENSE # MIT License
├── package.json # Root package.json for the workspace
├── .eslintrc.js # Base ESLint config
├── .prettierrc.json # Prettier config
├── tsconfig.base.json # Base TypeScript config
├── packages/ # Directory for all individual NPM packages
│ ├── audit/ # Example: @accessibility-devkit/audit
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ ├── src/
│ │ └── README.md
│ └── components/ # Example: @accessibility-devkit/components
│ └── ...
├── configs/ # Shared configurations (e.g., Jest, Storybook)
├── examples/ # Usage examples for different frameworks
│ ├── react-app/
│ └── vanilla-js/
└── docs/ # Conceptual documentation
├── 01-philosophy.md
├── 02-why-not-overlays.md
└── 03-layered-approach.md
- Language: TypeScript will be used for all packages.
- Style: Prettier will be used for automatic code formatting. A
.prettierrc.jsonfile will be present at the root. - Linting: ESLint will be used for static analysis. A base
.eslintrc.jswill be at the root, with packages extending it as needed. - Build Tool:
tsupor a similar modern bundler will be used to compile TypeScript for each package.
- Root
README.md: Provides a high-level overview of the entireaccessibility-devkitproject, its philosophy, and a guide to the packages within. - Package
README.md: Each package in thepackages/directory must have its ownREADME.mddetailing its specific purpose, API, and usage examples. docs/Directory: Contains long-form conceptual documentation, including the project's philosophy, architectural decisions (e.g., why it's not an overlay), and guides on accessibility best practices.- API Documentation: TypeDoc or a similar tool will be used to generate API documentation from TSDoc comments.
All commit messages must follow the Conventional Commits specification. This facilitates automated changelog generation and versioning.
feat:A new featurefix:A bug fixdocs:Documentation only changesstyle:Changes that do not affect the meaning of the code (white-space, formatting, etc)refactor:A code change that neither fixes a bug nor adds a featureperf:A code change that improves performancetest:Adding missing tests or correcting existing testschore:Changes to the build process or auxiliary tools and libraries
- Tool: Changesets is the preferred tool for managing versioning and publishing of packages in the monorepo.
- Process: When making a change that should trigger a package version bump, a developer will run
pnpm changesetand fill out the prompt. This creates a markdown file that will be committed and later used to automate the release process.