@voidzero-dev/vite-plus-core 0.1.12-alpha.2 → 0.1.13-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.
@@ -5,7 +5,7 @@ import "node:child_process";
5
5
  import path from "node:path";
6
6
  import { rolldown } from "@voidzero-dev/vite-plus-core/rolldown";
7
7
  import { tmpdir } from "node:os";
8
- import re, { existsSync } from "node:fs";
8
+ import fs, { existsSync } from "node:fs";
9
9
  import { Buffer } from "node:buffer";
10
10
  import crypto from "node:crypto";
11
11
  //#region ../../node_modules/.pnpm/unrun@0.2.32/node_modules/unrun/dist/src-GU5PtktT.mjs
@@ -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;
@@ -11,7 +11,7 @@ import { importerId, include } from "@voidzero-dev/vite-plus-core/rolldown/filte
11
11
  import nativeFs from "fs";
12
12
  import path$1 from "path";
13
13
  import { tmpdir } from "node:os";
14
- import re, { existsSync } from "node:fs";
14
+ import fs$1, { existsSync } from "node:fs";
15
15
  import { ResolverFactory, isolatedDeclarationSync } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
16
16
  import Be from "os";
17
17
  //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
@@ -30356,11 +30356,11 @@ function h(e) {
30356
30356
  }
30357
30357
  i(h, "slash");
30358
30358
  const Z = i((e) => {
30359
- const t = re[e];
30359
+ const t = fs$1[e];
30360
30360
  return (s, ...n) => {
30361
30361
  const o = `${e}:${n.join(":")}`;
30362
30362
  let l = s == null ? void 0 : s.get(o);
30363
- return l === void 0 && (l = Reflect.apply(t, re, n), s?.set(o, l)), l;
30363
+ return l === void 0 && (l = Reflect.apply(t, fs$1, n), s?.set(o, l)), l;
30364
30364
  };
30365
30365
  }, "cacheFs"), E = Z("existsSync"), $e = Z("readFileSync"), G = Z("statSync"), fe = i((e, t, s) => {
30366
30366
  for (;;) {
@@ -2,7 +2,7 @@ import * as Rolldown from "@voidzero-dev/vite-plus-core/rolldown";
2
2
  import { BuildOptions, ChecksOptions, ExternalOption, InputOptions, InternalModuleFormat, MinifyOptions, ModuleFormat, ModuleTypes, OutputAsset, OutputChunk, OutputOptions, TreeshakingOptions } from "@voidzero-dev/vite-plus-core/rolldown";
3
3
  import { IsolatedDeclarationsOptions } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
4
4
 
5
- //#region ../../node_modules/.pnpm/tsdown@0.21.2_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.2_@tsdown+exe@0.21.2_@type_059aa640a91d945cefc9d8c8db7a9cd0/node_modules/tsdown/dist/logger-BUKd5OJy.d.mts
5
+ //#region ../../node_modules/.pnpm/tsdown@0.21.4_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.4_@tsdown+exe@0.21.4_@type_17eb19013b58e1a32121480e0690eafa/node_modules/tsdown/dist/logger-DtCm1ySP.d.mts
6
6
  //#region src/utils/types.d.ts
7
7
  type Overwrite<T, U> = Omit<T, keyof U> & U;
8
8
  type Awaitable<T> = T | Promise<T>;
@@ -29,7 +29,7 @@ interface Logger {
29
29
  }
30
30
  declare const globalLogger: Logger; //#endregion
31
31
  //#endregion
32
- //#region ../../node_modules/.pnpm/hookable@6.0.1/node_modules/hookable/dist/index.d.mts
32
+ //#region ../../node_modules/.pnpm/hookable@6.1.0/node_modules/hookable/dist/index.d.mts
33
33
  //#region src/types.d.ts
34
34
  type HookCallback = (...arguments_: any) => Promise<void> | void;
35
35
  type HookKeys<T> = keyof T & string;
@@ -66,6 +66,7 @@ declare class Hookable<HooksT extends Record<string, any> = Record<string, HookC
66
66
  }): () => void;
67
67
  hookOnce<NameT extends HookNameT>(name: NameT, function_: InferCallback<HooksT, NameT>): () => void;
68
68
  removeHook<NameT extends HookNameT>(name: NameT, function_: InferCallback<HooksT, NameT>): void;
69
+ clearHook<NameT extends HookNameT>(name: NameT): void;
69
70
  deprecateHook<NameT extends HookNameT>(name: NameT, deprecated: HookKeys<HooksT> | DeprecatedHook<HooksT>): void;
70
71
  deprecateHooks(deprecatedHooks: Partial<Record<HookNameT, DeprecatedHook<HooksT>>>): void;
71
72
  addHooks(configHooks: NestedHooks<HooksT>): () => void;
@@ -8473,9 +8474,41 @@ interface GlobDependency {
8473
8474
  glob: string;
8474
8475
  }
8475
8476
  //#endregion
8476
- //#region ../../node_modules/.pnpm/@tsdown+css@0.21.2_jiti@2.6.1_postcss-import@16.1.1_postcss@8.5.8__postcss@8.5.8_sass-e_5b37bea2f024dcde9918b4daf7eea71b/node_modules/@tsdown/css/dist/index.d.mts
8477
+ //#region ../../node_modules/.pnpm/@tsdown+css@0.21.4_jiti@2.6.1_postcss-import@16.1.1_postcss@8.5.8__postcss-modules@6.0._abf34fadfb7b8325a031a05f696fa363/node_modules/@tsdown/css/dist/index.d.mts
8477
8478
  //#region src/options.d.ts
8478
8479
  type LightningCSSOptions = Omit<TransformOptions<any>, "filename" | "code">;
8480
+ interface CSSModulesOptions {
8481
+ /**
8482
+ * Controls the scoping behavior.
8483
+ * @default 'local'
8484
+ */
8485
+ scopeBehaviour?: "global" | "local";
8486
+ /**
8487
+ * File paths matching these patterns will use global scoping.
8488
+ */
8489
+ globalModulePaths?: RegExp[];
8490
+ /**
8491
+ * Pattern or function to generate scoped class names.
8492
+ * When using `transformer: 'lightningcss'`, only string patterns are supported.
8493
+ */
8494
+ generateScopedName?: string | ((name: string, filename: string, css: string) => string);
8495
+ /**
8496
+ * Prefix added to hashes when generating scoped names.
8497
+ */
8498
+ hashPrefix?: string;
8499
+ /**
8500
+ * Transform convention for exported class names.
8501
+ */
8502
+ localsConvention?: "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly";
8503
+ /**
8504
+ * Whether to include global class names in the export.
8505
+ */
8506
+ exportGlobals?: boolean;
8507
+ /**
8508
+ * Callback to receive the generated class name mappings.
8509
+ */
8510
+ getJSON?: (cssFileName: string, json: Record<string, string>, outputFileName: string) => void;
8511
+ }
8479
8512
  interface CssOptions {
8480
8513
  /**
8481
8514
  * Enable/disable CSS code splitting.
@@ -8535,6 +8568,14 @@ interface CssOptions {
8535
8568
  */
8536
8569
  inject?: boolean;
8537
8570
  /**
8571
+ * CSS modules configuration.
8572
+ * When not `false`, `.module.css` files (and preprocessor variants) are
8573
+ * treated as CSS modules with scoped class names.
8574
+ *
8575
+ * @see https://github.com/css-modules/css-modules
8576
+ */
8577
+ modules?: CSSModulesOptions | false;
8578
+ /**
8538
8579
  * CSS transformer to use. Controls how CSS is processed:
8539
8580
  *
8540
8581
  * - `'lightningcss'` (default): `@import` handled by Lightning CSS
@@ -9516,7 +9557,7 @@ interface TsgoOptions {
9516
9557
  path?: string;
9517
9558
  }
9518
9559
  //#endregion
9519
- //#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.0_@pnpm+logger@1001.0.1_typescript@5.9.3_vite@packages+core_vue@3.5.27_typescript@5.9.3_/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
9560
+ //#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.2_@pnpm+logger@1001.0.1_typescript@5.9.3_vite@packages+core_vue@3.5.27_typescript@5.9.3_/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
9520
9561
  //#region src/node/cli-commands.d.ts
9521
9562
  interface StartOptions {
9522
9563
  root?: string;
@@ -9526,7 +9567,7 @@ interface StartOptions {
9526
9567
  open?: boolean;
9527
9568
  }
9528
9569
  //#endregion
9529
- //#region ../../node_modules/.pnpm/@tsdown+exe@0.21.2_tsdown@0.21.2/node_modules/@tsdown/exe/dist/index.d.mts
9570
+ //#region ../../node_modules/.pnpm/@tsdown+exe@0.21.4_tsdown@0.21.4/node_modules/@tsdown/exe/dist/index.d.mts
9530
9571
  //#region src/platform.d.ts
9531
9572
  type ExePlatform = "win" | "darwin" | "linux";
9532
9573
  type ExeArch = "x64" | "arm64";
@@ -9667,7 +9708,7 @@ interface Options$1 {
9667
9708
  depKinds?: Array<DepKind>;
9668
9709
  }
9669
9710
  //#endregion
9670
- //#region ../../node_modules/.pnpm/tsdown@0.21.2_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.2_@tsdown+exe@0.21.2_@type_059aa640a91d945cefc9d8c8db7a9cd0/node_modules/tsdown/dist/types-DUxKwUmX.d.mts
9711
+ //#region ../../node_modules/.pnpm/tsdown@0.21.4_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.4_@tsdown+exe@0.21.4_@type_17eb19013b58e1a32121480e0690eafa/node_modules/tsdown/dist/types-D2Jnze_i.d.mts
9671
9712
  //#region src/features/copy.d.ts
9672
9713
  interface CopyEntry {
9673
9714
  /**
@@ -10791,7 +10832,7 @@ type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "from
10791
10832
  exe: false | ExeOptions;
10792
10833
  }>; //#endregion
10793
10834
  //#endregion
10794
- //#region ../../node_modules/.pnpm/tsdown@0.21.2_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.2_@tsdown+exe@0.21.2_@type_059aa640a91d945cefc9d8c8db7a9cd0/node_modules/tsdown/dist/config-Cz86PxVM.d.mts
10835
+ //#region ../../node_modules/.pnpm/tsdown@0.21.4_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.4_@tsdown+exe@0.21.4_@type_17eb19013b58e1a32121480e0690eafa/node_modules/tsdown/dist/config-D9p_BCF3.d.mts
10795
10836
  //#region src/config/options.d.ts
10796
10837
  /**
10797
10838
  * Resolve user config into resolved configs
@@ -10811,7 +10852,7 @@ declare function defineConfig(options: UserConfig[]): UserConfig[];
10811
10852
  declare function defineConfig(options: UserConfigFn): UserConfigFn;
10812
10853
  declare function defineConfig(options: UserConfigExport): UserConfigExport; //#endregion
10813
10854
  //#endregion
10814
- //#region ../../node_modules/.pnpm/tsdown@0.21.2_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.2_@tsdown+exe@0.21.2_@type_059aa640a91d945cefc9d8c8db7a9cd0/node_modules/tsdown/dist/index.d.mts
10855
+ //#region ../../node_modules/.pnpm/tsdown@0.21.4_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.4_@tsdown+exe@0.21.4_@type_17eb19013b58e1a32121480e0690eafa/node_modules/tsdown/dist/index.d.mts
10815
10856
  //#region src/build.d.ts
10816
10857
  /**
10817
10858
  * Build with tsdown.
@@ -1,10 +1,10 @@
1
- import { c as globalLogger } from "./main-4fHWraTN.js";
1
+ import { c as globalLogger } from "./main-JovZVvCY.js";
2
2
  import "./node-B3Gdtau1.js";
3
- import { t as enableDebug } from "./debug-C4FmgzkJ-BcERCViE.js";
4
- import { i as resolveUserConfig, n as buildWithConfigs, r as mergeConfig, t as build$1 } from "./build-CpOl_krN-DrIRjiqJ.js";
3
+ import { t as enableDebug } from "./debug-C4FmgzkJ-Co4tnxmE.js";
4
+ import { i as resolveUserConfig, n as buildWithConfigs, r as mergeConfig, t as build$1 } from "./build-CoLhkNXE-DtR1EaBG.js";
5
5
  import "./filename-UU7z2A9Z.js";
6
6
  import * as Rolldown from "@voidzero-dev/vite-plus-core/rolldown";
7
- //#region ../../node_modules/.pnpm/tsdown@0.21.2_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.2_@tsdown+exe@0.21.2_@type_059aa640a91d945cefc9d8c8db7a9cd0/node_modules/tsdown/dist/config.mjs
7
+ //#region ../../node_modules/.pnpm/tsdown@0.21.4_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.4_@tsdown+exe@0.21.4_@type_17eb19013b58e1a32121480e0690eafa/node_modules/tsdown/dist/config.mjs
8
8
  function defineConfig(options) {
9
9
  return options;
10
10
  }