@torpor/build 0.4.9 → 0.4.11
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/package.json +6 -2
- package/CHANGELOG.md +0 -473
- package/scripts/postbuild.ts +0 -12
- package/test/api/_hook.server.ts +0 -3
- package/test/api/posts/+page.server.ts +0 -3
- package/test/api/posts/[id]/+page.server.ts +0 -3
- package/test/app.test.ts +0 -47
- package/test/router.test.ts +0 -78
- package/test/routes/+page.server.ts +0 -3
- package/test/routes/+page.ts +0 -3
- package/test/routes/_error.ts +0 -3
- package/test/routes/_hook.server.ts +0 -3
- package/test/routes/_layout.server.ts +0 -3
- package/test/routes/_layout.ts +0 -3
- package/test/routes/posts/+page.ts +0 -3
- package/test/routes/posts/[id]/+page.ts +0 -3
- package/test/site.test.ts +0 -40
- package/tsconfig.json +0 -9
- package/tsdown.config.ts +0 -18
- package/vitest.config.ts +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@torpor/build",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"description": "A framework for building sites and apps with Torpor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -36,6 +36,10 @@
|
|
|
36
36
|
"types": "./src/types/manifest.d.ts"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"src"
|
|
42
|
+
],
|
|
39
43
|
"publishConfig": {
|
|
40
44
|
"access": "public"
|
|
41
45
|
},
|
|
@@ -51,7 +55,7 @@
|
|
|
51
55
|
"vite": "^7.2.2",
|
|
52
56
|
"vite-tsconfig-paths": "^5.1.4",
|
|
53
57
|
"@torpor/unplugin": "^0.2.1",
|
|
54
|
-
"@torpor/view": "^0.4.
|
|
58
|
+
"@torpor/view": "^0.4.16"
|
|
55
59
|
},
|
|
56
60
|
"devDependencies": {
|
|
57
61
|
"@trivago/prettier-plugin-sort-imports": "^6.0.0",
|
package/CHANGELOG.md
DELETED
|
@@ -1,473 +0,0 @@
|
|
|
1
|
-
# @torpor/build
|
|
2
|
-
|
|
3
|
-
## 0.4.9
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- 2e057c3: Fix: form and button actions
|
|
8
|
-
|
|
9
|
-
## 0.4.8
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- d813c86: Fix: pass search params to client side data cache
|
|
14
|
-
|
|
15
|
-
## 0.4.7
|
|
16
|
-
|
|
17
|
-
### Patch Changes
|
|
18
|
-
|
|
19
|
-
- a09c14e: Fix: bad bin script
|
|
20
|
-
|
|
21
|
-
## 0.4.6
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- cf8d8db: Fix: pass search params to client side navigation
|
|
26
|
-
- 64adf0b: Feat: `subFolder` option when adding routes
|
|
27
|
-
- Updated dependencies [9bca98e]
|
|
28
|
-
- Updated dependencies [7382b6d]
|
|
29
|
-
- Updated dependencies [d68d347]
|
|
30
|
-
- Updated dependencies [4e3d726]
|
|
31
|
-
- Updated dependencies [adfa504]
|
|
32
|
-
- @torpor/view@0.4.14
|
|
33
|
-
|
|
34
|
-
## 0.4.5
|
|
35
|
-
|
|
36
|
-
### Patch Changes
|
|
37
|
-
|
|
38
|
-
- ec90aef: Fix: submit to a button's formaction if set
|
|
39
|
-
|
|
40
|
-
## 0.4.4
|
|
41
|
-
|
|
42
|
-
### Patch Changes
|
|
43
|
-
|
|
44
|
-
- 5b12119: Fix: don't add error JSON as the message
|
|
45
|
-
- Updated dependencies [3cc2168]
|
|
46
|
-
- Updated dependencies [13f2afb]
|
|
47
|
-
- @torpor/view@0.4.7
|
|
48
|
-
|
|
49
|
-
## 0.4.3
|
|
50
|
-
|
|
51
|
-
### Patch Changes
|
|
52
|
-
|
|
53
|
-
- 426f7bd: Fix: return default $page.form status and message
|
|
54
|
-
|
|
55
|
-
## 0.4.2
|
|
56
|
-
|
|
57
|
-
### Patch Changes
|
|
58
|
-
|
|
59
|
-
- 5dd6a23: Fix: only set $page.form if the result is JSON
|
|
60
|
-
|
|
61
|
-
## 0.4.1
|
|
62
|
-
|
|
63
|
-
### Patch Changes
|
|
64
|
-
|
|
65
|
-
- 5972cf8: Fix: ensure that $page and client are always in scope
|
|
66
|
-
- Updated dependencies [00a1868]
|
|
67
|
-
- @torpor/view@0.4.3
|
|
68
|
-
|
|
69
|
-
## 0.4.0
|
|
70
|
-
|
|
71
|
-
### Minor Changes
|
|
72
|
-
|
|
73
|
-
- 168dff3: !Edit: rename Range to Region to avoid name conflicts
|
|
74
|
-
|
|
75
|
-
### Patch Changes
|
|
76
|
-
|
|
77
|
-
- 051998b: Feat: very rudimentary dev tools
|
|
78
|
-
- Updated dependencies [255aad3]
|
|
79
|
-
- Updated dependencies [8b377a2]
|
|
80
|
-
- Updated dependencies [450b739]
|
|
81
|
-
- Updated dependencies [168dff3]
|
|
82
|
-
- Updated dependencies [fc60fe0]
|
|
83
|
-
- Updated dependencies [42c6b60]
|
|
84
|
-
- Updated dependencies [2818679]
|
|
85
|
-
- Updated dependencies [38fd0a5]
|
|
86
|
-
- Updated dependencies [3e6f3f7]
|
|
87
|
-
- Updated dependencies [051998b]
|
|
88
|
-
- @torpor/view@0.4.0
|
|
89
|
-
- @torpor/unplugin@0.2.1
|
|
90
|
-
|
|
91
|
-
## 0.3.1
|
|
92
|
-
|
|
93
|
-
### Patch Changes
|
|
94
|
-
|
|
95
|
-
- 34d17f7: Feat: UI Form component and client-side submit
|
|
96
|
-
- Updated dependencies [f4716c5]
|
|
97
|
-
- Updated dependencies [1253f7a]
|
|
98
|
-
- Updated dependencies [6268e00]
|
|
99
|
-
- Updated dependencies [f2fb547]
|
|
100
|
-
- @torpor/view@0.3.2
|
|
101
|
-
|
|
102
|
-
## 0.3.0
|
|
103
|
-
|
|
104
|
-
### Minor Changes
|
|
105
|
-
|
|
106
|
-
- 51dbba7: Chore: drop CJS build and go ESM only
|
|
107
|
-
- 62b0d2e: !Edit: renamed responses and updated documentation
|
|
108
|
-
|
|
109
|
-
### Patch Changes
|
|
110
|
-
|
|
111
|
-
- bbdc8d3: Feat: return form errors from the server
|
|
112
|
-
- e1ae2bb: Feat: load and reload methods for navigation
|
|
113
|
-
- Updated dependencies [be98b35]
|
|
114
|
-
- Updated dependencies [51dbba7]
|
|
115
|
-
- Updated dependencies [2298a87]
|
|
116
|
-
- Updated dependencies [3a8431a]
|
|
117
|
-
- Updated dependencies [eb58d37]
|
|
118
|
-
- Updated dependencies [e0637be]
|
|
119
|
-
- Updated dependencies [9fcc613]
|
|
120
|
-
- Updated dependencies [f5f84e6]
|
|
121
|
-
- Updated dependencies [6cc57ff]
|
|
122
|
-
- Updated dependencies [c4f9d18]
|
|
123
|
-
- Updated dependencies [5598bc9]
|
|
124
|
-
- Updated dependencies [18f1ccf]
|
|
125
|
-
- Updated dependencies [c2b5c02]
|
|
126
|
-
- Updated dependencies [91d1536]
|
|
127
|
-
- Updated dependencies [4dc16df]
|
|
128
|
-
- Updated dependencies [543b229]
|
|
129
|
-
- Updated dependencies [3cf3ae6]
|
|
130
|
-
- @torpor/view@0.3.0
|
|
131
|
-
- @torpor/unplugin@0.2.0
|
|
132
|
-
|
|
133
|
-
## 0.2.0
|
|
134
|
-
|
|
135
|
-
### Minor Changes
|
|
136
|
-
|
|
137
|
-
- b716d5c: Feat: inline styles during SSR
|
|
138
|
-
|
|
139
|
-
### Patch Changes
|
|
140
|
-
|
|
141
|
-
- a4f2573: Fix: reload the page on successful form submit
|
|
142
|
-
- 67e6ca6: Fix: don't intercept external links
|
|
143
|
-
- Updated dependencies [c38f914]
|
|
144
|
-
- Updated dependencies [995d950]
|
|
145
|
-
- Updated dependencies [b716d5c]
|
|
146
|
-
- Updated dependencies [014bda0]
|
|
147
|
-
- @torpor/view@0.2.0
|
|
148
|
-
- @torpor/unplugin@0.1.17
|
|
149
|
-
|
|
150
|
-
## 0.1.34
|
|
151
|
-
|
|
152
|
-
### Patch Changes
|
|
153
|
-
|
|
154
|
-
- 1221923: Fix: updating layouts in [parameter] routes
|
|
155
|
-
- Updated dependencies [741a289]
|
|
156
|
-
- @torpor/view@0.1.11
|
|
157
|
-
|
|
158
|
-
## 0.1.33
|
|
159
|
-
|
|
160
|
-
### Patch Changes
|
|
161
|
-
|
|
162
|
-
- 74bf42d: Fix: store (and clear) the right layout slot ranges
|
|
163
|
-
- Updated dependencies [74bf42d]
|
|
164
|
-
- @torpor/view@0.1.10
|
|
165
|
-
|
|
166
|
-
## 0.1.32
|
|
167
|
-
|
|
168
|
-
### Patch Changes
|
|
169
|
-
|
|
170
|
-
- 951a86f: Feat: re-use layout data and UI
|
|
171
|
-
- 182d436: Feat: prefetching link data
|
|
172
|
-
- Updated dependencies [1866f30]
|
|
173
|
-
- Updated dependencies [a31647f]
|
|
174
|
-
- Updated dependencies [951a86f]
|
|
175
|
-
- Updated dependencies [6d6fb89]
|
|
176
|
-
- Updated dependencies [9c13f0f]
|
|
177
|
-
- @torpor/view@0.1.6
|
|
178
|
-
|
|
179
|
-
## 0.1.31
|
|
180
|
-
|
|
181
|
-
### Patch Changes
|
|
182
|
-
|
|
183
|
-
- Updated dependencies [f390b78]
|
|
184
|
-
- @torpor/view@0.1.5
|
|
185
|
-
- @torpor/unplugin@0.1.16
|
|
186
|
-
|
|
187
|
-
## 0.1.30
|
|
188
|
-
|
|
189
|
-
### Patch Changes
|
|
190
|
-
|
|
191
|
-
- Updated dependencies [daba2ad]
|
|
192
|
-
- @torpor/view@0.1.4
|
|
193
|
-
- @torpor/unplugin@0.1.15
|
|
194
|
-
|
|
195
|
-
## 0.1.29
|
|
196
|
-
|
|
197
|
-
### Patch Changes
|
|
198
|
-
|
|
199
|
-
- Updated dependencies [de51225]
|
|
200
|
-
- @torpor/view@0.1.3
|
|
201
|
-
- @torpor/unplugin@0.1.14
|
|
202
|
-
|
|
203
|
-
## 0.1.28
|
|
204
|
-
|
|
205
|
-
### Patch Changes
|
|
206
|
-
|
|
207
|
-
- fa85b57: Fix: force `.torp` file compilation in dev
|
|
208
|
-
|
|
209
|
-
## 0.1.27
|
|
210
|
-
|
|
211
|
-
### Patch Changes
|
|
212
|
-
|
|
213
|
-
- bed55d5: Feat: allow passing Vite options in dev
|
|
214
|
-
|
|
215
|
-
## 0.1.26
|
|
216
|
-
|
|
217
|
-
### Patch Changes
|
|
218
|
-
|
|
219
|
-
- 348cd75: Feat: allow creating the Site router with files
|
|
220
|
-
- Updated dependencies [0e69292]
|
|
221
|
-
- Updated dependencies [b69fde1]
|
|
222
|
-
- @torpor/view@0.1.2
|
|
223
|
-
- @torpor/unplugin@0.1.13
|
|
224
|
-
|
|
225
|
-
## 0.1.25
|
|
226
|
-
|
|
227
|
-
### Patch Changes
|
|
228
|
-
|
|
229
|
-
- 3fe0d0e: Feat: set default error messages in responses
|
|
230
|
-
- f26603f: Feat: basic error handling
|
|
231
|
-
- Updated dependencies [f9fd76d]
|
|
232
|
-
- Updated dependencies [1ddc240]
|
|
233
|
-
- Updated dependencies [7b9dc31]
|
|
234
|
-
- @torpor/view@0.1.1
|
|
235
|
-
- @torpor/unplugin@0.1.12
|
|
236
|
-
|
|
237
|
-
## 0.1.24
|
|
238
|
-
|
|
239
|
-
### Patch Changes
|
|
240
|
-
|
|
241
|
-
- 6092a91: Fix: don't swallow error responses when loading data
|
|
242
|
-
|
|
243
|
-
## 0.1.23
|
|
244
|
-
|
|
245
|
-
### Patch Changes
|
|
246
|
-
|
|
247
|
-
- 22f62d4: Fix: Site.viteConfig settings
|
|
248
|
-
|
|
249
|
-
## 0.1.22
|
|
250
|
-
|
|
251
|
-
### Patch Changes
|
|
252
|
-
|
|
253
|
-
- 4e0ec90: Feat: allow more Site.viteConfig settings
|
|
254
|
-
|
|
255
|
-
## 0.1.21
|
|
256
|
-
|
|
257
|
-
### Patch Changes
|
|
258
|
-
|
|
259
|
-
- 4296742: Feat: add Site.viteConfig to set Vite options in build
|
|
260
|
-
|
|
261
|
-
## 0.1.20
|
|
262
|
-
|
|
263
|
-
### Patch Changes
|
|
264
|
-
|
|
265
|
-
- a61f30f: Debug: double hydration
|
|
266
|
-
- Updated dependencies [28a993b]
|
|
267
|
-
- Updated dependencies [98602ec]
|
|
268
|
-
- Updated dependencies [a49d307]
|
|
269
|
-
- Updated dependencies [995513a]
|
|
270
|
-
- Updated dependencies [c9a9cf8]
|
|
271
|
-
- Updated dependencies [cbd07ca]
|
|
272
|
-
- Updated dependencies [f53b184]
|
|
273
|
-
- Updated dependencies [215db17]
|
|
274
|
-
- Updated dependencies [95e866b]
|
|
275
|
-
- @torpor/unplugin@0.1.11
|
|
276
|
-
- @torpor/view@0.1.0
|
|
277
|
-
|
|
278
|
-
## 0.1.19
|
|
279
|
-
|
|
280
|
-
### Patch Changes
|
|
281
|
-
|
|
282
|
-
- 170c886: Debug: double hydration
|
|
283
|
-
|
|
284
|
-
## 0.1.18
|
|
285
|
-
|
|
286
|
-
### Patch Changes
|
|
287
|
-
|
|
288
|
-
- Updated dependencies [fb896c6]
|
|
289
|
-
- Updated dependencies [85bccf6]
|
|
290
|
-
- @torpor/view@0.0.14
|
|
291
|
-
- @torpor/unplugin@0.1.10
|
|
292
|
-
|
|
293
|
-
## 0.1.17
|
|
294
|
-
|
|
295
|
-
### Patch Changes
|
|
296
|
-
|
|
297
|
-
- 7373f27: Fix: parse the cookie value retrieved from the map
|
|
298
|
-
- 679a448: Fix: set $page props on every navigation
|
|
299
|
-
- e5b761b: Feat: allow passing ServerEvent to runTest
|
|
300
|
-
- Updated dependencies [ed4a6db]
|
|
301
|
-
- @torpor/view@0.0.13
|
|
302
|
-
- @torpor/unplugin@0.1.9
|
|
303
|
-
|
|
304
|
-
## 0.1.16
|
|
305
|
-
|
|
306
|
-
### Patch Changes
|
|
307
|
-
|
|
308
|
-
- 9332635: Fix: set $page props in the correct object
|
|
309
|
-
- Updated dependencies [ff5f459]
|
|
310
|
-
- @torpor/view@0.0.12
|
|
311
|
-
- @torpor/unplugin@0.1.8
|
|
312
|
-
|
|
313
|
-
## 0.1.15
|
|
314
|
-
|
|
315
|
-
### Patch Changes
|
|
316
|
-
|
|
317
|
-
- Updated dependencies [e4060e6]
|
|
318
|
-
- @torpor/unplugin@0.1.7
|
|
319
|
-
|
|
320
|
-
## 0.1.14
|
|
321
|
-
|
|
322
|
-
### Patch Changes
|
|
323
|
-
|
|
324
|
-
- e395c9e: Feat: rudimentary test infrastructure
|
|
325
|
-
- Updated dependencies [5676a0b]
|
|
326
|
-
- @torpor/unplugin@0.1.6
|
|
327
|
-
|
|
328
|
-
## 0.1.13
|
|
329
|
-
|
|
330
|
-
### Patch Changes
|
|
331
|
-
|
|
332
|
-
- 02eac8e: Feat: allow passing extra inputs to build
|
|
333
|
-
|
|
334
|
-
## 0.1.12
|
|
335
|
-
|
|
336
|
-
### Patch Changes
|
|
337
|
-
|
|
338
|
-
- 8de094b: Fix: ignore trailing slashes when matching routes
|
|
339
|
-
|
|
340
|
-
## 0.1.11
|
|
341
|
-
|
|
342
|
-
### Patch Changes
|
|
343
|
-
|
|
344
|
-
- 858538b: Fix: move adapter to globalThis, pass it to server loads
|
|
345
|
-
|
|
346
|
-
## 0.1.10
|
|
347
|
-
|
|
348
|
-
### Patch Changes
|
|
349
|
-
|
|
350
|
-
- Updated dependencies [78e78b9]
|
|
351
|
-
- @torpor/view@0.0.11
|
|
352
|
-
- @torpor/unplugin@0.1.5
|
|
353
|
-
|
|
354
|
-
## 0.1.9
|
|
355
|
-
|
|
356
|
-
### Patch Changes
|
|
357
|
-
|
|
358
|
-
- ff685cb: Fix: use the existing fragment name
|
|
359
|
-
|
|
360
|
-
## 0.1.8
|
|
361
|
-
|
|
362
|
-
### Patch Changes
|
|
363
|
-
|
|
364
|
-
- fe7444e: Refactor: rearrange build exports
|
|
365
|
-
- Updated dependencies [8852c89]
|
|
366
|
-
- @torpor/unplugin@0.1.4
|
|
367
|
-
|
|
368
|
-
## 0.1.7
|
|
369
|
-
|
|
370
|
-
### Patch Changes
|
|
371
|
-
|
|
372
|
-
- Updated dependencies [3cf6de6]
|
|
373
|
-
- @torpor/view@0.0.10
|
|
374
|
-
- @torpor/unplugin@0.1.3
|
|
375
|
-
|
|
376
|
-
## 0.1.6
|
|
377
|
-
|
|
378
|
-
### Patch Changes
|
|
379
|
-
|
|
380
|
-
- 47c5277: Chore: update dependencies
|
|
381
|
-
- Updated dependencies [47c5277]
|
|
382
|
-
- @torpor/unplugin@0.1.2
|
|
383
|
-
- @torpor/view@0.0.9
|
|
384
|
-
|
|
385
|
-
## 0.1.5
|
|
386
|
-
|
|
387
|
-
### Patch Changes
|
|
388
|
-
|
|
389
|
-
- 5c9d90f: Fix: double check server rendering from Vite options
|
|
390
|
-
- Updated dependencies [a8ead36]
|
|
391
|
-
- @torpor/view@0.0.8
|
|
392
|
-
- @torpor/unplugin@0.1.1
|
|
393
|
-
|
|
394
|
-
## 0.1.4
|
|
395
|
-
|
|
396
|
-
### Patch Changes
|
|
397
|
-
|
|
398
|
-
- 20ddf6c: Fix: better/less console.logging
|
|
399
|
-
|
|
400
|
-
## 0.1.3
|
|
401
|
-
|
|
402
|
-
### Patch Changes
|
|
403
|
-
|
|
404
|
-
- 4b86717: Refactor: separate adapters into packages
|
|
405
|
-
|
|
406
|
-
## 0.1.2
|
|
407
|
-
|
|
408
|
-
### Patch Changes
|
|
409
|
-
|
|
410
|
-
- d31d14d: Feat: allow running from code
|
|
411
|
-
|
|
412
|
-
## 0.1.1
|
|
413
|
-
|
|
414
|
-
### Patch Changes
|
|
415
|
-
|
|
416
|
-
- Updated dependencies
|
|
417
|
-
- @torpor/unplugin@0.1.0
|
|
418
|
-
|
|
419
|
-
## 0.1.0
|
|
420
|
-
|
|
421
|
-
### Minor Changes
|
|
422
|
-
|
|
423
|
-
- Chore: replace Vinxi with Vite plugins
|
|
424
|
-
|
|
425
|
-
## 0.0.6
|
|
426
|
-
|
|
427
|
-
### Patch Changes
|
|
428
|
-
|
|
429
|
-
- Updated dependencies [b90d729]
|
|
430
|
-
- @torpor/view@0.0.7
|
|
431
|
-
- @torpor/unplugin@0.0.6
|
|
432
|
-
|
|
433
|
-
## 0.0.5
|
|
434
|
-
|
|
435
|
-
### Patch Changes
|
|
436
|
-
|
|
437
|
-
- 79da6cf: Refactor: export more types
|
|
438
|
-
- 3707fdb: Fix: better ordering of routes
|
|
439
|
-
- Updated dependencies [808da4c]
|
|
440
|
-
- @torpor/view@0.0.6
|
|
441
|
-
- @torpor/unplugin@0.0.5
|
|
442
|
-
|
|
443
|
-
## 0.0.4
|
|
444
|
-
|
|
445
|
-
### Patch Changes
|
|
446
|
-
|
|
447
|
-
- Updated dependencies [44cf656]
|
|
448
|
-
- Updated dependencies [a278176]
|
|
449
|
-
- @torpor/view@0.0.5
|
|
450
|
-
- @torpor/unplugin@0.0.4
|
|
451
|
-
|
|
452
|
-
## 0.0.3
|
|
453
|
-
|
|
454
|
-
### Patch Changes
|
|
455
|
-
|
|
456
|
-
- Updated dependencies [76dd6ea]
|
|
457
|
-
- Updated dependencies [8f0a0a1]
|
|
458
|
-
- @torpor/view@0.0.4
|
|
459
|
-
- @torpor/unplugin@0.0.3
|
|
460
|
-
|
|
461
|
-
## 0.0.2
|
|
462
|
-
|
|
463
|
-
### Patch Changes
|
|
464
|
-
|
|
465
|
-
- Fix: use /~server for hooks as well as layouts
|
|
466
|
-
- Fix: catch-all routes should get checked last
|
|
467
|
-
- Updated dependencies
|
|
468
|
-
- Updated dependencies
|
|
469
|
-
- Updated dependencies
|
|
470
|
-
- Updated dependencies
|
|
471
|
-
- Updated dependencies
|
|
472
|
-
- @torpor/view@0.0.3
|
|
473
|
-
- @torpor/unplugin@0.0.2
|
package/scripts/postbuild.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { renameSync } from "node:fs";
|
|
2
|
-
import { dirname, join, resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
5
|
-
// HACK: tsdown only creates *.mjs files now (post v0.16), so we need to rename
|
|
6
|
-
// the bin/index.mjs file to bin/index.js for it to be run by node
|
|
7
|
-
|
|
8
|
-
const scriptsFolder = dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
const distFolder = resolve(scriptsFolder, "../dist");
|
|
10
|
-
|
|
11
|
-
renameSync(join(distFolder, "bin", "index.mjs"), join(distFolder, "bin", "index.js"));
|
|
12
|
-
renameSync(join(distFolder, "bin", "index.mjs.map"), join(distFolder, "bin", "index.js.map"));
|
package/test/api/_hook.server.ts
DELETED
package/test/app.test.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { expect, test } from "vitest";
|
|
2
|
-
import Server from "../src/server/Server";
|
|
3
|
-
|
|
4
|
-
test("app router methods", () => {
|
|
5
|
-
let app = new Server();
|
|
6
|
-
expect(app).not.toBeUndefined();
|
|
7
|
-
/*
|
|
8
|
-
app.add("GET", "/blah", () => "hi there");
|
|
9
|
-
expect(app.match("GET", "/blah")).not.toBeUndefined();
|
|
10
|
-
expect(app.match("POST", "/blah")).toBeUndefined();
|
|
11
|
-
|
|
12
|
-
app.get("/", () => "hi there");
|
|
13
|
-
app.head("/", () => "hi there");
|
|
14
|
-
app.patch("/", () => "hi there");
|
|
15
|
-
app.post("/", () => "hi there");
|
|
16
|
-
app.put("/", () => "hi there");
|
|
17
|
-
app.delete("/", () => "hi there");
|
|
18
|
-
app.options("/", () => "hi there");
|
|
19
|
-
app.connect("/", () => "hi there");
|
|
20
|
-
app.trace("/", () => "hi there");
|
|
21
|
-
|
|
22
|
-
expect(app.match("GET", "/")).not.toBeUndefined();
|
|
23
|
-
expect(app.match("HEAD", "/")).not.toBeUndefined();
|
|
24
|
-
expect(app.match("PATCH", "/")).not.toBeUndefined();
|
|
25
|
-
expect(app.match("POST", "/")).not.toBeUndefined();
|
|
26
|
-
expect(app.match("PUT", "/")).not.toBeUndefined();
|
|
27
|
-
expect(app.match("DELETE", "/")).not.toBeUndefined();
|
|
28
|
-
expect(app.match("OPTIONS", "/")).not.toBeUndefined();
|
|
29
|
-
expect(app.match("CONNECT", "/")).not.toBeUndefined();
|
|
30
|
-
expect(app.match("TRACE", "/")).not.toBeUndefined();
|
|
31
|
-
*/
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
test("app router params", () => {
|
|
35
|
-
let app = new Server();
|
|
36
|
-
expect(app).not.toBeUndefined();
|
|
37
|
-
/*
|
|
38
|
-
app.add("GET", "/posts/[id]", () => "hi there");
|
|
39
|
-
|
|
40
|
-
let route = app.match("GET", "/posts/5");
|
|
41
|
-
|
|
42
|
-
expect(route).not.toBeUndefined();
|
|
43
|
-
expect(route!.handler).not.toBeUndefined();
|
|
44
|
-
expect(route!.params).not.toBeUndefined();
|
|
45
|
-
expect(route!.params!.id).toBe("5");
|
|
46
|
-
*/
|
|
47
|
-
});
|
package/test/router.test.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { assert, expect, test } from "vitest";
|
|
2
|
-
import Router from "../src/site/Router";
|
|
3
|
-
import { HOOK_SERVER_ROUTE, LAYOUT_ROUTE, PAGE_ROUTE } from "../src/types/RouteType";
|
|
4
|
-
|
|
5
|
-
test("router method sorting", () => {
|
|
6
|
-
let r = new Router();
|
|
7
|
-
r.addPage("/posts/[id]", PAGE_ROUTE, async () => {});
|
|
8
|
-
r.addPage("/posts/drafts/[id]", PAGE_ROUTE, async () => {});
|
|
9
|
-
expect(r.routes.map((r) => r.path).join(",")).toBe("/posts/drafts/[id],/posts/[id]");
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test("router matching", () => {
|
|
13
|
-
let r = new Router();
|
|
14
|
-
r.addPage("/posts", PAGE_ROUTE, async () => {});
|
|
15
|
-
const match = r.match("/posts", new URLSearchParams());
|
|
16
|
-
assert(match, "no match");
|
|
17
|
-
expect(match.params).toBeUndefined();
|
|
18
|
-
assert(match.handler, "no handler");
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
test("router matching with param", () => {
|
|
22
|
-
let r = new Router();
|
|
23
|
-
r.addPage("/posts/[id]", PAGE_ROUTE, async () => {});
|
|
24
|
-
r.addPage("/posts/drafts/[id]", PAGE_ROUTE, async () => {});
|
|
25
|
-
const match = r.match("/posts/5", new URLSearchParams());
|
|
26
|
-
assert(match, "no match");
|
|
27
|
-
assert(match.params, "no params");
|
|
28
|
-
expect(match.params["id"]).toBe("5");
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
test("router matching not found", () => {
|
|
32
|
-
let r = new Router();
|
|
33
|
-
r.addPage("/posts/[id]", PAGE_ROUTE, async () => {});
|
|
34
|
-
r.addPage("/posts/drafts/[id]", PAGE_ROUTE, async () => {});
|
|
35
|
-
const match = r.match("/postss/5", new URLSearchParams());
|
|
36
|
-
expect(match).toBeUndefined();
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test("router matching layouts", () => {
|
|
40
|
-
let r = new Router();
|
|
41
|
-
r.addPage("/_layout", LAYOUT_ROUTE, async () => {});
|
|
42
|
-
r.addPage("/posts/_layout", LAYOUT_ROUTE, async () => {});
|
|
43
|
-
r.addPage("/posts/[id]", PAGE_ROUTE, async () => {});
|
|
44
|
-
r.addPage("/posts/drafts/[id]", PAGE_ROUTE, async () => {});
|
|
45
|
-
const match = r.match("/posts/5", new URLSearchParams());
|
|
46
|
-
assert(match, "no match");
|
|
47
|
-
assert(match.handler.layouts, "no layouts");
|
|
48
|
-
expect(match.handler.layouts.length).toBe(2);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test("router matching hook", () => {
|
|
52
|
-
let r = new Router();
|
|
53
|
-
r.addPage("/_hook/~server", HOOK_SERVER_ROUTE, async () => {});
|
|
54
|
-
r.addPage("/posts/[id]", PAGE_ROUTE, async () => {});
|
|
55
|
-
const match = r.match("/posts/5", new URLSearchParams());
|
|
56
|
-
assert(match, "no match");
|
|
57
|
-
assert(match.handler.serverHook, "no hook");
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
test("router matching base folder", async () => {
|
|
61
|
-
let r = new Router();
|
|
62
|
-
r.addPage("/_hook/~server", HOOK_SERVER_ROUTE, async () => {});
|
|
63
|
-
r.addPage("/_layout", LAYOUT_ROUTE, async () => {});
|
|
64
|
-
r.addPage("/posts/_layout", LAYOUT_ROUTE, async () => {});
|
|
65
|
-
r.addPage("/posts/[id]", PAGE_ROUTE, async () => {});
|
|
66
|
-
r.addPage("/api/posts/[id]", PAGE_ROUTE, async () => {}, "/api");
|
|
67
|
-
r.addPage("/api/_hook/~server", HOOK_SERVER_ROUTE, async () => "api hook", "/api");
|
|
68
|
-
const match = r.match("/api/posts/5", new URLSearchParams());
|
|
69
|
-
assert(match, "no match");
|
|
70
|
-
assert(match.params, "no params");
|
|
71
|
-
expect(match.params["id"]).toBe("5");
|
|
72
|
-
|
|
73
|
-
expect(match.handler.path).toBe("/api/posts/[id]");
|
|
74
|
-
assert(match.handler.serverHook, "no hook");
|
|
75
|
-
expect(await match.handler.serverHook()).toBe("api hook");
|
|
76
|
-
|
|
77
|
-
expect(match.handler.layouts).toBeUndefined();
|
|
78
|
-
});
|
package/test/routes/+page.ts
DELETED
package/test/routes/_error.ts
DELETED
package/test/routes/_layout.ts
DELETED
package/test/site.test.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { expect, test } from "vitest";
|
|
2
|
-
import Site from "../src/site/Site";
|
|
3
|
-
|
|
4
|
-
test("site routes", async () => {
|
|
5
|
-
let site = new Site();
|
|
6
|
-
await site.addRouteFolder("./test/routes");
|
|
7
|
-
expect(site.routes.map((r) => r.path).join("\n")).toBe(
|
|
8
|
-
`
|
|
9
|
-
/
|
|
10
|
-
/_error
|
|
11
|
-
/_hook/~server
|
|
12
|
-
/_layout
|
|
13
|
-
/_layout/~server
|
|
14
|
-
/~server
|
|
15
|
-
/posts
|
|
16
|
-
/posts/[id]
|
|
17
|
-
`.trim(),
|
|
18
|
-
);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
test("site routes with base folder", async () => {
|
|
22
|
-
let site = new Site();
|
|
23
|
-
await site.addRouteFolder("./test/routes");
|
|
24
|
-
await site.addRouteFolder("./test/api", "api");
|
|
25
|
-
expect(site.routes.map((r) => r.path).join("\n")).toBe(
|
|
26
|
-
`
|
|
27
|
-
/
|
|
28
|
-
/_error
|
|
29
|
-
/_hook/~server
|
|
30
|
-
/_layout
|
|
31
|
-
/_layout/~server
|
|
32
|
-
/~server
|
|
33
|
-
/api/_hook/~server
|
|
34
|
-
/api/posts/~server
|
|
35
|
-
/api/posts/[id]/~server
|
|
36
|
-
/posts
|
|
37
|
-
/posts/[id]
|
|
38
|
-
`.trim(),
|
|
39
|
-
);
|
|
40
|
-
});
|
package/tsconfig.json
DELETED
package/tsdown.config.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type UserConfig, defineConfig } from "tsdown";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: [
|
|
5
|
-
"src/index.ts",
|
|
6
|
-
"src/nav.ts",
|
|
7
|
-
"src/response.ts",
|
|
8
|
-
"src/run.ts",
|
|
9
|
-
"src/server.ts",
|
|
10
|
-
"src/state.ts",
|
|
11
|
-
"src/test.ts",
|
|
12
|
-
"src/bin/index.ts",
|
|
13
|
-
],
|
|
14
|
-
// Put this in here to stop issues with bundling Vite from bin/index.ts
|
|
15
|
-
// I'm not sure if this will cause further issues down the line?
|
|
16
|
-
external: ["vite"],
|
|
17
|
-
onSuccess: "npm run build:fix",
|
|
18
|
-
}) satisfies UserConfig as UserConfig;
|
package/vitest.config.ts
DELETED