esbuild
Advanced tools
Comparing version 0.16.17 to 0.17.0
@@ -129,4 +129,4 @@ "use strict"; | ||
} | ||
if (stdout !== "0.16.17") { | ||
throw new Error(`Expected ${JSON.stringify("0.16.17")} but got ${JSON.stringify(stdout)}`); | ||
if (stdout !== "0.17.0") { | ||
throw new Error(`Expected ${JSON.stringify("0.17.0")} but got ${JSON.stringify(stdout)}`); | ||
} | ||
@@ -183,3 +183,3 @@ } | ||
child_process.execSync( | ||
`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.16.17"}`, | ||
`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.17.0"}`, | ||
{ cwd: installDir, stdio: "pipe", env } | ||
@@ -235,3 +235,3 @@ ); | ||
async function downloadDirectlyFromNPM(pkg, subpath, binPath) { | ||
const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${"0.16.17"}.tgz`; | ||
const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${"0.17.0"}.tgz`; | ||
console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`); | ||
@@ -238,0 +238,0 @@ try { |
@@ -135,4 +135,2 @@ export type Platform = 'browser' | 'node' | 'neutral'; | ||
footer?: { [type: string]: string }; | ||
/** Documentation: https://esbuild.github.io/api/#incremental */ | ||
incremental?: boolean; | ||
/** Documentation: https://esbuild.github.io/api/#entry-points */ | ||
@@ -148,10 +146,4 @@ entryPoints?: string[] | Record<string, string>; | ||
nodePaths?: string[]; // The "NODE_PATH" variable from Node.js | ||
/** Documentation: https://esbuild.github.io/api/#watch */ | ||
watch?: boolean | WatchMode; | ||
} | ||
export interface WatchMode { | ||
onRebuild?: (error: BuildFailure | null, result: BuildResult | null) => void; | ||
} | ||
export interface StdinOptions { | ||
@@ -204,24 +196,11 @@ contents: string | Uint8Array; | ||
export interface BuildInvalidate { | ||
(): Promise<BuildIncremental>; | ||
dispose(): void; | ||
} | ||
export interface BuildIncremental extends BuildResult { | ||
rebuild: BuildInvalidate; | ||
} | ||
export interface BuildResult { | ||
export interface BuildResult<SpecificOptions extends BuildOptions = BuildOptions> { | ||
errors: Message[]; | ||
warnings: Message[]; | ||
/** Only when "write: false" */ | ||
outputFiles?: OutputFile[]; | ||
/** Only when "incremental: true" */ | ||
rebuild?: BuildInvalidate; | ||
/** Only when "watch: true" */ | ||
stop?: () => void; | ||
outputFiles: OutputFile[] | (SpecificOptions['write'] extends false ? never : undefined); | ||
/** Only when "metafile: true" */ | ||
metafile?: Metafile; | ||
metafile: Metafile | (SpecificOptions['metafile'] extends true ? never : undefined); | ||
/** Only when "mangleCache" is present */ | ||
mangleCache?: Record<string, string | false>; | ||
mangleCache: Record<string, string | false> | (SpecificOptions['mangleCache'] extends Object ? never : undefined); | ||
} | ||
@@ -239,2 +218,4 @@ | ||
servedir?: string; | ||
keyfile?: string | ||
certfile?: string | ||
onRequest?: (args: ServeOnRequestArgs) => void; | ||
@@ -256,4 +237,2 @@ } | ||
host: string; | ||
wait: Promise<void>; | ||
stop: () => void; | ||
} | ||
@@ -282,3 +261,3 @@ | ||
export interface TransformResult { | ||
export interface TransformResult<SpecificOptions extends TransformOptions = TransformOptions> { | ||
code: string; | ||
@@ -288,5 +267,5 @@ map: string; | ||
/** Only when "mangleCache" is present */ | ||
mangleCache?: Record<string, string | false>; | ||
mangleCache: Record<string, string | false> | (SpecificOptions['mangleCache'] extends Object ? never : undefined); | ||
/** Only when "legalComments" is "external" */ | ||
legalComments?: string; | ||
legalComments: string | (SpecificOptions['legalComments'] extends 'external' ? never : undefined); | ||
} | ||
@@ -311,3 +290,3 @@ | ||
onEnd(callback: (result: BuildResult) => | ||
(void | Promise<void>)): void; | ||
(OnEndResult | null | void | Promise<OnEndResult | null | void>)): void; | ||
onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => | ||
@@ -320,3 +299,3 @@ (OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void; | ||
esbuild: { | ||
serve: typeof serve, | ||
context: typeof context, | ||
build: typeof build, | ||
@@ -361,2 +340,7 @@ buildSync: typeof buildSync, | ||
export interface OnEndResult { | ||
errors?: PartialMessage[]; | ||
warnings?: PartialMessage[]; | ||
} | ||
export interface OnResolveOptions { | ||
@@ -491,2 +475,12 @@ filter: RegExp; | ||
export interface WatchOptions { | ||
} | ||
export interface BuildContext<SpecificOptions extends BuildOptions = BuildOptions> { | ||
rebuild(): Promise<BuildResult<SpecificOptions>> | ||
watch(options?: WatchOptions): void | ||
serve(options?: ServeOptions): Promise<ServeResult> | ||
dispose(): Promise<void> | ||
} | ||
/** | ||
@@ -502,11 +496,8 @@ * This function invokes the "esbuild" command-line tool for you. It returns a | ||
*/ | ||
export declare function build(options: BuildOptions & { write: false }): Promise<BuildResult & { outputFiles: OutputFile[] }>; | ||
export declare function build(options: BuildOptions & { incremental: true, metafile: true }): Promise<BuildIncremental & { metafile: Metafile }>; | ||
export declare function build(options: BuildOptions & { incremental: true }): Promise<BuildIncremental>; | ||
export declare function build(options: BuildOptions & { metafile: true }): Promise<BuildResult & { metafile: Metafile }>; | ||
export declare function build<SpecificOptions extends BuildOptions>(options: SpecificOptions): Promise<BuildResult<SpecificOptions>>; | ||
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. | ||
* This is the advanced long-running form of "build" that supports additional | ||
* features such as watch mode and a local development server. | ||
* | ||
@@ -516,5 +507,6 @@ * - Works in node: yes | ||
* | ||
* Documentation: https://esbuild.github.io/api/#serve | ||
* Documentation: https://esbuild.github.io/api/#context-api | ||
*/ | ||
export declare function serve(serveOptions: ServeOptions, buildOptions: BuildOptions): Promise<ServeResult>; | ||
export declare function context<T extends BuildOptions>(options: T): Promise<BuildContext<T>>; | ||
export declare function context(options: BuildOptions): Promise<BuildContext>; | ||
@@ -532,2 +524,3 @@ /** | ||
*/ | ||
export declare function transform<SpecificOptions extends TransformOptions>(input: string | Uint8Array, options?: SpecificOptions): Promise<TransformResult<SpecificOptions>>; | ||
export declare function transform(input: string | Uint8Array, options?: TransformOptions): Promise<TransformResult>; | ||
@@ -565,3 +558,3 @@ | ||
*/ | ||
export declare function buildSync(options: BuildOptions & { write: false }): BuildResult & { outputFiles: OutputFile[] }; | ||
export declare function buildSync<SpecificOptions extends BuildOptions>(options: SpecificOptions): BuildResult<SpecificOptions>; | ||
export declare function buildSync(options: BuildOptions): BuildResult; | ||
@@ -577,3 +570,4 @@ | ||
*/ | ||
export declare function transformSync(input: string, options?: TransformOptions): TransformResult; | ||
export declare function transformSync<SpecificOptions extends TransformOptions>(input: string, options?: SpecificOptions): TransformResult<SpecificOptions>; | ||
export declare function transformSync(input: string | Uint8Array, options?: TransformOptions): TransformResult; | ||
@@ -580,0 +574,0 @@ /** |
{ | ||
"name": "esbuild", | ||
"version": "0.16.17", | ||
"version": "0.17.0", | ||
"description": "An extremely fast JavaScript and CSS bundler and minifier.", | ||
@@ -18,26 +18,26 @@ "repository": "https://github.com/evanw/esbuild", | ||
"optionalDependencies": { | ||
"@esbuild/android-arm": "0.16.17", | ||
"@esbuild/android-arm64": "0.16.17", | ||
"@esbuild/android-x64": "0.16.17", | ||
"@esbuild/darwin-arm64": "0.16.17", | ||
"@esbuild/darwin-x64": "0.16.17", | ||
"@esbuild/freebsd-arm64": "0.16.17", | ||
"@esbuild/freebsd-x64": "0.16.17", | ||
"@esbuild/linux-arm": "0.16.17", | ||
"@esbuild/linux-arm64": "0.16.17", | ||
"@esbuild/linux-ia32": "0.16.17", | ||
"@esbuild/linux-loong64": "0.16.17", | ||
"@esbuild/linux-mips64el": "0.16.17", | ||
"@esbuild/linux-ppc64": "0.16.17", | ||
"@esbuild/linux-riscv64": "0.16.17", | ||
"@esbuild/linux-s390x": "0.16.17", | ||
"@esbuild/linux-x64": "0.16.17", | ||
"@esbuild/netbsd-x64": "0.16.17", | ||
"@esbuild/openbsd-x64": "0.16.17", | ||
"@esbuild/sunos-x64": "0.16.17", | ||
"@esbuild/win32-arm64": "0.16.17", | ||
"@esbuild/win32-ia32": "0.16.17", | ||
"@esbuild/win32-x64": "0.16.17" | ||
"@esbuild/android-arm": "0.17.0", | ||
"@esbuild/android-arm64": "0.17.0", | ||
"@esbuild/android-x64": "0.17.0", | ||
"@esbuild/darwin-arm64": "0.17.0", | ||
"@esbuild/darwin-x64": "0.17.0", | ||
"@esbuild/freebsd-arm64": "0.17.0", | ||
"@esbuild/freebsd-x64": "0.17.0", | ||
"@esbuild/linux-arm": "0.17.0", | ||
"@esbuild/linux-arm64": "0.17.0", | ||
"@esbuild/linux-ia32": "0.17.0", | ||
"@esbuild/linux-loong64": "0.17.0", | ||
"@esbuild/linux-mips64el": "0.17.0", | ||
"@esbuild/linux-ppc64": "0.17.0", | ||
"@esbuild/linux-riscv64": "0.17.0", | ||
"@esbuild/linux-s390x": "0.17.0", | ||
"@esbuild/linux-x64": "0.17.0", | ||
"@esbuild/netbsd-x64": "0.17.0", | ||
"@esbuild/openbsd-x64": "0.17.0", | ||
"@esbuild/sunos-x64": "0.17.0", | ||
"@esbuild/win32-arm64": "0.17.0", | ||
"@esbuild/win32-ia32": "0.17.0", | ||
"@esbuild/win32-x64": "0.17.0" | ||
}, | ||
"license": "MIT" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
126932
3153