diff --git a/codegen/codegen.ts b/codegen/main.ts similarity index 100% rename from codegen/codegen.ts rename to codegen/main.ts diff --git a/codegen/tsconfig.json b/codegen/tsconfig.json new file mode 100644 index 0000000..31a52e6 --- /dev/null +++ b/codegen/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist" + } +} \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index aa20e1a..1a4b7dc 100644 --- a/jest.config.js +++ b/jest.config.js @@ -22,7 +22,7 @@ module.exports = { }, globals: { "ts-jest": { - tsConfigFile: "tsconfig.json", + tsConfigFile: "src/tsconfig.json", }, }, moduleFileExtensions: ["js", "json", "ts"], diff --git a/package.json b/package.json index 62f2072..595889a 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,14 @@ "version": "0.0.1", "license": "MIT", "scripts": { - "codegen": "ts-node codegen/codegen", - "compile": "tsc -p .", - "lint": "tslint -p tsconfig.json -c tslint.json '{src,codegen}/**/*.ts'", + "codegen": "npm-run-all -s compile:codegen node:codegen", + "compile:src": "tsc -p src", + "compile:codegen": "tsc -p codegen", + "lint": "tslint -p src/tsconfig.json -c tslint.json '{src,codegen}/**/*.ts'", "lint:fix": "yarn lint --fix", + "node:codegen": "ts-node codegen/main", "test": "jest --config jest.config.js", - "verify": "npm-run-all -s codegen compile lint test" + "verify": "npm-run-all -s codegen compile:src lint test" }, "devDependencies": { "@types/jest": "^22.2.3", diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 0000000..596f485 --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "declaration": true, + "outDir": "../dist" + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.base.json similarity index 82% rename from tsconfig.json rename to tsconfig.base.json index b5db826..4e8ae51 100644 --- a/tsconfig.json +++ b/tsconfig.base.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "declaration": true, "module": "commonjs", "moduleResolution": "node", "noFallthroughCasesInSwitch": true, @@ -9,18 +8,15 @@ "noImplicitThis": true, "noUnusedLocals": true, "noUnusedParameters": true, - "outDir": "./dist", "pretty": true, "removeComments": false, "sourceMap": true, "strict": true, - "stripInternal": true, "target": "es5", "lib": [ "es5", "es2015", "es2015.core" - ], - }, - + ] + } } \ No newline at end of file