tsdown 0.2.8 → 0.2.9
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/index.d.ts +3 -1
- package/dist/index.js +5 -4
- package/dist/run.js +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type Options, type OptionsWithoutConfig } from "./options";
|
|
2
|
-
|
|
2
|
+
import { logger } from "./utils/logger";
|
|
3
|
+
export declare function build(userOptions?: Omit<Options, "silent">): Promise<void>;
|
|
3
4
|
export declare function defineConfig(options: OptionsWithoutConfig): OptionsWithoutConfig;
|
|
5
|
+
export { logger };
|
|
4
6
|
export type { Options, OptionsWithoutConfig };
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { access, readdir, rm, stat } from "node:fs/promises";
|
|
|
7
7
|
import { default as path, default as path$1, default as path$2, default as path$3 } from "node:path";
|
|
8
8
|
import { glob, glob as glob$1 } from "tinyglobby";
|
|
9
9
|
import { readPackageJSON } from "pkg-types";
|
|
10
|
+
import { default as pc, default as pc$1 } from "picocolors";
|
|
10
11
|
import { loadConfig } from "unconfig";
|
|
11
12
|
|
|
12
13
|
//#region src/utils/fs.ts
|
|
@@ -121,7 +122,7 @@ async function resolveEntry(entry) {
|
|
|
121
122
|
const resolvedEntry = await glob(entry);
|
|
122
123
|
if (resolvedEntry.length > 0) {
|
|
123
124
|
entry = resolvedEntry;
|
|
124
|
-
logger.info(`entry: ${entry.join(", ")}`);
|
|
125
|
+
logger.info(`entry: ${pc$1.blue(entry.join(", "))}`);
|
|
125
126
|
} else {
|
|
126
127
|
throw new Error(`Cannot find entry: ${entry}`);
|
|
127
128
|
}
|
|
@@ -132,7 +133,7 @@ async function resolveEntry(entry) {
|
|
|
132
133
|
throw new Error(`Cannot find entry: ${filename}`);
|
|
133
134
|
}
|
|
134
135
|
});
|
|
135
|
-
logger.info(`entry: ${files.join(", ")}`);
|
|
136
|
+
logger.info(`entry: ${pc$1.blue(files.join(", "))}`);
|
|
136
137
|
}
|
|
137
138
|
return entry;
|
|
138
139
|
}
|
|
@@ -199,7 +200,7 @@ async function loadConfigFile(options) {
|
|
|
199
200
|
defaults: {}
|
|
200
201
|
});
|
|
201
202
|
if (sources.length > 0) {
|
|
202
|
-
logger.info(`Using tsdown config: ${sources.join(", ")}`);
|
|
203
|
+
logger.info(`Using tsdown config: ${pc.underline(sources.join(", "))}`);
|
|
203
204
|
}
|
|
204
205
|
return config;
|
|
205
206
|
}
|
|
@@ -254,4 +255,4 @@ function defineConfig(options) {
|
|
|
254
255
|
}
|
|
255
256
|
|
|
256
257
|
//#endregion
|
|
257
|
-
export { build, defineConfig };
|
|
258
|
+
export { build, defineConfig, logger };
|
package/dist/run.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { logger } from "./logger-e0Fr5WMR.js";
|
|
2
2
|
import { default as process } from "node:process";
|
|
3
|
-
import { cac } from "cac";
|
|
4
3
|
import { default as pc } from "picocolors";
|
|
4
|
+
import { cac } from "cac";
|
|
5
5
|
|
|
6
6
|
//#region node_modules/.pnpm/rolldown@0.12.2-snapshot-374cd3d-20240819002934/node_modules/rolldown/package.json
|
|
7
7
|
const version$1 = "0.12.2-snapshot-374cd3d-20240819002934";
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region package.json
|
|
11
|
-
const version = "0.2.
|
|
11
|
+
const version = "0.2.9";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/cli.ts
|
|
@@ -16,7 +16,7 @@ async function runCLI() {
|
|
|
16
16
|
const cli = cac("tsdown");
|
|
17
17
|
cli.command("[...files]", "Bundle files", { ignoreOptionDefaultValue: true }).option("-c, --config <filename>", "Use a custom config file").option("--no-config", "Disable config file").option("--format <format>", "Bundle format: esm, cjs, iife", { default: "esm" }).option("--clean", "Clean output directory").option("--minify", "Minify output").option("--silent", "Suppress non-error logs").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--watch", "Watch mode").action(async (input, flags) => {
|
|
18
18
|
logger.level = flags.silent ? 0 : 3;
|
|
19
|
-
logger.info(`tsdown ${pc.
|
|
19
|
+
logger.info(`tsdown ${pc.dim(`v${version}`)} powered by rolldown ${pc.dim(`v${version$1}`)}`);
|
|
20
20
|
const { build } = await import("./index.js");
|
|
21
21
|
if (input.length > 0) flags.entry = input;
|
|
22
22
|
await build(flags);
|