vite-plugin-kiru 0.30.1 → 0.32.0-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.dev.ts CHANGED
@@ -3,13 +3,13 @@ import fs from "node:fs"
3
3
 
4
4
  await esbuild
5
5
  .context({
6
- entryPoints: ["src/index.ts"],
6
+ entryPoints: ["src/index.ts", "src/server.ts"],
7
7
  bundle: true,
8
8
  platform: "node",
9
9
  target: "esnext",
10
10
  format: "esm",
11
- outfile: "./dist/index.js",
12
- external: ["kiru", "vite"],
11
+ outdir: "./dist",
12
+ external: ["kiru", "vite", "virtual:kiru:entry-server"],
13
13
  write: true,
14
14
  plugins: [
15
15
  {
@@ -18,6 +18,7 @@ await esbuild
18
18
  onEnd(() => {
19
19
  console.log("[vite-plugin-kiru]: Build complete!")
20
20
  fs.copyFileSync("./src/types.d.ts", "dist/index.d.ts")
21
+ fs.copyFileSync("./src/types.server.d.ts", "dist/server.d.ts")
21
22
  })
22
23
  },
23
24
  },
package/dist/index.d.ts CHANGED
@@ -116,6 +116,11 @@ export interface SSGOptions {
116
116
  * @default "layout.{tsx,jsx}"
117
117
  */
118
118
  layout?: string
119
+ /**
120
+ * The filename of guard files to search for
121
+ * @default "guard.{ts,js}"
122
+ */
123
+ guard?: string
119
124
  /**
120
125
  * Enable transitions for all routes and loading states
121
126
  * @default false
@@ -133,6 +138,49 @@ export interface SSGOptions {
133
138
  build?: SSGBuildOptions
134
139
  }
135
140
 
141
+ export interface SSROptions {
142
+ /**
143
+ * The path to the server entry file
144
+ * @example "src/server.ts"
145
+ */
146
+ runtimeEntry: string
147
+ /**
148
+ * The base URL of the app
149
+ * @default "/"
150
+ */
151
+ baseUrl?: string
152
+ /**
153
+ * The directory of the app
154
+ * @default "src/pages"
155
+ */
156
+ dir?: string
157
+ /**
158
+ * The name of the document component
159
+ * @default "document.{tsx,jsx}"
160
+ */
161
+ document?: string
162
+ /**
163
+ * The filename of page components to search for
164
+ * @default "index.{tsx,jsx}"
165
+ */
166
+ page?: string
167
+ /**
168
+ * The filename of layout components to search for
169
+ * @default "layout.{tsx,jsx}"
170
+ */
171
+ layout?: string
172
+ /**
173
+ * The filename of guard files to search for
174
+ * @default "guard.{ts,js}"
175
+ */
176
+ guard?: string
177
+ /**
178
+ * Enable transitions for all routes and loading states
179
+ * @default false
180
+ */
181
+ transition?: boolean
182
+ }
183
+
136
184
  export interface DevtoolsOptions {
137
185
  /**
138
186
  * Specifies the path to the devtools app displayed via popup
@@ -193,6 +241,21 @@ export interface KiruPluginOptions {
193
241
  * ```
194
242
  */
195
243
  ssg?: SSGOptions | true
244
+
245
+ /**
246
+ * Options for SSR
247
+ * @example
248
+ * ```ts
249
+ * ssr: {
250
+ * dir: "./src/app",
251
+ * document: "document.{tsx,jsx}",
252
+ * page: "index.{tsx,jsx}",
253
+ * layout: "layout.{tsx,jsx}",
254
+ * transition: true
255
+ * }
256
+ * ```
257
+ */
258
+ ssr?: SSROptions
196
259
  }
197
260
 
198
261
  export const defaultEsBuildOptions: ESBuildOptions