Skip to content

New command line help developer experience. #44157

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

Merged
merged 28 commits into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
399e0a0
refactor help CLI output.
ShuiRuTian May 19, 2021
26848b9
fix typo and omit false condition boolean output.
ShuiRuTian May 20, 2021
c8ddf1a
fix typo
ShuiRuTian May 20, 2021
7dae10b
add line break
ShuiRuTian May 20, 2021
418dc83
add --plugins option to basic option category.
ShuiRuTian May 22, 2021
43090a4
Merge branch 'refactor-help-output' of https://github.com/ShuiRuTian/…
ShuiRuTian May 22, 2021
d7df681
add ts icon and remove old print help function.
ShuiRuTian May 22, 2021
0847b23
better command description for --jsx.
ShuiRuTian May 22, 2021
2203137
Fix test
ShuiRuTian May 23, 2021
9e2ba00
fix lint
ShuiRuTian May 23, 2021
9d33edf
Merge branch 'master' into refactor-help-output
ShuiRuTian May 23, 2021
33baa84
Improvements to the UX
orta May 28, 2021
970f86e
Fix tests
orta May 28, 2021
dd27367
fix test.
ShuiRuTian Jun 3, 2021
3b767bc
Merge branch 'main' into refactor-help-output
ShuiRuTian Jun 3, 2021
b2045e3
add missing help out.
ShuiRuTian Jun 3, 2021
ae87113
use environemnt variable to control test case.
ShuiRuTian Jun 3, 2021
b37fd7e
Merge branch 'main' into refactor-help-output
ShuiRuTian Jun 3, 2021
11fd524
fix merge issues.
ShuiRuTian Jun 3, 2021
36dd59d
No `No Category`
ShuiRuTian Jun 3, 2021
983d2e5
Merge branch 'main' into refactor-help-output
ShuiRuTian Jun 4, 2021
fa88df1
make getWidthOfTerminal optional.
ShuiRuTian Jun 5, 2021
e30eba1
fix test
ShuiRuTian Jun 5, 2021
d319a8b
fix review.
ShuiRuTian Jun 8, 2021
fef9f9f
fix review.
ShuiRuTian Jun 8, 2021
36de5ff
Update baselines
orta Jun 9, 2021
d7981c7
Merge
orta Jun 9, 2021
5e2ef70
Update with main
orta Jun 15, 2021
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
219 changes: 143 additions & 76 deletions src/compiler/commandLineParser.ts

Large diffs are not rendered by default.

127 changes: 124 additions & 3 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4031,11 +4031,11 @@
"category": "Message",
"code": 6014
},
"Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'.": {
"Specify ECMAScript target version.": {
"category": "Message",
"code": 6015
},
"Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'.": {
"Specify module code generation.": {
"category": "Message",
"code": 6016
},
Expand Down Expand Up @@ -4243,7 +4243,7 @@
"category": "Message",
"code": 6079
},
"Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'.": {
"Specify JSX code generation.": {
"category": "Message",
"code": 6080
},
Expand Down Expand Up @@ -5638,6 +5638,127 @@
"code": 6803
},

"one of:": {
"category": "Message",
"code": 6900
},
"one or more:": {
"category": "Message",
"code": 6901
},
"type:": {
"category": "Message",
"code": 6902
},
"default:": {
"category": "Message",
"code": 6903
},
"module === \"system\" or esModuleInterop": {
"category": "Message",
"code": 6904
},
"`false`, unless `strict` is set": {
"category": "Message",
"code": 6905
},
"`false`, unless `composite` is set": {
"category": "Message",
"code": 6906
},
"`[\"node_modules\", \"bower_components\", \"jspm_packages\"]`, plus the value of `outDir` if one is specified.": {
"category": "Message",
"code": 6907
},
"`[]` if `files` is specified, otherwise `[\"**/*\"]`": {
"category": "Message",
"code": 6908
},
"`true` if `composite`, `false` otherwise": {
"category": "Message",
"code": 6909
},
"module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`": {
"category": "Message",
"code": 69010
},
"Computed from the list of input files": {
"category": "Message",
"code": 6911
},
"Platform specific": {
"category": "Message",
"code": 6912
},
"You can learn about all of the compiler options at {0}": {
"category": "Message",
"code": 6913
},
"Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:": {
"category": "Message",
"code": 6914
},
"Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}": {
"category": "Message",
"code": 6915
},
"COMMON COMMANDS": {
"category": "Message",
"code": 6916
},
"ALL COMPILER OPTIONS": {
"category": "Message",
"code": 6917
},
"WATCH OPTIONS": {
"category": "Message",
"code": 6918
},
"BUILD OPTIONS": {
"category": "Message",
"code": 6919
},
"COMMON COMPILER OPTIONS": {
"category": "Message",
"code": 6920
},
"COMMAND LINE FLAGS": {
"category": "Message",
"code": 6921
},
"tsc: The TypeScript Compiler": {
"category": "Message",
"code": 6922
},
"Compiles the current project (tsconfig.json in the working directory.)": {
"category": "Message",
"code": 6923
},
"Ignoring tsconfig.json, compiles the specified files with default compiler options": {
"category": "Message",
"code": 6924
},
"Build a composite project in the working directory.": {
"category": "Message",
"code": 6925
},
"Creates a tsconfig.json with the recommended settings in the working directory.": {
"category": "Message",
"code": 6926
},
"Compiles the TypeScript project located at the specified path": {
"category": "Message",
"code": 6927
},
"An expanded version of this information, showing all possible compiler options": {
"category": "Message",
"code": 6928
},
"Compiles the current project, with additional settings": {
"category": "Message",
"code": 6929
},

"Variable '{0}' implicitly has an '{1}' type.": {
"category": "Error",
"code": 7005
Expand Down
4 changes: 4 additions & 0 deletions src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,7 @@ namespace ts {
useCaseSensitiveFileNames: boolean;
write(s: string): void;
writeOutputIsTTY?(): boolean;
getWidthOfTerminal?(): number;
readFile(path: string, encoding?: string): string | undefined;
getFileSize?(path: string): number;
writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
Expand Down Expand Up @@ -1308,6 +1309,9 @@ namespace ts {
write(s: string): void {
process.stdout.write(s);
},
getWidthOfTerminal(){
return process.stdout.columns;
},
writeOutputIsTTY() {
return process.stdout.isTTY;
},
Expand Down
3 changes: 2 additions & 1 deletion src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6224,7 +6224,8 @@ namespace ts {
type: "string" | "number" | "boolean" | "object" | "list" | ESMap<string, number | string>; // a value of a primitive type, or an object literal mapping named values to actual values
isFilePath?: boolean; // True if option value is a path or fileName
shortName?: string; // A short mnemonic for convenience - for instance, 'h' can be used in place of 'help'
description?: DiagnosticMessage; // The message describing what the command line switch does
description?: DiagnosticMessage; // The message describing what the command line switch does.
defaultValueDescription?: string | DiagnosticMessage; // The message describing what the dafault value is. string type is prepared for fixed chosen like "false" which do not need I18n.
paramType?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter
isTSConfigOnly?: boolean; // True if option can only be specified via tsconfig.json file
isCommandLineOnly?: boolean;
Expand Down
Loading