@nuxt/vite-builder-nightly 4.4.7-29652037.eb785fd0 → 4.4.7-29673425.78b1e698
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/_chunks/libs/@babel/code-frame.mjs +4 -4
- package/dist/_chunks/libs/@babel/compat-data.mjs +2 -2
- package/dist/_chunks/libs/@babel/core.mjs +97 -33
- package/dist/_chunks/rolldown-runtime.mjs +1 -1
- package/dist/index.mjs +60 -34
- package/dist/vite-node.d.mts +1 -1
- package/package.json +11 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __commonJSMin } from "../../rolldown-runtime.mjs";
|
|
2
2
|
var require_identifier = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.isIdentifierChar = isIdentifierChar;
|
|
@@ -1373,9 +1373,9 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1373
1373
|
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
|
1374
1374
|
if (process.emitWarning) process.emitWarning(message, "DeprecationWarning");
|
|
1375
1375
|
else {
|
|
1376
|
-
const deprecationError = new Error(message);
|
|
1376
|
+
const deprecationError = /* @__PURE__ */ new Error(message);
|
|
1377
1377
|
deprecationError.name = "DeprecationWarning";
|
|
1378
|
-
console.warn(new Error(message));
|
|
1378
|
+
console.warn(/* @__PURE__ */ new Error(message));
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
1381
1381
|
colNumber = Math.max(colNumber, 0);
|
|
@@ -1388,4 +1388,4 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1388
1388
|
exports.default = index;
|
|
1389
1389
|
exports.highlight = highlight;
|
|
1390
1390
|
}));
|
|
1391
|
-
export { require_lib
|
|
1391
|
+
export { require_lib, require_lib$1 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __commonJSMin } from "../../rolldown-runtime.mjs";
|
|
2
2
|
var require_plugins$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3
3
|
module.exports = {
|
|
4
4
|
"transform-explicit-resource-management": {
|
|
@@ -868,4 +868,4 @@ var require_native_modules$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
868
868
|
var require_native_modules = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
869
869
|
module.exports = require_native_modules$1();
|
|
870
870
|
}));
|
|
871
|
-
export {
|
|
871
|
+
export { require_native_modules, require_plugins };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { __commonJSMin, __esmMin, __exportAll, __require, __toCommonJS } from "../../rolldown-runtime.mjs";
|
|
2
|
+
import { require_lib as require_lib$13, require_lib$1 as require_lib$12 } from "./code-frame.mjs";
|
|
3
|
+
import { require_native_modules, require_plugins as require_plugins$2 } from "./compat-data.mjs";
|
|
4
4
|
var require_shallowEqual = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = shallowEqual;
|
|
@@ -28068,7 +28068,7 @@ var require_visitors = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
28068
28068
|
for (const nodeType of Object.keys(visitor)) {
|
|
28069
28069
|
if (nodeType === "enter" || nodeType === "exit") validateVisitorMethods(nodeType, visitor[nodeType]);
|
|
28070
28070
|
if (shouldIgnoreKey(nodeType)) continue;
|
|
28071
|
-
if (!TYPES.includes(nodeType)) throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse 7.29.
|
|
28071
|
+
if (!TYPES.includes(nodeType)) throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse 7.29.7`);
|
|
28072
28072
|
const visitors = visitor[nodeType];
|
|
28073
28073
|
if (typeof visitors === "object") for (const visitorKey of Object.keys(visitors)) if (visitorKey === "enter" || visitorKey === "exit") validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]);
|
|
28074
28074
|
else throw new Error(`You passed \`traverse()\` a visitor object with the property ${nodeType} that has the invalid property ${visitorKey}`);
|
|
@@ -30642,7 +30642,8 @@ var require_source_map = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
30642
30642
|
line,
|
|
30643
30643
|
column
|
|
30644
30644
|
});
|
|
30645
|
-
if (
|
|
30645
|
+
if (originalMapping.name && (identifierNamePos || identifierName != null && originalMapping.column === column)) identifierName = originalMapping.name;
|
|
30646
|
+
else if (identifierNamePos) {
|
|
30646
30647
|
const originalIdentifierMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, identifierNamePos);
|
|
30647
30648
|
if (originalIdentifierMapping.name) identifierName = originalIdentifierMapping.name;
|
|
30648
30649
|
}
|
|
@@ -30732,9 +30733,9 @@ var require_buffer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
30732
30733
|
};
|
|
30733
30734
|
return result;
|
|
30734
30735
|
}
|
|
30735
|
-
append(str, maybeNewline) {
|
|
30736
|
+
append(str, maybeNewline, ignoreMapping = false) {
|
|
30736
30737
|
this._flush();
|
|
30737
|
-
this._append(str, maybeNewline);
|
|
30738
|
+
this._append(str, maybeNewline, ignoreMapping);
|
|
30738
30739
|
}
|
|
30739
30740
|
appendChar(char) {
|
|
30740
30741
|
this._flush();
|
|
@@ -30776,7 +30777,7 @@ var require_buffer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
30776
30777
|
position.column = 0;
|
|
30777
30778
|
}
|
|
30778
30779
|
}
|
|
30779
|
-
_append(str, maybeNewline) {
|
|
30780
|
+
_append(str, maybeNewline, ignoreMapping) {
|
|
30780
30781
|
const len = str.length;
|
|
30781
30782
|
const position = this._position;
|
|
30782
30783
|
const sourcePos = this._sourcePosition;
|
|
@@ -30787,7 +30788,7 @@ var require_buffer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
30787
30788
|
this._str = str;
|
|
30788
30789
|
this._appendCount = 0;
|
|
30789
30790
|
} else this._str += str;
|
|
30790
|
-
const hasMap = this._map !== null;
|
|
30791
|
+
const hasMap = !ignoreMapping && this._map !== null;
|
|
30791
30792
|
if (!maybeNewline && !hasMap) {
|
|
30792
30793
|
position.column += len;
|
|
30793
30794
|
return;
|
|
@@ -30858,13 +30859,16 @@ var require_buffer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
30858
30859
|
_normalizePosition(prop, loc, columnOffset) {
|
|
30859
30860
|
this._flush();
|
|
30860
30861
|
const pos = loc[prop];
|
|
30861
|
-
const target = this._sourcePosition;
|
|
30862
30862
|
if (pos) {
|
|
30863
|
-
|
|
30864
|
-
|
|
30865
|
-
target.filename = loc.filename;
|
|
30863
|
+
this.setSourcePosition(pos.line, Math.max(pos.column + columnOffset, 0));
|
|
30864
|
+
this._sourcePosition.filename = loc.filename;
|
|
30866
30865
|
}
|
|
30867
30866
|
}
|
|
30867
|
+
setSourcePosition(line, column) {
|
|
30868
|
+
const target = this._sourcePosition;
|
|
30869
|
+
target.line = line;
|
|
30870
|
+
target.column = column;
|
|
30871
|
+
}
|
|
30868
30872
|
getCurrentColumn() {
|
|
30869
30873
|
return this._position.column + (this._queuedChar ? 1 : 0);
|
|
30870
30874
|
}
|
|
@@ -34808,7 +34812,8 @@ var require_printer$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
34808
34812
|
const spacesCount = count > 0 ? column : column - this._buf.getCurrentColumn();
|
|
34809
34813
|
if (spacesCount > 0) {
|
|
34810
34814
|
const spaces = this._originalCode ? this._originalCode.slice(index - spacesCount, index).replace(/[^\t\x0B\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]/gu, " ") : " ".repeat(spacesCount);
|
|
34811
|
-
this.
|
|
34815
|
+
this._buf.append(spaces, false, true);
|
|
34816
|
+
this._buf.setSourcePosition(line, column);
|
|
34812
34817
|
this.setLastChar(32);
|
|
34813
34818
|
}
|
|
34814
34819
|
}
|
|
@@ -74500,6 +74505,79 @@ var require_convert_source_map = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
74500
74505
|
return options && options.multiline ? "/*# " + data + " */" : "//# " + data;
|
|
74501
74506
|
};
|
|
74502
74507
|
}));
|
|
74508
|
+
var require_read_input_source_map_file = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
74509
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74510
|
+
exports.default = readInputSourceMapFile;
|
|
74511
|
+
function _fs$3() {
|
|
74512
|
+
const data = __require("fs");
|
|
74513
|
+
_fs$3 = function() {
|
|
74514
|
+
return data;
|
|
74515
|
+
};
|
|
74516
|
+
return data;
|
|
74517
|
+
}
|
|
74518
|
+
function _path$4() {
|
|
74519
|
+
const data = __require("path");
|
|
74520
|
+
_path$4 = function() {
|
|
74521
|
+
return data;
|
|
74522
|
+
};
|
|
74523
|
+
return data;
|
|
74524
|
+
}
|
|
74525
|
+
function _debug() {
|
|
74526
|
+
const data = require_src();
|
|
74527
|
+
_debug = function() {
|
|
74528
|
+
return data;
|
|
74529
|
+
};
|
|
74530
|
+
return data;
|
|
74531
|
+
}
|
|
74532
|
+
function _convertSourceMap() {
|
|
74533
|
+
const data = require_convert_source_map();
|
|
74534
|
+
_convertSourceMap = function() {
|
|
74535
|
+
return data;
|
|
74536
|
+
};
|
|
74537
|
+
return data;
|
|
74538
|
+
}
|
|
74539
|
+
const debug = _debug()("babel:transform:file");
|
|
74540
|
+
function findUpSync(name, { cwd, stopAt } = {}) {
|
|
74541
|
+
let directory = _path$4().resolve(cwd || "");
|
|
74542
|
+
const { root } = _path$4().parse(directory);
|
|
74543
|
+
stopAt = _path$4().resolve(directory, stopAt || root);
|
|
74544
|
+
const isAbsoluteName = _path$4().isAbsolute(name);
|
|
74545
|
+
while (directory) {
|
|
74546
|
+
const filePath = isAbsoluteName ? name : _path$4().join(directory, name);
|
|
74547
|
+
try {
|
|
74548
|
+
if (_fs$3().statSync(filePath).isFile()) return filePath;
|
|
74549
|
+
} catch (_) {}
|
|
74550
|
+
if (directory === stopAt || directory === root) break;
|
|
74551
|
+
directory = _path$4().dirname(directory);
|
|
74552
|
+
}
|
|
74553
|
+
}
|
|
74554
|
+
function getInputMapPath(filename, root, inputMapURL) {
|
|
74555
|
+
const inputFileDir = _path$4().dirname(filename);
|
|
74556
|
+
const inputMapPath = _path$4().resolve(inputFileDir, inputMapURL);
|
|
74557
|
+
const relativeToInputFileDir = _path$4().relative(inputFileDir, inputMapPath);
|
|
74558
|
+
if (relativeToInputFileDir.startsWith("..") || _path$4().isAbsolute(relativeToInputFileDir)) {
|
|
74559
|
+
const inputPackageJSONPath = findUpSync("package.json", {
|
|
74560
|
+
cwd: inputFileDir,
|
|
74561
|
+
stopAt: root
|
|
74562
|
+
});
|
|
74563
|
+
const inputFileRoot = inputPackageJSONPath ? _path$4().dirname(inputPackageJSONPath) : root;
|
|
74564
|
+
const relativeInputMapPath = _path$4().relative(inputFileRoot, inputMapPath);
|
|
74565
|
+
if (relativeInputMapPath.startsWith("..") || _path$4().isAbsolute(relativeInputMapPath)) {
|
|
74566
|
+
debug(`discarding input sourcemap "${inputMapPath}" outside of package root "${inputFileRoot}"`);
|
|
74567
|
+
return null;
|
|
74568
|
+
}
|
|
74569
|
+
}
|
|
74570
|
+
return inputMapPath;
|
|
74571
|
+
}
|
|
74572
|
+
function readInputSourceMapFile(filename, root, inputMapURL) {
|
|
74573
|
+
const inputMapPath = getInputMapPath(filename, root, inputMapURL);
|
|
74574
|
+
if (inputMapPath) {
|
|
74575
|
+
const inputMapContent = _fs$3().readFileSync(inputMapPath, "utf8");
|
|
74576
|
+
return _convertSourceMap().fromJSON(inputMapContent);
|
|
74577
|
+
}
|
|
74578
|
+
return null;
|
|
74579
|
+
}
|
|
74580
|
+
}));
|
|
74503
74581
|
var require_missing_plugin_helper = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
74504
74582
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74505
74583
|
exports.default = generateMissingPluginMessage;
|
|
@@ -74914,20 +74992,6 @@ var require_clone_deep = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
74914
74992
|
var require_normalize_file = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
74915
74993
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74916
74994
|
exports.default = normalizeFile;
|
|
74917
|
-
function _fs$3() {
|
|
74918
|
-
const data = __require("fs");
|
|
74919
|
-
_fs$3 = function() {
|
|
74920
|
-
return data;
|
|
74921
|
-
};
|
|
74922
|
-
return data;
|
|
74923
|
-
}
|
|
74924
|
-
function _path$4() {
|
|
74925
|
-
const data = __require("path");
|
|
74926
|
-
_path$4 = function() {
|
|
74927
|
-
return data;
|
|
74928
|
-
};
|
|
74929
|
-
return data;
|
|
74930
|
-
}
|
|
74931
74995
|
function _debug() {
|
|
74932
74996
|
const data = require_src();
|
|
74933
74997
|
_debug = function() {
|
|
@@ -74949,6 +75013,7 @@ var require_normalize_file = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
74949
75013
|
};
|
|
74950
75014
|
return data;
|
|
74951
75015
|
}
|
|
75016
|
+
var _readInputSourceMapFile = require_read_input_source_map_file();
|
|
74952
75017
|
var _file = require_file();
|
|
74953
75018
|
var _index = require_parser();
|
|
74954
75019
|
var _cloneDeep = require_clone_deep();
|
|
@@ -74977,9 +75042,8 @@ var require_normalize_file = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
74977
75042
|
if (!inputMap) {
|
|
74978
75043
|
const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);
|
|
74979
75044
|
if (typeof options.filename === "string" && lastComment) try {
|
|
74980
|
-
const
|
|
74981
|
-
|
|
74982
|
-
inputMap = _convertSourceMap().fromJSON(inputMapContent);
|
|
75045
|
+
const inputMapURL = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment)[1];
|
|
75046
|
+
inputMap = (0, _readInputSourceMapFile.default)(options.filename, options.root, inputMapURL);
|
|
74983
75047
|
} catch (err) {
|
|
74984
75048
|
debug("discarding unknown file input sourcemap", err);
|
|
74985
75049
|
}
|
|
@@ -77250,7 +77314,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
77250
77314
|
var _transformFile = require_transform_file();
|
|
77251
77315
|
var _transformAst = require_transform_ast();
|
|
77252
77316
|
var _parse = require_parse();
|
|
77253
|
-
exports.version = "7.29.
|
|
77317
|
+
exports.version = "7.29.7";
|
|
77254
77318
|
const resolvePlugin = (name, dirname) => resolvers.resolvePlugin(name, dirname, false).filepath;
|
|
77255
77319
|
exports.resolvePlugin = resolvePlugin;
|
|
77256
77320
|
const resolvePreset = (name, dirname) => resolvers.resolvePreset(name, dirname, false).filepath;
|
|
@@ -77272,4 +77336,4 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
77272
77336
|
throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`);
|
|
77273
77337
|
};
|
|
77274
77338
|
}));
|
|
77275
|
-
export { require_lib
|
|
77339
|
+
export { require_lib };
|
|
@@ -32,4 +32,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
32
|
}) : target, mod));
|
|
33
33
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
34
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
35
|
-
export {
|
|
35
|
+
export { __commonJSMin, __esmMin, __exportAll, __require, __toCommonJS, __toESM };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __toESM } from "./_chunks/rolldown-runtime.mjs";
|
|
2
2
|
import { isBuiltin } from "node:module";
|
|
3
3
|
import fs, { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { performance } from "node:perf_hooks";
|
|
@@ -14,15 +14,15 @@ import { filename } from "pathe/utils";
|
|
|
14
14
|
import { resolveModulePath } from "exsolve";
|
|
15
15
|
import MagicString from "magic-string";
|
|
16
16
|
import process from "node:process";
|
|
17
|
-
import { mkdir, readFile, rm,
|
|
17
|
+
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
18
18
|
import net from "node:net";
|
|
19
19
|
import os from "node:os";
|
|
20
20
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
21
21
|
import { Buffer } from "node:buffer";
|
|
22
22
|
import { ViteNodeServer } from "vite-node/server";
|
|
23
23
|
import { normalizeViteManifest, precomputeDependencies } from "vue-bundle-renderer";
|
|
24
|
-
import { hasTTY, isCI, provider } from "std-env";
|
|
25
24
|
import { colorize, stripAnsi } from "consola/utils";
|
|
25
|
+
import { hasTTY, isCI } from "std-env";
|
|
26
26
|
import escapeStringRegexp from "escape-string-regexp";
|
|
27
27
|
import { defu } from "defu";
|
|
28
28
|
import { addDependency } from "nypm";
|
|
@@ -219,19 +219,18 @@ function getManifest(nuxt, viteServer, clientEntry) {
|
|
|
219
219
|
} }
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function pickSocketPath(platform) {
|
|
223
223
|
const socketName = `nuxt-vite-node-${`${process.pid}-${Date.now()}`}`;
|
|
224
|
-
if (
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return join(os.tmpdir(), `${socketName}.sock`);
|
|
224
|
+
if (platform === "win32") return { socketPath: join(String.raw`\\.\pipe`, socketName) };
|
|
225
|
+
const parentDir = fs.mkdtempSync(join(os.tmpdir(), "nuxt-vite-node-"));
|
|
226
|
+
fs.chmodSync(parentDir, 448);
|
|
227
|
+
return {
|
|
228
|
+
socketPath: join(parentDir, `${socketName}.sock`),
|
|
229
|
+
parentDir
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function generateSocketPath() {
|
|
233
|
+
return pickSocketPath(process.platform);
|
|
235
234
|
}
|
|
236
235
|
function useInvalidates() {
|
|
237
236
|
const invalidates = /* @__PURE__ */ new Set();
|
|
@@ -254,12 +253,18 @@ function useInvalidates() {
|
|
|
254
253
|
function ViteNodePlugin(nuxt) {
|
|
255
254
|
if (!nuxt.options.dev) return;
|
|
256
255
|
let socketServer;
|
|
257
|
-
const socketPath = generateSocketPath();
|
|
256
|
+
const { socketPath, parentDir } = generateSocketPath();
|
|
258
257
|
const { invalidates, markInvalidate, markInvalidates } = useInvalidates();
|
|
258
|
+
let cleanedUp = false;
|
|
259
259
|
async function cleanupSocket() {
|
|
260
|
+
if (cleanedUp) return;
|
|
261
|
+
cleanedUp = true;
|
|
260
262
|
if (socketServer && socketServer.listening) await new Promise((resolveClose) => socketServer.close(() => resolveClose()));
|
|
261
|
-
if (
|
|
262
|
-
await
|
|
263
|
+
if (parentDir) try {
|
|
264
|
+
await rm(parentDir, {
|
|
265
|
+
recursive: true,
|
|
266
|
+
force: true
|
|
267
|
+
});
|
|
263
268
|
} catch {}
|
|
264
269
|
}
|
|
265
270
|
const nitro = useNitro();
|
|
@@ -472,15 +477,35 @@ function createViteNodeSocketServer(nuxt, ssrServer, clientServer, invalidates,
|
|
|
472
477
|
});
|
|
473
478
|
const currentSocketPath = config.socketPath;
|
|
474
479
|
if (!currentSocketPath) throw new Error("Socket path not configured for ViteNodeSocketServer.");
|
|
475
|
-
|
|
476
|
-
fs.unlinkSync(currentSocketPath);
|
|
477
|
-
} catch (unlinkError) {
|
|
478
|
-
if (unlinkError.code !== "ENOENT") {}
|
|
479
|
-
}
|
|
480
|
-
server.listen(currentSocketPath);
|
|
480
|
+
listenAndRestrict(server, currentSocketPath);
|
|
481
481
|
server.on("error", () => {});
|
|
482
482
|
return server;
|
|
483
483
|
}
|
|
484
|
+
function listenAndRestrict(server, socketPath) {
|
|
485
|
+
if (socketPath.startsWith("\\\\.\\pipe\\")) {
|
|
486
|
+
server.listen(socketPath);
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
const previousUmask = process.umask(63);
|
|
490
|
+
try {
|
|
491
|
+
server.listen(socketPath, () => {
|
|
492
|
+
try {
|
|
493
|
+
fs.chmodSync(socketPath, 384);
|
|
494
|
+
} catch (error) {
|
|
495
|
+
console.error("[nuxt] Failed to restrict vite-node socket permissions; closing.", error);
|
|
496
|
+
server.close();
|
|
497
|
+
try {
|
|
498
|
+
fs.rmSync(dirname(socketPath), {
|
|
499
|
+
recursive: true,
|
|
500
|
+
force: true
|
|
501
|
+
});
|
|
502
|
+
} catch {}
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
} finally {
|
|
506
|
+
process.umask(previousUmask);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
484
509
|
function sendResponse(socket, id, data) {
|
|
485
510
|
try {
|
|
486
511
|
const responseJSON = JSON.stringify({
|
|
@@ -522,8 +547,8 @@ function sendError(socket, id, error) {
|
|
|
522
547
|
if (err) {}
|
|
523
548
|
});
|
|
524
549
|
}
|
|
525
|
-
const PREFIX = "
|
|
526
|
-
const PREFIX_RE =
|
|
550
|
+
const PREFIX = "\0virtual:public?";
|
|
551
|
+
const PREFIX_RE = /^\0virtual:public\?/;
|
|
527
552
|
const CSS_URL_RE = /url\((\/[^)]+)\)/g;
|
|
528
553
|
const CSS_URL_SINGLE_RE = /url\(\/[^)]+\)/;
|
|
529
554
|
const RENDER_CHUNK_RE = /(?<= = )['"`]/;
|
|
@@ -553,7 +578,7 @@ const PublicDirsPlugin = (options) => {
|
|
|
553
578
|
order: "pre",
|
|
554
579
|
filter: { id: PREFIX_RE },
|
|
555
580
|
handler(id) {
|
|
556
|
-
return `import { publicAssetsURL } from '#internal/nuxt/paths';export default publicAssetsURL(${JSON.stringify(decodeURIComponent(id.slice(
|
|
581
|
+
return `import { publicAssetsURL } from '#internal/nuxt/paths';export default publicAssetsURL(${JSON.stringify(decodeURIComponent(id.slice(16)))})`;
|
|
557
582
|
}
|
|
558
583
|
},
|
|
559
584
|
resolveId: {
|
|
@@ -702,7 +727,7 @@ function createViteLogger(config, ctx = {}) {
|
|
|
702
727
|
}
|
|
703
728
|
function formatIncludeSnippet(deps, cjsDeps) {
|
|
704
729
|
if (!deps.length) return "[]";
|
|
705
|
-
return `[\n${
|
|
730
|
+
return `[\n${deps.toSorted().map((d) => {
|
|
706
731
|
return ` '${d}',${cjsDeps?.has(d) ? " // CJS" : ""}`;
|
|
707
732
|
}).join("\n")}\n ]`;
|
|
708
733
|
}
|
|
@@ -979,7 +1004,7 @@ function DevServerPlugin(nuxt) {
|
|
|
979
1004
|
const hmrPortDefault = 24678;
|
|
980
1005
|
serverDefaults.hmr.port = await getPort({
|
|
981
1006
|
verbose: false,
|
|
982
|
-
portRange: [hmrPortDefault,
|
|
1007
|
+
portRange: [hmrPortDefault, 24698]
|
|
983
1008
|
});
|
|
984
1009
|
}
|
|
985
1010
|
if (nuxt.options.devServer.https) serverDefaults.https = nuxt.options.devServer.https === true ? {} : nuxt.options.devServer.https;
|
|
@@ -1435,7 +1460,7 @@ async function buildServer(nuxt, ctx) {
|
|
|
1435
1460
|
const hmrPortDefault = 24678;
|
|
1436
1461
|
serverConfig.server.hmr.port ||= await getPort({
|
|
1437
1462
|
verbose: false,
|
|
1438
|
-
portRange: [hmrPortDefault,
|
|
1463
|
+
portRange: [hmrPortDefault, 24698]
|
|
1439
1464
|
});
|
|
1440
1465
|
}
|
|
1441
1466
|
}
|
|
@@ -1856,8 +1881,7 @@ function LayerDepOptimizePlugin(nuxt) {
|
|
|
1856
1881
|
const delimitedRootDir = nuxt.options.rootDir + "/";
|
|
1857
1882
|
for (const dirs of getLayerDirectories(nuxt)) if (dirs.app !== nuxt.options.srcDir && !dirs.app.startsWith(delimitedRootDir)) layerDirs.push(dirs.app);
|
|
1858
1883
|
if (layerDirs.length > 0) {
|
|
1859
|
-
layerDirs.
|
|
1860
|
-
const dirs = [...layerDirs];
|
|
1884
|
+
const dirs = layerDirs.toSorted().reverse();
|
|
1861
1885
|
return {
|
|
1862
1886
|
name: "nuxt:optimize-layer-deps",
|
|
1863
1887
|
enforce: "pre",
|
|
@@ -1911,7 +1935,7 @@ function DecoratorsPlugin(nuxt) {
|
|
|
1911
1935
|
apply: () => !!nuxt.options.experimental.decorators,
|
|
1912
1936
|
async applyToEnvironment() {
|
|
1913
1937
|
if (!await ensureBabelDecoratorDeps(nuxt)) return false;
|
|
1914
|
-
transformSync = await import("./_chunks/libs/@babel/core.mjs").then((n) => /* @__PURE__ */ __toESM(n.
|
|
1938
|
+
transformSync = await import("./_chunks/libs/@babel/core.mjs").then((n) => /* @__PURE__ */ __toESM(n.require_lib(), 1)).then((r) => r.transformSync);
|
|
1915
1939
|
return true;
|
|
1916
1940
|
},
|
|
1917
1941
|
transform: {
|
|
@@ -2426,7 +2450,9 @@ async function handleEnvironments(nuxt, config) {
|
|
|
2426
2450
|
}
|
|
2427
2451
|
nuxt._perf?.startPhase("vite:dev-server");
|
|
2428
2452
|
await withLogs(async () => {
|
|
2429
|
-
|
|
2453
|
+
const server = await createServer(config);
|
|
2454
|
+
nuxt.hook("close", () => server.close());
|
|
2455
|
+
await server.environments.ssr.pluginContainer.buildStart({});
|
|
2430
2456
|
}, "Vite dev server built");
|
|
2431
2457
|
nuxt._perf?.endPhase("vite:dev-server");
|
|
2432
2458
|
}
|
package/dist/vite-node.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PluginContainer } from "vite";
|
|
2
|
-
import { Socket } from "node:net";
|
|
2
|
+
import net, { Socket } from "node:net";
|
|
3
3
|
import { Manifest } from "vue-bundle-renderer";
|
|
4
4
|
import { FetchResult } from "vite-node";
|
|
5
5
|
type ResolveIdResponse = Awaited<ReturnType<PluginContainer["resolveId"]>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/vite-builder-nightly",
|
|
3
|
-
"version": "4.4.7-
|
|
3
|
+
"version": "4.4.7-29673425.78b1e698",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.4.7-
|
|
26
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.4.7-29673425.78b1e698",
|
|
27
27
|
"@rollup/plugin-replace": "^6.0.3",
|
|
28
28
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
29
29
|
"@vitejs/plugin-vue-jsx": "^5.1.5",
|
|
@@ -42,33 +42,33 @@
|
|
|
42
42
|
"nypm": "^0.6.6",
|
|
43
43
|
"pathe": "^2.0.3",
|
|
44
44
|
"pkg-types": "^2.3.1",
|
|
45
|
-
"postcss": "^8.5.
|
|
45
|
+
"postcss": "^8.5.15",
|
|
46
46
|
"seroval": "^1.5.4",
|
|
47
47
|
"std-env": "^4.1.0",
|
|
48
48
|
"ufo": "^1.6.4",
|
|
49
49
|
"unenv": "^2.0.0-rc.24",
|
|
50
50
|
"vite": "^7.3.3",
|
|
51
51
|
"vite-node": "^5.3.0",
|
|
52
|
-
"vite-plugin-checker": "^0.
|
|
52
|
+
"vite-plugin-checker": "^0.14.1",
|
|
53
53
|
"vue-bundle-renderer": "^2.2.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@babel/plugin-proposal-decorators": "7.29.
|
|
57
|
-
"@babel/plugin-syntax-jsx": "7.
|
|
58
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.4.7-
|
|
56
|
+
"@babel/plugin-proposal-decorators": "7.29.7",
|
|
57
|
+
"@babel/plugin-syntax-jsx": "7.29.7",
|
|
58
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.4.7-29673425.78b1e698",
|
|
59
59
|
"h3": "1.15.11",
|
|
60
60
|
"h3-next": "npm:h3@2.0.1-rc.22",
|
|
61
61
|
"nitropack": "2.13.4",
|
|
62
|
-
"obuild": "0.4.
|
|
63
|
-
"rolldown": "1.0.
|
|
62
|
+
"obuild": "0.4.36",
|
|
63
|
+
"rolldown": "1.0.3",
|
|
64
64
|
"rollup": "4.60.4",
|
|
65
65
|
"rollup-plugin-visualizer": "7.0.1",
|
|
66
|
-
"vue": "3.5.
|
|
66
|
+
"vue": "3.5.35"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@babel/plugin-proposal-decorators": "^7.25.0",
|
|
70
70
|
"@babel/plugin-syntax-jsx": "^7.25.0",
|
|
71
|
-
"nuxt": "npm:nuxt-nightly@4.4.7-
|
|
71
|
+
"nuxt": "npm:nuxt-nightly@4.4.7-29673425.78b1e698",
|
|
72
72
|
"rolldown": "^1.0.0-beta.38",
|
|
73
73
|
"rollup-plugin-visualizer": "^6.0.0 || ^7.0.1",
|
|
74
74
|
"vue": "^3.3.4"
|