@solidjs/start 0.7.3 → 0.7.5

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/config/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AppOptions } from "vinxi";
1
+ import type { AppOptions, createApp } from "vinxi";
2
2
  import type { CustomizableConfig } from "vinxi/dist/types/lib/vite-dev";
3
3
  import { InlineConfig } from "vite";
4
4
  import type { Options } from "vite-plugin-solid";
@@ -25,4 +25,4 @@ type SolidStartInlineConfig = {
25
25
  | ((options: { router: "server" | "client" | "server-function" }) => ViteCustomizableConfig);
26
26
  };
27
27
 
28
- export declare function defineConfig(baseConfig?: SolidStartInlineConfig): any;
28
+ export declare function defineConfig(baseConfig?: SolidStartInlineConfig): ReturnType<typeof createApp>;
package/config/index.js CHANGED
@@ -50,6 +50,9 @@ export function defineConfig(baseConfig = {}) {
50
50
  },
51
51
  solid: {},
52
52
  server: {
53
+ routeRules: {
54
+ "/_build/assets/**": { headers: { "cache-control": "public, immutable, max-age=31536000" } }
55
+ },
53
56
  experimental: {
54
57
  asyncContext: true
55
58
  }
@@ -91,7 +94,8 @@ export function defineConfig(baseConfig = {}) {
91
94
  extensions,
92
95
  target: "server",
93
96
  plugins: async () => {
94
- const userConfig = typeof vite === "function" ? await vite({ router: "server" }) : { ...vite };
97
+ const userConfig =
98
+ typeof vite === "function" ? await vite({ router: "server" }) : { ...vite };
95
99
  const plugins = userConfig.plugins || [];
96
100
  delete userConfig.plugins;
97
101
  return [
@@ -108,7 +112,9 @@ export function defineConfig(baseConfig = {}) {
108
112
  }),
109
113
  ...plugins,
110
114
  serverTransform({
111
- runtime: normalize(fileURLToPath(new URL("../dist/runtime/server-fns-runtime.js", import.meta.url)))
115
+ runtime: normalize(
116
+ fileURLToPath(new URL("../dist/runtime/server-fns-runtime.js", import.meta.url))
117
+ )
112
118
  }),
113
119
  start.experimental.islands ? serverComponents.server() : null,
114
120
  solid({ ...start.solid, ssr: true, extensions: extensions.map(ext => `.${ext}`) }),
@@ -150,7 +156,8 @@ export function defineConfig(baseConfig = {}) {
150
156
  extensions,
151
157
  target: "browser",
152
158
  plugins: async () => {
153
- const userConfig = typeof vite === "function" ? await vite({ router: "client" }) : { ...vite };
159
+ const userConfig =
160
+ typeof vite === "function" ? await vite({ router: "client" }) : { ...vite };
154
161
  const plugins = userConfig.plugins || [];
155
162
  delete userConfig.plugins;
156
163
  return [
@@ -167,7 +174,9 @@ export function defineConfig(baseConfig = {}) {
167
174
  }),
168
175
  ...plugins,
169
176
  serverFunctions.client({
170
- runtime: normalize(fileURLToPath(new URL("../dist/runtime/server-runtime.js", import.meta.url)))
177
+ runtime: normalize(
178
+ fileURLToPath(new URL("../dist/runtime/server-runtime.js", import.meta.url))
179
+ )
171
180
  }),
172
181
  start.experimental.islands ? serverComponents.client() : null,
173
182
  solid({ ...start.solid, ssr: start.ssr, extensions: extensions.map(ext => `.${ext}`) }),
@@ -207,12 +216,15 @@ export function defineConfig(baseConfig = {}) {
207
216
  name: "server-fns",
208
217
  type: "http",
209
218
  base: "/_server",
210
- handler: normalize(fileURLToPath(new URL("../dist/runtime/server-handler.js", import.meta.url))),
219
+ handler: normalize(
220
+ fileURLToPath(new URL("../dist/runtime/server-handler.js", import.meta.url))
221
+ ),
211
222
  middleware: start.middleware,
212
223
  target: "server",
213
224
  routes: solidStartServerFsRouter({ dir: routeDir, extensions }),
214
225
  plugins: async () => {
215
- const userConfig = typeof vite === "function" ? await vite({ router: "server-function" }) : { ...vite };
226
+ const userConfig =
227
+ typeof vite === "function" ? await vite({ router: "server-function" }) : { ...vite };
216
228
  const plugins = userConfig.plugins || [];
217
229
  delete userConfig.plugins;
218
230
  return [
@@ -230,7 +242,9 @@ export function defineConfig(baseConfig = {}) {
230
242
  }),
231
243
  ...plugins,
232
244
  serverFunctionServer({
233
- runtime: normalize(fileURLToPath(new URL("../dist/runtime/server-fns-runtime.js", import.meta.url)))
245
+ runtime: normalize(
246
+ fileURLToPath(new URL("../dist/runtime/server-fns-runtime.js", import.meta.url))
247
+ )
234
248
  }),
235
249
  solid({ ...start.solid, ssr: true, extensions: extensions.map(ext => `.${ext}`) }),
236
250
  config("app-server", {
@@ -1,5 +1,6 @@
1
+ // @refresh skip
1
2
  import { defineMiddleware, sendWebResponse } from "vinxi/http";
2
- import { getFetchEvent } from "../server/fetchEvent.js";
3
+ import { getFetchEvent } from "../server/fetchEvent";
3
4
  function wrapRequestMiddleware(onRequest) {
4
5
  return async (h3Event) => {
5
6
  const fetchEvent = getFetchEvent(h3Event);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidjs/start",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
4
4
  "type": "module",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
@@ -16,7 +16,7 @@
16
16
  "exports": {
17
17
  ".": "./dist/index.jsx",
18
18
  "./config": "./config/index.js",
19
- "./middleware": "./dist/middleware/index.js",
19
+ "./middleware": "./dist/middleware/index.jsx",
20
20
  "./router": "./dist/router/index.jsx",
21
21
  "./server": "./dist/server/index.jsx",
22
22
  "./server/spa": "./dist/server/spa/index.jsx",