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,252 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>lib/models/per-bundle-addon-cache/addon-proxy.js - 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
-
69
-
70
-
71
- <div class="version-info">
72
- Version: 4.0.0-release-b4cbb1029f
73
- </div>
74
-
75
- </div>
76
-
77
- <div id="main" class="yui3-u">
78
- <div class="content"><div class="title">
79
- <h1 class="file-name">lib/models/per-bundle-addon-cache/addon-proxy.js</h1>
80
- </div>
81
-
82
- <pre class="code prettyprint linenums">
83
- &#x27;use strict&#x27;;
84
-
85
- const { TARGET_INSTANCE } = require(&#x27;./target-instance&#x27;);
86
-
87
- const CACHE_KEY_FOR_TREE_TRACKER = Symbol(&#x27;CACHE_KEY_FOR_TREE_TRACKER&#x27;);
88
-
89
- /**
90
- * Validates that a new cache key for a given tree type matches the previous
91
- * cache key for the same tree type. To opt-in to bundle addon caching for
92
- * a given addon it&#x27;s assumed that it returns stable cache keys; specifically
93
- * this is because the interplay between bundle addon caching and &#x60;ember-engines&#x60;
94
- * when transitive deduplication is enabled assumes stable cache keys, so we validate
95
- * for this case here.
96
- *
97
- * @method validateCacheKey
98
- * @param {Addon} realAddonInstance The real addon instance
99
- * @param {string} treeType
100
- * @param {string} newCacheKey
101
- * @throws {Error} If the new cache key doesn&#x27;t match the previous cache key
102
- */
103
- function validateCacheKey(realAddonInstance, treeType, newCacheKey) {
104
- let cacheKeyTracker = realAddonInstance[CACHE_KEY_FOR_TREE_TRACKER];
105
-
106
- if (!cacheKeyTracker) {
107
- cacheKeyTracker = {};
108
- realAddonInstance[CACHE_KEY_FOR_TREE_TRACKER] = cacheKeyTracker;
109
- }
110
-
111
- cacheKeyTracker[treeType] = treeType in cacheKeyTracker ? cacheKeyTracker[treeType] : newCacheKey;
112
-
113
- if (cacheKeyTracker[treeType] !== newCacheKey) {
114
- throw new Error(
115
- &#x60;[ember-cli] addon bundle caching can only be used on addons that have stable cache keys (previously \&#x60;${
116
- cacheKeyTracker[treeType]
117
- }\&#x60;, now \&#x60;${newCacheKey}\&#x60;; for addon \&#x60;${realAddonInstance.name}\&#x60; located at \&#x60;${
118
- realAddonInstance.packageRoot || realAddonInstance.root
119
- }\&#x60;)&#x60;
120
- );
121
- }
122
- }
123
-
124
- /**
125
- * Returns a proxy to a target with specific handling for the
126
- * &#x60;parent&#x60; property, as well has to handle the &#x60;app&#x60; property;
127
- * that is, the proxy should maintain correct local state in
128
- * closure scope for the &#x60;app&#x60; property if it happens to be set
129
- * by &#x60;ember-cli&#x60;. Other than &#x60;parent&#x60; &amp; &#x60;app&#x60;, this function also
130
- * proxies _almost_ everything to &#x60;target[TARGET_INSTANCE] with a few
131
- * exceptions: we trap &amp; return &#x60;[]&#x60; for &#x60;addons&#x60;, and we don&#x27;t return
132
- * the original &#x60;included&#x60; (it&#x27;s already called on the &quot;real&quot; addon
133
- * by &#x60;ember-cli&#x60;).
134
- *
135
- * Note: the target is NOT the per-bundle cacheable instance of the addon. Rather,
136
- * it is a cache entry POJO from PerBundleAddonCache.
137
- *
138
- * @method getAddonProxy
139
- * @param targetCacheEntry the PerBundleAddonCache cache entry we are to proxy. It
140
- * has one interesting property, the real addon instance the proxy is forwarding
141
- * calls to (that property is not globally exposed).
142
- * @param parent the parent object of the proxy being created (the same as
143
- * the &#x27;parent&#x27; property of a normal addon instance)
144
- * @return Proxy
145
- */
146
- function getAddonProxy(targetCacheEntry, parent) {
147
- let _app;
148
-
149
- // handle &#x60;preprocessJs&#x60; separately for Embroider
150
- //
151
- // some context here:
152
- //
153
- // Embroider patches &#x60;preprocessJs&#x60;, so we want to maintain local state within the
154
- // proxy rather than allowing a patched &#x60;preprocessJs&#x60; set on the original addon
155
- // instance itself
156
- //
157
- // for more info as to where this happens, see:
158
- // https://github.com/embroider-build/embroider/blob/master/packages/compat/src/v1-addon.ts#L634
159
- let _preprocessJs;
160
-
161
- return new Proxy(targetCacheEntry, {
162
- get(targetCacheEntry, property) {
163
- if (property === &#x27;parent&#x27;) {
164
- return parent;
165
- }
166
-
167
- if (property === &#x27;app&#x27;) {
168
- return _app;
169
- }
170
-
171
- // only return &#x60;_preprocessJs&#x60; here if it was previously set to a patched version
172
- if (property === &#x27;preprocessJs&#x27; &amp;&amp; _preprocessJs) {
173
- return _preprocessJs;
174
- }
175
-
176
- // keep proxies from even trying to set or initialize addons
177
- if (property === &#x27;initializeAddons&#x27;) {
178
- return undefined;
179
- }
180
-
181
- // See the {@link index.js} file for a discussion of why the proxy &#x27;addons&#x27;
182
- // property returns an empty array.
183
- if (property === &#x27;addons&#x27;) {
184
- return [];
185
- }
186
-
187
- // allow access to the property pointing to the real instance.
188
- if (property === TARGET_INSTANCE) {
189
- return targetCacheEntry[TARGET_INSTANCE];
190
- }
191
-
192
- // &#x60;included&#x60; will be called on the &quot;real&quot; addon, so there&#x27;s no need for it to be
193
- // called again; instead we return a no-op implementation here
194
- if (property === &#x27;included&#x27;) {
195
- return () =&gt; undefined;
196
- }
197
-
198
- if (targetCacheEntry[TARGET_INSTANCE]) {
199
- if (property !== &#x27;constructor&#x27; &amp;&amp; typeof targetCacheEntry[TARGET_INSTANCE][property] === &#x27;function&#x27;) {
200
- // If we fall through to the Reflect.get just below, the &#x27;this&#x27; context of the function when
201
- // invoked is the proxy, not the original instance (so its local state is incorrect).
202
- // Wrap the original methods to maintain the correct &#x27;this&#x27; context.
203
- return function _originalAddonPropMethodWrapper() {
204
- let originalReturnValue = targetCacheEntry[TARGET_INSTANCE][property](...arguments);
205
-
206
- if (property === &#x27;cacheKeyForTree&#x27;) {
207
- const treeType = arguments[0];
208
- validateCacheKey(targetCacheEntry[TARGET_INSTANCE], treeType, originalReturnValue);
209
- }
210
-
211
- return originalReturnValue;
212
- };
213
- }
214
-
215
- return Reflect.get(targetCacheEntry[TARGET_INSTANCE], property);
216
- }
217
-
218
- return Reflect.get(targetCacheEntry, property);
219
- },
220
- set(targetCacheEntry, property, value) {
221
- if (property === &#x27;app&#x27;) {
222
- _app = value;
223
- return true;
224
- }
225
-
226
- if (property === &#x27;preprocessJs&#x27;) {
227
- _preprocessJs = value;
228
- return true;
229
- }
230
-
231
- if (targetCacheEntry[TARGET_INSTANCE]) {
232
- return Reflect.set(targetCacheEntry[TARGET_INSTANCE], property, value);
233
- }
234
-
235
- return Reflect.set(targetCacheEntry, property, value);
236
- },
237
- });
238
- }
239
-
240
- module.exports = { getAddonProxy };
241
-
242
- </pre>
243
-
244
- </div>
245
- </div>
246
- </div>
247
- </div>
248
- <script src="../assets/vendor/prettify/prettify-min.js"></script>
249
- <script>prettyPrint();</script>
250
- <script src="../assets/js/yui-prettify.js"></script>
251
- </body>
252
- </html>