vike-lite 1.0.14 → 1.0.16

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.
@@ -1,2 +1,2 @@
1
- import { n as store, t as setVikeState } from "../store-BRWiOtOy.mjs";
1
+ import { n as store, t as setVikeState } from "../store-CU7IkMCz.mjs";
2
2
  export { setVikeState, store };
package/dist/server.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as matchRoute } from "./matchRoute-BONrLRYy.mjs";
2
- import { n as store } from "./store-BRWiOtOy.mjs";
2
+ import { n as store } from "./store-CU7IkMCz.mjs";
3
3
  //#region src/utils/serializeContext.ts
4
4
  const ESCAPE_LOOKUP = {
5
5
  "&": String.raw`\u0026`,
@@ -0,0 +1,21 @@
1
+ //#region src/server/store.ts
2
+ const STORE_KEY = "_vike_lite";
3
+ const g = globalThis;
4
+ if (!g[STORE_KEY]) g[STORE_KEY] = {
5
+ routes: [],
6
+ errorRoute: null,
7
+ config: null,
8
+ manifest: void 0
9
+ };
10
+ const store = new Proxy({}, {
11
+ get: (_, prop) => g[STORE_KEY][prop],
12
+ set: (_, prop, value) => {
13
+ g[STORE_KEY][prop] = value;
14
+ return true;
15
+ }
16
+ });
17
+ function setVikeState(newState) {
18
+ Object.assign(g[STORE_KEY], newState);
19
+ }
20
+ //#endregion
21
+ export { store as n, setVikeState as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike-lite",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",
@@ -1,12 +0,0 @@
1
- //#region src/server/store.ts
2
- const store = {
3
- routes: [],
4
- errorRoute: null,
5
- config: null,
6
- manifest: void 0
7
- };
8
- function setVikeState(newState) {
9
- Object.assign(store, newState);
10
- }
11
- //#endregion
12
- export { store as n, setVikeState as t };