Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit f12f94e

Browse files
committed
fix(@angular/schematics): fix the null protocol for node-modules-engine-host
1 parent 45731e8 commit f12f94e

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

packages/schematics/src/engine/engine.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@ export class SchematicEngine<CollectionT, SchematicT> implements Engine<Collecti
9898
case 'host:': return (context: TypedSchematicContext<CollectionT, SchematicT>) => {
9999
return context.host.map(tree => branch(tree));
100100
};
101-
case '':
102-
const fileUrl = parse(format(url));
103-
fileUrl.protocol = 'file:';
104-
return (context: TypedSchematicContext<CollectionT, SchematicT>) => {
105-
return context.engine.createSourceFromUrl(fileUrl)(context);
106-
};
107101
default:
108102
const hostSource = this._host.createSourceFromUrl(url);
109103
if (!hostSource) {

packages/schematics/tooling/node-module-engine-host.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export class NodeModulesEngineHost implements EngineHost<NodeModulesCollectionDe
122122

123123
createSourceFromUrl(url: Url): Source | null {
124124
switch (url.protocol) {
125-
case '':
125+
case null:
126126
case 'file:':
127127
return (context: NodeModulesSchematicContext) => {
128128
// Resolve all file:///a/b/c/d from the schematic's own path, and not the current

0 commit comments

Comments
 (0)