A collection of utility scripts for managing monorepo projects, including cleaning build artifacts and database setup tools.
pnpm add -D @finografic/project-scriptsA utility for cleaning build artifacts and dependencies from your project.
# Clean with default options
clean
# Clean recursively (includes all workspaces)
clean --recursive
# Dry run (shows what would be deleted)
clean --dry-run
# Available flags
--recursive, -r Clean all workspaces recursively
--dry-run, -d Show what would be deleted without actually deleting
--verbose, -v Show detailed progressAn interactive database setup utility for managing schema migrations and seeding data.
- Create a
seed.config.tsfile in your project'sscriptsfolder:
import type { SeedConfig } from '@finografic/project-scripts/db-setup';
export const seedOrder: SeedConfig[] = [
{
name: 'users',
description: 'Base user tables',
},
{
name: 'products',
description: 'Product catalog',
dependencies: ['users'], // Will ensure users are seeded first
},
];- The
db-setupscript requirestsxto load TypeScript config files. You have two options:
Option A: Install tsx in your project (recommended)
{
"devDependencies": {
"tsx": "^4.0.0"
},
"scripts": {
"db.setup": "db-setup"
}
}Option B: Use NODE_OPTIONS (works with pnpm dlx)
{
"scripts": {
"db.setup": "NODE_OPTIONS='--import tsx' db-setup"
}
}Note: tsx is a peerDependency of @finografic/project-scripts and is required for db-setup to work.
pnpm db.setupThe command will present an interactive interface to:
- Select operations to perform (seed data, run migrations, generate migrations)
- Choose specific schemas to process (if seeding data)
- Execute operations in the correct order, respecting dependencies
- Environment files should be located in
apps/server/.env.[environment] - Schema files should be in
apps/server/src/db/schemas/ - Migration commands are executed using
pnpm --filter @touch/server
To keep the package updated in your project:
{
"scripts": {
"project-scripts": "dotenvx run -- pnpm update @finografic/project-scripts --latest --recursive"
}
}