@void/svelte 0.7.6 → 0.7.7
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/plugin.d.mts
CHANGED
|
@@ -2,15 +2,15 @@ import { svelte } from "@sveltejs/vite-plugin-svelte";
|
|
|
2
2
|
import { Plugin } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin.d.ts
|
|
5
|
-
|
|
5
|
+
type PrefetchConfig = {
|
|
6
6
|
hoverDelay?: number;
|
|
7
7
|
cacheFor?: number | string | [string, string];
|
|
8
|
-
}
|
|
9
|
-
|
|
8
|
+
};
|
|
9
|
+
type VoidSvelteOptions = Readonly<{
|
|
10
10
|
svelte?: Parameters<typeof svelte>[0];
|
|
11
11
|
viewTransitions?: boolean;
|
|
12
12
|
prefetch?: PrefetchConfig;
|
|
13
|
-
}
|
|
14
|
-
declare function voidSvelte(options?: VoidSvelteOptions):
|
|
13
|
+
}>;
|
|
14
|
+
declare function voidSvelte(options?: VoidSvelteOptions): ReadonlyArray<Plugin>;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { VoidSvelteOptions, voidSvelte };
|
package/dist/plugin.mjs
CHANGED
|
@@ -176,17 +176,17 @@ function islandsPlugin(pagesDir) {
|
|
|
176
176
|
pageScan = await scanPages(root);
|
|
177
177
|
const importAttrRe = /import\s+\w+\s+from\s+("[^"]+"|'[^']+')\s+with\s*\{\s*island\s*:\s*("[^"]+"|'[^']+')\s*\}/g;
|
|
178
178
|
const filesToScan = [
|
|
179
|
-
...pageScan.pages.map((
|
|
180
|
-
filePath:
|
|
181
|
-
island:
|
|
179
|
+
...pageScan.pages.map((page) => ({
|
|
180
|
+
filePath: page.componentPath,
|
|
181
|
+
island: page.island
|
|
182
182
|
})),
|
|
183
|
-
...pageScan.layouts.map((
|
|
184
|
-
filePath:
|
|
185
|
-
island:
|
|
183
|
+
...pageScan.layouts.map((layout) => ({
|
|
184
|
+
filePath: layout.filePath,
|
|
185
|
+
island: layout.island
|
|
186
186
|
})),
|
|
187
|
-
...pageScan.namedLayouts.map((
|
|
188
|
-
filePath:
|
|
189
|
-
island:
|
|
187
|
+
...pageScan.namedLayouts.map((namedLayout) => ({
|
|
188
|
+
filePath: namedLayout.filePath,
|
|
189
|
+
island: namedLayout.island
|
|
190
190
|
}))
|
|
191
191
|
];
|
|
192
192
|
for (const entry of filesToScan) {
|
|
@@ -195,10 +195,10 @@ function islandsPlugin(pagesDir) {
|
|
|
195
195
|
const code = readFileSync(filePath, "utf-8");
|
|
196
196
|
const importerDir = dirname(filePath);
|
|
197
197
|
importAttrRe.lastIndex = 0;
|
|
198
|
-
let
|
|
199
|
-
while ((
|
|
200
|
-
const spec =
|
|
201
|
-
const strategy =
|
|
198
|
+
let importMatch;
|
|
199
|
+
while ((importMatch = importAttrRe.exec(code)) !== null) {
|
|
200
|
+
const spec = importMatch[1].slice(1, -1);
|
|
201
|
+
const strategy = importMatch[2].slice(1, -1);
|
|
202
202
|
const absPath = resolveSpecifier(spec, importerDir, COMPONENT_EXTENSIONS);
|
|
203
203
|
if (absPath) {
|
|
204
204
|
const islandId = normalizePath(relative(root, absPath)).replace(/\.[^.]+$/, "");
|
|
@@ -238,7 +238,7 @@ function islandsPlugin(pagesDir) {
|
|
|
238
238
|
handler(id) {
|
|
239
239
|
if (id === "\0" + ISLANDS_RENDERER_ID) {
|
|
240
240
|
if (!pageScan) return "export function renderIslandPage() { throw new Error('No pages found'); }";
|
|
241
|
-
const mdPlugin = resolvedConfig?.plugins?.find((
|
|
241
|
+
const mdPlugin = resolvedConfig?.plugins?.find((plugin) => plugin.name === "void-md");
|
|
242
242
|
const mdScriptIds = new Set(mdPlugin?.api?.getClientScripts?.()?.keys() ?? []);
|
|
243
243
|
const needsJS = computePagesNeedingClientJS$1();
|
|
244
244
|
return generateIslandRenderer(pageScan, pagesDir, mdScriptIds, needsJS);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@void/svelte",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/voidzero-dev/void.git",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"svelte": "^5.55.5",
|
|
45
45
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.20",
|
|
46
46
|
"vite-plus": "^0.1.20",
|
|
47
|
-
"void": "0.7.
|
|
47
|
+
"void": "0.7.7"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"svelte": "^5.0.0",
|
|
51
51
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.20",
|
|
52
|
-
"void": "0.7.
|
|
52
|
+
"void": "0.7.7"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "vp pack",
|
|
@@ -24,8 +24,8 @@ type UntypedForm = {
|
|
|
24
24
|
put(opts?: FormSubmitOptions): Promise<void>;
|
|
25
25
|
patch(opts?: FormSubmitOptions): Promise<void>;
|
|
26
26
|
delete(opts?: FormSubmitOptions): Promise<void>;
|
|
27
|
-
reset(...fields:
|
|
28
|
-
clearErrors(...fields:
|
|
27
|
+
reset(...fields: ReadonlyArray<string>): void;
|
|
28
|
+
clearErrors(...fields: ReadonlyArray<string>): void;
|
|
29
29
|
clearError(): void;
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -61,8 +61,8 @@ export function useForm<U extends ActionUrl & string>(
|
|
|
61
61
|
put(opts?: FormSubmitOptions): Promise<void>;
|
|
62
62
|
patch(opts?: FormSubmitOptions): Promise<void>;
|
|
63
63
|
delete(opts?: FormSubmitOptions): Promise<void>;
|
|
64
|
-
reset(...fields:
|
|
65
|
-
clearErrors(...fields:
|
|
64
|
+
reset(...fields: ReadonlyArray<keyof ResolveActionBody<U> & string>): void;
|
|
65
|
+
clearErrors(...fields: ReadonlyArray<keyof ResolveActionBody<U> & string>): void;
|
|
66
66
|
clearError(): void;
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -105,7 +105,7 @@ export function useForm(
|
|
|
105
105
|
Object.keys(defaults_).some((key) => !isEqualFormValue(data[key], defaults_[key])),
|
|
106
106
|
);
|
|
107
107
|
|
|
108
|
-
function reset(...fields:
|
|
108
|
+
function reset(...fields: ReadonlyArray<string>) {
|
|
109
109
|
if (fields.length === 0) {
|
|
110
110
|
data = { ...defaults_ };
|
|
111
111
|
} else {
|
|
@@ -115,7 +115,7 @@ export function useForm(
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
function clearErrors(...fields:
|
|
118
|
+
function clearErrors(...fields: ReadonlyArray<string>) {
|
|
119
119
|
if (fields.length === 0) {
|
|
120
120
|
errors = {};
|
|
121
121
|
} else {
|
|
@@ -13,8 +13,8 @@ type UntypedIslandForm = {
|
|
|
13
13
|
put(url: string): Promise<void>;
|
|
14
14
|
patch(url: string): Promise<void>;
|
|
15
15
|
delete(url: string): Promise<void>;
|
|
16
|
-
reset(...fields:
|
|
17
|
-
clearErrors(...fields:
|
|
16
|
+
reset(...fields: ReadonlyArray<string>): void;
|
|
17
|
+
clearErrors(...fields: ReadonlyArray<string>): void;
|
|
18
18
|
clearError(): void;
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -64,7 +64,7 @@ export function useIslandForm(defaults: Record<string, unknown>): UntypedIslandF
|
|
|
64
64
|
Object.keys(defaults_).some((key) => !isEqualFormValue(data[key], defaults_[key])),
|
|
65
65
|
);
|
|
66
66
|
|
|
67
|
-
function reset(...fields:
|
|
67
|
+
function reset(...fields: ReadonlyArray<string>) {
|
|
68
68
|
if (fields.length === 0) {
|
|
69
69
|
data = { ...defaults_ };
|
|
70
70
|
} else {
|
|
@@ -74,7 +74,7 @@ export function useIslandForm(defaults: Record<string, unknown>): UntypedIslandF
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
function clearErrors(...fields:
|
|
77
|
+
function clearErrors(...fields: ReadonlyArray<string>) {
|
|
78
78
|
if (fields.length === 0) {
|
|
79
79
|
errors = {};
|
|
80
80
|
} else {
|