nitro-nightly 3.0.1-20251217-093053-f360ffee → 3.0.1-20251217-124302-0d9f782c

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.
@@ -1,7 +1,6 @@
1
1
  import "../_rolldown.mjs";
2
2
  import { O as relative, o as debounce, w as join } from "../_libs/c12.mjs";
3
- import "../_libs/@jridgewell/gen-mapping.mjs";
4
- import "../_libs/@pi0/vite-plugin-fullstack.mjs";
3
+ import "../_libs/@hiogawa/vite-plugin-fullstack.mjs";
5
4
  import "../_libs/acorn.mjs";
6
5
  import "../_libs/unimport.mjs";
7
6
  import "../_libs/@rollup/plugin-commonjs.mjs";
@@ -10,9 +9,10 @@ import "./shared.mjs";
10
9
  import { i as scanHandlers, n as writeTypes } from "../_nitro2.mjs";
11
10
  import "../_libs/mime.mjs";
12
11
  import { n as writeBuildInfo } from "./shared2.mjs";
13
- import { a as watch$1 } from "../_libs/chokidar.mjs";
12
+ import { i as watch$1 } from "../_libs/chokidar.mjs";
14
13
  import { a as baseBuildConfig, i as libChunkName, n as NODE_MODULES_RE, r as getChunkName, t as baseBuildPlugins } from "../_nitro3.mjs";
15
14
  import "../_libs/etag.mjs";
15
+ import "../_libs/@jridgewell/gen-mapping.mjs";
16
16
  import "../_libs/@jridgewell/remapping.mjs";
17
17
  import "../_libs/@rollup/plugin-replace.mjs";
18
18
  import "../_libs/duplexer.mjs";
@@ -1,7 +1,6 @@
1
1
  import "../_rolldown.mjs";
2
2
  import { C as isAbsolute, O as relative, o as debounce, w as join } from "../_libs/c12.mjs";
3
- import "../_libs/@jridgewell/gen-mapping.mjs";
4
- import "../_libs/@pi0/vite-plugin-fullstack.mjs";
3
+ import "../_libs/@hiogawa/vite-plugin-fullstack.mjs";
5
4
  import "../_libs/acorn.mjs";
6
5
  import "../_libs/unimport.mjs";
7
6
  import { t as commonjs } from "../_libs/@rollup/plugin-commonjs.mjs";
@@ -10,11 +9,12 @@ import "./shared.mjs";
10
9
  import { i as scanHandlers, n as writeTypes } from "../_nitro2.mjs";
11
10
  import "../_libs/mime.mjs";
12
11
  import { n as writeBuildInfo } from "./shared2.mjs";
13
- import { a as watch$1 } from "../_libs/chokidar.mjs";
12
+ import { i as watch$1 } from "../_libs/chokidar.mjs";
14
13
  import { t as alias } from "../_libs/@rollup/plugin-alias.mjs";
15
14
  import { t as inject } from "../_libs/@rollup/plugin-inject.mjs";
16
15
  import { a as baseBuildConfig, i as libChunkName, n as NODE_MODULES_RE, r as getChunkName, t as baseBuildPlugins } from "../_nitro3.mjs";
17
16
  import "../_libs/etag.mjs";
17
+ import "../_libs/@jridgewell/gen-mapping.mjs";
18
18
  import "../_libs/@jridgewell/remapping.mjs";
19
19
  import "../_libs/@rollup/plugin-replace.mjs";
20
20
  import "../_libs/duplexer.mjs";
@@ -1,7 +1,6 @@
1
1
  import "../_rolldown.mjs";
2
2
  import "../_libs/c12.mjs";
3
- import "../_libs/@jridgewell/gen-mapping.mjs";
4
- import "../_libs/@pi0/vite-plugin-fullstack.mjs";
3
+ import "../_libs/@hiogawa/vite-plugin-fullstack.mjs";
5
4
  import "../_libs/acorn.mjs";
6
5
  import "../_libs/unimport.mjs";
7
6
  import "../_libs/@rollup/plugin-commonjs.mjs";
@@ -17,6 +16,7 @@ import "../_libs/@rollup/plugin-alias.mjs";
17
16
  import "../_libs/@rollup/plugin-inject.mjs";
18
17
  import "../_nitro3.mjs";
19
18
  import "../_libs/etag.mjs";
19
+ import "../_libs/@jridgewell/gen-mapping.mjs";
20
20
  import "../_libs/@jridgewell/remapping.mjs";
21
21
  import "../_libs/@rollup/plugin-replace.mjs";
22
22
  import { t as nitro } from "./vite.plugin.mjs";
@@ -1,5 +1,5 @@
1
1
  import { C as isAbsolute$1, O as relative$1, b as basename$1, h as resolveModulePath, k as resolve$1, o as debounce, w as join$1, x as dirname$1 } from "../_libs/c12.mjs";
2
- import { t as assetsPlugin } from "../_libs/@pi0/vite-plugin-fullstack.mjs";
2
+ import { t as assetsPlugin } from "../_libs/@hiogawa/vite-plugin-fullstack.mjs";
3
3
  import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
4
4
  import { i as a, r as T } from "../_libs/std-env.mjs";
5
5
  import { a as copyPublicAssets, i as prepare, s as createNitro } from "../_nitro.mjs";
@@ -7,7 +7,7 @@ import { n as prettyPath } from "./shared.mjs";
7
7
  import { i as scanHandlers } from "../_nitro2.mjs";
8
8
  import { n as writeBuildInfo, t as getBuildInfo } from "./shared2.mjs";
9
9
  import { i as NodeEnvRunner, r as NitroDevApp } from "../_dev.mjs";
10
- import { a as watch$1 } from "../_libs/chokidar.mjs";
10
+ import { i as watch$1 } from "../_libs/chokidar.mjs";
11
11
  import { t as alias } from "../_libs/@rollup/plugin-alias.mjs";
12
12
  import { t as inject } from "../_libs/@rollup/plugin-inject.mjs";
13
13
  import { a as baseBuildConfig, i as libChunkName, n as NODE_MODULES_RE, r as getChunkName, t as baseBuildPlugins } from "../_nitro3.mjs";
package/dist/_dev.mjs CHANGED
@@ -3,7 +3,7 @@ import { i as a, r as T } from "./_libs/std-env.mjs";
3
3
  import { t as src_default } from "./_libs/mime.mjs";
4
4
  import { r as writeDevBuildInfo } from "./_build/shared2.mjs";
5
5
  import { n as createProxyServer } from "./_libs/httpxy.mjs";
6
- import { a as watch$1 } from "./_libs/chokidar.mjs";
6
+ import { i as watch$1 } from "./_libs/chokidar.mjs";
7
7
  import consola$1 from "consola";
8
8
  import { dirname, resolve } from "node:path";
9
9
  import { createReadStream, existsSync } from "node:fs";
@@ -1,5 +1,4 @@
1
1
  import { i as __toESM, t as __commonJSMin } from "../../_rolldown.mjs";
2
- import { u as encode } from "../@jridgewell/gen-mapping.mjs";
3
2
  import path from "node:path";
4
3
  import fs from "node:fs";
5
4
  import { fileURLToPath } from "node:url";
@@ -9,6 +8,172 @@ import { createHash } from "node:crypto";
9
8
  import { isCSSRequest, normalizePath } from "vite";
10
9
  import assert$1 from "node:assert/strict";
11
10
 
11
+ //#region node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
12
+ var comma = ",".charCodeAt(0);
13
+ var semicolon = ";".charCodeAt(0);
14
+ var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
15
+ var intToChar = new Uint8Array(64);
16
+ var charToInt = new Uint8Array(128);
17
+ for (let i = 0; i < chars.length; i++) {
18
+ const c = chars.charCodeAt(i);
19
+ intToChar[i] = c;
20
+ charToInt[c] = i;
21
+ }
22
+ function decodeInteger(reader, relative$1) {
23
+ let value = 0;
24
+ let shift = 0;
25
+ let integer = 0;
26
+ do {
27
+ integer = charToInt[reader.next()];
28
+ value |= (integer & 31) << shift;
29
+ shift += 5;
30
+ } while (integer & 32);
31
+ const shouldNegate = value & 1;
32
+ value >>>= 1;
33
+ if (shouldNegate) value = -2147483648 | -value;
34
+ return relative$1 + value;
35
+ }
36
+ function encodeInteger(builder, num, relative$1) {
37
+ let delta = num - relative$1;
38
+ delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
39
+ do {
40
+ let clamped = delta & 31;
41
+ delta >>>= 5;
42
+ if (delta > 0) clamped |= 32;
43
+ builder.write(intToChar[clamped]);
44
+ } while (delta > 0);
45
+ return num;
46
+ }
47
+ function hasMoreVlq(reader, max) {
48
+ if (reader.pos >= max) return false;
49
+ return reader.peek() !== comma;
50
+ }
51
+ var bufLength = 1024 * 16;
52
+ var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
53
+ return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
54
+ } } : { decode(buf) {
55
+ let out = "";
56
+ for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
57
+ return out;
58
+ } };
59
+ var StringWriter = class {
60
+ constructor() {
61
+ this.pos = 0;
62
+ this.out = "";
63
+ this.buffer = new Uint8Array(bufLength);
64
+ }
65
+ write(v) {
66
+ const { buffer } = this;
67
+ buffer[this.pos++] = v;
68
+ if (this.pos === bufLength) {
69
+ this.out += td.decode(buffer);
70
+ this.pos = 0;
71
+ }
72
+ }
73
+ flush() {
74
+ const { buffer, out, pos } = this;
75
+ return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
76
+ }
77
+ };
78
+ var StringReader = class {
79
+ constructor(buffer) {
80
+ this.pos = 0;
81
+ this.buffer = buffer;
82
+ }
83
+ next() {
84
+ return this.buffer.charCodeAt(this.pos++);
85
+ }
86
+ peek() {
87
+ return this.buffer.charCodeAt(this.pos);
88
+ }
89
+ indexOf(char) {
90
+ const { buffer, pos } = this;
91
+ const idx = buffer.indexOf(char, pos);
92
+ return idx === -1 ? buffer.length : idx;
93
+ }
94
+ };
95
+ function decode(mappings) {
96
+ const { length } = mappings;
97
+ const reader = new StringReader(mappings);
98
+ const decoded = [];
99
+ let genColumn = 0;
100
+ let sourcesIndex = 0;
101
+ let sourceLine = 0;
102
+ let sourceColumn = 0;
103
+ let namesIndex = 0;
104
+ do {
105
+ const semi = reader.indexOf(";");
106
+ const line = [];
107
+ let sorted = true;
108
+ let lastCol = 0;
109
+ genColumn = 0;
110
+ while (reader.pos < semi) {
111
+ let seg;
112
+ genColumn = decodeInteger(reader, genColumn);
113
+ if (genColumn < lastCol) sorted = false;
114
+ lastCol = genColumn;
115
+ if (hasMoreVlq(reader, semi)) {
116
+ sourcesIndex = decodeInteger(reader, sourcesIndex);
117
+ sourceLine = decodeInteger(reader, sourceLine);
118
+ sourceColumn = decodeInteger(reader, sourceColumn);
119
+ if (hasMoreVlq(reader, semi)) {
120
+ namesIndex = decodeInteger(reader, namesIndex);
121
+ seg = [
122
+ genColumn,
123
+ sourcesIndex,
124
+ sourceLine,
125
+ sourceColumn,
126
+ namesIndex
127
+ ];
128
+ } else seg = [
129
+ genColumn,
130
+ sourcesIndex,
131
+ sourceLine,
132
+ sourceColumn
133
+ ];
134
+ } else seg = [genColumn];
135
+ line.push(seg);
136
+ reader.pos++;
137
+ }
138
+ if (!sorted) sort(line);
139
+ decoded.push(line);
140
+ reader.pos = semi + 1;
141
+ } while (reader.pos <= length);
142
+ return decoded;
143
+ }
144
+ function sort(line) {
145
+ line.sort(sortComparator);
146
+ }
147
+ function sortComparator(a, b) {
148
+ return a[0] - b[0];
149
+ }
150
+ function encode(decoded) {
151
+ const writer = new StringWriter();
152
+ let sourcesIndex = 0;
153
+ let sourceLine = 0;
154
+ let sourceColumn = 0;
155
+ let namesIndex = 0;
156
+ for (let i = 0; i < decoded.length; i++) {
157
+ const line = decoded[i];
158
+ if (i > 0) writer.write(semicolon);
159
+ if (line.length === 0) continue;
160
+ let genColumn = 0;
161
+ for (let j = 0; j < line.length; j++) {
162
+ const segment = line[j];
163
+ if (j > 0) writer.write(comma);
164
+ genColumn = encodeInteger(writer, segment[0], genColumn);
165
+ if (segment.length === 1) continue;
166
+ sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
167
+ sourceLine = encodeInteger(writer, segment[2], sourceLine);
168
+ sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
169
+ if (segment.length === 4) continue;
170
+ namesIndex = encodeInteger(writer, segment[4], namesIndex);
171
+ }
172
+ }
173
+ return writer.flush();
174
+ }
175
+
176
+ //#endregion
12
177
  //#region node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs
13
178
  var BitSet = class BitSet {
14
179
  constructor(arg) {
@@ -1371,7 +1536,7 @@ function stripLiteral(code, options) {
1371
1536
  }
1372
1537
 
1373
1538
  //#endregion
1374
- //#region node_modules/.pnpm/@pi0+vite-plugin-fullstack@0.0.5-pr-1297_vite@8.0.0-beta.2_@types+node@25.0.2_jiti@2.6.1_tsx@4.21.0_yaml@2.8.2_/node_modules/@pi0/vite-plugin-fullstack/dist/index.js
1539
+ //#region node_modules/.pnpm/@hiogawa+vite-plugin-fullstack@0.0.8_vite@8.0.0-beta.2_@types+node@25.0.3_jiti@2.6.1_tsx@4.21.0_yaml@2.8.2_/node_modules/@hiogawa/vite-plugin-fullstack/dist/index.js
1375
1540
  function parseIdQuery(id) {
1376
1541
  if (!id.includes("?")) return {
1377
1542
  filename: id,
@@ -1476,11 +1641,11 @@ function assetsPlugin(pluginOpts) {
1476
1641
  };
1477
1642
  const environment = server.environments[options.environment];
1478
1643
  assert$1(environment, `Unknown environment: ${options.environment}`);
1479
- if (options.environment === "client") result.entry = normalizeViteImportAnalysisUrl(environment, id);
1644
+ if (options.environment === "client") result.entry = assetsURLDev(normalizeViteImportAnalysisUrl(environment, id).slice(1), resolvedConfig);
1480
1645
  if (environment.name !== "client") {
1481
1646
  const collected = await collectCss(environment, id, { eager: pluginOpts?.experimental?.devEagerTransform ?? true });
1482
1647
  result.css = collected.hrefs.map((href, i) => ({
1483
- href,
1648
+ href: assetsURLDev(href.slice(1), resolvedConfig),
1484
1649
  "data-vite-dev-id": collected.ids[i]
1485
1650
  }));
1486
1651
  }
@@ -1517,13 +1682,13 @@ function assetsPlugin(pluginOpts) {
1517
1682
  };
1518
1683
  const { chunk, deps } = found;
1519
1684
  if (environmentName === "client") {
1520
- result.entry = `/${chunk.fileName}`;
1521
- result.js = deps.js.map((fileName) => ({ href: `/${fileName}` }));
1685
+ result.entry = assetsURL(chunk.fileName, builder.config);
1686
+ result.js = deps.js.map((fileName) => ({ href: assetsURL(fileName, builder.config) }));
1522
1687
  }
1523
- result.css = deps.css.map((fileName) => ({ href: `/${fileName}` }));
1688
+ result.css = deps.css.map((fileName) => ({ href: assetsURL(fileName, builder.config) }));
1524
1689
  if (!builder.environments[environmentName].config.build.cssCodeSplit) {
1525
1690
  const singleCss = Object.values(bundle).find((v) => v.type === "asset" && v.originalFileNames.includes("style.css"));
1526
- if (singleCss) result.css.push({ href: `/${singleCss.fileName}` });
1691
+ if (singleCss) result.css.push({ href: assetsURL(singleCss.fileName, builder.config) });
1527
1692
  }
1528
1693
  (manifest[environmentName] ??= {})[meta.key] = result;
1529
1694
  }
@@ -1531,7 +1696,7 @@ function assetsPlugin(pluginOpts) {
1531
1696
  const importerEnvironments = new Set(Object.values(importAssetsMetaMap).flatMap((metas) => Object.values(metas)).flatMap((meta) => meta.importerEnvironment));
1532
1697
  for (const environmentName of importerEnvironments) {
1533
1698
  const outDir = builder.environments[environmentName].config.build.outDir;
1534
- fs.writeFileSync(path.join(outDir, BUILD_ASSETS_MANIFEST_NAME), `export default ${JSON.stringify(manifest, null, 2)};`);
1699
+ fs.writeFileSync(path.join(outDir, BUILD_ASSETS_MANIFEST_NAME), `export default ${serializeValueWithRuntime(manifest)};`);
1535
1700
  const clientOutDir = builder.environments["client"].config.build.outDir;
1536
1701
  for (const asset of Object.values(bundleMap[environmentName])) if (asset.type === "asset") {
1537
1702
  const srcFile = path.join(outDir, asset.fileName);
@@ -1606,6 +1771,7 @@ function assetsPlugin(pluginOpts) {
1606
1771
  }
1607
1772
  } },
1608
1773
  resolveId: { handler(source) {
1774
+ if (source === "virtual:fullstack/runtime") return "\0" + source;
1609
1775
  if (source.startsWith("virtual:fullstack/assets?")) return "\0" + source;
1610
1776
  if (source === "virtual:fullstack/assets-manifest") {
1611
1777
  assert$1.notEqual(this.environment.name, "client");
@@ -1615,10 +1781,35 @@ function assetsPlugin(pluginOpts) {
1615
1781
  external: true
1616
1782
  };
1617
1783
  }
1618
- if (source === "virtual:fullstack/runtime") return { id: source };
1619
1784
  } },
1620
1785
  load: { async handler(id) {
1621
- if (id === "virtual:fullstack/runtime") return runtimeUtils();
1786
+ if (id === "\0virtual:fullstack/runtime") return `//#region src/runtime.ts
1787
+ function mergeAssets(...args) {
1788
+ const js = uniqBy(args.flatMap((h) => h.js), (a) => a.href);
1789
+ const css = uniqBy(args.flatMap((h) => h.css), (a) => a.href);
1790
+ const entry = args.filter((arg) => arg.entry)?.[0]?.entry;
1791
+ const raw = {
1792
+ entry,
1793
+ js,
1794
+ css
1795
+ };
1796
+ return {
1797
+ ...raw,
1798
+ merge: (...args$1) => mergeAssets(raw, ...args$1)
1799
+ };
1800
+ }
1801
+ function uniqBy(array, key) {
1802
+ const seen = /* @__PURE__ */ new Set();
1803
+ return array.filter((item) => {
1804
+ const k = key(item);
1805
+ if (seen.has(k)) return false;
1806
+ seen.add(k);
1807
+ return true;
1808
+ });
1809
+ }
1810
+
1811
+ //#endregion
1812
+ export { mergeAssets };`;
1622
1813
  const parsed = parseAssetsVirtual(id);
1623
1814
  if (!parsed) return;
1624
1815
  assert$1.notEqual(this.environment.name, "client");
@@ -1682,12 +1873,10 @@ function assetsPlugin(pluginOpts) {
1682
1873
  if (typeof query["assets"] !== "undefined") {
1683
1874
  if (this.environment.name === "client") return `\0virtual:fullstack/empty-assets`;
1684
1875
  }
1685
- if (source === "virtual:fullstack/runtime") return source;
1686
1876
  }
1687
1877
  },
1688
1878
  load: { async handler(id) {
1689
1879
  if (id === "\0virtual:fullstack/empty-assets") return `export default ${JSON.stringify(EMPTY_ASSETS)}`;
1690
- if (id === "virtual:fullstack/runtime") return runtimeUtils();
1691
1880
  const { filename, query } = parseIdQuery(id);
1692
1881
  const value = query["assets"];
1693
1882
  if (typeof value !== "undefined") {
@@ -1899,25 +2088,42 @@ function patchCssLinkSelfAccept() {
1899
2088
  }
1900
2089
  };
1901
2090
  }
1902
- function runtimeUtils() {
1903
- return `
1904
- export function mergeAssets(...args) {
1905
- const js = uniqBy(args.flatMap((h) => h.js), (a) => a.href);
1906
- const css = uniqBy(args.flatMap((h) => h.css), (a) => a.href);
1907
- const entry = args.filter((arg) => arg.entry)?.[0]?.entry;
1908
- const raw = { entry, js, css };
1909
- return { ...raw, merge: (...args$1) => mergeAssets(raw, ...args$1) };
2091
+ var BuildAssetsURLWithRuntime = class {
2092
+ constructor(runtime) {
2093
+ this.runtime = runtime;
2094
+ }
2095
+ };
2096
+ function serializeValueWithRuntime(value) {
2097
+ const replacements = [];
2098
+ let result = JSON.stringify(value, (_key, value$1) => {
2099
+ if (value$1 instanceof BuildAssetsURLWithRuntime) {
2100
+ const placeholder = `__runtime_placeholder_${replacements.length}__`;
2101
+ replacements.push([placeholder, value$1.runtime]);
2102
+ return placeholder;
2103
+ }
2104
+ return value$1;
2105
+ }, 2);
2106
+ for (const [placeholder, runtime] of replacements) result = result.replace(`"${placeholder}"`, runtime);
2107
+ return result;
2108
+ }
2109
+ function assetsURL(url, config) {
2110
+ if (config.command === "build" && typeof config.experimental?.renderBuiltUrl === "function") {
2111
+ const result = config.experimental.renderBuiltUrl(url, {
2112
+ type: "asset",
2113
+ hostType: "js",
2114
+ ssr: true,
2115
+ hostId: ""
2116
+ });
2117
+ if (typeof result === "object") {
2118
+ if (result.runtime) return new BuildAssetsURLWithRuntime(result.runtime);
2119
+ assert$1(!result.relative, "\"result.relative\" not supported on renderBuiltUrl() for fullstack plugin");
2120
+ } else if (result) return result;
2121
+ }
2122
+ return config.base + url;
1910
2123
  }
1911
- function uniqBy(array, key) {
1912
- const seen = new Set();
1913
- return array.filter((item) => {
1914
- const k = key(item);
1915
- if (seen.has(k)) return false;
1916
- seen.add(k);
1917
- return true;
1918
- });
1919
- }`;
2124
+ function assetsURLDev(url, config) {
2125
+ return config.base + url;
1920
2126
  }
1921
2127
 
1922
2128
  //#endregion
1923
- export { stripLiteral as n, MagicString as r, assetsPlugin as t };
2129
+ export { encode as a, decode as i, stripLiteral as n, MagicString as r, assetsPlugin as t };
@@ -1,169 +1,5 @@
1
- //#region node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
2
- var comma = ",".charCodeAt(0);
3
- var semicolon = ";".charCodeAt(0);
4
- var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
5
- var intToChar = new Uint8Array(64);
6
- var charToInt = new Uint8Array(128);
7
- for (let i = 0; i < chars.length; i++) {
8
- const c = chars.charCodeAt(i);
9
- intToChar[i] = c;
10
- charToInt[c] = i;
11
- }
12
- function decodeInteger(reader, relative) {
13
- let value = 0;
14
- let shift = 0;
15
- let integer = 0;
16
- do {
17
- integer = charToInt[reader.next()];
18
- value |= (integer & 31) << shift;
19
- shift += 5;
20
- } while (integer & 32);
21
- const shouldNegate = value & 1;
22
- value >>>= 1;
23
- if (shouldNegate) value = -2147483648 | -value;
24
- return relative + value;
25
- }
26
- function encodeInteger(builder, num, relative) {
27
- let delta = num - relative;
28
- delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
29
- do {
30
- let clamped = delta & 31;
31
- delta >>>= 5;
32
- if (delta > 0) clamped |= 32;
33
- builder.write(intToChar[clamped]);
34
- } while (delta > 0);
35
- return num;
36
- }
37
- function hasMoreVlq(reader, max) {
38
- if (reader.pos >= max) return false;
39
- return reader.peek() !== comma;
40
- }
41
- var bufLength = 1024 * 16;
42
- var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
43
- return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
44
- } } : { decode(buf) {
45
- let out = "";
46
- for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
47
- return out;
48
- } };
49
- var StringWriter = class {
50
- constructor() {
51
- this.pos = 0;
52
- this.out = "";
53
- this.buffer = new Uint8Array(bufLength);
54
- }
55
- write(v) {
56
- const { buffer } = this;
57
- buffer[this.pos++] = v;
58
- if (this.pos === bufLength) {
59
- this.out += td.decode(buffer);
60
- this.pos = 0;
61
- }
62
- }
63
- flush() {
64
- const { buffer, out, pos } = this;
65
- return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
66
- }
67
- };
68
- var StringReader = class {
69
- constructor(buffer) {
70
- this.pos = 0;
71
- this.buffer = buffer;
72
- }
73
- next() {
74
- return this.buffer.charCodeAt(this.pos++);
75
- }
76
- peek() {
77
- return this.buffer.charCodeAt(this.pos);
78
- }
79
- indexOf(char) {
80
- const { buffer, pos } = this;
81
- const idx = buffer.indexOf(char, pos);
82
- return idx === -1 ? buffer.length : idx;
83
- }
84
- };
85
- function decode(mappings) {
86
- const { length } = mappings;
87
- const reader = new StringReader(mappings);
88
- const decoded = [];
89
- let genColumn = 0;
90
- let sourcesIndex = 0;
91
- let sourceLine = 0;
92
- let sourceColumn = 0;
93
- let namesIndex = 0;
94
- do {
95
- const semi = reader.indexOf(";");
96
- const line = [];
97
- let sorted = true;
98
- let lastCol = 0;
99
- genColumn = 0;
100
- while (reader.pos < semi) {
101
- let seg;
102
- genColumn = decodeInteger(reader, genColumn);
103
- if (genColumn < lastCol) sorted = false;
104
- lastCol = genColumn;
105
- if (hasMoreVlq(reader, semi)) {
106
- sourcesIndex = decodeInteger(reader, sourcesIndex);
107
- sourceLine = decodeInteger(reader, sourceLine);
108
- sourceColumn = decodeInteger(reader, sourceColumn);
109
- if (hasMoreVlq(reader, semi)) {
110
- namesIndex = decodeInteger(reader, namesIndex);
111
- seg = [
112
- genColumn,
113
- sourcesIndex,
114
- sourceLine,
115
- sourceColumn,
116
- namesIndex
117
- ];
118
- } else seg = [
119
- genColumn,
120
- sourcesIndex,
121
- sourceLine,
122
- sourceColumn
123
- ];
124
- } else seg = [genColumn];
125
- line.push(seg);
126
- reader.pos++;
127
- }
128
- if (!sorted) sort(line);
129
- decoded.push(line);
130
- reader.pos = semi + 1;
131
- } while (reader.pos <= length);
132
- return decoded;
133
- }
134
- function sort(line) {
135
- line.sort(sortComparator$1);
136
- }
137
- function sortComparator$1(a, b) {
138
- return a[0] - b[0];
139
- }
140
- function encode(decoded) {
141
- const writer = new StringWriter();
142
- let sourcesIndex = 0;
143
- let sourceLine = 0;
144
- let sourceColumn = 0;
145
- let namesIndex = 0;
146
- for (let i = 0; i < decoded.length; i++) {
147
- const line = decoded[i];
148
- if (i > 0) writer.write(semicolon);
149
- if (line.length === 0) continue;
150
- let genColumn = 0;
151
- for (let j = 0; j < line.length; j++) {
152
- const segment = line[j];
153
- if (j > 0) writer.write(comma);
154
- genColumn = encodeInteger(writer, segment[0], genColumn);
155
- if (segment.length === 1) continue;
156
- sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
157
- sourceLine = encodeInteger(writer, segment[2], sourceLine);
158
- sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
159
- if (segment.length === 4) continue;
160
- namesIndex = encodeInteger(writer, segment[4], namesIndex);
161
- }
162
- }
163
- return writer.flush();
164
- }
1
+ import { a as encode, i as decode } from "../@hiogawa/vite-plugin-fullstack.mjs";
165
2
 
166
- //#endregion
167
3
  //#region node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
168
4
  const schemeRegex = /^[\w+.-]+:\/\//;
169
5
  /**
@@ -609,4 +445,4 @@ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIn
609
445
  }
610
446
 
611
447
  //#endregion
612
- export { toDecodedMap as a, decodedMappings as c, setSourceContent as i, traceSegment as l, maybeAddSegment as n, toEncodedMap as o, setIgnore as r, TraceMap as s, GenMapping as t, encode as u };
448
+ export { toDecodedMap as a, decodedMappings as c, setSourceContent as i, traceSegment as l, maybeAddSegment as n, toEncodedMap as o, setIgnore as r, TraceMap as s, GenMapping as t };
@@ -1,5 +1,5 @@
1
1
  import { i as __toESM, n as __require$1, t as __commonJSMin } from "../../_rolldown.mjs";
2
- import { r as MagicString } from "../@pi0/vite-plugin-fullstack.mjs";
2
+ import { r as MagicString } from "../@hiogawa/vite-plugin-fullstack.mjs";
3
3
  import * as nativeFs$1 from "fs";
4
4
  import { existsSync, readFileSync, statSync } from "fs";
5
5
  import { basename, dirname, extname, isAbsolute, join, normalize, posix, relative, resolve, sep, win32 } from "path";
@@ -1787,10 +1787,10 @@ const resolveSymlinksAsync = function(path$2, state, callback$1) {
1787
1787
  queue.enqueue();
1788
1788
  fs.realpath(path$2, (error, resolvedPath) => {
1789
1789
  if (error) return queue.dequeue(suppressErrors ? null : error, state);
1790
- fs.stat(resolvedPath, (error$1, stat$1) => {
1790
+ fs.stat(resolvedPath, (error$1, stat) => {
1791
1791
  if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
1792
- if (stat$1.isDirectory() && isRecursive(path$2, resolvedPath, state)) return queue.dequeue(null, state);
1793
- callback$1(stat$1, resolvedPath);
1792
+ if (stat.isDirectory() && isRecursive(path$2, resolvedPath, state)) return queue.dequeue(null, state);
1793
+ callback$1(stat, resolvedPath);
1794
1794
  queue.dequeue(null, state);
1795
1795
  });
1796
1796
  });
@@ -1800,9 +1800,9 @@ const resolveSymlinks = function(path$2, state, callback$1) {
1800
1800
  queue.enqueue();
1801
1801
  try {
1802
1802
  const resolvedPath = fs.realpathSync(path$2);
1803
- const stat$1 = fs.statSync(resolvedPath);
1804
- if (stat$1.isDirectory() && isRecursive(path$2, resolvedPath, state)) return;
1805
- callback$1(stat$1, resolvedPath);
1803
+ const stat = fs.statSync(resolvedPath);
1804
+ if (stat.isDirectory() && isRecursive(path$2, resolvedPath, state)) return;
1805
+ callback$1(stat, resolvedPath);
1806
1806
  } catch (e) {
1807
1807
  if (!suppressErrors) throw e;
1808
1808
  }
@@ -2007,8 +2007,8 @@ var Walker = class {
2007
2007
  this.walkDirectory(this.state, path$2, path$2, depth - 1, this.walk);
2008
2008
  } else if (this.resolveSymlink && entry.isSymbolicLink()) {
2009
2009
  let path$2 = joinPathWithBasePath(entry.name, directoryPath);
2010
- this.resolveSymlink(path$2, this.state, (stat$1, resolvedPath) => {
2011
- if (stat$1.isDirectory()) {
2010
+ this.resolveSymlink(path$2, this.state, (stat, resolvedPath) => {
2011
+ if (stat.isDirectory()) {
2012
2012
  resolvedPath = normalizePath$1(resolvedPath, this.state.options);
2013
2013
  if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$2 + pathSeparator)) return;
2014
2014
  this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$2 + pathSeparator, depth - 1, this.walk);
@@ -1,4 +1,4 @@
1
- import { r as MagicString } from "../@pi0/vite-plugin-fullstack.mjs";
1
+ import { r as MagicString } from "../@hiogawa/vite-plugin-fullstack.mjs";
2
2
  import { a as makeLegalIdentifier, n as attachScopes, o as walk, r as createFilter } from "./plugin-commonjs.mjs";
3
3
  import { sep } from "path";
4
4