This template provides a complete TanStack library setup. Follow these steps to create a new library:
Replace the following strings throughout the codebase:
| Find | Replace With | Example |
|---|---|---|
template |
your-library-name |
@tanstack/template → @tanstack/your-library-name |
Template |
YourLibraryName |
class Template → class YourLibraryName |
TEMPLATE |
YOUR_LIBRARY_NAME |
TEMPLATE_VAR → YOUR_LIBRARY_NAME_VAR |
- Update repository URL
- Update homepage URL
- Update description
- Update overrides section with your package names
- Update name, description, keywords
- Update repository directory paths
- Update docs/overview.md with your library's purpose
- Update docs/quick-start.md with real usage examples
- Add guides for your library's features
- Update config.json with your DocSearch credentials
- Update .github/ISSUE_TEMPLATE/bug_report.yml
- Update workflow files if needed
- Update FUNDING.yml with your sponsor links
- Replace placeholder console.log code with your library's implementation
- Update types in src/types.ts
- Write real tests
- Add framework-specific implementations
- Update example apps to demonstrate your library
- Add more examples as needed
- Write comprehensive README describing your library
- Add badges, installation instructions, usage examples
template/
├── packages/
│ ├── template/ # Core library (framework-agnostic)
│ ├── react-template/ # React adapter
│ ├── solid-template/ # Solid adapter
│ ├── template-devtools/ # Base devtools
│ ├── react-template-devtools/ # React devtools
│ └── solid-template-devtools/ # Solid devtools
├── examples/ # Example applications
├── docs/ # Documentation
├── scripts/ # Build and doc scripts
└── .github/ # CI/CD workflows
To add a new framework (e.g., Vue):
- Create
packages/vue-template/directory - Copy structure from
packages/react-template/ - Update package.json with vue-specific dependencies
- Implement Vue-specific primitives
- Add example in
examples/vue/ - Update docs with
framework/vue/adapter.md - Update root package.json overrides
- Update vitest.workspace.js
- Update scripts/generate-docs.ts
# Install dependencies
pnpm install
# Build all packages
pnpm build:all
# Run tests
pnpm test:lib
# Run linting
pnpm test:eslint
# Format code
pnpm format
# Generate documentation
pnpm generate-docs
# Watch mode for development
pnpm watch- Make changes
- Run
pnpm changesetto create a changeset - Commit and push
- Create PR
- Merge PR
- GitHub Actions will automatically version and publish
- See CONTRIBUTING.md for contribution guidelines
- Check existing TanStack libraries for patterns
- Refer to pacer source for complete examples