From ad35f54b8728a4a8a3f216bf1ba04dee58a7a37b Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Fri, 22 May 2020 02:14:28 -0400 Subject: [PATCH] Update tsconfig files and switch to _build for outputs, for consistency with main grist repo --- .gitignore | 2 +- app/client/tsconfig.json | 11 ++++------- app/common/tsconfig.json | 5 +---- app/server/tsconfig.json | 11 ++++------- app/tsconfig.json | 12 ++++++------ buildtools/tsconfig-base.json | 9 +++++++++ buildtools/webpack.config.js | 4 ++-- package.json | 6 +++--- tsconfig.json | 9 +++++++++ 9 files changed, 39 insertions(+), 30 deletions(-) create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index cc3bc291..78a58e0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /node_modules/ -/build/ +/_build/ /static/*.bundle.js /static/*.bundle.js.map diff --git a/app/client/tsconfig.json b/app/client/tsconfig.json index f29fd563..c789f31a 100644 --- a/app/client/tsconfig.json +++ b/app/client/tsconfig.json @@ -1,9 +1,6 @@ { - "extends": "../../buildtools/tsconfig-base.json", - "compilerOptions": { - "outDir": "../../build/app/client" - }, - "references": [ - { "path": "../common" } - ] + "extends": "../../buildtools/tsconfig-base.json", + "references": [ + { "path": "../common" } + ] } diff --git a/app/common/tsconfig.json b/app/common/tsconfig.json index 4e2e4df3..185bec10 100644 --- a/app/common/tsconfig.json +++ b/app/common/tsconfig.json @@ -1,6 +1,3 @@ { - "extends": "../../buildtools/tsconfig-base.json", - "compilerOptions": { - "outDir": "../../build/app/common", - } + "extends": "../../buildtools/tsconfig-base.json", } diff --git a/app/server/tsconfig.json b/app/server/tsconfig.json index b78eda59..c789f31a 100644 --- a/app/server/tsconfig.json +++ b/app/server/tsconfig.json @@ -1,9 +1,6 @@ { - "extends": "../../buildtools/tsconfig-base.json", - "compilerOptions": { - "outDir": "../../build/app/server", - }, - "references": [ - { "path": "../common" } - ] + "extends": "../../buildtools/tsconfig-base.json", + "references": [ + { "path": "../common" } + ] } diff --git a/app/tsconfig.json b/app/tsconfig.json index 978fc884..50c49b4d 100644 --- a/app/tsconfig.json +++ b/app/tsconfig.json @@ -1,9 +1,9 @@ { "files": [], - "include": [], - "references": [ - { "path": "./client" }, - { "path": "./server" }, - { "path": "./common" }, - ] + "include": [], + "references": [ + { "path": "./client" }, + { "path": "./server" }, + { "path": "./common" }, + ] } diff --git a/buildtools/tsconfig-base.json b/buildtools/tsconfig-base.json index cf65940a..d32557f9 100644 --- a/buildtools/tsconfig-base.json +++ b/buildtools/tsconfig-base.json @@ -8,7 +8,16 @@ "noImplicitAny": true, "noUnusedLocals": true, "moduleResolution": "node", + "allowJs": true, "baseUrl": "..", + "rootDir": "..", + "outDir": "../_build", + "paths": { + "*": [ + "*", + "grist-core/*", + ], + }, "composite": true, "plugins": [{ "name": "typescript-tslint-plugin" diff --git a/buildtools/webpack.config.js b/buildtools/webpack.config.js index 6f2eace6..3540cb13 100644 --- a/buildtools/webpack.config.js +++ b/buildtools/webpack.config.js @@ -7,7 +7,7 @@ const path = require('path'); module.exports = { target: 'web', entry: { - main: "./build/app/client/index.js", + main: "app/client/index.js", }, output: { filename: "[name].bundle.js", @@ -33,7 +33,7 @@ module.exports = { devtool: "source-map", resolve: { modules: [ - path.resolve('./build'), + path.resolve('./_build'), path.resolve('./node_modules') ], }, diff --git a/package.json b/package.json index 84ff265b..6d6fafb7 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "description": "", "main": "index.js", "scripts": { - "start": "tsc --build app -w --preserveWatchOutput & webpack --config buildtools/webpack.config.js --mode development --watch --hide-modules & nodemon -w build/app/server -w build/app/common build/app/server/server & wait", - "build:prod": "tsc --build app && webpack --config buildtools/webpack.config.js --mode production", - "start:prod": "node build/app/server/server" + "start": "tsc --build -w --preserveWatchOutput & webpack --config buildtools/webpack.config.js --mode development --watch --hide-modules & nodemon -w _build/app/server -w _build/app/common _build/app/server/server & wait", + "build:prod": "tsc --build && webpack --config buildtools/webpack.config.js --mode production", + "start:prod": "node _build/app/server/server" }, "keywords": [], "author": "", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..fc1cab4b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "./buildtools/tsconfig-base.json", + "files": [], + "include": [], + "references": [ + { "path": "./app" }, + // { "path": "./test" }, + ] +}