tsdown 0.12.8 → 0.13.0-beta.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.
@@ -94,7 +94,7 @@ interface TsdownHooks {
94
94
  * Build with tsdown.
95
95
  */
96
96
  declare function build$1(userOptions?: Options$3): Promise<void>;
97
- declare const pkgRoot: string;
97
+ declare const shimFile: string;
98
98
  type TsdownChunks = Partial<Record<NormalizedFormat, Array<OutputChunk | OutputAsset>>>;
99
99
  /**
100
100
  * Build a single configuration, without watch and shortcuts features.
@@ -161,8 +161,8 @@ declare function ReportPlugin(options: ReportOptions, cwd: string, cjsDts?: bool
161
161
  //#endregion
162
162
  //#region src/options/types.d.ts
163
163
  type Sourcemap = boolean | "inline" | "hidden";
164
- type Format = Exclude<ModuleFormat, "experimental-app">;
165
- type NormalizedFormat = Exclude<InternalModuleFormat, "app">;
164
+ type Format = ModuleFormat;
165
+ type NormalizedFormat = InternalModuleFormat;
166
166
  type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset">;
167
167
  interface Workspace {
168
168
  /**
@@ -387,6 +387,7 @@ interface Options$3 {
387
387
  * If enabled, strips the `node:` protocol prefix from import source.
388
388
  *
389
389
  * @default false
390
+ * @deprecated Use `nodeProtocol: 'strip'` instead.
390
391
  *
391
392
  * @example
392
393
  * // With removeNodeProtocol enabled:
@@ -394,6 +395,23 @@ interface Options$3 {
394
395
  */
395
396
  removeNodeProtocol?: boolean;
396
397
  /**
398
+ * - If true, add `node:` prefix to built-in modules.
399
+ * - If 'strip', strips the `node:` protocol prefix from import source.
400
+ * - If false, does not modify the import source.
401
+ *
402
+ * @default false
403
+ *
404
+ * @example
405
+ * // With nodeProtocol enabled:
406
+ * import('fs'); // becomes import('node:fs')
407
+ * // With nodeProtocol set to 'strip':
408
+ * import('node:fs'); // becomes import('fs')
409
+ * // With nodeProtocol set to false:
410
+ * import('node:fs'); // remains import('node:fs')
411
+ *
412
+ */
413
+ nodeProtocol?: "strip" | boolean;
414
+ /**
397
415
  * If enabled, appends hash to chunk filenames.
398
416
  * @default true
399
417
  */
@@ -428,6 +446,7 @@ type ResolvedOptions = Omit<Overwrite<MarkPartial<Omit<Options$3, "publicDir" |
428
446
  tsconfig: string | false;
429
447
  pkg?: PackageJson;
430
448
  exports: false | ExportsOptions;
449
+ nodeProtocol: "strip" | boolean;
431
450
  }>, "config" | "fromVite">;
432
451
  //#endregion
433
452
  //#region src/config.d.ts
@@ -436,4 +455,4 @@ type ResolvedOptions = Omit<Overwrite<MarkPartial<Omit<Options$3, "publicDir" |
436
455
  */
437
456
  declare function defineConfig(options: UserConfig | UserConfigFn): UserConfig | UserConfigFn;
438
457
  //#endregion
439
- export { BuildContext, Options$3 as Options, ReportPlugin, ResolvedOptions, TsdownChunks, TsdownHooks, UserConfig, UserConfigFn, build$1 as build, buildSingle, defineConfig, logger, pkgRoot };
458
+ export { BuildContext, Options$3 as Options, ReportPlugin, ResolvedOptions, TsdownChunks, TsdownHooks, UserConfig, UserConfigFn, build$1 as build, buildSingle, defineConfig, logger, shimFile };
package/dist/config.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { UserConfig, UserConfigFn, defineConfig } from "./config-D_2fTM9-.mjs";
1
+ import { UserConfig, UserConfigFn, defineConfig } from "./config-BHQdCemQ.mjs";
2
2
  export { UserConfig, UserConfigFn, defineConfig };
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { BuildContext, Options, ResolvedOptions, TsdownChunks, TsdownHooks, UserConfig, UserConfigFn, build, buildSingle, defineConfig, logger, pkgRoot } from "./config-D_2fTM9-.mjs";
2
- export { BuildContext, Options, ResolvedOptions, TsdownChunks, TsdownHooks, UserConfig, UserConfigFn, build, buildSingle, defineConfig, logger, pkgRoot };
1
+ import { BuildContext, Options, ResolvedOptions, TsdownChunks, TsdownHooks, UserConfig, UserConfigFn, build, buildSingle, defineConfig, logger, shimFile } from "./config-BHQdCemQ.mjs";
2
+ export { BuildContext, Options, ResolvedOptions, TsdownChunks, TsdownHooks, UserConfig, UserConfigFn, build, buildSingle, defineConfig, logger, shimFile };