Tracking de l'application VApp (IHM du jeu)
This commit is contained in:
21
VApp/node_modules/unplugin/LICENSE
generated
vendored
Normal file
21
VApp/node_modules/unplugin/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021-PRESENT Nuxt Contrib
|
||||
|
||||
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.
|
33
VApp/node_modules/unplugin/README.md
generated
vendored
Normal file
33
VApp/node_modules/unplugin/README.md
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
# Unplugin
|
||||
|
||||
[![npm version][npm-version-src]][npm-version-href]
|
||||
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
||||
[![License][license-src]][license-href]
|
||||
|
||||
Unified plugin system for build tools.
|
||||
|
||||
Currently supports:
|
||||
|
||||
- [Vite](https://vitejs.dev/)
|
||||
- [Rollup](https://rollupjs.org/)
|
||||
- [Webpack](https://webpack.js.org/)
|
||||
- [esbuild](https://esbuild.github.io/)
|
||||
- [Rspack](https://www.rspack.dev/) (⚠️ experimental)
|
||||
- And every framework built on top of them.
|
||||
|
||||
## Documentations
|
||||
|
||||
Learn more on the [Documentation](https://unplugin.vercel.app/)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) License © 2021-PRESENT Nuxt Contrib
|
||||
|
||||
<!-- Badges -->
|
||||
|
||||
[npm-version-src]: https://img.shields.io/npm/v/unplugin?style=flat&colorA=18181B&colorB=F0DB4F
|
||||
[npm-version-href]: https://npmjs.com/package/unplugin
|
||||
[npm-downloads-src]: https://img.shields.io/npm/dm/unplugin?style=flat&colorA=18181B&colorB=F0DB4F
|
||||
[npm-downloads-href]: https://npmjs.com/package/unplugin
|
||||
[license-src]: https://img.shields.io/github/license/unjs/unplugin.svg?style=flat&colorA=18181B&colorB=F0DB4F
|
||||
[license-href]: https://github.com/unjs/unplugin/blob/main/LICENSE
|
148
VApp/node_modules/unplugin/dist/index.d.mts
generated
vendored
Normal file
148
VApp/node_modules/unplugin/dist/index.d.mts
generated
vendored
Normal file
@ -0,0 +1,148 @@
|
||||
import * as _rspack_core_dist_config_zod from '@rspack/core/dist/config/zod';
|
||||
import * as webpack from 'webpack';
|
||||
import { Compiler, WebpackPluginInstance } from 'webpack';
|
||||
export { Compiler as WebpackCompiler, WebpackPluginInstance } from 'webpack';
|
||||
import * as vite from 'vite';
|
||||
import { Plugin as Plugin$1 } from 'vite';
|
||||
export { Plugin as VitePlugin } from 'vite';
|
||||
import * as rollup from 'rollup';
|
||||
import { SourceMapInput, EmittedAsset, AstNode, Plugin, PluginContextMeta } from 'rollup';
|
||||
export { Plugin as RollupPlugin } from 'rollup';
|
||||
import * as esbuild from 'esbuild';
|
||||
import { Plugin as Plugin$2, Loader, BuildOptions, PluginBuild } from 'esbuild';
|
||||
export { Plugin as EsbuildPlugin } from 'esbuild';
|
||||
import { Compiler as Compiler$1, RspackPluginInstance } from '@rspack/core';
|
||||
export { Compiler as RspackCompiler, RspackPluginInstance } from '@rspack/core';
|
||||
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
||||
|
||||
type Thenable<T> = T | Promise<T>;
|
||||
interface SourceMapCompact {
|
||||
file?: string;
|
||||
mappings: string;
|
||||
names: string[];
|
||||
sourceRoot?: string;
|
||||
sources: string[];
|
||||
sourcesContent?: (string | null)[];
|
||||
version: number;
|
||||
}
|
||||
type TransformResult = string | {
|
||||
code: string;
|
||||
map?: SourceMapInput | SourceMapCompact | null;
|
||||
} | null | undefined;
|
||||
interface ExternalIdResult {
|
||||
id: string;
|
||||
external?: boolean;
|
||||
}
|
||||
interface UnpluginBuildContext {
|
||||
addWatchFile: (id: string) => void;
|
||||
emitFile: (emittedFile: EmittedAsset) => void;
|
||||
getWatchFiles: () => string[];
|
||||
parse: (input: string, options?: any) => AstNode;
|
||||
}
|
||||
interface UnpluginOptions {
|
||||
name: string;
|
||||
enforce?: 'post' | 'pre' | undefined;
|
||||
buildStart?: (this: UnpluginBuildContext) => Promise<void> | void;
|
||||
buildEnd?: (this: UnpluginBuildContext) => Promise<void> | void;
|
||||
transform?: (this: UnpluginBuildContext & UnpluginContext, code: string, id: string) => Thenable<TransformResult>;
|
||||
load?: (this: UnpluginBuildContext & UnpluginContext, id: string) => Thenable<TransformResult>;
|
||||
resolveId?: (this: UnpluginBuildContext & UnpluginContext, id: string, importer: string | undefined, options: {
|
||||
isEntry: boolean;
|
||||
}) => Thenable<string | ExternalIdResult | null | undefined>;
|
||||
watchChange?: (this: UnpluginBuildContext, id: string, change: {
|
||||
event: 'create' | 'update' | 'delete';
|
||||
}) => void;
|
||||
writeBundle?: (this: void) => Promise<void> | void;
|
||||
/**
|
||||
* Custom predicate function to filter modules to be loaded.
|
||||
* When omitted, all modules will be included (might have potential perf impact on Webpack).
|
||||
*/
|
||||
loadInclude?: (id: string) => boolean | null | undefined;
|
||||
/**
|
||||
* Custom predicate function to filter modules to be transformed.
|
||||
* When omitted, all modules will be included (might have potential perf impact on Webpack).
|
||||
*/
|
||||
transformInclude?: (id: string) => boolean | null | undefined;
|
||||
rollup?: Partial<Plugin>;
|
||||
webpack?: (compiler: Compiler) => void;
|
||||
rspack?: (compiler: Compiler$1) => void;
|
||||
vite?: Partial<Plugin$1>;
|
||||
esbuild?: {
|
||||
onResolveFilter?: RegExp;
|
||||
onLoadFilter?: RegExp;
|
||||
setup?: Plugin$2['setup'];
|
||||
loader?: Loader | ((code: string, id: string) => Loader);
|
||||
config?: (options: BuildOptions) => void;
|
||||
};
|
||||
}
|
||||
interface ResolvedUnpluginOptions extends UnpluginOptions {
|
||||
__vfs?: VirtualModulesPlugin;
|
||||
__vfsModules?: Set<string>;
|
||||
__virtualModulePrefix: string;
|
||||
}
|
||||
type UnpluginFactory<UserOptions, Nested extends boolean = boolean> = (options: UserOptions, meta: UnpluginContextMeta) => Nested extends true ? Array<UnpluginOptions> : UnpluginOptions;
|
||||
type UnpluginFactoryOutput<UserOptions, Return> = undefined extends UserOptions ? (options?: UserOptions) => Return : (options: UserOptions) => Return;
|
||||
interface UnpluginInstance<UserOptions, Nested extends boolean = boolean> {
|
||||
rollup: UnpluginFactoryOutput<UserOptions, Nested extends true ? Array<Plugin> : Plugin>;
|
||||
vite: UnpluginFactoryOutput<UserOptions, Nested extends true ? Array<Plugin$1> : Plugin$1>;
|
||||
webpack: UnpluginFactoryOutput<UserOptions, WebpackPluginInstance>;
|
||||
rspack: UnpluginFactoryOutput<UserOptions, RspackPluginInstance>;
|
||||
esbuild: UnpluginFactoryOutput<UserOptions, Plugin$2>;
|
||||
raw: UnpluginFactory<UserOptions, Nested>;
|
||||
}
|
||||
type UnpluginContextMeta = Partial<PluginContextMeta> & ({
|
||||
framework: 'rollup' | 'vite';
|
||||
} | {
|
||||
framework: 'webpack';
|
||||
webpack: {
|
||||
compiler: Compiler;
|
||||
};
|
||||
} | {
|
||||
framework: 'esbuild';
|
||||
build?: PluginBuild;
|
||||
/** Set the host plugin name of esbuild when returning multiple plugins */
|
||||
esbuildHostName?: string;
|
||||
} | {
|
||||
framework: 'rspack';
|
||||
rspack: {
|
||||
compiler: Compiler$1;
|
||||
};
|
||||
});
|
||||
interface UnpluginMessage {
|
||||
name?: string;
|
||||
id?: string;
|
||||
message: string;
|
||||
stack?: string;
|
||||
code?: string;
|
||||
plugin?: string;
|
||||
pluginCode?: unknown;
|
||||
loc?: {
|
||||
column: number;
|
||||
file?: string;
|
||||
line: number;
|
||||
};
|
||||
meta?: any;
|
||||
}
|
||||
interface UnpluginContext {
|
||||
error: (message: string | UnpluginMessage) => void;
|
||||
warn: (message: string | UnpluginMessage) => void;
|
||||
}
|
||||
declare module 'webpack' {
|
||||
interface Compiler {
|
||||
$unpluginContext: Record<string, ResolvedUnpluginOptions>;
|
||||
}
|
||||
}
|
||||
declare module '@rspack/core' {
|
||||
interface Compiler {
|
||||
$unpluginContext: Record<string, ResolvedUnpluginOptions>;
|
||||
}
|
||||
}
|
||||
|
||||
declare function createUnplugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginInstance<UserOptions, Nested>;
|
||||
declare function createEsbuildPlugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginFactoryOutput<UserOptions, esbuild.Plugin>;
|
||||
declare function createRollupPlugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginFactoryOutput<UserOptions, Nested extends true ? rollup.Plugin<any>[] : rollup.Plugin<any>>;
|
||||
declare function createVitePlugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginFactoryOutput<UserOptions, Nested extends true ? vite.Plugin<any>[] : vite.Plugin<any>>;
|
||||
declare function createWebpackPlugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginFactoryOutput<UserOptions, webpack.WebpackPluginInstance>;
|
||||
declare function createRspackPlugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginFactoryOutput<UserOptions, _rspack_core_dist_config_zod.RspackPluginInstance>;
|
||||
|
||||
export { type ExternalIdResult, type ResolvedUnpluginOptions, type SourceMapCompact, type Thenable, type TransformResult, type UnpluginBuildContext, type UnpluginContext, type UnpluginContextMeta, type UnpluginFactory, type UnpluginFactoryOutput, type UnpluginInstance, type UnpluginMessage, type UnpluginOptions, createEsbuildPlugin, createRollupPlugin, createRspackPlugin, createUnplugin, createVitePlugin, createWebpackPlugin };
|
148
VApp/node_modules/unplugin/dist/index.d.ts
generated
vendored
Normal file
148
VApp/node_modules/unplugin/dist/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,148 @@
|
||||
import * as _rspack_core_dist_config_zod from '@rspack/core/dist/config/zod';
|
||||
import * as webpack from 'webpack';
|
||||
import { Compiler, WebpackPluginInstance } from 'webpack';
|
||||
export { Compiler as WebpackCompiler, WebpackPluginInstance } from 'webpack';
|
||||
import * as vite from 'vite';
|
||||
import { Plugin as Plugin$1 } from 'vite';
|
||||
export { Plugin as VitePlugin } from 'vite';
|
||||
import * as rollup from 'rollup';
|
||||
import { SourceMapInput, EmittedAsset, AstNode, Plugin, PluginContextMeta } from 'rollup';
|
||||
export { Plugin as RollupPlugin } from 'rollup';
|
||||
import * as esbuild from 'esbuild';
|
||||
import { Plugin as Plugin$2, Loader, BuildOptions, PluginBuild } from 'esbuild';
|
||||
export { Plugin as EsbuildPlugin } from 'esbuild';
|
||||
import { Compiler as Compiler$1, RspackPluginInstance } from '@rspack/core';
|
||||
export { Compiler as RspackCompiler, RspackPluginInstance } from '@rspack/core';
|
||||
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
||||
|
||||
type Thenable<T> = T | Promise<T>;
|
||||
interface SourceMapCompact {
|
||||
file?: string;
|
||||
mappings: string;
|
||||
names: string[];
|
||||
sourceRoot?: string;
|
||||
sources: string[];
|
||||
sourcesContent?: (string | null)[];
|
||||
version: number;
|
||||
}
|
||||
type TransformResult = string | {
|
||||
code: string;
|
||||
map?: SourceMapInput | SourceMapCompact | null;
|
||||
} | null | undefined;
|
||||
interface ExternalIdResult {
|
||||
id: string;
|
||||
external?: boolean;
|
||||
}
|
||||
interface UnpluginBuildContext {
|
||||
addWatchFile: (id: string) => void;
|
||||
emitFile: (emittedFile: EmittedAsset) => void;
|
||||
getWatchFiles: () => string[];
|
||||
parse: (input: string, options?: any) => AstNode;
|
||||
}
|
||||
interface UnpluginOptions {
|
||||
name: string;
|
||||
enforce?: 'post' | 'pre' | undefined;
|
||||
buildStart?: (this: UnpluginBuildContext) => Promise<void> | void;
|
||||
buildEnd?: (this: UnpluginBuildContext) => Promise<void> | void;
|
||||
transform?: (this: UnpluginBuildContext & UnpluginContext, code: string, id: string) => Thenable<TransformResult>;
|
||||
load?: (this: UnpluginBuildContext & UnpluginContext, id: string) => Thenable<TransformResult>;
|
||||
resolveId?: (this: UnpluginBuildContext & UnpluginContext, id: string, importer: string | undefined, options: {
|
||||
isEntry: boolean;
|
||||
}) => Thenable<string | ExternalIdResult | null | undefined>;
|
||||
watchChange?: (this: UnpluginBuildContext, id: string, change: {
|
||||
event: 'create' | 'update' | 'delete';
|
||||
}) => void;
|
||||
writeBundle?: (this: void) => Promise<void> | void;
|
||||
/**
|
||||
* Custom predicate function to filter modules to be loaded.
|
||||
* When omitted, all modules will be included (might have potential perf impact on Webpack).
|
||||
*/
|
||||
loadInclude?: (id: string) => boolean | null | undefined;
|
||||
/**
|
||||
* Custom predicate function to filter modules to be transformed.
|
||||
* When omitted, all modules will be included (might have potential perf impact on Webpack).
|
||||
*/
|
||||
transformInclude?: (id: string) => boolean | null | undefined;
|
||||
rollup?: Partial<Plugin>;
|
||||
webpack?: (compiler: Compiler) => void;
|
||||
rspack?: (compiler: Compiler$1) => void;
|
||||
vite?: Partial<Plugin$1>;
|
||||
esbuild?: {
|
||||
onResolveFilter?: RegExp;
|
||||
onLoadFilter?: RegExp;
|
||||
setup?: Plugin$2['setup'];
|
||||
loader?: Loader | ((code: string, id: string) => Loader);
|
||||
config?: (options: BuildOptions) => void;
|
||||
};
|
||||
}
|
||||
interface ResolvedUnpluginOptions extends UnpluginOptions {
|
||||
__vfs?: VirtualModulesPlugin;
|
||||
__vfsModules?: Set<string>;
|
||||
__virtualModulePrefix: string;
|
||||
}
|
||||
type UnpluginFactory<UserOptions, Nested extends boolean = boolean> = (options: UserOptions, meta: UnpluginContextMeta) => Nested extends true ? Array<UnpluginOptions> : UnpluginOptions;
|
||||
type UnpluginFactoryOutput<UserOptions, Return> = undefined extends UserOptions ? (options?: UserOptions) => Return : (options: UserOptions) => Return;
|
||||
interface UnpluginInstance<UserOptions, Nested extends boolean = boolean> {
|
||||
rollup: UnpluginFactoryOutput<UserOptions, Nested extends true ? Array<Plugin> : Plugin>;
|
||||
vite: UnpluginFactoryOutput<UserOptions, Nested extends true ? Array<Plugin$1> : Plugin$1>;
|
||||
webpack: UnpluginFactoryOutput<UserOptions, WebpackPluginInstance>;
|
||||
rspack: UnpluginFactoryOutput<UserOptions, RspackPluginInstance>;
|
||||
esbuild: UnpluginFactoryOutput<UserOptions, Plugin$2>;
|
||||
raw: UnpluginFactory<UserOptions, Nested>;
|
||||
}
|
||||
type UnpluginContextMeta = Partial<PluginContextMeta> & ({
|
||||
framework: 'rollup' | 'vite';
|
||||
} | {
|
||||
framework: 'webpack';
|
||||
webpack: {
|
||||
compiler: Compiler;
|
||||
};
|
||||
} | {
|
||||
framework: 'esbuild';
|
||||
build?: PluginBuild;
|
||||
/** Set the host plugin name of esbuild when returning multiple plugins */
|
||||
esbuildHostName?: string;
|
||||
} | {
|
||||
framework: 'rspack';
|
||||
rspack: {
|
||||
compiler: Compiler$1;
|
||||
};
|
||||
});
|
||||
interface UnpluginMessage {
|
||||
name?: string;
|
||||
id?: string;
|
||||
message: string;
|
||||
stack?: string;
|
||||
code?: string;
|
||||
plugin?: string;
|
||||
pluginCode?: unknown;
|
||||
loc?: {
|
||||
column: number;
|
||||
file?: string;
|
||||
line: number;
|
||||
};
|
||||
meta?: any;
|
||||
}
|
||||
interface UnpluginContext {
|
||||
error: (message: string | UnpluginMessage) => void;
|
||||
warn: (message: string | UnpluginMessage) => void;
|
||||
}
|
||||
declare module 'webpack' {
|
||||
interface Compiler {
|
||||
$unpluginContext: Record<string, ResolvedUnpluginOptions>;
|
||||
}
|
||||
}
|
||||
declare module '@rspack/core' {
|
||||
interface Compiler {
|
||||
$unpluginContext: Record<string, ResolvedUnpluginOptions>;
|
||||
}
|
||||
}
|
||||
|
||||
declare function createUnplugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginInstance<UserOptions, Nested>;
|
||||
declare function createEsbuildPlugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginFactoryOutput<UserOptions, esbuild.Plugin>;
|
||||
declare function createRollupPlugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginFactoryOutput<UserOptions, Nested extends true ? rollup.Plugin<any>[] : rollup.Plugin<any>>;
|
||||
declare function createVitePlugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginFactoryOutput<UserOptions, Nested extends true ? vite.Plugin<any>[] : vite.Plugin<any>>;
|
||||
declare function createWebpackPlugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginFactoryOutput<UserOptions, webpack.WebpackPluginInstance>;
|
||||
declare function createRspackPlugin<UserOptions, Nested extends boolean = boolean>(factory: UnpluginFactory<UserOptions, Nested>): UnpluginFactoryOutput<UserOptions, _rspack_core_dist_config_zod.RspackPluginInstance>;
|
||||
|
||||
export { type ExternalIdResult, type ResolvedUnpluginOptions, type SourceMapCompact, type Thenable, type TransformResult, type UnpluginBuildContext, type UnpluginContext, type UnpluginContextMeta, type UnpluginFactory, type UnpluginFactoryOutput, type UnpluginInstance, type UnpluginMessage, type UnpluginOptions, createEsbuildPlugin, createRollupPlugin, createRspackPlugin, createUnplugin, createVitePlugin, createWebpackPlugin };
|
1900
VApp/node_modules/unplugin/dist/index.js
generated
vendored
Normal file
1900
VApp/node_modules/unplugin/dist/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1865
VApp/node_modules/unplugin/dist/index.mjs
generated
vendored
Normal file
1865
VApp/node_modules/unplugin/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5
VApp/node_modules/unplugin/dist/rspack/loaders/load.d.mts
generated
vendored
Normal file
5
VApp/node_modules/unplugin/dist/rspack/loaders/load.d.mts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { LoaderContext } from '@rspack/core';
|
||||
|
||||
declare function load(this: LoaderContext, source: string, map: any): Promise<void>;
|
||||
|
||||
export { load as default };
|
5
VApp/node_modules/unplugin/dist/rspack/loaders/load.d.ts
generated
vendored
Normal file
5
VApp/node_modules/unplugin/dist/rspack/loaders/load.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { LoaderContext } from '@rspack/core';
|
||||
|
||||
declare function load(this: LoaderContext, source: string, map: any): Promise<void>;
|
||||
|
||||
export { load as default };
|
118
VApp/node_modules/unplugin/dist/rspack/loaders/load.js
generated
vendored
Normal file
118
VApp/node_modules/unplugin/dist/rspack/loaders/load.js
generated
vendored
Normal file
@ -0,0 +1,118 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/rspack/loaders/load.ts
|
||||
var load_exports = {};
|
||||
__export(load_exports, {
|
||||
default: () => load
|
||||
});
|
||||
module.exports = __toCommonJS(load_exports);
|
||||
|
||||
// src/rspack/context.ts
|
||||
var import_buffer = require("buffer");
|
||||
var import_webpack_sources = __toESM(require("webpack-sources"));
|
||||
var import_acorn = require("acorn");
|
||||
function createBuildContext(compilation) {
|
||||
return {
|
||||
parse(code, opts = {}) {
|
||||
return import_acorn.Parser.parse(code, {
|
||||
sourceType: "module",
|
||||
ecmaVersion: "latest",
|
||||
locations: true,
|
||||
...opts
|
||||
});
|
||||
},
|
||||
addWatchFile() {
|
||||
},
|
||||
emitFile(emittedFile) {
|
||||
const outFileName = emittedFile.fileName || emittedFile.name;
|
||||
if (emittedFile.source && outFileName) {
|
||||
compilation.emitAsset(
|
||||
outFileName,
|
||||
new import_webpack_sources.default.RawSource(
|
||||
// @ts-expect-error types mismatch
|
||||
typeof emittedFile.source === "string" ? emittedFile.source : import_buffer.Buffer.from(emittedFile.source)
|
||||
)
|
||||
);
|
||||
}
|
||||
},
|
||||
getWatchFiles() {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
}
|
||||
function createContext(loader) {
|
||||
return {
|
||||
error: (error) => loader.emitError(normalizeMessage(error)),
|
||||
warn: (message) => loader.emitWarning(normalizeMessage(message))
|
||||
};
|
||||
}
|
||||
function normalizeMessage(error) {
|
||||
const err = new Error(typeof error === "string" ? error : error.message);
|
||||
if (typeof error === "object") {
|
||||
err.stack = error.stack;
|
||||
err.cause = error.meta;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
// src/utils.ts
|
||||
var import_path = require("path");
|
||||
function normalizeAbsolutePath(path) {
|
||||
if ((0, import_path.isAbsolute)(path))
|
||||
return (0, import_path.normalize)(path);
|
||||
else
|
||||
return path;
|
||||
}
|
||||
|
||||
// src/rspack/loaders/load.ts
|
||||
async function load(source, map) {
|
||||
const callback = this.async();
|
||||
const { unpluginName } = this.query;
|
||||
const plugin = this._compiler?.$unpluginContext[unpluginName];
|
||||
const id = this.resource;
|
||||
if (!plugin?.load || !id)
|
||||
return callback(null, source, map);
|
||||
if (plugin.loadInclude && !plugin.loadInclude(id))
|
||||
return callback(null, source, map);
|
||||
const context = createContext(this);
|
||||
const res = await plugin.load.call(
|
||||
Object.assign(
|
||||
this._compilation && createBuildContext(this._compilation),
|
||||
context
|
||||
),
|
||||
normalizeAbsolutePath(id)
|
||||
);
|
||||
if (res == null)
|
||||
callback(null, source, map);
|
||||
else if (typeof res !== "string")
|
||||
callback(null, res.code, res.map ?? map);
|
||||
else
|
||||
callback(null, res, map);
|
||||
}
|
85
VApp/node_modules/unplugin/dist/rspack/loaders/load.mjs
generated
vendored
Normal file
85
VApp/node_modules/unplugin/dist/rspack/loaders/load.mjs
generated
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
// src/rspack/context.ts
|
||||
import { Buffer } from "buffer";
|
||||
import sources from "webpack-sources";
|
||||
import { Parser } from "acorn";
|
||||
function createBuildContext(compilation) {
|
||||
return {
|
||||
parse(code, opts = {}) {
|
||||
return Parser.parse(code, {
|
||||
sourceType: "module",
|
||||
ecmaVersion: "latest",
|
||||
locations: true,
|
||||
...opts
|
||||
});
|
||||
},
|
||||
addWatchFile() {
|
||||
},
|
||||
emitFile(emittedFile) {
|
||||
const outFileName = emittedFile.fileName || emittedFile.name;
|
||||
if (emittedFile.source && outFileName) {
|
||||
compilation.emitAsset(
|
||||
outFileName,
|
||||
new sources.RawSource(
|
||||
// @ts-expect-error types mismatch
|
||||
typeof emittedFile.source === "string" ? emittedFile.source : Buffer.from(emittedFile.source)
|
||||
)
|
||||
);
|
||||
}
|
||||
},
|
||||
getWatchFiles() {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
}
|
||||
function createContext(loader) {
|
||||
return {
|
||||
error: (error) => loader.emitError(normalizeMessage(error)),
|
||||
warn: (message) => loader.emitWarning(normalizeMessage(message))
|
||||
};
|
||||
}
|
||||
function normalizeMessage(error) {
|
||||
const err = new Error(typeof error === "string" ? error : error.message);
|
||||
if (typeof error === "object") {
|
||||
err.stack = error.stack;
|
||||
err.cause = error.meta;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
// src/utils.ts
|
||||
import { isAbsolute, normalize } from "path";
|
||||
function normalizeAbsolutePath(path) {
|
||||
if (isAbsolute(path))
|
||||
return normalize(path);
|
||||
else
|
||||
return path;
|
||||
}
|
||||
|
||||
// src/rspack/loaders/load.ts
|
||||
async function load(source, map) {
|
||||
const callback = this.async();
|
||||
const { unpluginName } = this.query;
|
||||
const plugin = this._compiler?.$unpluginContext[unpluginName];
|
||||
const id = this.resource;
|
||||
if (!plugin?.load || !id)
|
||||
return callback(null, source, map);
|
||||
if (plugin.loadInclude && !plugin.loadInclude(id))
|
||||
return callback(null, source, map);
|
||||
const context = createContext(this);
|
||||
const res = await plugin.load.call(
|
||||
Object.assign(
|
||||
this._compilation && createBuildContext(this._compilation),
|
||||
context
|
||||
),
|
||||
normalizeAbsolutePath(id)
|
||||
);
|
||||
if (res == null)
|
||||
callback(null, source, map);
|
||||
else if (typeof res !== "string")
|
||||
callback(null, res.code, res.map ?? map);
|
||||
else
|
||||
callback(null, res, map);
|
||||
}
|
||||
export {
|
||||
load as default
|
||||
};
|
5
VApp/node_modules/unplugin/dist/rspack/loaders/transform.d.mts
generated
vendored
Normal file
5
VApp/node_modules/unplugin/dist/rspack/loaders/transform.d.mts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { LoaderContext } from '@rspack/core';
|
||||
|
||||
declare function transform(this: LoaderContext, source: string, map: any): Promise<void>;
|
||||
|
||||
export { transform as default };
|
5
VApp/node_modules/unplugin/dist/rspack/loaders/transform.d.ts
generated
vendored
Normal file
5
VApp/node_modules/unplugin/dist/rspack/loaders/transform.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { LoaderContext } from '@rspack/core';
|
||||
|
||||
declare function transform(this: LoaderContext, source: string, map: any): Promise<void>;
|
||||
|
||||
export { transform as default };
|
114
VApp/node_modules/unplugin/dist/rspack/loaders/transform.js
generated
vendored
Normal file
114
VApp/node_modules/unplugin/dist/rspack/loaders/transform.js
generated
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/rspack/loaders/transform.ts
|
||||
var transform_exports = {};
|
||||
__export(transform_exports, {
|
||||
default: () => transform
|
||||
});
|
||||
module.exports = __toCommonJS(transform_exports);
|
||||
|
||||
// src/rspack/context.ts
|
||||
var import_buffer = require("buffer");
|
||||
var import_webpack_sources = __toESM(require("webpack-sources"));
|
||||
var import_acorn = require("acorn");
|
||||
function createBuildContext(compilation) {
|
||||
return {
|
||||
parse(code, opts = {}) {
|
||||
return import_acorn.Parser.parse(code, {
|
||||
sourceType: "module",
|
||||
ecmaVersion: "latest",
|
||||
locations: true,
|
||||
...opts
|
||||
});
|
||||
},
|
||||
addWatchFile() {
|
||||
},
|
||||
emitFile(emittedFile) {
|
||||
const outFileName = emittedFile.fileName || emittedFile.name;
|
||||
if (emittedFile.source && outFileName) {
|
||||
compilation.emitAsset(
|
||||
outFileName,
|
||||
new import_webpack_sources.default.RawSource(
|
||||
// @ts-expect-error types mismatch
|
||||
typeof emittedFile.source === "string" ? emittedFile.source : import_buffer.Buffer.from(emittedFile.source)
|
||||
)
|
||||
);
|
||||
}
|
||||
},
|
||||
getWatchFiles() {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
}
|
||||
function createContext(loader) {
|
||||
return {
|
||||
error: (error) => loader.emitError(normalizeMessage(error)),
|
||||
warn: (message) => loader.emitWarning(normalizeMessage(message))
|
||||
};
|
||||
}
|
||||
function normalizeMessage(error) {
|
||||
const err = new Error(typeof error === "string" ? error : error.message);
|
||||
if (typeof error === "object") {
|
||||
err.stack = error.stack;
|
||||
err.cause = error.meta;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
// src/rspack/loaders/transform.ts
|
||||
async function transform(source, map) {
|
||||
const callback = this.async();
|
||||
let unpluginName;
|
||||
if (typeof this.query === "string") {
|
||||
const query = new URLSearchParams(this.query);
|
||||
unpluginName = query.get("unpluginName");
|
||||
} else {
|
||||
unpluginName = this.query.unpluginName;
|
||||
}
|
||||
const id = this.resource;
|
||||
const plugin = this._compiler?.$unpluginContext[unpluginName];
|
||||
if (!plugin?.transform)
|
||||
return callback(null, source, map);
|
||||
const context = createContext(this);
|
||||
const res = await plugin.transform.call(
|
||||
Object.assign(
|
||||
this._compilation && createBuildContext(this._compilation),
|
||||
context
|
||||
),
|
||||
source,
|
||||
id
|
||||
);
|
||||
if (res == null)
|
||||
callback(null, source, map);
|
||||
else if (typeof res !== "string")
|
||||
callback(null, res.code, map == null ? map : res.map || map);
|
||||
else
|
||||
callback(null, res, map);
|
||||
}
|
81
VApp/node_modules/unplugin/dist/rspack/loaders/transform.mjs
generated
vendored
Normal file
81
VApp/node_modules/unplugin/dist/rspack/loaders/transform.mjs
generated
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
// src/rspack/context.ts
|
||||
import { Buffer } from "buffer";
|
||||
import sources from "webpack-sources";
|
||||
import { Parser } from "acorn";
|
||||
function createBuildContext(compilation) {
|
||||
return {
|
||||
parse(code, opts = {}) {
|
||||
return Parser.parse(code, {
|
||||
sourceType: "module",
|
||||
ecmaVersion: "latest",
|
||||
locations: true,
|
||||
...opts
|
||||
});
|
||||
},
|
||||
addWatchFile() {
|
||||
},
|
||||
emitFile(emittedFile) {
|
||||
const outFileName = emittedFile.fileName || emittedFile.name;
|
||||
if (emittedFile.source && outFileName) {
|
||||
compilation.emitAsset(
|
||||
outFileName,
|
||||
new sources.RawSource(
|
||||
// @ts-expect-error types mismatch
|
||||
typeof emittedFile.source === "string" ? emittedFile.source : Buffer.from(emittedFile.source)
|
||||
)
|
||||
);
|
||||
}
|
||||
},
|
||||
getWatchFiles() {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
}
|
||||
function createContext(loader) {
|
||||
return {
|
||||
error: (error) => loader.emitError(normalizeMessage(error)),
|
||||
warn: (message) => loader.emitWarning(normalizeMessage(message))
|
||||
};
|
||||
}
|
||||
function normalizeMessage(error) {
|
||||
const err = new Error(typeof error === "string" ? error : error.message);
|
||||
if (typeof error === "object") {
|
||||
err.stack = error.stack;
|
||||
err.cause = error.meta;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
// src/rspack/loaders/transform.ts
|
||||
async function transform(source, map) {
|
||||
const callback = this.async();
|
||||
let unpluginName;
|
||||
if (typeof this.query === "string") {
|
||||
const query = new URLSearchParams(this.query);
|
||||
unpluginName = query.get("unpluginName");
|
||||
} else {
|
||||
unpluginName = this.query.unpluginName;
|
||||
}
|
||||
const id = this.resource;
|
||||
const plugin = this._compiler?.$unpluginContext[unpluginName];
|
||||
if (!plugin?.transform)
|
||||
return callback(null, source, map);
|
||||
const context = createContext(this);
|
||||
const res = await plugin.transform.call(
|
||||
Object.assign(
|
||||
this._compilation && createBuildContext(this._compilation),
|
||||
context
|
||||
),
|
||||
source,
|
||||
id
|
||||
);
|
||||
if (res == null)
|
||||
callback(null, source, map);
|
||||
else if (typeof res !== "string")
|
||||
callback(null, res.code, map == null ? map : res.map || map);
|
||||
else
|
||||
callback(null, res, map);
|
||||
}
|
||||
export {
|
||||
transform as default
|
||||
};
|
5
VApp/node_modules/unplugin/dist/webpack/loaders/load.d.mts
generated
vendored
Normal file
5
VApp/node_modules/unplugin/dist/webpack/loaders/load.d.mts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { LoaderContext } from 'webpack';
|
||||
|
||||
declare function load(this: LoaderContext<any>, source: string, map: any): Promise<void>;
|
||||
|
||||
export { load as default };
|
5
VApp/node_modules/unplugin/dist/webpack/loaders/load.d.ts
generated
vendored
Normal file
5
VApp/node_modules/unplugin/dist/webpack/loaders/load.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { LoaderContext } from 'webpack';
|
||||
|
||||
declare function load(this: LoaderContext<any>, source: string, map: any): Promise<void>;
|
||||
|
||||
export { load as default };
|
130
VApp/node_modules/unplugin/dist/webpack/loaders/load.js
generated
vendored
Normal file
130
VApp/node_modules/unplugin/dist/webpack/loaders/load.js
generated
vendored
Normal file
@ -0,0 +1,130 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/webpack/loaders/load.ts
|
||||
var load_exports = {};
|
||||
__export(load_exports, {
|
||||
default: () => load
|
||||
});
|
||||
module.exports = __toCommonJS(load_exports);
|
||||
|
||||
// src/webpack/context.ts
|
||||
var import_path = require("path");
|
||||
var import_buffer = require("buffer");
|
||||
var import_process = __toESM(require("process"));
|
||||
var import_webpack_sources = __toESM(require("webpack-sources"));
|
||||
var import_acorn = require("acorn");
|
||||
function createBuildContext(options, compilation) {
|
||||
return {
|
||||
parse(code, opts = {}) {
|
||||
return import_acorn.Parser.parse(code, {
|
||||
sourceType: "module",
|
||||
ecmaVersion: "latest",
|
||||
locations: true,
|
||||
...opts
|
||||
});
|
||||
},
|
||||
addWatchFile(id) {
|
||||
options.addWatchFile((0, import_path.resolve)(import_process.default.cwd(), id));
|
||||
},
|
||||
emitFile(emittedFile) {
|
||||
const outFileName = emittedFile.fileName || emittedFile.name;
|
||||
if (emittedFile.source && outFileName) {
|
||||
if (!compilation)
|
||||
throw new Error("unplugin/webpack: emitFile outside supported hooks (buildStart, buildEnd, load, transform, watchChange)");
|
||||
compilation.emitAsset(
|
||||
outFileName,
|
||||
import_webpack_sources.default ? new import_webpack_sources.default.RawSource(
|
||||
// @ts-expect-error types mismatch
|
||||
typeof emittedFile.source === "string" ? emittedFile.source : import_buffer.Buffer.from(emittedFile.source)
|
||||
) : {
|
||||
source: () => emittedFile.source,
|
||||
size: () => emittedFile.source.length
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
getWatchFiles() {
|
||||
return options.getWatchFiles();
|
||||
}
|
||||
};
|
||||
}
|
||||
function createContext(loader) {
|
||||
return {
|
||||
error: (error) => loader.emitError(normalizeMessage(error)),
|
||||
warn: (message) => loader.emitWarning(normalizeMessage(message))
|
||||
};
|
||||
}
|
||||
function normalizeMessage(error) {
|
||||
const err = new Error(typeof error === "string" ? error : error.message);
|
||||
if (typeof error === "object") {
|
||||
err.stack = error.stack;
|
||||
err.cause = error.meta;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
// src/utils.ts
|
||||
var import_path2 = require("path");
|
||||
function normalizeAbsolutePath(path) {
|
||||
if ((0, import_path2.isAbsolute)(path))
|
||||
return (0, import_path2.normalize)(path);
|
||||
else
|
||||
return path;
|
||||
}
|
||||
|
||||
// src/webpack/loaders/load.ts
|
||||
async function load(source, map) {
|
||||
const callback = this.async();
|
||||
const { unpluginName } = this.query;
|
||||
const plugin = this._compiler?.$unpluginContext[unpluginName];
|
||||
let id = this.resource;
|
||||
if (!plugin?.load || !id)
|
||||
return callback(null, source, map);
|
||||
if (id.startsWith(plugin.__virtualModulePrefix))
|
||||
id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length));
|
||||
const context = createContext(this);
|
||||
const res = await plugin.load.call(
|
||||
{ ...createBuildContext({
|
||||
addWatchFile: (file) => {
|
||||
this.addDependency(file);
|
||||
},
|
||||
getWatchFiles: () => {
|
||||
return this.getDependencies();
|
||||
}
|
||||
}, this._compilation), ...context },
|
||||
normalizeAbsolutePath(id)
|
||||
);
|
||||
if (res == null)
|
||||
callback(null, source, map);
|
||||
else if (typeof res !== "string")
|
||||
callback(null, res.code, res.map ?? map);
|
||||
else
|
||||
callback(null, res, map);
|
||||
}
|
97
VApp/node_modules/unplugin/dist/webpack/loaders/load.mjs
generated
vendored
Normal file
97
VApp/node_modules/unplugin/dist/webpack/loaders/load.mjs
generated
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
// src/webpack/context.ts
|
||||
import { resolve } from "path";
|
||||
import { Buffer } from "buffer";
|
||||
import process from "process";
|
||||
import sources from "webpack-sources";
|
||||
import { Parser } from "acorn";
|
||||
function createBuildContext(options, compilation) {
|
||||
return {
|
||||
parse(code, opts = {}) {
|
||||
return Parser.parse(code, {
|
||||
sourceType: "module",
|
||||
ecmaVersion: "latest",
|
||||
locations: true,
|
||||
...opts
|
||||
});
|
||||
},
|
||||
addWatchFile(id) {
|
||||
options.addWatchFile(resolve(process.cwd(), id));
|
||||
},
|
||||
emitFile(emittedFile) {
|
||||
const outFileName = emittedFile.fileName || emittedFile.name;
|
||||
if (emittedFile.source && outFileName) {
|
||||
if (!compilation)
|
||||
throw new Error("unplugin/webpack: emitFile outside supported hooks (buildStart, buildEnd, load, transform, watchChange)");
|
||||
compilation.emitAsset(
|
||||
outFileName,
|
||||
sources ? new sources.RawSource(
|
||||
// @ts-expect-error types mismatch
|
||||
typeof emittedFile.source === "string" ? emittedFile.source : Buffer.from(emittedFile.source)
|
||||
) : {
|
||||
source: () => emittedFile.source,
|
||||
size: () => emittedFile.source.length
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
getWatchFiles() {
|
||||
return options.getWatchFiles();
|
||||
}
|
||||
};
|
||||
}
|
||||
function createContext(loader) {
|
||||
return {
|
||||
error: (error) => loader.emitError(normalizeMessage(error)),
|
||||
warn: (message) => loader.emitWarning(normalizeMessage(message))
|
||||
};
|
||||
}
|
||||
function normalizeMessage(error) {
|
||||
const err = new Error(typeof error === "string" ? error : error.message);
|
||||
if (typeof error === "object") {
|
||||
err.stack = error.stack;
|
||||
err.cause = error.meta;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
// src/utils.ts
|
||||
import { isAbsolute, normalize } from "path";
|
||||
function normalizeAbsolutePath(path) {
|
||||
if (isAbsolute(path))
|
||||
return normalize(path);
|
||||
else
|
||||
return path;
|
||||
}
|
||||
|
||||
// src/webpack/loaders/load.ts
|
||||
async function load(source, map) {
|
||||
const callback = this.async();
|
||||
const { unpluginName } = this.query;
|
||||
const plugin = this._compiler?.$unpluginContext[unpluginName];
|
||||
let id = this.resource;
|
||||
if (!plugin?.load || !id)
|
||||
return callback(null, source, map);
|
||||
if (id.startsWith(plugin.__virtualModulePrefix))
|
||||
id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length));
|
||||
const context = createContext(this);
|
||||
const res = await plugin.load.call(
|
||||
{ ...createBuildContext({
|
||||
addWatchFile: (file) => {
|
||||
this.addDependency(file);
|
||||
},
|
||||
getWatchFiles: () => {
|
||||
return this.getDependencies();
|
||||
}
|
||||
}, this._compilation), ...context },
|
||||
normalizeAbsolutePath(id)
|
||||
);
|
||||
if (res == null)
|
||||
callback(null, source, map);
|
||||
else if (typeof res !== "string")
|
||||
callback(null, res.code, res.map ?? map);
|
||||
else
|
||||
callback(null, res, map);
|
||||
}
|
||||
export {
|
||||
load as default
|
||||
};
|
7
VApp/node_modules/unplugin/dist/webpack/loaders/transform.d.mts
generated
vendored
Normal file
7
VApp/node_modules/unplugin/dist/webpack/loaders/transform.d.mts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import { LoaderContext } from 'webpack';
|
||||
|
||||
declare function transform(this: LoaderContext<{
|
||||
unpluginName: string;
|
||||
}>, source: string, map: any): Promise<void>;
|
||||
|
||||
export { transform as default };
|
7
VApp/node_modules/unplugin/dist/webpack/loaders/transform.d.ts
generated
vendored
Normal file
7
VApp/node_modules/unplugin/dist/webpack/loaders/transform.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import { LoaderContext } from 'webpack';
|
||||
|
||||
declare function transform(this: LoaderContext<{
|
||||
unpluginName: string;
|
||||
}>, source: string, map: any): Promise<void>;
|
||||
|
||||
export { transform as default };
|
125
VApp/node_modules/unplugin/dist/webpack/loaders/transform.js
generated
vendored
Normal file
125
VApp/node_modules/unplugin/dist/webpack/loaders/transform.js
generated
vendored
Normal file
@ -0,0 +1,125 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/webpack/loaders/transform.ts
|
||||
var transform_exports = {};
|
||||
__export(transform_exports, {
|
||||
default: () => transform
|
||||
});
|
||||
module.exports = __toCommonJS(transform_exports);
|
||||
|
||||
// src/webpack/context.ts
|
||||
var import_path = require("path");
|
||||
var import_buffer = require("buffer");
|
||||
var import_process = __toESM(require("process"));
|
||||
var import_webpack_sources = __toESM(require("webpack-sources"));
|
||||
var import_acorn = require("acorn");
|
||||
function createBuildContext(options, compilation) {
|
||||
return {
|
||||
parse(code, opts = {}) {
|
||||
return import_acorn.Parser.parse(code, {
|
||||
sourceType: "module",
|
||||
ecmaVersion: "latest",
|
||||
locations: true,
|
||||
...opts
|
||||
});
|
||||
},
|
||||
addWatchFile(id) {
|
||||
options.addWatchFile((0, import_path.resolve)(import_process.default.cwd(), id));
|
||||
},
|
||||
emitFile(emittedFile) {
|
||||
const outFileName = emittedFile.fileName || emittedFile.name;
|
||||
if (emittedFile.source && outFileName) {
|
||||
if (!compilation)
|
||||
throw new Error("unplugin/webpack: emitFile outside supported hooks (buildStart, buildEnd, load, transform, watchChange)");
|
||||
compilation.emitAsset(
|
||||
outFileName,
|
||||
import_webpack_sources.default ? new import_webpack_sources.default.RawSource(
|
||||
// @ts-expect-error types mismatch
|
||||
typeof emittedFile.source === "string" ? emittedFile.source : import_buffer.Buffer.from(emittedFile.source)
|
||||
) : {
|
||||
source: () => emittedFile.source,
|
||||
size: () => emittedFile.source.length
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
getWatchFiles() {
|
||||
return options.getWatchFiles();
|
||||
}
|
||||
};
|
||||
}
|
||||
function createContext(loader) {
|
||||
return {
|
||||
error: (error) => loader.emitError(normalizeMessage(error)),
|
||||
warn: (message) => loader.emitWarning(normalizeMessage(message))
|
||||
};
|
||||
}
|
||||
function normalizeMessage(error) {
|
||||
const err = new Error(typeof error === "string" ? error : error.message);
|
||||
if (typeof error === "object") {
|
||||
err.stack = error.stack;
|
||||
err.cause = error.meta;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
// src/webpack/loaders/transform.ts
|
||||
async function transform(source, map) {
|
||||
const callback = this.async();
|
||||
let unpluginName;
|
||||
if (typeof this.query === "string") {
|
||||
const query = new URLSearchParams(this.query);
|
||||
unpluginName = query.get("unpluginName");
|
||||
} else {
|
||||
unpluginName = this.query.unpluginName;
|
||||
}
|
||||
const plugin = this._compiler?.$unpluginContext[unpluginName];
|
||||
if (!plugin?.transform)
|
||||
return callback(null, source, map);
|
||||
const context = createContext(this);
|
||||
const res = await plugin.transform.call(
|
||||
{ ...createBuildContext({
|
||||
addWatchFile: (file) => {
|
||||
this.addDependency(file);
|
||||
},
|
||||
getWatchFiles: () => {
|
||||
return this.getDependencies();
|
||||
}
|
||||
}, this._compilation), ...context },
|
||||
source,
|
||||
this.resource
|
||||
);
|
||||
if (res == null)
|
||||
callback(null, source, map);
|
||||
else if (typeof res !== "string")
|
||||
callback(null, res.code, map == null ? map : res.map || map);
|
||||
else
|
||||
callback(null, res, map);
|
||||
}
|
92
VApp/node_modules/unplugin/dist/webpack/loaders/transform.mjs
generated
vendored
Normal file
92
VApp/node_modules/unplugin/dist/webpack/loaders/transform.mjs
generated
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
// src/webpack/context.ts
|
||||
import { resolve } from "path";
|
||||
import { Buffer } from "buffer";
|
||||
import process from "process";
|
||||
import sources from "webpack-sources";
|
||||
import { Parser } from "acorn";
|
||||
function createBuildContext(options, compilation) {
|
||||
return {
|
||||
parse(code, opts = {}) {
|
||||
return Parser.parse(code, {
|
||||
sourceType: "module",
|
||||
ecmaVersion: "latest",
|
||||
locations: true,
|
||||
...opts
|
||||
});
|
||||
},
|
||||
addWatchFile(id) {
|
||||
options.addWatchFile(resolve(process.cwd(), id));
|
||||
},
|
||||
emitFile(emittedFile) {
|
||||
const outFileName = emittedFile.fileName || emittedFile.name;
|
||||
if (emittedFile.source && outFileName) {
|
||||
if (!compilation)
|
||||
throw new Error("unplugin/webpack: emitFile outside supported hooks (buildStart, buildEnd, load, transform, watchChange)");
|
||||
compilation.emitAsset(
|
||||
outFileName,
|
||||
sources ? new sources.RawSource(
|
||||
// @ts-expect-error types mismatch
|
||||
typeof emittedFile.source === "string" ? emittedFile.source : Buffer.from(emittedFile.source)
|
||||
) : {
|
||||
source: () => emittedFile.source,
|
||||
size: () => emittedFile.source.length
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
getWatchFiles() {
|
||||
return options.getWatchFiles();
|
||||
}
|
||||
};
|
||||
}
|
||||
function createContext(loader) {
|
||||
return {
|
||||
error: (error) => loader.emitError(normalizeMessage(error)),
|
||||
warn: (message) => loader.emitWarning(normalizeMessage(message))
|
||||
};
|
||||
}
|
||||
function normalizeMessage(error) {
|
||||
const err = new Error(typeof error === "string" ? error : error.message);
|
||||
if (typeof error === "object") {
|
||||
err.stack = error.stack;
|
||||
err.cause = error.meta;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
// src/webpack/loaders/transform.ts
|
||||
async function transform(source, map) {
|
||||
const callback = this.async();
|
||||
let unpluginName;
|
||||
if (typeof this.query === "string") {
|
||||
const query = new URLSearchParams(this.query);
|
||||
unpluginName = query.get("unpluginName");
|
||||
} else {
|
||||
unpluginName = this.query.unpluginName;
|
||||
}
|
||||
const plugin = this._compiler?.$unpluginContext[unpluginName];
|
||||
if (!plugin?.transform)
|
||||
return callback(null, source, map);
|
||||
const context = createContext(this);
|
||||
const res = await plugin.transform.call(
|
||||
{ ...createBuildContext({
|
||||
addWatchFile: (file) => {
|
||||
this.addDependency(file);
|
||||
},
|
||||
getWatchFiles: () => {
|
||||
return this.getDependencies();
|
||||
}
|
||||
}, this._compilation), ...context },
|
||||
source,
|
||||
this.resource
|
||||
);
|
||||
if (res == null)
|
||||
callback(null, source, map);
|
||||
else if (typeof res !== "string")
|
||||
callback(null, res.code, map == null ? map : res.map || map);
|
||||
else
|
||||
callback(null, res, map);
|
||||
}
|
||||
export {
|
||||
transform as default
|
||||
};
|
77
VApp/node_modules/unplugin/package.json
generated
vendored
Normal file
77
VApp/node_modules/unplugin/package.json
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
{
|
||||
"name": "unplugin",
|
||||
"version": "1.7.1",
|
||||
"packageManager": "pnpm@8.15.1",
|
||||
"description": "Unified plugin system for build tools",
|
||||
"license": "MIT",
|
||||
"repository": "unjs/unplugin",
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": {
|
||||
"import": "./dist/index.d.mts",
|
||||
"require": "./dist/index.d.ts"
|
||||
},
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"./dist/webpack/loaders/*": "./dist/webpack/loaders/*.js",
|
||||
"./dist/rspack/loaders/*": "./dist/rspack/loaders/*.js"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"dev": "tsup --watch src",
|
||||
"lint": "eslint --cache .",
|
||||
"lint:fix": "nr lint --fix",
|
||||
"prepublishOnly": "nr build",
|
||||
"release": "bumpp --all -x 'npx conventional-changelog -p angular -i CHANGELOG.md -s' && npm publish",
|
||||
"test": "nr lint && nr test:build && vitest run --pool=forks",
|
||||
"test:build": "jiti scripts/buildFixtures.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"acorn": "^8.11.3",
|
||||
"chokidar": "^3.5.3",
|
||||
"webpack-sources": "^3.2.3",
|
||||
"webpack-virtual-modules": "^0.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ampproject/remapping": "^2.2.1",
|
||||
"@antfu/eslint-config": "^2.6.4",
|
||||
"@antfu/ni": "^0.21.12",
|
||||
"@rspack/cli": "^0.5.3",
|
||||
"@rspack/core": "^0.5.3",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/node": "^20.11.15",
|
||||
"@types/webpack-sources": "^3.2.3",
|
||||
"bumpp": "^9.3.0",
|
||||
"conventional-changelog-cli": "^4.1.0",
|
||||
"esbuild": "^0.20.0",
|
||||
"eslint": "^8.56.0",
|
||||
"fast-glob": "^3.3.2",
|
||||
"fs-extra": "^11.2.0",
|
||||
"jiti": "^1.21.0",
|
||||
"lint-staged": "^15.2.1",
|
||||
"magic-string": "^0.30.6",
|
||||
"picocolors": "^1.0.0",
|
||||
"rollup": "^4.9.6",
|
||||
"simple-git-hooks": "^2.9.0",
|
||||
"tsup": "^8.0.1",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^5.0.12",
|
||||
"vitest": "^1.2.2",
|
||||
"webpack": "^5.90.0",
|
||||
"webpack-cli": "4.10.0"
|
||||
},
|
||||
"simple-git-hooks": {
|
||||
"pre-commit": "pnpm lint-staged"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*": "eslint --fix"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user