@solidjs/start 2.0.0-beta.1 → 2.0.0-beta.2
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/CHANGELOG.md +7 -0
- package/dist/client/StartClient.d.ts +7 -0
- package/{src/client/StartClient.tsx → dist/client/StartClient.jsx} +7 -15
- package/dist/client/index.jsx +2 -0
- package/dist/client/mount.d.ts +1 -0
- package/dist/client/mount.js +1 -0
- package/dist/client/spa/index.d.ts +4 -0
- package/dist/client/spa/index.jsx +5 -0
- package/dist/config/constants.d.ts +16 -0
- package/dist/config/constants.js +16 -0
- package/dist/config/dev-server.d.ts +2 -0
- package/dist/config/dev-server.js +128 -0
- package/dist/config/env.d.ts +19 -0
- package/dist/config/env.js +81 -0
- package/dist/config/fs-router.d.ts +37 -0
- package/dist/config/fs-router.js +141 -0
- package/dist/config/fs-routes/fs-watcher.d.ts +3 -0
- package/dist/config/fs-routes/fs-watcher.js +53 -0
- package/dist/config/fs-routes/index.d.ts +7 -0
- package/dist/config/fs-routes/index.js +107 -0
- package/dist/config/fs-routes/router.d.ts +42 -0
- package/dist/config/fs-routes/router.js +148 -0
- package/dist/config/fs-routes/tree-shake.d.ts +2 -0
- package/dist/config/fs-routes/tree-shake.js +305 -0
- package/dist/config/index.d.ts +25 -0
- package/dist/config/index.js +217 -0
- package/dist/config/lazy.d.ts +3 -0
- package/dist/config/lazy.js +114 -0
- package/dist/config/manifest.d.ts +3 -0
- package/dist/config/manifest.js +109 -0
- package/dist/config/utils.d.ts +4 -0
- package/dist/config/utils.js +6 -0
- package/dist/config/vite-utils.d.ts +21 -0
- package/dist/config/vite-utils.js +85 -0
- package/dist/directives/bubble-function-declaration.d.ts +3 -0
- package/dist/directives/bubble-function-declaration.js +23 -0
- package/dist/directives/compile.d.ts +9 -0
- package/dist/directives/compile.js +40 -0
- package/dist/directives/generate-unique-name.d.ts +3 -0
- package/dist/directives/generate-unique-name.js +16 -0
- package/dist/directives/get-descriptive-name.d.ts +2 -0
- package/dist/directives/get-descriptive-name.js +37 -0
- package/dist/directives/get-import-identifier.d.ts +4 -0
- package/dist/directives/get-import-identifier.js +19 -0
- package/dist/directives/get-root-statement-path.d.ts +2 -0
- package/dist/directives/get-root-statement-path.js +12 -0
- package/dist/directives/index.d.ts +14 -0
- package/dist/directives/index.js +170 -0
- package/dist/directives/is-statement-top-level.d.ts +3 -0
- package/dist/directives/is-statement-top-level.js +9 -0
- package/dist/directives/paths.d.ts +9 -0
- package/dist/directives/paths.js +36 -0
- package/dist/directives/plugin.d.ts +21 -0
- package/dist/directives/plugin.js +302 -0
- package/dist/directives/remove-unused-variables.d.ts +3 -0
- package/dist/directives/remove-unused-variables.js +66 -0
- package/{src/directives/types.ts → dist/directives/types.d.ts} +5 -7
- package/dist/directives/types.js +1 -0
- package/dist/directives/xxhash32.d.ts +6 -0
- package/dist/directives/xxhash32.js +193 -0
- package/dist/fns/client.d.ts +3 -0
- package/dist/fns/client.js +106 -0
- package/dist/fns/handler.d.ts +5 -0
- package/dist/fns/handler.js +269 -0
- package/dist/fns/registration.d.ts +2 -0
- package/dist/fns/registration.js +12 -0
- package/dist/fns/serialization.d.ts +6 -0
- package/dist/fns/serialization.js +208 -0
- package/dist/fns/server.d.ts +7 -0
- package/dist/fns/server.js +38 -0
- package/dist/fns/shared.d.ts +17 -0
- package/dist/fns/shared.js +105 -0
- package/dist/http/index.d.ts +81 -0
- package/dist/http/index.js +129 -0
- package/{src/index.tsx → dist/index.d.ts} +0 -2
- package/dist/index.jsx +6 -0
- package/dist/middleware/index.d.ts +38 -0
- package/dist/middleware/index.js +59 -0
- package/dist/router.d.ts +6 -0
- package/dist/router.jsx +29 -0
- package/dist/server/StartServer.d.ts +9 -0
- package/dist/server/StartServer.jsx +34 -0
- package/dist/server/assets/PatchVirtualDevStyles.d.ts +4 -0
- package/{src/server/assets/PatchVirtualDevStyles.tsx → dist/server/assets/PatchVirtualDevStyles.jsx} +7 -10
- package/dist/server/assets/index.d.ts +2 -0
- package/dist/server/assets/index.js +52 -0
- package/dist/server/assets/render.d.ts +19 -0
- package/dist/server/assets/render.jsx +14 -0
- package/dist/server/collect-styles.d.ts +3 -0
- package/dist/server/collect-styles.js +57 -0
- package/dist/server/fetchEvent.d.ts +7 -0
- package/dist/server/fetchEvent.js +26 -0
- package/dist/server/handler.d.ts +64 -0
- package/dist/server/handler.js +222 -0
- package/dist/server/index.d.ts +9 -0
- package/{src/server/index.tsx → dist/server/index.jsx} +4 -19
- package/dist/server/manifest/client-manifest.d.ts +9 -0
- package/dist/server/manifest/client-manifest.js +6 -0
- package/dist/server/manifest/dev-client-manifest.d.ts +4 -0
- package/dist/server/manifest/dev-client-manifest.js +24 -0
- package/dist/server/manifest/dev-ssr-manifest.d.ts +5 -0
- package/dist/server/manifest/dev-ssr-manifest.js +23 -0
- package/dist/server/manifest/prod-client-manifest.d.ts +5 -0
- package/dist/server/manifest/prod-client-manifest.js +26 -0
- package/dist/server/manifest/prod-ssr-manifest.d.ts +6 -0
- package/dist/server/manifest/prod-ssr-manifest.js +85 -0
- package/dist/server/manifest/ssr-manifest.d.ts +4 -0
- package/dist/server/manifest/ssr-manifest.js +6 -0
- package/dist/server/routes.d.ts +23 -0
- package/dist/server/routes.js +74 -0
- package/dist/server/spa/StartServer.d.ts +9 -0
- package/dist/server/spa/StartServer.jsx +25 -0
- package/dist/server/spa/handler.d.ts +36 -0
- package/dist/server/spa/handler.js +20 -0
- package/{src/server/spa/index.tsx → dist/server/spa/index.d.ts} +0 -1
- package/dist/server/spa/index.jsx +5 -0
- package/dist/server/types.d.ts +75 -0
- package/dist/server/types.js +1 -0
- package/dist/server/util.d.ts +2 -0
- package/dist/server/util.js +8 -0
- package/dist/shared/ErrorBoundary.d.ts +3 -0
- package/dist/shared/ErrorBoundary.jsx +36 -0
- package/dist/shared/GET.d.ts +5 -0
- package/dist/shared/GET.js +8 -0
- package/dist/shared/HttpHeader.d.ts +10 -0
- package/dist/shared/HttpHeader.jsx +38 -0
- package/dist/shared/HttpStatusCode.d.ts +9 -0
- package/dist/shared/HttpStatusCode.js +18 -0
- package/dist/shared/clientOnly.d.ts +12 -0
- package/dist/shared/clientOnly.js +27 -0
- package/dist/shared/dev-overlay/CodeView.d.ts +7 -0
- package/dist/shared/dev-overlay/CodeView.jsx +62 -0
- package/dist/shared/dev-overlay/DevOverlayDialog.d.ts +9 -0
- package/dist/shared/dev-overlay/DevOverlayDialog.jsx +226 -0
- package/dist/shared/dev-overlay/createStackFrame.d.ts +9 -0
- package/dist/shared/dev-overlay/createStackFrame.js +56 -0
- package/dist/shared/dev-overlay/download.d.ts +1 -0
- package/dist/shared/dev-overlay/download.js +6 -0
- package/dist/shared/dev-overlay/get-source-map.d.ts +2 -0
- package/dist/shared/dev-overlay/get-source-map.js +25 -0
- package/dist/shared/dev-overlay/icons.d.ts +28 -0
- package/dist/shared/dev-overlay/icons.jsx +150 -0
- package/dist/shared/dev-overlay/index.d.ts +5 -0
- package/dist/shared/dev-overlay/index.jsx +39 -0
- package/dist/shared/lazy.d.ts +3 -0
- package/dist/shared/lazy.js +42 -0
- package/dist/shared/serverFunction.d.ts +6 -0
- package/dist/shared/serverFunction.js +8 -0
- package/dist/utils/debounce.d.ts +4 -0
- package/dist/utils/debounce.js +10 -0
- package/package.json +7 -2
- package/scripts/build.js +0 -15
- package/scripts/validate-imports.js +0 -316
- package/src/client/mount.ts +0 -1
- package/src/client/spa/index.tsx +0 -9
- package/src/config/constants.ts +0 -19
- package/src/config/dev-server.ts +0 -161
- package/src/config/env.ts +0 -105
- package/src/config/fs-router.ts +0 -162
- package/src/config/fs-routes/fs-watcher.ts +0 -66
- package/src/config/fs-routes/index.ts +0 -136
- package/src/config/fs-routes/router.ts +0 -184
- package/src/config/fs-routes/tree-shake.ts +0 -324
- package/src/config/index.ts +0 -239
- package/src/config/lazy.ts +0 -132
- package/src/config/manifest.ts +0 -120
- package/src/config/utils.ts +0 -5
- package/src/config/vite-utils.ts +0 -113
- package/src/directives/bubble-function-declaration.ts +0 -33
- package/src/directives/compile.ts +0 -54
- package/src/directives/generate-unique-name.ts +0 -22
- package/src/directives/get-descriptive-name.ts +0 -39
- package/src/directives/get-import-identifier.ts +0 -34
- package/src/directives/get-root-statement-path.ts +0 -14
- package/src/directives/index.ts +0 -233
- package/src/directives/is-statement-top-level.ts +0 -13
- package/src/directives/paths.ts +0 -63
- package/src/directives/plugin.ts +0 -389
- package/src/directives/remove-unused-variables.ts +0 -70
- package/src/directives/xxhash32.ts +0 -214
- package/src/env.d.ts +0 -17
- package/src/fns/client.ts +0 -141
- package/src/fns/handler.spec.ts +0 -85
- package/src/fns/handler.ts +0 -287
- package/src/fns/registration.ts +0 -19
- package/src/fns/serialization.ts +0 -250
- package/src/fns/server.ts +0 -46
- package/src/fns/shared.ts +0 -116
- package/src/http/index.ts +0 -216
- package/src/internal.d.ts +0 -14
- package/src/middleware/index.ts +0 -92
- package/src/router.tsx +0 -37
- package/src/server/StartServer.tsx +0 -58
- package/src/server/assets/index.ts +0 -70
- package/src/server/assets/render.tsx +0 -46
- package/src/server/collect-styles.ts +0 -70
- package/src/server/fetchEvent.spec.ts +0 -85
- package/src/server/fetchEvent.ts +0 -36
- package/src/server/handler.ts +0 -261
- package/src/server/manifest/client-manifest.ts +0 -8
- package/src/server/manifest/dev-client-manifest.ts +0 -21
- package/src/server/manifest/dev-ssr-manifest.ts +0 -23
- package/src/server/manifest/prod-client-manifest.ts +0 -21
- package/src/server/manifest/prod-ssr-manifest.ts +0 -109
- package/src/server/manifest/ssr-manifest.ts +0 -10
- package/src/server/routes.ts +0 -126
- package/src/server/spa/StartServer.tsx +0 -42
- package/src/server/spa/handler.ts +0 -29
- package/src/server/types.ts +0 -82
- package/src/server/util.ts +0 -12
- package/src/shared/ErrorBoundary.tsx +0 -52
- package/src/shared/GET.ts +0 -8
- package/src/shared/HttpHeader.tsx +0 -42
- package/src/shared/HttpStatusCode.ts +0 -27
- package/src/shared/clientOnly.ts +0 -44
- package/src/shared/dev-overlay/CodeView.tsx +0 -90
- package/src/shared/dev-overlay/DevOverlayDialog.tsx +0 -316
- package/src/shared/dev-overlay/createStackFrame.ts +0 -74
- package/src/shared/dev-overlay/download.ts +0 -6
- package/src/shared/dev-overlay/env.d.ts +0 -4
- package/src/shared/dev-overlay/get-source-map.ts +0 -33
- package/src/shared/dev-overlay/icons.tsx +0 -456
- package/src/shared/dev-overlay/index.tsx +0 -63
- package/src/shared/lazy.ts +0 -52
- package/src/shared/serverFunction.ts +0 -10
- package/src/utils/debounce.ts +0 -10
- package/src/virtual.d.ts +0 -27
- package/tsconfig.json +0 -24
- package/vitest.config.ts +0 -9
- /package/{src/client/index.tsx → dist/client/index.d.ts} +0 -0
- /package/{src → dist}/shared/dev-overlay/styles.css +0 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
export function ArrowRightIcon(props) {
|
|
2
|
+
return (<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" {...props}>
|
|
3
|
+
<title>{props.title}</title>
|
|
4
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3"/>
|
|
5
|
+
</svg>);
|
|
6
|
+
}
|
|
7
|
+
export function ArrowLeftIcon(props) {
|
|
8
|
+
return (<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" {...props}>
|
|
9
|
+
<title>{props.title}</title>
|
|
10
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
|
|
11
|
+
</svg>);
|
|
12
|
+
}
|
|
13
|
+
export function RefreshIcon(props) {
|
|
14
|
+
return (<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" {...props}>
|
|
15
|
+
<title>{props.title}</title>
|
|
16
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
|
|
17
|
+
</svg>);
|
|
18
|
+
}
|
|
19
|
+
export function ViewCompiledIcon(props) {
|
|
20
|
+
return (<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" {...props}>
|
|
21
|
+
<title>{props.title}</title>
|
|
22
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
|
|
23
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/>
|
|
24
|
+
</svg>);
|
|
25
|
+
}
|
|
26
|
+
export function ViewOriginalIcon(props) {
|
|
27
|
+
return (<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" {...props}>
|
|
28
|
+
<title>{props.title}</title>
|
|
29
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"/>
|
|
30
|
+
</svg>);
|
|
31
|
+
}
|
|
32
|
+
export function CameraIcon(props) {
|
|
33
|
+
return (<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" stroke="none" {...props}>
|
|
34
|
+
<title>{props.title}</title>
|
|
35
|
+
<path d="M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z"/>
|
|
36
|
+
<path fill-rule="evenodd" d="M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3h-15a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd"/>
|
|
37
|
+
</svg>);
|
|
38
|
+
}
|
|
39
|
+
export function DiscordIcon(props) {
|
|
40
|
+
return (<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" stroke="none" {...props}>
|
|
41
|
+
<title>{props.title}</title>
|
|
42
|
+
<path d="M14.82 4.26a10.14 10.14 0 0 0-.53 1.1 14.66 14.66 0 0 0-4.58 0 10.14 10.14 0 0 0-.53-1.1 16 16 0 0 0-4.13 1.3 17.33 17.33 0 0 0-3 11.59 16.6 16.6 0 0 0 5.07 2.59A12.89 12.89 0 0 0 8.23 18a9.65 9.65 0 0 1-1.71-.83 3.39 3.39 0 0 0 .42-.33 11.66 11.66 0 0 0 10.12 0q.21.18.42.33a10.84 10.84 0 0 1-1.71.84 12.41 12.41 0 0 0 1.08 1.78 16.44 16.44 0 0 0 5.06-2.59 17.22 17.22 0 0 0-3-11.59 16.09 16.09 0 0 0-4.09-1.35zM8.68 14.81a1.94 1.94 0 0 1-1.8-2 1.93 1.93 0 0 1 1.8-2 1.93 1.93 0 0 1 1.8 2 1.93 1.93 0 0 1-1.8 2zm6.64 0a1.94 1.94 0 0 1-1.8-2 1.93 1.93 0 0 1 1.8-2 1.92 1.92 0 0 1 1.8 2 1.92 1.92 0 0 1-1.8 2z"></path>
|
|
43
|
+
</svg>);
|
|
44
|
+
}
|
|
45
|
+
export function GithubIcon(props) {
|
|
46
|
+
return (<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" stroke="none" {...props}>
|
|
47
|
+
<title>{props.title}</title>
|
|
48
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.026 2c-5.509 0-9.974 4.465-9.974 9.974 0 4.406 2.857 8.145 6.821 9.465.499.09.679-.217.679-.481 0-.237-.008-.865-.011-1.696-2.775.602-3.361-1.338-3.361-1.338-.452-1.152-1.107-1.459-1.107-1.459-.905-.619.069-.605.069-.605 1.002.07 1.527 1.028 1.527 1.028.89 1.524 2.336 1.084 2.902.829.091-.645.351-1.085.635-1.334-2.214-.251-4.542-1.107-4.542-4.93 0-1.087.389-1.979 1.024-2.675-.101-.253-.446-1.268.099-2.64 0 0 .837-.269 2.742 1.021a9.582 9.582 0 0 1 2.496-.336 9.554 9.554 0 0 1 2.496.336c1.906-1.291 2.742-1.021 2.742-1.021.545 1.372.203 2.387.099 2.64.64.696 1.024 1.587 1.024 2.675 0 3.833-2.33 4.675-4.552 4.922.355.308.675.916.675 1.846 0 1.334-.012 2.41-.012 2.737 0 .267.178.577.687.479C19.146 20.115 22 16.379 22 11.974 22 6.465 17.535 2 12.026 2z"></path>
|
|
49
|
+
</svg>);
|
|
50
|
+
}
|
|
51
|
+
export function SolidStartIcon(props) {
|
|
52
|
+
return (<svg viewBox="0 0 701 701" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
53
|
+
<title>{props.title}</title>
|
|
54
|
+
<g filter="url(#filter0_d_1_2)">
|
|
55
|
+
<rect width="693" height="693" transform="translate(4)" fill="white"/>
|
|
56
|
+
<mask id="mask0_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="323" y="556" width="174" height="72">
|
|
57
|
+
<path d="M323.508 627.978L435.81 619.384C435.81 619.384 474.315 613.168 496.842 576.082L417.413 556.809L323.508 627.978Z" fill="white"/>
|
|
58
|
+
</mask>
|
|
59
|
+
<g mask="url(#mask0_1_2)">
|
|
60
|
+
<path d="M510.734 559.645L490 661.769L309.658 625.183L330.349 523.018L510.734 559.645Z" fill="url(#paint0_linear_1_2)"/>
|
|
61
|
+
</g>
|
|
62
|
+
<mask id="mask1_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="73" y="364" width="424" height="220">
|
|
63
|
+
<path d="M168.488 364.785C135.031 366.371 73.2477 372.295 73.2477 372.295L342.489 567.989L403.813 583.341L496.884 576.124L225.974 380.096C225.974 380.096 204.072 364.66 172.91 364.66C171.491 364.66 169.989 364.702 168.488 364.785Z" fill="white"/>
|
|
64
|
+
</mask>
|
|
65
|
+
<g mask="url(#mask1_1_2)">
|
|
66
|
+
<path d="M192.016 773.57L-24.954 425.942L378.115 174.389L595.085 522.017L192.016 773.57Z" fill="url(#paint1_linear_1_2)"/>
|
|
67
|
+
</g>
|
|
68
|
+
<mask id="mask2_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="515" y="255" width="179" height="71">
|
|
69
|
+
<path d="M515.573 325.822L631.254 318.688C631.254 318.688 670.885 312.931 693.621 275.928L611.438 255.487L515.573 325.822Z" fill="white"/>
|
|
70
|
+
</mask>
|
|
71
|
+
<g mask="url(#mask2_1_2)">
|
|
72
|
+
<path d="M557.832 401.58L485.62 272.174L651.32 179.729L723.532 309.135L557.832 401.58Z" fill="url(#paint2_linear_1_2)"/>
|
|
73
|
+
</g>
|
|
74
|
+
<mask id="mask3_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="254" y="59" width="440" height="223">
|
|
75
|
+
<path d="M352.251 59.0417C317.751 60.1681 254.132 65.2993 254.132 65.2993L534.345 265.666L597.755 281.936L693.621 275.928L411.697 75.2279C411.697 75.2279 388.294 59 355.505 59C354.42 59 353.335 59 352.251 59.0417Z" fill="white"/>
|
|
76
|
+
</mask>
|
|
77
|
+
<g mask="url(#mask3_1_2)">
|
|
78
|
+
<path d="M623.161 -102.236L775.386 246.226L324.592 443.172L172.325 94.7097L623.161 -102.236Z" fill="url(#paint3_linear_1_2)"/>
|
|
79
|
+
</g>
|
|
80
|
+
<mask id="mask4_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="6" y="371" width="396" height="257">
|
|
81
|
+
<path d="M6.62575 415.555C6.41717 415.889 6.20858 416.264 6 416.64L79.6305 469.912L153.261 523.185L275.909 611.917C317.125 641.744 373.318 628.895 401.393 583.215L326.762 529.234L252.13 475.252L130.483 387.229C115.632 376.508 98.8203 371.377 82.1335 371.377C53.0567 371.335 24.272 386.895 6.62575 415.555Z" fill="white"/>
|
|
82
|
+
</mask>
|
|
83
|
+
<g mask="url(#mask4_1_2)">
|
|
84
|
+
<path d="M529.756 464.03L265.855 829.387L-122.321 549.008L141.538 183.65L529.756 464.03Z" fill="url(#paint4_linear_1_2)"/>
|
|
85
|
+
</g>
|
|
86
|
+
<mask id="mask5_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="187" y="64" width="411" height="263">
|
|
87
|
+
<path d="M188.47 108.101C188.261 108.476 188.053 108.81 187.844 109.186L264.478 163.751L341.112 218.317L468.725 309.177C511.61 339.714 569.388 327.532 597.755 281.977L520.078 226.661L442.401 171.386L315.832 81.2352C300.063 70.0133 282.25 64.6318 264.645 64.6318C235.026 64.6318 206.074 79.9002 188.47 108.101Z" fill="white"/>
|
|
88
|
+
</mask>
|
|
89
|
+
<g mask="url(#mask5_1_2)">
|
|
90
|
+
<path d="M685.945 96.6704L550.031 471.164L99.6544 307.675L235.527 -66.8184L685.945 96.6704Z" fill="url(#paint5_linear_1_2)"/>
|
|
91
|
+
</g>
|
|
92
|
+
<mask id="mask6_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="134" y="164" width="419" height="344">
|
|
93
|
+
<path d="M134.363 170.051L233.149 278.64C237.571 284.856 242.744 290.571 248.626 295.66L441.567 507.791L537.432 501.784C565.8 456.229 554.036 394.53 511.151 363.993L383.539 273.133L306.863 218.567L230.229 164.002L134.363 170.051Z" fill="white"/>
|
|
94
|
+
</mask>
|
|
95
|
+
<g mask="url(#mask6_1_2)">
|
|
96
|
+
<path d="M291.886 715.5L-31.1699 289.528L408.235 -43.7072L731.291 382.265L291.886 715.5Z" fill="url(#paint6_linear_1_2)"/>
|
|
97
|
+
</g>
|
|
98
|
+
<mask id="mask7_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="118" y="170" width="340" height="338">
|
|
99
|
+
<path d="M133.696 171.094C105.703 216.065 117.301 276.971 159.644 307.091L286.255 397.241L363.932 452.516L441.609 507.791C469.976 462.236 458.212 400.537 415.327 370L287.631 279.141L210.997 224.575L134.363 170.051C134.154 170.384 133.904 170.718 133.696 171.094Z" fill="white"/>
|
|
100
|
+
</mask>
|
|
101
|
+
<g mask="url(#mask7_1_2)">
|
|
102
|
+
<path d="M606.057 239.009L395.553 654.635L-30.4607 438.833L180.043 23.2069L606.057 239.009Z" fill="url(#paint7_linear_1_2)"/>
|
|
103
|
+
</g>
|
|
104
|
+
</g>
|
|
105
|
+
<defs>
|
|
106
|
+
<filter id="filter0_d_1_2" x="0" y="0" width="701" height="701" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
107
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
108
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
109
|
+
<feOffset dy="4"/>
|
|
110
|
+
<feGaussianBlur stdDeviation="2"/>
|
|
111
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
112
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
|
113
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_2"/>
|
|
114
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1_2" result="shape"/>
|
|
115
|
+
</filter>
|
|
116
|
+
<linearGradient id="paint0_linear_1_2" x1="522.269" y1="40.5341" x2="374.272" y2="769.949" gradientUnits="userSpaceOnUse">
|
|
117
|
+
<stop stop-color="#1593F5"/>
|
|
118
|
+
<stop offset="1" stop-color="#0084CE"/>
|
|
119
|
+
</linearGradient>
|
|
120
|
+
<linearGradient id="paint1_linear_1_2" x1="507.729" y1="830.625" x2="-112.45" y2="-163.072" gradientUnits="userSpaceOnUse">
|
|
121
|
+
<stop stop-color="#1593F5"/>
|
|
122
|
+
<stop offset="1" stop-color="#0084CE"/>
|
|
123
|
+
</linearGradient>
|
|
124
|
+
<linearGradient id="paint2_linear_1_2" x1="915.255" y1="847.35" x2="541.738" y2="177.838" gradientUnits="userSpaceOnUse">
|
|
125
|
+
<stop stop-color="white"/>
|
|
126
|
+
<stop offset="1" stop-color="#15ABFF"/>
|
|
127
|
+
</linearGradient>
|
|
128
|
+
<linearGradient id="paint3_linear_1_2" x1="254.189" y1="-332.587" x2="571.326" y2="393.304" gradientUnits="userSpaceOnUse">
|
|
129
|
+
<stop stop-color="white"/>
|
|
130
|
+
<stop offset="1" stop-color="#79CFFF"/>
|
|
131
|
+
</linearGradient>
|
|
132
|
+
<linearGradient id="paint4_linear_1_2" x1="610.213" y1="-56.2573" x2="106.317" y2="641.444" gradientUnits="userSpaceOnUse">
|
|
133
|
+
<stop stop-color="#0057E5"/>
|
|
134
|
+
<stop offset="1" stop-color="#0084CE"/>
|
|
135
|
+
</linearGradient>
|
|
136
|
+
<linearGradient id="paint5_linear_1_2" x1="496.212" y1="-82.6564" x2="337.643" y2="354.288" gradientUnits="userSpaceOnUse">
|
|
137
|
+
<stop stop-color="white"/>
|
|
138
|
+
<stop offset="1" stop-color="#15ABFF"/>
|
|
139
|
+
</linearGradient>
|
|
140
|
+
<linearGradient id="paint6_linear_1_2" x1="693.692" y1="789.133" x2="-102.675" y2="-260.944" gradientUnits="userSpaceOnUse">
|
|
141
|
+
<stop stop-color="white"/>
|
|
142
|
+
<stop offset="1" stop-color="#79CFFF"/>
|
|
143
|
+
</linearGradient>
|
|
144
|
+
<linearGradient id="paint7_linear_1_2" x1="555.118" y1="-188.777" x2="146.363" y2="618.161" gradientUnits="userSpaceOnUse">
|
|
145
|
+
<stop stop-color="white"/>
|
|
146
|
+
<stop offset="1" stop-color="#79CFFF"/>
|
|
147
|
+
</linearGradient>
|
|
148
|
+
</defs>
|
|
149
|
+
</svg>);
|
|
150
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// @refresh skip
|
|
2
|
+
import { createEffect, createSignal, ErrorBoundary, onCleanup, resetErrorBoundaries, Show, } from "solid-js";
|
|
3
|
+
import clientOnly from "../clientOnly.js";
|
|
4
|
+
import { HttpStatusCode } from "../HttpStatusCode.js";
|
|
5
|
+
const DevOverlayDialog = import.meta.env.PROD
|
|
6
|
+
? () => <></>
|
|
7
|
+
: clientOnly(() => import("./DevOverlayDialog"), { lazy: true });
|
|
8
|
+
export function DevOverlay(props) {
|
|
9
|
+
const [errors, setErrors] = createSignal([]);
|
|
10
|
+
function resetError() {
|
|
11
|
+
setErrors([]);
|
|
12
|
+
resetErrorBoundaries();
|
|
13
|
+
}
|
|
14
|
+
function pushError(error) {
|
|
15
|
+
console.error(error);
|
|
16
|
+
setErrors(current => [error, ...current]);
|
|
17
|
+
}
|
|
18
|
+
createEffect(() => {
|
|
19
|
+
const onErrorEvent = (error) => {
|
|
20
|
+
pushError(error.error ?? error);
|
|
21
|
+
};
|
|
22
|
+
window.addEventListener("error", onErrorEvent);
|
|
23
|
+
onCleanup(() => {
|
|
24
|
+
window.removeEventListener("error", onErrorEvent);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return (<>
|
|
28
|
+
<ErrorBoundary fallback={error => {
|
|
29
|
+
pushError(error);
|
|
30
|
+
return <HttpStatusCode code={500}/>;
|
|
31
|
+
}}>
|
|
32
|
+
{props.children}
|
|
33
|
+
</ErrorBoundary>
|
|
34
|
+
<Show when={errors().length}>
|
|
35
|
+
<HttpStatusCode code={500}/>
|
|
36
|
+
<DevOverlayDialog errors={errors()} resetError={resetError}/>
|
|
37
|
+
</Show>
|
|
38
|
+
</>);
|
|
39
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { lazy as solidLazy } from "solid-js";
|
|
2
|
+
import { getRequestEvent, isServer } from "solid-js/web";
|
|
3
|
+
import { getManifest } from "solid-start:get-manifest";
|
|
4
|
+
import { useAssets } from "../server/assets/index.js";
|
|
5
|
+
const assetsById = {};
|
|
6
|
+
const getAssets = async (id) => {
|
|
7
|
+
if (assetsById[id])
|
|
8
|
+
return assetsById[id];
|
|
9
|
+
const manifest = getManifest(import.meta.env.SSR && import.meta.env.DEV ? "ssr" : "client");
|
|
10
|
+
const assets = await manifest.getAssets(id);
|
|
11
|
+
if (import.meta.env.PROD)
|
|
12
|
+
assetsById[id] = assets;
|
|
13
|
+
return assets;
|
|
14
|
+
};
|
|
15
|
+
const withAssets = function (fn) {
|
|
16
|
+
const wrapper = async () => {
|
|
17
|
+
const mod = await fn();
|
|
18
|
+
// This id$$ export is generated by the lazy vite plugin
|
|
19
|
+
const id = mod.id$$;
|
|
20
|
+
if (!id)
|
|
21
|
+
return mod;
|
|
22
|
+
if (!mod.default) {
|
|
23
|
+
console.error(`Module ${id} does not export default`);
|
|
24
|
+
return { default: () => [] };
|
|
25
|
+
}
|
|
26
|
+
const assets = await getAssets(id);
|
|
27
|
+
if (!assets.length)
|
|
28
|
+
return mod;
|
|
29
|
+
return {
|
|
30
|
+
default: (props) => {
|
|
31
|
+
const { nonce } = getRequestEvent();
|
|
32
|
+
useAssets(assets, nonce);
|
|
33
|
+
return mod.default(props);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
return wrapper;
|
|
38
|
+
};
|
|
39
|
+
const lazy = !isServer
|
|
40
|
+
? solidLazy
|
|
41
|
+
: (fn) => solidLazy(withAssets(fn));
|
|
42
|
+
export default lazy;
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/start",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist",
|
|
7
|
+
"env.d.ts",
|
|
8
|
+
"CHANGELOG.md"
|
|
9
|
+
],
|
|
5
10
|
"repository": {
|
|
6
11
|
"type": "git",
|
|
7
12
|
"url": "git+https://github.com/solidjs/solid-start.git",
|
|
@@ -62,7 +67,7 @@
|
|
|
62
67
|
"vitest": "^4.1.0"
|
|
63
68
|
},
|
|
64
69
|
"peerDependencies": {
|
|
65
|
-
"vite": "^
|
|
70
|
+
"vite": "^8"
|
|
66
71
|
},
|
|
67
72
|
"scripts": {
|
|
68
73
|
"build": "pnpm validate-imports && tsc && node scripts/build.js",
|
package/scripts/build.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs/promises";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import glob from "fast-glob";
|
|
4
|
-
|
|
5
|
-
const files = await glob("**/*.{js,css}", { cwd: `${process.cwd()}/src` });
|
|
6
|
-
|
|
7
|
-
await Promise.all(
|
|
8
|
-
files.map(file =>
|
|
9
|
-
fs.cp(
|
|
10
|
-
path.join(import.meta.dirname, "../src", file),
|
|
11
|
-
path.join(import.meta.dirname, "../dist", file),
|
|
12
|
-
{ recursive: true },
|
|
13
|
-
),
|
|
14
|
-
),
|
|
15
|
-
);
|
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Import Extension Validation Script for SolidStart
|
|
5
|
-
*
|
|
6
|
-
* This script validates that all relative imports in the src/ directory have
|
|
7
|
-
* explicit file extensions, which is mandated by Node.js ESM (ES Modules).
|
|
8
|
-
*
|
|
9
|
-
* Node.js requires explicit file extensions for relative imports when using
|
|
10
|
-
* ES modules to avoid ambiguity and improve performance. This script ensures
|
|
11
|
-
* compliance with this requirement.
|
|
12
|
-
*
|
|
13
|
-
* Features:
|
|
14
|
-
* - Scans all .ts and .tsx files in the src/ directory recursively
|
|
15
|
-
* - Detects relative imports (starting with ./ or ../) without extensions
|
|
16
|
-
* - Prevents .js/.jsx imports in TypeScript files (should use .ts/.tsx)
|
|
17
|
-
* - Ignores commented code, CSS imports, and dynamic imports (handled by bundlers)
|
|
18
|
-
* - Provides detailed error reporting with line numbers and suggestions
|
|
19
|
-
* - Exits with appropriate status codes for CI/CD integration
|
|
20
|
-
*
|
|
21
|
-
* Usage:
|
|
22
|
-
* npm run validate-imports
|
|
23
|
-
*
|
|
24
|
-
* Exit codes:
|
|
25
|
-
* 0 - All relative imports have valid extensions
|
|
26
|
-
* 1 - Found relative imports without extensions
|
|
27
|
-
*
|
|
28
|
-
* Valid extensions for TypeScript files: .ts, .tsx, .json
|
|
29
|
-
* Invalid extensions for TypeScript files: .js, .jsx (use .ts/.tsx instead)
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* // ❌ Invalid - missing extension
|
|
33
|
-
* import { config } from "./config/index";
|
|
34
|
-
*
|
|
35
|
-
* // ❌ Invalid - .js extension in TypeScript file
|
|
36
|
-
* import { config } from "./config/index.js";
|
|
37
|
-
*
|
|
38
|
-
* // ✅ Valid - has .ts extension
|
|
39
|
-
* import { config } from "./config/index.ts";
|
|
40
|
-
*
|
|
41
|
-
* // ✅ Valid - external package import (no extension needed)
|
|
42
|
-
* import { something } from "external-package";
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
46
|
-
import { join, dirname, extname } from "node:path";
|
|
47
|
-
import { fileURLToPath } from "node:url";
|
|
48
|
-
|
|
49
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
50
|
-
const __dirname = dirname(__filename);
|
|
51
|
-
|
|
52
|
-
// Configuration
|
|
53
|
-
const SRC_DIR = join(__dirname, "..", "src");
|
|
54
|
-
const VALID_EXTENSIONS = [".ts", ".tsx", ".json"];
|
|
55
|
-
const INVALID_EXTENSIONS = [".js", ".jsx"];
|
|
56
|
-
const FILE_EXTENSIONS = [".ts", ".tsx"];
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Recursively find all files with specified extensions
|
|
60
|
-
*/
|
|
61
|
-
function findFiles(dir, extensions, files = []) {
|
|
62
|
-
try {
|
|
63
|
-
const entries = readdirSync(dir);
|
|
64
|
-
|
|
65
|
-
for (const entry of entries) {
|
|
66
|
-
const fullPath = join(dir, entry);
|
|
67
|
-
const stat = statSync(fullPath);
|
|
68
|
-
|
|
69
|
-
if (stat.isDirectory()) {
|
|
70
|
-
findFiles(fullPath, extensions, files);
|
|
71
|
-
} else if (extensions.includes(extname(entry))) {
|
|
72
|
-
files.push(fullPath);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
} catch (error) {
|
|
76
|
-
console.error(`Error reading directory ${dir}: ${error.message}`);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return files;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Check if a path is a relative import (starts with . or ..)
|
|
84
|
-
*/
|
|
85
|
-
function isRelativeImport(path) {
|
|
86
|
-
return path.startsWith("./") || path.startsWith("../");
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Check if an import path has a valid file extension
|
|
91
|
-
*/
|
|
92
|
-
function hasValidExtension(path) {
|
|
93
|
-
return VALID_EXTENSIONS.some(ext => path.endsWith(ext));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Check if an import path has an invalid extension for TypeScript files
|
|
98
|
-
*/
|
|
99
|
-
function hasInvalidExtension(path) {
|
|
100
|
-
return INVALID_EXTENSIONS.some(ext => path.endsWith(ext));
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Extract import/export statements from file content
|
|
105
|
-
* Matches both import and export statements with from clauses
|
|
106
|
-
*/
|
|
107
|
-
function extractImportExportStatements(content, filePath) {
|
|
108
|
-
const statements = [];
|
|
109
|
-
const lines = content.split("\n");
|
|
110
|
-
|
|
111
|
-
// Regex patterns for different import/export statements
|
|
112
|
-
const patterns = [
|
|
113
|
-
// Standard imports: import { ... } from '...'
|
|
114
|
-
/import\s+(?:(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)\s+from\s+)?['"`]([^'"`]+)['"`]/g,
|
|
115
|
-
// Export from: export { ... } from '...'
|
|
116
|
-
/export\s+(?:\{[^}]*\}|\*)\s+from\s+['"`]([^'"`]+)['"`]/g,
|
|
117
|
-
// Export default from: export { default } from '...'
|
|
118
|
-
/export\s+\{\s*default\s*\}\s+from\s+['"`]([^'"`]+)['"`]/g,
|
|
119
|
-
// Note: Dynamic imports are excluded as they're handled by bundlers
|
|
120
|
-
];
|
|
121
|
-
|
|
122
|
-
lines.forEach((line, lineNumber) => {
|
|
123
|
-
const trimmedLine = line.trim();
|
|
124
|
-
|
|
125
|
-
// Skip commented lines, dynamic imports, and TypeScript type-only imports in d.ts files
|
|
126
|
-
if (
|
|
127
|
-
trimmedLine.startsWith("//") ||
|
|
128
|
-
trimmedLine.startsWith("/*") ||
|
|
129
|
-
trimmedLine.startsWith("*") ||
|
|
130
|
-
(filePath.endsWith(".d.ts") && trimmedLine.includes("import(")) ||
|
|
131
|
-
// Skip CSS imports as they're handled by bundlers
|
|
132
|
-
/import\s+['"`][^'"`]*\.css['"`]/.test(trimmedLine) ||
|
|
133
|
-
// Skip dynamic imports as they're handled by bundlers
|
|
134
|
-
/import\s*\(\s*['"`]/.test(trimmedLine)
|
|
135
|
-
) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
patterns.forEach(pattern => {
|
|
140
|
-
let match;
|
|
141
|
-
// Reset regex lastIndex to avoid issues with global flag
|
|
142
|
-
pattern.lastIndex = 0;
|
|
143
|
-
while ((match = pattern.exec(line)) !== null) {
|
|
144
|
-
const importPath = match[1];
|
|
145
|
-
if (importPath) {
|
|
146
|
-
statements.push({
|
|
147
|
-
path: importPath,
|
|
148
|
-
line: lineNumber + 1,
|
|
149
|
-
fullLine: line.trim(),
|
|
150
|
-
filePath,
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
return statements;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Validate a single file for relative imports without extensions
|
|
162
|
-
*/
|
|
163
|
-
function validateFile(filePath) {
|
|
164
|
-
const errors = [];
|
|
165
|
-
|
|
166
|
-
try {
|
|
167
|
-
const content = readFileSync(filePath, "utf8");
|
|
168
|
-
const statements = extractImportExportStatements(content, filePath);
|
|
169
|
-
|
|
170
|
-
statements.forEach(statement => {
|
|
171
|
-
if (isRelativeImport(statement.path)) {
|
|
172
|
-
if (hasInvalidExtension(statement.path)) {
|
|
173
|
-
errors.push({
|
|
174
|
-
file: filePath,
|
|
175
|
-
line: statement.line,
|
|
176
|
-
importPath: statement.path,
|
|
177
|
-
fullLine: statement.fullLine,
|
|
178
|
-
type: "invalid-extension",
|
|
179
|
-
});
|
|
180
|
-
} else if (!hasValidExtension(statement.path)) {
|
|
181
|
-
errors.push({
|
|
182
|
-
file: filePath,
|
|
183
|
-
line: statement.line,
|
|
184
|
-
importPath: statement.path,
|
|
185
|
-
fullLine: statement.fullLine,
|
|
186
|
-
type: "missing-extension",
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
} catch (error) {
|
|
192
|
-
console.error(`Error reading file ${filePath}: ${error.message}`);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return errors;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Main validation function
|
|
200
|
-
*/
|
|
201
|
-
function validateImports() {
|
|
202
|
-
console.log("🔍 Validating relative imports in src/ directory...\n");
|
|
203
|
-
|
|
204
|
-
// Find all TypeScript/TSX files in src directory
|
|
205
|
-
const files = findFiles(SRC_DIR, FILE_EXTENSIONS);
|
|
206
|
-
|
|
207
|
-
if (files.length === 0) {
|
|
208
|
-
console.log("⚠️ No TypeScript files found in src/ directory");
|
|
209
|
-
process.exit(0);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
console.log(`📁 Scanning ${files.length} files...\n`);
|
|
213
|
-
|
|
214
|
-
let totalErrors = 0;
|
|
215
|
-
const errorsByFile = new Map();
|
|
216
|
-
|
|
217
|
-
// Validate each file
|
|
218
|
-
files.forEach(file => {
|
|
219
|
-
const errors = validateFile(file);
|
|
220
|
-
if (errors.length > 0) {
|
|
221
|
-
errorsByFile.set(file, errors);
|
|
222
|
-
totalErrors += errors.length;
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
// Report results
|
|
227
|
-
if (totalErrors === 0) {
|
|
228
|
-
console.log("✅ All relative imports have valid extensions!");
|
|
229
|
-
process.exit(0);
|
|
230
|
-
} else {
|
|
231
|
-
const missingExtensionErrors = [];
|
|
232
|
-
const invalidExtensionErrors = [];
|
|
233
|
-
|
|
234
|
-
errorsByFile.forEach(errors => {
|
|
235
|
-
errors.forEach(error => {
|
|
236
|
-
if (error.type === "missing-extension") {
|
|
237
|
-
missingExtensionErrors.push(error);
|
|
238
|
-
} else if (error.type === "invalid-extension") {
|
|
239
|
-
invalidExtensionErrors.push(error);
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
if (missingExtensionErrors.length > 0) {
|
|
245
|
-
console.log(
|
|
246
|
-
`❌ Found ${missingExtensionErrors.length} relative import(s) without extensions:\n`,
|
|
247
|
-
);
|
|
248
|
-
|
|
249
|
-
const missingByFile = new Map();
|
|
250
|
-
missingExtensionErrors.forEach(error => {
|
|
251
|
-
if (!missingByFile.has(error.file)) {
|
|
252
|
-
missingByFile.set(error.file, []);
|
|
253
|
-
}
|
|
254
|
-
missingByFile.get(error.file).push(error);
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
missingByFile.forEach((errors, file) => {
|
|
258
|
-
const relativePath = file.replace(process.cwd(), "").replace(/^\//, "");
|
|
259
|
-
console.log(`📄 ${relativePath}:`);
|
|
260
|
-
|
|
261
|
-
errors.forEach(error => {
|
|
262
|
-
console.log(` Line ${error.line}: ${error.importPath}`);
|
|
263
|
-
console.log(` ${error.fullLine}`);
|
|
264
|
-
console.log(
|
|
265
|
-
` ${"".padStart(error.fullLine.indexOf(error.importPath), " ")}${"".padStart(error.importPath.length, "^")}`,
|
|
266
|
-
);
|
|
267
|
-
});
|
|
268
|
-
console.log("");
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
if (invalidExtensionErrors.length > 0) {
|
|
273
|
-
console.log(
|
|
274
|
-
`❌ Found ${invalidExtensionErrors.length} relative import(s) with invalid extensions:\n`,
|
|
275
|
-
);
|
|
276
|
-
|
|
277
|
-
const invalidByFile = new Map();
|
|
278
|
-
invalidExtensionErrors.forEach(error => {
|
|
279
|
-
if (!invalidByFile.has(error.file)) {
|
|
280
|
-
invalidByFile.set(error.file, []);
|
|
281
|
-
}
|
|
282
|
-
invalidByFile.get(error.file).push(error);
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
invalidByFile.forEach((errors, file) => {
|
|
286
|
-
const relativePath = file.replace(process.cwd(), "").replace(/^\//, "");
|
|
287
|
-
console.log(`📄 ${relativePath}:`);
|
|
288
|
-
|
|
289
|
-
errors.forEach(error => {
|
|
290
|
-
console.log(` Line ${error.line}: ${error.importPath}`);
|
|
291
|
-
console.log(` ${error.fullLine}`);
|
|
292
|
-
console.log(
|
|
293
|
-
` ${"".padStart(error.fullLine.indexOf(error.importPath), " ")}${"".padStart(error.importPath.length, "^")}`,
|
|
294
|
-
);
|
|
295
|
-
});
|
|
296
|
-
console.log("");
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
console.log("💡 Tips:");
|
|
301
|
-
if (missingExtensionErrors.length > 0) {
|
|
302
|
-
console.log(' - Add file extensions to relative imports (e.g., "./file" → "./file.ts")');
|
|
303
|
-
}
|
|
304
|
-
if (invalidExtensionErrors.length > 0) {
|
|
305
|
-
console.log(" - Replace .js/.jsx with .ts/.tsx in TypeScript files");
|
|
306
|
-
}
|
|
307
|
-
console.log(" - This is required by Node.js ESM modules");
|
|
308
|
-
console.log(" - Valid extensions for TypeScript files: " + VALID_EXTENSIONS.join(", "));
|
|
309
|
-
console.log(" - Invalid extensions for TypeScript files: " + INVALID_EXTENSIONS.join(", "));
|
|
310
|
-
|
|
311
|
-
process.exit(1);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
// Run the validation
|
|
316
|
-
validateImports();
|
package/src/client/mount.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { hydrate as mount } from "solid-js/web"
|
package/src/client/spa/index.tsx
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// @refresh skip
|
|
2
|
-
import type { JSX } from "solid-js";
|
|
3
|
-
import { render, type MountableElement } from "solid-js/web";
|
|
4
|
-
|
|
5
|
-
export function mount(fn: () => JSX.Element, el: MountableElement) {
|
|
6
|
-
render(fn, el);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export { StartClient } from "../StartClient.tsx";
|