Skip to content

Commit 613f7db

Browse files
alan-agius4vikerman
authored andcommitted
refactor(@angular-devkit/core): deprecate old terminal and resolve APIs
1 parent a384a98 commit 613f7db

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/angular_devkit/core/node/resolve.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { isFile } from './fs';
1212

1313
/**
1414
* Exception thrown when a module could not be resolved.
15+
* @deprecated since version 8. Use `MODULE_NOT_FOUND` Node error code instead.
1516
*/
1617
export class ModuleNotFoundException extends BaseException {
1718
public readonly code: string;
@@ -70,6 +71,7 @@ function _getGlobalNodeModules() {
7071
}
7172

7273

74+
/** @deprecated since version 8. Use `require.resolve` instead. */
7375
export interface ResolveOptions {
7476
/**
7577
* The basedir to use from which to resolve.
@@ -111,6 +113,7 @@ export interface ResolveOptions {
111113

112114

113115
let _resolveHook: ((x: string, options: ResolveOptions) => string | null) | null = null;
116+
/** @deprecated since version 8. Use `require.resolve` instead. */
114117
export function setResolveHook(
115118
hook: ((x: string, options: ResolveOptions) => string | null) | null,
116119
) {
@@ -125,6 +128,7 @@ export function setResolveHook(
125128
* @returns {string} Path to the index to include, or if `resolvePackageJson` option was
126129
* passed, a path to that file.
127130
* @throws {ModuleNotFoundException} If no module with that name was found anywhere.
131+
* @deprecated since version 8. Use `require.resolve` instead.
128132
*/
129133
export function resolve(packageName: string, options: ResolveOptions): string {
130134
if (_resolveHook) {

packages/angular_devkit/core/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,21 @@ import * as analytics from './analytics';
99
import * as experimental from './experimental';
1010
import * as json from './json/index';
1111
import * as logging from './logger/index';
12-
import * as terminal from './terminal/index';
12+
import * as ɵterminal from './terminal/index';
1313
import * as workspaces from './workspace';
1414

1515
export * from './exception/exception';
1616
export * from './json/index';
1717
export * from './utils/index';
1818
export * from './virtual-fs/index';
1919

20+
/** @deprecated since version 8 - Instead use other 3rd party libraries like `colors` and `chalk`. */
21+
export const terminal = ɵterminal;
22+
2023
export {
2124
analytics,
2225
experimental,
2326
json,
2427
logging,
25-
terminal,
2628
workspaces,
2729
};

0 commit comments

Comments
 (0)