Skip to content

Mention npm scripts, per RFC-831 #302

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

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions guides/advanced-use/debugging.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- alex disable just -->
For most Ember applications, Ember CLI "just works". Run `ember server` in your Terminal and you get
a LiveReload development server at `http://localhost:4200`. Run `ember build`, and you get a `dist/`
For most Ember applications, Ember CLI "just works". Run `ember server` or `npm start` in your Terminal and you get
Copy link
Member

@MehulKChaudhari MehulKChaudhari Sep 18, 2023

Choose a reason for hiding this comment

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

Can we make it more generalised like use package manager whatever your project is using instead of just npm start?

Copy link
Member

Choose a reason for hiding this comment

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

We're going to merge this unchanged, our reasoning is that if you are using any other package manager you are likely going to know how to "translate" commands from npm to your chosen package manager 👍

a LiveReload development server at `http://localhost:4200`. Run `ember build --environment=production` or `npm run build`, and you get a `dist/`
directory with compiled assets ready to be deployed to your production server.

But things don't always go smoothly and CLI commands can fail inexplicably with error messages that
Expand Down Expand Up @@ -67,7 +67,7 @@ For example, if your app installs [`ember-power-select`][3], and you want to tes
You can verify this did the intended thing by checking that `node_modules/ember-power-select` is now
a symlink pointing to the cloned repo.

Now, in your app, if you run `ember server`, it should use the linked repo and any code changes in
Now, in your app, if you run `npm start` or `ember server`, it should use the linked repo and any code changes in
your local clone of `ember-power-select` should get picked up by the app.

## Broccoli Debug
Expand Down
11 changes: 11 additions & 0 deletions guides/basic-use/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ To stop an Ember server, press `control-c`.
If the local server will not start due to missing dependencies, use
`npm install` or `yarn install` to get going again.

Often, developers may run `npm start` instead of `ember serve`, since
there may be some application-specific environment variables or flags specified
in the `start` command of the project's `package.json`.

### Example use

By default, apps are served at port `4200`, but if you need to change it for some reason, you could visit your app at `http://localhost:3200` by using this command:
Expand Down Expand Up @@ -199,6 +203,13 @@ you can run only the first test with `ember test --filter="test one"`.

See `ember test --help` for more options!

### Running all tests including linters

`ember test` runs only the tests in the `tests` folder, so if you want to
run additional tests such as linters too, try `npm test` instead. It will run
all tests specified in your project's `package.json` script for the `test`
command.

### Learn more
- [The Ember.js Guides about Testing](https://guides.emberjs.com/release/testing/)
- [The Ember Super Rentals Tutorial](https://guides.emberjs.com/release/tutorial/ember-cli/) which shows step-by-step how to write tests and understand the results
Expand Down
5 changes: 4 additions & 1 deletion guides/basic-use/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ As a result, you may not need to understand or configure build steps, but it's s

Behind the scenes, deploying an app has two steps: building the app for production and pushing the result to a web server for hosting.

There are three main options for deploying your app: using the `ember build` command, installing `ember-cli-deploy`, or using pre-made build packs.
There are three main options for deploying your app: using the `ember build --environment=production` command, installing `ember-cli-deploy`, or using pre-made build packs.

### `ember build` and upload

Expand All @@ -29,6 +29,9 @@ ember build --environment production

The results of the `build` command are placed in the `dist` directory within your project.

Often, developers may run `npm run build` instead, since
there may be some application-specific environment variables or flags specified
in the `build` command of the project's `package.json`.

### Ember CLI Deploy

Expand Down
2 changes: 1 addition & 1 deletion guides/writing-addons/intro-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ There are several options to see the addon in action. We could use `npm link` or
2. In the Ember app's `package.json`, add a `devDependencies` entry for your addon, like `"addon-name": "*"`. The `*` means that it will include all version numbers of our addon.
3. Run `yarn install` or `npm install` in the app. (If you are using the app for the first time, you can use `npm install --prefer-offline` or `npm install --offline` instead. These alternative commands can speed up installation, because `npm install` checks the online npm registry for your addon instead of your local storage.)
4. Add a reference to your addon's component somewhere in an app template, like `<ComponentName @buttonLabel="Register" />`
5. Run a local server with `ember serve` and visit [http://localhost:4200](http://localhost:4200)
5. Run a local server with `npm start` or `ember serve`, and visit [http://localhost:4200](http://localhost:4200)

We should now see our addon in action!

Expand Down