Shared packages, configurations, and architectural patterns for Perimetre projects.
@perimetre/eslint-config-base- Base ESLint rules for TypeScript projects@perimetre/eslint-config-nextjs- Next.js ESLint configuration (extends base)@perimetre/eslint-config-react- React ESLint with hooks, a11y, and TanStack Query rules@perimetre/eslint-config-graphql- GraphQL ESLint configuration@perimetre/eslint-config-trpc- tRPC-optimized ESLint configuration@perimetre/lintstaged-config-nextjs- lint-staged configuration for Next.js projects@perimetre/prettier-config- Prettier configuration
@perimetre/service-builder- Type-safe service layer builder with error-as-values pattern@perimetre/helpers- Shared TypeScript utilities (Faker, CSV parsing)@perimetre/icons- Accessible React icon wrapper with TypeScript enforcement@perimetre/classnames- Classname utility combining clsx and tailwind-merge
@perimetre/ui- Reusable React component library with brand-aware theming built on Tailwind CSS v4 and Radix UI primitives
AI-focused documentation for patterns and best practices:
LLMs/error-handling-exception.md- Error-as-values pattern with TypeScriptLLMs/services.md- Service layer architecture guideLLMs/trpc.md- tRPC implementation patterns for Next.jsLLMs/react-hook-form.md- Form handling patternsLLMs/graphql.md- GraphQL + TanStack Query usageLLMs/tanstack-query.md- TanStack Query patternsLLMs/icons.md- Icon implementation guide
Working example projects:
examples/trpc/- Full tRPC + service layer implementationexamples/tanstack-query-and-graphql/- GraphQL + TanStack Query integration
- Install pnpm
- Install GitHub CLI
-
Clone the repository:
gh repo clone perimetre/framework cd framework -
Authenticate with GitHub Package Registry:
gh auth login -h github.com -s read:packages > Select SSH npm config set //npm.pkg.github.com/:_authToken "$(gh auth token)" npm config set @perimetre:registry https://npm.pkg.github.com
-
Install dependencies:
pnpm install
-
Create a feature branch:
git checkout -b feature/your-feature
-
Make your changes to packages
-
Run tests and linting:
pnpm turbo run lint build
-
Create a changeset:
pnpm changeset
-
Commit your changes:
git add . git commit -m "feat: your feature description"
-
Push and create a pull request:
git push -u origin feature/your-feature
Releases are automated when PRs are merged to main:
- Changesets creates a "Version Packages" PR
- Review and merge the PR
- Packages are automatically published to GitHub Package Registry
-
Create
.npmrcin your project root:@perimetre:registry=https://npm.pkg.github.com //npm.pkg.github.com/:_authToken=${NPM_TOKEN}
-
Set up authentication token:
gh auth login -h github.com -s read:packages > Select SSH npm config set //npm.pkg.github.com/:_authToken "$(gh auth token)" npm config set @perimetre:registry https://npm.pkg.github.com
-
Install packages:
pnpm add @perimetre/eslint-config-nextjs
-
Create a GitHub Personal Access Token:
- Go to GitHub Settings → Developer settings → Personal access tokens
- Create token with
read:packagesscope - Or use:
gh auth token(for temporary token)
-
Add environment variable to your CI/CD platform:
- Variable name:
NPM_TOKEN - Value: Your GitHub PAT
- Scope: Both production and preview environments
- Variable name:
-
Ensure
.npmrcis committed to your project (the token uses environment variable substitution, so it's safe)