From b86db21e9354c49b7efcf843ce8e00ea6e53db64 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 11 Aug 2020 17:13:22 +0100 Subject: [PATCH] [ACA-3593] fix library builds (#1593) * upgrade to solution style tsconfig * remove missing path * add e2e config to the solution * fix config path --- e2e/tsconfig.e2e.json | 12 +--- projects/aca-shared/tsconfig.lib.json | 2 +- projects/aca-shared/tsconfig.spec.json | 2 +- projects/aca-testing-shared/tsconfig.lib.json | 2 +- .../adf-office-services-ext/tsconfig.lib.json | 12 +--- .../tsconfig.spec.json | 16 ++--- scripts/run | 10 +-- src/tsconfig.app.json | 19 ++---- src/tsconfig.spec.json | 2 +- tsconfig.base.json | 36 ++++++++++ tsconfig.json | 65 +++++++++---------- 11 files changed, 94 insertions(+), 84 deletions(-) create mode 100644 tsconfig.base.json diff --git a/e2e/tsconfig.e2e.json b/e2e/tsconfig.e2e.json index 82725ab76..fcb3236c2 100755 --- a/e2e/tsconfig.e2e.json +++ b/e2e/tsconfig.e2e.json @@ -1,21 +1,15 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "../out-tsc/e2e", "baseUrl": "./", "module": "commonjs", "target": "es2017", - "types": [ - "jasmine", - "jasminewd2", - "node" - ], + "types": ["jasmine", "jasminewd2", "node"], "skipLibCheck": true, "paths": { "@alfresco/aca-testing-shared": ["../projects/aca-testing-shared"] } }, - "exclude": [ - "node_modules" - ] + "exclude": ["node_modules"] } diff --git a/projects/aca-shared/tsconfig.lib.json b/projects/aca-shared/tsconfig.lib.json index 231fa3c8d..5fac25aa4 100644 --- a/projects/aca-shared/tsconfig.lib.json +++ b/projects/aca-shared/tsconfig.lib.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "../../out-tsc/lib", "target": "es2015", diff --git a/projects/aca-shared/tsconfig.spec.json b/projects/aca-shared/tsconfig.spec.json index c1d29e83b..44c049f0f 100644 --- a/projects/aca-shared/tsconfig.spec.json +++ b/projects/aca-shared/tsconfig.spec.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "../../out-tsc/spec", "types": ["jasmine", "node"] diff --git a/projects/aca-testing-shared/tsconfig.lib.json b/projects/aca-testing-shared/tsconfig.lib.json index 3fd17214b..2de411763 100644 --- a/projects/aca-testing-shared/tsconfig.lib.json +++ b/projects/aca-testing-shared/tsconfig.lib.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "../../out-tsc/aca-testing", "target": "es2015", diff --git a/projects/adf-office-services-ext/tsconfig.lib.json b/projects/adf-office-services-ext/tsconfig.lib.json index a78ed73a8..11e4709b2 100644 --- a/projects/adf-office-services-ext/tsconfig.lib.json +++ b/projects/adf-office-services-ext/tsconfig.lib.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "../../out-tsc/lib", "target": "es2015", @@ -12,10 +12,7 @@ "experimentalDecorators": true, "importHelpers": true, "types": [], - "lib": [ - "dom", - "es2018" - ] + "lib": ["dom", "es2018"] }, "angularCompilerOptions": { "skipTemplateCodegen": true, @@ -24,8 +21,5 @@ "strictInjectionParameters": true, "enableResourceInlining": true }, - "exclude": [ - "src/test.ts", - "**/*.spec.ts" - ] + "exclude": ["src/test.ts", "**/*.spec.ts"] } diff --git a/projects/adf-office-services-ext/tsconfig.spec.json b/projects/adf-office-services-ext/tsconfig.spec.json index 16da33db0..483f7515b 100644 --- a/projects/adf-office-services-ext/tsconfig.spec.json +++ b/projects/adf-office-services-ext/tsconfig.spec.json @@ -1,17 +1,9 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "../../out-tsc/spec", - "types": [ - "jasmine", - "node" - ] + "types": ["jasmine", "node"] }, - "files": [ - "src/test.ts" - ], - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] + "files": ["src/test.ts"], + "include": ["**/*.spec.ts", "**/*.d.ts"] } diff --git a/scripts/run b/scripts/run index 67e62c76c..543153332 100755 --- a/scripts/run +++ b/scripts/run @@ -1,20 +1,20 @@ #!/usr/bin/env node const path = require('path'); -const tsConfigPath = path.resolve(__dirname, 'tsconfig.json'); +const tsConfigPath = path.resolve(__dirname, 'tsconfig.base.json'); const tsConfig = require(tsConfigPath); require('ts-node').register({ project: tsConfigPath }); require('tsconfig-paths').register({ - project: tsConfigPath, - baseUrl: path.resolve(__dirname), - paths: tsConfig.compilerOptions.paths + project: tsConfigPath, + baseUrl: path.resolve(__dirname), + paths: tsConfig.compilerOptions.paths }); const handlerParam = process.argv[2]; const RunnerClass = require(`./npm/${handlerParam}.ts`).default; -const runnerArgs = [ ...process.argv ]; +const runnerArgs = [...process.argv]; runnerArgs.splice(2, 1); const runner = new RunnerClass(runnerArgs); runner.run(); diff --git a/src/tsconfig.app.json b/src/tsconfig.app.json index 039ba35ab..057bc4b50 100644 --- a/src/tsconfig.app.json +++ b/src/tsconfig.app.json @@ -1,14 +1,9 @@ { - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/app", - "types": [] - }, - "files": [ - "main.ts", - "polyfills.ts" - ], - "include": [ - "src/**/*.d.ts" - ] + "extends": "../tsconfig.base.json", + "compilerOptions": { + "outDir": "../out-tsc/app", + "types": [] + }, + "files": ["main.ts", "polyfills.ts"], + "include": ["src/**/*.d.ts"] } diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json index 70add2d52..841d4a333 100644 --- a/src/tsconfig.spec.json +++ b/src/tsconfig.spec.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "../out-tsc/spec", "types": ["jasmine", "node"] diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 000000000..8b03693fa --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,36 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "downlevelIteration": true, + "importHelpers": true, + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "esnext", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "target": "es2015", + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "typeRoots": ["node_modules/@types"], + "lib": ["es2018", "dom"], + "paths": { + "@alfresco/aca-shared": ["projects/aca-shared/src/public-api.ts"], + "@alfresco/aca-shared/store": ["projects/aca-shared/store/src/public-api.ts"], + "@alfresco/aca-shared/rules": ["projects/aca-shared/rules/src/public-api.ts"], + "@alfresco/adf-office-services-ext": ["projects/adf-office-services-ext/src/public-api.ts"], + "@alfresco/aca-testing-shared": ["projects/aca-testing-shared"] + } + }, + "exclude": ["node_modules"], + "angularCompilerOptions": { + "preserveWhitespaces": false, + "fullTemplateTypeCheck": true, + "strictInjectionParameters": true + } +} diff --git a/tsconfig.json b/tsconfig.json index 8b03693fa..c5acdcfa5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,36 +1,35 @@ +/* + This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. + It is not intended to be used to perform a compilation. + + To learn more about this file see: https://angular.io/config/solution-tsconfig. +*/ { - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "downlevelIteration": true, - "importHelpers": true, - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "module": "esnext", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "target": "es2015", - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "typeRoots": ["node_modules/@types"], - "lib": ["es2018", "dom"], - "paths": { - "@alfresco/aca-shared": ["projects/aca-shared/src/public-api.ts"], - "@alfresco/aca-shared/store": ["projects/aca-shared/store/src/public-api.ts"], - "@alfresco/aca-shared/rules": ["projects/aca-shared/rules/src/public-api.ts"], - "@alfresco/adf-office-services-ext": ["projects/adf-office-services-ext/src/public-api.ts"], - "@alfresco/aca-testing-shared": ["projects/aca-testing-shared"] + "files": [], + "references": [ + { + "path": "./src/tsconfig.app.json" + }, + { + "path": "./src/tsconfig.spec.json" + }, + { + "path": "./e2e/tsconfig.e2e.json" + }, + { + "path": "./projects/aca-shared/tsconfig.lib.json" + }, + { + "path": "./projects/aca-shared/tsconfig.spec.json" + }, + { + "path": "./projects/aca-testing-shared/tsconfig.lib.json" + }, + { + "path": "./projects/adf-office-services-ext/tsconfig.lib.json" + }, + { + "path": "./projects/adf-office-services-ext/tsconfig.spec.json" } - }, - "exclude": ["node_modules"], - "angularCompilerOptions": { - "preserveWhitespaces": false, - "fullTemplateTypeCheck": true, - "strictInjectionParameters": true - } + ] }