Merge pull request #68 from ChainSafe/dapplion/tsc

Simplify build setup with tsc
This commit is contained in:
Lion - dapplion 2020-12-08 15:22:40 +00:00 committed by GitHub
commit d82a0e9862
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 906 deletions

View File

@ -1,15 +0,0 @@
/*
See
https://github.com/babel/babel/issues/8652
https://github.com/babel/babel/pull/6027
Babel isn't currently configured by default to read .ts files and
can only be configured to do so via cli or configuration below.
This file is used by mocha to interpret test files using a properly
configured babel.
This can (probably) be removed in babel 8.x.
*/
require('@babel/register')({
extensions: ['.ts'],
})

View File

@ -1,22 +0,0 @@
{
"presets": [
[
"@babel/env",
{
"targets": {
"node": "10.4",
"browsers": ">1%, not ie 11"
},
"exclude": [
"transform-regenerator"
]
}
],
"@babel/typescript"
],
"plugins": [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread",
"@babel/plugin-syntax-bigint"
]
}

View File

@ -14,8 +14,6 @@ jobs:
registry-url: "https://registry.npmjs.org" registry-url: "https://registry.npmjs.org"
- name: Install deps - name: Install deps
run: yarn run: yarn
- name: Check types
run: yarn check-types
- name: Lint - name: Lint
run: yarn lint run: yarn lint
- name: Test build - name: Test build

View File

@ -26,15 +26,9 @@
], ],
"scripts": { "scripts": {
"clean": "rm -rf lib && rm -rf dist && rm -f tsconfig.tsbuildinfo", "clean": "rm -rf lib && rm -rf dist && rm -f tsconfig.tsbuildinfo",
"build": "yarn build-lib && yarn build-types", "build": "tsc --incremental --project tsconfig.build.json",
"build:release": "yarn clean && yarn build && yarn build-web",
"build-lib": "babel src -x .ts -d lib",
"build-types": "tsc --declaration --incremental --outDir lib --project tsconfig.build.json --emitDeclarationOnly",
"build-web": "webpack --mode production --entry ./lib/web.js --output ./dist/bls.min.js",
"check-types": "tsc --noEmit",
"lint": "eslint --color --ext .ts src/ test/", "lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix", "lint:fix": "yarn run lint --fix",
"pretest": "yarn check-types",
"prepublishOnly": "yarn build", "prepublishOnly": "yarn build",
"test:web": "karma start", "test:web": "karma start",
"test:unit": "mocha --colors -r ts-node/register 'test/unit/**/*.test.ts'", "test:unit": "mocha --colors -r ts-node/register 'test/unit/**/*.test.ts'",
@ -52,14 +46,6 @@
"randombytes": "^2.1.0" "randombytes": "^2.1.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/plugin-syntax-bigint": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/preset-typescript": "^7.8.3",
"@babel/register": "^7.8.3",
"@chainsafe/blst": "^0.1.3", "@chainsafe/blst": "^0.1.3",
"@chainsafe/lodestar-spec-test-util": "^0.12.0", "@chainsafe/lodestar-spec-test-util": "^0.12.0",
"@types/chai": "^4.2.9", "@types/chai": "^4.2.9",

View File

@ -1,7 +1,8 @@
{ {
"include": ["src", "test"], "include": ["src", "test"],
"compilerOptions": { "compilerOptions": {
"target": "esnext", "outDir": "lib",
"target": "es2019",
"module": "commonjs", "module": "commonjs",
"pretty": true, "pretty": true,
"lib": ["esnext.bigint", "DOM"], "lib": ["esnext.bigint", "DOM"],

860
yarn.lock

File diff suppressed because it is too large Load Diff