1 |
|
2 | ember-cli
|
3 | ==============================================================================
|
4 |
|
5 | [![Latest npm release][npm-badge]][npm-badge-url]
|
6 | [![TravisCI Build Status][travis-badge]][travis-badge-url]
|
7 | [![AppVeyor Build Status][appveyor-badge]][appveyor-badge-url]
|
8 | [![Test Coverage][coveralls-badge]][coveralls-badge-url]
|
9 | [![Code Climate][codeclimate-badge]][codeclimate-badge-url]
|
10 |
|
11 | [logo]: https://avatars0.githubusercontent.com/u/10262982?v=3&s=150
|
12 | [npm-badge]: https://img.shields.io/npm/v/ember-cli.svg
|
13 | [npm-badge-url]: https://www.npmjs.com/package/ember-cli
|
14 | [travis-badge]: https://img.shields.io/travis/ember-cli/ember-cli/master.svg?label=TravisCI
|
15 | [travis-badge-url]: https://travis-ci.org/ember-cli/ember-cli
|
16 | [appveyor-badge]: https://img.shields.io/appveyor/ci/embercli/ember-cli/master.svg?label=AppVeyor
|
17 | [appveyor-badge-url]: https://ci.appveyor.com/project/embercli/ember-cli/branch/master
|
18 | [coveralls-badge]: https://img.shields.io/coveralls/ember-cli/ember-cli/master.svg
|
19 | [coveralls-badge-url]: https://coveralls.io/github/ember-cli/ember-cli
|
20 | [codeclimate-badge]: https://codeclimate.com/github/ember-cli/ember-cli/badges/gpa.svg
|
21 | [codeclimate-badge-url]: https://codeclimate.com/github/ember-cli/ember-cli
|
22 |
|
23 | The Ember.js command line utility.
|
24 |
|
25 |
|
26 | Features
|
27 | ------------------------------------------------------------------------------
|
28 |
|
29 | - Asset build pipeline using [Broccoli.js](http://broccolijs.com/)
|
30 | - ES6 transpilation using [Babel](https://babeljs.io/)
|
31 | - Project structure conventions using ES6 module syntax
|
32 | - Development server including live-reload and API proxy
|
33 | - File/Project generator using blueprints
|
34 | - Unit, Integration and Acceptance test support using
|
35 | [Testem](https://github.com/testem/testem)
|
36 | - Powerful addon system for extensibility
|
37 |
|
38 |
|
39 | Installation
|
40 | ------------------------------------------------------------------------------
|
41 |
|
42 | ```
|
43 | npm install -g ember-cli
|
44 | ```
|
45 |
|
46 | Usage
|
47 | ------------------------------------------------------------------------------
|
48 |
|
49 | After installation the `ember` CLI tool will be available to you. It is the
|
50 | entrypoint for all the functionality mentioned above.
|
51 |
|
52 | You can call `ember <command> --help` to find out more about all of the
|
53 | following commands or visit <https://ember-cli.com/user-guide/> to read
|
54 | the in-depth documentation.
|
55 |
|
56 |
|
57 | ### Create a new project
|
58 |
|
59 | ```
|
60 | ember new my-new-app
|
61 | ```
|
62 |
|
63 | This will create a new folder `my-new-app`, initialize a Git project in it,
|
64 | add the basic Ember.js project structure and install any necessary npm and
|
65 | Bower dependencies.
|
66 |
|
67 |
|
68 | ### Create a new addon project
|
69 |
|
70 | ```
|
71 | ember addon my-new-addon
|
72 | ```
|
73 |
|
74 | This is essentially similar to `ember new` but will generate the structure
|
75 | for an ember-cli addon instead.
|
76 |
|
77 |
|
78 | ### Build the project
|
79 |
|
80 | ```
|
81 | ember build
|
82 | ```
|
83 |
|
84 | This will create a `dist` folder and run the build pipeline to generate all
|
85 | the output files in it. You can specify `--environment=production` to build
|
86 | in production mode, which includes code minification and other optimizations.
|
87 |
|
88 |
|
89 | ### Run the development server
|
90 |
|
91 | ```
|
92 | ember serve
|
93 | ```
|
94 |
|
95 | This will launch a development server that will automatically rebuild your
|
96 | project on file changes and serves the built app at <http://localhost:4200/>.
|
97 |
|
98 |
|
99 | ### Run the test suite
|
100 |
|
101 | ```
|
102 | ember test
|
103 | ```
|
104 |
|
105 | This command will start the Testem runner, which will run all your tests from
|
106 | the `tests` folder. This command also supports a `--server` option which will
|
107 | automatically run tests on file changes.
|
108 |
|
109 |
|
110 | ### Generate files
|
111 |
|
112 | ```
|
113 | ember generate route foo
|
114 | ```
|
115 |
|
116 | This will generate a `route` named `foo`. `route` is an example here and can
|
117 | be replaced by any other available blueprint. Blueprints are provided by
|
118 | ember-cli itself and any of you installed addons. Run `ember generate --help`
|
119 | to see a list of available blueprints in your project and their options.
|
120 |
|
121 |
|
122 | ### Install an ember-cli addon
|
123 |
|
124 | ```
|
125 | ember install some-other-addon
|
126 | ```
|
127 |
|
128 | This will search npm for a package named `some-other-addon`, install it and
|
129 | run any additional install steps defined in the addon.
|
130 |
|
131 |
|
132 | Community
|
133 | ------------------------------------------------------------------------------
|
134 |
|
135 | - Slack: [Get your invite](https://ember-community-slackin.herokuapp.com/)
|
136 | - IRC: #ember-cli on [freenode](https://webchat.freenode.net/?channels=%23ember-cli)
|
137 | - Issues: [ember-cli/issues](https://github.com/ember-cli/ember-cli/issues)
|
138 | - Website: [ember-cli.com](https://ember-cli.com)
|
139 |
|
140 |
|
141 | Development
|
142 | ------------------------------------------------------------------------------
|
143 |
|
144 | Start by cloning the Git project to your local hard drive:
|
145 |
|
146 | ```
|
147 | git clone https://github.com/ember-cli/ember-cli.git
|
148 | ```
|
149 |
|
150 | ### Link `ember` to your development version
|
151 |
|
152 |
|
153 | Running the following command will link the global `ember` utility to your
|
154 | local development version:
|
155 |
|
156 | ```
|
157 | npm link
|
158 | ```
|
159 |
|
160 | Note that the global `ember` CLI utility will automatically relay to any
|
161 | project-local ember-cli installation. If you want to use your development
|
162 | version there instead run the following command from your Ember.js
|
163 | project folder:
|
164 |
|
165 | ```
|
166 | npm link ember-cli
|
167 | ```
|
168 |
|
169 | Read the official [npm-link documentation](https://www.npmjs.org/doc/cli/npm-link.html)
|
170 | for more information.
|
171 |
|
172 |
|
173 | ### Run the test suite
|
174 |
|
175 | ```
|
176 | npm test
|
177 | ```
|
178 |
|
179 | will run ESLint and the "fast" subset of the test suite. Run
|
180 | `npm run test-all` for the full test suite which will currently take quite a
|
181 | few minutes due to heavy IO and network usage.
|
182 |
|
183 | ember-cli is using [Mocha](https://mochajs.org/) for its internal tests. If
|
184 | you want to run a specific subset of tests have a look at their
|
185 | [documentation](https://mochajs.org/#exclusive-tests).
|
186 |
|
187 |
|
188 | ## Build the documentation
|
189 |
|
190 | Use `npm run docs` to build HTML and JSON documentation with YUIDoc and place
|
191 | it in `docs/build/`. Please help by improving this documentation.
|
192 |
|
193 |
|
194 | License
|
195 | ------------------------------------------------------------------------------
|
196 |
|
197 | This project is licensed under the [MIT License](LICENSE).
|