chore:更换到主分支

This commit is contained in:
张益铭
2021-03-01 15:26:05 +08:00
parent 9064b372e8
commit 6a5f1810f9
3530 changed files with 59613 additions and 479452 deletions

2
node_modules/esbuild/README.md generated vendored
View File

@@ -1,3 +1,3 @@
# esbuild
This is a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://github.com/evanw/esbuild/blob/master/docs/js-api.md) for details.
This is a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://esbuild.github.io/api/) for details.

5
node_modules/esbuild/bin/esbuild generated vendored
View File

@@ -1,5 +1,6 @@
#!/usr/bin/env node
const path = require('path');
const esbuild_exe = path.join(__dirname, '..', 'esbuild.exe');
const esbuild_exe = path.join(__dirname, '..', "esbuild.exe");
const child_process = require('child_process');
child_process.spawnSync(esbuild_exe, process.argv.slice(2), { stdio: 'inherit' });
const { status } = child_process.spawnSync(esbuild_exe, process.argv.slice(2), { stdio: 'inherit' });
process.exitCode = status === null ? 1 : status;

BIN
node_modules/esbuild/esbuild.exe generated vendored

Binary file not shown.

76
node_modules/esbuild/install.js generated vendored
View File

@@ -27,7 +27,7 @@ const path = require("path");
const zlib = require("zlib");
const https = require("https");
const child_process = require("child_process");
const version = "0.7.22";
const version = "0.8.53";
const binPath = path.join(__dirname, "bin", "esbuild");
function installBinaryFromPackage(name, fromPath, toPath) {
return __async(this, null, function* () {
@@ -72,7 +72,10 @@ function installBinaryFromPackage(name, fromPath, toPath) {
process.exit(1);
}
try {
fs.mkdirSync(path.dirname(cachePath), {recursive: true});
fs.mkdirSync(path.dirname(cachePath), {
recursive: true,
mode: 448
});
fs.copyFileSync(toPath, cachePath);
cleanCacheLRU(cachePath);
} catch (e) {
@@ -94,6 +97,9 @@ function getCachePath(name) {
return path.join(home, "Library", "Caches", ...common);
if (process.platform === "win32")
return path.join(home, "AppData", "Local", "Cache", ...common);
const XDG_CACHE_HOME = process.env.XDG_CACHE_HOME;
if (process.platform === "linux" && XDG_CACHE_HOME && path.isAbsolute(XDG_CACHE_HOME))
return path.join(XDG_CACHE_HOME, ...common);
return path.join(home, ".cache", ...common);
}
function cleanCacheLRU(fileToKeep) {
@@ -150,13 +156,16 @@ function extractFileFromTarGzip(buffer, file) {
throw new Error(`Could not find ${JSON.stringify(file)} in archive`);
}
function installUsingNPM(name, file) {
const installDir = path.join(__dirname, ".install");
const installDir = path.join(os.tmpdir(), "esbuild-" + Math.random().toString(36).slice(2));
fs.mkdirSync(installDir, {recursive: true});
fs.writeFileSync(path.join(installDir, "package.json"), "{}");
const env = __assign(__assign({}, process.env), {npm_config_global: void 0});
child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${name}@${version}`, {cwd: installDir, stdio: "pipe", env});
const buffer = fs.readFileSync(path.join(installDir, "node_modules", name, file));
removeRecursive(installDir);
try {
removeRecursive(installDir);
} catch (e) {
}
return buffer;
}
function removeRecursive(dir) {
@@ -175,51 +184,76 @@ function removeRecursive(dir) {
}
fs.rmdirSync(dir);
}
function installOnUnix(name) {
if (process.env.ESBUILD_BIN_PATH_FOR_TESTS) {
fs.unlinkSync(binPath);
fs.symlinkSync(process.env.ESBUILD_BIN_PATH_FOR_TESTS, binPath);
function isYarnBerryOrNewer() {
const {npm_config_user_agent} = process.env;
if (npm_config_user_agent) {
const match = npm_config_user_agent.match(/yarn\/(\d+)/);
if (match && match[1]) {
return parseInt(match[1], 10) >= 2;
}
}
return false;
}
function installDirectly(name) {
if (process.env.ESBUILD_BINARY_PATH) {
fs.copyFileSync(process.env.ESBUILD_BINARY_PATH, binPath);
validateBinaryVersion(binPath);
} else {
installBinaryFromPackage(name, "bin/esbuild", binPath).catch((e) => setImmediate(() => {
throw e;
}));
}
}
function installOnWindows(name) {
function installWithWrapper(name, fromPath, toPath) {
fs.writeFileSync(binPath, `#!/usr/bin/env node
const path = require('path');
const esbuild_exe = path.join(__dirname, '..', 'esbuild.exe');
const esbuild_exe = path.join(__dirname, '..', ${JSON.stringify(toPath)});
const child_process = require('child_process');
child_process.spawnSync(esbuild_exe, process.argv.slice(2), { stdio: 'inherit' });
const { status } = child_process.spawnSync(esbuild_exe, process.argv.slice(2), { stdio: 'inherit' });
process.exitCode = status === null ? 1 : status;
`);
const exePath = path.join(__dirname, "esbuild.exe");
if (process.env.ESBUILD_BIN_PATH_FOR_TESTS) {
fs.copyFileSync(process.env.ESBUILD_BIN_PATH_FOR_TESTS, exePath);
const absToPath = path.join(__dirname, toPath);
if (process.env.ESBUILD_BINARY_PATH) {
fs.copyFileSync(process.env.ESBUILD_BINARY_PATH, absToPath);
validateBinaryVersion(absToPath);
} else {
installBinaryFromPackage(name, "esbuild.exe", exePath).catch((e) => setImmediate(() => {
installBinaryFromPackage(name, fromPath, absToPath).catch((e) => setImmediate(() => {
throw e;
}));
}
}
const key = `${process.platform} ${os.arch()} ${os.endianness()}`;
function installOnUnix(name) {
if (isYarnBerryOrNewer()) {
installWithWrapper(name, "bin/esbuild", "esbuild");
} else {
installDirectly(name);
}
}
function installOnWindows(name) {
installWithWrapper(name, "esbuild.exe", "esbuild.exe");
}
const platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`;
const knownWindowsPackages = {
"win32 ia32 LE": "esbuild-windows-32",
"win32 x64 LE": "esbuild-windows-64"
};
const knownUnixlikePackages = {
"darwin x64 LE": "esbuild-darwin-64",
"darwin arm64 LE": "esbuild-darwin-arm64",
"freebsd arm64 LE": "esbuild-freebsd-arm64",
"freebsd x64 LE": "esbuild-freebsd-64",
"linux arm LE": "esbuild-linux-arm",
"linux arm64 LE": "esbuild-linux-arm64",
"linux ia32 LE": "esbuild-linux-32",
"linux mips64el LE": "esbuild-linux-mips64le",
"linux ppc64 LE": "esbuild-linux-ppc64le",
"linux x64 LE": "esbuild-linux-64"
};
if (key in knownWindowsPackages) {
installOnWindows(knownWindowsPackages[key]);
} else if (key in knownUnixlikePackages) {
installOnUnix(knownUnixlikePackages[key]);
if (platformKey in knownWindowsPackages) {
installOnWindows(knownWindowsPackages[platformKey]);
} else if (platformKey in knownUnixlikePackages) {
installOnUnix(knownUnixlikePackages[platformKey]);
} else {
console.error(`Unsupported platform: ${key}`);
console.error(`Unsupported platform: ${platformKey}`);
process.exit(1);
}

195
node_modules/esbuild/lib/main.d.ts generated vendored
View File

@@ -1,28 +1,33 @@
export type Platform = 'browser' | 'node';
export type Platform = 'browser' | 'node' | 'neutral';
export type Format = 'iife' | 'cjs' | 'esm';
export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary';
export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'default';
export type LogLevel = 'info' | 'warning' | 'error' | 'silent';
export type Strict = 'nullish-coalescing' | 'optional-chaining' | 'class-fields';
export type Charset = 'ascii' | 'utf8';
export type TreeShaking = true | 'ignore-annotations';
interface CommonOptions {
sourcemap?: boolean | 'inline' | 'external';
sourcemap?: boolean | 'inline' | 'external' | 'both';
sourcesContent?: boolean;
format?: Format;
globalName?: string;
target?: string | string[];
strict?: boolean | Strict[];
minify?: boolean;
minifyWhitespace?: boolean;
minifyIdentifiers?: boolean;
minifySyntax?: boolean;
charset?: Charset;
treeShaking?: TreeShaking;
jsxFactory?: string;
jsxFragment?: string;
define?: { [key: string]: string };
pure?: string[];
avoidTDZ?: boolean;
keepNames?: boolean;
banner?: string;
footer?: string;
color?: boolean;
logLevel?: LogLevel;
@@ -32,11 +37,12 @@ interface CommonOptions {
export interface BuildOptions extends CommonOptions {
bundle?: boolean;
splitting?: boolean;
preserveSymlinks?: boolean;
outfile?: string;
metafile?: string;
outdir?: string;
outbase?: string;
platform?: Platform;
color?: boolean;
external?: string[];
loader?: { [ext: string]: Loader };
resolveExtensions?: string[];
@@ -45,10 +51,20 @@ export interface BuildOptions extends CommonOptions {
tsconfig?: string;
outExtension?: { [ext: string]: string };
publicPath?: string;
chunkNames?: string;
assetNames?: string;
inject?: string[];
incremental?: boolean;
entryPoints?: string[];
stdin?: StdinOptions;
plugins?: Plugin[];
absWorkingDir?: string;
nodePaths?: string[]; // The "NODE_PATH" variable from Node.js
watch?: boolean | WatchMode;
}
export interface WatchMode {
onRebuild?: (error: BuildFailure | null, result: BuildResult | null) => void;
}
export interface StdinOptions {
@@ -61,10 +77,21 @@ export interface StdinOptions {
export interface Message {
text: string;
location: Location | null;
notes: Note[];
// Optional user-specified data that is passed through unmodified. You can
// use this to stash the original error, for example.
detail: any;
}
export interface Note {
text: string;
location: Location | null;
}
export interface Location {
file: string;
namespace: string;
line: number; // 1-based
column: number; // 0-based, in bytes
length: number; // in bytes
@@ -73,12 +100,24 @@ export interface Location {
export interface OutputFile {
path: string;
contents: Uint8Array;
contents: Uint8Array; // "text" as bytes
text: string; // "contents" as text
}
export interface BuildInvalidate {
(): Promise<BuildIncremental>;
dispose(): void;
}
export interface BuildIncremental extends BuildResult {
rebuild: BuildInvalidate;
}
export interface BuildResult {
warnings: Message[];
outputFiles?: OutputFile[]; // Only when "write: false"
rebuild?: BuildInvalidate; // Only when "incremental: true"
stop?: () => void; // Only when "watch: true"
}
export interface BuildFailure extends Error {
@@ -86,6 +125,28 @@ export interface BuildFailure extends Error {
warnings: Message[];
}
export interface ServeOptions {
port?: number;
host?: string;
servedir?: string;
onRequest?: (args: ServeOnRequestArgs) => void;
}
export interface ServeOnRequestArgs {
remoteAddress: string;
method: string;
path: string;
status: number;
timeInMS: number; // The time to generate the response, not to send it
}
export interface ServeResult {
port: number;
host: string;
wait: Promise<void>;
stop: () => void;
}
export interface TransformOptions extends CommonOptions {
tsconfigRaw?: string | {
compilerOptions?: {
@@ -101,8 +162,8 @@ export interface TransformOptions extends CommonOptions {
}
export interface TransformResult {
js: string;
jsSourceMap: string;
code: string;
map: string;
warnings: Message[];
}
@@ -111,6 +172,103 @@ export interface TransformFailure extends Error {
warnings: Message[];
}
export interface Plugin {
name: string;
setup: (build: PluginBuild) => void;
}
export interface PluginBuild {
onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) =>
(OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void;
onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) =>
(OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>)): void;
}
export interface OnResolveOptions {
filter: RegExp;
namespace?: string;
}
export interface OnResolveArgs {
path: string;
importer: string;
namespace: string;
resolveDir: string;
kind: ResolveKind;
pluginData: any;
}
export type ResolveKind =
| 'entry-point'
// JS
| 'import-statement'
| 'require-call'
| 'dynamic-import'
| 'require-resolve'
// CSS
| 'import-rule'
| 'url-token'
export interface OnResolveResult {
pluginName?: string;
errors?: PartialMessage[];
warnings?: PartialMessage[];
path?: string;
external?: boolean;
namespace?: string;
pluginData?: any;
}
export interface OnLoadOptions {
filter: RegExp;
namespace?: string;
}
export interface OnLoadArgs {
path: string;
namespace: string;
pluginData: any;
}
export interface OnLoadResult {
pluginName?: string;
errors?: PartialMessage[];
warnings?: PartialMessage[];
contents?: string | Uint8Array;
resolveDir?: string;
loader?: Loader;
pluginData?: any;
}
export interface PartialMessage {
text?: string;
location?: Partial<Location> | null;
notes?: PartialNote[];
detail?: any;
}
export interface PartialNote {
text?: string;
location?: Partial<Location> | null;
}
export type MetadataImportKind =
// JS
| 'import-statement'
| 'require-call'
| 'dynamic-import'
| 'require-resolve'
// CSS
| 'import-rule'
| 'url-token'
// This is the type information for the "metafile" JSON format
export interface Metadata {
inputs: {
@@ -118,6 +276,7 @@ export interface Metadata {
bytes: number
imports: {
path: string
kind: MetadataImportKind
}[]
}
}
@@ -131,13 +290,19 @@ export interface Metadata {
}
imports: {
path: string
kind: MetadataImportKind
}[]
exports: string[]
entryPoint?: string
}
}
}
export interface Service {
build(options: BuildOptions & { write: false }): Promise<BuildResult & { outputFiles: OutputFile[] }>;
build(options: BuildOptions & { incremental: true }): Promise<BuildIncremental>;
build(options: BuildOptions): Promise<BuildResult>;
serve(serveOptions: ServeOptions, buildOptions: BuildOptions): Promise<ServeResult>;
transform(input: string, options?: TransformOptions): Promise<TransformResult>;
// This stops the service, which kills the long-lived child process. Any
@@ -151,8 +316,17 @@ export interface Service {
//
// Works in node: yes
// Works in browser: no
export declare function build(options: BuildOptions & { write: false }): Promise<BuildResult & { outputFiles: OutputFile[] }>;
export declare function build(options: BuildOptions & { incremental: true }): Promise<BuildIncremental>;
export declare function build(options: BuildOptions): Promise<BuildResult>;
// This function is similar to "build" but it serves the resulting files over
// HTTP on a localhost address with the specified port.
//
// Works in node: yes
// Works in browser: no
export declare function serve(serveOptions: ServeOptions, buildOptions: BuildOptions): Promise<ServeResult>;
// This function transforms a single JavaScript file. It can be used to minify
// JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
// to older JavaScript. It returns a promise that is either resolved with a
@@ -166,6 +340,7 @@ export declare function transform(input: string, options?: TransformOptions): Pr
//
// Works in node: yes
// Works in browser: no
export declare function buildSync(options: BuildOptions & { write: false }): BuildResult & { outputFiles: OutputFile[] };
export declare function buildSync(options: BuildOptions): BuildResult;
// A synchronous version of "transform".

1056
node_modules/esbuild/lib/main.js generated vendored

File diff suppressed because it is too large Load Diff

32
node_modules/esbuild/package.json generated vendored
View File

@@ -1,39 +1,35 @@
{
"_args": [
[
"esbuild@0.7.22",
"J:\\Github\\CURD-TS"
]
],
"_development": true,
"_from": "esbuild@0.7.22",
"_id": "esbuild@0.7.22",
"_from": "esbuild@^0.8.52",
"_id": "esbuild@0.8.53",
"_inBundle": false,
"_integrity": "sha1-kUm5A/gSi3xFp1QEbCQZnXa74I4=",
"_integrity": "sha1-tAi7DKGynasT2Lv31Z9Zr+Z3boY=",
"_location": "/esbuild",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "esbuild@0.7.22",
"raw": "esbuild@^0.8.52",
"name": "esbuild",
"escapedName": "esbuild",
"rawSpec": "0.7.22",
"rawSpec": "^0.8.52",
"saveSpec": null,
"fetchSpec": "0.7.22"
"fetchSpec": "^0.8.52"
},
"_requiredBy": [
"/vite"
],
"_resolved": "http://192.168.250.101:4873/esbuild/-/esbuild-0.7.22.tgz",
"_spec": "0.7.22",
"_where": "J:\\Github\\CURD-TS",
"_resolved": "http://192.168.250.101:4873/esbuild/-/esbuild-0.8.53.tgz",
"_shasum": "b408bb0ca1b29dab13d8bbf7d59f59afe6776e86",
"_spec": "esbuild@^0.8.52",
"_where": "J:\\Github\\CURD-TS\\node_modules\\vite",
"bin": {
"esbuild": "bin/esbuild"
},
"bugs": {
"url": "https://github.com/evanw/esbuild/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "An extremely fast JavaScript bundler and minifier.",
"homepage": "https://github.com/evanw/esbuild#readme",
"license": "MIT",
@@ -47,5 +43,5 @@
"postinstall": "node install.js"
},
"types": "lib/main.d.ts",
"version": "0.7.22"
"version": "0.8.53"
}