parent
63ae3ae077
commit
09baf958e8
@ -1,4 +1,5 @@
|
||||
import {
|
||||
formatFiles,
|
||||
joinPathFragments,
|
||||
readProjectConfiguration,
|
||||
Tree,
|
||||
@ -9,7 +10,9 @@ import { SwcExecutorOptions } from '../../utils/schema';
|
||||
|
||||
type OldSwcExecutorOptions = SwcExecutorOptions & { swcrcPath?: string };
|
||||
|
||||
export function updateSwcrcPath(tree: Tree) {
|
||||
export async function updateSwcrcPath(tree: Tree) {
|
||||
let changesMade = false;
|
||||
|
||||
forEachExecutorOptions(
|
||||
tree,
|
||||
'@nrwl/js:swc',
|
||||
@ -30,8 +33,14 @@ export function updateSwcrcPath(tree: Tree) {
|
||||
executorOptions.swcrc = newSwcrcPath;
|
||||
|
||||
updateProjectConfiguration(tree, projectName, projectConfig);
|
||||
|
||||
changesMade = true;
|
||||
}
|
||||
);
|
||||
|
||||
if (changesMade) {
|
||||
await formatFiles(tree);
|
||||
}
|
||||
}
|
||||
|
||||
export default updateSwcrcPath;
|
||||
|
||||
@ -8,6 +8,7 @@ import {
|
||||
readJson,
|
||||
writeJson,
|
||||
joinPathFragments,
|
||||
formatFiles,
|
||||
} from '@nrwl/devkit';
|
||||
import type { Tree } from '@nrwl/devkit';
|
||||
import type { Schema } from './schema';
|
||||
@ -152,6 +153,8 @@ export async function migrationGenerator(host: Tree, schema: Schema) {
|
||||
readJson<PackageJson>(host, packageJsonPath)
|
||||
);
|
||||
}
|
||||
|
||||
await formatFiles(host);
|
||||
}
|
||||
|
||||
export default migrationGenerator;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { formatChangedFilesWithPrettierIfAvailable } from 'nx/src/generators/internal-utils/format-changed-files-with-prettier-if-available';
|
||||
import { ProjectConfiguration } from '../../config/workspace-json-project-json';
|
||||
import type { Tree } from '../../generators/tree';
|
||||
import { updateJson } from '../../generators/utils/json';
|
||||
@ -43,4 +44,6 @@ export default async function (tree: Tree) {
|
||||
...projConfig,
|
||||
} as ProjectConfiguration);
|
||||
}
|
||||
|
||||
await formatChangedFilesWithPrettierIfAvailable(tree);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user