Skip to content

Commit

Permalink
Merge pull request #235 from kategengler/kg-npm-commands
Browse files Browse the repository at this point in the history
Switch ember serve(r) -> npm start
  • Loading branch information
ef4 authored Jan 5, 2024
2 parents 6323536 + d9350d1 commit 67a50e7
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 35 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,13 @@ Start a server (background task).
Example:

```run:server:start cwd=super-rentals expect="Serving on http://localhost:4200/"
ember server
npm start
```

Result:

```shell
$ ember server
$ npm start
Build successful (9006ms) – Serving on http://localhost:4200/
```

Expand Down Expand Up @@ -574,7 +574,7 @@ Stop a server (background task) previously started with `run:server:start`.
Example:

```run:server:stop
ember server
npm start
```

The content of the source code block is the command used to start the server.
Expand All @@ -589,7 +589,7 @@ Options:

## How?

* Requires [Volta](https://volta.sh), `git`
* Requires `git`
* Probably only works on Unix/bash for now (PRs welcome)
* Should probably run the build in a docker container anyway
* `yarn install`
Expand Down
12 changes: 6 additions & 6 deletions src/markdown/tutorial/part-1/01-orientation.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,19 @@ We'll learn about the purposes of these files and folders as we go. For now, jus
## Starting and Stopping the Development Server
Ember CLI comes with a lot of different commands for a variety of development tasks, such as the `ember new` command that we saw earlier. It also comes with a *development server*, which we can launch with the `ember serve` command:
Ember CLI comes with a lot of different commands for a variety of development tasks, such as the `ember new` command that we saw earlier. It also comes with a *development server*, which we can launch within the project with the `npm start` command:
```run:server:start cwd=super-rentals expect="Serving on http://localhost:4200/"
#[cfg(all(ci, unix))]
#[display(ember serve)]
ember serve | awk '{ \
#[display(npm start)]
npm start | awk '{ \
gsub("Build successful \\([0-9]+ms\\)", "Build successful (9761ms)"); \
print; \
system("") # https://unix.stackexchange.com/a/83853 \
}'
#[cfg(not(all(ci, unix)))]
ember serve
npm start
```
The development server is responsible for compiling our app and serving it to the browsers. It may take a while to boot up. Once it's up and running, open your favorite browser and head to <http://localhost:4200>. You should see the following welcome page:
Expand All @@ -258,7 +258,7 @@ visit http://localhost:4200/?deterministic
>
> The `localhost` address in the URL means that you can only access the development server from your local machine. If you would like to share your work with the world, you will have to *[deploy](https://cli.emberjs.com/release/basic-use/deploying/)* your app to the public Internet. We'll cover how to do that in Part 2 of the tutorial.
You can exit out of the development server at any time by typing `Ctrl + C` into the terminal window where `ember serve` is running. That is, typing the "C" key on your keyboard *while* holding down the "Ctrl" key at the same time. Once it has stopped, you can start it back up again with the same `ember server` command. We recommend having two terminal windows open: one to run the server in background, another to type other Ember CLI commands.
You can exit out of the development server at any time by typing `Ctrl + C` into the terminal window where `npm start` is running. That is, typing the "C" key on your keyboard *while* holding down the "Ctrl" key at the same time. Once it has stopped, you can start it back up again with the same `npm start` command. We recommend having two terminal windows open: one to run the server in background, another to type other Ember CLI commands.
## Editing Files and Live Reload
Expand Down Expand Up @@ -402,7 +402,7 @@ visit http://localhost:4200/?deterministic
```

```run:server:stop
ember serve
npm start
```

```run:checkpoint cwd=super-rentals
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-1/02-building-pages.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--lint disable no-undefined-references-->

```run:server:start hidden=true cwd=super-rentals expect="Serving on http://localhost:4200/"
ember serve
npm start
```

In this chapter, you will build the first few pages of your Ember app and set up links between them. By the end of this chapter, you should have two new pages – an about page and a contact page. These pages will be linked to from your landing page:
Expand Down Expand Up @@ -192,7 +192,7 @@ We will learn more about how all of this works soon. In the meantime, go ahead a
Congratulations, you are well on your way to becoming a master page-crafter!

```run:server:stop
ember serve
npm start
```

```run:checkpoint cwd=super-rentals
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-1/03-automated-testing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--lint disable no-undefined-references-->

```run:server:start hidden=true cwd=super-rentals expect="Serving on http://localhost:4200/"
ember serve
npm start
```

In this chapter, you will use Ember's built-in testing framework to write some automated tests for your app. By the end of this chapter, we will have an automated test suite that we can run to ensure our app is working correctly:
Expand Down Expand Up @@ -192,7 +192,7 @@ For the rest of the tutorial, we will continue to add more automated tests as we
If you are in a hurry, you can skip over the testing sections in this tutorial and still be able to follow along with everything else. But don't you find it super satisfying&mdash;*oddly satisfying*&mdash;to watch a robot click on things really, really fast?

```run:server:stop
ember serve
npm start
```

```run:checkpoint cwd=super-rentals
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-1/04-component-basics.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--lint disable no-undefined-references-->

```run:server:start hidden=true cwd=super-rentals expect="Serving on http://localhost:4200/"
ember serve
npm start
```

In this chapter, you will *[refactor](../../../components/introducing-components/#toc_breaking-it-into-pieces)* your existing templates to use components. We will also be adding a site-wide navigation bar:
Expand Down Expand Up @@ -372,7 +372,7 @@ wait #qunit-banner.qunit-pass
```

```run:server:stop
ember serve
npm start
```

```run:checkpoint cwd=super-rentals
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-1/05-more-about-components.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--lint disable no-undefined-references-->

```run:server:start hidden=true cwd=super-rentals expect="Serving on http://localhost:4200/"
ember serve
npm start
```

It's time to finally work on the rentals listing:
Expand Down Expand Up @@ -249,7 +249,7 @@ wait #qunit-banner.qunit-pass
```
```run:server:stop
ember serve
npm start
```
```run:checkpoint cwd=super-rentals
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-1/06-interactive-components.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--lint disable no-undefined-references-->

```run:server:start hidden=true cwd=super-rentals expect="Serving on http://localhost:4200/"
ember serve
npm start
```

In this chapter, you will add interactivity to the page, allowing the user to click an image to enlarge or shrink it:
Expand Down Expand Up @@ -341,7 +341,7 @@ wait #qunit-banner.qunit-pass
```

```run:server:stop
ember serve
npm start
```

```run:checkpoint cwd=super-rentals
Expand Down
10 changes: 5 additions & 5 deletions src/markdown/tutorial/part-1/07-reusable-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@ After saving the changes to our configuration file, we will need to restart our

<!-- TODO: https://github.com/ember-cli/ember-cli/issues/8782 -->

You can stop the server by finding the terminal window where `ember serve` is running, then type `Ctrl + C`. That is, typing the "C" key on your keyboard *while* holding down the "Ctrl" key at the same time. Once it has stopped, you can start it back up again with the same `ember server` command.
You can stop the server by finding the terminal window where `npm start` is running, then type `Ctrl + C`. That is, typing the "C" key on your keyboard *while* holding down the "Ctrl" key at the same time. Once it has stopped, you can start it back up again with the same `npm start` command.

```run:server:start cwd=super-rentals expect="Serving on http://localhost:4200/"
#[cfg(all(ci, unix))]
#[display(ember serve)]
ember serve | awk '{ \
#[display(npm start)]
npm start | awk '{ \
gsub("Build successful \\([0-9]+ms\\)", "Build successful (13286ms)"); \
print; \
system("") # https://unix.stackexchange.com/a/83853 \
}'
#[cfg(not(all(ci, unix)))]
ember serve
npm start
```

## Generating a Component with a Component Class
Expand Down Expand Up @@ -465,7 +465,7 @@ wait #qunit-banner.qunit-pass
```
```run:server:stop
ember serve
npm start
```
```run:checkpoint cwd=super-rentals
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-1/08-working-with-data.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--lint disable no-undefined-references-->

```run:server:start hidden=true cwd=super-rentals expect="Serving on http://localhost:4200/"
ember serve
npm start
```

In this chapter, we will remove the hard-coded data from our `<Rental>` component. By the end, your app would finally be displaying real data that came from the server:
Expand Down Expand Up @@ -387,7 +387,7 @@ wait #qunit-banner.qunit-pass
```

```run:server:stop
ember serve
npm start
```

```run:checkpoint cwd=super-rentals
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-2/09-route-params.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--lint disable no-undefined-references-->

```run:server:start hidden=true cwd=super-rentals expect="Serving on http://localhost:4200/"
ember serve
npm start
```

Now that we are fetching real data from our "server", let's add a new feature — dedicated pages for each of our rentals:
Expand Down Expand Up @@ -374,7 +374,7 @@ wait #qunit-banner.qunit-pass
This page *looks* done, but we have a share button that doesn't actually work. We'll address this in the next chapter.

```run:server:stop
ember serve
npm start
```

```run:checkpoint cwd=super-rentals
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-2/10-service-injection.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--lint disable no-undefined-references-->

```run:server:start hidden=true cwd=super-rentals expect="Serving on http://localhost:4200/"
ember serve
npm start
```

As promised, we will now work on implementing the share button!
Expand Down Expand Up @@ -417,7 +417,7 @@ wait #qunit-banner.qunit-pass
```
```run:server:stop
ember serve
npm start
```
```run:checkpoint cwd=super-rentals
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-2/11-ember-data.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--lint disable no-undefined-references-->

```run:server:start hidden=true cwd=super-rentals expect="Serving on http://localhost:4200/"
ember serve
npm start
```

In this chapter, we will work on removing some code duplication in our route handlers, by switching to using EmberData to manage our data. The end result looks exactly the same as before:
Expand Down Expand Up @@ -327,7 +327,7 @@ wait .rental.detailed
EmberData offers many, many features (like managing the *relationships* between different models) and there's a lot more we can learn about it. For example, if your backend's have some inconsistencies across different endpoints, EmberData allows you to define more specific, per-model adapters and serializers too! We are just scratching the surface here. If you want to learn more about EmberData, check out [its own dedicated section](../../../models/) in the guides!
```run:server:stop
ember serve
npm start
```
```run:checkpoint cwd=super-rentals
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-2/12-provider-components.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--lint disable no-undefined-references-->

```run:server:start hidden=true cwd=super-rentals expect="Serving on http://localhost:4200/"
ember serve
npm start
```

In this chapter, we'll work on adding a new search feature, and refactor our `index.hbs` template into a new component along the way. We'll learn about a new pattern for passing data around between components, too! Once we're done, our page will look like this:
Expand Down Expand Up @@ -391,7 +391,7 @@ wait #qunit-banner.qunit-pass
```

```run:server:stop
ember serve
npm start
```

```run:checkpoint cwd=super-rentals
Expand Down

0 comments on commit 67a50e7

Please sign in to comment.