Comparing version 2.1.3 to 2.1.4
@@ -30,3 +30,3 @@ #!/usr/bin/env node | ||
var version = "2.1.3"; | ||
var version = "2.1.4"; | ||
@@ -33,0 +33,0 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { |
@@ -1,126 +0,34 @@ | ||
import * as url from 'url'; | ||
import * as worker_threads from 'worker_threads'; | ||
import * as _babel_core from '@babel/core'; | ||
import { JscTarget } from '@swc/core'; | ||
import { RollupOptions, InputOptions, OutputOptions } from 'rollup'; | ||
declare const spread: { | ||
globalThis: typeof globalThis; | ||
eval(x: string): any; | ||
parseInt(string: string, radix?: number | undefined): number; | ||
parseFloat(string: string): number; | ||
isNaN(number: number): boolean; | ||
isFinite(number: number): boolean; | ||
decodeURI(encodedURI: string): string; | ||
decodeURIComponent(encodedURIComponent: string): string; | ||
encodeURI(uri: string): string; | ||
encodeURIComponent(uriComponent: string | number | boolean): string; | ||
escape(string: string): string; | ||
unescape(string: string): string; | ||
NaN: number; | ||
Infinity: number; | ||
Symbol: SymbolConstructor; | ||
Object: ObjectConstructor; | ||
Function: FunctionConstructor; | ||
String: StringConstructor; | ||
Boolean: BooleanConstructor; | ||
Number: NumberConstructor; | ||
Math: Math; | ||
Date: DateConstructor; | ||
RegExp: RegExpConstructor; | ||
Error: ErrorConstructor; | ||
EvalError: EvalErrorConstructor; | ||
RangeError: RangeErrorConstructor; | ||
ReferenceError: ReferenceErrorConstructor; | ||
SyntaxError: SyntaxErrorConstructor; | ||
TypeError: TypeErrorConstructor; | ||
URIError: URIErrorConstructor; | ||
JSON: JSON; | ||
Array: ArrayConstructor; | ||
Promise: PromiseConstructor; | ||
ArrayBuffer: ArrayBufferConstructor; | ||
DataView: DataViewConstructor; | ||
Int8Array: Int8ArrayConstructor; | ||
Uint8Array: Uint8ArrayConstructor; | ||
Uint8ClampedArray: Uint8ClampedArrayConstructor; | ||
Int16Array: Int16ArrayConstructor; | ||
Uint16Array: Uint16ArrayConstructor; | ||
Int32Array: Int32ArrayConstructor; | ||
Uint32Array: Uint32ArrayConstructor; | ||
Float32Array: Float32ArrayConstructor; | ||
Float64Array: Float64ArrayConstructor; | ||
Intl: typeof Intl; | ||
Map: MapConstructor; | ||
WeakMap: WeakMapConstructor; | ||
Set: SetConstructor; | ||
WeakSet: WeakSetConstructor; | ||
Proxy: ProxyConstructor; | ||
Reflect: typeof Reflect; | ||
SharedArrayBuffer: SharedArrayBufferConstructor; | ||
Atomics: Atomics; | ||
BigInt: BigIntConstructor; | ||
BigInt64Array: BigInt64ArrayConstructor; | ||
BigUint64Array: BigUint64ArrayConstructor; | ||
babel: typeof _babel_core; | ||
structuredClone<T>(value: T, transfer?: { | ||
transfer: readonly worker_threads.TransferListItem[]; | ||
} | undefined): T; | ||
process: NodeJS.Process; | ||
console: Console; | ||
__filename: string; | ||
__dirname: string; | ||
require: NodeRequire; | ||
module: NodeModule; | ||
exports: any; | ||
gc: (() => void) | undefined; | ||
AbortController: { | ||
new (): AbortController; | ||
prototype: AbortController; | ||
declare type ExportType = 'require' | 'export' | 'default' | string; | ||
declare type CommonConfig = { | ||
dts?: boolean; | ||
format?: OutputOptions['format']; | ||
minify?: boolean; | ||
sourcemap?: boolean; | ||
external?: string[]; | ||
runtime?: string; | ||
exportCondition?: { | ||
source: string; | ||
name: string; | ||
export: ExportCondition; | ||
}; | ||
AbortSignal: { | ||
new (): AbortSignal; | ||
prototype: AbortSignal; | ||
}; | ||
global: typeof globalThis; | ||
spyOn<T_1>(object: T_1, method: keyof T_1): jasmine.Spy; | ||
pending(reason?: string | undefined): void; | ||
fail(error?: any): never; | ||
beforeAll: jest.Lifecycle; | ||
beforeEach: jest.Lifecycle; | ||
afterAll: jest.Lifecycle; | ||
afterEach: jest.Lifecycle; | ||
describe: jest.Describe; | ||
fdescribe: jest.Describe; | ||
xdescribe: jest.Describe; | ||
it: jest.It; | ||
fit: jest.It; | ||
xit: jest.It; | ||
test: jest.It; | ||
xtest: jest.It; | ||
jest: typeof jest; | ||
jasmine: typeof jasmine; | ||
atob(data: string): string; | ||
btoa(data: string): string; | ||
Buffer: BufferConstructor; | ||
setTimeout: typeof setTimeout; | ||
clearTimeout(timeoutId: string | number | NodeJS.Timeout | undefined): void; | ||
setInterval: typeof setInterval; | ||
clearInterval(intervalId: string | number | NodeJS.Timeout | undefined): void; | ||
setImmediate: typeof setImmediate; | ||
clearImmediate(immediateId: NodeJS.Immediate | undefined): void; | ||
queueMicrotask(callback: () => void): void; | ||
URLSearchParams: typeof url.URLSearchParams; | ||
URL: typeof url.URL; | ||
undefined: undefined; | ||
}; | ||
declare function loadList(): Promise<number[]>; | ||
declare const optionalChainFn: { | ||
<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>; | ||
<T_1, A0, A_1 extends any[], R>(this: (this: T_1, arg0: A0, ...args: A_1) => R, thisArg: T_1, arg0: A0): (...args: A_1) => R; | ||
<T_2, A0_1, A1, A_2 extends any[], R_1>(this: (this: T_2, arg0: A0_1, arg1: A1, ...args: A_2) => R_1, thisArg: T_2, arg0: A0_1, arg1: A1): (...args: A_2) => R_1; | ||
<T_3, A0_2, A1_1, A2, A_3 extends any[], R_2>(this: (this: T_3, arg0: A0_2, arg1: A1_1, arg2: A2, ...args: A_3) => R_2, thisArg: T_3, arg0: A0_2, arg1: A1_1, arg2: A2): (...args: A_3) => R_2; | ||
<T_4, A0_3, A1_2, A2_1, A3, A_4 extends any[], R_3>(this: (this: T_4, arg0: A0_3, arg1: A1_2, arg2: A2_1, arg3: A3, ...args: A_4) => R_3, thisArg: T_4, arg0: A0_3, arg1: A1_2, arg2: A2_1, arg3: A3): (...args: A_4) => R_3; | ||
<T_5, AX, R_4>(this: (this: T_5, ...args: AX[]) => R_4, thisArg: T_5, ...args: AX[]): (...args: AX[]) => R_4; | ||
declare type ExportCondition = string | Record<ExportType, string>; | ||
declare type BuncheeRollupConfig = Partial<Omit<RollupOptions, 'input' | 'output'>> & { | ||
exportName?: string; | ||
input: InputOptions; | ||
output: OutputOptions[]; | ||
dtsOnly: boolean; | ||
}; | ||
declare class A { | ||
} | ||
declare type CliArgs = CommonConfig & { | ||
file?: string; | ||
watch?: boolean; | ||
cwd?: string; | ||
target?: JscTarget; | ||
}; | ||
export { A, loadList, optionalChainFn, spread }; | ||
declare function bundle(entryPath: string, { cwd, ...options }?: CliArgs): Promise<any>; | ||
export { BuncheeRollupConfig, CliArgs, bundle }; |
@@ -337,3 +337,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
var name = file ? file.replace(new RegExp("" + path.extname(file) + "$"), "") : undefined; | ||
var dtsFile = (exportCondition == null ? void 0 : exportCondition.name) ? path.resolve(dtsDir, (exportCondition.name === "." ? "index" : exportCondition.name) + ".d.ts") : file ? name + ".d.ts" : typings; | ||
var dtsFile = file ? name + ".d.ts" : (exportCondition == null ? void 0 : exportCondition.name) ? path.resolve(dtsDir, (exportCondition.name === "." ? "index" : exportCondition.name) + ".d.ts") : typings; | ||
// If there's dts file, use `output.file` | ||
@@ -390,3 +390,2 @@ var dtsPathConfig = dtsFile ? { | ||
buildOutputConfigs(_extends$1({}, cliArgs, { | ||
file: undefined, | ||
format: "es", | ||
@@ -408,7 +407,7 @@ useTypescript: useTypescript | ||
var ref1; | ||
var format = (ref1 = outputExports[0]) == null ? void 0 : ref1.format; | ||
var fallbackFormat = (ref1 = outputExports[0]) == null ? void 0 : ref1.format; | ||
outputConfigs = [ | ||
buildOutputConfigs(_extends$1({}, cliArgs, { | ||
file: file, | ||
format: cliArgs.format || format, | ||
format: cliArgs.format || fallbackFormat, | ||
useTypescript: useTypescript | ||
@@ -415,0 +414,0 @@ }), pkg, typescriptOptions), |
{ | ||
"name": "bunchee", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "zero config bundler for js/ts/jsx libraries", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -103,6 +103,16 @@ # bunchee | ||
```js | ||
import path from 'path' | ||
import { bundle } from 'bunchee' | ||
// options is same to CLI options | ||
await bundle(entryFilePath, options) | ||
// The definition of these options can be found in help information | ||
await bundle(path.resolve('./src/index.ts'), { | ||
dts: false, | ||
watch: false, | ||
minify: false, | ||
sourcemap: false, | ||
external: [], | ||
format: 'esm', | ||
target: 'es2016', | ||
runtime: 'nodejs', | ||
}) | ||
``` | ||
@@ -109,0 +119,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
178
46776
1128