Skip to content

Latest commit

 

History

History
78 lines (58 loc) · 4.4 KB

File metadata and controls

78 lines (58 loc) · 4.4 KB

Development

Emulsify CLI is a TypeScript project that builds to the dist directory and publishes the emulsify binary from dist/index.js.

Setup

Use the Node.js version in .nvmrc, which should satisfy the package requirement of Node.js 24 or newer.

nvm use
npm install
npm run build
npm link

After npm link, run the local CLI:

emulsify --help

Source Layout

Path Purpose
src/index.ts Commander command composition and top-level error handling.
src/handlers Command handlers for init, system, and component commands.
src/handlers/hofs Shared handler wrappers, including progress and system-loading helpers.
src/lib Logging, constants, and CLI error primitives.
src/schemas JSON Schemas for project, system, and variant configuration.
src/scripts Maintenance scripts, including schema type generation and develop version bumps.
src/types Type modules. Generated schema types are prefixed with _.
src/util Platform detection, cache utilities, filesystem helpers, component generation, and project config utilities.

Scripts

Script Purpose
npm run build Generate schema types, compile TypeScript, copy package.json to dist, and install production dependencies in dist.
npm run build-schema-types Generate TypeScript definitions from JSON Schema files.
npm run build-ts Compile TypeScript with tsconfig.dist.json.
npm run watch Rebuild when files in src change.
npm run watch-ts Recompile TypeScript when files in src change.
npm run format Run Prettier on source TypeScript and JavaScript files.
npm run lint Runs the Jest test suite through npm run test.
npm run test Run Jest with coverage.
npm run type Run TypeScript checking without emitting files.
npm run twatch Run Jest without coverage in watch mode.
npm run version:develop Update package metadata from semantic commits on develop.
npm run semantic-release Publish through semantic-release using release.config.cjs.

Run one test file by passing the path after --:

npm run test -- src/handlers/componentCreate.test.ts

Generated Types

Schema-derived type files live in src/types and are generated by:

npm run build-schema-types

Run this after changing files in src/schemas.

Local Verification

Before opening a PR, run:

npm run type
npm run build
npm run test

npm run build may report npm audit warnings from dependencies after the production install in dist; those warnings are not TypeScript build failures.