@se-studio/project-build
v1.4.2
Published
Build tools and management scripts for SE Studio projects
Maintainers
Readme
@se-studio/project-build
Build tools and management scripts for SE Studio projects.
Used by
This package is used by the following apps (and others) for the Tailwind build system, colour setup, and generated types:
- example-empty (this monorepo) – setailwind, setup-colours, type generation
- Customer sites – same CLI tools; see
docs/RELATED_PROJECTS.md
Features
Tailwind Build System
- Custom Tailwind CSS v4 build system with file watching
- Automatic grid generation
- Rich text formatting utilities
- Color lookup generation
- Type-safe configuration
Contentful Management Scripts
- Color field validation setup
- CMS configuration utilities
- Environment management
Repo-root npm release scripts (not in this package)
Trusted publishing for @se-studio/* is configured from the monorepo root via
./scripts/configure-npm-trusted-publishers.sh (workflow release-main.yml).
See docs/NPM_TRUSTED_PUBLISHING.md.
CI Dev versions packages on dev; Release Main publishes from main only.
Installation
pnpm add -D @se-studio/project-buildUsage
Tailwind Build System
Add to your package.json:
{
"scripts": {
"setailwind": "setailwind"
}
}Run the build system:
pnpm setailwindDest Flight debug-info patch
React dest Flight copies unnamed _debugInfo without dedup, which can OOM next dest on large CMS pages. The rewrite dedupes the copy so each receiving chunk keeps each unnamed entry once. Call this at the top of the app next.config.ts. Next loads that file for pnpm dev, pnpm dev:dev, and a raw next dev (local smoke and cloud agents) before dest starts. predev does not run for dev:dev.
import { ensureNextDevFlightPatch } from '@se-studio/project-build/patch-next-dev';
ensureNextDevFlightPatch();The helper no-ops when NODE_ENV is production or NEXT_PHASE is a production phase, so Vercel builds do not rewrite node_modules. It is idempotent. When Next/React ship the upstream fix, the command prints a notice and exits 0 — then remove the call.
patch-next-flight-debuginfo remains the CLI for the same rewrite. Do not write the runtime files in place under node_modules yourself; the patch write+renames to avoid corrupting pnpm hardlinks.
Management Scripts
pnpm setup-coloursAgent skills
SE Studio skills are now published as a separate package: @se-studio/skills. Skill source files live in packages/skills/skills/.
In the monorepo, run from the repo root after editing skills:
pnpm skills:validate
pnpm skills:syncSee packages/skills/README.md for frontmatter rules.
In a customer site, add the package as an exact-version devDependency and link its skills in prepare (skipped on CI/Vercel):
"devDependencies": {
"@se-studio/skills": "<exact version>",
"skills-npm": "^4.1.0"
},
"scripts": {
"prepare": "node -e \"if(process.env.VERCEL||process.env.CI)process.exit(0);process.exit(1)\" || (git config core.hooksPath .githooks && skills-npm --yes)"
}skills-npm --yes links the package's skills from node_modules into .agents/skills (and the agent directories). The version is pinned by the lockfile, so the skills match the installed package. Do not run skills update or skills@latest, do not keep a per-repo scripts/sync-skills.sh, and do not add third-party skill packs (a skill a site needs goes into @se-studio/skills through core). Track skills-npm-lock.json; ignore the linked skill directories (.agents/skills, .claude/skills, .cursor/skills, .grok/skills) except the repo's own authored skills. Use the dir/* form with !dir/<name> exceptions (as eagle-website does), not dir/, which cannot take exceptions. Hooks come from customer-guardrails/ (see packages/skills/references/agent-session/customer-guardrails/README.md); replace git config core.hooksPath .githooks with husky if the repo uses husky.
npx skills add @se-studio/skills is only for a one-off project that does not depend on the package.
API Reference
Main Exports
Tailwind Build System
- Tailwind configuration utilities - Functions for generating Tailwind config files
- Grid generation - Automatic grid system generation
- Color utilities - Color lookup and generation functions
- Font utilities - Typography and font configuration
Management Scripts
- Color field validation - Contentful color field setup utilities
- CMS configuration - Contentful management utilities
CLI Commands
setailwind
Tailwind CSS v4 build system with file watching.
Usage:
setailwind [options]Options:
--watch, -w- Watch for changes and rebuild automatically--config, -c- Path to configuration file
setup-colours
Sets up color field validation in Contentful.
Usage:
setup-coloursadd-cms-type
Adds a component, collection or external component type to Contentful. These are enum values (componentType, collectionType, externalComponentType), not content types, so this appends to the enum and publishes the content type. Append-only and idempotent.
Usage:
add-cms-type component "Logo Wall" "Pricing Table"
add-cms-type collection "Logo Grid" --dry-run
add-cms-type externalComponent "Calendly"Needs CONTENTFUL_SPACE_ID, CONTENTFUL_ENVIRONMENT_NAME and CONTENTFUL_MANAGEMENT_TOKEN (read from .env.local). Afterwards register the type in src/lib/registrations.ts and run pnpm codegen.
seskills sync [target-dir]
Deprecated. Depend on @se-studio/skills and link it with skills-npm (see above). See packages/skills/ for the canonical skill sources.
For detailed JSDoc documentation on all exports, see the TypeScript declaration files (.d.ts) in the package.
License
MIT
