bunchee 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -24,7 +24,7 @@ var logger = {
24
24
  }
25
25
  };
26
26
 
27
- var version = "2.1.0";
27
+ var version = "2.1.1";
28
28
 
29
29
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
30
30
  try {
@@ -191,7 +191,7 @@ function parseCliArgs(argv) {
191
191
  minify: args["--minify"],
192
192
  sourcemap: !!args["--sourcemap"],
193
193
  cwd: args["--cwd"],
194
- dts: !!args["--dts"],
194
+ dts: args["--dts"],
195
195
  help: args["--help"],
196
196
  version: args["--version"],
197
197
  runtime: args["--runtime"],
package/dist/lib.d.ts ADDED
@@ -0,0 +1,126 @@
1
+ import * as url from 'url';
2
+ import * as worker_threads from 'worker_threads';
3
+ import * as _babel_core from '@babel/core';
4
+
5
+ declare const spread: {
6
+ globalThis: typeof globalThis;
7
+ eval(x: string): any;
8
+ parseInt(string: string, radix?: number | undefined): number;
9
+ parseFloat(string: string): number;
10
+ isNaN(number: number): boolean;
11
+ isFinite(number: number): boolean;
12
+ decodeURI(encodedURI: string): string;
13
+ decodeURIComponent(encodedURIComponent: string): string;
14
+ encodeURI(uri: string): string;
15
+ encodeURIComponent(uriComponent: string | number | boolean): string;
16
+ escape(string: string): string;
17
+ unescape(string: string): string;
18
+ NaN: number;
19
+ Infinity: number;
20
+ Symbol: SymbolConstructor;
21
+ Object: ObjectConstructor;
22
+ Function: FunctionConstructor;
23
+ String: StringConstructor;
24
+ Boolean: BooleanConstructor;
25
+ Number: NumberConstructor;
26
+ Math: Math;
27
+ Date: DateConstructor;
28
+ RegExp: RegExpConstructor;
29
+ Error: ErrorConstructor;
30
+ EvalError: EvalErrorConstructor;
31
+ RangeError: RangeErrorConstructor;
32
+ ReferenceError: ReferenceErrorConstructor;
33
+ SyntaxError: SyntaxErrorConstructor;
34
+ TypeError: TypeErrorConstructor;
35
+ URIError: URIErrorConstructor;
36
+ JSON: JSON;
37
+ Array: ArrayConstructor;
38
+ Promise: PromiseConstructor;
39
+ ArrayBuffer: ArrayBufferConstructor;
40
+ DataView: DataViewConstructor;
41
+ Int8Array: Int8ArrayConstructor;
42
+ Uint8Array: Uint8ArrayConstructor;
43
+ Uint8ClampedArray: Uint8ClampedArrayConstructor;
44
+ Int16Array: Int16ArrayConstructor;
45
+ Uint16Array: Uint16ArrayConstructor;
46
+ Int32Array: Int32ArrayConstructor;
47
+ Uint32Array: Uint32ArrayConstructor;
48
+ Float32Array: Float32ArrayConstructor;
49
+ Float64Array: Float64ArrayConstructor;
50
+ Intl: typeof Intl;
51
+ Map: MapConstructor;
52
+ WeakMap: WeakMapConstructor;
53
+ Set: SetConstructor;
54
+ WeakSet: WeakSetConstructor;
55
+ Proxy: ProxyConstructor;
56
+ Reflect: typeof Reflect;
57
+ SharedArrayBuffer: SharedArrayBufferConstructor;
58
+ Atomics: Atomics;
59
+ BigInt: BigIntConstructor;
60
+ BigInt64Array: BigInt64ArrayConstructor;
61
+ BigUint64Array: BigUint64ArrayConstructor;
62
+ babel: typeof _babel_core;
63
+ structuredClone<T>(value: T, transfer?: {
64
+ transfer: readonly worker_threads.TransferListItem[];
65
+ } | undefined): T;
66
+ process: NodeJS.Process;
67
+ console: Console;
68
+ __filename: string;
69
+ __dirname: string;
70
+ require: NodeRequire;
71
+ module: NodeModule;
72
+ exports: any;
73
+ gc: (() => void) | undefined;
74
+ AbortController: {
75
+ new (): AbortController;
76
+ prototype: AbortController;
77
+ };
78
+ AbortSignal: {
79
+ new (): AbortSignal;
80
+ prototype: AbortSignal;
81
+ };
82
+ global: typeof globalThis;
83
+ spyOn<T_1>(object: T_1, method: keyof T_1): jasmine.Spy;
84
+ pending(reason?: string | undefined): void;
85
+ fail(error?: any): never;
86
+ beforeAll: jest.Lifecycle;
87
+ beforeEach: jest.Lifecycle;
88
+ afterAll: jest.Lifecycle;
89
+ afterEach: jest.Lifecycle;
90
+ describe: jest.Describe;
91
+ fdescribe: jest.Describe;
92
+ xdescribe: jest.Describe;
93
+ it: jest.It;
94
+ fit: jest.It;
95
+ xit: jest.It;
96
+ test: jest.It;
97
+ xtest: jest.It;
98
+ jest: typeof jest;
99
+ jasmine: typeof jasmine;
100
+ atob(data: string): string;
101
+ btoa(data: string): string;
102
+ Buffer: BufferConstructor;
103
+ setTimeout: typeof setTimeout;
104
+ clearTimeout(timeoutId: string | number | NodeJS.Timeout | undefined): void;
105
+ setInterval: typeof setInterval;
106
+ clearInterval(intervalId: string | number | NodeJS.Timeout | undefined): void;
107
+ setImmediate: typeof setImmediate;
108
+ clearImmediate(immediateId: NodeJS.Immediate | undefined): void;
109
+ queueMicrotask(callback: () => void): void;
110
+ URLSearchParams: typeof url.URLSearchParams;
111
+ URL: typeof url.URL;
112
+ undefined: undefined;
113
+ };
114
+ declare function loadList(): Promise<number[]>;
115
+ declare const optionalChainFn: {
116
+ <T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;
117
+ <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;
118
+ <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;
119
+ <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;
120
+ <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;
121
+ <T_5, AX, R_4>(this: (this: T_5, ...args: AX[]) => R_4, thisArg: T_5, ...args: AX[]): (...args: AX[]) => R_4;
122
+ };
123
+ declare class A {
124
+ }
125
+
126
+ export { A, loadList, optionalChainFn, spread };
package/dist/lib.js CHANGED
@@ -251,6 +251,7 @@ function buildInputConfig(entry, pkg, options, param) {
251
251
  preserveSymlinks: false,
252
252
  target: "esnext",
253
253
  module: "esnext",
254
+ incremental: false,
254
255
  jsx: (tsCompilerOptions == null ? void 0 : tsCompilerOptions.jsx) || "react"
255
256
  })
256
257
  }),
@@ -570,7 +571,7 @@ var __generator = undefined && undefined.__generator || function(thisArg, body)
570
571
  }
571
572
  };
572
573
  function logBuild(exportPath, dtsOnly, _duration) {
573
- logger.log(" ✓ " + (dtsOnly ? "Generated types" : "Built") + " " + exportPath);
574
+ logger.log(" ✓ " + (dtsOnly ? "Typed" : "Built") + " " + exportPath);
574
575
  }
575
576
  function assignDefault(options, name, defaultValue) {
576
577
  if (!(name in options) || options[name] == null) {
@@ -635,6 +636,9 @@ function _bundle() {
635
636
  assignDefault(options, "format", "es");
636
637
  assignDefault(options, "minify", false);
637
638
  assignDefault(options, "target", "es5");
639
+ if (options.dts === undefined && isTypescript(entryPath)) {
640
+ options.dts = true;
641
+ }
638
642
  pkg = getPackageMeta(config.rootDir);
639
643
  _tmp = {};
640
644
  packageExports = pkg.exports || _tmp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunchee",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "zero config bundler for js/ts/jsx libraries",
5
5
  "bin": {
6
6
  "bunchee": "./dist/cli.js"