diff --git a/goldens/public-api/animations/browser/browser.md b/goldens/public-api/animations/browser/index.md similarity index 100% rename from goldens/public-api/animations/browser/browser.md rename to goldens/public-api/animations/browser/index.md diff --git a/goldens/public-api/animations/browser/testing/testing.md b/goldens/public-api/animations/browser/testing/index.md similarity index 100% rename from goldens/public-api/animations/browser/testing/testing.md rename to goldens/public-api/animations/browser/testing/index.md diff --git a/goldens/public-api/animations/animations.md b/goldens/public-api/animations/index.md similarity index 100% rename from goldens/public-api/animations/animations.md rename to goldens/public-api/animations/index.md diff --git a/goldens/public-api/common/http/http.md b/goldens/public-api/common/http/index.md similarity index 100% rename from goldens/public-api/common/http/http.md rename to goldens/public-api/common/http/index.md diff --git a/goldens/public-api/common/http/testing/testing.md b/goldens/public-api/common/http/testing/index.md similarity index 100% rename from goldens/public-api/common/http/testing/testing.md rename to goldens/public-api/common/http/testing/index.md diff --git a/goldens/public-api/common/common.md b/goldens/public-api/common/index.md similarity index 100% rename from goldens/public-api/common/common.md rename to goldens/public-api/common/index.md diff --git a/goldens/public-api/common/testing/testing.md b/goldens/public-api/common/testing/index.md similarity index 100% rename from goldens/public-api/common/testing/testing.md rename to goldens/public-api/common/testing/index.md diff --git a/goldens/public-api/common/upgrade/upgrade.md b/goldens/public-api/common/upgrade/index.md similarity index 100% rename from goldens/public-api/common/upgrade/upgrade.md rename to goldens/public-api/common/upgrade/index.md diff --git a/goldens/public-api/core/core.md b/goldens/public-api/core/index.md similarity index 100% rename from goldens/public-api/core/core.md rename to goldens/public-api/core/index.md diff --git a/goldens/public-api/core/testing/testing.md b/goldens/public-api/core/testing/index.md similarity index 100% rename from goldens/public-api/core/testing/testing.md rename to goldens/public-api/core/testing/index.md diff --git a/goldens/public-api/elements/elements.md b/goldens/public-api/elements/index.md similarity index 99% rename from goldens/public-api/elements/elements.md rename to goldens/public-api/elements/index.md index 66ac31d9cae..a2c5822f78b 100644 --- a/goldens/public-api/elements/elements.md +++ b/goldens/public-api/elements/index.md @@ -69,7 +69,6 @@ export type WithProperties

= { [property in keyof P]: P[property]; }; - // (No @packageDocumentation comment for this package) ``` diff --git a/goldens/public-api/forms/forms.md b/goldens/public-api/forms/index.md similarity index 100% rename from goldens/public-api/forms/forms.md rename to goldens/public-api/forms/index.md diff --git a/goldens/public-api/localize/tools/index.md b/goldens/public-api/localize/tools/index.md new file mode 100644 index 00000000000..9d6c0345523 --- /dev/null +++ b/goldens/public-api/localize/tools/index.md @@ -0,0 +1,183 @@ +## API Report File for "@angular/localize_tools" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AbsoluteFsPath } from '@angular/compiler-cli/private/localize'; +import * as _babelNamespace from '@babel/core'; +import { Element as Element_2 } from '@angular/compiler'; +import { Logger } from '@angular/compiler-cli/private/localize'; +import { NodePath } from '@babel/traverse'; +import { ParseError } from '@angular/compiler'; +import { PathManipulation } from '@angular/compiler-cli/private/localize'; +import { ReadonlyFileSystem } from '@angular/compiler-cli/private/localize'; +import * as t from '@babel/types'; +import { ɵMessageId } from '@angular/localize'; +import { ɵParsedMessage } from '@angular/localize'; +import { ɵParsedTranslation } from '@angular/localize'; +import { ɵSourceLocation } from '@angular/localize'; +import { ɵSourceMessage } from '@angular/localize'; + +// @public +export class ArbTranslationParser implements TranslationParser { + // (undocumented) + analyze(_filePath: string, contents: string): ParseAnalysis; + // @deprecated (undocumented) + canParse(filePath: string, contents: string): ArbJsonObject | false; + // (undocumented) + parse(_filePath: string, contents: string, arb?: ArbJsonObject): ParsedTranslationBundle; +} + +// @public +export class ArbTranslationSerializer implements TranslationSerializer { + constructor(sourceLocale: string, basePath: AbsoluteFsPath, fs: PathManipulation); + // (undocumented) + serialize(messages: ɵParsedMessage[]): string; +} + +// @public +export function buildLocalizeReplacement(messageParts: TemplateStringsArray, substitutions: readonly t.Expression[]): t.Expression; + +// @public +export function checkDuplicateMessages(fs: PathManipulation, messages: ɵParsedMessage[], duplicateMessageHandling: DiagnosticHandlingStrategy, basePath: AbsoluteFsPath): Diagnostics; + +// @public +export type DiagnosticHandlingStrategy = 'error' | 'warning' | 'ignore'; + +// @public +export class Diagnostics { + // (undocumented) + add(type: DiagnosticHandlingStrategy, message: string): void; + // (undocumented) + error(message: string): void; + // (undocumented) + formatDiagnostics(message: string): string; + // (undocumented) + get hasErrors(): boolean; + // (undocumented) + merge(other: Diagnostics): void; + // (undocumented) + readonly messages: { + type: 'warning' | 'error'; + message: string; + }[]; + // (undocumented) + warn(message: string): void; +} + +// @public +export function isGlobalIdentifier(identifier: NodePath): boolean; + +// @public +export class LegacyMessageIdMigrationSerializer implements TranslationSerializer { + constructor(_diagnostics: Diagnostics); + // (undocumented) + serialize(messages: ɵParsedMessage[]): string; +} + +// @public +export function makeEs2015TranslatePlugin(diagnostics: Diagnostics, translations: Record, { missingTranslation, localizeName }?: TranslatePluginOptions, fs?: PathManipulation): PluginObj; + +// @public +export function makeEs5TranslatePlugin(diagnostics: Diagnostics, translations: Record, { missingTranslation, localizeName }?: TranslatePluginOptions, fs?: PathManipulation): PluginObj; + +// @public +export function makeLocalePlugin(locale: string, { localizeName }?: TranslatePluginOptions): PluginObj; + +// @public +export class MessageExtractor { + constructor(fs: ReadonlyFileSystem, logger: Logger, { basePath, useSourceMaps, localizeName }: ExtractionOptions); + // (undocumented) + extractMessages(filename: string): ɵParsedMessage[]; +} + +// @public +export class SimpleJsonTranslationParser implements TranslationParser { + // (undocumented) + analyze(filePath: string, contents: string): ParseAnalysis; + // @deprecated (undocumented) + canParse(filePath: string, contents: string): SimpleJsonFile | false; + // (undocumented) + parse(_filePath: string, contents: string, json?: SimpleJsonFile): ParsedTranslationBundle; +} + +// @public +export class SimpleJsonTranslationSerializer implements TranslationSerializer { + constructor(sourceLocale: string); + // (undocumented) + serialize(messages: ɵParsedMessage[]): string; +} + +// @public +export function translate(diagnostics: Diagnostics, translations: Record, messageParts: TemplateStringsArray, substitutions: readonly any[], missingTranslation: DiagnosticHandlingStrategy): [TemplateStringsArray, readonly any[]]; + +// @public +export function unwrapExpressionsFromTemplateLiteral(quasi: NodePath, fs?: PathManipulation): [t.Expression[], (ɵSourceLocation | undefined)[]]; + +// @public +export function unwrapMessagePartsFromLocalizeCall(call: NodePath, fs?: PathManipulation): [TemplateStringsArray, (ɵSourceLocation | undefined)[]]; + +// @public +export function unwrapMessagePartsFromTemplateLiteral(elements: NodePath[], fs?: PathManipulation): [ +TemplateStringsArray, +(ɵSourceLocation | undefined)[] +]; + +// @public +export function unwrapSubstitutionsFromLocalizeCall(call: NodePath, fs?: PathManipulation): [t.Expression[], (ɵSourceLocation | undefined)[]]; + +// @public +export class Xliff1TranslationParser implements TranslationParser { + // (undocumented) + analyze(filePath: string, contents: string): ParseAnalysis; + // @deprecated (undocumented) + canParse(filePath: string, contents: string): XmlTranslationParserHint | false; + // (undocumented) + parse(filePath: string, contents: string, hint?: XmlTranslationParserHint): ParsedTranslationBundle; +} + +// @public +export class Xliff1TranslationSerializer implements TranslationSerializer { + constructor(sourceLocale: string, basePath: AbsoluteFsPath, useLegacyIds: boolean, formatOptions?: FormatOptions, fs?: PathManipulation); + // (undocumented) + serialize(messages: ɵParsedMessage[]): string; +} + +// @public +export class Xliff2TranslationParser implements TranslationParser { + // (undocumented) + analyze(filePath: string, contents: string): ParseAnalysis; + // @deprecated (undocumented) + canParse(filePath: string, contents: string): XmlTranslationParserHint | false; + // (undocumented) + parse(filePath: string, contents: string, hint?: XmlTranslationParserHint): ParsedTranslationBundle; +} + +// @public +export class Xliff2TranslationSerializer implements TranslationSerializer { + constructor(sourceLocale: string, basePath: AbsoluteFsPath, useLegacyIds: boolean, formatOptions?: FormatOptions, fs?: PathManipulation); + // (undocumented) + serialize(messages: ɵParsedMessage[]): string; +} + +// @public +export class XmbTranslationSerializer implements TranslationSerializer { + constructor(basePath: AbsoluteFsPath, useLegacyIds: boolean, fs?: PathManipulation); + // (undocumented) + serialize(messages: ɵParsedMessage[]): string; +} + +// @public +export class XtbTranslationParser implements TranslationParser { + // (undocumented) + analyze(filePath: string, contents: string): ParseAnalysis; + // @deprecated (undocumented) + canParse(filePath: string, contents: string): XmlTranslationParserHint | false; + // (undocumented) + parse(filePath: string, contents: string, hint?: XmlTranslationParserHint): ParsedTranslationBundle; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/goldens/public-api/platform-browser-dynamic/platform-browser-dynamic.md b/goldens/public-api/platform-browser-dynamic/index.md similarity index 100% rename from goldens/public-api/platform-browser-dynamic/platform-browser-dynamic.md rename to goldens/public-api/platform-browser-dynamic/index.md diff --git a/goldens/public-api/platform-browser-dynamic/testing/testing.md b/goldens/public-api/platform-browser-dynamic/testing/index.md similarity index 100% rename from goldens/public-api/platform-browser-dynamic/testing/testing.md rename to goldens/public-api/platform-browser-dynamic/testing/index.md diff --git a/goldens/public-api/platform-browser/animations/animations.md b/goldens/public-api/platform-browser/animations/index.md similarity index 100% rename from goldens/public-api/platform-browser/animations/animations.md rename to goldens/public-api/platform-browser/animations/index.md diff --git a/goldens/public-api/platform-browser/platform-browser.md b/goldens/public-api/platform-browser/index.md similarity index 100% rename from goldens/public-api/platform-browser/platform-browser.md rename to goldens/public-api/platform-browser/index.md diff --git a/goldens/public-api/platform-browser/testing/testing.md b/goldens/public-api/platform-browser/testing/index.md similarity index 100% rename from goldens/public-api/platform-browser/testing/testing.md rename to goldens/public-api/platform-browser/testing/index.md diff --git a/goldens/public-api/platform-server/platform-server.md b/goldens/public-api/platform-server/index.md similarity index 100% rename from goldens/public-api/platform-server/platform-server.md rename to goldens/public-api/platform-server/index.md diff --git a/goldens/public-api/platform-server/init/init.md b/goldens/public-api/platform-server/init/index.md similarity index 99% rename from goldens/public-api/platform-server/init/init.md rename to goldens/public-api/platform-server/init/index.md index 03c40608bb4..c1608a873d2 100644 --- a/goldens/public-api/platform-server/init/init.md +++ b/goldens/public-api/platform-server/init/index.md @@ -4,7 +4,6 @@ ```ts - // (No @packageDocumentation comment for this package) ``` diff --git a/goldens/public-api/platform-server/testing/testing.md b/goldens/public-api/platform-server/testing/index.md similarity index 100% rename from goldens/public-api/platform-server/testing/testing.md rename to goldens/public-api/platform-server/testing/index.md diff --git a/goldens/public-api/router/router.md b/goldens/public-api/router/index.md similarity index 100% rename from goldens/public-api/router/router.md rename to goldens/public-api/router/index.md diff --git a/goldens/public-api/router/testing/testing.md b/goldens/public-api/router/testing/index.md similarity index 100% rename from goldens/public-api/router/testing/testing.md rename to goldens/public-api/router/testing/index.md diff --git a/goldens/public-api/router/upgrade/upgrade.md b/goldens/public-api/router/upgrade/index.md similarity index 99% rename from goldens/public-api/router/upgrade/upgrade.md rename to goldens/public-api/router/upgrade/index.md index 8b7522abbfe..f052443c781 100644 --- a/goldens/public-api/router/upgrade/upgrade.md +++ b/goldens/public-api/router/upgrade/index.md @@ -19,7 +19,6 @@ export const RouterUpgradeInitializer: { // @public export function setUpLocationSync(ngUpgrade: UpgradeModule, urlType?: 'path' | 'hash'): void; - // (No @packageDocumentation comment for this package) ``` diff --git a/goldens/public-api/service-worker/config/config.md b/goldens/public-api/service-worker/config/index.md similarity index 100% rename from goldens/public-api/service-worker/config/config.md rename to goldens/public-api/service-worker/config/index.md diff --git a/goldens/public-api/service-worker/service-worker.md b/goldens/public-api/service-worker/index.md similarity index 100% rename from goldens/public-api/service-worker/service-worker.md rename to goldens/public-api/service-worker/index.md diff --git a/goldens/public-api/upgrade/upgrade.md b/goldens/public-api/upgrade/index.md similarity index 99% rename from goldens/public-api/upgrade/upgrade.md rename to goldens/public-api/upgrade/index.md index e3d0a9dfbbd..bc44961e612 100644 --- a/goldens/public-api/upgrade/upgrade.md +++ b/goldens/public-api/upgrade/index.md @@ -40,7 +40,6 @@ export class UpgradeAdapterRef { // @public (undocumented) export const VERSION: Version; - // (No @packageDocumentation comment for this package) ``` diff --git a/goldens/public-api/upgrade/static/static.md b/goldens/public-api/upgrade/static/index.md similarity index 100% rename from goldens/public-api/upgrade/static/static.md rename to goldens/public-api/upgrade/static/index.md diff --git a/goldens/public-api/upgrade/static/testing/testing.md b/goldens/public-api/upgrade/static/testing/index.md similarity index 99% rename from goldens/public-api/upgrade/static/testing/testing.md rename to goldens/public-api/upgrade/static/testing/index.md index fcab6e91cb7..879ee154335 100644 --- a/goldens/public-api/upgrade/static/testing/testing.md +++ b/goldens/public-api/upgrade/static/testing/index.md @@ -12,7 +12,6 @@ export function createAngularJSTestingModule(angularModules: any[]): string; // @public export function createAngularTestingModule(angularJSModules: string[], strictDi?: boolean): Type; - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/localize/BUILD.bazel b/packages/localize/BUILD.bazel index 42066b3b98c..78c6febb394 100644 --- a/packages/localize/BUILD.bazel +++ b/packages/localize/BUILD.bazel @@ -44,4 +44,7 @@ api_golden_test_npm_package( ], golden_dir = "angular/goldens/public-api/localize", npm_package = "angular/packages/localize/npm_package", + # The tool entry-point uses namespace aliases and API extractor needs to be + # able to resolve `@babel/core` to fully understand the `types` re-export/alias. + types = ["@npm//@types/babel__core"], )