ember-cli 4.0.0 → 4.1.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 (114) hide show
  1. package/.github/workflows/ci.yml +4 -4
  2. package/CHANGELOG.md +42 -2
  3. package/blueprints/addon/additional-dev-dependencies.json +1 -1
  4. package/blueprints/addon/files/.github/workflows/ci.yml +0 -1
  5. package/blueprints/addon/files/.travis.yml +0 -1
  6. package/blueprints/addon/files/addon-config/ember-try.js +0 -13
  7. package/blueprints/app/files/config/environment.js +1 -1
  8. package/blueprints/app/files/package.json +6 -6
  9. package/docs/build/data.json +3 -3
  10. package/lib/models/host-info-cache.js +3 -5
  11. package/lib/models/per-bundle-addon-cache/index.js +2 -3
  12. package/lib/tasks/npm-task.js +1 -1
  13. package/lib/utilities/get-lang-arg.js +45 -45
  14. package/package.json +25 -25
  15. package/tests/helpers/mock-project.js +1 -1
  16. package/.github/ISSUE_TEMPLATE.md +0 -12
  17. package/.github/dependabot.yml +0 -15
  18. package/.github/workflows/coverage.yml +0 -31
  19. package/docs/analytics.md +0 -44
  20. package/docs/architecture.md +0 -316
  21. package/docs/assets/architecture/Ember-CLI architecture.png +0 -0
  22. package/docs/assets/architecture/Ember-CLI architecture.xml +0 -1
  23. package/docs/assets/architecture/README.md +0 -5
  24. package/docs/brocfile-transition.md +0 -46
  25. package/docs/build/api.js +0 -44
  26. package/docs/build/assets/css/external-small.png +0 -0
  27. package/docs/build/assets/css/logo.png +0 -0
  28. package/docs/build/assets/css/main.css +0 -555
  29. package/docs/build/assets/favicon.ico +0 -0
  30. package/docs/build/assets/img/spinner.gif +0 -0
  31. package/docs/build/assets/index.html +0 -10
  32. package/docs/build/assets/js/api-filter.js +0 -56
  33. package/docs/build/assets/js/api-list.js +0 -255
  34. package/docs/build/assets/js/api-search.js +0 -98
  35. package/docs/build/assets/js/apidocs.js +0 -376
  36. package/docs/build/assets/js/yui-prettify.js +0 -17
  37. package/docs/build/assets/vendor/prettify/CHANGES.html +0 -130
  38. package/docs/build/assets/vendor/prettify/COPYING +0 -202
  39. package/docs/build/assets/vendor/prettify/README.html +0 -203
  40. package/docs/build/assets/vendor/prettify/prettify-min.css +0 -1
  41. package/docs/build/assets/vendor/prettify/prettify-min.js +0 -1
  42. package/docs/build/classes/Addon.html +0 -4318
  43. package/docs/build/classes/AmdTransformAddon.html +0 -202
  44. package/docs/build/classes/Blueprint.html +0 -4796
  45. package/docs/build/classes/Builder.html +0 -611
  46. package/docs/build/classes/CLI.html +0 -810
  47. package/docs/build/classes/Command.html +0 -1655
  48. package/docs/build/classes/DefaultPackager.html +0 -202
  49. package/docs/build/classes/EmberAddon.html +0 -2207
  50. package/docs/build/classes/EmberApp.html +0 -2225
  51. package/docs/build/classes/HardwareInfo.html +0 -620
  52. package/docs/build/classes/HistorySupportAddon.html +0 -203
  53. package/docs/build/classes/Instrumentation.html +0 -695
  54. package/docs/build/classes/NodeModulesList.html +0 -460
  55. package/docs/build/classes/NpmTask.html +0 -333
  56. package/docs/build/classes/PackageInfo.html +0 -1390
  57. package/docs/build/classes/PackageInfoCache.html +0 -963
  58. package/docs/build/classes/PerBundleAddonCache {.html +0 -1010
  59. package/docs/build/classes/Project.html +0 -2083
  60. package/docs/build/classes/ServeFilesAddon.html +0 -260
  61. package/docs/build/classes/TestsServerAddon.html +0 -203
  62. package/docs/build/classes/WatcherAddon.html +0 -204
  63. package/docs/build/classes/WindowsSymlinkChecker.html +0 -1505
  64. package/docs/build/files/lib_broccoli_default-packager.js.html +0 -1426
  65. package/docs/build/files/lib_broccoli_ember-addon.js.html +0 -159
  66. package/docs/build/files/lib_broccoli_ember-app.js.html +0 -1913
  67. package/docs/build/files/lib_cli_cli.js.html +0 -417
  68. package/docs/build/files/lib_models_addon-info.js.html +0 -112
  69. package/docs/build/files/lib_models_addon.js.html +0 -1866
  70. package/docs/build/files/lib_models_blueprint.js.html +0 -1678
  71. package/docs/build/files/lib_models_builder.js.html +0 -417
  72. package/docs/build/files/lib_models_command.js.html +0 -804
  73. package/docs/build/files/lib_models_hardware-info.js.html +0 -479
  74. package/docs/build/files/lib_models_host-info-cache.js.html +0 -428
  75. package/docs/build/files/lib_models_installation-checker.js.html +0 -181
  76. package/docs/build/files/lib_models_instantiate-addons.js.html +0 -191
  77. package/docs/build/files/lib_models_instrumentation.js.html +0 -433
  78. package/docs/build/files/lib_models_package-info-cache_index.js.html +0 -793
  79. package/docs/build/files/lib_models_package-info-cache_node-modules-list.js.html +0 -208
  80. package/docs/build/files/lib_models_package-info-cache_package-info.js.html +0 -661
  81. package/docs/build/files/lib_models_per-bundle-addon-cache_addon-proxy.js.html +0 -252
  82. package/docs/build/files/lib_models_per-bundle-addon-cache_index.js.html +0 -485
  83. package/docs/build/files/lib_models_per-bundle-addon-cache_target-instance.js.html +0 -108
  84. package/docs/build/files/lib_models_project.js.html +0 -913
  85. package/docs/build/files/lib_models_task.js.html +0 -117
  86. package/docs/build/files/lib_tasks_build-watch.js.html +0 -157
  87. package/docs/build/files/lib_tasks_npm-task.js.html +0 -463
  88. package/docs/build/files/lib_tasks_serve.js.html +0 -207
  89. package/docs/build/files/lib_tasks_server_middleware_broccoli-serve-files_index.js.html +0 -127
  90. package/docs/build/files/lib_tasks_server_middleware_broccoli-watcher_index.js.html +0 -158
  91. package/docs/build/files/lib_tasks_server_middleware_history-support_index.js.html +0 -181
  92. package/docs/build/files/lib_tasks_server_middleware_tests-server_index.js.html +0 -171
  93. package/docs/build/files/lib_tasks_test-server.js.html +0 -167
  94. package/docs/build/files/lib_tasks_transforms_amd_index.js.html +0 -143
  95. package/docs/build/files/lib_utilities_ember-app-utils.js.html +0 -292
  96. package/docs/build/files/lib_utilities_insert-into-file.js.html +0 -219
  97. package/docs/build/files/lib_utilities_is-lazy-engine.js.html +0 -125
  98. package/docs/build/files/lib_utilities_is-yarn-project.js.html +0 -120
  99. package/docs/build/files/lib_utilities_valid-project-name.js.html +0 -142
  100. package/docs/build/files/lib_utilities_will-interrupt-process.js.html +0 -290
  101. package/docs/build/files/lib_utilities_windows-admin.js.html +0 -230
  102. package/docs/build/index.html +0 -125
  103. package/docs/build/modules/ember-cli.html +0 -152
  104. package/docs/build/modules/is-lazy-engine.html +0 -106
  105. package/docs/build-concurrency.md +0 -15
  106. package/docs/build-pipeline-debugging.md +0 -33
  107. package/docs/code-coverage.md +0 -14
  108. package/docs/error-propagation.md +0 -136
  109. package/docs/experiments.md +0 -53
  110. package/docs/node-support.md +0 -43
  111. package/docs/perf-guide.md +0 -250
  112. package/docs/project_version_preprocessor.js +0 -8
  113. package/docs/sourcemaps.md +0 -60
  114. package/docs/yuidoc.json +0 -13
@@ -1,963 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>PackageInfoCache - ember-cli</title>
6
- <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
7
- <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
8
- <script src="https://cdnjs.cloudflare.com/ajax/libs/yui/3.18.0/yui/yui-min.js"></script>
9
- </head>
10
- <body class="yui3-skin-sam">
11
-
12
- <div id="doc">
13
- <div class="yui3-g">
14
- <div id="sidebar" class="yui3-u">
15
- <div class="logo">
16
- <a href="../index.html">
17
- <img src="https://ember-cli.com/assets/images/ember-cli-logo-small-dark.png">
18
- </a>
19
- </div>
20
-
21
- <div id="modules" class="sidebox">
22
- <div class="hd">
23
- <h2 class="no-toc">Modules</h2>
24
- </div>
25
- <div class="bd">
26
- <ul>
27
- <li><a href="../modules/ember-cli.html">ember-cli</a>
28
- </li>
29
- <li><a href="../modules/is-lazy-engine.html">is-lazy-engine</a>
30
- </li>
31
- </ul>
32
- </div>
33
- </div>
34
-
35
- <div id="classes" class="sidebox">
36
- <div class="hd">
37
- <h2 class="no-toc">Classes</h2>
38
- </div>
39
- <div class="bd">
40
- <ul>
41
- <li><a href="../classes/Addon.html">Addon</a></li>
42
- <li><a href="../classes/AmdTransformAddon.html">AmdTransformAddon</a></li>
43
- <li><a href="../classes/Blueprint.html">Blueprint</a></li>
44
- <li><a href="../classes/Builder.html">Builder</a></li>
45
- <li><a href="../classes/CLI.html">CLI</a></li>
46
- <li><a href="../classes/Command.html">Command</a></li>
47
- <li><a href="../classes/DefaultPackager.html">DefaultPackager</a></li>
48
- <li><a href="../classes/EmberAddon.html">EmberAddon</a></li>
49
- <li><a href="../classes/EmberApp.html">EmberApp</a></li>
50
- <li><a href="../classes/HardwareInfo.html">HardwareInfo</a></li>
51
- <li><a href="../classes/HistorySupportAddon.html">HistorySupportAddon</a></li>
52
- <li><a href="../classes/Instrumentation.html">Instrumentation</a></li>
53
- <li><a href="../classes/NodeModulesList.html">NodeModulesList</a></li>
54
- <li><a href="../classes/NpmTask.html">NpmTask</a></li>
55
- <li><a href="../classes/PackageInfo.html">PackageInfo</a></li>
56
- <li><a href="../classes/PackageInfoCache.html">PackageInfoCache</a></li>
57
- <li><a href="../classes/PerBundleAddonCache {.html">PerBundleAddonCache {</a></li>
58
- <li><a href="../classes/Project.html">Project</a></li>
59
- <li><a href="../classes/ServeFilesAddon.html">ServeFilesAddon</a></li>
60
- <li><a href="../classes/TestsServerAddon.html">TestsServerAddon</a></li>
61
- <li><a href="../classes/WatcherAddon.html">WatcherAddon</a></li>
62
- <li><a href="../classes/WindowsSymlinkChecker.html">WindowsSymlinkChecker</a></li>
63
- </ul>
64
- </div>
65
- </div>
66
-
67
-
68
- <div id="sections" class="sidebox">
69
- <div class="hd">
70
- <h2 class="no-toc">PackageInfoCache</h2>
71
- </div>
72
- <div class="bd">
73
-
74
-
75
-
76
-
77
- <div><a href="#method-summary">Method Summary</a></div>
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
- <div><a href="#public-methods">Public Methods</a></div>
92
- <ul>
93
- <li><a href="#method_contains">contains</a></li>
94
- <li><a href="#method_getEntry">getEntry</a></li>
95
- <li><a href="#method_hasErrors">hasErrors</a></li>
96
- <li><a href="#method_loadAddon">loadAddon</a></li>
97
- <li><a href="#method_loadProject">loadProject</a></li>
98
- <li><a href="#method_reloadProjects">reloadProjects</a></li>
99
- <li><a href="#method_showErrors">showErrors</a></li>
100
- </ul>
101
-
102
-
103
- <div><a href="#private-methods">Private Methods</a></div>
104
- <ul>
105
- <li><a href="#method__addEntry">_addEntry</a></li>
106
- <li><a href="#method__clear">_clear</a></li>
107
- <li><a href="#method__readModulesList">_readModulesList</a></li>
108
- <li><a href="#method__readPackage">_readPackage</a></li>
109
- <li><a href="#method__resolveDependencies">_resolveDependencies</a></li>
110
- <li><a href="#method__showObjErrors">_showObjErrors</a></li>
111
- </ul>
112
- </div>
113
- </div>
114
-
115
-
116
-
117
- <div class="version-info">
118
- Version: 4.0.0-release-b4cbb1029f
119
- </div>
120
-
121
- </div>
122
-
123
- <div id="main" class="yui3-u">
124
- <div class="content"><div class="title">
125
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l23"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:23</code></a></span>
126
- <h1 class="class-name">PackageInfoCache</h1>
127
- </div>
128
-
129
-
130
-
131
-
132
- <div class="class-description"><p>Class that stores entries that are either PackageInfo or NodeModulesList objects.
133
- The entries are stored in a map keyed by real directory path.</p>
134
- </div>
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
- <h2 id="method-summary">Method Summary</h2>
144
-
145
- <table class="summary">
146
- <thead>
147
- <tr>
148
- <th colspan="2">Public Methods</th>
149
- </tr>
150
- </thead>
151
- <tbody>
152
- <tr>
153
- <td>
154
- public
155
-
156
-
157
- </td>
158
- <td>
159
- <div class="method-name ">
160
- <a href="#method_contains">contains</a>(path):
161
- </div>
162
- <div class="short-description">
163
- <p>Indicate if an entry for a given path exists in the cache.</p>
164
- </div>
165
- </td>
166
- </tr>
167
- <tr>
168
- <td>
169
- public
170
-
171
-
172
- </td>
173
- <td>
174
- <div class="method-name ">
175
- <a href="#method_getEntry">getEntry</a>(path): <a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a>
176
- </div>
177
- <div class="short-description">
178
- <p>Retrieve an entry from the cache.</p>
179
- </div>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- public
185
-
186
-
187
- </td>
188
- <td>
189
- <div class="method-name ">
190
- <a href="#method_hasErrors">hasErrors</a>( ):
191
- </div>
192
- <div class="short-description">
193
- <p>Indicates if there is at least one error in any object in the cache.</p>
194
- </div>
195
- </td>
196
- </tr>
197
- <tr>
198
- <td>
199
- public
200
-
201
-
202
- </td>
203
- <td>
204
- <div class="method-name ">
205
- <a href="#method_loadAddon">loadAddon</a>(addonInstance): <a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a>
206
- </div>
207
- <div class="short-description">
208
- <p>Do the actual processing of the root directory of an addon, when the addon object already exists (i.e. the addon is acting as the root object of a tree, like project does). We need the object in order to find the internal addons. _readPackage takes care of the general processing of the root directory and common locations for addons, filling the cache with each.</p>
209
- </div>
210
- </td>
211
- </tr>
212
- <tr>
213
- <td>
214
- public
215
-
216
-
217
- </td>
218
- <td>
219
- <div class="method-name ">
220
- <a href="#method_loadProject">loadProject</a>(projectInstance): <a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a>
221
- </div>
222
- <div class="short-description">
223
- <p>Process the root directory of a project, given a Project object (we need the object in order to find the internal addons). _readPackage takes care of the general processing of the root directory and common locations for addons, filling the cache with each. Once it returns, we take care of the locations for addons that are specific to projects, not other packages (e.g. internal addons, cli root).</p>
224
- </div>
225
- </td>
226
- </tr>
227
- <tr>
228
- <td>
229
- public
230
-
231
-
232
- </td>
233
- <td>
234
- <div class="method-name ">
235
- <a href="#method_reloadProjects">reloadProjects</a>( ):
236
- </div>
237
- <div class="short-description">
238
- <p>To support the project.reloadPkg method, we need the ability to flush the cache and reload from the updated package.json. There are some issues with doing this:</p>
239
- </div>
240
- </td>
241
- </tr>
242
- <tr>
243
- <td>
244
- public
245
-
246
-
247
- </td>
248
- <td>
249
- <div class="method-name ">
250
- <a href="#method_showErrors">showErrors</a>( )
251
- </div>
252
- <div class="short-description">
253
- <p>Gather all the errors in the PIC and any cached objects, then dump them out to the ui-console.</p>
254
- </div>
255
- </td>
256
- </tr>
257
- </tbody>
258
- </table>
259
-
260
-
261
- <table class="summary">
262
- <thead>
263
- <tr>
264
- <th colspan="2">Private Methods</th>
265
- </tr>
266
- </thead>
267
- <tbody>
268
- <tr>
269
- <td>
270
- private
271
-
272
-
273
- </td>
274
- <td>
275
- <div class="method-name ">
276
- <a href="#method__addEntry">_addEntry</a>( )
277
- </div>
278
- <div class="short-description">
279
- <p>Add an entry to the cache.</p>
280
- </div>
281
- </td>
282
- </tr>
283
- <tr>
284
- <td>
285
- private
286
-
287
-
288
- </td>
289
- <td>
290
- <div class="method-name ">
291
- <a href="#method__clear">_clear</a>( )
292
- </div>
293
- <div class="short-description">
294
- <p>Clear the cache information.</p>
295
- </div>
296
- </td>
297
- </tr>
298
- <tr>
299
- <td>
300
- private
301
-
302
-
303
- </td>
304
- <td>
305
- <div class="method-name ">
306
- <a href="#method__readModulesList">_readModulesList</a>(nodeModulesDir)
307
- </div>
308
- <div class="short-description">
309
- <p>Process a directory of modules in a given package directory.</p>
310
- </div>
311
- </td>
312
- </tr>
313
- <tr>
314
- <td>
315
- private
316
-
317
-
318
- </td>
319
- <td>
320
- <div class="method-name ">
321
- <a href="#method__readPackage">_readPackage</a>(pkgDir, isRoot,)
322
- </div>
323
- <div class="short-description">
324
- <p>Given a directory that supposedly contains a package, create a PackageInfo object and try to fill it out, EVEN IF the package.json is not readable. Errors will then be stored in the PackageInfo for anything with the package that might be wrong. Because it's possible that the path given to the packageDir is not actually valid, we'll just use the path.resolve() version of that path to search for the path in the cache, before trying to get the 'real' path (which also then resolves links). The cache itself is keyed on either the realPath, if the packageDir is actually a real valid directory path, or the normalized path (before path.resolve()), if it is not.</p>
325
- </div>
326
- </td>
327
- </tr>
328
- <tr>
329
- <td>
330
- private
331
-
332
-
333
- </td>
334
- <td>
335
- <div class="method-name ">
336
- <a href="#method__resolveDependencies">_resolveDependencies</a>( )
337
- </div>
338
- <div class="short-description">
339
- <p>Resolve the node_module dependencies across all packages after they have been loaded into the cache, because we don't know when a particular package will enter the cache.</p>
340
- </div>
341
- </td>
342
- </tr>
343
- <tr>
344
- <td>
345
- private
346
-
347
-
348
- </td>
349
- <td>
350
- <div class="method-name ">
351
- <a href="#method__showObjErrors">_showObjErrors</a>( )
352
- </div>
353
- <div class="short-description">
354
- <p>Dump all the errors for a single object in the cache out to the ui-console.</p>
355
- </div>
356
- </td>
357
- </tr>
358
- </tbody>
359
- </table>
360
-
361
-
362
-
363
-
364
-
365
-
366
-
367
-
368
-
369
-
370
-
371
-
372
-
373
- <div id="methods public">
374
- <h2 id="public-methods">Public Methods</h2>
375
- <div class="method item public">
376
- <div id="method_contains" class="title">
377
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l321"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:321</code></a></span>
378
- <h3 class="">
379
- public
380
-
381
-
382
- contains(path):
383
- </h3>
384
- </div>
385
-
386
-
387
-
388
- <div class="method-description"><p>Indicate if an entry for a given path exists in the cache.</p>
389
- </div>
390
-
391
- <div class="params">
392
- <h4>Parameters:</h4>
393
- <table>
394
- <thead>
395
- <tr>
396
- <th>Name</th>
397
- <th>Type</th>
398
- <th>Attribute</th>
399
- <th>Description</th>
400
- </tr>
401
- </thead>
402
- <tbody>
403
- <tr>
404
- <td>path</td>
405
- <td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></td>
406
- <td>
407
- <ul>
408
-
409
-
410
-
411
- </ul>
412
- </td>
413
- <td><p>the real path to check for in the cache.</p>
414
- </td>
415
- </tr>
416
-
417
- </tbody>
418
- </table>
419
- </div>
420
-
421
- <div class="return">
422
- <h4>Return:</h4>
423
- <div>
424
-
425
- <span class="return-description"><p>true if the entry is present for the given path, false otherwise.</p>
426
- </span>
427
- </div>
428
- </div>
429
-
430
-
431
- </div>
432
- <div class="method item public">
433
- <div id="method_getEntry" class="title">
434
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l309"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:309</code></a></span>
435
- <h3 class="">
436
- public
437
-
438
-
439
- getEntry(path): <a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a>
440
- </h3>
441
- </div>
442
-
443
-
444
-
445
- <div class="method-description"><p>Retrieve an entry from the cache.</p>
446
- </div>
447
-
448
- <div class="params">
449
- <h4>Parameters:</h4>
450
- <table>
451
- <thead>
452
- <tr>
453
- <th>Name</th>
454
- <th>Type</th>
455
- <th>Attribute</th>
456
- <th>Description</th>
457
- </tr>
458
- </thead>
459
- <tbody>
460
- <tr>
461
- <td>path</td>
462
- <td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></td>
463
- <td>
464
- <ul>
465
-
466
-
467
-
468
- </ul>
469
- </td>
470
- <td><p>the real path whose PackageInfo or NodeModulesList is desired.</p>
471
- </td>
472
- </tr>
473
-
474
- </tbody>
475
- </table>
476
- </div>
477
-
478
- <div class="return">
479
- <h4>Return:</h4>
480
- <div>
481
- <span class="return-type"><a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a></span>
482
- <span class="return-description"><p>or {NodeModulesList} the desired entry.</p>
483
- </span>
484
- </div>
485
- </div>
486
-
487
-
488
- </div>
489
- <div class="method item public">
490
- <div id="method_hasErrors" class="title">
491
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l48"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:48</code></a></span>
492
- <h3 class="">
493
- public
494
-
495
-
496
- hasErrors( ):
497
- </h3>
498
- </div>
499
-
500
-
501
-
502
- <div class="method-description"><p>Indicates if there is at least one error in any object in the cache.</p>
503
- </div>
504
-
505
-
506
- <div class="return">
507
- <h4>Return:</h4>
508
- <div>
509
-
510
- <span class="return-description"><p>true if there are any errors in the cache, for any entries, else false.</p>
511
- </span>
512
- </div>
513
- </div>
514
-
515
-
516
- </div>
517
- <div class="method item public">
518
- <div id="method_loadAddon" class="title">
519
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l228"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:228</code></a></span>
520
- <h3 class="">
521
- public
522
-
523
-
524
- loadAddon(addonInstance): <a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a>
525
- </h3>
526
- </div>
527
-
528
-
529
-
530
- <div class="method-description"><p>Do the actual processing of the root directory of an addon, when the addon
531
- object already exists (i.e. the addon is acting as the root object of a
532
- tree, like project does). We need the object in order to find the internal addons.
533
- _readPackage takes care of the general processing of the root directory
534
- and common locations for addons, filling the cache with each.</p>
535
- <p>Once all the addon processing is done, go back through all cache entries
536
- to create references between the packageInfo objects.</p>
537
- </div>
538
-
539
- <div class="params">
540
- <h4>Parameters:</h4>
541
- <table>
542
- <thead>
543
- <tr>
544
- <th>Name</th>
545
- <th>Type</th>
546
- <th>Attribute</th>
547
- <th>Description</th>
548
- </tr>
549
- </thead>
550
- <tbody>
551
- <tr>
552
- <td>addonInstance</td>
553
- <td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></td>
554
- <td>
555
- <ul>
556
-
557
-
558
-
559
- </ul>
560
- </td>
561
- <td><p>the instance of the Addon object to load package data
562
- about into the cache.</p>
563
- </td>
564
- </tr>
565
-
566
- </tbody>
567
- </table>
568
- </div>
569
-
570
- <div class="return">
571
- <h4>Return:</h4>
572
- <div>
573
- <span class="return-type"><a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a></span>
574
- <span class="return-description"><p>the PackageInfo object for the given Addon object.
575
- Note that if the addon path is already in the cache, that will be returned.
576
- No copy is made.</p>
577
- </span>
578
- </div>
579
- </div>
580
-
581
-
582
- </div>
583
- <div class="method item public">
584
- <div id="method_loadProject" class="title">
585
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l146"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:146</code></a></span>
586
- <h3 class="">
587
- public
588
-
589
-
590
- loadProject(projectInstance): <a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a>
591
- </h3>
592
- </div>
593
-
594
-
595
-
596
- <div class="method-description"><p>Process the root directory of a project, given a
597
- Project object (we need the object in order to find the internal addons).
598
- _readPackage takes care of the general processing of the root directory
599
- and common locations for addons, filling the cache with each. Once it
600
- returns, we take care of the locations for addons that are specific to
601
- projects, not other packages (e.g. internal addons, cli root).</p>
602
- <p>Once all the project processing is done, go back through all cache entries
603
- to create references between the packageInfo objects.</p>
604
- </div>
605
-
606
- <div class="params">
607
- <h4>Parameters:</h4>
608
- <table>
609
- <thead>
610
- <tr>
611
- <th>Name</th>
612
- <th>Type</th>
613
- <th>Attribute</th>
614
- <th>Description</th>
615
- </tr>
616
- </thead>
617
- <tbody>
618
- <tr>
619
- <td>projectInstance</td>
620
- <td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></td>
621
- <td>
622
- <ul>
623
-
624
-
625
-
626
- </ul>
627
- </td>
628
- <td><p>the instance of the Project object to load package data
629
- about into the cache.</p>
630
- </td>
631
- </tr>
632
-
633
- </tbody>
634
- </table>
635
- </div>
636
-
637
- <div class="return">
638
- <h4>Return:</h4>
639
- <div>
640
- <span class="return-type"><a href="../classes/PackageInfo.html" class="crosslink">PackageInfo</a></span>
641
- <span class="return-description"><p>the PackageInfo object for the given Project object.
642
- Note that if the project path is already in the cache, that will be returned.
643
- No copy is made.</p>
644
- </span>
645
- </div>
646
- </div>
647
-
648
-
649
- </div>
650
- <div class="method item public">
651
- <div id="method_reloadProjects" class="title">
652
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l203"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:203</code></a></span>
653
- <h3 class="">
654
- public
655
-
656
-
657
- reloadProjects( ):
658
- </h3>
659
- </div>
660
-
661
-
662
-
663
- <div class="method-description"><p>To support the project.reloadPkg method, we need the ability to flush
664
- the cache and reload from the updated package.json.
665
- There are some issues with doing this:</p>
666
- <ul>
667
- <li>Because of the possible relationship between projects and their addons
668
- due to symlinks, it's not trivial to flush only the data related to a
669
- given project.</li>
670
- <li>If an 'ember-build-cli.js' dynamically adds new projects to the cache,
671
- we will not necessarily get called again to redo the loading of those
672
- projects.
673
- The solution, implemented here:</li>
674
- <li>Keep track of the Project objects whose packages are loaded into the cache.</li>
675
- <li>If a project is reloaded, flush the cache, then do loadPackage again
676
- for all the known Projects.</li>
677
- </ul>
678
- </div>
679
-
680
-
681
- <div class="return">
682
- <h4>Return:</h4>
683
- <div>
684
-
685
- <span class="return-description"><p>null</p>
686
- </span>
687
- </div>
688
- </div>
689
-
690
-
691
- </div>
692
- <div class="method item public">
693
- <div id="method_showErrors" class="title">
694
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l65"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:65</code></a></span>
695
- <h3 class="">
696
- public
697
-
698
-
699
- showErrors( )
700
- </h3>
701
- </div>
702
-
703
-
704
-
705
- <div class="method-description"><p>Gather all the errors in the PIC and any cached objects, then dump them
706
- out to the ui-console.</p>
707
- </div>
708
-
709
-
710
-
711
-
712
- </div>
713
- </div>
714
-
715
-
716
- <div id="methods private">
717
- <h2 id="private-methods">Private Methods</h2>
718
- <div class="method item private">
719
- <div id="method__addEntry" class="title">
720
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l299"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:299</code></a></span>
721
- <h3 class="">
722
- private
723
-
724
-
725
- _addEntry( )
726
- </h3>
727
- </div>
728
-
729
-
730
-
731
- <div class="method-description"><p>Add an entry to the cache.</p>
732
- </div>
733
-
734
-
735
-
736
-
737
- </div>
738
- <div class="method item private">
739
- <div id="method__clear" class="title">
740
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l36"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:36</code></a></span>
741
- <h3 class="">
742
- private
743
-
744
-
745
- _clear( )
746
- </h3>
747
- </div>
748
-
749
-
750
-
751
- <div class="method-description"><p>Clear the cache information.</p>
752
- </div>
753
-
754
-
755
-
756
-
757
- </div>
758
- <div class="method item private">
759
- <div id="method__readModulesList" class="title">
760
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l585"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:585</code></a></span>
761
- <h3 class="">
762
- private
763
-
764
-
765
- _readModulesList(nodeModulesDir)
766
- </h3>
767
- </div>
768
-
769
-
770
-
771
- <div class="method-description"><p>Process a directory of modules in a given package directory.</p>
772
- <p>We will allow cache entries for node_modules that actually
773
- have no contents, just so we don't have to hit the file system more
774
- often than necessary--it's much quicker to check an in-memory object.
775
- object.</p>
776
- <p>Note: only a NodeModulesList or null is returned.</p>
777
- </div>
778
-
779
- <div class="params">
780
- <h4>Parameters:</h4>
781
- <table>
782
- <thead>
783
- <tr>
784
- <th>Name</th>
785
- <th>Type</th>
786
- <th>Attribute</th>
787
- <th>Description</th>
788
- </tr>
789
- </thead>
790
- <tbody>
791
- <tr>
792
- <td>nodeModulesDir</td>
793
- <td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></td>
794
- <td>
795
- <ul>
796
-
797
-
798
-
799
- </ul>
800
- </td>
801
- <td><p>the path of the node_modules directory
802
- to read the package.json from and process the contents and create a
803
- new cache entry or entries.</p>
804
- </td>
805
- </tr>
806
-
807
- </tbody>
808
- </table>
809
- </div>
810
-
811
-
812
-
813
- </div>
814
- <div class="method item private">
815
- <div id="method__readPackage" class="title">
816
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l395"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:395</code></a></span>
817
- <h3 class="">
818
- private
819
-
820
-
821
- _readPackage(pkgDir, isRoot,)
822
- </h3>
823
- </div>
824
-
825
-
826
-
827
- <div class="method-description"><p>Given a directory that supposedly contains a package, create a PackageInfo
828
- object and try to fill it out, EVEN IF the package.json is not readable.
829
- Errors will then be stored in the PackageInfo for anything with the package
830
- that might be wrong.
831
- Because it's possible that the path given to the packageDir is not actually valid,
832
- we'll just use the path.resolve() version of that path to search for the
833
- path in the cache, before trying to get the 'real' path (which also then
834
- resolves links). The cache itself is keyed on either the realPath, if the
835
- packageDir is actually a real valid directory path, or the normalized path (before
836
- path.resolve()), if it is not.</p>
837
- <p>NOTE: the cache is also used to store the NULL_PROJECT project object,
838
- which actually has no package.json or other files, but does have an empty
839
- package object. Because of that, and to speed up processing, loadProject()
840
- will pass in both the package root directory path and the project's package
841
- object, if there is one. If the package object is present, we will use that
842
- in preference to trying to find a package.json file.</p>
843
- <p>If there is no package object, and there is no package.json or the package.json
844
- is bad or the package is an addon with
845
- no main, the only thing we can do is return an ErrorEntry to the caller.
846
- Once past all those problems, if any error occurs with any of the contents
847
- of the package, they'll be cached in the PackageInfo itself.</p>
848
- <p>In summary, only PackageInfo or ErrorEntry will be returned.</p>
849
- </div>
850
-
851
- <div class="params">
852
- <h4>Parameters:</h4>
853
- <table>
854
- <thead>
855
- <tr>
856
- <th>Name</th>
857
- <th>Type</th>
858
- <th>Attribute</th>
859
- <th>Description</th>
860
- </tr>
861
- </thead>
862
- <tbody>
863
- <tr>
864
- <td>pkgDir</td>
865
- <td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></td>
866
- <td>
867
- <ul>
868
-
869
-
870
-
871
- </ul>
872
- </td>
873
- <td><p>the path of the directory to read the package.json from and
874
- process the contents and create a new cache entry or entries.</p>
875
- </td>
876
- </tr>
877
-
878
- <tr>
879
- <td>isRoot,</td>
880
- <td><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></td>
881
- <td>
882
- <ul>
883
-
884
-
885
-
886
- </ul>
887
- </td>
888
- <td><p>for when this is to be considered the root
889
- package, whose dependencies we must all consider for discovery.</p>
890
- </td>
891
- </tr>
892
-
893
- </tbody>
894
- </table>
895
- </div>
896
-
897
-
898
-
899
- </div>
900
- <div class="method item private">
901
- <div id="method__resolveDependencies" class="title">
902
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l262"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:262</code></a></span>
903
- <h3 class="">
904
- private
905
-
906
-
907
- _resolveDependencies( )
908
- </h3>
909
- </div>
910
-
911
-
912
-
913
- <div class="method-description"><p>Resolve the node_module dependencies across all packages after they have
914
- been loaded into the cache, because we don't know when a particular package
915
- will enter the cache.</p>
916
- <p>Since loadProject can be called multiple times for different projects,
917
- we don't want to reprocess any packages that happen to be common
918
- between them. We'll handle this by marking any packageInfo once it
919
- has been processed here, then ignore it in any later processing.</p>
920
- </div>
921
-
922
-
923
-
924
-
925
- </div>
926
- <div class="method item private">
927
- <div id="method__showObjErrors" class="title">
928
- <span class="source-link"><a href="../files/lib_models_package-info-cache_index.js.html#l80"><code>lib&#x2F;models&#x2F;package-info-cache&#x2F;index.js:80</code></a></span>
929
- <h3 class="">
930
- private
931
-
932
-
933
- _showObjErrors( )
934
- </h3>
935
- </div>
936
-
937
-
938
-
939
- <div class="method-description"><p>Dump all the errors for a single object in the cache out to the ui-console.</p>
940
- <p>Special case: because package-info-cache also creates PackageInfo objects for entries
941
- that do not actually exist (to allow simplifying the code), if there's a case where
942
- an object has only the single error ERROR_PACKAGE_DIR_MISSING, do not print
943
- anything. The package will have been found as a reference from some other
944
- addon or the root project, and we'll print a reference error there. Having
945
- both is just confusing to users.</p>
946
- </div>
947
-
948
-
949
-
950
-
951
- </div>
952
- </div>
953
-
954
-
955
- </div>
956
- </div>
957
- </div>
958
- </div>
959
- <script src="../assets/vendor/prettify/prettify-min.js"></script>
960
- <script>prettyPrint();</script>
961
- <script src="../assets/js/yui-prettify.js"></script>
962
- </body>
963
- </html>