ember-cli 4.0.0 → 4.2.0-beta.1

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.
Files changed (115) hide show
  1. package/.github/workflows/ci.yml +8 -4
  2. package/CHANGELOG.md +43 -2
  3. package/README.md +1 -1
  4. package/blueprints/addon/additional-dev-dependencies.json +1 -1
  5. package/blueprints/addon/files/CONTRIBUTING.md +1 -1
  6. package/blueprints/app/files/README.md +2 -2
  7. package/blueprints/app/files/package.json +8 -8
  8. package/docs/build/data.json +64 -3
  9. package/lib/debug/assert.js +37 -0
  10. package/lib/debug/deprecate.js +111 -0
  11. package/lib/debug/index.js +6 -0
  12. package/lib/models/host-info-cache.js +3 -5
  13. package/lib/models/per-bundle-addon-cache/index.js +2 -3
  14. package/lib/tasks/npm-task.js +1 -1
  15. package/lib/utilities/get-lang-arg.js +45 -45
  16. package/package.json +31 -31
  17. package/.github/ISSUE_TEMPLATE.md +0 -12
  18. package/.github/dependabot.yml +0 -15
  19. package/.github/workflows/coverage.yml +0 -31
  20. package/docs/analytics.md +0 -44
  21. package/docs/architecture.md +0 -316
  22. package/docs/assets/architecture/Ember-CLI architecture.png +0 -0
  23. package/docs/assets/architecture/Ember-CLI architecture.xml +0 -1
  24. package/docs/assets/architecture/README.md +0 -5
  25. package/docs/brocfile-transition.md +0 -46
  26. package/docs/build/api.js +0 -44
  27. package/docs/build/assets/css/external-small.png +0 -0
  28. package/docs/build/assets/css/logo.png +0 -0
  29. package/docs/build/assets/css/main.css +0 -555
  30. package/docs/build/assets/favicon.ico +0 -0
  31. package/docs/build/assets/img/spinner.gif +0 -0
  32. package/docs/build/assets/index.html +0 -10
  33. package/docs/build/assets/js/api-filter.js +0 -56
  34. package/docs/build/assets/js/api-list.js +0 -255
  35. package/docs/build/assets/js/api-search.js +0 -98
  36. package/docs/build/assets/js/apidocs.js +0 -376
  37. package/docs/build/assets/js/yui-prettify.js +0 -17
  38. package/docs/build/assets/vendor/prettify/CHANGES.html +0 -130
  39. package/docs/build/assets/vendor/prettify/COPYING +0 -202
  40. package/docs/build/assets/vendor/prettify/README.html +0 -203
  41. package/docs/build/assets/vendor/prettify/prettify-min.css +0 -1
  42. package/docs/build/assets/vendor/prettify/prettify-min.js +0 -1
  43. package/docs/build/classes/Addon.html +0 -4318
  44. package/docs/build/classes/AmdTransformAddon.html +0 -202
  45. package/docs/build/classes/Blueprint.html +0 -4796
  46. package/docs/build/classes/Builder.html +0 -611
  47. package/docs/build/classes/CLI.html +0 -810
  48. package/docs/build/classes/Command.html +0 -1655
  49. package/docs/build/classes/DefaultPackager.html +0 -202
  50. package/docs/build/classes/EmberAddon.html +0 -2207
  51. package/docs/build/classes/EmberApp.html +0 -2225
  52. package/docs/build/classes/HardwareInfo.html +0 -620
  53. package/docs/build/classes/HistorySupportAddon.html +0 -203
  54. package/docs/build/classes/Instrumentation.html +0 -695
  55. package/docs/build/classes/NodeModulesList.html +0 -460
  56. package/docs/build/classes/NpmTask.html +0 -333
  57. package/docs/build/classes/PackageInfo.html +0 -1390
  58. package/docs/build/classes/PackageInfoCache.html +0 -963
  59. package/docs/build/classes/PerBundleAddonCache {.html +0 -1010
  60. package/docs/build/classes/Project.html +0 -2083
  61. package/docs/build/classes/ServeFilesAddon.html +0 -260
  62. package/docs/build/classes/TestsServerAddon.html +0 -203
  63. package/docs/build/classes/WatcherAddon.html +0 -204
  64. package/docs/build/classes/WindowsSymlinkChecker.html +0 -1505
  65. package/docs/build/files/lib_broccoli_default-packager.js.html +0 -1426
  66. package/docs/build/files/lib_broccoli_ember-addon.js.html +0 -159
  67. package/docs/build/files/lib_broccoli_ember-app.js.html +0 -1913
  68. package/docs/build/files/lib_cli_cli.js.html +0 -417
  69. package/docs/build/files/lib_models_addon-info.js.html +0 -112
  70. package/docs/build/files/lib_models_addon.js.html +0 -1866
  71. package/docs/build/files/lib_models_blueprint.js.html +0 -1678
  72. package/docs/build/files/lib_models_builder.js.html +0 -417
  73. package/docs/build/files/lib_models_command.js.html +0 -804
  74. package/docs/build/files/lib_models_hardware-info.js.html +0 -479
  75. package/docs/build/files/lib_models_host-info-cache.js.html +0 -428
  76. package/docs/build/files/lib_models_installation-checker.js.html +0 -181
  77. package/docs/build/files/lib_models_instantiate-addons.js.html +0 -191
  78. package/docs/build/files/lib_models_instrumentation.js.html +0 -433
  79. package/docs/build/files/lib_models_package-info-cache_index.js.html +0 -793
  80. package/docs/build/files/lib_models_package-info-cache_node-modules-list.js.html +0 -208
  81. package/docs/build/files/lib_models_package-info-cache_package-info.js.html +0 -661
  82. package/docs/build/files/lib_models_per-bundle-addon-cache_addon-proxy.js.html +0 -252
  83. package/docs/build/files/lib_models_per-bundle-addon-cache_index.js.html +0 -485
  84. package/docs/build/files/lib_models_per-bundle-addon-cache_target-instance.js.html +0 -108
  85. package/docs/build/files/lib_models_project.js.html +0 -913
  86. package/docs/build/files/lib_models_task.js.html +0 -117
  87. package/docs/build/files/lib_tasks_build-watch.js.html +0 -157
  88. package/docs/build/files/lib_tasks_npm-task.js.html +0 -463
  89. package/docs/build/files/lib_tasks_serve.js.html +0 -207
  90. package/docs/build/files/lib_tasks_server_middleware_broccoli-serve-files_index.js.html +0 -127
  91. package/docs/build/files/lib_tasks_server_middleware_broccoli-watcher_index.js.html +0 -158
  92. package/docs/build/files/lib_tasks_server_middleware_history-support_index.js.html +0 -181
  93. package/docs/build/files/lib_tasks_server_middleware_tests-server_index.js.html +0 -171
  94. package/docs/build/files/lib_tasks_test-server.js.html +0 -167
  95. package/docs/build/files/lib_tasks_transforms_amd_index.js.html +0 -143
  96. package/docs/build/files/lib_utilities_ember-app-utils.js.html +0 -292
  97. package/docs/build/files/lib_utilities_insert-into-file.js.html +0 -219
  98. package/docs/build/files/lib_utilities_is-lazy-engine.js.html +0 -125
  99. package/docs/build/files/lib_utilities_is-yarn-project.js.html +0 -120
  100. package/docs/build/files/lib_utilities_valid-project-name.js.html +0 -142
  101. package/docs/build/files/lib_utilities_will-interrupt-process.js.html +0 -290
  102. package/docs/build/files/lib_utilities_windows-admin.js.html +0 -230
  103. package/docs/build/index.html +0 -125
  104. package/docs/build/modules/ember-cli.html +0 -152
  105. package/docs/build/modules/is-lazy-engine.html +0 -106
  106. package/docs/build-concurrency.md +0 -15
  107. package/docs/build-pipeline-debugging.md +0 -33
  108. package/docs/code-coverage.md +0 -14
  109. package/docs/error-propagation.md +0 -136
  110. package/docs/experiments.md +0 -53
  111. package/docs/node-support.md +0 -43
  112. package/docs/perf-guide.md +0 -250
  113. package/docs/project_version_preprocessor.js +0 -8
  114. package/docs/sourcemaps.md +0 -60
  115. package/docs/yuidoc.json +0 -13
@@ -1,316 +0,0 @@
1
- ## Architecture
2
-
3
- ![embercli architecture](./assets/architecture/Ember-CLI%20architecture.png)
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.
@@ -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,5 +0,0 @@
1
- # Steps to update architecture diagram
2
- 1. Open xml file in https://www.draw.io
3
- 2. Make necessary changes
4
- 3. Commit the updated diagram in xml and png format.
5
- 4. Point the architecture.md file to the updated diagram
@@ -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