@voidzero-dev/vite-plus-core 0.1.17-alpha.3 → 0.1.17-alpha.5

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,6 +1,6 @@
1
- import { D as toArray, w as resolveComma } from "./main-CSVR9Fv3.js";
1
+ import { D as toArray, w as resolveComma } from "./main-Ccx2FDJq.js";
2
2
  import { n as enable, r as namespaces, t as createDebug } from "./node-B3Gdtau1.js";
3
- //#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@type_40fa21a6dd0aac837d14f6503ecc360a/node_modules/tsdown/dist/debug-BmAPbhgA.mjs
3
+ //#region ../../node_modules/.pnpm/tsdown@0.21.8_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.8_@tsdown+exe@0.21.8_@type_bf863151738d83584e36df49913526fa/node_modules/tsdown/dist/debug-CLlnG64L.mjs
4
4
  const debugLog = createDebug("tsdown:debug");
5
5
  function enableDebug(debug) {
6
6
  if (!debug) return;
@@ -1,7 +1,7 @@
1
1
  import process from "node:process";
2
2
  import path from "node:path";
3
3
  import fs from "node:fs/promises";
4
- //#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@type_40fa21a6dd0aac837d14f6503ecc360a/node_modules/tsdown/dist/detect-h8ZFBH96.mjs
4
+ //#region ../../node_modules/.pnpm/tsdown@0.21.8_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.8_@tsdown+exe@0.21.8_@type_bf863151738d83584e36df49913526fa/node_modules/tsdown/dist/detect-DN3DXXYt.mjs
5
5
  const AGENTS = [
6
6
  "npm",
7
7
  "yarn",
@@ -1,7 +1,7 @@
1
1
  import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./chunk-CSNpwdVU.js";
2
2
  import { t as createDebug } from "./node-B3Gdtau1.js";
3
3
  import { a as RE_JSON, c as RE_TS, d as filename_js_to_dts, f as filename_to_dts, i as RE_JS, l as RE_VUE, m as resolveTemplateFn, n as RE_DTS, o as RE_NODE_MODULES, p as replaceTemplateName, r as RE_DTS_MAP, s as RE_ROLLDOWN_RUNTIME, t as RE_CSS, u as filename_dts_to } from "./filename-DQnUJlio-DHPB7cQg.js";
4
- import { n as pe, t as Ge } from "./dist-CxeZzY9B.js";
4
+ import { n as pe, t as Ge } from "./dist-CbhZqEsp.js";
5
5
  import { n as globalContext, r as invalidateContextFile, t as createContext } from "./tsc-context-C2cC1Bhi.js";
6
6
  import { createRequire } from "node:module";
7
7
  import process from "node:process";
@@ -1,9 +1,9 @@
1
1
  import module from "node:module";
2
2
  import path from "node:path";
3
- import re from "node:fs";
4
- import nativeFs from "fs";
3
+ import fs from "node:fs";
4
+ import xe from "fs";
5
5
  import Be from "os";
6
- import path$1 from "path";
6
+ import Ie from "path";
7
7
  //#region ../../node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.mjs
8
8
  const A = (r) => r !== null && typeof r == "object", a = (r, t) => Object.assign(/* @__PURE__ */ new Error(`[${r}]: ${t}`), { code: r }), _ = "ERR_INVALID_PACKAGE_CONFIG", E$1 = "ERR_INVALID_PACKAGE_TARGET", I$1 = "ERR_PACKAGE_PATH_NOT_EXPORTED", R = /^\d+$/, O$1 = /^(\.{1,2}|node_modules)$/i, w = /\/|\\/;
9
9
  var h$1 = ((r) => (r.Export = "exports", r.Import = "imports", r))(h$1 || {});
@@ -63,11 +63,11 @@ function h(e) {
63
63
  }
64
64
  i(h, "slash");
65
65
  const Z = i((e) => {
66
- const t = re[e];
66
+ const t = fs[e];
67
67
  return (s, ...n) => {
68
68
  const o = `${e}:${n.join(":")}`;
69
69
  let l = s == null ? void 0 : s.get(o);
70
- return l === void 0 && (l = Reflect.apply(t, re, n), s?.set(o, l)), l;
70
+ return l === void 0 && (l = Reflect.apply(t, fs, n), s?.set(o, l)), l;
71
71
  };
72
72
  }, "cacheFs"), E = Z("existsSync"), $e = Z("readFileSync"), G = Z("statSync"), fe = i((e, t, s) => {
73
73
  for (;;) {
@@ -773,7 +773,7 @@ const Ae = X((e) => {
773
773
  }
774
774
  return t;
775
775
  }, "invertCase"), le = /* @__PURE__ */ new Map(), _e = X((e, t) => {
776
- const s = path$1.join(e, `.is-fs-case-sensitive-test-${process.pid}`);
776
+ const s = Ie.join(e, `.is-fs-case-sensitive-test-${process.pid}`);
777
777
  try {
778
778
  return t.writeFileSync(s, ""), !t.existsSync(Ae(s));
779
779
  } finally {
@@ -788,7 +788,7 @@ const Ae = X((e) => {
788
788
  if (t === void 0) return _e(Be.tmpdir(), s);
789
789
  throw n;
790
790
  }
791
- }, "checkDirectoryCaseWithFallback"), Oe = X((e, t = nativeFs, s = !0) => {
791
+ }, "checkDirectoryCaseWithFallback"), Oe = X((e, t = xe, s = !0) => {
792
792
  const n = e != null ? e : process.cwd();
793
793
  if (s && le.has(n)) return le.get(n);
794
794
  let o;
@@ -3,7 +3,7 @@ import process from "node:process";
3
3
  import "node:child_process";
4
4
  import path from "node:path";
5
5
  import { rolldown } from "@voidzero-dev/vite-plus-core/rolldown";
6
- import re, { existsSync } from "node:fs";
6
+ import fs, { existsSync } from "node:fs";
7
7
  import { tmpdir } from "node:os";
8
8
  import { fileURLToPath, pathToFileURL } from "node:url";
9
9
  import { Buffer } from "node:buffer";
@@ -54,7 +54,7 @@ function resolveOptions(options = {}) {
54
54
  inputOptions: options.inputOptions,
55
55
  outputOptions: options.outputOptions
56
56
  };
57
- if (!re.existsSync(resolvedOptions.path)) throw new Error(`[unrun] File not found: ${resolvedOptions.path}`);
57
+ if (!fs.existsSync(resolvedOptions.path)) throw new Error(`[unrun] File not found: ${resolvedOptions.path}`);
58
58
  if (!new Set([
59
59
  "none",
60
60
  "jiti",
@@ -268,7 +268,7 @@ function createJsonLoader() {
268
268
  let isRequire = false;
269
269
  try {
270
270
  if (importer) {
271
- const src = re.readFileSync(importer, "utf8");
271
+ const src = fs.readFileSync(importer, "utf8");
272
272
  const escaped = source.replaceAll(/[.*+?^${}()|[\]\\]/g, (m) => `\\${m}`);
273
273
  const pattern = String.raw`\brequire\s*\(\s*['"]${escaped}['"]\s*\)`;
274
274
  isRequire = new RegExp(pattern).test(src);
@@ -281,7 +281,7 @@ function createJsonLoader() {
281
281
  handler(id) {
282
282
  try {
283
283
  const realId = id.replace(/\?unrun-json\.(?:mjs|cjs)$/, "");
284
- const src = re.readFileSync(realId, "utf8");
284
+ const src = fs.readFileSync(realId, "utf8");
285
285
  const data = JSON.parse(src);
286
286
  const jsonLiteral = JSON.stringify(data);
287
287
  if (id.endsWith("?unrun-json.cjs")) return { code: `const __data = ${jsonLiteral}\ntry { Object.defineProperty(__data, 'default', { value: __data, enumerable: false, configurable: true }) } catch {}\nmodule.exports = __data\n` };
@@ -375,7 +375,7 @@ function createRequireResolveFix(options) {
375
375
  ".cjs"
376
376
  ]) {
377
377
  const testPath = path.resolve(baseDir, id + ext);
378
- if (re.existsSync(testPath)) return JSON.stringify(testPath);
378
+ if (fs.existsSync(testPath)) return JSON.stringify(testPath);
379
379
  }
380
380
  const resolvedPath = path.resolve(baseDir, id);
381
381
  return JSON.stringify(resolvedPath);
@@ -416,7 +416,7 @@ function createSourceContextShimsPlugin() {
416
416
  const normalizedPhysicalId = path.normalize(physicalId);
417
417
  let code;
418
418
  try {
419
- code = re.readFileSync(normalizedPhysicalId, "utf8");
419
+ code = fs.readFileSync(normalizedPhysicalId, "utf8");
420
420
  } catch {
421
421
  return null;
422
422
  }
@@ -658,7 +658,7 @@ function cleanModule(moduleUrl, options) {
658
658
  try {
659
659
  if (moduleUrl.startsWith("file://")) {
660
660
  const filePath = new URL(moduleUrl);
661
- re.unlinkSync(filePath);
661
+ fs.unlinkSync(filePath);
662
662
  }
663
663
  } catch (error) {
664
664
  if (error.code !== "ENOENT") throw error;
@@ -682,14 +682,14 @@ function writeModule(code, options) {
682
682
  const projectNodeModules = path.join(process.cwd(), "node_modules");
683
683
  const outDir = path.join(projectNodeModules, ".unrun");
684
684
  const outFile = path.join(outDir, fname);
685
- if (!re.existsSync(outFile)) try {
686
- re.mkdirSync(outDir, { recursive: true });
687
- re.writeFileSync(outFile, code, "utf8");
685
+ if (!fs.existsSync(outFile)) try {
686
+ fs.mkdirSync(outDir, { recursive: true });
687
+ fs.writeFileSync(outFile, code, "utf8");
688
688
  } catch {
689
689
  const fallbackDir = path.join(tmpdir(), "unrun-cache");
690
690
  const fallbackFile = path.join(fallbackDir, fname);
691
- re.mkdirSync(fallbackDir, { recursive: true });
692
- re.writeFileSync(fallbackFile, code, "utf8");
691
+ fs.mkdirSync(fallbackDir, { recursive: true });
692
+ fs.writeFileSync(fallbackFile, code, "utf8");
693
693
  moduleUrl = pathToFileURL(fallbackFile).href;
694
694
  }
695
695
  moduleUrl = moduleUrl || pathToFileURL(outFile).href;