The full path to globally changing the Ember app name

I built the Ember app with CLI and 2.0 - this is a plant hat app, so I called it "plant-hat".

A few months later, I realized that people don’t really like to wear plants on their heads, so I redid it to sell Shoes Filled with Worms. I think this time it will really take off.

So, I want to rename the application and any important parts of it - as if from the very beginning I created it as “worm boots”.

What steps do I take to not miss anything?

+5
source share
3 answers

TBH, I would buy hats from plants ...

Lol but seriously:

Below are the locations where the name of the app excluding that you created, i.e. these are the places where ember-cli puts your default application name:

package.json:

"name": "...", 

environment.js:

 modulePrefix: '...', 

bower.json

 "name": "...", 

application / index.html

 <link rel="stylesheet" href="assets/....css"> <script src="assets/....js"></script> 

tests / index.html

 <link rel="stylesheet" href="assets/....css"> <script src="assets/....js"></script> 

Replace ... new application name.

Thanks.

+5
source

cd to your application, ember init --name=shoes-filled-with-worms view diffs

+3
source

This is what worked for me -

rm -rf node_modules/ dist/

grep -nr 'current-project-name*' .

This will return about 8-10 files (if you did not use the name in your application). Then you can make changes manually or automate it like this:

grep -nr 'current-project-name*' . | xargs sed -i 's/current-project-name/new-app-name/g'

You will need to do npm install to reinstall node modules

-

I am using ember 2.15.1 and had to modify the following files -

 ./tests/index.html ./tests/unit/initializers/ember-simple-auth-test.js ./package-lock.json ./app/index.html ./README.md ./package.json ./config/environment.js ./bower.json 
+2
source

Source: https://habr.com/ru/post/1232356/


All Articles