Relevant source files
The following files were used as context for generating this wiki page:
The release process for the comp project encompasses automated package publishing, rigorous dependency management, and defined build and deployment strategies. This ensures consistency across internal packages, simplifies the integration of external dependencies, and provides a structured approach to delivering the application and its components.
This document outlines the mechanisms in place for managing releases, from internal package versioning to deployment considerations.
Automated Package Publishing
The project utilizes semantic-release to automate the publishing of internal packages to npm. This process is triggered upon merging pull requests into the release branch, ensuring that new versions are released consistently and follow semantic versioning principles based on conventional commits.
Published Packages
The following internal packages are automatically published:
| Package Name | Description |
|---|---|
@comp/db | Database utilities with Prisma client |
@comp/email | Email templates and components |
@comp/kv | Key-value store utilities using Upstash Redis |
@comp/ui | UI component library with Tailwind CSS |
Sources: README.md:166-169
Publishing Workflow
The publishing workflow is designed to be fully automated once changes are merged into the release branch.
Setup NPM Token
To enable
semantic-releaseto publish packages, an npm token must be configured as a GitHub repository secret namedNPM_TOKEN.Trigger Release
Create and merge pull requests into the
releasebranch.semantic-releasewill automatically detect conventional commits and bump versions accordingly.
Sources: README.md:173-174
Local Development and Testing
Developers can build and test packages locally before they are published.
# Build all packages in the monorepo
bun run build
# Build a specific package, e.g., @comp/ui
bun run -F @comp/ui build
# Test the release process without actually publishing
bun run release:packages --dry-runSources: README.md:180-185
Dependency Management and Consistency
The project uses syncpack to enforce consistent dependency versions across all packages within the monorepo. This tool is configured via .syncpackrc.json to manage internal package references, ensure uniform versions for critical external dependencies, and prevent the inclusion of forbidden modules.
Configuration Overview
Sources: .syncpackrc.json
Key Consistency Rules
All internal @comp packages are configured to use exact workspace:* versions. This ensures that all parts of the monorepo reference the latest local version of internal dependencies.
semverGroups:
This group specifically targets internal packages, ensuring they use workspace:* for their version ranges.
| Label | Packages | Dependencies | Range |
|---|---|---|---|
| Use exact versions for internal packages | @comp/** | @comp/** | workspace:* |
versionGroups:
These groups ensure that critical external dependencies maintain consistent versions across all packages in the monorepo.
| Label | Dependencies |
|---|---|
| Ensure React is consistent | react, react-dom, @types/react, @types/react-dom, react-is |
| Ensure Next.js is consistent | next |
| Ensure TypeScript is consistent | typescript |
| Ensure common build tools are consistent | postcss, tailwindcss, @tailwindcss/**, autoprefixer |
| Ensure testing tools are consistent | @types/node, prettier, turbo |
| Ensure ESLint is consistent | eslint, eslint-config-next |
lintRules:
A set of rules to forbid certain dependencies, typically Node.js built-in modules or mistakenly added packages, to maintain a clean and predictable dependency graph.
| Rule | Dependencies | Message |
|---|---|---|
forbiddenDependencies | crypto, buffer, fs, path, os, install, npm | This is a Node.js built-in module or a mistakenly added dependency |
Sources: .syncpackrc.json
Deployment Considerations
While detailed deployment steps for Docker and Vercel are "coming soon", the project's package.json files provide insights into the planned deployment strategies and build processes.
Build and Deployment Scripts
The apps/api/package.json defines several scripts relevant to building and deploying the API service:
| Script Name | Command | Description |
|---|---|---|
prebuild | bun run db:generate | Generates the Prisma client before the main build process. |
build | nest build | Compiles the NestJS application. |
build:docker | bunx prisma generate && nest build | Prepares the application for Docker by generating Prisma client and then building the NestJS app. |
deploy:trigger-prod | npx trigger.dev@4.0.6 deploy | Deploys Trigger.dev jobs to the production environment. |
start:prod | node dist/main | Starts the compiled NestJS application in production mode. |
Sources: apps/api/package.json:96-100, apps/api/package.json:104