Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 1.26 KB

File metadata and controls

67 lines (47 loc) · 1.26 KB

Getting Started

Prerequisites

  • Node.js 24+
  • npm 10+

Installation

cd core
npm install

Create Your First Component

SpecifyJS uses createElement (or JSX) to describe UI:

import { createElement } from 'specifyjs';
import { useState } from 'specifyjs/hooks';
import { createRoot } from 'specifyjs/dom';

function App() {
  const [count, setCount] = useState(0);

  return createElement('div', null,
    createElement('h1', null, `Count: ${count}`),
    createElement('button', {
      onClick: () => setCount(count + 1)
    }, 'Increment'),
  );
}

const root = createRoot(document.getElementById('root'));
root.render(createElement(App, null));

Development Server

Start the Vite dev server for hot-reloading:

npx vite --port 3000

Build for Production

npm run build

Output lands in dist/ with ESM and CJS bundles.

Run Tests

npm test              # Unit + integration (465 tests)
npm run test:e2e      # Playwright browser tests (27 tests)
npm run test:coverage # Tests with coverage report

Next Steps