Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🛠️ A collection of reusable scripts and utilities for automating common tasks in JavaScript/TypeScript monorepos.

License

Notifications You must be signed in to change notification settings

finografic/project-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

353 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦋 @finografic/project-scripts

A collection of utility scripts for managing monorepo projects, including cleaning build artifacts and database setup tools.

Installation

pnpm add -D @finografic/project-scripts

Utilities

clean

A 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 progress

db-setup

An interactive database setup utility for managing schema migrations and seeding data.

Prerequisites

  1. Create a seed.config.ts file in your project's scripts folder:
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
  },
];
  1. The db-setup script requires tsx to 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.

Usage

pnpm db.setup

The command will present an interactive interface to:

  1. Select operations to perform (seed data, run migrations, generate migrations)
  2. Choose specific schemas to process (if seeding data)
  3. Execute operations in the correct order, respecting dependencies

Configuration

  • 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

Package Scripts

To keep the package updated in your project:

{
  "scripts": {
    "project-scripts": "dotenvx run -- pnpm update @finografic/project-scripts --latest --recursive"
  }
}

About

🛠️ A collection of reusable scripts and utilities for automating common tasks in JavaScript/TypeScript monorepos.

Resources

License

Stars

Watchers

Forks

Packages

No packages published