New Project
All checks were successful
BeijingMediaOfficialWebsite-ZhaoJian/BeijingMediaOfficialWebsite-ZhaoJian/pipeline/head This commit looks good
All checks were successful
BeijingMediaOfficialWebsite-ZhaoJian/BeijingMediaOfficialWebsite-ZhaoJian/pipeline/head This commit looks good
This commit is contained in:
21
web/node_modules/@vitejs/plugin-vue-jsx/LICENSE
generated
vendored
Normal file
21
web/node_modules/@vitejs/plugin-vue-jsx/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
109
web/node_modules/@vitejs/plugin-vue-jsx/README.md
generated
vendored
Normal file
109
web/node_modules/@vitejs/plugin-vue-jsx/README.md
generated
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
# @vitejs/plugin-vue-jsx [](https://npmjs.com/package/@vitejs/plugin-vue-jsx)
|
||||
|
||||
Provides Vue 3 JSX & TSX support with HMR.
|
||||
|
||||
```js
|
||||
// vite.config.js
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
|
||||
export default {
|
||||
plugins: [
|
||||
vueJsx({
|
||||
// options are passed on to @vue/babel-plugin-jsx
|
||||
}),
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### include
|
||||
|
||||
Type: `(string | RegExp)[] | string | RegExp | null`
|
||||
|
||||
Default: `/\.[jt]sx$/`
|
||||
|
||||
A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files the plugin should operate on.
|
||||
|
||||
### exclude
|
||||
|
||||
Type: `(string | RegExp)[] | string | RegExp | null`
|
||||
|
||||
Default: `undefined`
|
||||
|
||||
A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files to be ignored by the plugin.
|
||||
|
||||
> See [@vue/babel-plugin-jsx](https://github.com/vuejs/jsx-next) for other options.
|
||||
|
||||
### defineComponentName
|
||||
|
||||
Type: `string[]`
|
||||
|
||||
Default: `['defineComponent']`
|
||||
|
||||
The name of the function to be used for defining components. This is useful when you have a custom `defineComponent` function.
|
||||
|
||||
### tsTransform
|
||||
|
||||
Type: `'babel' | 'built-in'`
|
||||
|
||||
Default: `'babel'`
|
||||
|
||||
Defines how `typescript` transformation is handled for `.tsx` files.
|
||||
|
||||
`'babel'` - `typescript` transformation is handled by `@babel/plugin-transform-typescript` during `babel` invocation for JSX transformation.
|
||||
|
||||
`'built-in'` - `babel` is invoked only for JSX transformation and then `typescript` transformation is handled by the same toolchain used for `.ts` files (currently `esbuild`).
|
||||
|
||||
### babelPlugins
|
||||
|
||||
Type: `any[]`
|
||||
|
||||
Default: `undefined`
|
||||
|
||||
Provide additional plugins for `babel` invocation for JSX transformation.
|
||||
|
||||
### tsPluginOptions
|
||||
|
||||
Type: `any`
|
||||
|
||||
Default: `undefined`
|
||||
|
||||
Defines options for `@babel/plugin-transform-typescript` plugin.
|
||||
|
||||
## HMR Detection
|
||||
|
||||
This plugin supports HMR of Vue JSX components. The detection requirements are:
|
||||
|
||||
- The component must be exported.
|
||||
- The component must be declared by calling `defineComponent` or the name specified in `defineComponentName` via a root-level statement, either variable declaration or export declaration.
|
||||
|
||||
### Supported patterns
|
||||
|
||||
```jsx
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
// named exports w/ variable declaration: ok
|
||||
export const Foo = defineComponent({})
|
||||
|
||||
// named exports referencing variable declaration: ok
|
||||
const Bar = defineComponent({ render() { return <div>Test</div> }})
|
||||
export { Bar }
|
||||
|
||||
// default export call: ok
|
||||
export default defineComponent({ render() { return <div>Test</div> }})
|
||||
|
||||
// default export referencing variable declaration: ok
|
||||
const Baz = defineComponent({ render() { return <div>Test</div> }})
|
||||
export default Baz
|
||||
```
|
||||
|
||||
### Non-supported patterns
|
||||
|
||||
```jsx
|
||||
// not using `defineComponent` call
|
||||
export const Bar = { ... }
|
||||
|
||||
// not exported
|
||||
const Foo = defineComponent(...)
|
||||
```
|
||||
22
web/node_modules/@vitejs/plugin-vue-jsx/dist/index.d.mts
generated
vendored
Normal file
22
web/node_modules/@vitejs/plugin-vue-jsx/dist/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { VueJSXPluginOptions } from "@vue/babel-plugin-jsx";
|
||||
import { FilterPattern, Plugin } from "vite";
|
||||
|
||||
//#region src/types.d.ts
|
||||
interface FilterOptions {
|
||||
include?: FilterPattern;
|
||||
exclude?: FilterPattern;
|
||||
}
|
||||
interface Options extends VueJSXPluginOptions, FilterOptions {
|
||||
babelPlugins?: any[];
|
||||
/** @default ['defineComponent'] */
|
||||
defineComponentName?: string[];
|
||||
tsPluginOptions?: any;
|
||||
/** @default 'babel' */
|
||||
tsTransform?: 'babel' | 'built-in';
|
||||
}
|
||||
//#endregion
|
||||
//#region src/index.d.ts
|
||||
declare function vueJsxPlugin(options?: Options): Plugin;
|
||||
declare function vueJsxPluginCjs(this: unknown, options: Options): Plugin;
|
||||
//#endregion
|
||||
export { FilterOptions, Options, vueJsxPlugin as default, vueJsxPluginCjs as "module.exports" };
|
||||
209
web/node_modules/@vitejs/plugin-vue-jsx/dist/index.mjs
generated
vendored
Normal file
209
web/node_modules/@vitejs/plugin-vue-jsx/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,209 @@
|
||||
import crypto from "node:crypto";
|
||||
import path from "node:path";
|
||||
import * as babel from "@babel/core";
|
||||
import { types } from "@babel/core";
|
||||
import jsx from "@vue/babel-plugin-jsx";
|
||||
import { createFilter, normalizePath } from "vite";
|
||||
import { exactRegex, makeIdFiltersToMatchWithQuery } from "@rolldown/pluginutils";
|
||||
|
||||
//#region src/index.ts
|
||||
const ssrRegisterHelperId = "/__vue-jsx-ssr-register-helper";
|
||||
const ssrRegisterHelperCode = `import { useSSRContext } from "vue"\nexport const ssrRegisterHelper = ${ssrRegisterHelper.toString()}`;
|
||||
/**
|
||||
* This function is serialized with toString() and evaluated as a virtual
|
||||
* module during SSR
|
||||
*/
|
||||
function ssrRegisterHelper(comp, filename) {
|
||||
const setup = comp.setup;
|
||||
comp.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add(filename);
|
||||
if (setup) return setup(props, ctx);
|
||||
};
|
||||
}
|
||||
function vueJsxPlugin(options = {}) {
|
||||
let root = "";
|
||||
let needHmr = false;
|
||||
let needSourceMap = true;
|
||||
const { include = /\.[jt]sx$/, exclude, babelPlugins = [], defineComponentName = ["defineComponent"], tsPluginOptions = {}, tsTransform, ...babelPluginOptions } = options;
|
||||
const filter = createFilter(include, exclude);
|
||||
return {
|
||||
name: "vite:vue-jsx",
|
||||
config(config) {
|
||||
const parseDefine = (v) => {
|
||||
try {
|
||||
return typeof v === "string" ? JSON.parse(v) : v;
|
||||
} catch (err) {
|
||||
return v;
|
||||
}
|
||||
};
|
||||
const isRolldownVite = this && "rolldownVersion" in this.meta;
|
||||
return {
|
||||
[isRolldownVite ? "oxc" : "esbuild"]: tsTransform === "built-in" ? { exclude: /\.jsx?$/ } : { include: /\.ts$/ },
|
||||
define: {
|
||||
__VUE_OPTIONS_API__: parseDefine(config.define?.__VUE_OPTIONS_API__) ?? true,
|
||||
__VUE_PROD_DEVTOOLS__: parseDefine(config.define?.__VUE_PROD_DEVTOOLS__) ?? false,
|
||||
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: parseDefine(config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__) ?? false
|
||||
},
|
||||
optimizeDeps: isRolldownVite ? { rolldownOptions: { transform: { jsx: "preserve" } } } : {}
|
||||
};
|
||||
},
|
||||
configResolved(config) {
|
||||
needHmr = config.command === "serve" && !config.isProduction;
|
||||
needSourceMap = config.command === "serve" || !!config.build.sourcemap;
|
||||
root = config.root;
|
||||
},
|
||||
resolveId: {
|
||||
filter: { id: exactRegex(ssrRegisterHelperId) },
|
||||
handler(id) {
|
||||
if (id === ssrRegisterHelperId) return id;
|
||||
}
|
||||
},
|
||||
load: {
|
||||
filter: { id: exactRegex(ssrRegisterHelperId) },
|
||||
handler(id) {
|
||||
if (id === ssrRegisterHelperId) return ssrRegisterHelperCode;
|
||||
}
|
||||
},
|
||||
transform: {
|
||||
order: tsTransform === "built-in" ? "pre" : void 0,
|
||||
filter: { id: {
|
||||
include: include ? makeIdFiltersToMatchWithQuery(include) : void 0,
|
||||
exclude: exclude ? makeIdFiltersToMatchWithQuery(exclude) : void 0
|
||||
} },
|
||||
async handler(code, id, opt) {
|
||||
const ssr = opt?.ssr === true;
|
||||
const [filepath] = id.split("?");
|
||||
if (filter(id) || filter(filepath)) {
|
||||
const plugins = [[jsx, babelPluginOptions], ...babelPlugins];
|
||||
if (id.endsWith(".tsx") || filepath.endsWith(".tsx")) if (tsTransform === "built-in") plugins.push([await import("@babel/plugin-syntax-typescript").then((r) => r.default), { isTSX: true }]);
|
||||
else plugins.push([await import("@babel/plugin-transform-typescript").then((r) => r.default), {
|
||||
...tsPluginOptions,
|
||||
isTSX: true,
|
||||
allowExtensions: true
|
||||
}]);
|
||||
if (!ssr && !needHmr) plugins.push(() => {
|
||||
return { visitor: { CallExpression: { enter(_path) {
|
||||
if (isDefineComponentCall(_path.node, defineComponentName)) {
|
||||
const callee = _path.node.callee;
|
||||
callee.name = `/* @__PURE__ */ ${callee.name}`;
|
||||
}
|
||||
} } } };
|
||||
});
|
||||
else plugins.push(() => {
|
||||
return { visitor: { ExportDefaultDeclaration: { enter(_path) {
|
||||
const unwrappedDeclaration = unwrapTypeAssertion(_path.node.declaration);
|
||||
if (isDefineComponentCall(unwrappedDeclaration, defineComponentName)) {
|
||||
const declaration = unwrappedDeclaration;
|
||||
const nodesPath = _path.replaceWithMultiple([types.variableDeclaration("const", [types.variableDeclarator(types.identifier("__default__"), types.callExpression(declaration.callee, declaration.arguments))]), types.exportDefaultDeclaration(types.identifier("__default__"))]);
|
||||
_path.scope.registerDeclaration(nodesPath[0]);
|
||||
}
|
||||
} } } };
|
||||
});
|
||||
const result = babel.transformSync(code, {
|
||||
babelrc: false,
|
||||
ast: true,
|
||||
plugins,
|
||||
sourceMaps: needSourceMap,
|
||||
sourceFileName: id,
|
||||
configFile: false
|
||||
});
|
||||
if (!ssr && !needHmr) {
|
||||
if (!result.code) return;
|
||||
return {
|
||||
code: result.code,
|
||||
map: result.map
|
||||
};
|
||||
}
|
||||
const declaredComponents = [];
|
||||
const hotComponents = [];
|
||||
for (const node of result.ast.program.body) {
|
||||
if (node.type === "VariableDeclaration") {
|
||||
const names = parseComponentDecls(node, defineComponentName);
|
||||
if (names.length) declaredComponents.push(...names);
|
||||
}
|
||||
if (node.type === "ExportNamedDeclaration") {
|
||||
if (node.declaration && node.declaration.type === "VariableDeclaration") hotComponents.push(...parseComponentDecls(node.declaration, defineComponentName).map((name) => ({
|
||||
local: name,
|
||||
exported: name,
|
||||
id: getHash(id + name)
|
||||
})));
|
||||
else if (node.specifiers.length) {
|
||||
for (const spec of node.specifiers) if (spec.type === "ExportSpecifier" && spec.exported.type === "Identifier") {
|
||||
if (declaredComponents.find((name) => name === spec.local.name)) hotComponents.push({
|
||||
local: spec.local.name,
|
||||
exported: spec.exported.name,
|
||||
id: getHash(id + spec.exported.name)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (node.type === "ExportDefaultDeclaration") {
|
||||
if (node.declaration.type === "Identifier") {
|
||||
const _name = node.declaration.name;
|
||||
if (declaredComponents.find((name) => name === _name)) hotComponents.push({
|
||||
local: _name,
|
||||
exported: "default",
|
||||
id: getHash(id + "default")
|
||||
});
|
||||
} else if (isDefineComponentCall(unwrapTypeAssertion(node.declaration), defineComponentName)) hotComponents.push({
|
||||
local: "__default__",
|
||||
exported: "default",
|
||||
id: getHash(id + "default")
|
||||
});
|
||||
}
|
||||
}
|
||||
if (hotComponents.length) {
|
||||
if (needHmr && !ssr && !/\?vue&type=script/.test(id)) {
|
||||
let code$1 = result.code;
|
||||
let callbackCode = ``;
|
||||
for (const { local, exported, id: id$1 } of hotComponents) {
|
||||
code$1 += `\n${local}.__hmrId = "${id$1}"\n__VUE_HMR_RUNTIME__.createRecord("${id$1}", ${local})`;
|
||||
callbackCode += `\n__VUE_HMR_RUNTIME__.reload("${id$1}", __${exported})`;
|
||||
}
|
||||
const newCompNames = hotComponents.map((c) => `${c.exported}: __${c.exported}`).join(",");
|
||||
code$1 += `\nimport.meta.hot.accept(({${newCompNames}}) => {${callbackCode}\n})`;
|
||||
result.code = code$1;
|
||||
}
|
||||
if (ssr) {
|
||||
const normalizedId = normalizePath(path.relative(root, id));
|
||||
let ssrInjectCode = `\nimport { ssrRegisterHelper } from "${ssrRegisterHelperId}"\nconst __moduleId = ${JSON.stringify(normalizedId)}`;
|
||||
for (const { local } of hotComponents) ssrInjectCode += `\nssrRegisterHelper(${local}, __moduleId)`;
|
||||
result.code += ssrInjectCode;
|
||||
}
|
||||
}
|
||||
if (!result.code) return;
|
||||
return {
|
||||
code: result.code,
|
||||
map: result.map
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function parseComponentDecls(node, fnNames) {
|
||||
const names = [];
|
||||
for (const decl of node.declarations) if (decl.id.type === "Identifier" && isDefineComponentCall(unwrapTypeAssertion(decl.init), fnNames)) names.push(decl.id.name);
|
||||
return names;
|
||||
}
|
||||
function isDefineComponentCall(node, names) {
|
||||
return node && node.type === "CallExpression" && node.callee.type === "Identifier" && names.includes(node.callee.name);
|
||||
}
|
||||
function unwrapTypeAssertion(node) {
|
||||
if (!node) return node;
|
||||
let current = node;
|
||||
while (current.type === "TSAsExpression" || current.type === "TSSatisfiesExpression" || current.type === "TSTypeAssertion") current = current.expression;
|
||||
return current;
|
||||
}
|
||||
function getHash(text) {
|
||||
return crypto.hash("sha256", text, "hex").substring(0, 8);
|
||||
}
|
||||
var src_default = vueJsxPlugin;
|
||||
function vueJsxPluginCjs(options) {
|
||||
return vueJsxPlugin.call(this, options);
|
||||
}
|
||||
Object.assign(vueJsxPluginCjs, { default: vueJsxPluginCjs });
|
||||
|
||||
//#endregion
|
||||
export { src_default as default, vueJsxPluginCjs as "module.exports" };
|
||||
25
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/LICENSE
generated
vendored
Normal file
25
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024-present VoidZero Inc. & Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
end of terms and conditions
|
||||
|
||||
The licenses of externally maintained libraries from which parts of the Software is derived are listed [here](https://github.com/rolldown/rolldown/blob/main/THIRD-PARTY-LICENSE).
|
||||
85
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/README.md
generated
vendored
Normal file
85
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/README.md
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
# @rolldown/pluginutils
|
||||
|
||||
A utility library for building flexible, composable filter expressions that can be used in plugin hook filters of Rolldown/Vite/Rollup/Unplugin plugins.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
pnpm add @rolldown/pluginutils
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Simple Filters
|
||||
|
||||
```ts
|
||||
import {
|
||||
exactRegex,
|
||||
makeIdFiltersToMatchWithQuery,
|
||||
prefixRegex,
|
||||
} from '@rolldown/pluginutils';
|
||||
|
||||
// Match exactly 'foo.js'
|
||||
const filter = exactRegex('foo.js');
|
||||
|
||||
// Match any id starting with 'lib/'
|
||||
const prefix = prefixRegex('lib/');
|
||||
|
||||
// Match ids with query params (e.g. 'foo.js?bar')
|
||||
const idFilters = makeIdFiltersToMatchWithQuery(['**/*.js', /\.ts$/]);
|
||||
|
||||
// Usage in a plugin to define a hook filter
|
||||
const myPlugin = {
|
||||
resolveId: {
|
||||
filter: {
|
||||
id: [exactRegex('MY_ID_TO_CHECK'), /some-other-regex/],
|
||||
},
|
||||
handler(id) {
|
||||
// Your code here
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Composable Filters
|
||||
|
||||
> [!WARNING] Composable filters are not yet supported in Vite, Rolldown-Vite or unplugin. They can be used in Rolldown plugins only.
|
||||
|
||||
```ts
|
||||
import { and, id, include, moduleType, query } from '@rolldown/pluginutils';
|
||||
|
||||
// Build a filter expression
|
||||
const filterExpr = and(
|
||||
id(/\.ts$/),
|
||||
moduleType('ts'),
|
||||
query('foo', true),
|
||||
);
|
||||
|
||||
// Usage in a plugin to define a hook filter
|
||||
const myPlugin = {
|
||||
transform: {
|
||||
filter: [include(filterExpr)],
|
||||
handler(code, id, options) {
|
||||
// Your code here
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
### Simple Filters
|
||||
|
||||
- `exactRegex(str: string, flags?: string): RegExp` — Matches the exact string.
|
||||
- `prefixRegex(str: string, flags?: string): RegExp` — Matches values with the given prefix.
|
||||
- `makeIdFiltersToMatchWithQuery(input: string | RegExp | (string | RegExp)[]): string | RegExp | (string | RegExp)[]` — Adapts filters to match ids with query params.
|
||||
|
||||
### Composable Filters
|
||||
|
||||
- `and(...exprs)` / `or(...exprs)` / `not(expr)` — Logical composition of filter expressions.
|
||||
- `id(pattern, params?)` — Filter by id (string or RegExp).
|
||||
- `moduleType(type)` — Filter by module type (e.g. 'js', 'tsx', or 'json').
|
||||
- `code(pattern)` — Filter by code content.
|
||||
- `query(key, pattern)` — Filter by query parameter.
|
||||
- `include(expr)` / `exclude(expr)` — Top-level include/exclude wrappers.
|
||||
- `queries(obj)` — Compose multiple query filters.
|
||||
90
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.d.ts
generated
vendored
Normal file
90
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.d.ts
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
type StringOrRegExp = string | RegExp;
|
||||
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
||||
export type FilterExpressionKind = FilterExpression['kind'];
|
||||
export type FilterExpression = And | Or | Not | Id | ImporterId | ModuleType | Code | Query;
|
||||
export type TopLevelFilterExpression = Include | Exclude;
|
||||
declare class And {
|
||||
kind: 'and';
|
||||
args: FilterExpression[];
|
||||
constructor(...args: FilterExpression[]);
|
||||
}
|
||||
declare class Or {
|
||||
kind: 'or';
|
||||
args: FilterExpression[];
|
||||
constructor(...args: FilterExpression[]);
|
||||
}
|
||||
declare class Not {
|
||||
kind: 'not';
|
||||
expr: FilterExpression;
|
||||
constructor(expr: FilterExpression);
|
||||
}
|
||||
export interface QueryFilterObject {
|
||||
[key: string]: StringOrRegExp | boolean;
|
||||
}
|
||||
interface IdParams {
|
||||
cleanUrl?: boolean;
|
||||
}
|
||||
declare class Id {
|
||||
kind: 'id';
|
||||
pattern: StringOrRegExp;
|
||||
params: IdParams;
|
||||
constructor(pattern: StringOrRegExp, params?: IdParams);
|
||||
}
|
||||
declare class ImporterId {
|
||||
kind: 'importerId';
|
||||
pattern: StringOrRegExp;
|
||||
params: IdParams;
|
||||
constructor(pattern: StringOrRegExp, params?: IdParams);
|
||||
}
|
||||
declare class ModuleType {
|
||||
kind: 'moduleType';
|
||||
pattern: PluginModuleType;
|
||||
constructor(pattern: PluginModuleType);
|
||||
}
|
||||
declare class Code {
|
||||
kind: 'code';
|
||||
pattern: StringOrRegExp;
|
||||
constructor(expr: StringOrRegExp);
|
||||
}
|
||||
declare class Query {
|
||||
kind: 'query';
|
||||
key: string;
|
||||
pattern: StringOrRegExp | boolean;
|
||||
constructor(key: string, pattern: StringOrRegExp | boolean);
|
||||
}
|
||||
declare class Include {
|
||||
kind: 'include';
|
||||
expr: FilterExpression;
|
||||
constructor(expr: FilterExpression);
|
||||
}
|
||||
declare class Exclude {
|
||||
kind: 'exclude';
|
||||
expr: FilterExpression;
|
||||
constructor(expr: FilterExpression);
|
||||
}
|
||||
export declare function and(...args: FilterExpression[]): And;
|
||||
export declare function or(...args: FilterExpression[]): Or;
|
||||
export declare function not(expr: FilterExpression): Not;
|
||||
export declare function id(pattern: StringOrRegExp, params?: IdParams): Id;
|
||||
export declare function importerId(pattern: StringOrRegExp, params?: IdParams): ImporterId;
|
||||
export declare function moduleType(pattern: PluginModuleType): ModuleType;
|
||||
export declare function code(pattern: StringOrRegExp): Code;
|
||||
export declare function query(key: string, pattern: StringOrRegExp | boolean): Query;
|
||||
export declare function include(expr: FilterExpression): Include;
|
||||
export declare function exclude(expr: FilterExpression): Exclude;
|
||||
/**
|
||||
* convert a queryObject to FilterExpression like
|
||||
* ```js
|
||||
* and(query(k1, v1), query(k2, v2))
|
||||
* ```
|
||||
* @param queryFilterObject The query filter object needs to be matched.
|
||||
* @returns a `And` FilterExpression
|
||||
*/
|
||||
export declare function queries(queryFilter: QueryFilterObject): And;
|
||||
export declare function interpreter(exprs: TopLevelFilterExpression | TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string): boolean;
|
||||
interface InterpreterCtx {
|
||||
urlSearchParamsCache?: URLSearchParams;
|
||||
}
|
||||
export declare function interpreterImpl(expr: TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
|
||||
export declare function exprInterpreter(expr: FilterExpression, code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
|
||||
export {};
|
||||
256
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.js
generated
vendored
Normal file
256
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.js
generated
vendored
Normal file
@@ -0,0 +1,256 @@
|
||||
import { cleanUrl, extractQueryWithoutFragment } from "../utils.js";
|
||||
class And {
|
||||
kind;
|
||||
args;
|
||||
constructor(...args) {
|
||||
if (args.length === 0) {
|
||||
throw new Error('`And` expects at least one operand');
|
||||
}
|
||||
this.args = args;
|
||||
this.kind = 'and';
|
||||
}
|
||||
}
|
||||
class Or {
|
||||
kind;
|
||||
args;
|
||||
constructor(...args) {
|
||||
if (args.length === 0) {
|
||||
throw new Error('`Or` expects at least one operand');
|
||||
}
|
||||
this.args = args;
|
||||
this.kind = 'or';
|
||||
}
|
||||
}
|
||||
class Not {
|
||||
kind;
|
||||
expr;
|
||||
constructor(expr) {
|
||||
this.expr = expr;
|
||||
this.kind = 'not';
|
||||
}
|
||||
}
|
||||
class Id {
|
||||
kind;
|
||||
pattern;
|
||||
params;
|
||||
constructor(pattern, params) {
|
||||
this.pattern = pattern;
|
||||
this.kind = 'id';
|
||||
this.params = params ?? {
|
||||
cleanUrl: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
class ImporterId {
|
||||
kind;
|
||||
pattern;
|
||||
params;
|
||||
constructor(pattern, params) {
|
||||
this.pattern = pattern;
|
||||
this.kind = 'importerId';
|
||||
this.params = params ?? {
|
||||
cleanUrl: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
class ModuleType {
|
||||
kind;
|
||||
pattern;
|
||||
constructor(pattern) {
|
||||
this.pattern = pattern;
|
||||
this.kind = 'moduleType';
|
||||
}
|
||||
}
|
||||
class Code {
|
||||
kind;
|
||||
pattern;
|
||||
constructor(expr) {
|
||||
this.pattern = expr;
|
||||
this.kind = 'code';
|
||||
}
|
||||
}
|
||||
class Query {
|
||||
kind;
|
||||
key;
|
||||
pattern;
|
||||
constructor(key, pattern) {
|
||||
this.pattern = pattern;
|
||||
this.key = key;
|
||||
this.kind = 'query';
|
||||
}
|
||||
}
|
||||
class Include {
|
||||
kind;
|
||||
expr;
|
||||
constructor(expr) {
|
||||
this.expr = expr;
|
||||
this.kind = 'include';
|
||||
}
|
||||
}
|
||||
class Exclude {
|
||||
kind;
|
||||
expr;
|
||||
constructor(expr) {
|
||||
this.expr = expr;
|
||||
this.kind = 'exclude';
|
||||
}
|
||||
}
|
||||
export function and(...args) {
|
||||
return new And(...args);
|
||||
}
|
||||
export function or(...args) {
|
||||
return new Or(...args);
|
||||
}
|
||||
export function not(expr) {
|
||||
return new Not(expr);
|
||||
}
|
||||
export function id(pattern, params) {
|
||||
return new Id(pattern, params);
|
||||
}
|
||||
export function importerId(pattern, params) {
|
||||
return new ImporterId(pattern, params);
|
||||
}
|
||||
export function moduleType(pattern) {
|
||||
return new ModuleType(pattern);
|
||||
}
|
||||
export function code(pattern) {
|
||||
return new Code(pattern);
|
||||
}
|
||||
/*
|
||||
* There are three kinds of conditions are supported:
|
||||
* 1. `boolean`: if the value is `true`, the key must exist and be truthy. if the value is `false`, the key must not exist or be falsy.
|
||||
* 2. `string`: the key must exist and be equal to the value.
|
||||
* 3. `RegExp`: the key must exist and match the value.
|
||||
*/
|
||||
export function query(key, pattern) {
|
||||
return new Query(key, pattern);
|
||||
}
|
||||
export function include(expr) {
|
||||
return new Include(expr);
|
||||
}
|
||||
export function exclude(expr) {
|
||||
return new Exclude(expr);
|
||||
}
|
||||
/**
|
||||
* convert a queryObject to FilterExpression like
|
||||
* ```js
|
||||
* and(query(k1, v1), query(k2, v2))
|
||||
* ```
|
||||
* @param queryFilterObject The query filter object needs to be matched.
|
||||
* @returns a `And` FilterExpression
|
||||
*/
|
||||
export function queries(queryFilter) {
|
||||
let arr = Object.entries(queryFilter).map(([key, value]) => {
|
||||
return new Query(key, value);
|
||||
});
|
||||
return and(...arr);
|
||||
}
|
||||
export function interpreter(exprs, code, id, moduleType, importerId) {
|
||||
let arr = [];
|
||||
if (Array.isArray(exprs)) {
|
||||
arr = exprs;
|
||||
}
|
||||
else {
|
||||
arr = [exprs];
|
||||
}
|
||||
return interpreterImpl(arr, code, id, moduleType, importerId);
|
||||
}
|
||||
export function interpreterImpl(expr, code, id, moduleType, importerId, ctx = {}) {
|
||||
let hasInclude = false;
|
||||
for (const e of expr) {
|
||||
switch (e.kind) {
|
||||
case 'include': {
|
||||
hasInclude = true;
|
||||
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'exclude': {
|
||||
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return !hasInclude;
|
||||
}
|
||||
export function exprInterpreter(expr, code, id, moduleType, importerId, ctx = {}) {
|
||||
switch (expr.kind) {
|
||||
case 'and': {
|
||||
return expr.args.every((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
|
||||
}
|
||||
case 'or': {
|
||||
return expr.args.some((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
|
||||
}
|
||||
case 'not': {
|
||||
return !exprInterpreter(expr.expr, code, id, moduleType, importerId, ctx);
|
||||
}
|
||||
case 'id': {
|
||||
if (id === undefined) {
|
||||
throw new Error('`id` is required for `id` expression');
|
||||
}
|
||||
let idToMatch = id;
|
||||
if (expr.params.cleanUrl) {
|
||||
idToMatch = cleanUrl(idToMatch);
|
||||
}
|
||||
return typeof expr.pattern === 'string'
|
||||
? idToMatch === expr.pattern
|
||||
: expr.pattern.test(idToMatch);
|
||||
}
|
||||
case 'importerId': {
|
||||
if (importerId === undefined) {
|
||||
return false; // Entry files have no importer, so no match
|
||||
}
|
||||
let importerIdToMatch = importerId;
|
||||
if (expr.params.cleanUrl) {
|
||||
importerIdToMatch = cleanUrl(importerIdToMatch);
|
||||
}
|
||||
return typeof expr.pattern === 'string'
|
||||
? importerIdToMatch === expr.pattern
|
||||
: expr.pattern.test(importerIdToMatch);
|
||||
}
|
||||
case 'moduleType': {
|
||||
if (moduleType === undefined) {
|
||||
throw new Error('`moduleType` is required for `moduleType` expression');
|
||||
}
|
||||
return moduleType === expr.pattern;
|
||||
}
|
||||
case 'code': {
|
||||
if (code === undefined) {
|
||||
throw new Error('`code` is required for `code` expression');
|
||||
}
|
||||
return typeof expr.pattern === 'string'
|
||||
? code.includes(expr.pattern)
|
||||
: expr.pattern.test(code);
|
||||
}
|
||||
case 'query': {
|
||||
if (id === undefined) {
|
||||
throw new Error('`id` is required for `Query` expression');
|
||||
}
|
||||
if (!ctx.urlSearchParamsCache) {
|
||||
let queryString = extractQueryWithoutFragment(id);
|
||||
ctx.urlSearchParamsCache = new URLSearchParams(queryString);
|
||||
}
|
||||
let urlParams = ctx.urlSearchParamsCache;
|
||||
if (typeof expr.pattern === 'boolean') {
|
||||
if (expr.pattern) {
|
||||
return urlParams.has(expr.key);
|
||||
}
|
||||
else {
|
||||
return !urlParams.has(expr.key);
|
||||
}
|
||||
}
|
||||
else if (typeof expr.pattern === 'string') {
|
||||
return urlParams.get(expr.key) === expr.pattern;
|
||||
}
|
||||
else {
|
||||
return expr.pattern.test(urlParams.get(expr.key) ?? '');
|
||||
}
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
28
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.d.ts
generated
vendored
Normal file
28
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Filters out Vite plugins that have `apply: 'serve'` set.
|
||||
*
|
||||
* Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
|
||||
* are intended only for Vite's dev server and should be excluded from the build process.
|
||||
*
|
||||
* @param plugins - Array of plugins (can include nested arrays)
|
||||
* @returns Filtered array with serve-only plugins removed
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import { defineConfig } from 'rolldown';
|
||||
* import { filterVitePlugins } from '@rolldown/pluginutils';
|
||||
* import viteReact from '@vitejs/plugin-react';
|
||||
*
|
||||
* export default defineConfig({
|
||||
* plugins: filterVitePlugins([
|
||||
* viteReact(),
|
||||
* {
|
||||
* name: 'dev-only',
|
||||
* apply: 'serve', // This will be filtered out
|
||||
* // ...
|
||||
* }
|
||||
* ])
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export declare function filterVitePlugins<T = any>(plugins: T | T[] | null | undefined | false): T[];
|
||||
75
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.js
generated
vendored
Normal file
75
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Filters out Vite plugins that have `apply: 'serve'` set.
|
||||
*
|
||||
* Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
|
||||
* are intended only for Vite's dev server and should be excluded from the build process.
|
||||
*
|
||||
* @param plugins - Array of plugins (can include nested arrays)
|
||||
* @returns Filtered array with serve-only plugins removed
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import { defineConfig } from 'rolldown';
|
||||
* import { filterVitePlugins } from '@rolldown/pluginutils';
|
||||
* import viteReact from '@vitejs/plugin-react';
|
||||
*
|
||||
* export default defineConfig({
|
||||
* plugins: filterVitePlugins([
|
||||
* viteReact(),
|
||||
* {
|
||||
* name: 'dev-only',
|
||||
* apply: 'serve', // This will be filtered out
|
||||
* // ...
|
||||
* }
|
||||
* ])
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function filterVitePlugins(plugins) {
|
||||
if (!plugins) {
|
||||
return [];
|
||||
}
|
||||
const pluginArray = Array.isArray(plugins) ? plugins : [plugins];
|
||||
const result = [];
|
||||
for (const plugin of pluginArray) {
|
||||
// Skip falsy values
|
||||
if (!plugin) {
|
||||
continue;
|
||||
}
|
||||
// Handle nested arrays recursively
|
||||
if (Array.isArray(plugin)) {
|
||||
result.push(...filterVitePlugins(plugin));
|
||||
continue;
|
||||
}
|
||||
// Check if plugin has apply property
|
||||
const pluginWithApply = plugin;
|
||||
if ('apply' in pluginWithApply) {
|
||||
const applyValue = pluginWithApply.apply;
|
||||
// If apply is a function, call it with build mode
|
||||
if (typeof applyValue === 'function') {
|
||||
try {
|
||||
const shouldApply = applyValue({}, // config object
|
||||
{ command: 'build', mode: 'production' });
|
||||
if (shouldApply) {
|
||||
result.push(plugin);
|
||||
}
|
||||
}
|
||||
catch {
|
||||
// If function throws, include the plugin to be safe
|
||||
result.push(plugin);
|
||||
}
|
||||
} // If apply is 'serve', skip this plugin
|
||||
else if (applyValue === 'serve') {
|
||||
continue;
|
||||
} // If apply is 'build' or anything else, include it
|
||||
else {
|
||||
result.push(plugin);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// No apply property, include the plugin
|
||||
result.push(plugin);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
3
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/index.d.ts
generated
vendored
Normal file
3
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './composable-filters.ts';
|
||||
export * from './filter-vite-plugins.ts';
|
||||
export * from './simple-filters.ts';
|
||||
3
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/index.js
generated
vendored
Normal file
3
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from "./composable-filters.js";
|
||||
export * from "./filter-vite-plugins.js";
|
||||
export * from "./simple-filters.js";
|
||||
71
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.d.ts
generated
vendored
Normal file
71
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.d.ts
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* Constructs a RegExp that matches the exact string specified.
|
||||
*
|
||||
* This is useful for plugin hook filters.
|
||||
*
|
||||
* @param str the string to match.
|
||||
* @param flags flags for the RegExp.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import { exactRegex } from '@rolldown/pluginutils';
|
||||
* const plugin = {
|
||||
* name: 'plugin',
|
||||
* resolveId: {
|
||||
* filter: { id: exactRegex('foo') },
|
||||
* handler(id) {} // will only be called for `foo`
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export declare function exactRegex(str: string, flags?: string): RegExp;
|
||||
/**
|
||||
* Constructs a RegExp that matches a value that has the specified prefix.
|
||||
*
|
||||
* This is useful for plugin hook filters.
|
||||
*
|
||||
* @param str the string to match.
|
||||
* @param flags flags for the RegExp.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import { prefixRegex } from '@rolldown/pluginutils';
|
||||
* const plugin = {
|
||||
* name: 'plugin',
|
||||
* resolveId: {
|
||||
* filter: { id: prefixRegex('foo') },
|
||||
* handler(id) {} // will only be called for IDs starting with `foo`
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export declare function prefixRegex(str: string, flags?: string): RegExp;
|
||||
type WidenString<T> = T extends string ? string : T;
|
||||
/**
|
||||
* Converts a id filter to match with an id with a query.
|
||||
*
|
||||
* @param input the id filters to convert.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import { makeIdFiltersToMatchWithQuery } from '@rolldown/pluginutils';
|
||||
* const plugin = {
|
||||
* name: 'plugin',
|
||||
* transform: {
|
||||
* filter: { id: makeIdFiltersToMatchWithQuery(['**' + '/*.js', /\.ts$/]) },
|
||||
* // The handler will be called for IDs like:
|
||||
* // - foo.js
|
||||
* // - foo.js?foo
|
||||
* // - foo.txt?foo.js
|
||||
* // - foo.ts
|
||||
* // - foo.ts?foo
|
||||
* // - foo.txt?foo.ts
|
||||
* handler(code, id) {}
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: T): WidenString<T>;
|
||||
export declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: readonly T[]): WidenString<T>[];
|
||||
export declare function makeIdFiltersToMatchWithQuery(input: string | RegExp | readonly (string | RegExp)[]): string | RegExp | (string | RegExp)[];
|
||||
export {};
|
||||
70
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.js
generated
vendored
Normal file
70
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* Constructs a RegExp that matches the exact string specified.
|
||||
*
|
||||
* This is useful for plugin hook filters.
|
||||
*
|
||||
* @param str the string to match.
|
||||
* @param flags flags for the RegExp.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import { exactRegex } from '@rolldown/pluginutils';
|
||||
* const plugin = {
|
||||
* name: 'plugin',
|
||||
* resolveId: {
|
||||
* filter: { id: exactRegex('foo') },
|
||||
* handler(id) {} // will only be called for `foo`
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export function exactRegex(str, flags) {
|
||||
return new RegExp(`^${escapeRegex(str)}$`, flags);
|
||||
}
|
||||
/**
|
||||
* Constructs a RegExp that matches a value that has the specified prefix.
|
||||
*
|
||||
* This is useful for plugin hook filters.
|
||||
*
|
||||
* @param str the string to match.
|
||||
* @param flags flags for the RegExp.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import { prefixRegex } from '@rolldown/pluginutils';
|
||||
* const plugin = {
|
||||
* name: 'plugin',
|
||||
* resolveId: {
|
||||
* filter: { id: prefixRegex('foo') },
|
||||
* handler(id) {} // will only be called for IDs starting with `foo`
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export function prefixRegex(str, flags) {
|
||||
return new RegExp(`^${escapeRegex(str)}`, flags);
|
||||
}
|
||||
const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
|
||||
function escapeRegex(str) {
|
||||
return str.replace(escapeRegexRE, '\\$&');
|
||||
}
|
||||
export function makeIdFiltersToMatchWithQuery(input) {
|
||||
if (!Array.isArray(input)) {
|
||||
return makeIdFilterToMatchWithQuery(
|
||||
// Array.isArray cannot narrow the type
|
||||
// https://github.com/microsoft/TypeScript/issues/17002
|
||||
input);
|
||||
}
|
||||
return input.map((i) => makeIdFilterToMatchWithQuery(i));
|
||||
}
|
||||
function makeIdFilterToMatchWithQuery(input) {
|
||||
if (typeof input === 'string') {
|
||||
return `${input}{?*,}`;
|
||||
}
|
||||
return makeRegexIdFilterToMatchWithQuery(input);
|
||||
}
|
||||
function makeRegexIdFilterToMatchWithQuery(input) {
|
||||
return new RegExp(
|
||||
// replace `$` with `(?:\?.*)?$` (ignore `\$`)
|
||||
input.source.replace(/(?<!\\)\$/g, '(?:\\?.*)?$'), input.flags);
|
||||
}
|
||||
1
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/index.d.ts
generated
vendored
Normal file
1
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './filter/index.ts';
|
||||
1
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/index.js
generated
vendored
Normal file
1
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./filter/index.js";
|
||||
2
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/utils.d.ts
generated
vendored
Normal file
2
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare function cleanUrl(url: string): string;
|
||||
export declare function extractQueryWithoutFragment(url: string): string;
|
||||
17
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/utils.js
generated
vendored
Normal file
17
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/dist/utils.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
const postfixRE = /[?#].*$/;
|
||||
export function cleanUrl(url) {
|
||||
return url.replace(postfixRE, '');
|
||||
}
|
||||
export function extractQueryWithoutFragment(url) {
|
||||
const questionMarkIndex = url.indexOf('?');
|
||||
if (questionMarkIndex === -1) {
|
||||
return '';
|
||||
}
|
||||
const fragmentIndex = url.indexOf('#', questionMarkIndex); // Search for # after ?
|
||||
if (fragmentIndex === -1) {
|
||||
return url.substring(questionMarkIndex);
|
||||
}
|
||||
else {
|
||||
return url.substring(questionMarkIndex, fragmentIndex);
|
||||
}
|
||||
}
|
||||
35
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/package.json
generated
vendored
Normal file
35
web/node_modules/@vitejs/plugin-vue-jsx/node_modules/@rolldown/pluginutils/package.json
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "@rolldown/pluginutils",
|
||||
"version": "1.0.0-beta.57",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/rolldown/rolldown.git",
|
||||
"directory": "packages/pluginutils"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
"./filter": "./dist/filter/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/picomatch": "^4.0.0",
|
||||
"picomatch": "^4.0.2",
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^4.0.15"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "vitest --typecheck"
|
||||
}
|
||||
}
|
||||
56
web/node_modules/@vitejs/plugin-vue-jsx/package.json
generated
vendored
Normal file
56
web/node_modules/@vitejs/plugin-vue-jsx/package.json
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "@vitejs/plugin-vue-jsx",
|
||||
"version": "5.1.3",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"author": "Evan You",
|
||||
"description": "Provides Vue 3 JSX & TSX support with HMR.",
|
||||
"keywords": [
|
||||
"vite",
|
||||
"vite-plugin",
|
||||
"vue"
|
||||
],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": "./dist/index.mjs",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vitejs/vite-plugin-vue.git",
|
||||
"directory": "packages/plugin-vue-jsx"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vitejs/vite-plugin-vue/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx#readme",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.28.5",
|
||||
"@babel/plugin-syntax-typescript": "^7.27.1",
|
||||
"@babel/plugin-transform-typescript": "^7.28.5",
|
||||
"@rolldown/pluginutils": "^1.0.0-beta.56",
|
||||
"@vue/babel-plugin-jsx": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tsdown": "^0.18.2",
|
||||
"vite": "^7.2.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0",
|
||||
"vue": "^3.0.0"
|
||||
},
|
||||
"tsdown": {
|
||||
"dts": {
|
||||
"tsgo": true
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "tsdown --watch",
|
||||
"build": "tsdown"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user