npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pol-studios/core-sync

v1.0.0

Published

CLI for syncing core schemas, functions, and triggers across projects

Readme

@pol-studios/core-sync

CLI for syncing core schemas, Edge Functions, and Trigger.dev resources across projects.

Usage

Run from anywhere within the POL-One monorepo:

pnpm exec core-sync <command>

Commands

Status

Check sync status across all resource types:

# Default project
pnpm exec core-sync status

# Specific project
pnpm exec core-sync status --project temple

# All projects
pnpm exec core-sync status --all-projects

Sync Schemas

Generate a migration file using migra diff:

# Preview changes (dry-run)
pnpm exec core-sync sync schemas --dry-run

# Preview with error details
pnpm exec core-sync sync schemas --dry-run --verbose

# Generate migration
pnpm exec core-sync sync schemas

# Custom migration name
pnpm exec core-sync sync schemas --name add_new_feature

# Specific project
pnpm exec core-sync sync schemas --project temple

Requires: Local Supabase running in the target project

Sync Functions

Copy Edge Functions from core to project:

# Preview changes
pnpm exec core-sync sync functions --dry-run

# Sync all functions
pnpm exec core-sync sync functions

# Sync specific function
pnpm exec core-sync sync functions --function query

# Specific project
pnpm exec core-sync sync functions --project temple

Sync Triggers

Copy Trigger.dev resources from core to project:

# Preview changes
pnpm exec core-sync sync triggers --dry-run

# Sync all
pnpm exec core-sync sync triggers

# Specific project
pnpm exec core-sync sync triggers --project temple

Sync All

Run all syncs at once:

pnpm exec core-sync sync all --dry-run
pnpm exec core-sync sync all --project temple
pnpm exec core-sync sync all --all-projects

Init

Generate a config file template:

pnpm exec core-sync init
pnpm exec core-sync init --force  # Overwrite existing

Configuration

Create core-sync.config.ts at the repo root:

import { defineConfig } from '@pol-studios/core-sync';

export default defineConfig({
  // Path to the core folder
  corePath: 'apps/core',

  // Optional: override default paths within core
  core: {
    schemas: 'schemas',      // default
    functions: 'functions',  // default
    triggers: 'trigger',     // default
  },

  // Projects to sync to
  projects: {
    self: {
      // Default project (POL-One itself)
      target: {
        migrations: 'supabase/migrations',
        functions: 'supabase/functions',
        triggers: 'apps/trigger',
      },
    },
    temple: {
      // External project
      path: '/path/to/TempleV2',
      target: {
        migrations: 'supabase/migrations',
        functions: 'supabase/functions',
        triggers: 'apps/trigger',
      },
      database: {
        port: 54332,  // Custom Supabase port
      },
    },
  },

  // Optional: schema sync options
  options: {
    schemas: ['core'],  // Schemas to diff
    filteredExtensions: [
      'pg_cron', 'pg_net', 'pg_graphql',
      'supabase_vault', 'pgmq', 'wrappers',
    ],
  },
});

How It Works

Schema Sync

  1. Creates two temporary PostgreSQL databases
  2. Applies existing migrations to one database
  3. Applies core schemas to the other database
  4. Runs migra to generate a diff
  5. Saves the diff as a new migration file
  6. Cleans up temporary databases

Function/Trigger Sync

  1. Calculates MD5 hashes of source and target directories
  2. Detects new, modified, and deleted files
  3. Copies changed files to target
  4. Removes deleted files from target

Lock File

A .core-sync.lock file tracks sync state:

{
  "version": 1,
  "lastSync": "2026-03-02T15:30:00Z",
  "schemas": {
    "hash": "abc123",
    "syncedAt": "2026-03-02T15:30:00Z",
    "migrationFile": "20260302_core_schema_sync.sql"
  },
  "functions": {
    "query": { "hash": "def456", "syncedAt": "..." }
  },
  "triggers": {
    "cli": { "hash": "ghi789", "syncedAt": "..." }
  }
}

Development

# Build
pnpm --filter @pol-studios/core-sync build

# Watch mode
pnpm --filter @pol-studios/core-sync dev

# Type check
pnpm --filter @pol-studios/core-sync typecheck