Revert "fix(compiler-cli): avoid broken references in .d.ts files due to @internal markers" (#43961)

This reverts commit 69821fcef6.

PR Close #43961
This commit is contained in:
Jessica Janiuk
2021-10-26 22:47:14 +00:00
parent 728926412d
commit e25ebb6058
6 changed files with 34 additions and 42 deletions
@@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/
export {COMPILER_ERRORS_WITH_GUIDES, ERROR_DETAILS_PAGE_BASE_URL} from './src/docs';
export {FatalDiagnosticError, isFatalDiagnosticError, makeDiagnostic, makeRelatedInformation} from './src/error';
export {ErrorCode} from './src/error_code';
export {ngErrorCode, replaceTsWithNgInErrors} from './src/util';
export {COMPILER_ERRORS_WITH_GUIDES, ERROR_DETAILS_PAGE_BASE_URL, ErrorCode, ngErrorCode} from './src/error_code';
export {replaceTsWithNgInErrors} from './src/util';
@@ -1,30 +0,0 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {ErrorCode} from './error_code';
/**
* Base URL for the error details page.
* Keep this value in sync with a similar const in
* `packages/core/src/render3/error_code.ts`.
*/
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
/**
* Contains a set of error messages that have detailed guides at angular.io.
* Full list of available error guides can be found at https://angular.io/errors
*/
export const COMPILER_ERRORS_WITH_GUIDES = new Set([
ErrorCode.DECORATOR_ARG_NOT_LITERAL,
ErrorCode.IMPORT_CYCLE_DETECTED,
ErrorCode.PARAM_MISSING_TOKEN,
ErrorCode.SCHEMA_INVALID_ELEMENT,
ErrorCode.SCHEMA_INVALID_ATTRIBUTE,
ErrorCode.MISSING_REFERENCE_TARGET,
ErrorCode.COMPONENT_INVALID_SHADOW_DOM_SELECTOR,
]);
@@ -8,8 +8,7 @@
import * as ts from 'typescript';
import {ErrorCode} from './error_code';
import {ngErrorCode} from './util';
import {ErrorCode, ngErrorCode} from './error_code';
export class FatalDiagnosticError {
constructor(
@@ -226,3 +226,33 @@ export enum ErrorCode {
*/
SUGGEST_SUBOPTIMAL_TYPE_INFERENCE = 10002,
}
/**
* @internal
* Base URL for the error details page.
* Keep this value in sync with a similar const in
* `packages/core/src/render3/error_code.ts`.
*/
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
/**
* @internal
* Contains a set of error messages that have detailed guides at angular.io.
* Full list of available error guides can be found at https://angular.io/errors
*/
export const COMPILER_ERRORS_WITH_GUIDES = new Set([
ErrorCode.DECORATOR_ARG_NOT_LITERAL,
ErrorCode.IMPORT_CYCLE_DETECTED,
ErrorCode.PARAM_MISSING_TOKEN,
ErrorCode.SCHEMA_INVALID_ELEMENT,
ErrorCode.SCHEMA_INVALID_ATTRIBUTE,
ErrorCode.MISSING_REFERENCE_TARGET,
ErrorCode.COMPONENT_INVALID_SHADOW_DOM_SELECTOR,
]);
/**
* @internal
*/
export function ngErrorCode(code: ErrorCode): number {
return parseInt('-99' + code);
}
@@ -6,8 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ErrorCode} from './error_code';
const ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
/**
@@ -22,7 +20,3 @@ const ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
export function replaceTsWithNgInErrors(errors: string): string {
return errors.replace(ERROR_CODE_MATCHER, '$1NG$2');
}
export function ngErrorCode(code: ErrorCode): number {
return parseInt('-99' + code);
}
+1 -1
View File
@@ -8,7 +8,7 @@
// Base URL for the error details page.
// Keep this value in sync with a similar const in
// `packages/compiler-cli/src/ngtsc/diagnostics/src/docs.ts`.
// `packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts`.
const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
export const enum RuntimeErrorCode {