Skip to content

Commit

Permalink
fix(misc): fix @nrwl/nx-plugin migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Feb 6, 2021
1 parent e55234f commit 285879c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Tree, readJson } from '@nrwl/devkit';
import { readJsonInTree } from '@nrwl/workspace';

export default function update(host: Tree) {
const p = readJson(host, 'package.json');
if (p['ng-update']) {
p['nx-migrations'] = p['ng-update'];
delete p['ng-update'];
}
host.write('package.json', JSON.stringify(p, null, 2));
export default function () {
return (host: any) => {
const p = readJsonInTree(host, 'package.json');
if (p['ng-update']) {
p['nx-migrations'] = p['ng-update'];
delete p['ng-update'];
}
host.overwrite('package.json', JSON.stringify(p, null, 2));
};
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { readJson } from '@nrwl/devkit';
import { basename } from 'path';
import { visitNotIgnoredFiles } from '@nrwl/workspace';
import { visitNotIgnoredFiles, readJsonInTree } from '@nrwl/workspace';

export default function () {
return visitNotIgnoredFiles((file, host) => {
if (basename(file) === 'schema.json') {
const p = readJson(host as any, file);
const p = readJsonInTree(host as any, file);
if (
p.$schema === 'https://json-schema.org/draft-07/schema' ||
p.$schema === 'http://json-schema.org/draft-07/schema'
Expand Down

0 comments on commit 285879c

Please sign in to comment.