Skip to content

Commit

Permalink
enhance: improve default tsconfig of prepare cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jan 12, 2025
1 parent 421508f commit 8edd082
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ export const tsExtensions = new Set(['ts', 'tsx', 'cts', 'mts'])

export const DEFAULT_TS_CONFIG = {
compilerOptions: {
target: 'ES2022',
module: 'ESNext',
moduleResolution: 'bundler',
},
include: ['src'],
}

export const BINARY_TAG = '$binary'
Expand Down
16 changes: 16 additions & 0 deletions test/integration/prepare-ts/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ describe('integration prepare-ts', () => {
it('should contain files', async () => {
const { stdout } = job
await assertContainFiles(dir, ['package.json', 'tsconfig.json'])

const tsconfig = await fsp.readFile(join(dir, './tsconfig.json'), 'utf-8')

expect(tsconfig).toMatchInlineSnapshot(`
"{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler"
},
"include": [
"src"
]
}"
`)

const pkgJson = JSON.parse(
await fsp.readFile(join(dir, './package.json'), 'utf-8'),
)
Expand Down

0 comments on commit 8edd082

Please sign in to comment.