fix: fix setup for new aegir

- tweak tsconfig.js
- add ts type check including test files
- fix ci setup for new aegir
- add new awesome aegir docs feature
  - you can publish to github pages with the flag --publish
This commit is contained in:
Hugo Dias 2021-01-26 21:52:12 +00:00
parent 89dd965bd2
commit 2038b26b76
No known key found for this signature in database
GPG Key ID: 9F61AFCAB8C717A0
4 changed files with 609 additions and 2113 deletions

View File

@ -27,6 +27,7 @@ jobs:
- stage: check
script:
- yarn aegir dep-check
- npx aegir ts -p check
- yarn run lint
- yarn run build
@ -34,25 +35,25 @@ jobs:
name: chrome
addons:
chrome: stable
script: npx aegir test -t browser -t webworker --node true --ts
script: npx aegir test -t browser -t webworker
- stage: test
name: firefox
addons:
firefox: latest
script: npx aegir test -t browser -t webworker --ts --node true -- --browsers FirefoxHeadless
script: npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless
- stage: test
name: electron-main
os: osx
script:
- npx aegir test -t electron-main --bail --ts
- npx aegir test -t electron-main --bail
- stage: test
name: electron-renderer
os: osx
script:
- npx aegir test -t electron-renderer --node true --bail --ts
- npx aegir test -t electron-renderer --bail
notifications:
email: false

View File

@ -21,25 +21,30 @@
"scripts": {
"bench": "node benchmarks/benchmark.js",
"clean": "rm -rf dist",
"copy-dts": "copyfiles -u 1 \"src/**/*.d.ts\" dist/src",
"build": "aegir build --ts",
"copy-dts": "copyup \"src/**/*.d.ts\" dist/src",
"build": "aegir build",
"postbuild": "yarn run copy-dts",
"lint": "aegir lint --ts",
"lint:fix": "aegir lint --ts --fix",
"test": "aegir test --ts --node true",
"test:node": "aegir test -t node --ts",
"test:browser": "aegir test -t browser --node true --ts",
"lint": "aegir lint",
"lint:fix": "aegir lint --fix",
"test": "aegir ts -p check && aegir test",
"test:node": "aegir test -t node",
"test:browser": "aegir test -t browser",
"docs": "aegir docs",
"proto:gen": "pbjs -t static-module -o ./src/proto/payload.js ./src/proto/payload.proto && pbts -o ./src/proto/payload.d.ts ./src/proto/payload.js && yarn run lint --fix"
},
"aegir" :{
"node": true,
"tsRepo": true,
"docs": {
"entryPoint": "src/index.ts"
}
},
"devDependencies": {
"@types/bl": "^2.1.0",
"@types/chai": "^4.2.4",
"@types/mocha": "^5.2.7",
"aegir": "28.2.0",
"aegir": "ipfs/aegir#feat/ts-repo-support",
"benchmark": "^2.1.4",
"chai": "^4.2.0",
"copyfiles": "^2.4.1",
"eslint-config-ipfs": "^0.1.0",
"karma-mocha-webworker": "^1.3.0",
"microtime": "^3.0.0",
"mocha": "^8.2.1",
@ -65,7 +70,9 @@
"eslintConfig": {
"extends": "ipfs",
"rules": {
"@typescript-eslint/no-unused-vars": "error"
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/strict-boolean-expressions": "off"
},
"ignorePatterns": [
"src/proto/payload.js"

View File

@ -1,5 +1,8 @@
{
"compilerOptions": {
"outDir": "dist",
"incremental": true,
"composite": true,
"target": "ES2018",
"module": "commonjs",
"strict": true,
@ -14,6 +17,7 @@
]
},
"include": [
"**/test/**/*.ts",
"**/src/**/*.ts",
"**/src/**/*.js"
],

2678
yarn.lock

File diff suppressed because it is too large Load Diff