diff --git a/generators/app/playground.js b/generators/app/playground.js index 115f00f..5dad9da 100644 --- a/generators/app/playground.js +++ b/generators/app/playground.js @@ -32,9 +32,12 @@ const setupPlayground = } ); - generator.fs.copy( - generator.templatePath('playground/tsconfig.json'), - generator.destinationPath('playground/tsconfig.json') + generator.fs.copyTpl( + generator.templatePath('playground/_tsconfig.json'), + generator.destinationPath('playground/tsconfig.json'), + { + props: generator.props + } ); generator.fs.copy( diff --git a/generators/app/templates/_package.json b/generators/app/templates/_package.json index c3fef02..e8799c0 100644 --- a/generators/app/templates/_package.json +++ b/generators/app/templates/_package.json @@ -8,8 +8,10 @@ "docs:build": "compodoc -p tsconfig.json -n <%= props.libraryName.original %> -d docs --hideGenerator", "docs:serve": "npm run docs:build -- -s", "docs:watch": "npm run docs:build -- -s -w", - "lint": "tslint --type-check --project tsconfig.json src/**/*.ts", + "lint:lib": "tslint --type-check --project tsconfig.json", + "lint": "npm run lint:lib && npm run playground:lint", "lite": "lite-server", + "playground:lint": "npm run build && tslint --type-check --project playground/tsconfig.json", "playground:build": "tsc -p playground -w", "playground": "concurrently \"npm run build:watch\" \"npm run playground:build\" \"npm run lite\"", "test": "tsc && karma start" diff --git a/generators/app/templates/_tsconfig.json b/generators/app/templates/_tsconfig.json index 5a61547..2169f76 100644 --- a/generators/app/templates/_tsconfig.json +++ b/generators/app/templates/_tsconfig.json @@ -9,6 +9,12 @@ "dom" ], "skipLibCheck": true, - "types": [] - } + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "playground" + ] } diff --git a/generators/app/templates/playground/tsconfig.json b/generators/app/templates/playground/_tsconfig.json similarity index 67% rename from generators/app/templates/playground/tsconfig.json rename to generators/app/templates/playground/_tsconfig.json index 27660b8..fa05759 100644 --- a/generators/app/templates/playground/tsconfig.json +++ b/generators/app/templates/playground/_tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "baseUrl": ".", "outDir": "../.playground", "target": "es5", "module": "commonjs", @@ -9,6 +10,9 @@ "experimentalDecorators": true, "lib": [ "es2015", "dom" ], "noImplicitAny": true, - "suppressImplicitAnyIndexErrors": true + "suppressImplicitAnyIndexErrors": true, + "paths": { + "<%= props.libraryName.kebabCase %>": ["../dist/index.d.ts"] + } } }