ember-cli 4.0.0-beta.4 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +4 -4
- package/CHANGELOG.md +28 -17
- package/bin/ember +0 -0
- package/blueprints/addon/additional-dev-dependencies.json +1 -1
- package/blueprints/addon/files/.github/workflows/ci.yml +5 -1
- package/blueprints/addon/files/.travis.yml +1 -1
- package/blueprints/addon/files/README.md +2 -2
- package/blueprints/addon/files/addon-config/ember-try.js +4 -4
- package/blueprints/app/files/.github/workflows/ci.yml +4 -0
- package/blueprints/app/files/package.json +8 -8
- package/blueprints/in-repo-addon/files/__root__/__name__/index.js +0 -0
- package/blueprints/in-repo-addon/index.js +0 -0
- package/blueprints/lib/index.js +0 -0
- package/docs/build/data.json +413 -413
- package/lib/models/host-info-cache.js +3 -5
- package/lib/models/per-bundle-addon-cache/index.js +2 -3
- package/lib/tasks/npm-task.js +1 -1
- package/lib/utilities/get-lang-arg.js +45 -45
- package/package.json +25 -25
- package/.github/ISSUE_TEMPLATE.md +0 -12
- package/.github/dependabot.yml +0 -15
- package/.github/workflows/coverage.yml +0 -31
- package/docs/analytics.md +0 -44
- package/docs/architecture.md +0 -316
- package/docs/assets/architecture/Ember-CLI architecture.png +0 -0
- package/docs/assets/architecture/Ember-CLI architecture.xml +0 -1
- package/docs/assets/architecture/README.md +0 -5
- package/docs/brocfile-transition.md +0 -46
- package/docs/build/api.js +0 -44
- package/docs/build/assets/css/external-small.png +0 -0
- package/docs/build/assets/css/logo.png +0 -0
- package/docs/build/assets/css/main.css +0 -555
- package/docs/build/assets/favicon.ico +0 -0
- package/docs/build/assets/img/spinner.gif +0 -0
- package/docs/build/assets/index.html +0 -10
- package/docs/build/assets/js/api-filter.js +0 -56
- package/docs/build/assets/js/api-list.js +0 -255
- package/docs/build/assets/js/api-search.js +0 -98
- package/docs/build/assets/js/apidocs.js +0 -376
- package/docs/build/assets/js/yui-prettify.js +0 -17
- package/docs/build/assets/vendor/prettify/CHANGES.html +0 -130
- package/docs/build/assets/vendor/prettify/COPYING +0 -202
- package/docs/build/assets/vendor/prettify/README.html +0 -203
- package/docs/build/assets/vendor/prettify/prettify-min.css +0 -1
- package/docs/build/assets/vendor/prettify/prettify-min.js +0 -1
- package/docs/build/classes/Addon.html +0 -4318
- package/docs/build/classes/AmdTransformAddon.html +0 -202
- package/docs/build/classes/Blueprint.html +0 -4796
- package/docs/build/classes/Builder.html +0 -611
- package/docs/build/classes/CLI.html +0 -810
- package/docs/build/classes/Command.html +0 -1655
- package/docs/build/classes/DefaultPackager.html +0 -202
- package/docs/build/classes/EmberAddon.html +0 -2207
- package/docs/build/classes/EmberApp.html +0 -2225
- package/docs/build/classes/HardwareInfo.html +0 -620
- package/docs/build/classes/HistorySupportAddon.html +0 -203
- package/docs/build/classes/Instrumentation.html +0 -695
- package/docs/build/classes/NodeModulesList.html +0 -460
- package/docs/build/classes/NpmTask.html +0 -333
- package/docs/build/classes/PackageInfo.html +0 -1390
- package/docs/build/classes/PackageInfoCache.html +0 -963
- package/docs/build/classes/PerBundleAddonCache {.html +0 -1010
- package/docs/build/classes/Project.html +0 -2083
- package/docs/build/classes/ServeFilesAddon.html +0 -260
- package/docs/build/classes/TestsServerAddon.html +0 -203
- package/docs/build/classes/WatcherAddon.html +0 -204
- package/docs/build/classes/WindowsSymlinkChecker.html +0 -1505
- package/docs/build/files/lib_broccoli_default-packager.js.html +0 -1426
- package/docs/build/files/lib_broccoli_ember-addon.js.html +0 -159
- package/docs/build/files/lib_broccoli_ember-app.js.html +0 -1913
- package/docs/build/files/lib_cli_cli.js.html +0 -417
- package/docs/build/files/lib_models_addon-info.js.html +0 -112
- package/docs/build/files/lib_models_addon.js.html +0 -1866
- package/docs/build/files/lib_models_blueprint.js.html +0 -1678
- package/docs/build/files/lib_models_builder.js.html +0 -417
- package/docs/build/files/lib_models_command.js.html +0 -804
- package/docs/build/files/lib_models_hardware-info.js.html +0 -479
- package/docs/build/files/lib_models_host-info-cache.js.html +0 -428
- package/docs/build/files/lib_models_installation-checker.js.html +0 -181
- package/docs/build/files/lib_models_instantiate-addons.js.html +0 -191
- package/docs/build/files/lib_models_instrumentation.js.html +0 -433
- package/docs/build/files/lib_models_package-info-cache_index.js.html +0 -793
- package/docs/build/files/lib_models_package-info-cache_node-modules-list.js.html +0 -208
- package/docs/build/files/lib_models_package-info-cache_package-info.js.html +0 -661
- package/docs/build/files/lib_models_per-bundle-addon-cache_addon-proxy.js.html +0 -252
- package/docs/build/files/lib_models_per-bundle-addon-cache_index.js.html +0 -485
- package/docs/build/files/lib_models_per-bundle-addon-cache_target-instance.js.html +0 -108
- package/docs/build/files/lib_models_project.js.html +0 -913
- package/docs/build/files/lib_models_task.js.html +0 -117
- package/docs/build/files/lib_tasks_build-watch.js.html +0 -157
- package/docs/build/files/lib_tasks_npm-task.js.html +0 -463
- package/docs/build/files/lib_tasks_serve.js.html +0 -207
- package/docs/build/files/lib_tasks_server_middleware_broccoli-serve-files_index.js.html +0 -127
- package/docs/build/files/lib_tasks_server_middleware_broccoli-watcher_index.js.html +0 -158
- package/docs/build/files/lib_tasks_server_middleware_history-support_index.js.html +0 -181
- package/docs/build/files/lib_tasks_server_middleware_tests-server_index.js.html +0 -171
- package/docs/build/files/lib_tasks_test-server.js.html +0 -167
- package/docs/build/files/lib_tasks_transforms_amd_index.js.html +0 -143
- package/docs/build/files/lib_utilities_ember-app-utils.js.html +0 -292
- package/docs/build/files/lib_utilities_insert-into-file.js.html +0 -219
- package/docs/build/files/lib_utilities_is-lazy-engine.js.html +0 -125
- package/docs/build/files/lib_utilities_is-yarn-project.js.html +0 -120
- package/docs/build/files/lib_utilities_valid-project-name.js.html +0 -142
- package/docs/build/files/lib_utilities_will-interrupt-process.js.html +0 -290
- package/docs/build/files/lib_utilities_windows-admin.js.html +0 -230
- package/docs/build/index.html +0 -125
- package/docs/build/modules/ember-cli.html +0 -152
- package/docs/build/modules/is-lazy-engine.html +0 -106
- package/docs/build-concurrency.md +0 -15
- package/docs/build-pipeline-debugging.md +0 -33
- package/docs/code-coverage.md +0 -14
- package/docs/error-propagation.md +0 -136
- package/docs/experiments.md +0 -53
- package/docs/node-support.md +0 -43
- package/docs/perf-guide.md +0 -250
- package/docs/project_version_preprocessor.js +0 -8
- package/docs/sourcemaps.md +0 -60
- package/docs/yuidoc.json +0 -13
package/docs/architecture.md
DELETED
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
## Architecture
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
- **cli** parses args and calls the respective **command**
|
|
7
|
-
- **command** calls a sequence of **tasks**
|
|
8
|
-
- **tasks** do the actual work
|
|
9
|
-
|
|
10
|
-
## The different components of ember-cli
|
|
11
|
-
### cli()
|
|
12
|
-
cli is a small function that gets everything going.
|
|
13
|
-
|
|
14
|
-
Usage:
|
|
15
|
-
``` JavaScript
|
|
16
|
-
let cli = require('./cli');
|
|
17
|
-
|
|
18
|
-
cli({
|
|
19
|
-
cliArgs: argv, // Required
|
|
20
|
-
inputStream: inputStream, // Required
|
|
21
|
-
outputStream: outputStream // Required
|
|
22
|
-
})
|
|
23
|
-
.then(...);
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## UI
|
|
27
|
-
In ember-cli we pass a `UI` instance around. Instead of calling
|
|
28
|
-
`console.log` or writing things directly to `process.stdout` we access
|
|
29
|
-
those through this wrapper. This makes our code testing friendly
|
|
30
|
-
because it lets us simulate user input and it lets us verify if the output
|
|
31
|
-
matches the expected output in tests.
|
|
32
|
-
|
|
33
|
-
`ui.prompt(options).then(...)` can be used to get user input. It wraps the [inquirer node
|
|
34
|
-
package](https://github.com/SBoudrias/Inquirer.js). See its documentation for
|
|
35
|
-
usage instructions. Note: Navigation with
|
|
36
|
-
arrow keys doesn't work properly on windows, only use prompt types with
|
|
37
|
-
text input.
|
|
38
|
-
|
|
39
|
-
`ui.write()` can be used to write something to the output stream. It's just
|
|
40
|
-
`this.outputStream.write(data);` internally.
|
|
41
|
-
|
|
42
|
-
`ui.inputStream`, `ui.outputStream` can be used for things that require a
|
|
43
|
-
stream. Also nice for testing, e.g. simulating input.
|
|
44
|
-
|
|
45
|
-
### Commands
|
|
46
|
-
Located in `lib/commands/`. They get picked up by `requireAsHash()`
|
|
47
|
-
automatically.
|
|
48
|
-
|
|
49
|
-
The CLI constructs command instances with dependencies including ui,
|
|
50
|
-
analytics, commands, project, etc. The plan is for these to eventually
|
|
51
|
-
be constructed and wired up via a dependency injection container.
|
|
52
|
-
|
|
53
|
-
The following file structure is expected (Demonstrated on the imaginary
|
|
54
|
-
command `develop-ember-cli`):
|
|
55
|
-
|
|
56
|
-
``` JavaScript
|
|
57
|
-
// e.g. commands/develop-ember-cli.js
|
|
58
|
-
|
|
59
|
-
let Command = require('../models/command');
|
|
60
|
-
|
|
61
|
-
module.exports = Command.extend({
|
|
62
|
-
name: 'develop-ember-cli', // Optional, default is the filename
|
|
63
|
-
// Powered by some magic in getCallerFile()
|
|
64
|
-
key: 'developEmberCLI', // Optional, default is the camelized name
|
|
65
|
-
description: 'Explanation', // Optional
|
|
66
|
-
aliases: ['d', 'go-tomster'], // Optional, default is an empty array
|
|
67
|
-
works: 'everywhere', // 'insideProject', 'outsideProject' or 'everywhere'
|
|
68
|
-
// Optional, default is 'insideProject'
|
|
69
|
-
|
|
70
|
-
availableOptions: [ // Optional, default is an empty array
|
|
71
|
-
{
|
|
72
|
-
name: 'package-name', // Required
|
|
73
|
-
key: 'packageName' // Optional, default is the camelized name
|
|
74
|
-
description: '...', // Optional
|
|
75
|
-
type: String, // Required
|
|
76
|
-
default: 'ember-cli', // Optional, default is undefined
|
|
77
|
-
required: false // Optional, default is false
|
|
78
|
-
},
|
|
79
|
-
...
|
|
80
|
-
],
|
|
81
|
-
|
|
82
|
-
anonymousOptions: [
|
|
83
|
-
'<option-1>',
|
|
84
|
-
'<option-2>',
|
|
85
|
-
...
|
|
86
|
-
],
|
|
87
|
-
|
|
88
|
-
run(options) { // Required
|
|
89
|
-
// options === { packageName, ... }
|
|
90
|
-
|
|
91
|
-
// Run tasks and return a promise
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
printDetailedHelp() { // Optional
|
|
95
|
-
this.ui.write('Detailed help...');
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
For more information on possible option types, see the [documentation for the
|
|
101
|
-
nopt library](https://github.com/npm/nopt).
|
|
102
|
-
|
|
103
|
-
Best practice is to use the `run()` function only to execute tasks. The real
|
|
104
|
-
work should be done in these tasks, then.
|
|
105
|
-
|
|
106
|
-
The promise returned by `run()` should either
|
|
107
|
-
|
|
108
|
-
- resolve to `undefined`
|
|
109
|
-
- reject with an `Error` instance if the error is unhandled
|
|
110
|
-
- or reject with `undefined` if it was handled. In this case the command
|
|
111
|
-
should log something via the `ui` first.
|
|
112
|
-
|
|
113
|
-
`requireAsHash()` assembles from the files in `commands/` a hash that looks
|
|
114
|
-
like this:
|
|
115
|
-
|
|
116
|
-
``` JavaScript
|
|
117
|
-
{
|
|
118
|
-
DevelopEmberCLI: require('commands/develop-ember-cli'),
|
|
119
|
-
...
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
#### Usage instructions formatting
|
|
124
|
-
```
|
|
125
|
-
ember serve <arg-option (Default: something)>
|
|
126
|
-
--port (Default: 4200) Description 1
|
|
127
|
-
--important-option (Required) Description 2
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
##### Formatting colors
|
|
131
|
-
- white: `ember serve`
|
|
132
|
-
- yellow: `<arg-option `, `>`
|
|
133
|
-
- cyan: `--port`, `--important-option`
|
|
134
|
-
- cyan: `(Default: something)`, `(Default: 4200)`
|
|
135
|
-
- white: `Description 1`, `Description 2`
|
|
136
|
-
- cyan: `(Required)`
|
|
137
|
-
|
|
138
|
-
### Tasks
|
|
139
|
-
Located in `lib/tasks`. They get picked up by `requireAsHash()` automatically.
|
|
140
|
-
|
|
141
|
-
Tasks do the real work. They should also do only one thing: For example there
|
|
142
|
-
are separate `bower-install` and `npm-install` tasks, not just one unified
|
|
143
|
-
`install` task. And they should not call other tasks: For example
|
|
144
|
-
`install-blueprint` shouldn't call `npm-install` directly. That's because the
|
|
145
|
-
task sequence is determined by the command and thus should be declared there.
|
|
146
|
-
|
|
147
|
-
The command constructs task instances with dependencies including ui,
|
|
148
|
-
analytics, project, etc. The plan is for these to eventually
|
|
149
|
-
be constructed and wired up via a dependency injection container.
|
|
150
|
-
|
|
151
|
-
A task's `run` method has to return a promise which resolves or rejects
|
|
152
|
-
depending on whether it ran through successfully or not.
|
|
153
|
-
|
|
154
|
-
The promise of a task should either
|
|
155
|
-
- fulfill to `undefined`
|
|
156
|
-
- reject with an `Error` instance if the error is unhandled
|
|
157
|
-
- or reject with `undefined` if it was handled. In this case the task should
|
|
158
|
-
log something via the `ui` first.
|
|
159
|
-
|
|
160
|
-
So, tasks don't have a return value per design.
|
|
161
|
-
|
|
162
|
-
The file format of a task looks like this:
|
|
163
|
-
``` JavaScript
|
|
164
|
-
// tasks/npm-install.js
|
|
165
|
-
|
|
166
|
-
let Task = require('../task');
|
|
167
|
-
|
|
168
|
-
module.exports = Task.extend({
|
|
169
|
-
run(options) {
|
|
170
|
-
// return promise
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
`requireAsHash()` assembles from the files in `tasks/` a hash that looks like this:
|
|
176
|
-
``` JavaScript
|
|
177
|
-
{
|
|
178
|
-
NpmInstall: require('tasks/npm-install'),
|
|
179
|
-
...
|
|
180
|
-
}
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
## Style guide
|
|
184
|
-
- Everything async (except require)
|
|
185
|
-
- Short files
|
|
186
|
-
- Tests, tests, tests
|
|
187
|
-
- Recommended line length <= 80 characters
|
|
188
|
-
- No `console.log`, we've our own logging system
|
|
189
|
-
- HTML and CSS: Double quotes, JavaScript: Single quotes
|
|
190
|
-
- Naming conventions
|
|
191
|
-
- Dasherized (`some-thing`)
|
|
192
|
-
- file, folder and package names
|
|
193
|
-
- CSS classes
|
|
194
|
-
- HTML tags and attributes
|
|
195
|
-
- Model relationships
|
|
196
|
-
- Camel case (`someThing`)
|
|
197
|
-
- JavaScript (and JSON) properties and variables
|
|
198
|
-
- Pascal case (`SomeThing`)
|
|
199
|
-
- JavaScript class names
|
|
200
|
-
- Acronyms:
|
|
201
|
-
- Okay: `url`, `id`, `rootURL` (property) or `URL`, `URLParser` (class)
|
|
202
|
-
- Wrong: `Url`,`rootUrl`
|
|
203
|
-
- We stick with how it's done in ember -> `rootURL`
|
|
204
|
-
- No comma separated assignment statements (`let cool = 123, supercool = 456;`)
|
|
205
|
-
- Line break at the end of every file
|
|
206
|
-
- Make constructors take an options object to avoid order-dependence
|
|
207
|
-
|
|
208
|
-
This list only contains style decisions not already covered by ESLint (e.g.
|
|
209
|
-
mandatory semicolons and other rules are omitted).
|
|
210
|
-
|
|
211
|
-
### Indentation
|
|
212
|
-
|
|
213
|
-
#### Multi-line return statement
|
|
214
|
-
``` JavaScript
|
|
215
|
-
// Correct
|
|
216
|
-
return someFunction(
|
|
217
|
-
someArgument,
|
|
218
|
-
otherArgument
|
|
219
|
-
);
|
|
220
|
-
|
|
221
|
-
// Wrong
|
|
222
|
-
return someFunction(
|
|
223
|
-
someArgument,
|
|
224
|
-
otherArgument
|
|
225
|
-
);
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
``` JavaScript
|
|
229
|
-
// Correct
|
|
230
|
-
return returnsAPromise()
|
|
231
|
-
.then(...)
|
|
232
|
-
.catch(...);
|
|
233
|
-
|
|
234
|
-
// Wrong
|
|
235
|
-
return retursAPromise().then(...)
|
|
236
|
-
.catch(...);
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### Custom errors
|
|
240
|
-
Custom error classes should end with the suffix "Error".
|
|
241
|
-
|
|
242
|
-
``` JavaScript
|
|
243
|
-
function CustomError() {
|
|
244
|
-
this.stack = (new Error()).stack;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
CustomError.prototype = Object.create(Error.prototype);
|
|
248
|
-
CustomError.prototype.name = 'CustomError';
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
Also a `message` property should be set: Either in the constructor or as a property on `CustomError.prototype`.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
### Dependencies
|
|
255
|
-
When requiring modules, we should be aware of their effect on startup
|
|
256
|
-
time. If they introduce a noticeable penalty, and are not needed except
|
|
257
|
-
for some task/command we should require them lazily. Obviously a few
|
|
258
|
-
small modules won't make a difference, but eagerly requiring npm + bower
|
|
259
|
-
and all of lodash will add a second to startup time.
|
|
260
|
-
|
|
261
|
-
The following example eagerly requires npm, but only truly requires it
|
|
262
|
-
when that task is invoked, not for `ember help` `ember version` or even
|
|
263
|
-
`ember server`. This introduces a 200ms-300ms startup penalty.
|
|
264
|
-
|
|
265
|
-
```js
|
|
266
|
-
let npm = require('npm');
|
|
267
|
-
|
|
268
|
-
module.exports = Task.extend({
|
|
269
|
-
run() {
|
|
270
|
-
npm.install() // or something
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
If a dependency (like bower or npm) turns out to have high startup cost,
|
|
276
|
-
we should require them lazily. This also allows us to inject
|
|
277
|
-
alternative dependencies at construction time. Some future DI
|
|
278
|
-
refactoring can likely automate this process.
|
|
279
|
-
|
|
280
|
-
example:
|
|
281
|
-
|
|
282
|
-
```js
|
|
283
|
-
module.exports = Task.extend({
|
|
284
|
-
init() {
|
|
285
|
-
this.npm = this.npm || require('npm');
|
|
286
|
-
},
|
|
287
|
-
run() {
|
|
288
|
-
this.npm.install() // or something
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### Sync vs async
|
|
294
|
-
Since [JavaScript uses an event loop](https://nodejs.org/about/), the use of
|
|
295
|
-
blocking and compute intensive operations is discouraged. The general
|
|
296
|
-
recommendation is to use asynchronous operations.
|
|
297
|
-
|
|
298
|
-
However, there are exceptions. Node's own `require` statement is synchronous. It
|
|
299
|
-
is mainly used at program startup and only for a handful of files. Consequently,
|
|
300
|
-
although it being synchronous, using it is harmless. Same thing goes for
|
|
301
|
-
synchronous file globs in combination with `require` at startup.
|
|
302
|
-
|
|
303
|
-
The use of asynchronous code is mainly important for file walking operations
|
|
304
|
-
during runtime. For example for globbing a large amount of files or recursive
|
|
305
|
-
copying/deleting of folder structures. These operations generally take a long
|
|
306
|
-
time to complete and would if implemented synchronously disrupt progress
|
|
307
|
-
animations or delay server responses.
|
|
308
|
-
|
|
309
|
-
An advantage of asynchronous operations is that libraries can use it to
|
|
310
|
-
offer increased reliability. For example the popular file deletion library
|
|
311
|
-
rimraf uses `setTimeout` and a limited amount of retries after increasing
|
|
312
|
-
time intervals to [mitigate EBUSY errors on
|
|
313
|
-
windows](https://github.com/isaacs/rimraf/blob/master/rimraf.js#L20-L27).
|
|
314
|
-
Also, libraries can use asynchronicity to offload work onto worker threads. By
|
|
315
|
-
providing an asynchronous API, fixes and optimizations can be implemented
|
|
316
|
-
transparently without breaking API compatibility.
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36" type="google"><diagram>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</diagram></mxfile>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Brocfile Transition
|
|
2
|
-
|
|
3
|
-
## Why
|
|
4
|
-
|
|
5
|
-
Broccoli historically assumed its brocfile was like a main file. Originally, we loaded the required config on-demand when the brocfile was invoked, unfortunately as the addon story evolved, we required this data before the brocfile was even invoked (or for tasks where no brocfile invocation was needed). This created a problem, and the quickest solution lead us to the current state of affairs, where we end up duplicating much internal state to satisfy both parts of the system.
|
|
6
|
-
|
|
7
|
-
This change occurred in an effort to unify both sides, rather then duplicating state, we can now pass that state in as an argument. Since the behavior of this file is a superset of a typical Brocfile, we opted to also change the name.
|
|
8
|
-
|
|
9
|
-
With this change, we are in a good position to fix more bugs, remove some much needed tech-debt, and continue to improve the internals without causing uneeded pain in userland.
|
|
10
|
-
|
|
11
|
-
Happy Hacking!
|
|
12
|
-
|
|
13
|
-
## How
|
|
14
|
-
|
|
15
|
-
Transitioning your Brocfile is fairly straight forward. Simply take the contents of your Brocfile and place it in the body of the function in the new `ember-cli-build.js` file. Instead of using `module.exports` to return the tree simply have the function return the tree. Ensure you pass the `defaults` to the EmberApp constructor along with any options you were passing to `EmberApp` in the Brocfile. Internally these two objects will be merged from right to left.
|
|
16
|
-
|
|
17
|
-
Two steps:
|
|
18
|
-
|
|
19
|
-
1. Remove `Brocfile.js` and add contents into `ember-cli-build.js`
|
|
20
|
-
2. Pass `defaults` into the `EmberApp` constructor
|
|
21
|
-
|
|
22
|
-
## Before (Brocfile.js)
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
|
26
|
-
var app = new EmberApp();
|
|
27
|
-
app.import("file1.js");
|
|
28
|
-
app.import("file2.js");
|
|
29
|
-
module.exports = app.toTree();
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## After (ember-cli-build.js)
|
|
33
|
-
```
|
|
34
|
-
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
|
35
|
-
|
|
36
|
-
module.exports = function (defaults) {
|
|
37
|
-
var app = new EmberApp(defaults, {
|
|
38
|
-
// Any other options
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
app.import("file1.js");
|
|
42
|
-
app.import("file2.js");
|
|
43
|
-
|
|
44
|
-
return app.toTree();
|
|
45
|
-
};
|
|
46
|
-
```
|
package/docs/build/api.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
YUI.add("yuidoc-meta", function(Y) {
|
|
2
|
-
Y.YUIDoc = { meta: {
|
|
3
|
-
"classes": [
|
|
4
|
-
"Addon",
|
|
5
|
-
"AmdTransformAddon",
|
|
6
|
-
"Blueprint",
|
|
7
|
-
"Builder",
|
|
8
|
-
"CLI",
|
|
9
|
-
"Command",
|
|
10
|
-
"DefaultPackager",
|
|
11
|
-
"EmberAddon",
|
|
12
|
-
"EmberApp",
|
|
13
|
-
"HardwareInfo",
|
|
14
|
-
"HistorySupportAddon",
|
|
15
|
-
"Instrumentation",
|
|
16
|
-
"NodeModulesList",
|
|
17
|
-
"NpmTask",
|
|
18
|
-
"PackageInfo",
|
|
19
|
-
"PackageInfoCache",
|
|
20
|
-
"PerBundleAddonCache {",
|
|
21
|
-
"Project",
|
|
22
|
-
"ServeFilesAddon",
|
|
23
|
-
"TestsServerAddon",
|
|
24
|
-
"WatcherAddon",
|
|
25
|
-
"WindowsSymlinkChecker"
|
|
26
|
-
],
|
|
27
|
-
"modules": [
|
|
28
|
-
"ember-cli",
|
|
29
|
-
"is-lazy-engine"
|
|
30
|
-
],
|
|
31
|
-
"allModules": [
|
|
32
|
-
{
|
|
33
|
-
"displayName": "ember-cli",
|
|
34
|
-
"name": "ember-cli"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"displayName": "is-lazy-engine",
|
|
38
|
-
"name": "is-lazy-engine",
|
|
39
|
-
"description": "Indicate if a given object is a constructor function or class or an instance of an Addon."
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
"elements": []
|
|
43
|
-
} };
|
|
44
|
-
});
|
|
Binary file
|
|
Binary file
|