Skip to content

Commit 656f574

Browse files
JoostKalxhub
authored andcommitted
refactor(compiler-cli): extract error documentation base url into separate file (angular#43965)
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 angular#43965
1 parent 9a89db7 commit 656f574

File tree

5 files changed

+35
-12
lines changed

5 files changed

+35
-12
lines changed

packages/compiler-cli/src/ngtsc/diagnostics/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export {COMPILER_ERRORS_WITH_GUIDES, ERROR_DETAILS_PAGE_BASE_URL} from './src/docs';
9+
export {COMPILER_ERRORS_WITH_GUIDES} from './src/docs';
1010
export {FatalDiagnosticError, isFatalDiagnosticError, makeDiagnostic, makeRelatedInformation} from './src/error';
1111
export {ErrorCode} from './src/error_code';
12+
export {ERROR_DETAILS_PAGE_BASE_URL} from './src/error_details_base_url';
1213
export {ngErrorCode, replaceTsWithNgInErrors} from './src/util';

packages/compiler-cli/src/ngtsc/diagnostics/src/docs.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88

99
import {ErrorCode} from './error_code';
1010

11-
/**
12-
* Base URL for the error details page.
13-
* Keep this value in sync with a similar const in
14-
* `packages/core/src/render3/error_code.ts`.
15-
*/
16-
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
17-
1811
/**
1912
* Contains a set of error messages that have detailed guides at angular.io.
2013
* Full list of available error guides can be found at https://angular.io/errors
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
/**
10+
* Base URL for the error details page.
11+
*
12+
* Keep the files below in sync:
13+
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
14+
* - packages/core/src/render3/error_details_base_url.ts
15+
*/
16+
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';

packages/core/src/render3/error_code.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
// Base URL for the error details page.
10-
// Keep this value in sync with a similar const in
11-
// `packages/compiler-cli/src/ngtsc/diagnostics/src/docs.ts`.
12-
const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
9+
import {ERROR_DETAILS_PAGE_BASE_URL} from './error_details_base_url';
1310

1411
export const enum RuntimeErrorCode {
1512
// Internal Errors
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
/**
10+
* Base URL for the error details page.
11+
*
12+
* Keep the files below in sync:
13+
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
14+
* - packages/core/src/render3/error_details_base_url.ts
15+
*/
16+
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';

0 commit comments

Comments
 (0)