Skip to content

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

Closed
wants to merge 6 commits into from

Conversation

filipesilva
Copy link
Contributor

@filipesilva filipesilva commented Feb 3, 2017

Fix #3198

@filipesilva filipesilva requested review from hansl and Brocco February 3, 2017 12:30
@filipesilva
Copy link
Contributor Author

filipesilva commented Feb 3, 2017

@johnpapa @wardbell @Foxandxss can you have a look as well please?

Copy link
Contributor

@Brocco Brocco left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Angular CLI (no dash)

Copy link
Contributor

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 link
Contributor Author

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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Angular CLI (no dash)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@filipesilva
Copy link
Contributor Author

@Brocco there are instructions in the last step to copy over .git, thus preserving history.

@@ -0,0 +1,63 @@
# Moving your project to Angular-CLI
Copy link
Contributor

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)

Copy link
Contributor

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 link
Contributor

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?

Copy link
Contributor Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to to --> to

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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.
Copy link
Contributor

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.

Copy link
Contributor Author

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).
Copy link
Contributor

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"

Copy link
Contributor Author

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`.
Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy these assets where?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

@wardbell wardbell left a 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
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Contributor

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!
Copy link
Contributor

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?

Copy link
Member

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

Copy link
Contributor Author

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)
Copy link
Contributor

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`.
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

@filipesilva
Copy link
Contributor Author

@StephenFluin I believe you also wanted to review this.

Copy link
Member

@Foxandxss Foxandxss left a 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/
Copy link
Member

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.

Copy link
Contributor Author

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!
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Angular CLI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@filipesilva
Copy link
Contributor Author

@Foxandxss added this to clarify environments (and also added style preprocessor info:

- If your styles are not in CSS, you'll need to convert them to CSS since the quickstart doesn't
use style preprocessors. You can also add preprocessor support yourself.
- Copy over the code your app needs from the `environments/` folder, if any.
You'll have to find another way to switch environments on the Quickstart

@filipesilva
Copy link
Contributor Author

Closed via 6b1d439

@filipesilva filipesilva deleted the add-migration-docs branch February 14, 2017 19:11
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking: Document steps to move in and out of the CLI
6 participants