tsdown 0.2.0 → 0.2.2

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/bin/tsdown.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../dist/run.js'
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function runCLI(): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function cleanOutDir(cwd: string, patterns: (string)[]): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { Options } from '../options';
2
+ export declare function resolveEntry(entry: Options['entry']): Promise<(((string)[]) | (Record<string, string>))>;
@@ -0,0 +1,5 @@
1
+ import type { ResolvedOptions } from '../options';
2
+ import type { InputOptions, Plugin } from 'rolldown';
3
+ export type External = InputOptions['external'];
4
+ export declare function ExternalPlugin(pkg: any, platform: ResolvedOptions['platform']): Plugin;
5
+ export declare function getProductionDeps(pkg: any): Set<string>;
@@ -0,0 +1,2 @@
1
+ import type { Format } from '../options';
2
+ export declare function resolveOutputExtension(pkg: any, format: Format): (('mjs') | ('cjs') | ('js'));
@@ -0,0 +1,3 @@
1
+ import { type Options, type OptionsWithoutConfig } from './options';
2
+ export declare function build(userOptions?: Options): Promise<void>;
3
+ export declare function defineConfig(options: OptionsWithoutConfig): OptionsWithoutConfig;
@@ -0,0 +1,23 @@
1
+ import type { External } from './features/external';
2
+ import type { InputOptions } from 'rolldown';
3
+ export type Format = (('es') | ('esm') | ('module') | ('cjs') | ('commonjs'));
4
+ export interface Options {
5
+ entry?: InputOptions['input'];
6
+ format?: ((Format) | ((Format)[]));
7
+ plugins?: InputOptions['plugins'];
8
+ external?: External;
9
+ outDir?: string;
10
+ clean?: ((boolean) | ((string)[]));
11
+ config?: ((boolean) | (string));
12
+ alias?: Record<string, string>;
13
+ treeshake?: boolean;
14
+ platform?: (('node') | ('neutral'));
15
+ }
16
+ export type OptionsWithoutConfig = Omit<Options, 'config'>;
17
+ type Overwrite<T, U> = (({ [P in Exclude<keyof T, keyof U>] : T[P]}) & (U));
18
+ export type ResolvedOptions = Omit<Overwrite<Required<Options>, {
19
+ format: (Format)[];
20
+ clean: (((string)[]) | (false));
21
+ }>, 'config'>;
22
+ export declare function normalizeOptions(options: Options): Promise<ResolvedOptions>;
23
+ export {};
@@ -0,0 +1 @@
1
+ export { ExternalPlugin } from './features/external';
package/dist/run.d.ts ADDED
File without changes
package/dist/run.js CHANGED
@@ -3,8 +3,9 @@ import { default as process } from "node:process";
3
3
  import { cac } from "cac";
4
4
 
5
5
  //#region package.json
6
- const version = '0.2.0';
6
+ const version = '0.2.2';
7
7
  const files = ['dist'];
8
+ const typesVersions = {'*': {'*': ['./dist/*', './*']}};
8
9
 
9
10
  //#endregion
10
11
  //#region src/cli.ts
@@ -0,0 +1 @@
1
+ export declare function fsExists(path: string): Promise<boolean>;
@@ -0,0 +1 @@
1
+ export declare function toArray<T>(val: ((T) | ((T)[]) | (null) | (undefined)), defaultValue?: T): (T)[];
@@ -0,0 +1,2 @@
1
+ import { type ConsolaInstance } from 'consola';
2
+ export declare const logger: ConsolaInstance;
@@ -0,0 +1,2 @@
1
+ export declare function readPackageJson(dir: string): Promise<any>;
2
+ export declare function getPackageType(pkg: any): (('module') | ('commonjs'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsdown",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "An even faster bundler powered by Rolldown.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,8 +24,16 @@
24
24
  "./plugins": "./dist/plugins.js",
25
25
  "./package.json": "./package.json"
26
26
  },
27
+ "typesVersions": {
28
+ "*": {
29
+ "*": [
30
+ "./dist/*",
31
+ "./*"
32
+ ]
33
+ }
34
+ },
27
35
  "bin": {
28
- "tsdown": "./dist/run.js"
36
+ "tsdown": "./bin/tsdown.js"
29
37
  },
30
38
  "publishConfig": {
31
39
  "access": "public"
@@ -47,6 +55,7 @@
47
55
  "tsup": "^8.1.0",
48
56
  "tsx": "^4.15.7",
49
57
  "typescript": "~5.5.2",
58
+ "unplugin-isolated-decl": "^0.1.0",
50
59
  "vitest": "^1.6.0"
51
60
  },
52
61
  "engines": {