Skip to content

Commit

Permalink
feat(interfaces): BuildOptions
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
  • Loading branch information
unicornware committed Nov 29, 2022
1 parent 645b692 commit b8bfa94
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/interfaces/__tests__/build-options.spec-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @file Unit Tests - BuildOptions
* @module tsconfig-types/interfaces/interfaces/BuildOptions
*/

import type TestSubject from '../build-options'

describe('unit:interfaces/BuildOptions', () => {
it('should allow empty object', () => {
assertType<TestSubject>({})
})

it('should allow object with all build options', () => {
assertType<Required<TestSubject>>({
assumeChangesOnlyAffectDirectDependencies: false,
dry: false,
force: false,
incremental: false,
traceResolution: false,
verbose: false
})
})

it('should allow object with unknown key', () => {
assertType<TestSubject>({ key: 'value' })
})
})
58 changes: 58 additions & 0 deletions src/interfaces/build-options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* @file Interfaces - BuildOptions
* @module tsconfig-types/interfaces/BuildOptions
*/

import type { CompilerOptionsValue } from '#src/types'

/**
* Program build options.
*/
interface BuildOptions {
[option: string]: CompilerOptionsValue | undefined

/**
* Have recompiles in projects that use {@linkcode incremental} assume that
* changes within a file will only affect files directly depending on it.
*
* @default false
*/
assumeChangesOnlyAffectDirectDependencies?: boolean

/**
* Show what would be built.
*
* @default false
*/
dry?: boolean

/**
* Build all projects, including those that appear to be up to date.
*
* @default false
*/
force?: boolean

/**
* Save `.tsbuildinfo` files to allow for incremental compilation of projects.
*
* @default false
*/
incremental?: boolean

/**
* Log paths used during the module resolution process.
*
* @default false
*/
traceResolution?: boolean

/**
* Enable verbose logging.
*
* @default false
*/
verbose?: boolean
}

export type { BuildOptions as default }
1 change: 1 addition & 0 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @module tsconfig-types/interfaces
*/

export type { default as BuildOptions } from './build-options'
export type { default as CompilerOptions } from './compiler-options'
export type { default as Plugin } from './plugin'
export type { default as ProjectReference } from './project-reference'
Expand Down

0 comments on commit b8bfa94

Please sign in to comment.