@lovable.dev/vite-tanstack-config 1.7.0 → 2.0.0-rc.1

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/dist/index.cjs CHANGED
@@ -266,7 +266,12 @@ function defineConfig(configOrOptions = {}) {
266
266
  options = { vite: await configOrOptions };
267
267
  } else {
268
268
  const optionObject = configOrOptions && typeof configOrOptions === "object" ? configOrOptions : {};
269
- const hasLovableKey = "vite" in optionObject || "serverFnErrorLogger" in optionObject || "ssrErrorLogger" in optionObject || "cloudflare" in optionObject || "tanstackStart" in optionObject || "react" in optionObject || "envDefine" in optionObject || "hmrGate" in optionObject;
269
+ if ("cloudflare" in optionObject) {
270
+ logWarning(
271
+ "The `cloudflare` option was removed in v2. Use `nitro: false` to disable the deploy plugin, or `nitro: { preset: '...' }` to configure it. The `cloudflare` setting is being ignored."
272
+ );
273
+ }
274
+ const hasLovableKey = "vite" in optionObject || "serverFnErrorLogger" in optionObject || "ssrErrorLogger" in optionObject || "nitro" in optionObject || "tanstackStart" in optionObject || "react" in optionObject || "envDefine" in optionObject || "hmrGate" in optionObject;
270
275
  options = hasLovableKey ? optionObject : { vite: optionObject };
271
276
  }
272
277
  const internalPlugins = [];
@@ -280,16 +285,6 @@ function defineConfig(configOrOptions = {}) {
280
285
  if (options.ssrErrorLogger !== false) {
281
286
  internalPlugins.push(devSsrErrorLogger());
282
287
  }
283
- if (options.cloudflare !== false && command === "build") {
284
- try {
285
- const { cloudflare } = await import("@cloudflare/vite-plugin");
286
- const cfOptions = typeof options.cloudflare === "object" && options.cloudflare || {
287
- viteEnvironment: { name: "ssr" }
288
- };
289
- internalPlugins.push(cloudflare(cfOptions));
290
- } catch {
291
- }
292
- }
293
288
  const { tanstackStart } = await import("@tanstack/react-start/plugin/vite");
294
289
  const tanstackStartDefaults = {
295
290
  importProtection: {
@@ -302,6 +297,16 @@ function defineConfig(configOrOptions = {}) {
302
297
  };
303
298
  const tanstackStartOptions = (0, import_vite.mergeConfig)(tanstackStartDefaults, options.tanstackStart ?? {});
304
299
  internalPlugins.push(tanstackStart(tanstackStartOptions));
300
+ if (options.nitro !== false && command === "build") {
301
+ try {
302
+ const { nitro } = await import("nitro/vite");
303
+ const userNitroOpts = typeof options.nitro === "object" && options.nitro ? options.nitro : {};
304
+ const preset = userNitroOpts.preset ?? process.env.NITRO_PRESET ?? "cloudflare-module";
305
+ const output = { dir: "dist", ...userNitroOpts.output ?? {} };
306
+ internalPlugins.push(nitro({ ...userNitroOpts, preset, output }));
307
+ } catch {
308
+ }
309
+ }
305
310
  const viteReact = (await import("@vitejs/plugin-react")).default;
306
311
  internalPlugins.push(viteReact(options.react));
307
312
  if (command === "serve") {
package/dist/index.d.cts CHANGED
@@ -5,7 +5,21 @@ interface LovableViteTanstackOptions {
5
5
  vite?: UserConfig;
6
6
  serverFnErrorLogger?: boolean;
7
7
  ssrErrorLogger?: boolean;
8
- cloudflare?: Record<string, unknown> | false;
8
+ /**
9
+ * Options forwarded to `nitro()` from `nitro/vite`. Set to `false` to skip
10
+ * the Nitro build plugin entirely. The preset is selected via `NITRO_PRESET`
11
+ * env var or `nitro.preset` here; `output.dir` defaults to `dist`.
12
+ *
13
+ * Narrow surface on purpose — Nitro v3 is still pre-RC, so we only expose
14
+ * stable build-time knobs to reduce churn if `NitroPluginConfig` schema
15
+ * changes. File an issue if you need to set a different field.
16
+ */
17
+ nitro?: {
18
+ preset?: string;
19
+ output?: {
20
+ dir?: string;
21
+ };
22
+ } | false;
9
23
  /** Options forwarded to tanstackStart(). */
10
24
  tanstackStart?: Record<string, unknown>;
11
25
  /** Options forwarded to viteReact(). */
package/dist/index.d.ts CHANGED
@@ -5,7 +5,21 @@ interface LovableViteTanstackOptions {
5
5
  vite?: UserConfig;
6
6
  serverFnErrorLogger?: boolean;
7
7
  ssrErrorLogger?: boolean;
8
- cloudflare?: Record<string, unknown> | false;
8
+ /**
9
+ * Options forwarded to `nitro()` from `nitro/vite`. Set to `false` to skip
10
+ * the Nitro build plugin entirely. The preset is selected via `NITRO_PRESET`
11
+ * env var or `nitro.preset` here; `output.dir` defaults to `dist`.
12
+ *
13
+ * Narrow surface on purpose — Nitro v3 is still pre-RC, so we only expose
14
+ * stable build-time knobs to reduce churn if `NitroPluginConfig` schema
15
+ * changes. File an issue if you need to set a different field.
16
+ */
17
+ nitro?: {
18
+ preset?: string;
19
+ output?: {
20
+ dir?: string;
21
+ };
22
+ } | false;
9
23
  /** Options forwarded to tanstackStart(). */
10
24
  tanstackStart?: Record<string, unknown>;
11
25
  /** Options forwarded to viteReact(). */
package/dist/index.js CHANGED
@@ -232,7 +232,12 @@ function defineConfig(configOrOptions = {}) {
232
232
  options = { vite: await configOrOptions };
233
233
  } else {
234
234
  const optionObject = configOrOptions && typeof configOrOptions === "object" ? configOrOptions : {};
235
- const hasLovableKey = "vite" in optionObject || "serverFnErrorLogger" in optionObject || "ssrErrorLogger" in optionObject || "cloudflare" in optionObject || "tanstackStart" in optionObject || "react" in optionObject || "envDefine" in optionObject || "hmrGate" in optionObject;
235
+ if ("cloudflare" in optionObject) {
236
+ logWarning(
237
+ "The `cloudflare` option was removed in v2. Use `nitro: false` to disable the deploy plugin, or `nitro: { preset: '...' }` to configure it. The `cloudflare` setting is being ignored."
238
+ );
239
+ }
240
+ const hasLovableKey = "vite" in optionObject || "serverFnErrorLogger" in optionObject || "ssrErrorLogger" in optionObject || "nitro" in optionObject || "tanstackStart" in optionObject || "react" in optionObject || "envDefine" in optionObject || "hmrGate" in optionObject;
236
241
  options = hasLovableKey ? optionObject : { vite: optionObject };
237
242
  }
238
243
  const internalPlugins = [];
@@ -246,16 +251,6 @@ function defineConfig(configOrOptions = {}) {
246
251
  if (options.ssrErrorLogger !== false) {
247
252
  internalPlugins.push(devSsrErrorLogger());
248
253
  }
249
- if (options.cloudflare !== false && command === "build") {
250
- try {
251
- const { cloudflare } = await import("@cloudflare/vite-plugin");
252
- const cfOptions = typeof options.cloudflare === "object" && options.cloudflare || {
253
- viteEnvironment: { name: "ssr" }
254
- };
255
- internalPlugins.push(cloudflare(cfOptions));
256
- } catch {
257
- }
258
- }
259
254
  const { tanstackStart } = await import("@tanstack/react-start/plugin/vite");
260
255
  const tanstackStartDefaults = {
261
256
  importProtection: {
@@ -268,6 +263,16 @@ function defineConfig(configOrOptions = {}) {
268
263
  };
269
264
  const tanstackStartOptions = mergeConfig(tanstackStartDefaults, options.tanstackStart ?? {});
270
265
  internalPlugins.push(tanstackStart(tanstackStartOptions));
266
+ if (options.nitro !== false && command === "build") {
267
+ try {
268
+ const { nitro } = await import("nitro/vite");
269
+ const userNitroOpts = typeof options.nitro === "object" && options.nitro ? options.nitro : {};
270
+ const preset = userNitroOpts.preset ?? process.env.NITRO_PRESET ?? "cloudflare-module";
271
+ const output = { dir: "dist", ...userNitroOpts.output ?? {} };
272
+ internalPlugins.push(nitro({ ...userNitroOpts, preset, output }));
273
+ } catch {
274
+ }
275
+ }
271
276
  const viteReact = (await import("@vitejs/plugin-react")).default;
272
277
  internalPlugins.push(viteReact(options.react));
273
278
  if (command === "serve") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovable.dev/vite-tanstack-config",
3
- "version": "1.7.0",
3
+ "version": "2.0.0-rc.1",
4
4
  "description": "Vite config wrapper for Lovable TanStack Start projects",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -9,15 +9,6 @@
9
9
  "files": [
10
10
  "dist"
11
11
  ],
12
- "scripts": {
13
- "build": "tsup src/index.ts --format cjs,esm --dts --outDir dist",
14
- "typecheck": "tsgo --noEmit",
15
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
16
- "test": "vitest",
17
- "prepublishOnly": "npm run clean && npm run build",
18
- "clean": "rimraf dist",
19
- "coverage": "vitest run --coverage"
20
- },
21
12
  "keywords": [
22
13
  "vite",
23
14
  "tanstack",
@@ -34,26 +25,34 @@
34
25
  "vite": ">=5.0.0 <9.0.0",
35
26
  "@tailwindcss/vite": ">=4.0.0",
36
27
  "vite-tsconfig-paths": ">=6.0.0",
37
- "@cloudflare/vite-plugin": ">=1.0.0",
28
+ "nitro": ">=3.0.260429-beta",
38
29
  "@tanstack/react-start": ">=1.100.0",
39
30
  "@vitejs/plugin-react": ">=4.0.0"
40
31
  },
41
32
  "peerDependenciesMeta": {
42
- "@cloudflare/vite-plugin": {
33
+ "nitro": {
43
34
  "optional": true
44
35
  }
45
36
  },
46
37
  "devDependencies": {
47
- "@cloudflare/vite-plugin": "^1.25.5",
38
+ "nitro": "3.0.260429-beta",
48
39
  "@tanstack/react-start": "^1.162.9",
49
40
  "@vitejs/plugin-react": "^4.5.2",
50
41
  "@tailwindcss/vite": "^4.2.1",
51
- "@types/node": "catalog:",
42
+ "@types/node": "22.13.13",
52
43
  "rimraf": "^5.0.0",
53
44
  "tsup": "^7.2.0",
54
- "typescript": "catalog:",
45
+ "typescript": "^5.9.3",
55
46
  "vite": "^7.3.1",
56
47
  "vite-tsconfig-paths": "^6.0.2",
57
- "vitest": "catalog:"
48
+ "vitest": "^4.1.5"
49
+ },
50
+ "scripts": {
51
+ "build": "tsup src/index.ts --format cjs,esm --dts --outDir dist",
52
+ "typecheck": "tsgo --noEmit",
53
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
54
+ "test": "vitest",
55
+ "clean": "rimraf dist",
56
+ "coverage": "vitest run --coverage"
58
57
  }
59
- }
58
+ }