Skip to main content

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)

CommandPurposeWhen to use
npm run buildBuild JS and CSS to dist/ and copy assetsProduce a fresh library build
npm run watchConcurrently watch JS, CSS, and run docs dev serverActive development across lib + docs
npm run watch-localSame as watch but binds docs dev server to local IPTesting from other devices on LAN
npm run build-and-minify-jsRollup build (ESM/UMD) and TypeScript typesJS-only rebuild without CSS
npm run watch-jsWatch and rebuild JS via RollupIterate on JS source only
npm run build-cssCopy CSS from src/ to dist/ and docs staticRebuild CSS only
npm run watch-cssWatch CSS changes and rebuildIterate on CSS only
npm run watch-docsStart docs dev server (Docusaurus)View docs site while developing
npm run watch-docs-localDocs dev server bound to local IPShare docs on local network
npm run copy-to-distCopy built assets into dist/ (incl. UMD)Post-build asset sync
npm run lintLint JS sourcesCheck code style/errors
npm run lint-auto-fixLint with --fixAuto-fix simple lint issues
npm run testRun ESLint + unit testsCI-friendly test suite (29 tests)
npm run tscGenerate TypeScript declaration filesRefresh type definitions
npm run build-proBuild Pro package (.tgz) for customersRelease new Pro version
npm run apiStart API server (license, AI, webhooks)Run backend for Pro features
npm run watch-filesWatch JS + CSS (no docs server)Development without Docusaurus

Notes:

  • npm run watch requires concurrently; if you see “command not found”, run npm install in 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/)

CommandPurposeWhen to use
npm startStart Docusaurus dev serverEdit docs/site locally
npm run buildBuild static siteProduce production docs build
npm run build-and-analyzeBuild with bundle analyzerInspect bundle composition
npm run serveServe the built static sitePreview production build locally
npm run deployDeploy via Docusaurus presetPublish docs site (if configured)
npm run clearClear cached artifactsFix odd dev/build cache issues
npm run docusaurusRun Docusaurus CLIAccess additional CLI commands
npm run swizzleCustomize theme/componentsOverride theme parts safely
npm run write-translationsExtract i18n stringsPrepare for localization
npm run write-heading-idsGenerate stable heading IDsMaintain consistent anchors

Backend proxy (example)

  • The example Express router lives at server/lemonsqueezy/router.js. Mount it under /api/license in 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 either LEMON_SQUEEZY_PRODUCT_ID or LEMON_SQUEEZY_VARIANT_ID.