@voidzero-dev/vite-plus-core 0.1.16 → 0.1.17-alpha.0
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.
|
@@ -72,7 +72,7 @@ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
72
72
|
}));
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region ../../vite/packages/vite/package.json
|
|
75
|
-
var version = "8.0.
|
|
75
|
+
var version = "8.0.7";
|
|
76
76
|
//#endregion
|
|
77
77
|
//#region ../../vite/packages/vite/src/node/constants.ts
|
|
78
78
|
const ROLLUP_HOOKS = [
|
|
@@ -16,7 +16,7 @@ import { VERSION as rolldownVersion, rolldown } from "@voidzero-dev/vite-plus-co
|
|
|
16
16
|
import os from "node:os";
|
|
17
17
|
import net from "node:net";
|
|
18
18
|
import childProcess, { exec, execFile, execSync } from "node:child_process";
|
|
19
|
-
import { promises } from "node:dns";
|
|
19
|
+
import { getDefaultResultOrder, promises } from "node:dns";
|
|
20
20
|
import { isatty } from "node:tty";
|
|
21
21
|
import path$1, { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, normalize as normalize$1, posix as posix$1, relative as relative$1, resolve as resolve$1, sep as sep$1, win32 } from "path";
|
|
22
22
|
import { exactRegex, makeIdFiltersToMatchWithQuery, prefixRegex, withFilter } from "@voidzero-dev/vite-plus-core/rolldown/filter";
|
|
@@ -3912,9 +3912,11 @@ function unique(arr) {
|
|
|
3912
3912
|
* Even if defaultResultOrder is `ipv4first`, `dns.lookup` result maybe same.
|
|
3913
3913
|
* For example, when IPv6 is not supported on that machine/network.
|
|
3914
3914
|
*/
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
return
|
|
3915
|
+
function getLocalhostAddressIfDiffersFromDNS() {
|
|
3916
|
+
if (getDefaultResultOrder() === "verbatim") return;
|
|
3917
|
+
return Promise.all([promises.lookup("localhost"), promises.lookup("localhost", { verbatim: true })]).then(([nodeResult, dnsResult]) => {
|
|
3918
|
+
return nodeResult.family === dnsResult.family && nodeResult.address === dnsResult.address ? void 0 : nodeResult.address;
|
|
3919
|
+
});
|
|
3918
3920
|
}
|
|
3919
3921
|
function diffDnsOrderChange(oldUrls, newUrls) {
|
|
3920
3922
|
return !(oldUrls === newUrls || oldUrls && newUrls && arrayEqual(oldUrls.local, newUrls.local) && arrayEqual(oldUrls.network, newUrls.network));
|
|
@@ -4389,6 +4391,10 @@ function formatAndTruncateFileList(files) {
|
|
|
4389
4391
|
truncated
|
|
4390
4392
|
};
|
|
4391
4393
|
}
|
|
4394
|
+
const hashbangRE = /^#!.*\n/;
|
|
4395
|
+
function getFileStartIndex(code) {
|
|
4396
|
+
return hashbangRE.exec(code)?.[0].length ?? 0;
|
|
4397
|
+
}
|
|
4392
4398
|
//#endregion
|
|
4393
4399
|
//#region ../../vite/packages/vite/src/node/plugin.ts
|
|
4394
4400
|
async function resolveEnvironmentPlugins(environment) {
|
|
@@ -15913,7 +15919,6 @@ const ssrDynamicImportKey = `__vite_ssr_dynamic_import__`;
|
|
|
15913
15919
|
const ssrExportAllKey = `__vite_ssr_exportAll__`;
|
|
15914
15920
|
const ssrExportNameKey = `__vite_ssr_exportName__`;
|
|
15915
15921
|
const ssrImportMetaKey = `__vite_ssr_import_meta__`;
|
|
15916
|
-
const hashbangRE = /^#!.*\n/;
|
|
15917
15922
|
async function ssrTransform(code, inMap, url, originalCode, options) {
|
|
15918
15923
|
if (options?.json?.stringify && isJSONRequest(url)) return ssrTransformJSON(code, inMap);
|
|
15919
15924
|
return ssrTransformScript(code, inMap, url, originalCode);
|
|
@@ -15950,7 +15955,7 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
|
|
|
15950
15955
|
const dynamicDeps = /* @__PURE__ */ new Set();
|
|
15951
15956
|
const idToImportMap = /* @__PURE__ */ new Map();
|
|
15952
15957
|
const declaredConst = /* @__PURE__ */ new Set();
|
|
15953
|
-
const fileStartIndex =
|
|
15958
|
+
const fileStartIndex = getFileStartIndex(code);
|
|
15954
15959
|
let hoistIndex = fileStartIndex;
|
|
15955
15960
|
function defineImport(index, importNode, metadata) {
|
|
15956
15961
|
const source = importNode.source.value;
|
|
@@ -26988,6 +26993,7 @@ const makeScssWorker = (environment, resolvers, _maxWorkers) => {
|
|
|
26988
26993
|
const scssProcessor = (maxWorkers) => {
|
|
26989
26994
|
let worker;
|
|
26990
26995
|
let failedSassEmbedded;
|
|
26996
|
+
const normalizedErrors = /* @__PURE__ */ new WeakSet();
|
|
26991
26997
|
return {
|
|
26992
26998
|
close() {
|
|
26993
26999
|
worker?.stop();
|
|
@@ -27023,13 +27029,16 @@ const scssProcessor = (maxWorkers) => {
|
|
|
27023
27029
|
deps
|
|
27024
27030
|
};
|
|
27025
27031
|
} catch (e) {
|
|
27026
|
-
e
|
|
27027
|
-
|
|
27028
|
-
|
|
27029
|
-
|
|
27030
|
-
|
|
27031
|
-
|
|
27032
|
-
|
|
27032
|
+
if (!normalizedErrors.has(e)) {
|
|
27033
|
+
e.message = `[sass] ${e.message}`;
|
|
27034
|
+
e.id = e.file;
|
|
27035
|
+
e.frame = e.formatted;
|
|
27036
|
+
if (e.span?.start) {
|
|
27037
|
+
e.line = e.span.start.line + 1;
|
|
27038
|
+
e.column = e.span.start.column + 1;
|
|
27039
|
+
e.frame = e.message;
|
|
27040
|
+
}
|
|
27041
|
+
normalizedErrors.add(e);
|
|
27033
27042
|
}
|
|
27034
27043
|
return {
|
|
27035
27044
|
code: "",
|
|
@@ -33375,8 +33384,10 @@ function interopNamedImports(str, importSpecifier, rewrittenUrl, importIndex, im
|
|
|
33375
33384
|
if (dynamicIndex > -1) str.overwrite(expStart, expEnd, `import('${rewrittenUrl}').then(m => (${interopHelperStr})(m.default, ${!!config.legacy?.inconsistentCjsInterop ? 0 : 1}))` + getLineBreaks(exp), { contentOnly: true });
|
|
33376
33385
|
else {
|
|
33377
33386
|
const rewritten = transformCjsImport(exp, rewrittenUrl, source.slice(start, end), importIndex, importer, isNodeMode, config);
|
|
33378
|
-
if (rewritten)
|
|
33379
|
-
|
|
33387
|
+
if (rewritten) {
|
|
33388
|
+
str.overwrite(expStart, expEnd, rewritten.importLine + getLineBreaks(exp), { contentOnly: true });
|
|
33389
|
+
if (rewritten.hoistedAssignments) str.appendLeft(getFileStartIndex(source), rewritten.hoistedAssignments + ";");
|
|
33390
|
+
} else str.overwrite(start, end, rewrittenUrl + getLineBreaks(source.slice(start, end)), { contentOnly: true });
|
|
33380
33391
|
}
|
|
33381
33392
|
}
|
|
33382
33393
|
function getLineBreaks(str) {
|
|
@@ -33399,7 +33410,7 @@ function transformCjsImport(importExp, url, rawUrl, importIndex, importer, isNod
|
|
|
33399
33410
|
const node = parseAst(importExp).body[0];
|
|
33400
33411
|
if (config.command === "serve" && node.type === "ExportAllDeclaration" && !node.exported) config.logger.warn(import_picocolors.default.yellow(`\nUnable to interop \`${importExp}\` in ${importer}, this may lose module exports. Please export "${rawUrl}" as ESM or use named exports instead, e.g. \`export { A, B } from "${rawUrl}"\``));
|
|
33401
33412
|
else if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration") {
|
|
33402
|
-
if (!node.specifiers.length) return `import "${url}"
|
|
33413
|
+
if (!node.specifiers.length) return { importLine: `import "${url}"` };
|
|
33403
33414
|
const importNames = [];
|
|
33404
33415
|
const exportNames = [];
|
|
33405
33416
|
let defaultExports = "";
|
|
@@ -33436,7 +33447,8 @@ function transformCjsImport(importExp, url, rawUrl, importIndex, importer, isNod
|
|
|
33436
33447
|
}
|
|
33437
33448
|
}
|
|
33438
33449
|
const cjsModuleName = makeLegalIdentifier(`__vite__cjsImport${importIndex}_${rawUrl}`);
|
|
33439
|
-
const
|
|
33450
|
+
const importLine = `import ${cjsModuleName} from "${url}"`;
|
|
33451
|
+
const lines = [];
|
|
33440
33452
|
importNames.forEach(({ importedName, localName }) => {
|
|
33441
33453
|
if (importedName === "*") lines.push(`const ${localName} = (${interopHelperStr})(${cjsModuleName}, ${+isNodeMode})`);
|
|
33442
33454
|
else if (importedName === "default") if (isNodeMode) lines.push(`const ${localName} = ${cjsModuleName}`);
|
|
@@ -33445,7 +33457,10 @@ function transformCjsImport(importExp, url, rawUrl, importIndex, importer, isNod
|
|
|
33445
33457
|
});
|
|
33446
33458
|
if (defaultExports) lines.push(`export default ${defaultExports}`);
|
|
33447
33459
|
if (exportNames.length) lines.push(`export { ${exportNames.join(", ")} }`);
|
|
33448
|
-
return
|
|
33460
|
+
return {
|
|
33461
|
+
importLine,
|
|
33462
|
+
hoistedAssignments: lines.join("; ")
|
|
33463
|
+
};
|
|
33449
33464
|
}
|
|
33450
33465
|
}
|
|
33451
33466
|
function getIdentifierNameOrLiteralValue(node) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voidzero-dev/vite-plus-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17-alpha.0",
|
|
4
4
|
"description": "The Unified Toolchain for the Web",
|
|
5
5
|
"homepage": "https://viteplus.dev/guide",
|
|
6
6
|
"bugs": {
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"hookable": "^6.0.1",
|
|
118
118
|
"magic-string": "^0.30.21",
|
|
119
119
|
"oxc-parser": "=0.123.0",
|
|
120
|
-
"oxfmt": "=0.
|
|
120
|
+
"oxfmt": "=0.44.0",
|
|
121
121
|
"picocolors": "^1.1.1",
|
|
122
122
|
"picomatch": "^4.0.3",
|
|
123
123
|
"pkg-types": "^2.3.0",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"tree-kill": "^1.2.2",
|
|
130
130
|
"tsdown": "^0.21.7",
|
|
131
131
|
"rolldown": "1.0.0-rc.13",
|
|
132
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.
|
|
132
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.17-alpha.0"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@arethetypeswrong/core": "^0.18.1",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"@tsdown/exe": "0.21.7",
|
|
138
138
|
"@types/node": "^20.19.0 || >=22.12.0",
|
|
139
139
|
"@vitejs/devtools": "^0.1.0",
|
|
140
|
-
"esbuild": "^0.28.0",
|
|
140
|
+
"esbuild": "^0.27.0 || ^0.28.0",
|
|
141
141
|
"jiti": ">=1.21.0",
|
|
142
142
|
"less": "^4.0.0",
|
|
143
143
|
"publint": "^0.3.0",
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
"node": "^20.19.0 || >=22.12.0"
|
|
215
215
|
},
|
|
216
216
|
"bundledVersions": {
|
|
217
|
-
"vite": "8.0.
|
|
217
|
+
"vite": "8.0.7",
|
|
218
218
|
"rolldown": "1.0.0-rc.13",
|
|
219
219
|
"tsdown": "0.21.7"
|
|
220
220
|
},
|