-
Notifications
You must be signed in to change notification settings - Fork 12k
docs: add move in/out docs #4400
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
Conversation
@johnpapa @wardbell @Foxandxss can you have a look as well please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I don't care for is since they'd be creating new and moving into the new folder structure they lose their git history which would be VERY useful for some projects. Thoughts?
- clean your folder from temporary files and ignored files using `git clean -fdx`. | ||
- rename your project folder to `old-awesome-app`. | ||
|
||
Now make a new project on the same folder as `old-awesome-app` using Angular-CLI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Angular CLI (no dash)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not loving "...-awesome-...". Too cute. Takes up mental space I need for other things. Can we get rid of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
- rename your project folder to `old-awesome-app`. | ||
|
||
Now make a new project on the same folder as `old-awesome-app` using Angular-CLI. | ||
- Read up on [Angular-CLI prerequisites](https://github.com/angular/angular-cli#prerequisites). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Angular CLI (no dash)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@Brocco there are instructions in the last step to copy over |
@@ -0,0 +1,63 @@ | |||
# Moving your project to Angular-CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are now saying "Angular CLI" (i saw a PR for this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must follow the Google docs standards and switch from "we" to "you".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's such a great idea to have the new and old in the same folder. Are you sure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@wardbell I don't see where 'we' is misused here. Can you point me in the right direction?
Regarding folder, they shouldn't be in the same folder. I'll clarify.
# Moving your project to Angular-CLI | ||
|
||
It's easy to move your existing project to use Angular-CLI. | ||
The most straightforward way is to to make a new CLI project and copy over your app files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to to --> to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify. No need to sell.
The easiest way to move an existing project to Angular CLI is to copy your application files into a new, empty CLI project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Let's see how to do it step by step. | ||
Here we use a project made with the [official QuickStart](https://github.com/angular/quickstart) | ||
as an example, but you should be able to adjust these instructions to other setups. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to other setups --> to your app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify how this edit would help? If an app is using the quickstart setup, these are the instructions they should follow and would need no adjustment. You only need to adjust if you're not using the quickstart boilerplate.
- clean your folder from temporary files and ignored files using `git clean -fdx`. | ||
- rename your project folder to `old-awesome-app`. | ||
|
||
Now make a new project on the same folder as `old-awesome-app` using Angular-CLI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be un desirable if the person wants to keep their existing git integrations. Just keep that in mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Git integration in the editor? I don't understand what you mean here.
- rename your project folder to `old-awesome-app`. | ||
|
||
Now make a new project on the same folder as `old-awesome-app` using Angular-CLI. | ||
- Read up on [Angular-CLI prerequisites](https://github.com/angular/angular-cli#prerequisites). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say "Verify you have ..." ... not "read up"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Now make a new project on the same folder as `old-awesome-app` using Angular-CLI. | ||
- Read up on [Angular-CLI prerequisites](https://github.com/angular/angular-cli#prerequisites). | ||
- Install the CLI globally: `npm install -g @angular/cli`. | ||
- Make a new app: `ng new awesome-app`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear that they have to go up a level before doing this. Someone might confuse it and think they are doing this inside their old app. We should make it clear they are doing this at same level as the old app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed via
Now make a new project on the same parent folder as
old-awesome-app
using Angular CLI.
- Compare `../old-awesome-project/package.json` to the new `./package.json` and add in your | ||
third party libraries and `@types/*` packages, project descriptions and any other fields. | ||
- Run `npm install` to install any packages you added. | ||
- Copy over any other files your app needs like images, icons, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy these assets where?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed via
- Copy over any other files your app needs like images into
src/assets
. Adjust paths on your app to use this folder e.g.<img src='assets/my-image.jpg>
.
@@ -0,0 +1,63 @@ | |||
# Moving your project to Angular-CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I think we could benefit from dividing this into 2 focus areas. This is targeted at moving any app. That's great and it should do that ... but maybe we should have a walk through do it exactly for the QuickStart. Showing step by step what they do. This will give folks something to try, before doing their own. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moving any app
You mean any Angular app, right?
I think a tutorial exercise that moved a QuickStart into CLI land would be great. It might need to be a little heftier than that if there are complications around routing. But if not, then that's perfect.
Similarly, nice to have an example for moving out of CLI-land.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused here... this example specifically shows moving a from and to quickstart app and that is said clearly on the second paragraph:
Here we use a project made with the official QuickStart as an example, but you should be able to adjust these instructions to other setups.
What makes you say this example isn't showing the quickstart details?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great start.
@@ -0,0 +1,63 @@ | |||
# Moving your project to Angular-CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moving any app
You mean any Angular app, right?
I think a tutorial exercise that moved a QuickStart into CLI land would be great. It might need to be a little heftier than that if there are complications around routing. But if not, then that's perfect.
Similarly, nice to have an example for moving out of CLI-land.
# Moving your project to Angular-CLI | ||
|
||
It's easy to move your existing project to use Angular-CLI. | ||
The most straightforward way is to to make a new CLI project and copy over your app files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify. No need to sell.
The easiest way to move an existing project to Angular CLI is to copy your application files into a new, empty CLI project.
@@ -0,0 +1,63 @@ | |||
# Moving your project to Angular-CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must follow the Google docs standards and switch from "we" to "you".
Copy over your app files. | ||
- Remove the existing app: `rm -rf src/app src/styles.css src/index.html e2e`. | ||
- Copy `src/app/`, `src/index.html`, `src/styles.css` and `e2e/`. | ||
If you don't have a `src/` folder then these files and folders should be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should teach the src/
folder? I think we have some verbiage around that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is showing everything assuming the src/
folder already.
There is only one line talking about the older structure, which I think is needed because every quickstart project made in the last year will still have the old structure.
- clean your folder from temporary files and ignored files using `git clean -fdx`. | ||
- rename your project folder to `old-awesome-app`. | ||
|
||
Now make a new project on the same folder as `old-awesome-app` using Angular-CLI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not loving "...-awesome-...". Too cute. Takes up mental space I need for other things. Can we get rid of it?
- Copy over the git folder: `cp ../old-awesome-project/.git .git` | ||
- Commit and push your changes as normal. | ||
|
||
You can now delete `../old-existing-project`, and you're done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
old-existing? or old-awesome?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not awesome anymore, just old. J/K, is a typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
The CLI runs static analysis on your code to ensure it's AOT ready, so you might run into a few | ||
new compilation errors that weren't there before. | ||
Check out this [handy list of AOT Do's and Dont's](https://github.com/rangle/angular-2-aot-sandbox#aot-dos-and-donts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get that "Handy list" into our docs NOW. Shouldn't have to go to rangle. @filipesilva, would you mind getting that underway?
You'll have to make a brand new project using your new project seed, move your app files and | ||
cater to any changes in the build process. | ||
|
||
Start with preparing your existing project folder, let's call it `awesome-app`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not. The name of the app isn't going to change. The new app and all of its project names should retain as much as possible of the old app. Rename the top level of the old project in a folder on your machine.
Do as separate clones maybe? Instead of trying to jack stuff around inside the same folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the app isn't going to change, but I don't know it's original name so I need to call it something.
quickstart-app
isn't a good name because the new app isn't going to be quickstart
one. your-app
isn't very good either because old-your-app
sounds weird. Can you offer an alternative suggestion?
Meanwhile I reworded to not imply you should change the app itself, rather that we're just using a name for your existing app.
Start with preparing your existing project folder. We'll refer to it as
awesome-app
.
Also adjusted text to clarify you're not supposed to do it inside the same folder.
@@ -0,0 +1,63 @@ | |||
# Moving your project to Angular-CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's such a great idea to have the new and old in the same folder. Are you sure?
@StephenFluin I believe you also wanted to review this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the move out, I would comment that you may need to translate all the environment changes you could have under environments/
cp ../old-awesome-project/src/app ./src/app | ||
cp ../old-awesome-project/src/index.html ./src/index.html | ||
cp ../old-awesome-project/src/styles.css ./src/styles.css | ||
cp ../old-awesome-project/e2e ./e2e/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe all this cp commands needs the recursive option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
- Copy over the git folder: `cp ../old-awesome-project/.git .git` | ||
- Commit and push your changes as normal. | ||
|
||
You can now delete `../old-existing-project`, and you're done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not awesome anymore, just old. J/K, is a typo
@@ -0,0 +1,49 @@ | |||
# Moving your project out of Angular-CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Angular CLI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@Foxandxss added this to clarify
|
1655dd4
to
1ac0858
Compare
Closed via 6b1d439 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fix #3198