Skip to content

Running npx @fluentui/codemods in project results in only 'Mod was a NoOp on this file' messages #19847

Description

@MarksPoint

Environment Information

  • Package version(s): Running latest version of @fluentui/codemods using npx @fluentui/codemods, I believe it's version 8.2.1
  • Browser and OS versions: macOS Big Sur 11.4, node 14.17.0, npx 6.14.13

Please provide a reproduction of the bug in a codepen:

Some background

  • We've built a lot of modules that use various (older) versions of Fluent UI React. Most of them use some 7.x version of office-ui-fabric-react. We want to upgrade these solutions to the new @fluentui/react library
  • I've tried to run npx @fluentui/codemods to help upgrading our solutions but nothing gets updated

Reproduction
I've used our Yeoman generator to build a dummy module. You can use this project (Archive.zip) or you can use the generator yourself:

  • Install Yeoman (npm install -g yo)
  • Install our Yeoman generator (npm install -g @ichicraft/generator-widgets)
  • Create a folder and go to that folder
  • Run our generator (yo @ichicraft/widgets)
  • Accept all the default answers
  • Wait for npm install to finish
  • Run npx @fluentui/codemods
  • See that no updates are done to the .tsx files
  • See several messages in the output of the command with 'Mod was a NoOp on this file'

Actual behavior:

Output

npx: installed 69 in 4.164s
fetching codeMod at  /Users/markvandijk/.npm/_npx/57698/lib/node_modules/@fluentui/codemods/lib/codeMods/mods/componentToCompat/componentToCompat.mod.js
fetching codeMod at  /Users/markvandijk/.npm/_npx/57698/lib/node_modules/@fluentui/codemods/lib/codeMods/mods/configMod/configMod.mod.js
fetching codeMod at  /Users/markvandijk/.npm/_npx/57698/lib/node_modules/@fluentui/codemods/lib/codeMods/mods/officeToFluentImport/officeToFluentImport.mod.js
fetching codeMod at  /Users/markvandijk/.npm/_npx/57698/lib/node_modules/@fluentui/codemods/lib/codeMods/mods/oldToNewButton/oldToNewButton.mod.js
fetching codeMod at  /Users/markvandijk/.npm/_npx/57698/lib/node_modules/@fluentui/codemods/lib/codeMods/mods/personaToAvatar/personaToAvatar.mod.js
getting configs
File index.ts has had the following mods error:
name:  configMod errorData:  {
  modName: 'configMod',
  error: 'failed to get any mods from json. Perhaps the file is missing or malformed?'
}
File index.ts has had the following mods run:
name:  RepathOfficeImportsToFluent logdata:  [ 'Mod was a NoOp on this file' ]
File typings.d.ts has had the following mods run:
name:  configMod logdata:  [ 'Mod was a NoOp on this file' ]
name:  RepathOfficeImportsToFluent logdata:  [ 'Mod was a NoOp on this file' ]
File App.tsx has had the following mods run:
name:  configMod logdata:  [ 'Mod was a NoOp on this file' ]
name:  RepathOfficeImportsToFluent logdata:  [ 'Mod was a NoOp on this file' ]
File LikeIcon.tsx has had the following mods run:
name:  configMod logdata:  [ 'Mod was a NoOp on this file' ]
name:  RepathOfficeImportsToFluent logdata:  [ 'Mod was a NoOp on this file' ]
File widget.module.scss.d.ts has had the following mods run:
name:  configMod logdata:  [ 'Mod was a NoOp on this file' ]
name:  RepathOfficeImportsToFluent logdata:  [ 'Mod was a NoOp on this file' ]

Expected behavior:

  • I was expecting that all references to office-ui-fabric-react would be updated to the new @fluentui/react library
  • I also expected the package.json being updated to include new (replacement) packages from the @FluentUI scope instead of the old @uifabric scope.

Priorities and help requested:

Are you willing to submit a PR to fix? > Not too familiar with this project, so preferrably no

Requested priority: Blocking (not at all working)

Products/sites affected: Our product Ichicraft Boards relies heavily on Fluent UI and it would save us a lot of time if we could upgrade/migrate somewhat automatically

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions