Installation
Scaffolding (Recommended)
Section titled “Scaffolding (Recommended)”The fastest way to start:
# npmnpm create whisq@latest my-app
# pnpmpnpm create whisq my-app
# bunbun create Whisq my-appThis creates a project with Vite, TypeScript, and a counter example.
Adding to an Existing Project
Section titled “Adding to an Existing Project”Package Manager
Section titled “Package Manager”# npmnpm install @whisq/core
# pnpmpnpm add @whisq/core
# yarnyarn add @whisq/core
# bunbun add @whisq/coreWith Vite
Section titled “With Vite”If you already have a Vite project, just install the package — no plugin needed for basic usage:
npm install @whisq/coreimport { signal, div, button, span, mount } from "@whisq/core";
const count = signal(0);
mount( div( button({ onclick: () => count.value++ }, "Click me"), span(() => `Count: ${count.value}`), ), document.getElementById("app")!,);For file-based routing, add the Vite plugin:
npm install @whisq/vite-pluginimport { defineConfig } from "vite";import { Whisq } from "@whisq/vite-plugin";
export default defineConfig({ plugins: [Whisq()],});TypeScript Configuration
Section titled “TypeScript Configuration”Whisq is written in TypeScript and ships with types. Recommended tsconfig.json:
{ "compilerOptions": { "target": "ES2022", "module": "ESNext", "moduleResolution": "bundler", "lib": ["ES2022", "DOM", "DOM.Iterable"], "strict": true, "esModuleInterop": true, "skipLibCheck": true, "isolatedModules": true }, "include": ["src"]}CDN (No Build)
Section titled “CDN (No Build)”For prototyping or small projects, use Whisq directly via CDN:
<!DOCTYPE html><html> <body> <div id="app"></div> <script type="module"> import { signal, div, button, span, mount } from "https://esm.sh/@whisq/core";
const count = signal(0);
mount( div( button({ onclick: () => count.value++ }, "+"), span(() => ` ${count.value} `), ), document.getElementById("app"), ); </script> </body></html>Optional Packages
Section titled “Optional Packages”| Package | Purpose | Install |
|---|---|---|
@whisq/router | Client-side routing | npm i @whisq/router |
@whisq/ssr | Server-side rendering | npm i @whisq/ssr |
@whisq/testing | Component testing | npm i -D @whisq/testing |
@whisq/vite-plugin | File routing, HMR | npm i -D @whisq/vite-plugin |
@whisq/devtools | Runtime debugging | npm i -D @whisq/devtools |
Next Steps
Section titled “Next Steps”- Your First Component — Build something real
- Signals — Understand reactive state