Files
thePR0M3TH3ANandClaude Opus 4.8 088e3cdabe standalone: ship the headless engine as one bundleable ESM file
A no-build static site couldn't vendor BitGate the way it vendors a single
dependency: bare @bitgate/* specifiers don't resolve in a browser, and the
headless path spans two packages (the evaluator in core, the kind-1985 label
codec in nostr). The widget bundle solved this for the DOM path only.

Add @bitgate/standalone (packages/standalone): an entry re-exporting core +
nostr, esbuilt into a single self-contained dist/bitgate.js (~44 KB). It's
the same canonical code the npm packages ship, with specifiers inlined, and
dependency-free -- @bitgate/verify's @noble deps are intentionally not pulled
in, so the bundle carries no third-party code. Wired into `npm run build` via
build:standalone.

Verified: no bare imports in the output (self-contained), and a smoke test
composes a full label -> decision flow from the single entry. README Packages
table and headless section document it.

Addresses the "standalone ESM single-file" item of the Tessera integration
feedback (docs/TODO.md).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BXQCvJPA6sVSQ5j8uBd9bB
2026-08-11 20:40:04 -04:00

37 lines
1.6 KiB
JSON

{
"name": "bitgate",
"version": "0.1.0",
"private": true,
"type": "module",
"description": "Headless Nostr governance SDK for decentralized moderation and access control",
"scripts": {
"test": "npm run test:unit && npm run test:conformance",
"test:unit": "vitest run --passWithNoTests",
"test:conformance": "vitest run tests/conformance --passWithNoTests",
"typecheck": "tsc -p tsconfig.json --noEmit",
"build:types": "tsc -p packages/core/tsconfig.types.json && tsc -p packages/nostr/tsconfig.types.json && tsc -p packages/verify/tsconfig.types.json && tsc -p packages/runtime/tsconfig.types.json && tsc -p packages/bitvid-compat/tsconfig.types.json && tsc -p packages/widget/tsconfig.types.json && tsc -p packages/testing/tsconfig.types.json",
"lint": "npm run check:references && npm run check:types",
"check:references": "node scripts/verify-no-reference-imports.mjs",
"check:types": "tsc -p tsconfig.json --noEmit && tsc -p packages/widget/tsconfig.json --noEmit",
"build:widget": "node packages/widget/build.mjs",
"build:standalone": "node packages/standalone/build.mjs",
"build": "npm run build:types && npm run build:widget && npm run build:standalone && npm run build:site",
"build:site": "node packages/site/build.mjs",
"dev:site": "node packages/site/build.mjs && node packages/site/serve.mjs"
},
"engines": {
"node": ">=22"
},
"workspaces": [
"packages/*",
"examples/*"
],
"devDependencies": {
"@types/node": "^22.10.0",
"happy-dom": "^20.11.2",
"typescript": "^5.4.5",
"vitest": "^3.2.7",
"esbuild": "^0.28.2"
}
}