fix(misc): fix @nrwl/nx-plugin migrations
This commit is contained in:
parent
e55234f2eb
commit
285879c1e2
@ -1,10 +1,12 @@
|
|||||||
import { Tree, readJson } from '@nrwl/devkit';
|
import { readJsonInTree } from '@nrwl/workspace';
|
||||||
|
|
||||||
export default function update(host: Tree) {
|
export default function () {
|
||||||
const p = readJson(host, 'package.json');
|
return (host: any) => {
|
||||||
if (p['ng-update']) {
|
const p = readJsonInTree(host, 'package.json');
|
||||||
p['nx-migrations'] = p['ng-update'];
|
if (p['ng-update']) {
|
||||||
delete p['ng-update'];
|
p['nx-migrations'] = p['ng-update'];
|
||||||
}
|
delete p['ng-update'];
|
||||||
host.write('package.json', JSON.stringify(p, null, 2));
|
}
|
||||||
|
host.overwrite('package.json', JSON.stringify(p, null, 2));
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
import { readJson } from '@nrwl/devkit';
|
|
||||||
import { basename } from 'path';
|
import { basename } from 'path';
|
||||||
import { visitNotIgnoredFiles } from '@nrwl/workspace';
|
import { visitNotIgnoredFiles, readJsonInTree } from '@nrwl/workspace';
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
return visitNotIgnoredFiles((file, host) => {
|
return visitNotIgnoredFiles((file, host) => {
|
||||||
if (basename(file) === 'schema.json') {
|
if (basename(file) === 'schema.json') {
|
||||||
const p = readJson(host as any, file);
|
const p = readJsonInTree(host as any, file);
|
||||||
if (
|
if (
|
||||||
p.$schema === 'https://json-schema.org/draft-07/schema' ||
|
p.$schema === 'https://json-schema.org/draft-07/schema' ||
|
||||||
p.$schema === 'http://json-schema.org/draft-07/schema'
|
p.$schema === 'http://json-schema.org/draft-07/schema'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user