@emporix/process-diagram
v2.0.0
Published
Process diagram library
Downloads
661
Readme
@emporix/process-diagram
A React component library for building process diagrams and workflow visualizations.
Installation
npm install @emporix/process-diagramDevelopment
Install Dependencies
npm installDevelopment Server
Start the development server:
npm run devBuild
Build the library for production:
npm run buildThis command will:
- Build the library using Vite
- Generate TypeScript type definitions
- Copy type definitions to the dist folder
The output will be in the dist directory with:
index.cjs- CommonJS bundleindex.mjs- ES module bundleindex.d.ts- TypeScript definitionstypes.d.ts- Additional type definitions
Publish
Before publishing, ensure you have:
- Built the library (
npm run build) - Updated the version in
package.json - Committed all changes
- Created a git tag (if using semantic versioning)
Publishing to npm
npm publishFor scoped packages, you may need to configure access:
npm publish --access publicPublishing a specific version
npm version patch|minor|major
npm publishStorybook
Running Storybook
Start the Storybook development server:
npm run storybookThis will start Storybook on http://localhost:6006
Building Storybook
Build a static version of Storybook:
npm run build-storybookThe static build will be output to the storybook-static directory, which can be deployed to any static hosting service.
Storybook Features
- Component Documentation: View all components with interactive examples
- Accessibility Testing: Built-in accessibility addon
- Visual Testing: Integration with Chromatic for visual regression testing
- Component Playground: Test components in isolation
Available Scripts
npm run dev- Start development servernpm run build- Build the library for productionnpm run lint- Run ESLint and fix issuesnpm run format- Format code with Prettiernpm run format:check- Check code formattingnpm run preview- Preview production buildnpm run test- Run testsnpm run test:watch- Run tests in watch modenpm run test:ui- Run tests with UInpm run test:coverage- Run tests with coveragenpm run storybook- Start Storybook development servernpm run build-storybook- Build static Storybook
Usage
import { Trigger, ProcessStep } from '@emporix/process-diagram'
import type { Step } from '@emporix/process-diagram'
const steps: Step[] = [
{ id: '1', title: 'Step 1' },
{ id: '2', title: 'Step 2' },
]
function App() {
return <Trigger steps={steps} />
}License
[Add your license here]
