@void/svelte 0.10.13 → 0.20.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026-present, Cloudflare, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -111,7 +111,8 @@ request.
111
111
 
112
112
  ## Tests
113
113
 
114
- - `test/unit/use-form.test.ts`
115
114
  - `test/integration/svelte-pages-client.test.ts`
116
115
 
117
- Cross-package SSR/protocol coverage for Svelte pages mode also lives in `framework/packages/void/test/integration/*`.
116
+ Cross-package SSR/protocol coverage for Svelte pages mode also lives in `packages/void/test/integration/*`.
117
+
118
+ The [shared client](../../test/pages-client-contract.ts) and [island](../../test/pages-island-contract.ts) contracts run against this adapter in both dev and preview. Shared form equality is tested directly in [Void](../void/test/unit/form-value-equality.test.ts); tests do not copy the hook implementation.
package/dist/plugin.d.mts CHANGED
@@ -1,16 +1,14 @@
1
1
  import { svelte } from "@sveltejs/vite-plugin-svelte";
2
2
  import { Plugin } from "vite";
3
-
4
3
  //#region src/plugin.d.ts
5
4
  type PrefetchConfig = {
6
5
  hoverDelay?: number;
7
6
  cacheFor?: number | string | [string, string];
8
7
  };
9
- type VoidSvelteOptions = Readonly<{
8
+ export type VoidSvelteOptions = Readonly<{
10
9
  svelte?: Parameters<typeof svelte>[0];
11
10
  viewTransitions?: boolean;
12
11
  prefetch?: PrefetchConfig;
13
12
  }>;
14
- declare function voidSvelte(options?: VoidSvelteOptions): Array<Plugin>;
15
- //#endregion
16
- export { VoidSvelteOptions, voidSvelte };
13
+ export declare function voidSvelte(options?: VoidSvelteOptions): Array<Plugin>;
14
+ //#endregion
package/dist/plugin.mjs CHANGED
@@ -356,6 +356,7 @@ initIslands(islands, hydrateIsland);
356
356
  }
357
357
  //#endregion
358
358
  //#region src/plugin-pages.ts
359
+ const RENDERER_ID = "virtual:void-pages-renderer";
359
360
  const CLIENT_ENTRY_ID = "virtual:void-pages-client";
360
361
  const SVELTE_OPTIMIZE_DEPS = {
361
362
  exclude: ["@void/svelte"],
@@ -398,7 +399,7 @@ function pagesPlugin(pagesDir, options) {
398
399
  return pendingRescan;
399
400
  };
400
401
  const invalidatePageModules = (server) => {
401
- for (const env of Object.values(server.environments)) for (const id of ["\0virtual:void-pages-renderer", "\0virtual:void-pages-client"]) {
402
+ for (const env of Object.values(server.environments)) for (const id of ["\0" + RENDERER_ID, "\0" + CLIENT_ENTRY_ID]) {
402
403
  const mod = env.moduleGraph.getModuleById(id);
403
404
  if (mod) env.moduleGraph.invalidateModule(mod);
404
405
  }
@@ -419,11 +420,11 @@ function pagesPlugin(pagesDir, options) {
419
420
  async handler(id) {
420
421
  if (isDev && pendingRescan) await pendingRescan;
421
422
  if (!pageScan && existsSync(pagesDir)) await runRescan();
422
- if (id === "\0virtual:void-pages-renderer") {
423
+ if (id === "\0" + RENDERER_ID) {
423
424
  if (!pageScan) return "export function renderPage() { throw new Error('No pages found'); }";
424
425
  return generateRendererModule(pageScan, pagesDir, isDev);
425
426
  }
426
- if (id === "\0virtual:void-pages-client") {
427
+ if (id === "\0" + CLIENT_ENTRY_ID) {
427
428
  if (!pageScan) return "";
428
429
  return generateClientEntry(pageScan, pagesDir, options?.viewTransitions, options?.prefetch, resolveStaticPageDataBuildOptions(root, { publicDir: viteConfig?.publicDir }));
429
430
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@void/svelte",
3
- "version": "0.10.13",
3
+ "version": "0.20.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/voidzero-dev/void.git",
@@ -20,40 +20,33 @@
20
20
  "types": "./dist/plugin.d.mts",
21
21
  "import": "./dist/plugin.mjs"
22
22
  },
23
- "./runtime": {
24
- "svelte": "./src/runtime/index.ts",
25
- "default": "./src/runtime/index.ts"
26
- },
27
23
  "./App.svelte": {
28
24
  "svelte": "./src/runtime/App.svelte",
29
25
  "default": "./src/runtime/App.svelte"
30
- },
31
- "./prefetch": {
32
- "default": "./src/runtime/prefetch.ts"
33
26
  }
34
27
  },
35
28
  "publishConfig": {
36
29
  "access": "public"
37
30
  },
38
31
  "dependencies": {
39
- "@sveltejs/vite-plugin-svelte": "^7.1.2"
32
+ "@sveltejs/vite-plugin-svelte": "^7.3.0"
40
33
  },
41
34
  "devDependencies": {
42
- "@types/node": "^26.1.0",
35
+ "@types/node": "^26.5.1",
43
36
  "pathslash": "^0.1.0",
44
- "svelte": "^5.56.4",
45
- "vite": "npm:@voidzero-dev/vite-plus-core@0.2.2",
46
- "vite-plus": "^0.2.2",
47
- "void": "0.10.13"
37
+ "svelte": "^5.57.0",
38
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.3.1",
39
+ "vite-plus": "0.3.1",
40
+ "void": "0.20.0"
48
41
  },
49
42
  "peerDependencies": {
50
43
  "svelte": "^5.0.0",
51
44
  "vite": "^8.0.0",
52
- "void": "0.10.13"
45
+ "void": "0.20.0"
53
46
  },
54
47
  "scripts": {
55
48
  "build": "vp pack",
56
49
  "dev": "vp pack --watch",
57
- "typecheck": "tsgo --noEmit"
50
+ "typecheck": "tsc --noEmit --rootDir ../.."
58
51
  }
59
52
  }
@@ -1,2 +0,0 @@
1
- export { PrefetchCache, parseCacheFor } from 'void/pages-prefetch';
2
- export type { CacheForResult, CacheForInput, CacheEntry } from 'void/pages-prefetch';