tanstack-config
Skill18 starsChanged 2 months agoApache-2.0View on GitHub
Opinionated toolkit for building, versioning, and publishing high-quality JavaScript/TypeScript packages.
- Reads credentials
- Installs packages
In this repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- hooks/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- hooks/CLAUDE.mdCLAUDE.md
- .cursor/rules/backend/hono-gateway.mdcCursor rule
- .cursor/rules/backend/ports.mdcCursor rule
- .cursor/rules/backend/service-bindings.mdcCursor rule
- .cursor/rules/backend/workers-cache.mdcCursor rule
- .cursor/rules/backend/workers-config.mdcCursor rule
- .cursor/rules/contracts/contracts.mdcCursor rule
- .cursor/rules/core/agent-instructions.mdcCursor rule
- .cursor/rules/core/boundaries.mdcCursor rule
- .cursor/rules/core/guardrails.mdcCursor rule
- .cursor/rules/core/turborepo.mdcCursor rule
- .cursor/rules/core/worktrees.mdcCursor rule
- .cursor/rules/frontend/react.mdcCursor rule
- .cursor/rules/frontend/tailwind.mdcCursor rule
- .cursor/rules/frontend/tanstack-query.mdcCursor rule
- .cursor/rules/frontend/tanstack-router.mdcCursor rule
- .cursor/rules/frontend/vite-config.mdcCursor rule
- .cursor/rules/ops/cd.mdcCursor rule
- .cursor/rules/ops/changesets.mdcCursor rule
- .cursor/rules/ops/ci.mdcCursor rule
- .cursor/rules/ops/previews.mdcCursor rule
- .cursor/rules/ops/quality-report.mdcCursor rule
- .cursor/rules/ops/release.mdcCursor rule
- .cursor/rules/quality/code-style.mdcCursor rule
- .cursor/rules/quality/comments.mdcCursor rule
- .cursor/rules/quality/knip.mdcCursor rule
- .cursor/rules/quality/lint-config.mdcCursor rule
- .cursor/rules/quality/markdown-style.mdcCursor rule
- .cursor/rules/quality/naming.mdcCursor rule
- .cursor/rules/quality/simplicity.mdcCursor rule
- .cursor/rules/quality/testing.mdcCursor rule
- .cursor/rules/quality/typescript-config.mdcCursor rule
- .cursor/rules/tests/front-react.mdcCursor rule
- .cursor/rules/tests/hono-workers.mdcCursor rule
- cfSkill
- changesetSkill
- front-vitestSkill
- git-commitSkill
- honoSkill
- monorepo-agent-setupSkill
- playwright-cliSkill
- pnpmSkill
- react-doctorSkill
- reviewSkill
- review-stackSkill
- run-appSkill
- security-auditSkill
- skills-updateSkill
- tanstack-devtoolsSkill
- tanstack-querySkill
- tanstack-routerSkill
- turborepoSkill
- ui-ux-design-best-practicesSkill
- vercel-react-best-practicesSkill
- workers-best-practicesSkill
- skills-updateSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 338
Not setting "type": "module" (causes ESM import issues)
- Distinctive: line 340
Not excluding test files from the build
- Very specific: line 342
Not configuring moduleResolution: "bundler" in tsconfig
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Overview
TanStack Config provides an opinionated, minimal-configuration toolkit for JavaScript/TypeScript package development. It includes Vite-powered build configuration, ESLint presets, publish automation with semantic versioning, and integrations with TypeScript, Prettier, Changesets, and GitHub Actions. Designed for monorepo workflows with pnpm and Nx.
Package: @tanstack/config
Status: Stable
Installation
npm install @tanstack/config --save-dev
# or
pnpm add @tanstack/config -DVite Build Configuration
Basic Setup
// vite.config.ts
import { defineConfig, mergeConfig } from 'vitest/config'
import { tanstackViteConfig } from '@tanstack/config/vite'
const config = defineConfig({
// Your custom Vite config
})
export default mergeConfig(
config,
tanstackViteConfig({
entry: './src/index.ts',
srcDir: './src',
exclude: ['./src/__tests__'],
})
)Multiple Entry Points
import { tanstackViteConfig } from '@tanstack/config/vite'
export default tanstackViteConfig({
entry: [
'./src/index.ts',
'./src/adapters.ts',
'./src/utils.ts',
],
srcDir: './src',
})Build Options
tanstackViteConfig({
entry: './src/index.ts',
srcDir: './src',
exclude: ['./src/__tests__', './src/**/*.test.ts'],
// Generates ESM and CJS outputs
// Generates .d.ts declaration files
// Handles tree-shaking configuration
})ESLint Configuration
Basic Setup
// eslint.config.js
import { tanstackEslintConfig } from '@tanstack/config/eslint'
export default tanstackEslintConfigExtending the Config
// eslint.config.js
import { tanstackEslintConfig } from '@tanstack/config/eslint'
export default [
...tanstackEslintConfig,
{
rules: {
// Custom overrides
'@typescript-eslint/no-explicit-any': 'warn',
},
},
]Publishing
Publish Configuration
// publish.config.ts or used via CLI
import { tanstackPublishConfig } from '@tanstack/config/publish'
export default tanstackPublishConfig({
// Publint-compliant defaults
// Semantic versioning automation
// Changelog generation
})Package.json Setup
{
"name": "@myorg/my-package",
"version": "0.0.0",
"type": "module",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
}
},
"files": ["dist", "src"],
"scripts": {
"build": "vite build",
"lint": "eslint .",
"test": "vitest"
}
}TypeScript Configuration
tsconfig.json
{
"compilerOptions": {
"strict": true,
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "./dist",
"rootDir": "./src",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}Changesets Integration
Setup
npx changeset initCreating a Changeset
npx changeset
# Interactive prompt: select packages, bump type, summaryChangeset Config
// .changeset/config.json
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch"
}GitHub Actions Workflow
CI/CD Pipeline
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- run: pnpm build
- run: pnpm lint
- run: pnpm testPublish Workflow
# .github/workflows/publish.yml
name: Publish
on:
push:
branches: [main]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
- run: pnpm build
- name: Create Release Pull Request or Publish
uses: changesets/action@v1
with:
publish: pnpm publish -r
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}Monorepo Setup (pnpm + Nx)
Workspace Configuration
# pnpm-workspace.yaml
packages:
- 'packages/*'
- 'examples/*'Nx Configuration
// nx.json
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "lint", "test"]
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
}
}
}Prettier Configuration
// .prettierrc
{
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80
}EditorConfig
# .editorconfig
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = trueBest Practices
- Use the Vite config for builds - handles ESM/CJS dual output and declarations
- Use publint-compliant exports in package.json for compatibility
- Use Changesets for version management in monorepos
- Set
"type": "module"in package.json for ESM-first packages - Include both
srcanddistinfilesfor source map debugging - Use Nx caching for faster builds in monorepos
- Always generate declaration files (
.d.ts) for TypeScript consumers - Use the ESLint config as a consistent baseline across packages
- Automate publishing with GitHub Actions and Changesets
Common Pitfalls
- Missing
exportsfield in package.json (breaks modern bundlers) - Not setting
"type": "module"(causes ESM import issues) - Forgetting declaration files in build output
- Not excluding test files from the build
- Publishing without running publint validation first
- Not configuring
moduleResolution: "bundler"in tsconfig - Inconsistent versioning across monorepo packages (use Changesets
linked)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

