@sigil-dev/grimoire 0.4.0 → 0.5.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 (43) hide show
  1. package/index.ts +29 -23
  2. package/package.json +1 -1
  3. package/public/__grimoire__/client.js +5 -36
  4. package/public/__grimoire__/hydrate.js +7 -45
  5. package/src/build.ts +88 -0
  6. package/src/cookie-utils.ts +66 -66
  7. package/src/plugins.ts +19 -5
  8. package/src/renderer.ts +12 -1
  9. package/src/server.ts +81 -81
  10. package/src/ssrPlugin.ts +7 -2
  11. package/src/transform-routes.ts +6 -1
  12. package/src/typegen.ts +77 -3
  13. package/src/types.ts +45 -1
  14. package/test/fail.test.ts +46 -46
  15. package/test/headers.test.ts +96 -96
  16. package/test/middleware.test.ts +217 -217
  17. package/test/redirect-error.test.ts +112 -112
  18. package/test/rendering.test.ts +310 -310
  19. package/test/server.test.ts +120 -0
  20. package/test/streaming.test.ts +132 -132
  21. package/test/typegen.test.ts +6 -6
  22. package/.grimoire/_routes.dom.js +0 -4
  23. package/.grimoire/_routes.hydrate.js +0 -4
  24. package/.grimoire/compiled/0-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503001657_protected__page.dom.js +0 -9
  25. package/.grimoire/compiled/0-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503001657_protected__page.hydrate.js +0 -11
  26. package/.grimoire/compiled/0-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503161592_protected__page.dom.js +0 -4
  27. package/.grimoire/compiled/0-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503161592_protected__page.hydrate.js +0 -4
  28. package/.grimoire/compiled/0-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503395872_login.dom.js +0 -4
  29. package/.grimoire/compiled/0-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503395872_login.hydrate.js +0 -4
  30. package/.grimoire/compiled/0-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503614350_login.dom.js +0 -4
  31. package/.grimoire/compiled/0-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503614350_login.hydrate.js +0 -4
  32. package/.grimoire/compiled/1-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503001657_login__page.dom.js +0 -8
  33. package/.grimoire/compiled/1-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503001657_login__page.hydrate.js +0 -9
  34. package/.grimoire/compiled/1-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503161592_login__page.dom.js +0 -4
  35. package/.grimoire/compiled/1-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503161592_login__page.hydrate.js +0 -4
  36. package/.grimoire/compiled/1-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503395872_protected.dom.js +0 -4
  37. package/.grimoire/compiled/1-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503395872_protected.hydrate.js +0 -4
  38. package/.grimoire/compiled/1-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503614350_protected.dom.js +0 -4
  39. package/.grimoire/compiled/1-C__Users_Cane1712_AppData_Local_Temp_grimoire-actions-1780503614350_protected.hydrate.js +0 -4
  40. package/.grimoire/tsconfig.generated.json +0 -11
  41. package/.grimoire/types/ambient.d.ts +0 -6
  42. package/.grimoire/types/api/hello/$types.d.ts +0 -29
  43. package/.grimoire/types/api/items/$types.d.ts +0 -29
@@ -78,3 +78,123 @@ describe("Server — API routes (+server.ts)", () => {
78
78
  server.stop();
79
79
  });
80
80
  });
81
+
82
+ describe("Server — WebSocket routes", () => {
83
+ let wsDir: string;
84
+ let server: Awaited<ReturnType<typeof createServer>>;
85
+
86
+ beforeAll(async () => {
87
+ wsDir = join(tmpdir(), `grimoire-ws-${Date.now()}`);
88
+ await mkdir(join(wsDir, "echo"), { recursive: true });
89
+ await mkdir(join(wsDir, "params", "[docId]"), { recursive: true });
90
+ await mkdir(join(wsDir, "reject"), { recursive: true });
91
+ await mkdir(join(wsDir, "mixed"), { recursive: true });
92
+
93
+ // echo: upgrade() merges extra data, message handler echoes back
94
+ await writeFile(
95
+ join(wsDir, "echo", "+server.ts"),
96
+ `export function upgrade({ params }) {
97
+ return { sessionId: "abc123" };
98
+ }
99
+ export const websocket = {
100
+ message(ws, data) { ws.send("echo:" + data); },
101
+ };`,
102
+ );
103
+
104
+ // params: no upgrade(), ws.data.params still available
105
+ await writeFile(
106
+ join(wsDir, "params", "[docId]", "+server.ts"),
107
+ `export const websocket = {
108
+ open(ws) { ws.send("docId:" + ws.data.params.docId); },
109
+ };`,
110
+ );
111
+
112
+ // reject: upgrade() throws → 426
113
+ await writeFile(
114
+ join(wsDir, "reject", "+server.ts"),
115
+ `export function upgrade() {
116
+ throw new Error("Unauthorized");
117
+ }
118
+ export const websocket = {
119
+ message(ws, data) { ws.send(data); },
120
+ };`,
121
+ );
122
+
123
+ // mixed: HTTP GET and WebSocket both exported
124
+ await writeFile(
125
+ join(wsDir, "mixed", "+server.ts"),
126
+ `export function GET() {
127
+ return Response.json({ kind: "http" });
128
+ }
129
+ export function upgrade({ params }) { return {}; }
130
+ export const websocket = {
131
+ message(ws, data) { ws.send(data); },
132
+ };`,
133
+ );
134
+
135
+ server = await createServer({ port: 3005, routes: wsDir });
136
+ });
137
+
138
+ afterAll(() => {
139
+ server.stop();
140
+ });
141
+
142
+ function wsConnect(path: string): Promise<WebSocket> {
143
+ return new Promise((resolve, reject) => {
144
+ const ws = new WebSocket(`ws://localhost:3005${path}`);
145
+ ws.onopen = () => resolve(ws);
146
+ ws.onerror = () => reject(new Error(`WebSocket connection failed: ${path}`));
147
+ });
148
+ }
149
+
150
+ function nextMessage(ws: WebSocket): Promise<string> {
151
+ return new Promise((resolve, reject) => {
152
+ const timer = setTimeout(() => reject(new Error("timeout waiting for message")), 2000);
153
+ ws.onmessage = (ev) => { clearTimeout(timer); resolve(String(ev.data)); };
154
+ ws.onerror = () => { clearTimeout(timer); reject(new Error("ws error")); };
155
+ });
156
+ }
157
+
158
+ test("message is echoed back", async () => {
159
+ const ws = await wsConnect("/echo");
160
+ const pending = nextMessage(ws);
161
+ ws.send("hello");
162
+ expect(await pending).toBe("echo:hello");
163
+ ws.close();
164
+ });
165
+
166
+ test("upgrade() return value merges into ws.data", async () => {
167
+ // sessionId set in upgrade() — echo route sends it back via a second message
168
+ const ws = new WebSocket("ws://localhost:3005/echo");
169
+ // just verify connection opens cleanly (sessionId is in ws.data server-side)
170
+ await new Promise<void>((resolve, reject) => {
171
+ const t = setTimeout(() => reject(new Error("timeout")), 2000);
172
+ ws.onopen = () => { clearTimeout(t); resolve(); };
173
+ ws.onerror = () => { clearTimeout(t); reject(new Error("connect failed")); };
174
+ });
175
+ ws.close();
176
+ });
177
+
178
+ test("ws.data.params available when no upgrade() export", async () => {
179
+ const ws = await wsConnect("/params/42");
180
+ expect(await nextMessage(ws)).toBe("docId:42");
181
+ ws.close();
182
+ });
183
+
184
+ test("upgrade() throwing rejects the connection", async () => {
185
+ await new Promise<void>((resolve, reject) => {
186
+ const ws = new WebSocket("ws://localhost:3005/reject");
187
+ const t = setTimeout(() => reject(new Error("timeout")), 2000);
188
+ ws.onopen = () => { clearTimeout(t); ws.close(); reject(new Error("should not have opened")); };
189
+ ws.onerror = () => { clearTimeout(t); resolve(); };
190
+ ws.onclose = (ev) => { clearTimeout(t); if (ev.code !== 1006) resolve(); else resolve(); };
191
+ });
192
+ });
193
+
194
+ test("plain HTTP GET on mixed route still works (no Upgrade header)", async () => {
195
+ const res = await fetch("http://localhost:3005/mixed");
196
+ expect(res.status).toBe(200);
197
+ const body = await res.json();
198
+ expect(body.kind).toBe("http");
199
+ });
200
+ });
@@ -1,132 +1,132 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { renderRoute } from "../src/renderer";
3
-
4
- describe("Streaming SSR", () => {
5
- test("returns a ReadableStream response", async () => {
6
- const matched = {
7
- route: {
8
- path: "/",
9
- params: {},
10
- filePath: "data:text/javascript,export default (p) => '<div>hello</div>'",
11
- },
12
- params: {},
13
- } as any;
14
-
15
- const res = await renderRoute(matched, new Request("http://localhost/"));
16
- expect(res.body).toBeInstanceOf(ReadableStream);
17
- });
18
-
19
- test("stream contains full HTML document", async () => {
20
- const matched = {
21
- route: {
22
- path: "/test",
23
- params: {},
24
- filePath:
25
- "data:text/javascript,export default (p) => '<p>streaming works</p>'",
26
- },
27
- params: {},
28
- } as any;
29
-
30
- const res = await renderRoute(matched, new Request("http://localhost/test"));
31
- const html = await res.text();
32
-
33
- expect(html).toContain("<!DOCTYPE html>");
34
- expect(html).toContain('<meta charset="UTF-8" />');
35
- expect(html).toContain("streaming works");
36
- expect(html).toContain("</html>");
37
- expect(html).toContain("__grimoire_state__");
38
- });
39
-
40
- test("stream includes state JSON with route pattern", async () => {
41
- const matched = {
42
- route: {
43
- path: "/spells/:id",
44
- params: {},
45
- filePath:
46
- "data:text/javascript,export default (p) => '<div>spell</div>'",
47
- },
48
- params: { id: "fireball" },
49
- } as any;
50
-
51
- const res = await renderRoute(
52
- matched,
53
- new Request("http://localhost/spells/fireball"),
54
- );
55
- const html = await res.text();
56
-
57
- expect(html).toContain('"pattern":"/spells/:id"');
58
- expect(html).toContain('"id":"fireball"');
59
- });
60
-
61
- test("head script tag comes before head content", async () => {
62
- const matched = {
63
- route: {
64
- path: "/head-test",
65
- params: {},
66
- filePath:
67
- "data:text/javascript,export default (p) => '<div>head</div>'",
68
- },
69
- params: {},
70
- } as any;
71
-
72
- const res = await renderRoute(matched, new Request("http://localhost/head-test"));
73
- const html = await res.text();
74
-
75
- const hydrateScript = html.indexOf("hydrate.js");
76
- const headClosing = html.indexOf("</head>");
77
- // hydrate.js should be in <head>
78
- expect(hydrateScript).toBeGreaterThan(-1);
79
- expect(hydrateScript).toBeLessThan(headClosing);
80
- });
81
-
82
- test("stream chunks arrive incrementally", async () => {
83
- const matched = {
84
- route: {
85
- path: "/chunked",
86
- params: {},
87
- filePath:
88
- "data:text/javascript,export default (p) => '<div>chunked</div>'",
89
- },
90
- params: {},
91
- } as any;
92
-
93
- const res = await renderRoute(matched, new Request("http://localhost/chunked"));
94
- const reader = res.body!.getReader();
95
- const chunks: string[] = [];
96
-
97
- while (true) {
98
- const { done, value } = await reader.read();
99
- if (done) break;
100
- // Bun ReadableStream returns Uint8Array
101
- chunks.push(typeof value === "string" ? value : new TextDecoder().decode(value.buffer));
102
- }
103
-
104
- // Should have multiple chunks (at least DOCTYPE + body)
105
- expect(chunks.length).toBeGreaterThan(1);
106
- // First chunk should start with DOCTYPE
107
- expect(chunks[0]).toContain("<!DOCTYPE html>");
108
- // Last chunk should close the document
109
- expect(chunks[chunks.length - 1]).toContain("</html>");
110
- });
111
-
112
- test("navigation request returns JSON not stream", async () => {
113
- const matched = {
114
- route: {
115
- path: "/nav",
116
- params: {},
117
- filePath:
118
- "data:text/javascript,export default (p) => '<div>nav</div>'",
119
- },
120
- params: {},
121
- } as any;
122
-
123
- const req = new Request("http://localhost/nav", {
124
- headers: { "x-grimoire-navigate": "1" },
125
- });
126
- const res = await renderRoute(matched, req);
127
- const json = await res.json();
128
-
129
- expect(json.pattern).toBe("/nav");
130
- expect(json.data).toBeDefined();
131
- });
132
- });
1
+ import { describe, expect, test } from "bun:test";
2
+ import { renderRoute } from "../src/renderer";
3
+
4
+ describe("Streaming SSR", () => {
5
+ test("returns a ReadableStream response", async () => {
6
+ const matched = {
7
+ route: {
8
+ path: "/",
9
+ params: {},
10
+ filePath: "data:text/javascript,export default (p) => '<div>hello</div>'",
11
+ },
12
+ params: {},
13
+ } as any;
14
+
15
+ const res = await renderRoute(matched, new Request("http://localhost/"));
16
+ expect(res.body).toBeInstanceOf(ReadableStream);
17
+ });
18
+
19
+ test("stream contains full HTML document", async () => {
20
+ const matched = {
21
+ route: {
22
+ path: "/test",
23
+ params: {},
24
+ filePath:
25
+ "data:text/javascript,export default (p) => '<p>streaming works</p>'",
26
+ },
27
+ params: {},
28
+ } as any;
29
+
30
+ const res = await renderRoute(matched, new Request("http://localhost/test"));
31
+ const html = await res.text();
32
+
33
+ expect(html).toContain("<!DOCTYPE html>");
34
+ expect(html).toContain('<meta charset="UTF-8" />');
35
+ expect(html).toContain("streaming works");
36
+ expect(html).toContain("</html>");
37
+ expect(html).toContain("__grimoire_state__");
38
+ });
39
+
40
+ test("stream includes state JSON with route pattern", async () => {
41
+ const matched = {
42
+ route: {
43
+ path: "/spells/:id",
44
+ params: {},
45
+ filePath:
46
+ "data:text/javascript,export default (p) => '<div>spell</div>'",
47
+ },
48
+ params: { id: "fireball" },
49
+ } as any;
50
+
51
+ const res = await renderRoute(
52
+ matched,
53
+ new Request("http://localhost/spells/fireball"),
54
+ );
55
+ const html = await res.text();
56
+
57
+ expect(html).toContain('"pattern":"/spells/:id"');
58
+ expect(html).toContain('"id":"fireball"');
59
+ });
60
+
61
+ test("head script tag comes before head content", async () => {
62
+ const matched = {
63
+ route: {
64
+ path: "/head-test",
65
+ params: {},
66
+ filePath:
67
+ "data:text/javascript,export default (p) => '<div>head</div>'",
68
+ },
69
+ params: {},
70
+ } as any;
71
+
72
+ const res = await renderRoute(matched, new Request("http://localhost/head-test"));
73
+ const html = await res.text();
74
+
75
+ const hydrateScript = html.indexOf("hydrate.js");
76
+ const headClosing = html.indexOf("</head>");
77
+ // hydrate.js should be in <head>
78
+ expect(hydrateScript).toBeGreaterThan(-1);
79
+ expect(hydrateScript).toBeLessThan(headClosing);
80
+ });
81
+
82
+ test("stream chunks arrive incrementally", async () => {
83
+ const matched = {
84
+ route: {
85
+ path: "/chunked",
86
+ params: {},
87
+ filePath:
88
+ "data:text/javascript,export default (p) => '<div>chunked</div>'",
89
+ },
90
+ params: {},
91
+ } as any;
92
+
93
+ const res = await renderRoute(matched, new Request("http://localhost/chunked"));
94
+ const reader = res.body!.getReader();
95
+ const chunks: string[] = [];
96
+
97
+ while (true) {
98
+ const { done, value } = await reader.read();
99
+ if (done) break;
100
+ // Bun ReadableStream returns Uint8Array
101
+ chunks.push(typeof value === "string" ? value : new TextDecoder().decode(value.buffer));
102
+ }
103
+
104
+ // Should have multiple chunks (at least DOCTYPE + body)
105
+ expect(chunks.length).toBeGreaterThan(1);
106
+ // First chunk should start with DOCTYPE
107
+ expect(chunks[0]).toContain("<!DOCTYPE html>");
108
+ // Last chunk should close the document
109
+ expect(chunks[chunks.length - 1]).toContain("</html>");
110
+ });
111
+
112
+ test("navigation request returns JSON not stream", async () => {
113
+ const matched = {
114
+ route: {
115
+ path: "/nav",
116
+ params: {},
117
+ filePath:
118
+ "data:text/javascript,export default (p) => '<div>nav</div>'",
119
+ },
120
+ params: {},
121
+ } as any;
122
+
123
+ const req = new Request("http://localhost/nav", {
124
+ headers: { "x-grimoire-navigate": "1" },
125
+ });
126
+ const res = await renderRoute(matched, req);
127
+ const json = await res.json();
128
+
129
+ expect(json.pattern).toBe("/nav");
130
+ expect(json.data).toBeDefined();
131
+ });
132
+ });
@@ -416,9 +416,9 @@ describe("generateTypes — route without +page.server.ts", () => {
416
416
  expect(content).toContain("export type Actions = Record<string, never>;");
417
417
  });
418
418
 
419
- test("PageProps contains params", async () => {
419
+ test("PageProps contains data and params", async () => {
420
420
  const content = await readGenerated("src/routes/blog");
421
- expect(content).toContain("export type PageProps = { params: Params };");
421
+ expect(content).toContain("export type PageProps = { data: PageData; params: Params };");
422
422
  });
423
423
  });
424
424
 
@@ -448,10 +448,10 @@ describe("generateTypes — route with +page.server.ts", () => {
448
448
  expect(content).toContain('Awaited<ReturnType<_PS["load"]>>');
449
449
  });
450
450
 
451
- test("PageProps = PageData & { params: Params }", async () => {
451
+ test("PageProps = { data: PageData; params: Params }", async () => {
452
452
  const content = await readGenerated("src/routes/blog/[slug]");
453
453
  expect(content).toContain(
454
- "export type PageProps = PageData & { params: Params };",
454
+ "export type PageProps = { data: PageData; params: Params };",
455
455
  );
456
456
  });
457
457
 
@@ -559,8 +559,8 @@ describe("tsc integration", () => {
559
559
  join(routeDir, "check.ts"),
560
560
  `import type { PageProps } from "./$types";
561
561
  declare const props: PageProps;
562
- const _title: string = props.post.title;
563
- const _views: number = props.post.views;
562
+ const _title: string = props.data.post.title;
563
+ const _views: number = props.data.post.views;
564
564
  const _slug: string = props.params.slug;
565
565
  export {};`,
566
566
  );
@@ -1,4 +0,0 @@
1
-
2
- export const routes = {
3
-
4
- };
@@ -1,4 +0,0 @@
1
-
2
- export const routes = {
3
-
4
- };
@@ -1,9 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function P() {
3
- return (() => {
4
- const _el0 = document.createElement("div");
5
- _el0.classList.add("9i0yqs");
6
- _el0.append(document.createTextNode("secret"));
7
- return _el0;
8
- })();
9
- }
@@ -1,11 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function P() {
3
- return (() => {
4
- const _el0 = claim(__nodes, "div");
5
- const _el1 = Array.from(_el0.childNodes);
6
- _el0.classList.add("9i0yqs");
7
- if (_el1.length === 0)
8
- _el0.append(document.createTextNode("secret"));
9
- return _el0;
10
- })();
11
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function P() {
3
- return "<div>secret</div>";
4
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function P() {
3
- return "<div>secret</div>";
4
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Login() {
3
- return "<form></form>";
4
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Login() {
3
- return "<form></form>";
4
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Login() {
3
- return "<form></form>";
4
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Login() {
3
- return "<form></form>";
4
- }
@@ -1,8 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Login() {
3
- return (() => {
4
- const _el0 = document.createElement("form");
5
- _el0.classList.add("6ulz94");
6
- return _el0;
7
- })();
8
- }
@@ -1,9 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Login() {
3
- return (() => {
4
- const _el0 = claim(__nodes, "form");
5
- const _el1 = Array.from(_el0.childNodes);
6
- _el0.classList.add("6ulz94");
7
- return _el0;
8
- })();
9
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Login() {
3
- return "<form></form>";
4
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Login() {
3
- return "<form></form>";
4
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Protected() {
3
- return "<div>secret</div>";
4
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Protected() {
3
- return "<div>secret</div>";
4
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Protected() {
3
- return "<div>secret</div>";
4
- }
@@ -1,4 +0,0 @@
1
- import { createSignal, createEffect, createMemo, reconcile, claim, claimText, claimComment, hydrateKeyedList, insert } from "@sigil-dev/runtime";
2
- export default function Protected() {
3
- return "<div>secret</div>";
4
- }
@@ -1,11 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "rootDirs": [
4
- "..",
5
- "./types"
6
- ]
7
- },
8
- "include": [
9
- "types/**/*.d.ts"
10
- ]
11
- }
@@ -1,6 +0,0 @@
1
- // Auto-generated by @sigil-dev/grimoire — do not edit
2
-
3
- declare namespace App {
4
- // Extend this interface in your app's src/app.d.ts to add typed locals
5
- interface Locals extends Record<string, unknown> {}
6
- }
@@ -1,29 +0,0 @@
1
- // Auto-generated by @sigil-dev/grimoire — do not edit
2
-
3
- export type Params = {};
4
-
5
- export type PageData = Record<string, never>;
6
- export type PageProps = { params: Params };
7
- export type PageServerLoad = never;
8
- export type Actions = Record<string, never>;
9
-
10
- export type LayoutData = Record<string, never>;
11
- export type LayoutProps = LayoutData & { params: Params; children?: unknown };
12
- export type LayoutServerLoad = (ctx: {
13
- params: Params;
14
- request: Request;
15
- url: URL;
16
- locals: App.Locals;
17
- }) => Record<string, unknown> | Promise<Record<string, unknown>>;
18
-
19
- type _SRV = typeof import("C:/Users/Cane1712/AppData/Local/Temp/grimoire-server-1780504083027/api/hello/+server.js");
20
- type _HttpMethods = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
21
- type _ServerKeys = Extract<keyof _SRV, _HttpMethods>;
22
- export type ServerHandlers = {
23
- [K in _ServerKeys]: (ctx: {
24
- params: Params;
25
- request: Request;
26
- url: URL;
27
- locals: App.Locals;
28
- }) => Response | Promise<Response>;
29
- };
@@ -1,29 +0,0 @@
1
- // Auto-generated by @sigil-dev/grimoire — do not edit
2
-
3
- export type Params = {};
4
-
5
- export type PageData = Record<string, never>;
6
- export type PageProps = { params: Params };
7
- export type PageServerLoad = never;
8
- export type Actions = Record<string, never>;
9
-
10
- export type LayoutData = Record<string, never>;
11
- export type LayoutProps = LayoutData & { params: Params; children?: unknown };
12
- export type LayoutServerLoad = (ctx: {
13
- params: Params;
14
- request: Request;
15
- url: URL;
16
- locals: App.Locals;
17
- }) => Record<string, unknown> | Promise<Record<string, unknown>>;
18
-
19
- type _SRV = typeof import("C:/Users/Cane1712/AppData/Local/Temp/grimoire-server-1780504083027/api/items/+server.js");
20
- type _HttpMethods = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
21
- type _ServerKeys = Extract<keyof _SRV, _HttpMethods>;
22
- export type ServerHandlers = {
23
- [K in _ServerKeys]: (ctx: {
24
- params: Params;
25
- request: Request;
26
- url: URL;
27
- locals: App.Locals;
28
- }) => Response | Promise<Response>;
29
- };