Skip to content

Commit 61fe64c

Browse files
committed
refactor: project rewrite p3
- bundling Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 2938beb commit 61fe64c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1835
-278
lines changed

build.config.mts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { defineBuildConfig, type Config } from '@flex-development/mkbuild'
7-
import tsconfig from './tsconfig.build.json' assert { type: 'json' }
7+
import tsconfig from './tsconfig.build.json' with { type: 'json' }
88

99
/**
1010
* Build configuration.

scripts/build.mts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ import config from '../build.config.mts'
1414
const report: Report = await make({ ...config, write: true })
1515

1616
for (const result of report.builds) {
17-
if (result.failure) console.error(result.failure)
17+
if (result.failure) result.logger.fail(result.failure)
1818
}

src/interfaces/__tests__/esbuild-options.spec-d.mts

+18-6
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ describe('unit-d:interfaces/EsbuildOptions', () => {
2424
.toEqualTypeOf<Nilable<{ [key: string]: string }>>()
2525
})
2626

27-
it('should match [drop?: Drop[] | null | undefined]', () => {
27+
it('should match [drop?: Set<Drop> | readonly Drop[] | null | undefined]', () => {
2828
expectTypeOf<TestSubject>()
2929
.toHaveProperty('drop')
30-
.toEqualTypeOf<Nilable<Drop[]>>()
30+
.toEqualTypeOf<Nilable<Set<Drop> | readonly Drop[]>>()
3131
})
3232

33-
it('should match [dropLabels?: string[] | null | undefined]', () => {
33+
it('should match [dropLabels?: Set<string> | readonly string[] | null | undefined]', () => {
3434
expectTypeOf<TestSubject>()
3535
.toHaveProperty('dropLabels')
36-
.toEqualTypeOf<Nilable<string[]>>()
36+
.toEqualTypeOf<Nilable<Set<string> | readonly string[]>>()
3737
})
3838

3939
it('should match [exclude?: FilterPattern | null | undefined]', () => {
@@ -42,6 +42,12 @@ describe('unit-d:interfaces/EsbuildOptions', () => {
4242
.toEqualTypeOf<Nilable<FilterPattern>>()
4343
})
4444

45+
it('should match [ignoreAnnotations?: boolean | null | undefined]', () => {
46+
expectTypeOf<TestSubject>()
47+
.toHaveProperty('ignoreAnnotations')
48+
.toEqualTypeOf<Nilable<boolean>>()
49+
})
50+
4551
it('should match [include?: FilterPattern | null | undefined]', () => {
4652
expectTypeOf<TestSubject>()
4753
.toHaveProperty('include')
@@ -150,6 +156,12 @@ describe('unit-d:interfaces/EsbuildOptions', () => {
150156
.toEqualTypeOf<Nilable<Platform>>()
151157
})
152158

159+
it('should match [pure?: Set<string> | readonly string[] | null | undefined]', () => {
160+
expectTypeOf<TestSubject>()
161+
.toHaveProperty('pure')
162+
.toEqualTypeOf<Nilable<Set<string> | readonly string[]>>()
163+
})
164+
153165
it('should match [reserveProps?: RegExp | null | undefined]', () => {
154166
expectTypeOf<TestSubject>()
155167
.toHaveProperty('reserveProps')
@@ -162,10 +174,10 @@ describe('unit-d:interfaces/EsbuildOptions', () => {
162174
.toEqualTypeOf<Nilable<Record<string, boolean>>>()
163175
})
164176

165-
it('should match [target?: Set<string> | string[] | string | null | undefined]', () => {
177+
it('should match [target?: Set<string> | readonly string[] | string | null | undefined]', () => {
166178
expectTypeOf<TestSubject>()
167179
.toHaveProperty('target')
168-
.toEqualTypeOf<Nilable<Set<string> | string[] | string>>()
180+
.toEqualTypeOf<Nilable<Set<string> | readonly string[] | string>>()
169181
})
170182

171183
it('should match [tsconfigRaw?: Tsconfig | string | null | undefined]', () => {

src/interfaces/__tests__/experimental-options.spec-d.mts

+18
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ import type TestSubject from '#interfaces/experimental-options'
77
import type { Nilable } from '@flex-development/tutils'
88

99
describe('unit-d:interfaces/ExperimentalOptions', () => {
10+
it('should match [cacheExpiry?: number | null | undefined]', () => {
11+
expectTypeOf<TestSubject>()
12+
.toHaveProperty('cacheExpiry')
13+
.toEqualTypeOf<Nilable<number>>()
14+
})
15+
16+
it('should match [logSideEffects?: boolean | null | undefined]', () => {
17+
expectTypeOf<TestSubject>()
18+
.toHaveProperty('logSideEffects')
19+
.toEqualTypeOf<Nilable<boolean>>()
20+
})
21+
22+
it('should match [minChunkSize?: number | null | undefined]', () => {
23+
expectTypeOf<TestSubject>()
24+
.toHaveProperty('minChunkSize')
25+
.toEqualTypeOf<Nilable<number>>()
26+
})
27+
1028
it('should match [perf?: boolean | null | undefined]', () => {
1129
expectTypeOf<TestSubject>()
1230
.toHaveProperty('perf')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @file Type Tests - InputMap
3+
* @module mkbuild/interfaces/tests/unit-d/InputMap
4+
*/
5+
6+
import type TestSubject from '#interfaces/input-map'
7+
import type { InputFile } from '@flex-development/mkbuild'
8+
9+
describe('unit-d:interfaces/InputMap', () => {
10+
it('should match Record<string, InputFile>', () => {
11+
expectTypeOf<TestSubject>().toMatchTypeOf<Record<string, InputFile>>()
12+
})
13+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @file Type Tests - ModuleContextMap
3+
* @module mkbuild/interfaces/tests/unit-d/ModuleContextMap
4+
*/
5+
6+
import type TestSubject from '#interfaces/module-context-map'
7+
8+
describe('unit-d:interfaces/ModuleContextMap', () => {
9+
it('should match Record<string, string>', () => {
10+
expectTypeOf<TestSubject>().toMatchTypeOf<Record<string, string>>()
11+
})
12+
})

src/interfaces/__tests__/resolve-options.spec-d.mts

+13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
import type { Skip, default as TestSubject } from '#interfaces/resolve-options'
7+
import type { ExternalOption } from '@flex-development/mkbuild'
78
import type { ResolveModuleOptions } from '@flex-development/mlly'
89
import type { Nilable } from '@flex-development/tutils'
910

@@ -25,9 +26,21 @@ describe('unit-d:interfaces/ResolveOptions', () => {
2526
.toEqualTypeOf<Nilable<Set<string> | string[]>>()
2627
})
2728

29+
it('should match [external?: ExternalOption | null | undefined]', () => {
30+
expectTypeOf<TestSubject>()
31+
.toHaveProperty('external')
32+
.toEqualTypeOf<Nilable<ExternalOption>>()
33+
})
34+
2835
it('should match [mainFields?: Set<string> | string[] | null | undefined]', () => {
2936
expectTypeOf<TestSubject>()
3037
.toHaveProperty('mainFields')
3138
.toEqualTypeOf<Nilable<Set<string> | string[]>>()
3239
})
40+
41+
it('should match [makeAbsoluteExternalsRelative?: "ifRelativeSource" | boolean | null | undefined]', () => {
42+
expectTypeOf<TestSubject>()
43+
.toHaveProperty('makeAbsoluteExternalsRelative')
44+
.toEqualTypeOf<Nilable<'ifRelativeSource' | boolean>>()
45+
})
3346
})

src/interfaces/__tests__/result.spec-d.mts

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ import type { Nilable } from '@flex-development/tutils'
1717
import type { SerializedTimings } from 'rollup'
1818

1919
describe('unit-d:interfaces/Result', () => {
20+
it('should match [bundle: boolean]', () => {
21+
expectTypeOf<TestSubject>()
22+
.toHaveProperty('bundle')
23+
.toEqualTypeOf<boolean>()
24+
})
25+
2026
it('should match [failure?: Failure | null | undefined]', () => {
2127
expectTypeOf<TestSubject>()
2228
.toHaveProperty('failure')

0 commit comments

Comments
 (0)