@@ -93,6 +93,8 @@ export type NoExternalFn = (
9393 importer : string | undefined ,
9494) => boolean | null | undefined | void
9595
96+ export type CIOption = 'ci-only' | 'local-only'
97+
9698/**
9799 * Options for tsdown.
98100 */
@@ -243,7 +245,7 @@ export interface UserConfig {
243245
244246 //#region Output Options
245247
246- /** @default [ 'es'] */
248+ /** @default 'es' */
247249 format ?: Format | Format [ ]
248250 globalName ?: string
249251 /** @default 'dist' */
@@ -353,7 +355,7 @@ export interface UserConfig {
353355 * If true, fails the build on warnings.
354356 * @default false
355357 */
356- failOnWarn ?: boolean
358+ failOnWarn ?: boolean | CIOption
357359 /**
358360 * Custom logger.
359361 */
@@ -387,7 +389,7 @@ export interface UserConfig {
387389 *
388390 * @default false
389391 */
390- debug ?: boolean | DebugOptions
392+ debug ?: boolean | CIOption | DebugOptions
391393
392394 //#region Addons
393395
@@ -398,21 +400,21 @@ export interface UserConfig {
398400 * - If the `types` field is present, or if the main `exports` contains a `types` entry, declaration file generation is enabled by default.
399401 * - Otherwise, declaration file generation is disabled by default.
400402 */
401- dts ?: boolean | DtsOptions
403+ dts ?: boolean | CIOption | DtsOptions
402404
403405 /**
404406 * Enable unused dependencies check with `unplugin-unused`
405407 * Requires `unplugin-unused` to be installed.
406408 * @default false
407409 */
408- unused ?: boolean | UnusedOptions
410+ unused ?: boolean | CIOption | UnusedOptions
409411
410412 /**
411413 * Run publint after bundling.
412414 * Requires `publint` to be installed.
413415 * @default false
414416 */
415- publint ?: boolean | PublintOptions
417+ publint ?: boolean | CIOption | PublintOptions
416418
417419 /**
418420 * Run `arethetypeswrong` after bundling.
@@ -421,13 +423,13 @@ export interface UserConfig {
421423 * @default false
422424 * @see https://github.com/arethetypeswrong/arethetypeswrong.github.io
423425 */
424- attw ?: boolean | AttwOptions
426+ attw ?: boolean | CIOption | AttwOptions
425427
426428 /**
427429 * Enable size reporting after bundling.
428430 * @default true
429431 */
430- report ?: boolean | ReportOptions
432+ report ?: boolean | CIOption | ReportOptions
431433
432434 /**
433435 * `import.meta.glob` support.
@@ -442,7 +444,7 @@ export interface UserConfig {
442444 * This will set the `main`, `module`, `types`, `exports` fields in `package.json`
443445 * to point to the generated files.
444446 */
445- exports ?: boolean | ExportsOptions
447+ exports ?: boolean | CIOption | ExportsOptions
446448
447449 /**
448450 * @deprecated Alias for `copy`, will be removed in the future.
@@ -492,6 +494,7 @@ export interface InlineConfig extends UserConfig {
492494
493495export type UserConfigFn = (
494496 inlineConfig : InlineConfig ,
497+ context : { ci : boolean } ,
495498) => Awaitable < Arrayable < UserConfig > >
496499
497500export type UserConfigExport = Awaitable < Arrayable < UserConfig > | UserConfigFn >
@@ -530,16 +533,20 @@ export type ResolvedConfig = Overwrite<
530533 format : NormalizedFormat [ ]
531534 target ?: string [ ]
532535 clean : string [ ]
533- dts : false | DtsOptions
534- report : false | ReportOptions
535- tsconfig : false | string
536536 pkg ?: PackageJson
537- exports : false | ExportsOptions
538537 nodeProtocol : 'strip' | boolean
539538 logger : Logger
540539 ignoreWatch : Array < string | RegExp >
541540 noExternal ?: NoExternalFn
542541 inlineOnly ?: Array < string | RegExp >
542+
543+ dts : false | DtsOptions
544+ report : false | ReportOptions
545+ tsconfig : false | string
546+ exports : false | ExportsOptions
543547 debug : false | DebugOptions
548+ publint : false | PublintOptions
549+ attw : false | AttwOptions
550+ unused : false | UnusedOptions
544551 }
545552>
0 commit comments