Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: tsconfig for editor warnings #3791

Merged
merged 2 commits into from
Mar 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TypeScript config that is used to build the e2e spec files. Protractor will use TS-Node to
// compile the e2e/ folder at runtime.
{
"compilerOptions": {
"declaration": true,
Expand Down
6 changes: 4 additions & 2 deletions src/demo-app/tsconfig-aot.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* Config file for the Angular Compiler. Paths need to be relative to the dist folder. */
// TypeScript config that extends the demo-app tsconfig file. This config compiles the
// "main-aot.ts" file and also enables templage code generation / AOT. All paths need
// to be relative to the output directory.
{
"extends": "./tsconfig",
"extends": "./tsconfig-build",
"compilerOptions": {
"experimentalDecorators": true,
"paths": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TypeScript config file that is used to compile the demo-app. Target environment will be ES5,
// since the demo-app will be served in the browser.
{
"compilerOptions": {
"declaration": false,
Expand Down
2 changes: 2 additions & 0 deletions src/e2e-app/tsconfig.json → src/e2e-app/tsconfig-build.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TypeScript config file that is used to compile the e2e-app. Protractor will run all specs
// against the e2e-app in the browser and therefore the code needs to be ES5 compatible.
{
"compilerOptions": {
"declaration": true,
Expand Down
2 changes: 2 additions & 0 deletions src/lib/tsconfig.json → src/lib/tsconfig-build.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TypeScript config file that is used to compile the library. Target environment needs to be
// ES2015 since the build process will create FESM bundles using rollup.
{
"compilerOptions": {
"baseUrl": ".",
Expand Down
5 changes: 4 additions & 1 deletion src/lib/tsconfig-specs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// TypeScript config file that extends the default tsconfig file for the library. This config is
// used to compile the specs for Karma. Since the code will run inside of the browser, the target
// needs to be ES5. The format needs to be CommonJS since Karma only supports that module format.
{
"extends": "./tsconfig",
"extends": "./tsconfig-build",
"compilerOptions": {
"module": "commonjs",
"target": "es5",
Expand Down
15 changes: 15 additions & 0 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// TypeScript config file that matches all source files in the project. This file is read by
// IDEs and ensures that `experimentalDecorator` warnings are not showing up.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're doing this, could you add a top-level comment to all of the tsconfig files that say what they're used for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

{
"compilerOptions": {
"experimentalDecorators": true,
"module": "es2015",
"moduleResolution": "node",
"outDir": "../../dist/packages/all",
"sourceMap": true,
"inlineSources": true,
"target": "es2015",
"lib": ["es2015", "dom"],
"types": ["jasmine"]
}
}
2 changes: 1 addition & 1 deletion tools/gulp/tasks/development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ task(':watch:devapp', () => {
});

/** Path to the demo-app tsconfig file. */
const tsconfigPath = join(appDir, 'tsconfig.json');
const tsconfigPath = join(appDir, 'tsconfig-build.json');

task(':build:devapp:ts', tsBuildTask(tsconfigPath));
task(':build:devapp:scss', sassBuildTask(outDir, appDir));
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const appDir = path.join(SOURCE_ROOT, 'e2e-app');
const outDir = DIST_E2EAPP;

const PROTRACTOR_CONFIG_PATH = path.join(PROJECT_ROOT, 'test/protractor.conf.js');
const tsconfigPath = path.join(appDir, 'tsconfig.json');
const tsconfigPath = path.join(appDir, 'tsconfig-build.json');

task(':watch:e2eapp', () => {
watch(path.join(appDir, '**/*.ts'), [':build:e2eapp:ts']);
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const inlineResources = require('../../../scripts/release/inline-resources');
const uglify = require('uglify-js');

const libraryRoot = join(SOURCE_ROOT, 'lib');
const tsconfigPath = join(libraryRoot, 'tsconfig.json');
const tsconfigPath = join(libraryRoot, 'tsconfig-build.json');

// Paths to the different output directories.
const materialDir = DIST_MATERIAL;
Expand Down
2 changes: 2 additions & 0 deletions tools/gulp/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TypeScript config file that will be used to compile the gulp tasks. The normal gulpfile will
// use TS-Node to compile the gulp tasks at runtime.
{
"compilerOptions": {
"experimentalDecorators": true,
Expand Down