更新前端静态网页获取方式,放弃使用后端获取api

This commit is contained in:
2025-09-09 10:47:51 +08:00
parent 6889ca37e5
commit 44a4f1bae1
25558 changed files with 2463152 additions and 153 deletions

21
frontend/node_modules/webpack-sources/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 JS Foundation and other 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.

228
frontend/node_modules/webpack-sources/README.md generated vendored Normal file
View File

@@ -0,0 +1,228 @@
# webpack-sources
Contains multiple classes which represent a `Source`. A `Source` can be asked for source code, size, source map and hash.
## `Source`
Base class for all sources.
### Public methods
All methods should be considered as expensive as they may need to do computations.
#### `source`
```typescript
Source.prototype.source() -> String | Buffer
```
Returns the represented source code as string or Buffer (for binary Sources).
#### `buffer`
```typescript
Source.prototype.buffer() -> Buffer
```
Returns the represented source code as Buffer. Strings are converted to utf-8.
#### `size`
```typescript
Source.prototype.size() -> Number
```
Returns the size in bytes of the represented source code.
#### `map`
```typescript
Source.prototype.map(options?: Object) -> Object | null
```
Returns the SourceMap of the represented source code as JSON. May return `null` if no SourceMap is available.
The `options` object can contain the following keys:
- `columns: Boolean` (default `true`): If set to false the implementation may omit mappings for columns.
#### `sourceAndMap`
```typescript
Source.prototype.sourceAndMap(options?: Object) -> {
source: String | Buffer,
map: Object | null
}
```
Returns both, source code (like `Source.prototype.source()` and SourceMap (like `Source.prototype.map()`). This method could have better performance than calling `source()` and `map()` separately.
See `map()` for `options`.
#### `updateHash`
```typescript
Source.prototype.updateHash(hash: Hash) -> void
```
Updates the provided `Hash` object with the content of the represented source code. (`Hash` is an object with an `update` method, which is called with string values)
## `RawSource`
Represents source code without SourceMap.
```typescript
new RawSource(sourceCode: String | Buffer)
```
## `OriginalSource`
Represents source code, which is a copy of the original file.
```typescript
new OriginalSource(
sourceCode: String | Buffer,
name: String
)
```
- `sourceCode`: The source code.
- `name`: The filename of the original source code.
OriginalSource tries to create column mappings if requested, by splitting the source code at typical statement borders (`;`, `{`, `}`).
## `SourceMapSource`
Represents source code with SourceMap, optionally having an additional SourceMap for the original source.
```typescript
new SourceMapSource(
sourceCode: String | Buffer,
name: String,
sourceMap: Object | String | Buffer,
originalSource?: String | Buffer,
innerSourceMap?: Object | String | Buffer,
removeOriginalSource?: boolean
)
```
- `sourceCode`: The source code.
- `name`: The filename of the original source code.
- `sourceMap`: The SourceMap for the source code.
- `originalSource`: The source code of the original file. Can be omitted if the `sourceMap` already contains the original source code.
- `innerSourceMap`: The SourceMap for the `originalSource`/`name`.
- `removeOriginalSource`: Removes the source code for `name` from the final map, keeping only the deeper mappings for that file.
The `SourceMapSource` supports "identity" mappings for the `innerSourceMap`.
When original source matches generated source for a mapping it's assumed to be mapped char by char allowing to keep finer mappings from `sourceMap`.
## `CachedSource`
Decorates a `Source` and caches returned results of `map`, `source`, `buffer`, `size` and `sourceAndMap` in memory. `updateHash` is not cached.
It tries to reused cached results from other methods to avoid calculations, i. e. when `source` is already cached, calling `size` will get the size from the cached source, calling `sourceAndMap` will only call `map` on the wrapped Source.
```typescript
new CachedSource(source: Source)
new CachedSource(source: Source | () => Source, cachedData?: CachedData)
```
Instead of passing a `Source` object directly one can pass an function that returns a `Source` object. The function is only called when needed and once.
### Public methods
#### `getCachedData()`
Returns the cached data for passing to the constructor. All cached entries are converted to Buffers and strings are avoided.
#### `original()`
Returns the original `Source` object.
#### `originalLazy()`
Returns the original `Source` object or a function returning these.
## `PrefixSource`
Prefix every line of the decorated `Source` with a provided string.
```typescript
new PrefixSource(
prefix: String,
source: Source | String | Buffer
)
```
## `ConcatSource`
Concatenate multiple `Source`s or strings to a single source.
```typescript
new ConcatSource(
...items?: Source | String
)
```
### Public methods
#### `add`
```typescript
ConcatSource.prototype.add(item: Source | String)
```
Adds an item to the source.
## `ReplaceSource`
Decorates a `Source` with replacements and insertions of source code.
The `ReplaceSource` supports "identity" mappings for child source.
When original source matches generated source for a mapping it's assumed to be mapped char by char allowing to split mappings at replacements/insertions.
### Public methods
#### `replace`
```typescript
ReplaceSource.prototype.replace(
start: Number,
end: Number,
replacement: String
)
```
Replaces chars from `start` (0-indexed, inclusive) to `end` (0-indexed, inclusive) with `replacement`.
Locations represents locations in the original source and are not influenced by other replacements or insertions.
#### `insert`
```typescript
ReplaceSource.prototype.insert(
pos: Number,
insertion: String
)
```
Inserts the `insertion` before char `pos` (0-indexed).
Location represents location in the original source and is not influenced by other replacements or insertions.
#### `original`
Get decorated `Source`.
## `CompatSource`
Converts a Source-like object into a real Source object.
### Public methods
#### static `from`
```typescript
CompatSource.from(sourceLike: any | Source)
```
If `sourceLike` is a real Source it returns it unmodified. Otherwise it returns it wrapped in a CompatSource.

70
frontend/node_modules/webpack-sources/package.json generated vendored Normal file
View File

@@ -0,0 +1,70 @@
{
"name": "webpack-sources",
"version": "3.3.3",
"description": "Source code handling classes for webpack",
"main": "lib/index.js",
"types": "types.d.ts",
"scripts": {
"lint": "yarn lint:code && yarn lint:types && yarn lint:types-test && yarn lint:special",
"lint:code": "eslint --cache .",
"lint:special": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-file-header && node node_modules/tooling/generate-types",
"lint:types": "tsc",
"lint:types-test": "tsc -p tsconfig.types.test.json",
"fmt": "yarn fmt:base --loglevel warn --write",
"fmt:check": "yarn fmt:base --check",
"fmt:base": "prettier --cache --ignore-unknown .",
"fix": "yarn fix:code && yarn fix:special",
"fix:code": "yarn lint:code --fix",
"fix:special": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/generate-types --write",
"pretest": "yarn lint",
"test": "jest",
"cover": "jest --coverage"
},
"devDependencies": {
"@eslint/js": "^9.28.0",
"@eslint/markdown": "^6.5.0",
"@stylistic/eslint-plugin": "^4.4.1",
"@types/jest": "^27.5.2",
"coveralls": "^3.0.2",
"globals": "^16.2.0",
"eslint": "^9.28.0",
"eslint-config-webpack": "^4.0.8",
"eslint-config-prettier": "^10.1.5",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.12.0",
"eslint-plugin-jsdoc": "^50.7.1",
"eslint-plugin-n": "^17.19.0",
"eslint-plugin-prettier": "^5.4.1",
"eslint-plugin-unicorn": "^59.0.1",
"istanbul": "^0.4.1",
"jest": "^27.5.1",
"prettier": "^3.5.3",
"prettier-2": "npm:prettier@^2",
"source-map": "^0.7.3",
"sourcemap-validator": "^2.1.0",
"tooling": "webpack/tooling#v1.23.10",
"typescript": "^5.3.3",
"webpack": "^5.99.9"
},
"files": [
"lib/",
"types.d.ts"
],
"engines": {
"node": ">=10.13.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/webpack/webpack-sources.git"
},
"keywords": [
"webpack",
"source-map"
],
"author": "Tobias Koppers @sokra",
"license": "MIT",
"bugs": {
"url": "https://github.com/webpack/webpack-sources/issues"
},
"homepage": "https://github.com/webpack/webpack-sources#readme"
}

461
frontend/node_modules/webpack-sources/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,461 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
import { Buffer } from "buffer";
declare interface BufferEntry {
map?: null | RawSourceMap;
bufferedMap?: null | BufferedMap;
}
declare interface BufferedMap {
/**
* version
*/
version: number;
/**
* sources
*/
sources: string[];
/**
* name
*/
names: string[];
/**
* source root
*/
sourceRoot?: string;
/**
* sources content
*/
sourcesContent?: ("" | Buffer)[];
/**
* mappings
*/
mappings?: Buffer;
/**
* file
*/
file: string;
}
declare interface CachedData {
/**
* source
*/
source?: boolean;
/**
* buffer
*/
buffer: Buffer;
/**
* size
*/
size?: number;
/**
* maps
*/
maps: Map<string, BufferEntry>;
/**
* hash
*/
hash?: (string | Buffer)[];
}
declare class CachedSource extends Source {
constructor(source: Source | (() => Source), cachedData?: CachedData);
getCachedData(): CachedData;
originalLazy(): Source | (() => Source);
original(): Source;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
declare class CompatSource extends Source {
constructor(sourceLike: SourceLike);
static from(sourceLike: SourceLike): Source;
}
declare class ConcatSource extends Source {
constructor(...args: ConcatSourceChild[]);
getChildren(): Source[];
add(item: ConcatSourceChild): void;
addAllSkipOptimizing(items: ConcatSourceChild[]): void;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
type ConcatSourceChild = string | Source | SourceLike;
declare interface GeneratedSourceInfo {
/**
* generated line
*/
generatedLine?: number;
/**
* generated column
*/
generatedColumn?: number;
/**
* source
*/
source?: string;
}
declare interface HashLike {
/**
* make hash update
*/
update: (data: string | Buffer, inputEncoding?: string) => HashLike;
/**
* get hash digest
*/
digest: (encoding?: string) => string | Buffer;
}
declare interface MapOptions {
/**
* need columns?
*/
columns?: boolean;
/**
* is module
*/
module?: boolean;
}
declare class OriginalSource extends Source {
constructor(value: string | Buffer, name: string);
getName(): string;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
_onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
declare class PrefixSource extends Source {
constructor(prefix: string, source: string | Source | Buffer);
getPrefix(): string;
original(): Source;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
declare class RawSource extends Source {
constructor(value: string | Buffer, convertToString?: boolean);
isBuffer(): boolean;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
declare interface RawSourceMap {
/**
* version
*/
version: number;
/**
* sources
*/
sources: string[];
/**
* names
*/
names: string[];
/**
* source root
*/
sourceRoot?: string;
/**
* sources content
*/
sourcesContent?: string[];
/**
* mappings
*/
mappings: string;
/**
* file
*/
file: string;
/**
* debug id
*/
debugId?: string;
/**
* ignore list
*/
ignoreList?: number[];
}
declare class ReplaceSource extends Source {
constructor(source: Source, name?: string);
getName(): undefined | string;
getReplacements(): Replacement[];
replace(start: number, end: number, newValue: string, name?: string): void;
insert(pos: number, newValue: string, name?: string): void;
original(): Source;
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
static Replacement: typeof Replacement;
}
declare class Replacement {
constructor(start: number, end: number, content: string, name?: string);
start: number;
end: number;
content: string;
name?: string;
index?: number;
}
declare class SizeOnlySource extends Source {
constructor(size: number);
}
declare class Source {
constructor();
source(): SourceValue;
buffer(): Buffer;
size(): number;
map(options?: MapOptions): null | RawSourceMap;
sourceAndMap(options?: MapOptions): SourceAndMap;
updateHash(hash: HashLike): void;
}
declare interface SourceAndMap {
/**
* source
*/
source: SourceValue;
/**
* map
*/
map: null | RawSourceMap;
}
declare interface SourceLike {
/**
* source
*/
source: () => SourceValue;
/**
* buffer
*/
buffer?: () => Buffer;
/**
* size
*/
size?: () => number;
/**
* map
*/
map?: (options?: MapOptions) => null | RawSourceMap;
/**
* source and map
*/
sourceAndMap?: (options?: MapOptions) => SourceAndMap;
/**
* hash updater
*/
updateHash?: (hash: HashLike) => void;
}
declare class SourceMapSource extends Source {
constructor(
value: string | Buffer,
name: string,
sourceMap?: string | RawSourceMap | Buffer,
originalSource?: string | Buffer,
innerSourceMap?: string | RawSourceMap | Buffer,
removeOriginalSource?: boolean,
);
getArgsAsBuffers(): [
Buffer,
string,
Buffer,
undefined | Buffer,
undefined | Buffer,
undefined | boolean,
];
streamChunks(
options: StreamChunksOptions,
onChunk: (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void,
onSource: (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void,
onName: (nameIndex: number, name: string) => void,
): GeneratedSourceInfo;
}
type SourceValue = string | Buffer;
declare interface StreamChunksOptions {
source?: boolean;
finalSource?: boolean;
columns?: boolean;
}
declare namespace exports {
export namespace util {
export namespace stringBufferUtils {
export let disableDualStringBufferCaching: () => void;
export let enableDualStringBufferCaching: () => void;
export let internString: (str: string) => string;
export let isDualStringBufferCachingEnabled: () => boolean;
export let enterStringInterningRange: () => void;
export let exitStringInterningRange: () => void;
}
}
export type OnChunk = (
chunk: undefined | string,
generatedLine: number,
generatedColumn: number,
sourceIndex: number,
originalLine: number,
originalColumn: number,
nameIndex: number,
) => void;
export type OnName = (nameIndex: number, name: string) => void;
export type OnSource = (
sourceIndex: number,
source: null | string,
sourceContent?: string,
) => void;
export {
Source,
RawSource,
OriginalSource,
SourceMapSource,
CachedSource,
ConcatSource,
ReplaceSource,
PrefixSource,
SizeOnlySource,
CompatSource,
CachedData,
SourceLike,
ConcatSourceChild,
Replacement,
HashLike,
MapOptions,
RawSourceMap,
SourceAndMap,
SourceValue,
GeneratedSourceInfo,
StreamChunksOptions,
};
}
export = exports;