-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove TypeScript config `noImplicitAny` and `noImplicitTHis`. They are both enabled under `strict` in TSC >=5.0 - Remove `noUnusedLocals`: this should be checked by a linter. - Enable skipLibCheck (recommended by TSC) - Remove stripInternal (no use) - Add tsconfig and rome $schema for auto-completion in IDE - Remove `npx` in scripts: it incurs a 30% slowdown. - Specify `--target` for _ESbuild_. _ESbuild_ >= 0.18.0 no longer relies on `tsconfig`'s `target` option.
- Loading branch information
Showing
10 changed files
with
280 additions
and
293 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
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 |
---|---|---|
@@ -1,13 +1,17 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
# https://node.green/#ES2020 | ||
# https://kangax.github.io/compat-table/es2016plus | ||
TARGET=es2020 | ||
|
||
# build ESM | ||
esbuild src/*.ts src/*/*.ts --platform=neutral --outdir=dist --log-level=warning | ||
esbuild src/*.ts src/*/*.ts --target=$TARGET --platform=neutral --outdir=dist --log-level=warning | ||
|
||
# build .d.ts | ||
tsc --build src | ||
|
||
# build CommonJS (fallback) | ||
esbuild src/index.ts --bundle --platform=node > dist/index.cjs | ||
esbuild src/index.ts --bundle --target=$TARGET --platform=node > dist/index.cjs | ||
|
||
cp -f dist/index.d.ts dist/index.d.cts |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
declare const process: { readonly env: Record<string, string | undefined> } | ||
declare const process: { readonly env: { NODE_ENV: string | undefined } } | ||
|
||
export const DEV: boolean = process.env["NODE_ENV"] === "development" | ||
export const DEV: boolean = process.env.NODE_ENV === "development" |
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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
{ | ||
"extends": "../tsconfig-base.json", | ||
"compilerOptions": { | ||
"outDir": "../dist", | ||
"noEmit": false, | ||
"composite": true, | ||
"emitDeclarationOnly": true, | ||
|
||
"composite": true | ||
}, | ||
"include": ["**/*.ts"] | ||
"noEmit": false, | ||
"outDir": "../dist" | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,9 +1,3 @@ | ||
{ | ||
"extends": "../tsconfig-base.json", | ||
"compilerOptions": { | ||
"moduleResolution": "node", | ||
"paths": { "@bare-ts/lib": ["../src/index.js"] } | ||
}, | ||
"include": ["**/*.js", "**/*.ts"], | ||
"references": [{ "path": "../src" }] | ||
"extends": "../tsconfig-base.json" | ||
} |
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