Skip to content

Commit

Permalink
refactor(compiler-cli): extract error documentation base url into sep…
Browse files Browse the repository at this point in the history
…arate file (#43527)

Prior refactorings caused unexpected g3 sync issues due to a patch that
changes the error documentation URL. This commit moves the base url into
a separate file to make this more apparent.

PR Close #43527
  • Loading branch information
JoostK authored and thePunderWoman committed Oct 26, 2021
1 parent 1125574 commit bf59401
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 12 deletions.
3 changes: 2 additions & 1 deletion packages/compiler-cli/src/ngtsc/diagnostics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

export {COMPILER_ERRORS_WITH_GUIDES, ERROR_DETAILS_PAGE_BASE_URL} from './src/docs';
export {COMPILER_ERRORS_WITH_GUIDES} from './src/docs';
export {FatalDiagnosticError, isFatalDiagnosticError, makeDiagnostic, makeRelatedInformation} from './src/error';
export {ErrorCode} from './src/error_code';
export {ERROR_DETAILS_PAGE_BASE_URL} from './src/error_details_base_url';
export {ngErrorCode, replaceTsWithNgInErrors} from './src/util';
7 changes: 0 additions & 7 deletions packages/compiler-cli/src/ngtsc/diagnostics/src/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@

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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* @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
*/

/**
* Base URL for the error details page.
*
* Keep the files below in full sync:
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
* - packages/core/src/render3/error_details_base_url.ts
*/
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
5 changes: 1 addition & 4 deletions packages/core/src/render3/error_code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

// 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`.
const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
import {ERROR_DETAILS_PAGE_BASE_URL} from './error_details_base_url';

export const enum RuntimeErrorCode {
// Internal Errors
Expand Down
16 changes: 16 additions & 0 deletions packages/core/src/render3/error_details_base_url.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* @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
*/

/**
* Base URL for the error details page.
*
* Keep the files below in full sync:
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
* - packages/core/src/render3/error_details_base_url.ts
*/
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';

0 comments on commit bf59401

Please sign in to comment.