Skip to content

Commit 208336d

Browse files
alan-agius4mgechev
authored andcommitted
refactor(@angular-devkit/core): remove resolve methods and options
BREAKING CHANGE: deprecated API's `ModuleNotFoundException`, `ResolveOptions`, `resolve` have been removed. Use `MODULE_NOT_FOUND` and `require.resolve` instead. **Note**: this change only effect users using `@angular-devkit/core` public API and not application developers.
1 parent 5d73e9d commit 208336d

File tree

6 files changed

+0
-388
lines changed

6 files changed

+0
-388
lines changed

etc/api/angular_devkit/core/node/_golden-api.d.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ export declare function isDirectory(filePath: string): boolean;
44

55
export declare function isFile(filePath: string): boolean;
66

7-
export declare class ModuleNotFoundException extends BaseException {
8-
readonly basePath: string;
9-
readonly code: string;
10-
readonly moduleName: string;
11-
constructor(moduleName: string, basePath: string);
12-
}
13-
147
export declare class NodeJsAsyncHost implements virtualFs.Host<fs.Stats> {
158
get capabilities(): virtualFs.HostCapabilities;
169
delete(path: Path): Observable<void>;
@@ -47,15 +40,3 @@ export declare class NodeModuleJobRegistry<MinimumArgumentValueT extends JsonVal
4740
export interface ProcessOutput {
4841
write(buffer: string | Buffer): boolean;
4942
}
50-
51-
export declare function resolve(packageName: string, options: ResolveOptions): string;
52-
53-
export interface ResolveOptions {
54-
basedir: string;
55-
checkGlobal?: boolean;
56-
checkLocal?: boolean;
57-
extensions?: string[];
58-
paths?: string[];
59-
preserveSymlinks?: boolean;
60-
resolvePackageJson?: boolean;
61-
}

lib/bootstrap-local.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -190,29 +190,3 @@ if (!__dirname.match(new RegExp(`\\${path.sep}node_modules\\${path.sep}`))) {
190190
}
191191
};
192192
}
193-
194-
195-
// Set the resolve hook to allow resolution of packages from a local dev environment.
196-
require('@angular-devkit/core/node/resolve').setResolveHook(function(request, options) {
197-
try {
198-
if (request in packages) {
199-
if (options.resolvePackageJson) {
200-
return path.join(packages[request].root, 'package.json');
201-
} else {
202-
return packages[request].main;
203-
}
204-
} else {
205-
const match = Object.keys(packages).find(function(pkgName) {
206-
return request.startsWith(pkgName + '/');
207-
});
208-
209-
if (match) {
210-
return path.join(packages[match].root, request.substr(match[0].length));
211-
} else {
212-
return null;
213-
}
214-
}
215-
} catch (_) {
216-
return null;
217-
}
218-
});

packages/angular_devkit/core/node/_golden-api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ export * from './experimental/jobs/job-registry';
1515
export * from './fs';
1616
export * from './cli-logger';
1717
export * from './host';
18-
export { ModuleNotFoundException, ResolveOptions, resolve } from './resolve';

packages/angular_devkit/core/node/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import * as experimental from './experimental/jobs/job-registry';
99
import * as fs from './fs';
1010
export * from './cli-logger';
1111
export * from './host';
12-
export { ModuleNotFoundException, ResolveOptions, resolve } from './resolve';
1312

1413
export {
1514
experimental,

packages/angular_devkit/core/node/resolve.ts

Lines changed: 0 additions & 316 deletions
This file was deleted.

0 commit comments

Comments
 (0)