-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Perf(Pack): Enable TypeScript
compilerOptions.incremental
on watch
- Loading branch information
Showing
9 changed files
with
4,150 additions
and
544 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "@techor.tests/type", | ||
"private": true, | ||
"sideEffects": false, | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export default class Person { | ||
constructor( | ||
public readonly name: string, | ||
public readonly age: number, | ||
) { } | ||
sex: string | ||
weight: number | ||
height: number | ||
} | ||
|
||
const person = new Person('John', 18) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { execSync } from 'node:child_process' | ||
import dedent from 'ts-dedent' | ||
import fs from 'fs' | ||
import path from 'path' | ||
|
||
beforeAll(() => { | ||
execSync('tsx ../../src/bin pack', { cwd: __dirname, stdio: 'pipe' }) | ||
}) | ||
|
||
it('generates declarations', () => { | ||
expect(fs.readFileSync(path.join(__dirname, 'dist/index.d.ts')).toString()).toEqual(dedent` | ||
export default class Person { | ||
readonly name: string; | ||
readonly age: number; | ||
constructor(name: string, age: number); | ||
sex: string; | ||
weight: number; | ||
height: number; | ||
}\n | ||
`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../../../../tsconfig.json", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"outDir": "dist" | ||
}, | ||
"include": [ | ||
"src/**/*.ts", | ||
"src/**/*.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters