test(compiler): add a public API guard for the public compiler options (#35885)
This commit adds a public API test which guards against unintentional changes to the accepted keys in `angularCompilerOptions`. PR Close #35885
This commit is contained in:

committed by
Matias Niemelä

parent
edf881dbf1
commit
983f48136a
@ -66,7 +66,8 @@ ts_api_guardian_test(
|
||||
golden = "angular/tools/public_api_guard/global_utils.d.ts",
|
||||
)
|
||||
|
||||
# explicit target because the d.ts file is nested in the core and not part of typical public d.ts api
|
||||
# explicit target because the d.ts file is nested in the compiler and not part of typical public
|
||||
# d.ts api
|
||||
ts_api_guardian_test(
|
||||
name = "error_code_api",
|
||||
actual = "angular/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.d.ts",
|
||||
@ -76,3 +77,15 @@ ts_api_guardian_test(
|
||||
],
|
||||
golden = "angular/tools/public_api_guard/error_code.d.ts",
|
||||
)
|
||||
|
||||
# explicit target because the d.ts file is nested in the compiler and not part of typical public
|
||||
# d.ts api
|
||||
ts_api_guardian_test(
|
||||
name = "compiler_options_api",
|
||||
actual = "angular/packages/compiler-cli/src/ngtsc/core/api/src/public_options.d.ts",
|
||||
data = [
|
||||
":compiler_options.d.ts",
|
||||
"//packages/compiler-cli/src/ngtsc/core:api",
|
||||
],
|
||||
golden = "angular/tools/public_api_guard/compiler_options.d.ts",
|
||||
)
|
||||
|
43
tools/public_api_guard/compiler_options.d.ts
vendored
Normal file
43
tools/public_api_guard/compiler_options.d.ts
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
export interface BazelAndG3Options {
|
||||
annotateForClosureCompiler?: boolean;
|
||||
generateDeepReexports?: boolean;
|
||||
}
|
||||
|
||||
export interface I18nOptions {
|
||||
enableI18nLegacyMessageIdFormat?: boolean;
|
||||
i18nInLocale?: string;
|
||||
i18nUseExternalIds?: boolean;
|
||||
}
|
||||
|
||||
export interface LegacyNgcOptions {
|
||||
allowEmptyCodegenFiles?: boolean;
|
||||
flatModuleId?: string;
|
||||
flatModuleOutFile?: string;
|
||||
fullTemplateTypeCheck?: boolean;
|
||||
preserveWhitespaces?: boolean;
|
||||
strictInjectionParameters?: boolean;
|
||||
}
|
||||
|
||||
export interface MiscOptions {
|
||||
compileNonExportedClasses?: boolean;
|
||||
disableTypeScriptVersionCheck?: boolean;
|
||||
}
|
||||
|
||||
export interface NgcCompatibilityOptions {
|
||||
enableIvy?: boolean | 'ngtsc';
|
||||
generateNgFactoryShims?: boolean;
|
||||
generateNgSummaryShims?: boolean;
|
||||
}
|
||||
|
||||
export interface StrictTemplateOptions {
|
||||
strictAttributeTypes?: boolean;
|
||||
strictContextGenerics?: boolean;
|
||||
strictDomEventTypes?: boolean;
|
||||
strictDomLocalRefTypes?: boolean;
|
||||
strictInputTypes?: boolean;
|
||||
strictLiteralTypes?: boolean;
|
||||
strictNullInputTypes?: boolean;
|
||||
strictOutputEventTypes?: boolean;
|
||||
strictSafeNavigationTypes?: boolean;
|
||||
strictTemplates?: boolean;
|
||||
}
|
Reference in New Issue
Block a user