-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add typescript compiler and use a separate folder as outdur
This change adds typescript compilation step to the polygerrit build rules. The compiler is used only to produce the final gr-app bundle and is not used in other parts (tests, local development). In this change, the compiler does almost nothing - it only copies .js files to the output directory and makes some minor checks in .js files. Additionally, in this change the .ts-out directory as added to the top level of gerrit project. This directory is used as output directory when typescript runs in IDE. It is not used in bazel. Change-Id: I494993fd2ec98df45f46126399c2ee98c8365a2e
- Loading branch information
1 parent
9a8951d
commit 897b58e
Showing
11 changed files
with
195 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,5 @@ | |
!/plugins/webhooks | ||
/test_site | ||
/tools/format | ||
/.ts-out/* | ||
!/.ts-out/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This directory contains compiled js code. Typescript uses subdirectories | ||
as output directories when runs under IDE. | ||
|
||
Bazel doesn't use this directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ dist | |
fonts | ||
bower_components | ||
.tmp | ||
.vscode | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"compilerOptions": { | ||
/* Basic Options */ | ||
"target": "es2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ | ||
"module": "es2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ | ||
"allowJs": true, /* Allow javascript files to be compiled. */ | ||
"checkJs": false, /* Report errors in .js files. */ | ||
"declaration": false, /* Temporary disabled - generates corresponding '.d.ts' file. */ | ||
"declarationMap": false, /* Generates a sourcemap for each corresponding '.d.ts' file. */ | ||
"sourceMap": true, /* Generates corresponding '.map' file. */ | ||
"outDir": "../../.ts-out/polygerrit-ui/app", /* Not used in bazel. Redirect output structure to the directory. */ | ||
"rootDir": ".", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ | ||
"removeComments": false, /* Emit comments to output*/ | ||
|
||
/* Strict Type-Checking Options */ | ||
"strict": true, /* Enable all strict type-checking options. */ | ||
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ | ||
"strictNullChecks": true, /* Enable strict null checks. */ | ||
"strictFunctionTypes": true, /* Enable strict checking of function types. */ | ||
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ | ||
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ | ||
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ | ||
|
||
/* Additional Checks */ | ||
"noUnusedLocals": true, /* Report errors on unused locals. */ | ||
"noUnusedParameters": true, /* Report errors on unused parameters. */ | ||
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ | ||
"noFallthroughCasesInSwitch": true,/* Report errors for fallthrough cases in switch statement. */ | ||
|
||
"skipLibCheck": true, /* Do not check node_modules */ | ||
|
||
/* Module Resolution Options */ | ||
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ | ||
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ | ||
"preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ | ||
|
||
/* Advanced Options */ | ||
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */ | ||
"incremental": true | ||
}, | ||
// With the * pattern (without an extension), only supported files | ||
// are included. The supported files are .ts, .tsx, .d.ts. | ||
// If allowJs is set to true, .js and .jsx files are included as well. | ||
// Note: gerrit doesn't have .tsx and .jsx files | ||
"include": [ | ||
// This items below must be in sync with the src_dirs list in the BUILD file | ||
"behaviors/**/*", | ||
"constants/**/*", | ||
"elements/**/*", | ||
"embed/**/*", | ||
"gr-diff/**/*", | ||
"samples/**/*", | ||
"scripts/**/*", | ||
"services/**/*", | ||
"styles/**/*", | ||
"types/**/*", | ||
"utils/**/*", | ||
// Directory for test utils (not included in src_dirs in the BUILD file) | ||
"test/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters