@v-office/website-headless 0.0.1 → 0.0.3
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.
- package/dist/manifest/index.d.mts +9 -5
- package/dist/manifest/index.mjs +2 -10
- package/package.json +1 -1
|
@@ -59,7 +59,7 @@ type PlatformSurface = keyof typeof PLATFORM_SURFACES;
|
|
|
59
59
|
//#region src/manifest/index.d.ts
|
|
60
60
|
type ComponentState = "imported" | "custom";
|
|
61
61
|
interface SiteManifest {
|
|
62
|
-
manifestVersion:
|
|
62
|
+
manifestVersion: 1;
|
|
63
63
|
builtAt: string;
|
|
64
64
|
/** Installed versions of the tracked packages. */
|
|
65
65
|
packages: Record<string, string>;
|
|
@@ -96,7 +96,10 @@ declare function buildSiteManifest(root: string): SiteManifest;
|
|
|
96
96
|
*
|
|
97
97
|
* Typed structurally so this package needs no astro or vite dependency.
|
|
98
98
|
*/
|
|
99
|
-
|
|
99
|
+
/** Structural subset of Astro's `AstroIntegration`, so this package needs no
|
|
100
|
+
* astro dependency. `plugins` is `any[]`: Vite's `PluginOption` type must accept
|
|
101
|
+
* what we pass, and pinning Vite's types here would couple us to its versions. */
|
|
102
|
+
type SiteManifestIntegration = {
|
|
100
103
|
name: string;
|
|
101
104
|
hooks: {
|
|
102
105
|
"astro:config:setup": (ctx: {
|
|
@@ -105,14 +108,15 @@ declare function siteManifest(): {
|
|
|
105
108
|
};
|
|
106
109
|
updateConfig: (cfg: {
|
|
107
110
|
vite: {
|
|
108
|
-
plugins:
|
|
111
|
+
plugins: any[];
|
|
109
112
|
};
|
|
110
|
-
}) =>
|
|
113
|
+
}) => unknown;
|
|
111
114
|
}) => void;
|
|
112
115
|
"astro:build:done": (ctx: {
|
|
113
116
|
dir: URL;
|
|
114
117
|
}) => void;
|
|
115
118
|
};
|
|
116
119
|
};
|
|
120
|
+
declare function siteManifest(): SiteManifestIntegration;
|
|
117
121
|
//#endregion
|
|
118
|
-
export { ComponentState, CrossCheck, ImportSets, PLATFORM_SURFACES, type PlatformSurface, SiteManifest, buildSiteManifest, collectImports, collectImportsFromCode, crossCheck, deriveComponentStates, emptyImports, renderedSurfaces, siteManifest };
|
|
122
|
+
export { ComponentState, CrossCheck, ImportSets, PLATFORM_SURFACES, type PlatformSurface, SiteManifest, SiteManifestIntegration, buildSiteManifest, collectImports, collectImportsFromCode, crossCheck, deriveComponentStates, emptyImports, renderedSurfaces, siteManifest };
|
package/dist/manifest/index.mjs
CHANGED
|
@@ -211,20 +211,12 @@ function packagesOf(root) {
|
|
|
211
211
|
/** Everything without the bundler signal — used by tests and by anything that runs outside a build. */
|
|
212
212
|
function buildSiteManifest(root) {
|
|
213
213
|
return {
|
|
214
|
-
manifestVersion:
|
|
214
|
+
manifestVersion: 1,
|
|
215
215
|
builtAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
216
216
|
packages: packagesOf(root),
|
|
217
217
|
components: deriveComponentStates(collectImports(root))
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
|
-
/**
|
|
221
|
-
* The Astro integration:
|
|
222
|
-
*
|
|
223
|
-
* import { siteManifest } from "@v-office/website-headless/manifest";
|
|
224
|
-
* integrations: [react(), siteManifest()]
|
|
225
|
-
*
|
|
226
|
-
* Typed structurally so this package needs no astro or vite dependency.
|
|
227
|
-
*/
|
|
228
220
|
function siteManifest() {
|
|
229
221
|
let root = process.cwd();
|
|
230
222
|
const bundled = emptyImports();
|
|
@@ -248,7 +240,7 @@ function siteManifest() {
|
|
|
248
240
|
for (const w of check.warnings) console.warn(`[site-manifest] ${w}`);
|
|
249
241
|
if (check.errors.length) throw new Error(`[site-manifest] build refused:\n - ${check.errors.join("\n - ")}`);
|
|
250
242
|
const manifest = {
|
|
251
|
-
manifestVersion:
|
|
243
|
+
manifestVersion: 1,
|
|
252
244
|
builtAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
253
245
|
packages: packagesOf(root),
|
|
254
246
|
components: check.states
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/website-headless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Framework-free behavior layer for v-office websites, never UI: the checkout flow as a subscribable store (createCheckoutFlow), validation and insurance rules, the checkout's structural requirements, the derived site-manifest Astro integration and progressive-enhancement engines for server-rendered markup",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|