feat(cli): add build script and unify tests (#3369)
This commit is contained in:
parent
0c07c0ba4e
commit
f700f3427b
5 changed files with 23 additions and 15 deletions
0
cli/asdf
0
cli/asdf
|
@ -1,8 +0,0 @@
|
||||||
import type { Config } from 'jest';
|
|
||||||
|
|
||||||
const config: Config = {
|
|
||||||
preset: 'ts-jest',
|
|
||||||
setupFilesAfterEnv: ['jest-extended/all'],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
|
@ -40,10 +40,29 @@
|
||||||
"yaml": "^2.3.1"
|
"yaml": "^2.3.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"build": "tsc --project tsconfig.build.json",
|
||||||
"lint": "eslint \"src/**/*.ts\" --max-warnings 0",
|
"lint": "eslint \"src/**/*.ts\" --max-warnings 0",
|
||||||
"prepack": "yarn build ",
|
"prepack": "yarn build ",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test:cov": "jest --coverage",
|
"test:cov": "jest --coverage",
|
||||||
"format": "prettier --check ."
|
"format": "prettier --check ."
|
||||||
|
},
|
||||||
|
"jest": {
|
||||||
|
"clearMocks": true,
|
||||||
|
"moduleFileExtensions": [
|
||||||
|
"js",
|
||||||
|
"json",
|
||||||
|
"ts"
|
||||||
|
],
|
||||||
|
"rootDir": ".",
|
||||||
|
"testRegex": ".*\\.spec\\.ts$",
|
||||||
|
"transform": {
|
||||||
|
"^.+\\.ts$": "ts-jest"
|
||||||
|
},
|
||||||
|
"collectCoverageFrom": [
|
||||||
|
"<rootDir>/src/**/*.(t|j)s"
|
||||||
|
],
|
||||||
|
"coverageDirectory": "./coverage",
|
||||||
|
"testEnvironment": "node"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../tsconfig",
|
|
||||||
"compilerOptions": {
|
|
||||||
"noEmit": true
|
|
||||||
},
|
|
||||||
"references": [{ "path": ".." }]
|
|
||||||
}
|
|
4
cli/tsconfig.build.json
Normal file
4
cli/tsconfig.build.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"exclude": ["dist", "node_modules", "upload", "test", "**/*spec.ts"]
|
||||||
|
}
|
Loading…
Reference in a new issue