Skip to content

Allow emit related options in build mode #50814

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

Closed
wants to merge 2 commits into from
Closed
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
242 changes: 126 additions & 116 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,132 @@ namespace ts {
description: Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit,
defaultValueDescription: Diagnostics.Platform_specific
},
{
name: "declarationMap",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
showInSimplifiedHelpView: true,
category: Diagnostics.Emit,
transpileOptionValue: undefined,
defaultValueDescription: false,
description: Diagnostics.Create_sourcemaps_for_d_ts_files
},
{
name: "emitBOM",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
description: Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
defaultValueDescription: false,
},
{
name: "emitDeclarationOnly",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
showInSimplifiedHelpView: true,

category: Diagnostics.Emit,
description: Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
transpileOptionValue: undefined,
defaultValueDescription: false,
},
{
name: "emitDecoratorMetadata",
type: "boolean",
affectsSemanticDiagnostics: true,
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Language_and_Environment,
description: Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
defaultValueDescription: false,
},
{
name: "importHelpers",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
defaultValueDescription: false,
},
{
name: "inlineSourceMap",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
description: Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
defaultValueDescription: false,
},
{
name: "inlineSources",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
description: Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
defaultValueDescription: false,
},
{
name: "noEmitOnError",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
transpileOptionValue: undefined,
description: Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
defaultValueDescription: false,
},
{
name: "removeComments",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
showInSimplifiedHelpView: true,
category: Diagnostics.Emit,
defaultValueDescription: false,
description: Diagnostics.Disable_emitting_comments,
},
{
name: "skipDefaultLibCheck",
type: "boolean",
// We need to store these to determine whether `lib` files need to be rechecked
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Completeness,
description: Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
defaultValueDescription: false,
},
{
name: "skipLibCheck",
type: "boolean",
// We need to store these to determine whether `lib` files need to be rechecked
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Completeness,
description: Diagnostics.Skip_type_checking_all_d_ts_files,
defaultValueDescription: false,
},
{
name: "sourceMap",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
showInSimplifiedHelpView: true,
category: Diagnostics.Emit,
defaultValueDescription: false,
description: Diagnostics.Create_source_map_files_for_emitted_JavaScript_files,
},
{
name: "stripInternal",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
description: Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
defaultValueDescription: false,
},
];

/* @internal */
Expand Down Expand Up @@ -503,39 +629,6 @@ namespace ts {
description: Diagnostics.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project,
defaultValueDescription: Diagnostics.false_unless_composite_is_set,
},
{
name: "declarationMap",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
showInSimplifiedHelpView: true,
category: Diagnostics.Emit,
transpileOptionValue: undefined,
defaultValueDescription: false,
description: Diagnostics.Create_sourcemaps_for_d_ts_files
},
{
name: "emitDeclarationOnly",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
showInSimplifiedHelpView: true,

category: Diagnostics.Emit,
description: Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
transpileOptionValue: undefined,
defaultValueDescription: false,
},
{
name: "sourceMap",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
showInSimplifiedHelpView: true,
category: Diagnostics.Emit,
defaultValueDescription: false,
description: Diagnostics.Create_source_map_files_for_emitted_JavaScript_files,
},
{
name: "outFile",
type: "string",
Expand Down Expand Up @@ -618,15 +711,6 @@ namespace ts {
transpileOptionValue: undefined,
defaultValueDescription: false,
},
{
name: "importHelpers",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
defaultValueDescription: false,
},
{
name: "importsNotUsedAsValues",
type: new Map(getEntries({
Expand Down Expand Up @@ -975,24 +1059,6 @@ namespace ts {
category: Diagnostics.Emit,
description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,
},
{
name: "inlineSourceMap",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
description: Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
defaultValueDescription: false,
},
{
name: "inlineSources",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
description: Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
defaultValueDescription: false,
},

// Experimental
{
Expand All @@ -1004,16 +1070,6 @@ namespace ts {
description: Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
defaultValueDescription: false,
},
{
name: "emitDecoratorMetadata",
type: "boolean",
affectsSemanticDiagnostics: true,
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Language_and_Environment,
description: Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
defaultValueDescription: false,
},

// Advanced
{
Expand Down Expand Up @@ -1073,31 +1129,13 @@ namespace ts {
description: Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,
defaultValueDescription: "`React`",
},
{
name: "skipDefaultLibCheck",
type: "boolean",
// We need to store these to determine whether `lib` files need to be rechecked
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Completeness,
description: Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
defaultValueDescription: false,
},
{
name: "charset",
type: "string",
category: Diagnostics.Backwards_Compatibility,
description: Diagnostics.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files,
defaultValueDescription: "utf8"
},
{
name: "emitBOM",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
description: Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
defaultValueDescription: false,
},
{
name: "newLine",
type: new Map(getEntries({
Expand Down Expand Up @@ -1142,15 +1180,6 @@ namespace ts {
transpileOptionValue: true,
defaultValueDescription: false,
},
{
name: "stripInternal",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
description: Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
defaultValueDescription: false,
},
{
name: "disableSizeLimit",
type: "boolean",
Expand Down Expand Up @@ -1201,16 +1230,6 @@ namespace ts {
description: Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
defaultValueDescription: false,
},
{
name: "noEmitOnError",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
transpileOptionValue: undefined,
description: Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
defaultValueDescription: false,
},
{
name: "preserveConstEnums",
type: "boolean",
Expand All @@ -1232,15 +1251,6 @@ namespace ts {
transpileOptionValue: undefined,
description: Diagnostics.Specify_the_output_directory_for_generated_declaration_files,
},
{
name: "skipLibCheck",
type: "boolean",
// We need to store these to determine whether `lib` files need to be rechecked
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Completeness,
description: Diagnostics.Skip_type_checking_all_d_ts_files,
defaultValueDescription: false,
},
{
name: "allowUnusedLabels",
type: "boolean",
Expand Down
13 changes: 13 additions & 0 deletions src/compiler/tsbuildPublic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ namespace ts {
/*@internal*/ pretty?: boolean;
incremental?: boolean;
assumeChangesOnlyAffectDirectDependencies?: boolean;
declarationMap?: boolean;
emitBOM?: boolean;
emitDeclarationOnly?: boolean;
emitDecoratorMetadata?: boolean;
importHelpers?: boolean;
inlineSourceMap?: boolean;
inlineSources?: boolean;
noEmitOnError?: boolean;
removeComments?: boolean;
skipDefaultLibCheck?: boolean;
skipLibCheck?: boolean;
sourceMap?: boolean;
stripInternal?: boolean;

traceResolution?: boolean;
/* @internal */ diagnostics?: boolean;
Expand Down
13 changes: 13 additions & 0 deletions tests/baselines/reference/api/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5522,6 +5522,19 @@ declare namespace ts {
verbose?: boolean;
incremental?: boolean;
assumeChangesOnlyAffectDirectDependencies?: boolean;
declarationMap?: boolean;
emitBOM?: boolean;
emitDeclarationOnly?: boolean;
emitDecoratorMetadata?: boolean;
importHelpers?: boolean;
inlineSourceMap?: boolean;
inlineSources?: boolean;
noEmitOnError?: boolean;
removeComments?: boolean;
skipDefaultLibCheck?: boolean;
skipLibCheck?: boolean;
sourceMap?: boolean;
stripInternal?: boolean;
traceResolution?: boolean;
[option: string]: CompilerOptionsValue | undefined;
}
Expand Down
13 changes: 13 additions & 0 deletions tests/baselines/reference/api/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5522,6 +5522,19 @@ declare namespace ts {
verbose?: boolean;
incremental?: boolean;
assumeChangesOnlyAffectDirectDependencies?: boolean;
declarationMap?: boolean;
emitBOM?: boolean;
emitDeclarationOnly?: boolean;
emitDecoratorMetadata?: boolean;
importHelpers?: boolean;
inlineSourceMap?: boolean;
inlineSources?: boolean;
noEmitOnError?: boolean;
removeComments?: boolean;
skipDefaultLibCheck?: boolean;
skipLibCheck?: boolean;
sourceMap?: boolean;
stripInternal?: boolean;
traceResolution?: boolean;
[option: string]: CompilerOptionsValue | undefined;
}
Expand Down
Loading