@lovable.dev/vite-tanstack-config 2.23.0 → 2.23.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/hmr-gate.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let node_crypto = require("node:crypto");
3
2
  let node_fs = require("node:fs");
3
+ let node_crypto = require("node:crypto");
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 { createHash } from "node:crypto";
2
1
  import { readFileSync } from "node:fs";
2
+ import { createHash } from "node:crypto";
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,6 +21,7 @@ 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");
24
25
  let node_path = require("node:path");
25
26
  let node_url = require("node:url");
26
27
  let vite = require("vite");
@@ -153,7 +154,7 @@ function bundledDevCssUrlShim() {
153
154
  //#endregion
154
155
  //#region package.json
155
156
  var name = "@lovable.dev/vite-tanstack-config";
156
- var version = "2.23.0";
157
+ var version = "2.23.1";
157
158
  //#endregion
158
159
  //#region src/logging.ts
159
160
  const PACKAGE_NAME = "@lovable.dev/vite-tanstack-config";
@@ -668,6 +669,18 @@ const LOVABLE_SANDBOX_ENV_VAR = "LOVABLE_SANDBOX";
668
669
  function isSandboxEnvironment() {
669
670
  return process.env[LOVABLE_SANDBOX_ENV_VAR] === "1" || !!process.env[SANDBOX_ENV_VAR];
670
671
  }
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
+ }
671
684
  const TOOL_MANAGED_WATCH_IGNORES = [
672
685
  "**/.workspace/**",
673
686
  "**/.agents/**",
@@ -1643,12 +1656,14 @@ function defineConfig(configOrOptions = {}) {
1643
1656
  }
1644
1657
  if (isSandbox) {
1645
1658
  validateConfig(config);
1659
+ const fsAllow = sandboxFsAllow(process.cwd());
1646
1660
  config = cleanServerConfig((0, vite.mergeConfig)(config, { server: {
1647
1661
  host: "::",
1648
1662
  port: 8080,
1649
1663
  strictPort: true,
1650
1664
  watch: { ignored: [...TOOL_MANAGED_WATCH_IGNORES] },
1651
- hmr: { overlay: false }
1665
+ hmr: { overlay: false },
1666
+ ...fsAllow ? { fs: { allow: fsAllow } } : {}
1652
1667
  } }));
1653
1668
  } else config = (0, vite.mergeConfig)({ server: {
1654
1669
  host: "::",
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
+ import { realpathSync } from "node:fs";
1
2
  import { basename, extname, join, relative, resolve, sep } from "node:path";
2
3
  import { fileURLToPath } from "node:url";
3
- import { loadEnv, mergeConfig } from "vite";
4
+ import { loadEnv, mergeConfig, searchForWorkspaceRoot } from "vite";
4
5
  import https from "node:https";
5
6
  //#region src/assetsProxyPlugin.ts
6
7
  const ASSET_RE = /^\/__l5e\/assets-v1\//;
@@ -129,7 +130,7 @@ function bundledDevCssUrlShim() {
129
130
  //#endregion
130
131
  //#region package.json
131
132
  var name = "@lovable.dev/vite-tanstack-config";
132
- var version = "2.23.0";
133
+ var version = "2.23.1";
133
134
  //#endregion
134
135
  //#region src/logging.ts
135
136
  const PACKAGE_NAME = "@lovable.dev/vite-tanstack-config";
@@ -644,6 +645,18 @@ const LOVABLE_SANDBOX_ENV_VAR = "LOVABLE_SANDBOX";
644
645
  function isSandboxEnvironment() {
645
646
  return process.env[LOVABLE_SANDBOX_ENV_VAR] === "1" || !!process.env[SANDBOX_ENV_VAR];
646
647
  }
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
+ }
647
660
  const TOOL_MANAGED_WATCH_IGNORES = [
648
661
  "**/.workspace/**",
649
662
  "**/.agents/**",
@@ -1619,12 +1632,14 @@ function defineConfig(configOrOptions = {}) {
1619
1632
  }
1620
1633
  if (isSandbox) {
1621
1634
  validateConfig(config);
1635
+ const fsAllow = sandboxFsAllow(process.cwd());
1622
1636
  config = cleanServerConfig(mergeConfig(config, { server: {
1623
1637
  host: "::",
1624
1638
  port: 8080,
1625
1639
  strictPort: true,
1626
1640
  watch: { ignored: [...TOOL_MANAGED_WATCH_IGNORES] },
1627
- hmr: { overlay: false }
1641
+ hmr: { overlay: false },
1642
+ ...fsAllow ? { fs: { allow: fsAllow } } : {}
1628
1643
  } }));
1629
1644
  } else config = mergeConfig({ server: {
1630
1645
  host: "::",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovable.dev/vite-tanstack-config",
3
- "version": "2.23.0",
3
+ "version": "2.23.1",
4
4
  "description": "Vite config wrapper for Lovable TanStack Start projects",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",