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) {
|
||||
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));
|
||||
};
|
||||
}
|
||||
|
||||
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user