Cli-microsoft365: New command: project rename

Created on 24 Jan 2020  路  6Comments  路  Source: pnp/cli-microsoft365

Usage

spfx project rename [options]

Description

Fully rename a SPFx solution/component by updating all references to the original name used when creating a solution.
This would be very handy as sometimes solutions evolve to be something that was not fully expected when they were created and names may no longer fully describe the solution purpose.
Having a command to "replace" all instances of the name on the right places would be a great experience

Options

| Option | Description |
| ----------------------- | ----------------------------------------- |
| -n, --name <name> | The new name for the solution/component|

Additional Information

Sorry...no idea...

new feature waiting on response

Most helpful comment

For sure as I would like to check how the project is setup and give it a go (it has a great reputation 馃榿), but I anticipate I may only have time after the end of the month. I still have to add two reusable controls to the PnP repository and that will likely take all my spare time.
If no one else does it before the end of the month, then I will give it a try 馃憤

All 6 comments

Thanks for the suggestion @joelfmrodrigues. Could you give us a few examples of what you'd expect just so that we properly understand what you'd like to see? 馃檪

Sorry for the delay in getting back to this thread, and sorry if this will be non sense :) It came out as I got frustrated updating a solution that was created with a name that was no longer appropriate as the solution evolved dramatically into a different direction :) Updating all the references manually to tidy up things is a very boring task :)

I'm thinking on two different commands:

Update all the instances of the solution name provided during the creation process, and perhaps also the Id:

  • yo-rc.json: update libraryName and libraryId
  • deploy-azure-storage.json: update container property
  • package-solution.json: update name, id and zippedPackage
  • package.json: update name
  • readme.md: update title

Update the name and id of web parts or extensions

  • *.manifest.json: update id and all name references
  • config.json: components reference
  • update React component created by default - rename files and replace names in code
  • mystrings.d.ts: update references to previous name

Thanks for the clarification @joelfmrodrigues, it makes indeed sense to create two commands to keep things simple. I'll create specs for both of them and we can take it from there. Would you like to help building one of them?

Closing this issue in favor of two new issues with specs for the new commands.

For sure as I would like to check how the project is setup and give it a go (it has a great reputation 馃榿), but I anticipate I may only have time after the end of the month. I still have to add two reusable controls to the PnP repository and that will likely take all my spare time.
If no one else does it before the end of the month, then I will give it a try 馃憤

Awesome! Thanks again for the idea and the transparency about your availability 馃憦

Was this page helpful?
0 / 5 - 0 ratings