Skip to main content

Local Package Development

How to test changes to @enterpriseaigroup packages before publishing, and how to create new vertical packages.

Overview

The vertical applications use npm packages from GitHub Package Registry:

  • @enterpriseaigroup/core - Core infrastructure, providers, hooks, UI primitives
  • @enterpriseaigroup/daisy - DAISY-specific components (stages, chatbot, dashboard)
  • @enterpriseaigroup/demo - Template package for creating new verticals

When developing features that require package changes, use the sync script to test locally.

Important: Running npm run build in the packages repo does NOT propagate changes to consuming apps. You must use ./sync-local.sh for local development.

Prerequisites

Clone the packages repository alongside your app:

cloud-stack/
├── packages/ # Package source (@enterpriseaigroup/*)
├── DAISY/ # Uses packages
└── Vertical-template/ # Uses packages

Workflow

1. Make Package Changes

Edit files in the packages source:

cd packages/packages/core/src
# ... make changes ...

2. Build and Sync

Run the sync script to build and copy packages:

cd packages
./sync-local.sh # Sync to all apps
./sync-local.sh daisy # Sync to DAISY only
./sync-local.sh vertical # Sync to Vertical-template only

3. Test in App

Restart your dev server to pick up changes:

cd ../Vertical-template
npm run dev

How It Works

The sync-local.sh script:

  1. Builds packages sequentially - Avoids race conditions with parallel tsup builds
  2. Copies to node_modules - Replaces node_modules/@enterpriseaigroup/*
  3. Preserves package.json - CI/CD continues using published packages
#!/bin/bash
# Build packages sequentially
cd packages/core && npm run build
cd ../daisy && npm run build
cd ../demo && npm run build
cd ../../..

# Copy to app
cp -r packages/core ../DAISY/node_modules/@enterpriseaigroup/core
cp -r packages/daisy ../DAISY/node_modules/@enterpriseaigroup/daisy
cp -r packages/demo ../DAISY/node_modules/@enterpriseaigroup/demo

Important Notes

Changes Don't Survive npm install

If you run npm install in your app, it will overwrite the synced packages with the published versions. Run ./sync-local.sh again after installing dependencies.

CI/CD Uses Published Packages

The sync script only affects local development. CI/CD pipelines install from GitHub Package Registry, so you must publish packages before changes appear in deployments.

TypeScript Caching

If TypeScript doesn't pick up new types, try:

# Clear Next.js cache
rm -rf .next

# Restart TypeScript server in VS Code
Cmd+Shift+P → "TypeScript: Restart TS Server"

Publishing Packages

Publishing is done via GitHub Actions workflow dispatch:

  1. Go to Actions > "Publish Packages" in the packages repo
  2. Select package: core, daisy, demo, or all
  3. Enter version: patch, minor, major, or exact (e.g., 1.2.3)

The workflow builds, publishes to GitHub Package Registry, and commits the version bump.

Creating a New Vertical Package

Use the @enterpriseaigroup/demo package as a template for creating new domain-specific packages.

1. Copy the Demo Package

cd packages/packages
cp -r demo your-vertical-name

2. Update package.json

Edit packages/your-vertical-name/package.json:

{
"name": "@enterpriseaigroup/your-vertical-name",
"description": "Your vertical description",
"dependencies": {
"@enterpriseaigroup/core": "*"
// Add domain-specific dependencies
}
}

3. Build Your Components

The demo package provides a ready-to-use structure:

src/
├── index.ts # Main exports
├── components/ # React components
├── hooks/ # Custom hooks
└── providers/ # Context providers

4. Update Build Scripts

Add your package to sync-local.sh:

cd ../your-vertical-name && npm run build

And to the sync function:

rm -rf "$app_path/node_modules/@enterpriseaigroup/your-vertical-name"
cp -r packages/your-vertical-name "$app_path/node_modules/@enterpriseaigroup/your-vertical-name"

5. Update GitHub Workflow

Add your package to .github/workflows/publish.yml:

  1. Add to the options list
  2. Add a publish step for your package

See the packages repository's CLAUDE.md for detailed instructions on contributing to the @enterpriseaigroup packages.