Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some migrations missing call to formatFiles #10665

Closed
danielsharvey opened this issue Jun 9, 2022 · 3 comments · Fixed by #10709
Closed

Some migrations missing call to formatFiles #10665

danielsharvey opened this issue Jun 9, 2022 · 3 comments · Fixed by #10709
Assignees

Comments

@danielsharvey
Copy link
Contributor

Current Behavior

The current nx migrate --run-migrations appears to use a different set of formatting rules when compared with the standard nx format.

Specifically, the migration of project.json (etc) reformats this

"outputs": ["dist/apps/myproject"],

to this

"outputs": [
  "dist/apps/myproject"
],

I then need to run format to undo these changes:

nx format:write --files=angular.json

Expected Behavior

That migrated files would be consistent with nx format.

Steps to Reproduce

Run nx migrate --run-migrations where the migration alters project.json files (e.g. 14.x adding "$schema").

Observe format of migrated files.

Failure Logs

N/A

Environment

 >  NX   Report complete - copy this into the issue template

   Node : 16.15.0
   OS   : darwin arm64
   npm  : 8.12.1
   
   nx : 14.2.2
   @nrwl/angular : 14.2.2
   @nrwl/cypress : 14.2.2
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.2.2
   @nrwl/eslint-plugin-nx : 14.2.2
   @nrwl/express : 14.2.2
   @nrwl/jest : 14.2.2
   @nrwl/js : 14.2.2
   @nrwl/linter : 14.2.2
   @nrwl/nest : 14.2.2
   @nrwl/next : Not Found
   @nrwl/node : 14.2.2
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : 14.2.2
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.2.2
   @nrwl/web : Not Found
   @nrwl/workspace : 14.2.2
   typescript : 4.7.3
   ---------------------------------------
   Community plugins:
         @ngneat/transloco: 4.1.0
         @ngrx/effects: 14.0.0-rc.0
         @ngrx/router-store: 14.0.0-rc.0
         @ngrx/store: 14.0.0-rc.0
         @ngrx/store-devtools: 14.0.0-rc.0
         @ngxs/schematics: 0.0.1-alpha.5
         @nx-dotnet/core: 1.12.0
@AgentEnder
Copy link
Member

nx migrate itself doesn't run formatting. Rather, the individual migrations would call formatFiles. Its possible that there are some that are missing this, those should be found and updated.

Since you specifically noted this for the migration that added the $schema, would you like to submit a PR fixing it?

@AgentEnder AgentEnder added the scope: misc Misc issues label Jun 9, 2022
@AgentEnder AgentEnder changed the title nx migrate --run-migrations does not confirm to nx format for project.json Some migrations missing call to formatFiles Jun 9, 2022
@danielsharvey
Copy link
Contributor Author

Thanks. Will do.

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants