commands
Commands reference
Before running, install dependencies once in both locations:
- Root:
npm install - Docs site:
cd demo-docs-website && npm install
Root package scripts (run from repo root)
| Command | Purpose | When to use |
|---|---|---|
npm run build | Build JS and CSS to dist/ and copy assets | Produce a fresh library build |
npm run watch | Concurrently watch JS, CSS, and run docs dev server | Active development across lib + docs |
npm run watch-local | Same as watch but binds docs dev server to local IP | Testing from other devices on LAN |
npm run build-and-minify-js | Rollup build (ESM/UMD) and TypeScript types | JS-only rebuild without CSS |
npm run watch-js | Watch and rebuild JS via Rollup | Iterate on JS source only |
npm run build-css | Copy CSS from src/ to dist/ and docs static | Rebuild CSS only |
npm run watch-css | Watch CSS changes and rebuild | Iterate on CSS only |
npm run watch-docs | Start docs dev server (Docusaurus) | View docs site while developing |
npm run watch-docs-local | Docs dev server bound to local IP | Share docs on local network |
npm run copy-to-dist | Copy built assets into dist/ (incl. UMD) | Post-build asset sync |
npm run lint | Lint JS sources | Check code style/errors |
npm run lint-auto-fix | Lint with --fix | Auto-fix simple lint issues |
npm run test | Run ESLint + unit tests | CI-friendly test suite (29 tests) |
npm run tsc | Generate TypeScript declaration files | Refresh type definitions |
npm run build-pro | Build Pro package (.tgz) for customers | Release new Pro version |
npm run api | Start API server (license, AI, webhooks) | Run backend for Pro features |
npm run watch-files | Watch JS + CSS (no docs server) | Development without Docusaurus |
Notes:
npm run watchrequiresconcurrently; if you see “command not found”, runnpm installin the root. As a fallback:npx -y concurrently "npm:watch-js" "npm:watch-css" "npm:watch-docs".
Docs site scripts (run inside demo-docs-website/)
| Command | Purpose | When to use |
|---|---|---|
npm start | Start Docusaurus dev server | Edit docs/site locally |
npm run build | Build static site | Produce production docs build |
npm run build-and-analyze | Build with bundle analyzer | Inspect bundle composition |
npm run serve | Serve the built static site | Preview production build locally |
npm run deploy | Deploy via Docusaurus preset | Publish docs site (if configured) |
npm run clear | Clear cached artifacts | Fix odd dev/build cache issues |
npm run docusaurus | Run Docusaurus CLI | Access additional CLI commands |
npm run swizzle | Customize theme/components | Override theme parts safely |
npm run write-translations | Extract i18n strings | Prepare for localization |
npm run write-heading-ids | Generate stable heading IDs | Maintain consistent anchors |
Backend proxy (example)
- The example Express router lives at
server/lemonsqueezy/router.js. Mount it under/api/licensein your server or export serverless handlers with the same routes:/activate,/validate,/deactivate. - Required env vars:
LEMON_SQUEEZY_API_KEY,LEMON_SQUEEZY_STORE_ID, and eitherLEMON_SQUEEZY_PRODUCT_IDorLEMON_SQUEEZY_VARIANT_ID.