-
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. - Enable all Rome rules and make sure that generated code will pass all rules. - Disable Rome `json` formatting
- Loading branch information
Showing
38 changed files
with
341 additions
and
341 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
{ | ||
"$schema": "./node_modules/rome/configuration_schema.json", | ||
"formatter": { | ||
"indentStyle": "space", | ||
"indentSize": 4 | ||
"indentSize": 4, | ||
"ignore": ["*.json", "./tsconfig-base.json"] | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
"all": true, | ||
"nursery": { | ||
"useLiteralKeys": "off" | ||
} | ||
} | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"quoteProperties": "preserve", | ||
"semicolons": "asNeeded" | ||
} | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
} | ||
} |
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,19 +1,23 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
# https://node.green/#ES2020 | ||
# https://kangax.github.io/compat-table/es2016plus | ||
TARGET=es2020 | ||
|
||
# build .d.ts | ||
npx tsc --build src | ||
tsc --build src/ | ||
|
||
cp -f dist/index.d.ts dist/index.d.cts | ||
|
||
# build ESM | ||
npx esbuild src/index.ts src/*/*.ts --outdir=dist --log-level=warning | ||
esbuild src/index.ts src/*/*.ts --target=$TARGET --outdir=dist --log-level=warning | ||
|
||
# build CommonJS (fallback) | ||
npx esbuild src/index.ts --bundle --platform=node > dist/index.cjs | ||
esbuild src/index.ts --bundle --target=$TARGET --platform=node > dist/index.cjs | ||
|
||
# build cli (bin) | ||
npx esbuild src/cli.ts --define:VERSION=\""$npm_package_version"\" > dist/cli.js | ||
esbuild src/cli.ts --target=$TARGET --define:VERSION=\""$npm_package_version"\" > dist/cli.js | ||
|
||
# build standalone cli program | ||
npx esbuild dist/cli.js --bundle --minify --keep-names --platform=node > dist/bare | ||
esbuild dist/cli.js --bundle --target=$TARGET --minify --keep-names --platform=node > dist/bare |
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,14 +1,13 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
npm run build | ||
. scripts/build.sh | ||
|
||
# unit tests | ||
npx oletus dist/*/*.test.js tests-corpus/*.test.js tests-corpus/*/*/*.test.js | ||
oletus dist/*/*.test.js tests-corpus/*.test.js tests-corpus/*/*/*.test.js | ||
|
||
# lint | ||
npx rome ci src scripts | ||
npx rome check tests-corpus | ||
rome ci src scripts | ||
rome check tests-corpus | ||
|
||
# type check | ||
npx tsc --build src/tsconfig-*.json tests-corpus | ||
tsc --build src/tsconfig-test.json tests-corpus/ |
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
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{ | ||
"extends": "../tsconfig-base.json", | ||
"compilerOptions": { | ||
"moduleResolution": "node", | ||
"types": ["node"] | ||
}, | ||
"include": ["./**/*.test.ts"], | ||
"include": ["./cli.ts", "./**/*.test.ts"], | ||
"references": [{ "path": "." }] | ||
} |
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 |
---|---|---|
|
@@ -7,6 +7,5 @@ | |
|
||
"composite": true | ||
}, | ||
"include": ["./**/*.ts"], | ||
"exclude": ["./cli.ts", "./**/*.spec.ts", "./**/*.test.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
{ | ||
"extends": "../tsconfig-base.json", | ||
"compilerOptions": { | ||
"moduleResolution": "node", | ||
"paths": { "@bare-ts/tools": ["../src/index.js"] }, | ||
"types": ["node"] | ||
}, | ||
"include": ["./**/*.js", "./**/*.ts"], | ||
"references": [{ "path": "../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 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
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,4 +1,5 @@ | ||
import * as bare from "@bare-ts/lib" | ||
|
||
import * as ext from "./ext.js" | ||
|
||
export function readMessage(bc) { | ||
|
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,4 +1,5 @@ | ||
import * as bare from "@bare-ts/lib" | ||
|
||
import * as ext from "./ext.js" | ||
|
||
export type u8 = number | ||
|
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
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
2 changes: 1 addition & 1 deletion
2
tests-corpus/valid-bare-schema/list-union-circular-ref/out.gen.js
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
2 changes: 1 addition & 1 deletion
2
tests-corpus/valid-bare-schema/list-union-circular-ref/out.gen.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
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
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
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
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
Oops, something went wrong.