npm Scripts Guide

This page explains every script in the repository root package.json, when to use it, and which order to run scripts for common workflows.

All commands assume you are in the repository root after npm install (or npm ci).

Use these sequences instead of running every script ad hoc. Later steps usually depend on earlier builds or reports.

1. First-time setup

npm ci
npm run architecture:verify
npm run version:check
npm run build:packages
npm start
StepWhy
npm ciInstall locked dependencies
architecture:verifyConfirm package/app dependency direction
version:checkConfirm synchronized package versions
build:packagesProduce Core / Angular / React artifacts under dist/packages
npm startBuild the single-host site and open the local portal

2. Daily local development

Pick one path:

Whole platform (recommended default)

npm start

Multi-host platform (separate ports for docs/showcases)

npm run start:multi-host

Live Angular/React servers behind the portal

npm run portal:dev

One showcase only

npm run serve:vanilla-showcase
# or serve:angular-showcase / serve:react-showcase / serve:docs

3. After code changes (before a PR)

npm run version:check
npm run architecture:verify
npm run lint:all
npm run test:ci
npm run build:site
npm run site:verify
npm run test:hosting
npm run security:quick

Optional focused checks:

npm run test:e2e:smoke
npm test
npm run reports:open

4. Generate browsable test/coverage reports

npm run test:reports
npm run reports:open

Or the CI-shaped path used by release gates:

npm run test:ci

5. Security scanning

npm run security:quick      # day-to-day
npm run security:full       # broader local scan + SBOM
npm run release:security    # strictest gate before publishing

Install Gitleaks, Semgrep, and Dependency-Check (or Docker) for full/release profiles. See Release & Versioning and the repository file tools/security/README.md.

6. Release / publish rehearsal

Do not start with publish. Follow this order:

npm run release:dry-run
# or the fuller local gate:
npm run release:verify

Only after a green rehearsal and an intentional tag/trusted-publisher setup:

# preferred explicit local publish
VRE_CONFIRM_PUBLISH=YES npm run release:publish

# or existing wrapper (also runs release:verify first)
npm run publish:packages

Tagged releases on GitHub run .github/workflows/release.yml, which re-runs the quality gates and publishes with provenance.

7. Hosted evidence refresh (slow)

npm run evidence:refresh

This runs unit/coverage reports, the full Playwright suite, then publishes evidence into the hosted site layout. Prefer test:e2e:smoke during normal development.

Decision cheat sheet

GoalStart with
Open the product locallynpm start
Edit one showcase quicklymatching serve:* script
Validate a PRsequence in “After code changes”
Check security quicklynpm run security:quick
Rehearse npm publishnpm run release:dry-run
Publish packagesrelease:publish or publish:packages after a green gate
Refresh public evidencenpm run evidence:refresh

Script reference

Aliases are noted where a script simply forwards to another command.

Launch & serve

ScriptDescription
startDefault entry: same as start:single-host.
hostAlias of start:single-host.
start:single-hostBuilds the production single-origin site, then serves it.
serve:single-hostServes an already-built single-host site from dist/apps/portal/server.js.
serve:hostAlias of serve:single-host.
start:multi-hostBuilds packages/platform/showcases, then starts multi-host orchestration.
serve:multi-hostStarts multi-host processes without rebuilding.
portalAlias of start:multi-host.
portal:devBuilds packages + platform, then runs the portal with live Angular/React servers.
serveAlias of serve:angular-showcase.
serve:portalServes the compiled portal only.
serve:docsBuilds docs, then serves the docs app.
serve:docs:portalServes an already-built docs server.
serve:angular-showcaseServes the Angular showcase via Angular CLI.
serve:angular-showcase:portalAlias of serve:angular-showcase.
serve:react-showcaseServes the React showcase via Vite.
serve:react-showcase:portalAlias of serve:react-showcase.
serve:vanilla-showcaseServes the Vanilla JS showcase via Vite.
serve:vanilla-showcase:portalAlias of serve:vanilla-showcase.
start:react-showcaseAlias of serve:react-showcase.
start:vanilla-showcaseAlias of serve:vanilla-showcase.
serve:staticServes Playwright static fixtures/helpers.
ngForwards arguments to the Angular CLI inside packages/angular.

Build

ScriptDescription
buildAlias of build:packages.
build:packagesBuilds Core, then Angular adapter, then React adapter.
build:package:coreBuilds @validation-rules-engine/core.
build:package:angularBuilds Core, then @validation-rules-engine/angular.
build:package:reactBuilds Core, then @validation-rules-engine/react.
build:core / build-coreAliases of build:package:core.
build:angularAlias of build:package:angular.
build:reactAlias of build:package:react.
build:libHistorical alias of build:package:angular.
build:platformCompiles portal and docs Node apps.
build:app:portalTypeScript compile for the portal.
build:app:docsTypeScript compile for the docs app.
build:portal / build:docsAliases of the matching build:app:* scripts.
build:showcasesBuilds packages, then all three showcase apps.
build:showcase:angularProduction Angular showcase build.
build:showcase:reactProduction React showcase build.
build:showcase:vanillaProduction Vanilla showcase build.
build:showcase:angular:hostedAngular showcase build for single-host base paths.
build:showcase:react:hostedReact showcase build for single-host mode.
build:showcase:vanilla:hostedVanilla showcase build for single-host mode.
build:angular-showcasePackages + Angular showcase.
build:react-showcaseReact package + React showcase.
build:vanilla-showcaseCore + Vanilla showcase.
build:allPlatform apps + showcases (packages included via showcase builds).
build:siteFull single-host assembly under dist/site (packages, platform, hosted showcases, site packager).
site:verifyVerifies assembled single-host routes, assets, and health.
watch / watch:libWatches Angular library development builds after Core.

Build dependency order for publishable packages:

core → angular
core → react

Single-host site order:

build:packages → build:platform → hosted showcase builds → build-site packager

Version, architecture, branding

ScriptDescription
version:checkVerifies synchronized workspace/package versions and peer ranges.
version:check:distSame checks against built dist/packages/* manifests.
architecture:verifyEnforces dependency direction (showcases → adapters → core).
branding:verifyChecks shared branding/shell expectations.

Security

ScriptDescription
security:scanAlias of security:quick.
security:quickDeveloper security profile (npm audit high+, optional Gitleaks/Semgrep).
security:fullBroader scan including Dependency-Check and SBOM when tooling is available.
security:ciCI security profile.
security:releaseStrictest scanner profile used before publish.
security:dependenciesnpm audit wrapper + OWASP Dependency-Check.
security:secretsGitleaks only.
security:sastSemgrep only.
security:sbomCycloneDX SBOM generation under reports/security/sbom.
security:zapOptional OWASP ZAP baseline (Docker; target must be running).

Reports land in reports/security/ (gitignored) and can be published to the hosted Reports → Security page via npm run evidence:publish. Details: Security Scanning & Reports, Release & Versioning, and the repository file tools/security/README.md.

Release & publish

ScriptDescription
release:securityRuns the release security gate and stops on failure.
release:checkSecurity + version + lint + test:ci + package build + inspect.
release:dry-runFull publish rehearsal without publishing to npm. Start here for releases.
release:packSecurity + build + inspect + write tarballs under artifacts/release-packs.
release:publishFull gated publish; requires VRE_CONFIRM_PUBLISH=YES.
release:inspectInspects built package contents for required/forbidden files.
release:verifyLocal release mega-gate: security, versions, lint, tests, site build, hosting tests, pack dry-run, inspect.
pack:packages:dry-runBuilds packages and dry-runs npm pack for Core/Angular/React.
pack:libLegacy Angular-only pack dry-run.
publish:libLegacy Angular-only publish (prefer synchronized package publish).
publish:packagesRuns release:verify, then publishes all three packages with provenance.

Recommended release order:

release:security
   → tests / lint (via dry-run or verify)
   → build packages
   → SBOM / inspect / pack
   → explicit publish

Unit, coverage, and report generation

ScriptDescription
testRuns platform + Core + Angular + React + all showcase unit suites.
test:platformBuilds platform apps, then runs Node tests for portal/docs.
test:core / test:angular / test:reactPackage unit tests.
test:showcase:angular / :react / :vanillaShowcase unit tests.
test:coverageCoverage-enabled suite across platform and all projects.
test:coverage:*Per-project coverage runs (local Chrome).
test:coverage:*:ciCI Chrome variants where applicable.
test:reportsGenerates branded HTML/JSON/JUnit/coverage reports for every project.
test:reports:*Per-project report generation.
test:ciPlatform tests + CI report generation (used by release gates).
test:allnpm test plus report index regeneration.
test:watch:*Watch-mode unit tests for a single project.
reports:cleanDeletes generated report outputs.
reports:indexRebuilds the reports dashboard index.
reports:verifyVerifies expected report artifacts exist and are consistent.
reports:openOpens the local reports dashboard.

Typical report sequence:

test:reports → reports:verify → reports:open

Playwright E2E & hosting navigation

ScriptDescription
test:e2eDefault Chromium Playwright suite.
test:e2e:smokeFast @smoke Chromium subset. Prefer this while iterating.
test:e2e:allChromium + Firefox + WebKit.
test:e2e:fullBroad regression: browsers, a11y, visual, responsive (slow).
test:e2e:angular / :react / :vanilla / :docs / :portal / :reportsTag-filtered suites.
test:e2e:chromium / :firefox / :webkitBrowser-specific runs.
test:e2e:headed / :debug / :uiInteractive Playwright modes.
test:e2e:visual / :visual:updateVisual snapshot run / update.
test:e2e:accessibilityAccessibility project.
test:e2e:responsiveTablet + mobile responsive projects.
test:e2e:reportOpens the last Playwright HTML report.
test:e2e:catalogRegenerates the Playwright test catalog metadata.
test:e2e:cleanCleans Playwright artifacts.
test:e2e:portal-dataRegenerates portal automation data.
test:hostingMulti-host then single-host shared-navigation checks.
test:hosting:multi / test:hosting:singleIndividual hosting navigation modes.

Suggested E2E order while developing:

test:e2e:smoke → focused tag suite → test:e2e → test:e2e:full (before evidence/release)

Evidence publishing

ScriptDescription
evidence:publishCopies/publishes generated evidence into the hosted layout.
evidence:refreshtest:citest:e2e:fullevidence:publish. Slow; use when refreshing public proof artifacts.

Lint

ScriptDescription
lintLints the Angular project.
lint:allLints every configured ESLint/Angular project.

What not to run first

Avoid starting hereWhy
publish:packages / release:publishPublishing must follow a green security + quality gate.
evidence:refreshVery slow; not needed for routine local work.
test:e2e:fullUse smoke/focused E2E first.
serve:single-host before build:siteNeeds a prior site build.
release:inspect before build:packagesInspects dist/packages/*.
security:zap before a running targetZAP needs a live URL (usually npm start or serve:single-host).

Continue in the live platform

Open PortalLaunch documentation and every showcase from one place →Open Vanilla JS ShowcaseCore policies without framework adapters →Open Angular ShowcaseAngular forms and state integrations →Open React ShowcaseReact hooks and state integrations →