Skip to content

Commit

Permalink
chore: remove deprecated JSON APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Nov 7, 2021
1 parent fdbb623 commit e0291a5
Show file tree
Hide file tree
Showing 21 changed files with 62 additions and 132 deletions.
11 changes: 3 additions & 8 deletions modules/component-store/schematics-core/utility/angular-utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
JsonParseMode,
dirname,
normalize,
parseJsonAst,
resolve,
} from '@angular-devkit/core';
import { dirname, normalize, resolve } from '@angular-devkit/core';
import { Tree } from '@angular-devkit/schematics';
import { parseJsonAst } from '@angular-devkit/core/src/json/parser';
import { findPropertyInAstObject } from './json-utilts';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/migrations/update-9/utils.ts
Expand All @@ -18,7 +13,7 @@ export function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean {
return true;
}

const tsCfgAst = parseJsonAst(buffer.toString(), JsonParseMode.Loose);
const tsCfgAst = parseJsonAst(buffer.toString());

if (tsCfgAst.kind !== 'object') {
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { JsonAstNode, JsonAstObject } from '@angular-devkit/core';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts
export function findPropertyInAstObject(
node: JsonAstObject,
node: any,
propertyName: string
): JsonAstNode | null {
let maybeNode: JsonAstNode | null = null;
): any | null {
let maybeNode: any | null = null;
for (const property of node.properties) {
if (property.key.value == propertyName) {
maybeNode = property.value;
Expand Down
11 changes: 3 additions & 8 deletions modules/component/schematics-core/utility/angular-utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
JsonParseMode,
dirname,
normalize,
parseJsonAst,
resolve,
} from '@angular-devkit/core';
import { dirname, normalize, resolve } from '@angular-devkit/core';
import { Tree } from '@angular-devkit/schematics';
import { parseJsonAst } from '@angular-devkit/core/src/json/parser';
import { findPropertyInAstObject } from './json-utilts';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/migrations/update-9/utils.ts
Expand All @@ -18,7 +13,7 @@ export function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean {
return true;
}

const tsCfgAst = parseJsonAst(buffer.toString(), JsonParseMode.Loose);
const tsCfgAst = parseJsonAst(buffer.toString());

if (tsCfgAst.kind !== 'object') {
return true;
Expand Down
8 changes: 3 additions & 5 deletions modules/component/schematics-core/utility/json-utilts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { JsonAstNode, JsonAstObject } from '@angular-devkit/core';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts
export function findPropertyInAstObject(
node: JsonAstObject,
node: any,
propertyName: string
): JsonAstNode | null {
let maybeNode: JsonAstNode | null = null;
): any | null {
let maybeNode: any | null = null;
for (const property of node.properties) {
if (property.key.value == propertyName) {
maybeNode = property.value;
Expand Down
11 changes: 3 additions & 8 deletions modules/data/schematics-core/utility/angular-utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
JsonParseMode,
dirname,
normalize,
parseJsonAst,
resolve,
} from '@angular-devkit/core';
import { dirname, normalize, resolve } from '@angular-devkit/core';
import { Tree } from '@angular-devkit/schematics';
import { parseJsonAst } from '@angular-devkit/core/src/json/parser';
import { findPropertyInAstObject } from './json-utilts';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/migrations/update-9/utils.ts
Expand All @@ -18,7 +13,7 @@ export function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean {
return true;
}

const tsCfgAst = parseJsonAst(buffer.toString(), JsonParseMode.Loose);
const tsCfgAst = parseJsonAst(buffer.toString());

if (tsCfgAst.kind !== 'object') {
return true;
Expand Down
8 changes: 3 additions & 5 deletions modules/data/schematics-core/utility/json-utilts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { JsonAstNode, JsonAstObject } from '@angular-devkit/core';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts
export function findPropertyInAstObject(
node: JsonAstObject,
node: any,
propertyName: string
): JsonAstNode | null {
let maybeNode: JsonAstNode | null = null;
): any | null {
let maybeNode: any | null = null;
for (const property of node.properties) {
if (property.key.value == propertyName) {
maybeNode = property.value;
Expand Down
11 changes: 3 additions & 8 deletions modules/effects/schematics-core/utility/angular-utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
JsonParseMode,
dirname,
normalize,
parseJsonAst,
resolve,
} from '@angular-devkit/core';
import { dirname, normalize, resolve } from '@angular-devkit/core';
import { Tree } from '@angular-devkit/schematics';
import { parseJsonAst } from '@angular-devkit/core/src/json/parser';
import { findPropertyInAstObject } from './json-utilts';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/migrations/update-9/utils.ts
Expand All @@ -18,7 +13,7 @@ export function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean {
return true;
}

const tsCfgAst = parseJsonAst(buffer.toString(), JsonParseMode.Loose);
const tsCfgAst = parseJsonAst(buffer.toString());

if (tsCfgAst.kind !== 'object') {
return true;
Expand Down
8 changes: 3 additions & 5 deletions modules/effects/schematics-core/utility/json-utilts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { JsonAstNode, JsonAstObject } from '@angular-devkit/core';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts
export function findPropertyInAstObject(
node: JsonAstObject,
node: any,
propertyName: string
): JsonAstNode | null {
let maybeNode: JsonAstNode | null = null;
): any | null {
let maybeNode: any | null = null;
for (const property of node.properties) {
if (property.key.value == propertyName) {
maybeNode = property.value;
Expand Down
11 changes: 3 additions & 8 deletions modules/entity/schematics-core/utility/angular-utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
JsonParseMode,
dirname,
normalize,
parseJsonAst,
resolve,
} from '@angular-devkit/core';
import { dirname, normalize, resolve } from '@angular-devkit/core';
import { Tree } from '@angular-devkit/schematics';
import { parseJsonAst } from '@angular-devkit/core/src/json/parser';
import { findPropertyInAstObject } from './json-utilts';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/migrations/update-9/utils.ts
Expand All @@ -18,7 +13,7 @@ export function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean {
return true;
}

const tsCfgAst = parseJsonAst(buffer.toString(), JsonParseMode.Loose);
const tsCfgAst = parseJsonAst(buffer.toString());

if (tsCfgAst.kind !== 'object') {
return true;
Expand Down
8 changes: 3 additions & 5 deletions modules/entity/schematics-core/utility/json-utilts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { JsonAstNode, JsonAstObject } from '@angular-devkit/core';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts
export function findPropertyInAstObject(
node: JsonAstObject,
node: any,
propertyName: string
): JsonAstNode | null {
let maybeNode: JsonAstNode | null = null;
): any | null {
let maybeNode: any | null = null;
for (const property of node.properties) {
if (property.key.value == propertyName) {
maybeNode = property.value;
Expand Down
11 changes: 3 additions & 8 deletions modules/router-store/schematics-core/utility/angular-utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
JsonParseMode,
dirname,
normalize,
parseJsonAst,
resolve,
} from '@angular-devkit/core';
import { dirname, normalize, resolve } from '@angular-devkit/core';
import { Tree } from '@angular-devkit/schematics';
import { parseJsonAst } from '@angular-devkit/core/src/json/parser';
import { findPropertyInAstObject } from './json-utilts';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/migrations/update-9/utils.ts
Expand All @@ -18,7 +13,7 @@ export function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean {
return true;
}

const tsCfgAst = parseJsonAst(buffer.toString(), JsonParseMode.Loose);
const tsCfgAst = parseJsonAst(buffer.toString());

if (tsCfgAst.kind !== 'object') {
return true;
Expand Down
8 changes: 3 additions & 5 deletions modules/router-store/schematics-core/utility/json-utilts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { JsonAstNode, JsonAstObject } from '@angular-devkit/core';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts
export function findPropertyInAstObject(
node: JsonAstObject,
node: any,
propertyName: string
): JsonAstNode | null {
let maybeNode: JsonAstNode | null = null;
): any | null {
let maybeNode: any | null = null;
for (const property of node.properties) {
if (property.key.value == propertyName) {
maybeNode = property.value;
Expand Down
11 changes: 3 additions & 8 deletions modules/schematics-core/utility/angular-utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
JsonParseMode,
dirname,
normalize,
parseJsonAst,
resolve,
} from '@angular-devkit/core';
import { dirname, normalize, resolve } from '@angular-devkit/core';
import { Tree } from '@angular-devkit/schematics';
import { parseJsonAst } from '@angular-devkit/core/src/json/parser';
import { findPropertyInAstObject } from './json-utilts';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/migrations/update-9/utils.ts
Expand All @@ -18,7 +13,7 @@ export function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean {
return true;
}

const tsCfgAst = parseJsonAst(buffer.toString(), JsonParseMode.Loose);
const tsCfgAst = parseJsonAst(buffer.toString());

if (tsCfgAst.kind !== 'object') {
return true;
Expand Down
8 changes: 3 additions & 5 deletions modules/schematics-core/utility/json-utilts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { JsonAstNode, JsonAstObject } from '@angular-devkit/core';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts
export function findPropertyInAstObject(
node: JsonAstObject,
node: any,
propertyName: string
): JsonAstNode | null {
let maybeNode: JsonAstNode | null = null;
): any | null {
let maybeNode: any | null = null;
for (const property of node.properties) {
if (property.key.value == propertyName) {
maybeNode = property.value;
Expand Down
11 changes: 3 additions & 8 deletions modules/schematics/schematics-core/utility/angular-utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
JsonParseMode,
dirname,
normalize,
parseJsonAst,
resolve,
} from '@angular-devkit/core';
import { dirname, normalize, resolve } from '@angular-devkit/core';
import { Tree } from '@angular-devkit/schematics';
import { parseJsonAst } from '@angular-devkit/core/src/json/parser';
import { findPropertyInAstObject } from './json-utilts';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/migrations/update-9/utils.ts
Expand All @@ -18,7 +13,7 @@ export function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean {
return true;
}

const tsCfgAst = parseJsonAst(buffer.toString(), JsonParseMode.Loose);
const tsCfgAst = parseJsonAst(buffer.toString());

if (tsCfgAst.kind !== 'object') {
return true;
Expand Down
8 changes: 3 additions & 5 deletions modules/schematics/schematics-core/utility/json-utilts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { JsonAstNode, JsonAstObject } from '@angular-devkit/core';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts
export function findPropertyInAstObject(
node: JsonAstObject,
node: any,
propertyName: string
): JsonAstNode | null {
let maybeNode: JsonAstNode | null = null;
): any | null {
let maybeNode: any | null = null;
for (const property of node.properties) {
if (property.key.value == propertyName) {
maybeNode = property.value;
Expand Down
11 changes: 3 additions & 8 deletions modules/store-devtools/schematics-core/utility/angular-utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
JsonParseMode,
dirname,
normalize,
parseJsonAst,
resolve,
} from '@angular-devkit/core';
import { dirname, normalize, resolve } from '@angular-devkit/core';
import { Tree } from '@angular-devkit/schematics';
import { parseJsonAst } from '@angular-devkit/core/src/json/parser';
import { findPropertyInAstObject } from './json-utilts';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/migrations/update-9/utils.ts
Expand All @@ -18,7 +13,7 @@ export function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean {
return true;
}

const tsCfgAst = parseJsonAst(buffer.toString(), JsonParseMode.Loose);
const tsCfgAst = parseJsonAst(buffer.toString());

if (tsCfgAst.kind !== 'object') {
return true;
Expand Down
8 changes: 3 additions & 5 deletions modules/store-devtools/schematics-core/utility/json-utilts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { JsonAstNode, JsonAstObject } from '@angular-devkit/core';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts
export function findPropertyInAstObject(
node: JsonAstObject,
node: any,
propertyName: string
): JsonAstNode | null {
let maybeNode: JsonAstNode | null = null;
): any | null {
let maybeNode: any | null = null;
for (const property of node.properties) {
if (property.key.value == propertyName) {
maybeNode = property.value;
Expand Down
11 changes: 3 additions & 8 deletions modules/store/schematics-core/utility/angular-utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
JsonParseMode,
dirname,
normalize,
parseJsonAst,
resolve,
} from '@angular-devkit/core';
import { dirname, normalize, resolve } from '@angular-devkit/core';
import { Tree } from '@angular-devkit/schematics';
import { parseJsonAst } from '@angular-devkit/core/src/json/parser';
import { findPropertyInAstObject } from './json-utilts';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/migrations/update-9/utils.ts
Expand All @@ -18,7 +13,7 @@ export function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean {
return true;
}

const tsCfgAst = parseJsonAst(buffer.toString(), JsonParseMode.Loose);
const tsCfgAst = parseJsonAst(buffer.toString());

if (tsCfgAst.kind !== 'object') {
return true;
Expand Down
8 changes: 3 additions & 5 deletions modules/store/schematics-core/utility/json-utilts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { JsonAstNode, JsonAstObject } from '@angular-devkit/core';

// https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts
export function findPropertyInAstObject(
node: JsonAstObject,
node: any,
propertyName: string
): JsonAstNode | null {
let maybeNode: JsonAstNode | null = null;
): any | null {
let maybeNode: any | null = null;
for (const property of node.properties) {
if (property.key.value == propertyName) {
maybeNode = property.value;
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"noStrictGenericChecks": true,
"lib": ["es2016", "dom"],
"outDir": "../out-tsc/app",
"target": "es2015",
"module": "es2020",
"target": "es5",
"module": "commonjs",
"baseUrl": ".",
"rootDir": ".",
"strict": true,
Expand Down

0 comments on commit e0291a5

Please sign in to comment.