Skip to content

Commit 0405c1d

Browse files
committed
fix(schematics): update to use parse from jsonc-parser
parseJson is no longer available in angular-devkit
1 parent 4635842 commit 0405c1d

File tree

4 files changed

+5650
-5506
lines changed

4 files changed

+5650
-5506
lines changed

package-lock.json

Lines changed: 33 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
},
2323
"peerDependencies": {
2424
"@azure/functions": "^1.0.3 || ^3.0.0",
25-
"@nestjs/common": "^6.0.0 || ^7.0.0 || ^8.0.0",
26-
"@nestjs/core": "^6.0.0 || ^7.0.0 || ^8.0.0",
25+
"@nestjs/common": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
26+
"@nestjs/core": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
2727
"reflect-metadata": "^0.1.13"
2828
},
2929
"devDependencies": {
@@ -51,6 +51,7 @@
5151
"@types/jest": "26.0.24",
5252
"cors": "2.8.5",
5353
"jest": "27.5.1",
54+
"jsonc-parser": "^3.2.0",
5455
"trouter": "3.2.0",
5556
"ts-jest": "27.0.4"
5657
},

schematics/install/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import { parseJson, strings } from '@angular-devkit/core';
1+
import { strings } from '@angular-devkit/core';
2+
import { parse as parseJson } from 'jsonc-parser';
23
import {
34
apply,
45
chain,
56
FileEntry,
67
forEach,
7-
mergeWith, noop, Rule,
8+
mergeWith,
9+
noop,
10+
Rule,
811
SchematicContext,
912
SchematicsException,
1013
template,
@@ -50,7 +53,7 @@ function updateJsonFile<T>(
5053
if (source) {
5154
const sourceText = source.toString('utf-8');
5255
const json = parseJson(sourceText);
53-
callback((json as {}) as T);
56+
callback(json as {} as T);
5457
host.overwrite(path, JSON.stringify(json, null, 2));
5558
}
5659
return host;

0 commit comments

Comments
 (0)