@@ -3,7 +3,7 @@ import { JsonObject } from '@angular-devkit/core';
3
3
import { CoreSchemaRegistry } from '@angular-devkit/core/src/json/schema/index' ;
4
4
import { SchematicContext } from '@angular-devkit/schematics' ;
5
5
import { NodeWorkflow } from '@angular-devkit/schematics/tools' ;
6
- import { dirname as pathDirname , join as pathJoin } from 'path' ;
6
+ import { dirname as pathDirname , posix } from 'path' ;
7
7
8
8
import { getJsonFromUrl } from './request' ;
9
9
@@ -14,15 +14,15 @@ export interface NgCliOption extends Option {
14
14
const getExternalSchemaJson = async ( packageName : string , schematicName = 'ng-add' , retries = 3 , backoff = 300 ) : Promise < JsonObject > => {
15
15
const url = `http://cdn.jsdelivr.net/npm/${ packageName } @latest` ;
16
16
17
- const pkgJson = await getJsonFromUrl ( pathJoin ( url , 'package.json' ) , retries , backoff ) ;
17
+ const pkgJson = await getJsonFromUrl ( posix . join ( url , 'package.json' ) , retries , backoff ) ;
18
18
if ( pkgJson ?. [ 'schematics' ] ) {
19
- const collectionJson = await getJsonFromUrl ( pathJoin ( url , pkgJson [ 'schematics' ] as string ) , retries , backoff ) ;
19
+ const collectionJson = await getJsonFromUrl ( posix . join ( url , pkgJson [ 'schematics' ] as string ) , retries , backoff ) ;
20
20
if ( collectionJson ?. [ 'schematics' ] ) {
21
21
const schema = ( ( collectionJson [ 'schematics' ] as JsonObject ) [ schematicName ] as JsonObject ) ?. [ 'schema' ] as string ;
22
22
if ( ! schema ) {
23
23
throw new Error ( `Schematic "${ schematicName } " not found in collection "${ packageName } ".` ) ;
24
24
}
25
- return await getJsonFromUrl ( pathJoin ( url , pathDirname ( pkgJson [ 'schematics' ] as string ) , schema ) , retries , backoff ) ;
25
+ return await getJsonFromUrl ( posix . join ( url , pathDirname ( pkgJson [ 'schematics' ] as string ) , schema ) , retries , backoff ) ;
26
26
}
27
27
}
28
28
0 commit comments