@voidzero-dev/vite-plus-core 0.1.22 → 0.1.23
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/LICENSE +35 -24
- package/dist/pluginutils/filter/index.d.mts +194 -0
- package/dist/pluginutils/filter/index.mjs +2 -0
- package/dist/pluginutils/filter-B_mD-HGz.mjs +323 -0
- package/dist/pluginutils/index.d.mts +2 -0
- package/dist/pluginutils/index.mjs +2 -0
- package/dist/rolldown/cli.mjs +7 -7
- package/dist/rolldown/config.d.mts +1 -1
- package/dist/rolldown/config.mjs +3 -3
- package/dist/rolldown/experimental-index.d.mts +21 -4
- package/dist/rolldown/experimental-index.mjs +14 -9
- package/dist/rolldown/filter-index.d.mts +8 -9
- package/dist/rolldown/filter-index.mjs +2 -8
- package/dist/rolldown/get-log-filter.d.mts +3 -3
- package/dist/rolldown/index.d.mts +4 -4
- package/dist/rolldown/index.mjs +5 -5
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parallel-plugin.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +2 -2
- package/dist/rolldown/plugins-index.d.mts +3 -3
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/{binding-zH1vcmbM.d.mts → binding-BaCZTfMx.d.mts} +32 -3
- package/dist/rolldown/shared/{binding-ESkOU1xr.mjs → binding-CXquf8ay.mjs} +27 -26
- package/dist/rolldown/shared/{bindingify-input-options-wZdDRbfo.mjs → bindingify-input-options-D2ORek5s.mjs} +14 -14
- package/dist/rolldown/shared/{constructors-D6i2Tbyl.mjs → constructors-BiPdtLBB.mjs} +1 -1
- package/dist/rolldown/shared/{constructors-D0W3rNfA.d.mts → constructors-CbNaT434.d.mts} +2 -2
- package/dist/rolldown/shared/{define-config-5HJ1b9vG.d.mts → define-config-3BX_X2Am.d.mts} +70 -16
- package/dist/rolldown/shared/{error-BrnLyQ-g.mjs → error-BuvQYXuZ.mjs} +1 -1
- package/dist/rolldown/shared/{get-log-filter-semyr3Lj.d.mts → get-log-filter-BpNVNJ5-.d.mts} +1 -1
- package/dist/rolldown/shared/{load-config-BZFgt8GH.mjs → load-config-uvbpmLwO.mjs} +1 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-dAjLOSbp.mjs → normalize-string-or-regex-CNPF6PU9.mjs} +2 -2
- package/dist/rolldown/shared/{parse-DFts7Hyl.mjs → parse-1VOPJ1Lj.mjs} +2 -2
- package/dist/rolldown/shared/{prompt-Bm9aMQjm.mjs → prompt-DV1XbtjC.mjs} +1 -1
- package/dist/rolldown/shared/{resolve-tsconfig-DCdBlPeK.mjs → resolve-tsconfig-CcfxWrib.mjs} +15 -4
- package/dist/rolldown/shared/{rolldown-Cs2eRf4R.mjs → rolldown-BZYLlfsv.mjs} +1 -1
- package/dist/rolldown/shared/{rolldown-build-CNhzgsn2.mjs → rolldown-build-CgMNHFY3.mjs} +54 -65
- package/dist/rolldown/shared/{transform-DgZ3paSD.d.mts → transform-7xCUVrpL.d.mts} +2 -2
- package/dist/rolldown/shared/{watch-De_8Tgeq.mjs → watch-BX_aH1Oh.mjs} +6 -6
- package/dist/rolldown/utils-index.d.mts +3 -3
- package/dist/rolldown/utils-index.mjs +5 -5
- package/dist/tsdown/{build-5FURNVr0-D2dbyiC6.js → build-5FURNVr0-CsM6vj3e.js} +1046 -17
- package/dist/tsdown/{detect-DN3DXXYt-8gmDjZqp.js → detect-DN3DXXYt-TsZBbdhI.js} +1 -1
- package/dist/tsdown/{dist-DTzJRoOQ.js → dist-wWM45aJq.js} +2185 -1087
- package/dist/tsdown/index-types.d.ts +7 -5
- package/dist/tsdown/index.js +3 -4
- package/dist/tsdown/{main-BNUO6D3N.js → main-Cq8Is40L.js} +288 -8
- package/dist/tsdown/npm_cjs_chunk_range.cjs +11 -11
- package/dist/tsdown/npm_cjs_chunk_semver.cjs +6 -6
- package/dist/tsdown/npm_entry_semver_functions_coerce.cjs +2 -2
- package/dist/tsdown/npm_entry_semver_functions_satisfies.cjs +1 -1
- package/dist/tsdown/npm_entry_semver_ranges_min-version.cjs +1 -1
- package/dist/tsdown/{resolver-DkvdaW3s-BeVUoOo-.js → resolver-DkvdaW3s-Dz1U-gxd.js} +1 -1
- package/dist/tsdown/run.js +3 -4
- package/dist/tsdown/{tsc-Dr9kCkDm.js → tsc-Dp9emiKb.js} +3 -3
- package/dist/tsdown/{tsc-context-CANQEB9U.js → tsc-context-DXovbMXp.js} +2 -2
- package/dist/vite/client/client.mjs +61 -27
- package/dist/vite/node/chunks/build.js +21 -21
- package/dist/vite/node/chunks/dist.js +1 -1
- package/dist/vite/node/chunks/dist2.js +136 -110
- package/dist/vite/node/chunks/lib.js +1 -1
- package/dist/vite/node/chunks/logger.js +36 -3
- package/dist/vite/node/chunks/node.js +288 -181
- package/dist/vite/node/chunks/postcss-import.js +11 -11
- package/dist/vite/node/cli.js +1 -2
- package/dist/vite/node/index.d.ts +29 -14
- package/dist/vite/node/module-runner.d.ts +1 -2
- package/dist/vite/node/module-runner.js +19 -18
- package/dist/vite/types/customEvent.d.ts +1 -1
- package/package.json +13 -19
- package/dist/pluginutils/filter/composable-filters.d.ts +0 -90
- package/dist/pluginutils/filter/composable-filters.js +0 -256
- package/dist/pluginutils/filter/filter-vite-plugins.d.ts +0 -28
- package/dist/pluginutils/filter/filter-vite-plugins.js +0 -75
- package/dist/pluginutils/filter/index.d.ts +0 -3
- package/dist/pluginutils/filter/index.js +0 -3
- package/dist/pluginutils/filter/simple-filters.d.ts +0 -71
- package/dist/pluginutils/filter/simple-filters.js +0 -70
- package/dist/pluginutils/index.d.ts +0 -1
- package/dist/pluginutils/index.js +0 -1
- package/dist/pluginutils/utils.d.ts +0 -2
- package/dist/pluginutils/utils.js +0 -17
- package/dist/tsdown/debug-CLlnG64L-BkAqwHVS.js +0 -16
- package/dist/tsdown/dist-Cv2Z0Bi_.js +0 -1012
- package/dist/tsdown/filename-DQnUJlio-D7-CzKqs.js +0 -29
- package/dist/tsdown/node-B3Gdtau1.js +0 -268
- package/dist/vite/node/chunks/chunk.js +0 -35
- /package/dist/rolldown/shared/{define-config-DJOr6Iwt.mjs → define-config-Demdg3_4.mjs} +0 -0
- /package/dist/rolldown/shared/{logging-C6h4g8dA.d.mts → logging-BSNejiLS.d.mts} +0 -0
- /package/dist/rolldown/shared/{logs-D80CXhvg.mjs → logs-aMKUxRpj.mjs} +0 -0
- /package/dist/rolldown/shared/{misc-DJYbNKZX.mjs → misc-CoQm4NHO.mjs} +0 -0
- /package/dist/tsdown/{chunk-N93fKeF6.js → chunk-DJK8HYOj.js} +0 -0
- /package/dist/tsdown/{dist-JaOach5K.js → dist-CZtGyfn3.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as __commonJSMin, H as __require } from "./logger.js";
|
|
2
2
|
import { t as require_lib } from "./lib.js";
|
|
3
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
3
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.15/node_modules/postcss-import/lib/format-import-prelude.js
|
|
4
4
|
var require_format_import_prelude = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
5
|
module.exports = function formatImportPrelude(layer, media, supports) {
|
|
6
6
|
const parts = [];
|
|
@@ -15,7 +15,7 @@ var require_format_import_prelude = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
15
15
|
};
|
|
16
16
|
}));
|
|
17
17
|
//#endregion
|
|
18
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
18
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.15/node_modules/postcss-import/lib/base64-encoded-import.js
|
|
19
19
|
var require_base64_encoded_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
20
20
|
const formatImportPrelude = require_format_import_prelude();
|
|
21
21
|
module.exports = function base64EncodedConditionalImport(prelude, conditions) {
|
|
@@ -28,7 +28,7 @@ var require_base64_encoded_import = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
28
28
|
};
|
|
29
29
|
}));
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
31
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.15/node_modules/postcss-import/lib/apply-conditions.js
|
|
32
32
|
var require_apply_conditions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
33
33
|
const base64EncodedConditionalImport = require_base64_encoded_import();
|
|
34
34
|
module.exports = function applyConditions(bundle, atRule) {
|
|
@@ -103,7 +103,7 @@ var require_apply_conditions = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
103
103
|
};
|
|
104
104
|
}));
|
|
105
105
|
//#endregion
|
|
106
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
106
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.15/node_modules/postcss-import/lib/apply-raws.js
|
|
107
107
|
var require_apply_raws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
108
108
|
module.exports = function applyRaws(bundle) {
|
|
109
109
|
bundle.forEach((stmt, index) => {
|
|
@@ -117,7 +117,7 @@ var require_apply_raws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
117
117
|
};
|
|
118
118
|
}));
|
|
119
119
|
//#endregion
|
|
120
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
120
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.15/node_modules/postcss-import/lib/apply-styles.js
|
|
121
121
|
var require_apply_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
122
122
|
module.exports = function applyStyles(bundle, styles) {
|
|
123
123
|
styles.nodes = [];
|
|
@@ -137,7 +137,7 @@ var require_apply_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
137
137
|
};
|
|
138
138
|
}));
|
|
139
139
|
//#endregion
|
|
140
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
140
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.15/node_modules/postcss-import/lib/data-url.js
|
|
141
141
|
var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
142
142
|
const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i;
|
|
143
143
|
const base64DataURLRegexp = /^data:text\/css;base64,/i;
|
|
@@ -156,7 +156,7 @@ var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
156
156
|
};
|
|
157
157
|
}));
|
|
158
158
|
//#endregion
|
|
159
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
159
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.15/node_modules/postcss-import/lib/parse-statements.js
|
|
160
160
|
var require_parse_statements = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
161
161
|
const valueParser = require_lib();
|
|
162
162
|
const { stringify } = valueParser;
|
|
@@ -281,7 +281,7 @@ var require_parse_statements = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
281
281
|
}
|
|
282
282
|
}));
|
|
283
283
|
//#endregion
|
|
284
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
284
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.15/node_modules/postcss-import/lib/process-content.js
|
|
285
285
|
var require_process_content = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
286
286
|
const path$2 = __require("path");
|
|
287
287
|
let sugarss;
|
|
@@ -315,7 +315,7 @@ var require_process_content = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
315
315
|
}
|
|
316
316
|
}));
|
|
317
317
|
//#endregion
|
|
318
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
318
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.15/node_modules/postcss-import/lib/parse-styles.js
|
|
319
319
|
var require_parse_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
320
320
|
const path$1 = __require("path");
|
|
321
321
|
const dataURL = require_data_url();
|
|
@@ -418,7 +418,7 @@ var require_parse_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
418
418
|
module.exports = parseStyles;
|
|
419
419
|
}));
|
|
420
420
|
//#endregion
|
|
421
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
421
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.15/node_modules/postcss-import/index.js
|
|
422
422
|
var require_postcss_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
423
423
|
const path = __require("path");
|
|
424
424
|
const applyConditions = require_apply_conditions();
|
package/dist/vite/node/cli.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { F as VITE_PLUS_VERSION, n as createLogger, z as require_picocolors } from "./chunks/logger.js";
|
|
1
|
+
import { F as VITE_PLUS_VERSION, U as __toESM, n as createLogger, z as require_picocolors } from "./chunks/logger.js";
|
|
3
2
|
import fs from "node:fs";
|
|
4
3
|
import path from "node:path";
|
|
5
4
|
import { inspect } from "node:util";
|
|
@@ -31,7 +31,7 @@ import { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownA
|
|
|
31
31
|
|
|
32
32
|
//#region \0rolldown/runtime.js
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region ../../../node_modules/.pnpm/@vitejs+devtools@0.1.
|
|
34
|
+
//#region ../../../node_modules/.pnpm/@vitejs+devtools@0.1.24_@pnpm+logger@1001.0.1_typescript@6.0.2_vite@packages+core/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
|
|
35
35
|
//#region src/node/cli-commands.d.ts
|
|
36
36
|
interface StartOptions {
|
|
37
37
|
root?: string;
|
|
@@ -41,7 +41,7 @@ interface StartOptions {
|
|
|
41
41
|
open?: boolean;
|
|
42
42
|
}
|
|
43
43
|
//#endregion
|
|
44
|
-
//#region ../../../node_modules/.pnpm/@vitejs+devtools@0.1.
|
|
44
|
+
//#region ../../../node_modules/.pnpm/@vitejs+devtools@0.1.24_@pnpm+logger@1001.0.1_typescript@6.0.2_vite@packages+core/node_modules/@vitejs/devtools/dist/config.d.ts
|
|
45
45
|
//#region src/node/config.d.ts
|
|
46
46
|
interface DevToolsConfig extends Partial<StartOptions> {
|
|
47
47
|
enabled: boolean;
|
|
@@ -925,7 +925,7 @@ interface DepOptimizationConfig {
|
|
|
925
925
|
type DepOptimizationOptions = DepOptimizationConfig & {
|
|
926
926
|
/**
|
|
927
927
|
* By default, Vite will crawl your `index.html` to detect dependencies that
|
|
928
|
-
* need to be pre-bundled. If `build.
|
|
928
|
+
* need to be pre-bundled. If `build.rolldownOptions.input` is specified, Vite
|
|
929
929
|
* will crawl those entry points instead.
|
|
930
930
|
*
|
|
931
931
|
* If neither of these fit your needs, you can specify custom entries using
|
|
@@ -2999,6 +2999,14 @@ type PluginOption = Thenable<Plugin | {
|
|
|
2999
2999
|
*/
|
|
3000
3000
|
declare function perEnvironmentPlugin(name: string, applyToEnvironment: (environment: PartialEnvironment) => boolean | Promise<boolean> | PluginOption): Plugin;
|
|
3001
3001
|
//#endregion
|
|
3002
|
+
//#region src/node/idResolver.d.ts
|
|
3003
|
+
type ResolveIdFn = (environment: PartialEnvironment, id: string, importer?: string, aliasOnly?: boolean) => Promise<string | undefined>;
|
|
3004
|
+
/**
|
|
3005
|
+
* Create an internal resolver to be used in special scenarios, e.g.
|
|
3006
|
+
* optimizer and handling css @imports
|
|
3007
|
+
*/
|
|
3008
|
+
declare function createIdResolver(config: ResolvedConfig, options?: Partial<InternalResolveOptions>): ResolveIdFn;
|
|
3009
|
+
//#endregion
|
|
3002
3010
|
//#region src/node/plugins/css.d.ts
|
|
3003
3011
|
interface CSSOptions {
|
|
3004
3012
|
/**
|
|
@@ -3288,6 +3296,17 @@ interface SharedEnvironmentOptions {
|
|
|
3288
3296
|
* Optimize deps config
|
|
3289
3297
|
*/
|
|
3290
3298
|
optimizeDeps?: DepOptimizationOptions;
|
|
3299
|
+
/**
|
|
3300
|
+
* Whether this environment produces a bundled output.
|
|
3301
|
+
*
|
|
3302
|
+
* During `build`, this defaults to `true` for every environment.
|
|
3303
|
+
* During `serve`, this defaults to `true` only for the client environment
|
|
3304
|
+
* when `experimental.bundledDev` is enabled, and `false` otherwise.
|
|
3305
|
+
* Setting this explicitly on an environment always overrides the default.
|
|
3306
|
+
*
|
|
3307
|
+
* @experimental
|
|
3308
|
+
*/
|
|
3309
|
+
isBundled?: boolean;
|
|
3291
3310
|
}
|
|
3292
3311
|
interface EnvironmentOptions extends SharedEnvironmentOptions {
|
|
3293
3312
|
/**
|
|
@@ -3308,6 +3327,7 @@ type ResolvedEnvironmentOptions = {
|
|
|
3308
3327
|
optimizeDeps: DepOptimizationOptions;
|
|
3309
3328
|
dev: ResolvedDevEnvironmentOptions;
|
|
3310
3329
|
build: ResolvedBuildEnvironmentOptions;
|
|
3330
|
+
isBundled: boolean;
|
|
3311
3331
|
plugins: readonly Plugin[];
|
|
3312
3332
|
};
|
|
3313
3333
|
type DefaultEnvironmentOptions = Omit<EnvironmentOptions, "consumer" | "resolve" | "keepProcessEnv"> & {
|
|
@@ -3532,7 +3552,11 @@ interface ExperimentalOptions {
|
|
|
3532
3552
|
*/
|
|
3533
3553
|
hmrPartialAccept?: boolean;
|
|
3534
3554
|
/**
|
|
3535
|
-
* Enable full bundle mode
|
|
3555
|
+
* Enable full bundle mode during `serve`.
|
|
3556
|
+
*
|
|
3557
|
+
* This seeds the default for the client environment's `isBundled` option.
|
|
3558
|
+
* Other environments default to `false` during `serve`. Any environment
|
|
3559
|
+
* can override its `isBundled` value via `environments[name].isBundled`.
|
|
3536
3560
|
*
|
|
3537
3561
|
* This is highly experimental.
|
|
3538
3562
|
*
|
|
@@ -3592,8 +3616,7 @@ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "
|
|
|
3592
3616
|
publicDir: string;
|
|
3593
3617
|
cacheDir: string;
|
|
3594
3618
|
command: "build" | "serve";
|
|
3595
|
-
mode: string;
|
|
3596
|
-
isBundled: boolean;
|
|
3619
|
+
mode: string;
|
|
3597
3620
|
isWorker: boolean;
|
|
3598
3621
|
isProduction: boolean;
|
|
3599
3622
|
envDir: string | false;
|
|
@@ -3658,14 +3681,6 @@ declare function loadConfigFromFile(configEnv: ConfigEnv, configFile?: string, c
|
|
|
3658
3681
|
dependencies: string[];
|
|
3659
3682
|
} | null>;
|
|
3660
3683
|
//#endregion
|
|
3661
|
-
//#region src/node/idResolver.d.ts
|
|
3662
|
-
type ResolveIdFn = (environment: PartialEnvironment, id: string, importer?: string, aliasOnly?: boolean) => Promise<string | undefined>;
|
|
3663
|
-
/**
|
|
3664
|
-
* Create an internal resolver to be used in special scenarios, e.g.
|
|
3665
|
-
* optimizer and handling css @imports
|
|
3666
|
-
*/
|
|
3667
|
-
declare function createIdResolver(config: ResolvedConfig, options?: Partial<InternalResolveOptions>): ResolveIdFn;
|
|
3668
|
-
//#endregion
|
|
3669
3684
|
//#region src/node/server/middlewares/error.d.ts
|
|
3670
3685
|
declare function buildErrorMessage(err: RollupError, args?: string[], includeStack?: boolean): string;
|
|
3671
3686
|
//#endregion
|
|
@@ -131,8 +131,7 @@ declare class ModuleRunner {
|
|
|
131
131
|
*/
|
|
132
132
|
isClosed(): boolean;
|
|
133
133
|
private processImport;
|
|
134
|
-
private
|
|
135
|
-
private isCircularImport;
|
|
134
|
+
private isCircularRequest;
|
|
136
135
|
private cachedRequest;
|
|
137
136
|
private cachedModule;
|
|
138
137
|
private ensureBuiltins;
|
|
@@ -645,17 +645,23 @@ const createInvokeableTransport = (transport) => {
|
|
|
645
645
|
async send(data) {
|
|
646
646
|
if (invokeableTransport.send) {
|
|
647
647
|
if (!isConnected) if (connectingPromise) await connectingPromise;
|
|
648
|
-
else throw
|
|
648
|
+
else throw new SendBeforeConnectError("send was called before connect");
|
|
649
649
|
await invokeableTransport.send(data);
|
|
650
650
|
}
|
|
651
651
|
},
|
|
652
652
|
async invoke(name, data) {
|
|
653
653
|
if (!isConnected) if (connectingPromise) await connectingPromise;
|
|
654
|
-
else throw
|
|
654
|
+
else throw new SendBeforeConnectError("invoke was called before connect");
|
|
655
655
|
return invokeableTransport.invoke(name, data);
|
|
656
656
|
}
|
|
657
657
|
};
|
|
658
|
-
}
|
|
658
|
+
};
|
|
659
|
+
var SendBeforeConnectError = class extends Error {
|
|
660
|
+
constructor(message) {
|
|
661
|
+
super(message), this.name = "SendBeforeConnectError";
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
const createWebSocketModuleRunnerTransport = (options) => {
|
|
659
665
|
let pingInterval = options.pingInterval ?? 3e4, ws, pingIntervalId;
|
|
660
666
|
return {
|
|
661
667
|
async connect({ onMessage, onDisconnection }) {
|
|
@@ -1051,7 +1057,6 @@ function createImportMetaResolver() {
|
|
|
1051
1057
|
function importMetaResolveWithCustomHook(specifier, importer) {
|
|
1052
1058
|
return import.meta.resolve(`${customizationHookNamespace}${JSON.stringify([specifier, importer])}`);
|
|
1053
1059
|
}
|
|
1054
|
-
`${customizationHookNamespace}`;
|
|
1055
1060
|
//#endregion
|
|
1056
1061
|
//#region ../../vite/packages/vite/src/module-runner/createImportMeta.ts
|
|
1057
1062
|
const envProxy = new Proxy({}, { get(_, p) {
|
|
@@ -1138,29 +1143,25 @@ var ModuleRunner = class {
|
|
|
1138
1143
|
let { url, type } = fetchResult;
|
|
1139
1144
|
return type !== "module" && type !== "commonjs" || analyzeImportedModDifference(exports, url, type, metadata), exports;
|
|
1140
1145
|
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
if (
|
|
1148
|
-
if (visited.add(importer), importer === moduleUrl) return !0;
|
|
1149
|
-
let mod = this.evaluatedModules.getModuleById(importer);
|
|
1150
|
-
if (mod && mod.importers.size && this.isCircularImport(mod.importers, moduleUrl, visited)) return !0;
|
|
1146
|
+
isCircularRequest(mod, callstack, visited = /* @__PURE__ */ new Set()) {
|
|
1147
|
+
if (visited.has(mod.id)) return !1;
|
|
1148
|
+
visited.add(mod.id);
|
|
1149
|
+
for (let importedModuleId of mod.imports) {
|
|
1150
|
+
if (callstack.includes(importedModuleId)) return !0;
|
|
1151
|
+
let importedModule = this.evaluatedModules.getModuleById(importedModuleId);
|
|
1152
|
+
if (importedModule?.promise && !importedModule.evaluated && this.isCircularRequest(importedModule, callstack, visited)) return !0;
|
|
1151
1153
|
}
|
|
1152
1154
|
return !1;
|
|
1153
1155
|
}
|
|
1154
1156
|
async cachedRequest(url, mod, callstack = [], metadata) {
|
|
1155
|
-
let meta = mod.meta, moduleId = meta.id,
|
|
1156
|
-
if (importee && importers.add(importee), mod.evaluated && mod.promise) return this.processImport(await mod.promise, meta, metadata);
|
|
1157
|
-
if ((callstack.includes(moduleId) || this.
|
|
1157
|
+
let meta = mod.meta, moduleId = meta.id, importee = callstack[callstack.length - 1];
|
|
1158
|
+
if (importee && mod.importers.add(importee), mod.evaluated && mod.promise) return this.processImport(await mod.promise, meta, metadata);
|
|
1159
|
+
if (mod.promise) return mod.exports && (callstack.includes(moduleId) || this.isCircularRequest(mod, callstack)) ? this.processImport(mod.exports, meta, metadata) : this.processImport(await mod.promise, meta, metadata);
|
|
1158
1160
|
let debugTimer;
|
|
1159
1161
|
this.debug && (debugTimer = setTimeout(() => {
|
|
1160
1162
|
this.debug(`[module runner] module ${moduleId} takes over 2s to load.\n${`stack:\n${[...callstack, moduleId].reverse().map((p) => ` - ${p}`).join("\n")}`}`);
|
|
1161
1163
|
}, 2e3));
|
|
1162
1164
|
try {
|
|
1163
|
-
if (mod.promise) return this.processImport(await mod.promise, meta, metadata);
|
|
1164
1165
|
let promise = this.directRequest(url, mod, callstack);
|
|
1165
1166
|
return mod.promise = promise, mod.evaluated = !1, this.processImport(await promise, meta, metadata);
|
|
1166
1167
|
} finally {
|
|
@@ -18,7 +18,7 @@ export interface CustomEventMap {
|
|
|
18
18
|
/** @internal */
|
|
19
19
|
'vite:forward-console': ForwardConsolePayload
|
|
20
20
|
/** @internal */
|
|
21
|
-
'vite:module-loaded': { modules: string[] }
|
|
21
|
+
'vite:module-loaded': { modules: string[]; clientId: string }
|
|
22
22
|
|
|
23
23
|
// server events
|
|
24
24
|
'vite:client:connect': undefined
|
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.23",
|
|
4
4
|
"description": "The Unified Toolchain for the Web",
|
|
5
5
|
"homepage": "https://viteplus.dev/guide",
|
|
6
6
|
"bugs": {
|
|
@@ -85,14 +85,8 @@
|
|
|
85
85
|
"default": "./dist/rolldown/plugins-index.mjs",
|
|
86
86
|
"types": "./dist/rolldown/plugins-index.d.mts"
|
|
87
87
|
},
|
|
88
|
-
"./rolldown/pluginutils":
|
|
89
|
-
|
|
90
|
-
"types": "./dist/pluginutils/index.d.ts"
|
|
91
|
-
},
|
|
92
|
-
"./rolldown/pluginutils/filter": {
|
|
93
|
-
"default": "./dist/pluginutils/filter/index.js",
|
|
94
|
-
"types": "./dist/pluginutils/filter/index.d.ts"
|
|
95
|
-
},
|
|
88
|
+
"./rolldown/pluginutils": "./dist/pluginutils/index.mjs",
|
|
89
|
+
"./rolldown/pluginutils/filter": "./dist/pluginutils/filter/index.mjs",
|
|
96
90
|
"./rolldown/utils": {
|
|
97
91
|
"default": "./dist/rolldown/utils-index.mjs",
|
|
98
92
|
"types": "./dist/rolldown/utils-index.d.mts"
|
|
@@ -103,8 +97,8 @@
|
|
|
103
97
|
"./types/internal/*": null
|
|
104
98
|
},
|
|
105
99
|
"dependencies": {
|
|
106
|
-
"@oxc-project/runtime": "=0.
|
|
107
|
-
"@oxc-project/types": "=0.
|
|
100
|
+
"@oxc-project/runtime": "=0.133.0",
|
|
101
|
+
"@oxc-project/types": "=0.133.0",
|
|
108
102
|
"lightningcss": "^1.30.2",
|
|
109
103
|
"postcss": "^8.5.6"
|
|
110
104
|
},
|
|
@@ -115,24 +109,24 @@
|
|
|
115
109
|
"@babel/types": "^7.28.5",
|
|
116
110
|
"@oxc-node/cli": "^0.1.0",
|
|
117
111
|
"@oxc-node/core": "^0.1.0",
|
|
118
|
-
"@vitejs/devtools": "^0.
|
|
112
|
+
"@vitejs/devtools": "^0.2.0",
|
|
119
113
|
"es-module-lexer": "^1.7.0",
|
|
120
114
|
"hookable": "^6.0.1",
|
|
121
115
|
"magic-string": "^0.30.21",
|
|
122
|
-
"oxc-parser": "=0.
|
|
123
|
-
"oxfmt": "=0.
|
|
116
|
+
"oxc-parser": "=0.133.0",
|
|
117
|
+
"oxfmt": "=0.52.0",
|
|
124
118
|
"picocolors": "^1.1.1",
|
|
125
119
|
"picomatch": "^4.0.3",
|
|
126
120
|
"pkg-types": "^2.3.0",
|
|
127
|
-
"rolldown-plugin-dts": "^0.
|
|
121
|
+
"rolldown-plugin-dts": "^0.25.1",
|
|
128
122
|
"rollup": "^4.18.0",
|
|
129
123
|
"rollup-plugin-license": "^3.6.0",
|
|
130
124
|
"semver": "^7.7.3",
|
|
131
125
|
"tinyglobby": "^0.2.15",
|
|
132
126
|
"tree-kill": "^1.2.2",
|
|
133
127
|
"tsdown": "^0.22.0",
|
|
134
|
-
"rolldown": "1.0.
|
|
135
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.
|
|
128
|
+
"rolldown": "1.0.3",
|
|
129
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.23"
|
|
136
130
|
},
|
|
137
131
|
"peerDependencies": {
|
|
138
132
|
"@arethetypeswrong/core": "^0.18.1",
|
|
@@ -221,8 +215,8 @@
|
|
|
221
215
|
"node": "^20.19.0 || >=22.12.0"
|
|
222
216
|
},
|
|
223
217
|
"bundledVersions": {
|
|
224
|
-
"vite": "8.0.
|
|
225
|
-
"rolldown": "1.0.
|
|
218
|
+
"vite": "8.0.14",
|
|
219
|
+
"rolldown": "1.0.3",
|
|
226
220
|
"tsdown": "0.22.0"
|
|
227
221
|
},
|
|
228
222
|
"scripts": {
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
type StringOrRegExp = string | RegExp;
|
|
2
|
-
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
|
3
|
-
export type FilterExpressionKind = FilterExpression['kind'];
|
|
4
|
-
export type FilterExpression = And | Or | Not | Id | ImporterId | ModuleType | Code | Query;
|
|
5
|
-
export type TopLevelFilterExpression = Include | Exclude;
|
|
6
|
-
declare class And {
|
|
7
|
-
kind: 'and';
|
|
8
|
-
args: FilterExpression[];
|
|
9
|
-
constructor(...args: FilterExpression[]);
|
|
10
|
-
}
|
|
11
|
-
declare class Or {
|
|
12
|
-
kind: 'or';
|
|
13
|
-
args: FilterExpression[];
|
|
14
|
-
constructor(...args: FilterExpression[]);
|
|
15
|
-
}
|
|
16
|
-
declare class Not {
|
|
17
|
-
kind: 'not';
|
|
18
|
-
expr: FilterExpression;
|
|
19
|
-
constructor(expr: FilterExpression);
|
|
20
|
-
}
|
|
21
|
-
export interface QueryFilterObject {
|
|
22
|
-
[key: string]: StringOrRegExp | boolean;
|
|
23
|
-
}
|
|
24
|
-
interface IdParams {
|
|
25
|
-
cleanUrl?: boolean;
|
|
26
|
-
}
|
|
27
|
-
declare class Id {
|
|
28
|
-
kind: 'id';
|
|
29
|
-
pattern: StringOrRegExp;
|
|
30
|
-
params: IdParams;
|
|
31
|
-
constructor(pattern: StringOrRegExp, params?: IdParams);
|
|
32
|
-
}
|
|
33
|
-
declare class ImporterId {
|
|
34
|
-
kind: 'importerId';
|
|
35
|
-
pattern: StringOrRegExp;
|
|
36
|
-
params: IdParams;
|
|
37
|
-
constructor(pattern: StringOrRegExp, params?: IdParams);
|
|
38
|
-
}
|
|
39
|
-
declare class ModuleType {
|
|
40
|
-
kind: 'moduleType';
|
|
41
|
-
pattern: PluginModuleType;
|
|
42
|
-
constructor(pattern: PluginModuleType);
|
|
43
|
-
}
|
|
44
|
-
declare class Code {
|
|
45
|
-
kind: 'code';
|
|
46
|
-
pattern: StringOrRegExp;
|
|
47
|
-
constructor(expr: StringOrRegExp);
|
|
48
|
-
}
|
|
49
|
-
declare class Query {
|
|
50
|
-
kind: 'query';
|
|
51
|
-
key: string;
|
|
52
|
-
pattern: StringOrRegExp | boolean;
|
|
53
|
-
constructor(key: string, pattern: StringOrRegExp | boolean);
|
|
54
|
-
}
|
|
55
|
-
declare class Include {
|
|
56
|
-
kind: 'include';
|
|
57
|
-
expr: FilterExpression;
|
|
58
|
-
constructor(expr: FilterExpression);
|
|
59
|
-
}
|
|
60
|
-
declare class Exclude {
|
|
61
|
-
kind: 'exclude';
|
|
62
|
-
expr: FilterExpression;
|
|
63
|
-
constructor(expr: FilterExpression);
|
|
64
|
-
}
|
|
65
|
-
export declare function and(...args: FilterExpression[]): And;
|
|
66
|
-
export declare function or(...args: FilterExpression[]): Or;
|
|
67
|
-
export declare function not(expr: FilterExpression): Not;
|
|
68
|
-
export declare function id(pattern: StringOrRegExp, params?: IdParams): Id;
|
|
69
|
-
export declare function importerId(pattern: StringOrRegExp, params?: IdParams): ImporterId;
|
|
70
|
-
export declare function moduleType(pattern: PluginModuleType): ModuleType;
|
|
71
|
-
export declare function code(pattern: StringOrRegExp): Code;
|
|
72
|
-
export declare function query(key: string, pattern: StringOrRegExp | boolean): Query;
|
|
73
|
-
export declare function include(expr: FilterExpression): Include;
|
|
74
|
-
export declare function exclude(expr: FilterExpression): Exclude;
|
|
75
|
-
/**
|
|
76
|
-
* convert a queryObject to FilterExpression like
|
|
77
|
-
* ```js
|
|
78
|
-
* and(query(k1, v1), query(k2, v2))
|
|
79
|
-
* ```
|
|
80
|
-
* @param queryFilterObject The query filter object needs to be matched.
|
|
81
|
-
* @returns a `And` FilterExpression
|
|
82
|
-
*/
|
|
83
|
-
export declare function queries(queryFilter: QueryFilterObject): And;
|
|
84
|
-
export declare function interpreter(exprs: TopLevelFilterExpression | TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string): boolean;
|
|
85
|
-
interface InterpreterCtx {
|
|
86
|
-
urlSearchParamsCache?: URLSearchParams;
|
|
87
|
-
}
|
|
88
|
-
export declare function interpreterImpl(expr: TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
|
|
89
|
-
export declare function exprInterpreter(expr: FilterExpression, code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
|
|
90
|
-
export {};
|