@ethisyscore/vite-plugin 1.35.0 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +53 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # @ethisyscore/vite-plugin
2
+
3
+ The Vite plugin collection for EthisysCore plugin-side builds. It provides the
4
+ build passes for every UI render mode the platform supports — manifest-driven
5
+ HTML entries, Contract A SDUI schema validation and emission, the Contract B
6
+ worker bundle, the PlatformReact multi-page bundle orchestrator, and the Tier U
7
+ iframe-sandbox pass — plus the codegen that derives manifests from a plugin's
8
+ `routeMeta.json`.
9
+
10
+ > For the render-mode / trust-tier overview see the
11
+ > [top-level README](../../README.md#render-modes--three-ui-contracts). For the
12
+ > per-contract authoring walkthroughs see [`docs/authoring/`](../../docs/authoring/README.md).
13
+
14
+ ## Export surface
15
+
16
+ Each Vite plugin factory returns a standard Vite `Plugin`; wire the one(s) that
17
+ match your render mode into `vite.config.ts`.
18
+
19
+ | Export | Purpose |
20
+ |---|---|
21
+ | `ethisysContractAPlugin` | **Contract A** pass — validates the SDUI tree against the closed vocabulary and emits declarative resources / reactive rules at build time |
22
+ | `validateDeclarativeResource`, `validateReactiveRule` | Standalone SDUI + reactive-rule validators (`ValidationResult` / `ValidationFailure`) for tests and tooling |
23
+ | `ethisysContractBPlugin` | **Contract B** pass — emits the Web Worker bundle and its import map (`CONTRACT_B_SEMANTIC_PRIMITIVES`, `CONTRACT_B_RUNTIME_IMPORTS`, `CONTRACT_B_IMPORT_MAP_ALLOWLIST`) |
24
+ | `ethisysPlatformReactPlugin` | **PlatformReact** pass — builds one ESM bundle per declared page |
25
+ | `buildPlatformReactPages`, `rewriteAliasedExternalImports`, `virtualPageEntry` | Multi-bundle orchestrator: one isolated Vite sub-build per page, with host-externals dedupe (`PLATFORM_REACT_EXTERNALS`, `PLATFORM_REACT_DEDUPE`) and host-loader import rewriting |
26
+ | `generatePlatformReactManifest`, `computePlatformReactPages` | Build-step codegen — derive `feature.manifest.json` + the `extension.manifest.json` overlay from `routeMeta.json` |
27
+ | `parsePlatformReactPages` | Test helper for snapshot-testing PlatformReact page declarations |
28
+ | `ethisysIframeSandboxPlugin`, `buildIframeSandboxPages` | **Tier U** iframe-sandbox pass — cross-origin sandboxed pages with SHA-256 digest emission |
29
+ | `ethisysManifestPlugin` | Legacy manifest-driven pass — auto-generates `index.html` for pages/surfaces that declare a `source` field |
30
+
31
+ ## Typical usage
32
+
33
+ ```ts
34
+ // vite.config.ts for a PlatformReact plugin
35
+ import { defineConfig } from "vite";
36
+ import { ethisysPlatformReactPlugin } from "@ethisyscore/vite-plugin";
37
+
38
+ export default defineConfig({
39
+ plugins: [ethisysPlatformReactPlugin({ /* manifest + page options */ })],
40
+ });
41
+ ```
42
+
43
+ Most plugins never call these directly — `cc package` drives the correct pass
44
+ for the plugin's declared render mode. Reach for the factories when you maintain
45
+ a bespoke build or need the validators/codegen in tests.
46
+
47
+ ## Build and test
48
+
49
+ ```bash
50
+ npm ci && npm run build && npm test
51
+ ```
52
+
53
+ > Last Updated: 2026-07-10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethisyscore/vite-plugin",
3
- "version": "1.35.0",
3
+ "version": "1.37.0",
4
4
  "description": "Vite plugin for EthisysCore Contract A plugins: manifest-driven HTML entry points (legacy iframe mode) plus build-time SDUI/ReactiveRule schema validation and declarative-resource emission.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",