@lovable.dev/vite-tanstack-config 2.23.1 → 2.23.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/dist/hmr-gate.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let node_fs = require("node:fs");
3
2
  let node_crypto = require("node:crypto");
3
+ let node_fs = require("node:fs");
4
4
  //#region src/hmr-gate/index.ts
5
5
  const statusCorsOriginRe = /^(?:https:\/\/(?:[^/]+\.)?lovable\.dev|https?:\/\/(?:(?:[^/:]+\.)?localhost|127\.0\.0\.1|\[::1\]))(?::\d+)?$/;
6
6
  function requestPathname(req) {
package/dist/hmr-gate.js CHANGED
@@ -1,5 +1,5 @@
1
- import { readFileSync } from "node:fs";
2
1
  import { createHash } from "node:crypto";
2
+ import { readFileSync } from "node:fs";
3
3
  //#region src/hmr-gate/index.ts
4
4
  const statusCorsOriginRe = /^(?:https:\/\/(?:[^/]+\.)?lovable\.dev|https?:\/\/(?:(?:[^/:]+\.)?localhost|127\.0\.0\.1|\[::1\]))(?::\d+)?$/;
5
5
  function requestPathname(req) {
package/dist/index.cjs CHANGED
@@ -21,12 +21,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- let node_fs = require("node:fs");
25
24
  let node_path = require("node:path");
26
25
  let node_url = require("node:url");
27
26
  let vite = require("vite");
28
27
  let node_https = require("node:https");
29
28
  node_https = __toESM(node_https, 1);
29
+ let node_fs_promises = require("node:fs/promises");
30
30
  //#region src/assetsProxyPlugin.ts
31
31
  const ASSET_RE = /^\/__l5e\/assets-v1\//;
32
32
  const PREVIEW_HOST_ENV = "LOVABLE_PREVIEW_HOST";
@@ -154,7 +154,7 @@ function bundledDevCssUrlShim() {
154
154
  //#endregion
155
155
  //#region package.json
156
156
  var name = "@lovable.dev/vite-tanstack-config";
157
- var version = "2.23.1";
157
+ var version = "2.23.2";
158
158
  //#endregion
159
159
  //#region src/logging.ts
160
160
  const PACKAGE_NAME = "@lovable.dev/vite-tanstack-config";
@@ -368,6 +368,26 @@ function createDocumentSet(routerBasePath) {
368
368
  };
369
369
  }
370
370
  //#endregion
371
+ //#region src/linkedDependencies.ts
372
+ function linkedDependenciesPlugin() {
373
+ return {
374
+ name: "lovable-linked-dependencies",
375
+ apply: "serve",
376
+ async configResolved(config) {
377
+ let dependencies;
378
+ let root;
379
+ try {
380
+ root = await (0, node_fs_promises.realpath)(config.root);
381
+ dependencies = await (0, node_fs_promises.realpath)((0, node_path.join)(root, "node_modules"));
382
+ } catch {
383
+ return;
384
+ }
385
+ if (dependencies.startsWith(root + node_path.sep)) return;
386
+ if (!config.server.fs.allow.includes(dependencies)) config.server.fs.allow.push(dependencies);
387
+ }
388
+ };
389
+ }
390
+ //#endregion
371
391
  //#region src/routes.ts
372
392
  const ROUTE_MANIFEST_VERSION = 1;
373
393
  const GENERATOR = `${name}@${version}`;
@@ -669,18 +689,6 @@ const LOVABLE_SANDBOX_ENV_VAR = "LOVABLE_SANDBOX";
669
689
  function isSandboxEnvironment() {
670
690
  return process.env[LOVABLE_SANDBOX_ENV_VAR] === "1" || !!process.env[SANDBOX_ENV_VAR];
671
691
  }
672
- function sandboxFsAllow(root) {
673
- let nodeModules;
674
- let realRoot;
675
- try {
676
- nodeModules = node_fs.realpathSync.native((0, node_path.join)(root, "node_modules"));
677
- realRoot = node_fs.realpathSync.native(root);
678
- } catch {
679
- return;
680
- }
681
- if (nodeModules.startsWith(realRoot + node_path.sep)) return void 0;
682
- return [(0, vite.searchForWorkspaceRoot)(root), nodeModules];
683
- }
684
692
  const TOOL_MANAGED_WATCH_IGNORES = [
685
693
  "**/.workspace/**",
686
694
  "**/.agents/**",
@@ -1606,6 +1614,7 @@ function defineConfig(configOrOptions = {}) {
1606
1614
  }
1607
1615
  }
1608
1616
  if (command === "serve" && isSandbox) {
1617
+ internalPlugins.push(linkedDependenciesPlugin());
1609
1618
  const { devServerBridgePlugin } = await Promise.resolve().then(() => require("./dev-server-bridge.cjs"));
1610
1619
  internalPlugins.push(devServerBridgePlugin());
1611
1620
  }
@@ -1656,14 +1665,12 @@ function defineConfig(configOrOptions = {}) {
1656
1665
  }
1657
1666
  if (isSandbox) {
1658
1667
  validateConfig(config);
1659
- const fsAllow = sandboxFsAllow(process.cwd());
1660
1668
  config = cleanServerConfig((0, vite.mergeConfig)(config, { server: {
1661
1669
  host: "::",
1662
1670
  port: 8080,
1663
1671
  strictPort: true,
1664
1672
  watch: { ignored: [...TOOL_MANAGED_WATCH_IGNORES] },
1665
- hmr: { overlay: false },
1666
- ...fsAllow ? { fs: { allow: fsAllow } } : {}
1673
+ hmr: { overlay: false }
1667
1674
  } }));
1668
1675
  } else config = (0, vite.mergeConfig)({ server: {
1669
1676
  host: "::",
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { realpathSync } from "node:fs";
2
1
  import { basename, extname, join, relative, resolve, sep } from "node:path";
3
2
  import { fileURLToPath } from "node:url";
4
- import { loadEnv, mergeConfig, searchForWorkspaceRoot } from "vite";
3
+ import { loadEnv, mergeConfig } from "vite";
5
4
  import https from "node:https";
5
+ import { realpath } from "node:fs/promises";
6
6
  //#region src/assetsProxyPlugin.ts
7
7
  const ASSET_RE = /^\/__l5e\/assets-v1\//;
8
8
  const PREVIEW_HOST_ENV = "LOVABLE_PREVIEW_HOST";
@@ -130,7 +130,7 @@ function bundledDevCssUrlShim() {
130
130
  //#endregion
131
131
  //#region package.json
132
132
  var name = "@lovable.dev/vite-tanstack-config";
133
- var version = "2.23.1";
133
+ var version = "2.23.2";
134
134
  //#endregion
135
135
  //#region src/logging.ts
136
136
  const PACKAGE_NAME = "@lovable.dev/vite-tanstack-config";
@@ -344,6 +344,26 @@ function createDocumentSet(routerBasePath) {
344
344
  };
345
345
  }
346
346
  //#endregion
347
+ //#region src/linkedDependencies.ts
348
+ function linkedDependenciesPlugin() {
349
+ return {
350
+ name: "lovable-linked-dependencies",
351
+ apply: "serve",
352
+ async configResolved(config) {
353
+ let dependencies;
354
+ let root;
355
+ try {
356
+ root = await realpath(config.root);
357
+ dependencies = await realpath(join(root, "node_modules"));
358
+ } catch {
359
+ return;
360
+ }
361
+ if (dependencies.startsWith(root + sep)) return;
362
+ if (!config.server.fs.allow.includes(dependencies)) config.server.fs.allow.push(dependencies);
363
+ }
364
+ };
365
+ }
366
+ //#endregion
347
367
  //#region src/routes.ts
348
368
  const ROUTE_MANIFEST_VERSION = 1;
349
369
  const GENERATOR = `${name}@${version}`;
@@ -645,18 +665,6 @@ const LOVABLE_SANDBOX_ENV_VAR = "LOVABLE_SANDBOX";
645
665
  function isSandboxEnvironment() {
646
666
  return process.env[LOVABLE_SANDBOX_ENV_VAR] === "1" || !!process.env[SANDBOX_ENV_VAR];
647
667
  }
648
- function sandboxFsAllow(root) {
649
- let nodeModules;
650
- let realRoot;
651
- try {
652
- nodeModules = realpathSync.native(join(root, "node_modules"));
653
- realRoot = realpathSync.native(root);
654
- } catch {
655
- return;
656
- }
657
- if (nodeModules.startsWith(realRoot + sep)) return void 0;
658
- return [searchForWorkspaceRoot(root), nodeModules];
659
- }
660
668
  const TOOL_MANAGED_WATCH_IGNORES = [
661
669
  "**/.workspace/**",
662
670
  "**/.agents/**",
@@ -1582,6 +1590,7 @@ function defineConfig(configOrOptions = {}) {
1582
1590
  }
1583
1591
  }
1584
1592
  if (command === "serve" && isSandbox) {
1593
+ internalPlugins.push(linkedDependenciesPlugin());
1585
1594
  const { devServerBridgePlugin } = await import("./dev-server-bridge.js");
1586
1595
  internalPlugins.push(devServerBridgePlugin());
1587
1596
  }
@@ -1632,14 +1641,12 @@ function defineConfig(configOrOptions = {}) {
1632
1641
  }
1633
1642
  if (isSandbox) {
1634
1643
  validateConfig(config);
1635
- const fsAllow = sandboxFsAllow(process.cwd());
1636
1644
  config = cleanServerConfig(mergeConfig(config, { server: {
1637
1645
  host: "::",
1638
1646
  port: 8080,
1639
1647
  strictPort: true,
1640
1648
  watch: { ignored: [...TOOL_MANAGED_WATCH_IGNORES] },
1641
- hmr: { overlay: false },
1642
- ...fsAllow ? { fs: { allow: fsAllow } } : {}
1649
+ hmr: { overlay: false }
1643
1650
  } }));
1644
1651
  } else config = mergeConfig({ server: {
1645
1652
  host: "::",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovable.dev/vite-tanstack-config",
3
- "version": "2.23.1",
3
+ "version": "2.23.2",
4
4
  "description": "Vite config wrapper for Lovable TanStack Start projects",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",