Skip to content

Commit c0eb926

Browse files
committed
refactor(@angular-devkit/core): remove custom json parser
With this change we replace the workspace reader and write to use `jsonc-parser` instead of our custom build JSON parser
1 parent d270258 commit c0eb926

35 files changed

+362
-2058
lines changed

goldens/public-api/angular_devkit/core/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ export type DeepReadonlyObject<T> = {
366366
};
367367

368368
// @public (undocumented)
369-
type DefinitionCollectionListener<V extends object> = (name: string, action: 'add' | 'remove' | 'replace', newValue: V | undefined, oldValue: V | undefined, collection: DefinitionCollection<V>) => void;
369+
type DefinitionCollectionListener<V extends object> = (name: string, newValue: V | undefined, collection: DefinitionCollection<V>) => void;
370370

371371
// @public (undocumented)
372372
export class DependencyNotFoundException extends BaseException {

packages/angular/cli/src/utilities/json-file.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export class JSONFile {
8787

8888
const edits = modify(this.content, jsonPath, value, {
8989
getInsertionIndex,
90+
// TODO: use indentation from original file.
9091
formattingOptions: {
9192
insertSpaces: true,
9293
tabSize: 2,

packages/angular_devkit/core/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ts_library(
3939
"@npm//ajv",
4040
"@npm//ajv-formats",
4141
"@npm//fast-json-stable-stringify",
42-
"@npm//magic-string",
42+
"@npm//jsonc-parser",
4343
"@npm//rxjs",
4444
"@npm//source-map", # @external
4545
# @node_module: typescript:es2015.proxy
@@ -71,7 +71,6 @@ jasmine_node_test(
7171
deps = [
7272
# @node_module: ajv
7373
# @node_module: fast_json_stable_stringify
74-
# @node_module: magic_string
7574
# @node_module: source_map
7675
],
7776
)

packages/angular_devkit/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"ajv-formats": "2.1.1",
1212
"ajv": "8.11.0",
1313
"fast-json-stable-stringify": "2.1.0",
14-
"magic-string": "0.26.1",
14+
"jsonc-parser": "3.0.0",
1515
"rxjs": "6.6.7",
1616
"source-map": "0.7.3"
1717
},

0 commit comments

Comments
 (0)