-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #787 from wheresrhys/rhys/ts-build-for-core
build: use tsc to build core
- Loading branch information
Showing
8 changed files
with
92 additions
and
54 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
tsconfig.* | ||
scripts | ||
src |
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 was deleted.
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,15 @@ | ||
import { writeFile } from 'fs/promises'; | ||
const longFormatNames = { | ||
cjs: 'commonjs', | ||
esm: 'module', | ||
}; | ||
|
||
async function createPackageJson(format) { | ||
const pkg = { type: longFormatNames[format] }; | ||
|
||
const location = `./dist/${format}`; | ||
await writeFile(`${location}/package.json`, JSON.stringify(pkg, null, 2)); | ||
} | ||
|
||
await createPackageJson('esm'); | ||
await createPackageJson('cjs'); |
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,49 @@ | ||
{ | ||
"compilerOptions": { | ||
"inlineSourceMap": false, | ||
"listEmittedFiles": false, | ||
"listFiles": false, | ||
"pretty": true, | ||
"traceResolution": false, | ||
"rootDir": "src", | ||
"lib": [ | ||
"es2021", | ||
"dom", | ||
"dom.iterable" | ||
], | ||
"moduleResolution": "nodenext", | ||
"allowJs": true, | ||
"checkJs": true, | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"strictNullChecks": false, | ||
"strictFunctionTypes": true, | ||
"downlevelIteration": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"types": [], | ||
"declaration": true, | ||
"removeComments": true | ||
}, | ||
"compileOnSave": false, | ||
"exclude": ["node_modules", "src/__tests__"], | ||
"include": ["src"] | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"module": "commonjs", | ||
"outDir": "dist/cjs", | ||
"target": "es2021" | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"module": "nodenext", | ||
"outDir": "dist/esm", | ||
"target": "es2021" | ||
} | ||
} |