@solidjs/start 2.0.0-alpha.2 → 2.0.0-alpha.3
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 +19 -0
- package/dist/config/constants.d.ts +1 -1
- package/dist/config/constants.js +1 -1
- package/dist/config/dev-server.js +9 -1
- package/dist/config/env.d.ts +19 -0
- package/dist/config/env.js +81 -0
- package/dist/config/fs-routes/fs-watcher.js +14 -20
- package/dist/config/fs-routes/index.js +2 -2
- package/dist/config/fs-routes/router.js +2 -2
- package/dist/config/index.d.ts +16 -1
- package/dist/config/index.js +25 -27
- package/dist/config/lazy.js +2 -2
- package/dist/config/manifest.js +37 -4
- package/dist/config/vite-utils.d.ts +1 -1
- 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 +169 -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 +53 -0
- package/dist/directives/types.d.ts +10 -0
- package/dist/directives/xxhash32.d.ts +6 -0
- package/dist/directives/xxhash32.js +193 -0
- package/dist/{server/server-runtime.d.ts → fns/client.d.ts} +1 -1
- package/dist/fns/client.js +106 -0
- package/dist/fns/handler.d.ts +5 -0
- package/dist/{server/server-functions-handler.js → fns/handler.js} +55 -96
- 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/{server/server-fns-runtime.js → fns/server.js} +7 -1
- package/dist/fns/shared.d.ts +17 -0
- package/dist/fns/shared.js +105 -0
- package/dist/http/index.d.ts +1 -1
- package/dist/middleware/index.d.ts +17 -0
- package/dist/middleware/index.js +15 -0
- package/dist/server/handler.d.ts +61 -3
- package/dist/server/handler.js +17 -15
- package/dist/server/spa/handler.d.ts +30 -1
- package/dist/server/types.d.ts +1 -1
- package/dist/shared/dev-overlay/CodeView.jsx +4 -4
- package/dist/shared/dev-overlay/DevOverlayDialog.jsx +34 -34
- package/dist/shared/dev-overlay/index.jsx +2 -2
- package/dist/shared/dev-overlay/styles.css +40 -40
- package/package.json +27 -20
- package/src/config/constants.ts +1 -1
- package/src/config/env.ts +105 -0
- package/src/config/fs-routes/fs-watcher.ts +17 -24
- package/src/config/fs-routes/index.ts +2 -2
- package/src/config/fs-routes/router.ts +2 -2
- package/src/config/index.ts +39 -37
- package/src/config/lazy.ts +2 -2
- package/src/config/manifest.ts +37 -7
- package/src/config/vite-utils.ts +1 -1
- package/src/directives/bubble-function-declaration.ts +33 -0
- package/src/directives/compile.ts +54 -0
- package/src/directives/generate-unique-name.ts +22 -0
- package/src/directives/get-descriptive-name.ts +39 -0
- package/src/directives/get-import-identifier.ts +34 -0
- package/src/directives/get-root-statement-path.ts +14 -0
- package/src/directives/index.ts +232 -0
- package/src/directives/is-statement-top-level.ts +13 -0
- package/src/directives/paths.ts +63 -0
- package/src/directives/plugin.ts +389 -0
- package/src/directives/remove-unused-variables.ts +55 -0
- package/src/directives/types.ts +12 -0
- package/src/directives/xxhash32.ts +214 -0
- package/src/env.d.ts +1 -1
- package/src/fns/client.ts +141 -0
- package/src/fns/handler.spec.ts +85 -0
- package/src/{server/server-functions-handler.ts → fns/handler.ts} +65 -117
- package/src/fns/registration.ts +19 -0
- package/src/fns/serialization.ts +250 -0
- package/src/{server/server-fns-runtime.ts → fns/server.ts} +17 -2
- package/src/fns/shared.ts +116 -0
- package/src/middleware/index.ts +17 -0
- package/src/server/handler.ts +18 -16
- package/src/server/types.ts +1 -1
- package/src/shared/dev-overlay/CodeView.tsx +5 -7
- package/src/shared/dev-overlay/DevOverlayDialog.tsx +34 -34
- package/src/shared/dev-overlay/get-source-map.ts +1 -1
- package/src/shared/dev-overlay/index.tsx +4 -4
- package/src/shared/dev-overlay/styles.css +40 -40
- package/tsconfig.json +1 -0
- package/dist/server/fetchEvent.spec.js +0 -65
- package/dist/server/server-fns-runtime.d.ts +0 -1
- package/dist/server/server-functions-handler.d.ts +0 -2
- package/dist/server/server-runtime.js +0 -194
- package/src/server/server-runtime.ts +0 -240
- /package/dist/{server/fetchEvent.spec.d.ts → directives/types.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @refresh skip
|
|
2
2
|
import ErrorStackParser from "error-stack-parser";
|
|
3
3
|
import * as htmlToImage from "html-to-image";
|
|
4
|
-
import { ErrorBoundary, For, Show, Suspense
|
|
4
|
+
import { createMemo, createSignal, ErrorBoundary, For, Show, Suspense } from "solid-js";
|
|
5
5
|
import { Portal } from "solid-js/web";
|
|
6
6
|
// @ts-ignore - terracotta module resolution issue with NodeNext
|
|
7
7
|
import { Dialog, DialogOverlay, DialogPanel, Select, SelectOption } from "terracotta";
|
|
@@ -25,9 +25,9 @@ function ErrorInfo(props) {
|
|
|
25
25
|
}
|
|
26
26
|
return { message: e.toString() };
|
|
27
27
|
});
|
|
28
|
-
return (<span
|
|
29
|
-
<span
|
|
30
|
-
<span
|
|
28
|
+
return (<span data-start-dev-overlay-error-info>
|
|
29
|
+
<span data-start-dev-overlay-error-info-name>{error().name}</span>
|
|
30
|
+
<span data-start-dev-overlay-error-info-message>{error().message}</span>
|
|
31
31
|
</span>);
|
|
32
32
|
}
|
|
33
33
|
function getFileName(source) {
|
|
@@ -46,23 +46,23 @@ function getFilePath(source) {
|
|
|
46
46
|
return `${getFileName(source.source)}${line}${column}`;
|
|
47
47
|
}
|
|
48
48
|
function CodeFallback() {
|
|
49
|
-
return (<div
|
|
49
|
+
return (<div data-start-dev-overlay-stack-frames-code-fallback>
|
|
50
50
|
<span>Source not available.</span>
|
|
51
51
|
</div>);
|
|
52
52
|
}
|
|
53
53
|
function StackFramesContent(props) {
|
|
54
54
|
const stackframes = ErrorStackParser.parse(props.error);
|
|
55
55
|
const [selectedFrame, setSelectedFrame] = createSignal(stackframes[0]);
|
|
56
|
-
return (<div
|
|
57
|
-
<div
|
|
56
|
+
return (<div data-start-dev-overlay-stack-frames-content>
|
|
57
|
+
<div data-start-dev-overlay-stack-frames-code>
|
|
58
58
|
<ErrorBoundary fallback={null}>
|
|
59
59
|
{(() => {
|
|
60
60
|
const data = createStackFrame(selectedFrame(), () => props.isCompiled);
|
|
61
61
|
return (<Suspense fallback={<CodeFallback />}>
|
|
62
62
|
<Show when={data()} keyed fallback={<CodeFallback />}>
|
|
63
63
|
{source => (<>
|
|
64
|
-
<span
|
|
65
|
-
<div
|
|
64
|
+
<span data-start-dev-overlay-stack-frames-code-source>{source.source}</span>
|
|
65
|
+
<div data-start-dev-overlay-stack-frames-code-container>
|
|
66
66
|
<CodeView fileName={source.source} line={source.line} content={source.content}/>
|
|
67
67
|
</div>
|
|
68
68
|
</>)}
|
|
@@ -71,13 +71,13 @@ function StackFramesContent(props) {
|
|
|
71
71
|
})()}
|
|
72
72
|
</ErrorBoundary>
|
|
73
73
|
</div>
|
|
74
|
-
<Select
|
|
74
|
+
<Select data-start-dev-overlay-stack-frames value={selectedFrame()} onChange={setSelectedFrame}>
|
|
75
75
|
<For each={stackframes}>
|
|
76
|
-
{current => (<ErrorBoundary fallback={<div
|
|
77
|
-
<span
|
|
76
|
+
{current => (<ErrorBoundary fallback={<div data-start-dev-overlay-stack-frame>
|
|
77
|
+
<span data-start-dev-overlay-stack-frame-function>
|
|
78
78
|
{current.functionName ?? "<anonymous>"}
|
|
79
79
|
</span>
|
|
80
|
-
<span
|
|
80
|
+
<span data-start-dev-overlay-stack-frame-file>
|
|
81
81
|
{getFilePath({
|
|
82
82
|
source: current.getFileName(),
|
|
83
83
|
content: "",
|
|
@@ -91,11 +91,11 @@ function StackFramesContent(props) {
|
|
|
91
91
|
const data = createStackFrame(current, () => props.isCompiled);
|
|
92
92
|
return (<Suspense>
|
|
93
93
|
<Show when={data()} keyed>
|
|
94
|
-
{source => (<SelectOption
|
|
95
|
-
<span
|
|
94
|
+
{source => (<SelectOption data-start-dev-overlay-stack-frame value={current}>
|
|
95
|
+
<span data-start-dev-overlay-stack-frame-function>
|
|
96
96
|
{source.name ?? "<anonymous>"}
|
|
97
97
|
</span>
|
|
98
|
-
<span
|
|
98
|
+
<span data-start-dev-overlay-stack-frame-file>{getFilePath(source)}</span>
|
|
99
99
|
</SelectOption>)}
|
|
100
100
|
</Show>
|
|
101
101
|
</Suspense>);
|
|
@@ -165,55 +165,55 @@ export default function DevOverlayDialog(props) {
|
|
|
165
165
|
window.open(DISCORD_INVITE, "_blank").focus();
|
|
166
166
|
}
|
|
167
167
|
return (<Portal>
|
|
168
|
-
<Dialog
|
|
168
|
+
<Dialog data-start-dev-overlay isOpen>
|
|
169
169
|
<div>
|
|
170
|
-
<DialogOverlay
|
|
171
|
-
<DialogPanel ref={setPanel}
|
|
172
|
-
<div
|
|
173
|
-
<div
|
|
174
|
-
<div
|
|
175
|
-
<div
|
|
170
|
+
<DialogOverlay data-start-dev-overlay-background/>
|
|
171
|
+
<DialogPanel ref={setPanel} data-start-dev-overlay-panel-container>
|
|
172
|
+
<div data-start-dev-overlay-panel>
|
|
173
|
+
<div data-start-dev-overlay-navbar>
|
|
174
|
+
<div data-start-dev-overlay-navbar-left>
|
|
175
|
+
<div data-start-dev-overlay-version>
|
|
176
176
|
<div>
|
|
177
177
|
<SolidStartIcon title="Solid Start Version"/>
|
|
178
178
|
</div>
|
|
179
179
|
<span>{info.version}</span>
|
|
180
180
|
</div>
|
|
181
181
|
<Show when={props.errors.length > 1}>
|
|
182
|
-
<div
|
|
183
|
-
<button
|
|
182
|
+
<div data-start-dev-overlay-pagination>
|
|
183
|
+
<button data-start-dev-overlay-button onClick={goPrev} type="button">
|
|
184
184
|
<ArrowLeftIcon title="Go Previous"/>
|
|
185
185
|
</button>
|
|
186
|
-
<div
|
|
186
|
+
<div data-start-dev-overlay-page-counter>
|
|
187
187
|
{`${truncated()} of ${props.errors.length}`}
|
|
188
188
|
</div>
|
|
189
|
-
<button
|
|
189
|
+
<button data-start-dev-overlay-button onClick={goNext} type="button">
|
|
190
190
|
<ArrowRightIcon title="Go Next"/>
|
|
191
191
|
</button>
|
|
192
192
|
</div>
|
|
193
193
|
</Show>
|
|
194
194
|
</div>
|
|
195
|
-
<div
|
|
196
|
-
<button
|
|
195
|
+
<div data-start-dev-overlay-controls>
|
|
196
|
+
<button data-start-dev-overlay-button onClick={redirectToGithub} type="button">
|
|
197
197
|
<GithubIcon title="Create an issue thread on Github"/>
|
|
198
198
|
</button>
|
|
199
|
-
<button
|
|
199
|
+
<button data-start-dev-overlay-button onClick={redirectToDiscord} type="button">
|
|
200
200
|
<DiscordIcon title="Join our Discord Channel"/>
|
|
201
201
|
</button>
|
|
202
|
-
<button
|
|
202
|
+
<button data-start-dev-overlay-button onClick={downloadScreenshot} type="button">
|
|
203
203
|
<CameraIcon title="Capture Error Overlay"/>
|
|
204
204
|
</button>
|
|
205
|
-
<button
|
|
205
|
+
<button data-start-dev-overlay-button onClick={toggleIsCompiled} type="button">
|
|
206
206
|
<Show when={isCompiled()} fallback={<ViewOriginalIcon title="View Original Source"/>}>
|
|
207
207
|
<ViewCompiledIcon title="View Compiled Source"/>
|
|
208
208
|
</Show>
|
|
209
209
|
</button>
|
|
210
|
-
<button
|
|
210
|
+
<button data-start-dev-overlay-button onClick={props.resetError} type="button">
|
|
211
211
|
<RefreshIcon title="Reset Error"/>
|
|
212
212
|
</button>
|
|
213
213
|
</div>
|
|
214
214
|
</div>
|
|
215
215
|
<Show when={props.errors[truncated() - 1]} keyed>
|
|
216
|
-
{current => (<div
|
|
216
|
+
{current => (<div data-start-dev-overlay-content>
|
|
217
217
|
<ErrorInfo error={current}/>
|
|
218
218
|
<StackFrames error={current} isCompiled={isCompiled()}/>
|
|
219
219
|
</div>)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @refresh skip
|
|
2
|
-
import {
|
|
3
|
-
import { HttpStatusCode } from "../HttpStatusCode.js";
|
|
2
|
+
import { createEffect, createSignal, ErrorBoundary, onCleanup, resetErrorBoundaries, Show, } from "solid-js";
|
|
4
3
|
import clientOnly from "../clientOnly.js";
|
|
4
|
+
import { HttpStatusCode } from "../HttpStatusCode.js";
|
|
5
5
|
const DevOverlayDialog = import.meta.env.PROD
|
|
6
6
|
? () => <></>
|
|
7
7
|
: clientOnly(() => import("./DevOverlayDialog"), { lazy: true });
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
[data-start-dev-overlay] {
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0px;
|
|
4
4
|
z-index: 50;
|
|
5
5
|
overflow-y: auto;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
[data-start-dev-overlay]>div {
|
|
9
9
|
position: relative;
|
|
10
10
|
display: flex;
|
|
11
11
|
align-items: center;
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
min-height: 100vh;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
[data-start-dev-overlay-background] {
|
|
17
17
|
position: absolute;
|
|
18
18
|
inset: 0px;
|
|
19
19
|
background-color: rgb(17 24 39 / 0.5);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
[data-start-dev-overlay-panel] {
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
25
|
width: 75vw;
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
[data-start-dev-overlay-panel-container] {
|
|
34
34
|
margin: 2rem;
|
|
35
35
|
z-index: 10;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
[data-start-dev-overlay-navbar] {
|
|
39
39
|
display: flex;
|
|
40
40
|
flex-direction: row;
|
|
41
41
|
align-items: center;
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
gap: 0.5rem;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
[data-start-dev-overlay-pagination] {
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-direction: row;
|
|
49
49
|
align-items: center;
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
padding: 0.25rem;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
[data-start-dev-overlay-button] {
|
|
58
58
|
display: flex;
|
|
59
59
|
padding: 0.125rem;
|
|
60
60
|
border-radius: 9999px;
|
|
@@ -68,44 +68,44 @@
|
|
|
68
68
|
transition-duration: 150ms;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
[data-start-dev-overlay-button]:hover {
|
|
72
72
|
background-color: rgb(229 231 235);
|
|
73
73
|
color: rgb(55 65 81);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
[data-start-dev-overlay-button]:focus {
|
|
77
77
|
outline: 2px solid transparent;
|
|
78
78
|
outline-offset: 2px
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
[data-start-dev-overlay-button]:focus-visible {
|
|
82
82
|
box-shadow: 0 0 0 calc(3px) rgb(17 24 39 / 0.75);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
[data-start-dev-overlay-button]:active {
|
|
86
86
|
background-color: rgb(243 244 246);
|
|
87
87
|
color: rgb(31 41 55);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
[data-start-dev-overlay-button]>svg {
|
|
91
91
|
height: 1.5rem;
|
|
92
92
|
width: 1.5rem;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
[data-start-dev-overlay-page-counter] {
|
|
96
96
|
font-size: 0.875rem;
|
|
97
97
|
line-height: 1.25rem;
|
|
98
98
|
font-weight: 600;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
[data-start-dev-overlay-navbar-left] {
|
|
102
102
|
display: flex;
|
|
103
103
|
flex-direction: row;
|
|
104
104
|
gap: 0.5rem;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
[data-start-dev-overlay-controls] {
|
|
109
109
|
display: flex;
|
|
110
110
|
flex-direction: row;
|
|
111
111
|
align-items: center;
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
padding: 0.25rem;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
[data-start-dev-overlay-version] {
|
|
120
120
|
display: flex;
|
|
121
121
|
flex-direction: row;
|
|
122
122
|
align-items: center;
|
|
@@ -130,17 +130,17 @@
|
|
|
130
130
|
font-weight: 600;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
[data-start-dev-overlay-version]>div {
|
|
134
134
|
height: 1.5rem;
|
|
135
135
|
width: 1.5rem;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
[data-start-dev-overlay-version]>div>svg {
|
|
139
139
|
height: 1.5rem;
|
|
140
140
|
width: 1.5rem;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
[data-start-dev-overlay-content] {
|
|
144
144
|
display: flex;
|
|
145
145
|
flex-direction: column;
|
|
146
146
|
gap: 0.75rem;
|
|
@@ -149,30 +149,30 @@
|
|
|
149
149
|
padding: 1rem;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
[data-start-dev-overlay-error-info] {
|
|
153
153
|
display: flex;
|
|
154
154
|
flex-direction: column;
|
|
155
155
|
gap: 0.25rem;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
[data-start-dev-overlay-error-info-name] {
|
|
159
159
|
font-weight: 700;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
[data-start-dev-overlay-error-info-message] {
|
|
163
163
|
font-size: 1.5rem;
|
|
164
164
|
line-height: 2rem;
|
|
165
165
|
color: rgb(239 68 68);
|
|
166
166
|
font-weight: 700;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
[data-start-dev-overlay-stack-frames-content] {
|
|
170
170
|
display: flex;
|
|
171
171
|
flex-direction: column;
|
|
172
172
|
gap: 0.75rem;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
[data-start-dev-overlay-stack-frames] {
|
|
176
176
|
flex: 1 1 0%;
|
|
177
177
|
display: flex;
|
|
178
178
|
flex-direction: column;
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
border-radius: 0.5rem;
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
[data-start-dev-overlay-stack-frame] {
|
|
189
189
|
display: flex;
|
|
190
190
|
flex-direction: row;
|
|
191
191
|
align-items: center;
|
|
@@ -203,18 +203,18 @@
|
|
|
203
203
|
outline: none;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
[data-start-dev-overlay-stack-frame][tc-active],
|
|
207
|
+
[data-start-dev-overlay-stack-frame][tc-selected],
|
|
208
|
+
[data-start-dev-overlay-stack-frame]:focus {
|
|
209
209
|
background-color: rgb(219 234 254);
|
|
210
210
|
color: rgb(30 58 138);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
|
|
213
|
+
[data-start-dev-overlay-stack-frame-function] {
|
|
214
214
|
font-weight: 700;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
[data-start-dev-overlay-stack-frame-file] {
|
|
218
218
|
white-space: nowrap;
|
|
219
219
|
font-size: 0.75rem;
|
|
220
220
|
/* 12px */
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
/* 16px */
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
[data-start-dev-overlay-stack-frames-code] {
|
|
226
226
|
padding: 0.5rem 1rem;
|
|
227
227
|
gap: 0.25rem;
|
|
228
228
|
flex: 1 1 0%;
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
background-color: rgb(17 24 39);
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
|
|
237
|
+
[data-start-dev-overlay-stack-frames-code-fallback] {
|
|
238
238
|
display: flex;
|
|
239
239
|
align-items: center;
|
|
240
240
|
justify-content: center;
|
|
@@ -244,13 +244,13 @@
|
|
|
244
244
|
line-height: 1.25rem;
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
|
|
247
|
+
[data-start-dev-overlay-stack-frames-code-source] {
|
|
248
248
|
font-size: 0.875rem;
|
|
249
249
|
line-height: 1.25rem;
|
|
250
250
|
color: rgb(249 250 251);
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
|
|
253
|
+
[data-start-dev-overlay-stack-frames-code-container] {
|
|
254
254
|
width: 100%;
|
|
255
255
|
overflow: hidden;
|
|
256
256
|
min-width: 100%;
|
|
@@ -260,13 +260,13 @@
|
|
|
260
260
|
border-top-color: rgb(249 250 251);
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
|
|
263
|
+
[data-start-dev-overlay-code-view] {
|
|
264
264
|
overflow: auto;
|
|
265
265
|
min-width: 100%;
|
|
266
266
|
min-height: 16rem;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
|
|
269
|
+
[data-start-dev-overlay-code-view]>.shiki {
|
|
270
270
|
float: left;
|
|
271
271
|
min-width: 100%;
|
|
272
272
|
overflow-x: auto;
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
background-color: transparent !important;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
|
|
280
|
+
[data-start-dev-overlay-code-view]>.shiki .line::before {
|
|
281
281
|
content: counter(step);
|
|
282
282
|
counter-increment: step;
|
|
283
283
|
width: 1rem;
|
|
@@ -287,6 +287,6 @@
|
|
|
287
287
|
color: rgba(115, 138, 148, .4)
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
|
|
290
|
+
[data-start-dev-overlay-error-line] {
|
|
291
291
|
background-color: rgba(239, 68, 68, .4);
|
|
292
|
-
}
|
|
292
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/start",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/solidjs/solid-start.git",
|
|
8
|
+
"directory": "packages/start"
|
|
9
|
+
},
|
|
5
10
|
"exports": {
|
|
6
11
|
".": "./dist/index.jsx",
|
|
7
12
|
"./config": "./dist/config/index.js",
|
|
@@ -12,47 +17,49 @@
|
|
|
12
17
|
"./client/spa": "./dist/client/spa/index.jsx",
|
|
13
18
|
"./middleware": "./dist/middleware/index.js",
|
|
14
19
|
"./http": "./dist/http/index.js",
|
|
15
|
-
"./env": "./env.d.ts"
|
|
20
|
+
"./env": "./env.d.ts",
|
|
21
|
+
"./fns/server": "./dist/fns/server.js",
|
|
22
|
+
"./fns/client": "./dist/fns/client.js"
|
|
16
23
|
},
|
|
17
24
|
"publishConfig": {
|
|
18
25
|
"access": "public"
|
|
19
26
|
},
|
|
20
27
|
"dependencies": {
|
|
21
|
-
"@babel/core": "^7.
|
|
22
|
-
"@babel/traverse": "^7.
|
|
23
|
-
"@babel/types": "^7.
|
|
28
|
+
"@babel/core": "^7.29.0",
|
|
29
|
+
"@babel/traverse": "^7.29.0",
|
|
30
|
+
"@babel/types": "^7.29.0",
|
|
24
31
|
"@solidjs/meta": "^0.29.4",
|
|
25
|
-
"@tanstack/server-functions-plugin": "1.134.5",
|
|
26
32
|
"@types/babel__traverse": "^7.28.0",
|
|
27
|
-
"@types/micromatch": "^4.0.
|
|
33
|
+
"@types/micromatch": "^4.0.10",
|
|
28
34
|
"cookie-es": "^2.0.0",
|
|
29
35
|
"defu": "^6.1.4",
|
|
30
36
|
"error-stack-parser": "^2.1.4",
|
|
31
|
-
"es-module-lexer": "^
|
|
32
|
-
"esbuild": "^0.
|
|
37
|
+
"es-module-lexer": "^2.0.0",
|
|
38
|
+
"esbuild": "^0.27.4",
|
|
33
39
|
"fast-glob": "^3.3.3",
|
|
34
|
-
"h3": "
|
|
40
|
+
"h3": "2.0.1-rc.16",
|
|
35
41
|
"html-to-image": "^1.11.13",
|
|
36
42
|
"micromatch": "^4.0.8",
|
|
37
|
-
"path-to-regexp": "^8.
|
|
43
|
+
"path-to-regexp": "^8.3.0",
|
|
38
44
|
"pathe": "^2.0.3",
|
|
39
45
|
"radix3": "^1.1.2",
|
|
40
|
-
"seroval": "^1.4
|
|
41
|
-
"seroval-plugins": "^1.
|
|
42
|
-
"shiki": "^1.
|
|
43
|
-
"solid-js": "^1.9.
|
|
46
|
+
"seroval": "^1.5.4",
|
|
47
|
+
"seroval-plugins": "^1.5.1",
|
|
48
|
+
"shiki": "^1.29.2",
|
|
49
|
+
"solid-js": "^1.9.11",
|
|
44
50
|
"source-map-js": "^1.2.1",
|
|
45
|
-
"srvx": "^0.9
|
|
46
|
-
"terracotta": "^1.0
|
|
47
|
-
"vite-plugin-solid": "^2.11.
|
|
51
|
+
"srvx": "^0.11.9",
|
|
52
|
+
"terracotta": "^1.1.0",
|
|
53
|
+
"vite-plugin-solid": "^2.11.11"
|
|
48
54
|
},
|
|
49
55
|
"engines": {
|
|
50
56
|
"node": ">=22"
|
|
51
57
|
},
|
|
52
58
|
"devDependencies": {
|
|
53
59
|
"@types/babel__core": "^7.20.5",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
60
|
+
"@types/node": "^25.5.0",
|
|
61
|
+
"vite": "^7.3.1",
|
|
62
|
+
"vitest": "^4.1.0"
|
|
56
63
|
},
|
|
57
64
|
"peerDependencies": {
|
|
58
65
|
"vite": "^7"
|
package/src/config/constants.ts
CHANGED
|
@@ -7,7 +7,7 @@ export const VIRTUAL_MODULES = {
|
|
|
7
7
|
getClientManifest: "solid-start:get-client-manifest",
|
|
8
8
|
getManifest: "solid-start:get-manifest",
|
|
9
9
|
middleware: "solid-start:middleware",
|
|
10
|
-
serverFnManifest: "
|
|
10
|
+
serverFnManifest: "solid-start:server-fn-manifest",
|
|
11
11
|
clientEntry: "solid-start:client-entry",
|
|
12
12
|
serverEntry: "solid-start:server-entry",
|
|
13
13
|
app: "solid-start:app",
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { loadEnv, type Plugin } from "vite";
|
|
2
|
+
|
|
3
|
+
const LOADERS = {
|
|
4
|
+
node: `export default key => process.env[key];`,
|
|
5
|
+
"cloudflare-workers": `import { env } from 'cloudflare:workers';export default key => env[key];`,
|
|
6
|
+
"netlify-edge": `export default key => Netlify.env.get(key);`,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export interface EnvPluginOptions {
|
|
10
|
+
server?: {
|
|
11
|
+
runtime?: keyof typeof LOADERS | (string & {});
|
|
12
|
+
load?: (mode: string) => Record<string, string>;
|
|
13
|
+
prefix?: string;
|
|
14
|
+
};
|
|
15
|
+
client?: {
|
|
16
|
+
load?: (mode: string) => Record<string, string>;
|
|
17
|
+
prefix?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const SERVER_ENV = "env:server";
|
|
22
|
+
const CLIENT_ENV = "env:client";
|
|
23
|
+
|
|
24
|
+
const SERVER_RUNTIME_ENV = `${SERVER_ENV}/runtime`;
|
|
25
|
+
|
|
26
|
+
const SERVER_RUNTIME_LOADER = `${SERVER_RUNTIME_ENV}/loader`;
|
|
27
|
+
|
|
28
|
+
const DEFAULT_SERVER_PREFIX = "SERVER_";
|
|
29
|
+
const DEFAULT_CLIENT_PREFIX = "CLIENT_";
|
|
30
|
+
|
|
31
|
+
const SERVER_ONLY_MODULE = `throw new Error('Attempt to load server-only environment variables in client runtime.');`;
|
|
32
|
+
|
|
33
|
+
const SERVER_RUNTIME_CODE = `import load from '${SERVER_RUNTIME_LOADER}';
|
|
34
|
+
|
|
35
|
+
export default new Proxy({}, {
|
|
36
|
+
get(_, key) {
|
|
37
|
+
return load(key);
|
|
38
|
+
},
|
|
39
|
+
})`;
|
|
40
|
+
|
|
41
|
+
function convertObjectToModule(object: Record<string, string>): string {
|
|
42
|
+
let result = "";
|
|
43
|
+
for (const key in object) {
|
|
44
|
+
result += `export const ${key} = ${JSON.stringify(object[key])};`;
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function envPlugin(options?: EnvPluginOptions): Plugin {
|
|
50
|
+
const currentOptions = options ?? {};
|
|
51
|
+
let env: string;
|
|
52
|
+
const serverPrefix = currentOptions.server?.prefix ?? DEFAULT_SERVER_PREFIX;
|
|
53
|
+
const clientPrefix = currentOptions.client?.prefix ?? DEFAULT_CLIENT_PREFIX;
|
|
54
|
+
const runtime = options?.server?.runtime ?? "node";
|
|
55
|
+
const runtimeCode = runtime in LOADERS ? LOADERS[runtime as keyof typeof LOADERS] : runtime;
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
name: "solid-start:env",
|
|
59
|
+
enforce: "pre",
|
|
60
|
+
configResolved(config) {
|
|
61
|
+
env = config.mode !== "production" ? "development" : "production";
|
|
62
|
+
},
|
|
63
|
+
resolveId(id) {
|
|
64
|
+
if (
|
|
65
|
+
id === SERVER_ENV ||
|
|
66
|
+
id === CLIENT_ENV ||
|
|
67
|
+
id === SERVER_RUNTIME_ENV ||
|
|
68
|
+
id === SERVER_RUNTIME_LOADER
|
|
69
|
+
) {
|
|
70
|
+
return id;
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
},
|
|
74
|
+
load(id, opts) {
|
|
75
|
+
if (id === SERVER_ENV) {
|
|
76
|
+
if (!opts?.ssr) {
|
|
77
|
+
return SERVER_ONLY_MODULE;
|
|
78
|
+
}
|
|
79
|
+
const vars = currentOptions.server?.load
|
|
80
|
+
? currentOptions.server.load(env)
|
|
81
|
+
: loadEnv(env, '.', serverPrefix);
|
|
82
|
+
return convertObjectToModule(vars);
|
|
83
|
+
}
|
|
84
|
+
if (id === CLIENT_ENV) {
|
|
85
|
+
const vars = currentOptions.client?.load
|
|
86
|
+
? currentOptions.client.load(env)
|
|
87
|
+
: loadEnv(env, '.', clientPrefix);
|
|
88
|
+
return convertObjectToModule(vars);
|
|
89
|
+
}
|
|
90
|
+
if (id === SERVER_RUNTIME_LOADER) {
|
|
91
|
+
if (!opts?.ssr) {
|
|
92
|
+
return SERVER_ONLY_MODULE;
|
|
93
|
+
}
|
|
94
|
+
return runtimeCode;
|
|
95
|
+
}
|
|
96
|
+
if (id === SERVER_RUNTIME_ENV) {
|
|
97
|
+
if (!opts?.ssr) {
|
|
98
|
+
return SERVER_ONLY_MODULE;
|
|
99
|
+
}
|
|
100
|
+
return SERVER_RUNTIME_CODE;
|
|
101
|
+
}
|
|
102
|
+
return undefined;
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|