ember-source 4.6.0-alpha.5 → 4.6.0-beta.2

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 (60) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/blueprints/-utils.js +9 -0
  3. package/blueprints/acceptance-test/index.js +3 -1
  4. package/blueprints/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.ts +1 -1
  5. package/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.ts +1 -1
  6. package/blueprints/component-test/index.js +2 -0
  7. package/blueprints/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts +2 -2
  8. package/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts +2 -2
  9. package/blueprints/controller-test/index.js +2 -0
  10. package/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  11. package/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  12. package/blueprints/helper-test/index.js +2 -3
  13. package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.ts +1 -1
  14. package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.ts +1 -1
  15. package/blueprints/initializer-test/index.js +2 -3
  16. package/blueprints/instance-initializer-test/index.js +2 -4
  17. package/blueprints/route-test/index.js +2 -0
  18. package/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  19. package/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  20. package/blueprints/service-test/index.js +2 -0
  21. package/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  22. package/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  23. package/blueprints/util-test/index.js +2 -2
  24. package/blueprints/util-test/qunit-files/__root__/__testType__/__name__-test.js +1 -1
  25. package/blueprints/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.ts +1 -1
  26. package/blueprints-js/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.js +1 -1
  27. package/blueprints-js/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js +1 -1
  28. package/blueprints-js/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +2 -2
  29. package/blueprints-js/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +2 -2
  30. package/blueprints-js/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  31. package/blueprints-js/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  32. package/blueprints-js/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +1 -1
  33. package/blueprints-js/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +1 -1
  34. package/blueprints-js/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  35. package/blueprints-js/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  36. package/blueprints-js/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  37. package/blueprints-js/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  38. package/blueprints-js/util-test/qunit-files/__root__/__testType__/__name__-test.js +1 -1
  39. package/blueprints-js/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js +1 -1
  40. package/build-metadata.json +3 -3
  41. package/dist/ember-template-compiler.js +5 -5
  42. package/dist/ember-template-compiler.map +1 -1
  43. package/dist/ember-testing.js +1 -1
  44. package/dist/ember-testing.map +1 -1
  45. package/dist/ember.debug.js +18 -16
  46. package/dist/ember.debug.map +1 -1
  47. package/dist/header/license.js +1 -1
  48. package/dist/packages/@ember/-internals/glimmer/index.js +4 -2
  49. package/dist/packages/@ember/-internals/metal/index.js +1 -1
  50. package/dist/packages/@ember/-internals/routing/lib/location/auto_location.js +5 -5
  51. package/dist/packages/@ember/-internals/routing/lib/location/hash_location.js +1 -1
  52. package/dist/packages/@ember/-internals/routing/lib/location/util.js +1 -1
  53. package/dist/packages/@ember/-internals/routing/lib/services/router.js +1 -1
  54. package/dist/packages/@ember/-internals/routing/lib/utils.js +1 -1
  55. package/dist/packages/@ember/canary-features/index.js +2 -2
  56. package/dist/packages/ember/version.js +1 -1
  57. package/docs/data.json +1 -1
  58. package/package.json +3 -3
  59. package/blueprints-js/-addon-import.js +0 -48
  60. package/blueprints-js/test-framework-detector.js +0 -60
@@ -5,5 +5,5 @@
5
5
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
6
  * @license Licensed under MIT license
7
7
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
- * @version 4.6.0-alpha.5
8
+ * @version 4.6.0-beta.2
9
9
  */
@@ -4222,13 +4222,15 @@ var uniqueId = internalHelper(() => {
4222
4222
  // This code should be reasonably fast, and provide a unique value every time
4223
4223
  // it's called, which is what we need here. It produces a string formatted as a
4224
4224
  // standard UUID, which avoids accidentally turning Ember-specific
4225
- // implementation details into an intimate API.
4225
+ // implementation details into an intimate API. It also ensures that the UUID
4226
+ // always starts with a letter, to avoid creating invalid IDs with a numeric
4227
+ // digit at the start.
4226
4228
 
4227
4229
  function uniqueId$1() {
4228
4230
  // @ts-expect-error this one-liner abuses weird JavaScript semantics that
4229
4231
  // TypeScript (legitimately) doesn't like, but they're nonetheless valid and
4230
4232
  // specced.
4231
- return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, a => (a ^ Math.random() * 16 >> a / 4).toString(16));
4233
+ return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, a => (a * 4 ^ Math.random() * 16 >> (a & 2)).toString(16));
4232
4234
  }
4233
4235
 
4234
4236
  const MODIFIERS = ['alt', 'shift', 'meta', 'ctrl'];
@@ -818,7 +818,7 @@ function getChainTags(chainTags, obj, path, tagMeta, meta$$1) {
818
818
  } else {
819
819
  // use metaFor here to ensure we have the meta for the instance
820
820
  let lazyChains = instanceMeta.writableLazyChainsFor(segment);
821
- let rest = path.substr(segmentEnd + 1);
821
+ let rest = path.substring(segmentEnd + 1);
822
822
  let placeholderTag = createUpdatableTag();
823
823
  lazyChains.push([placeholderTag, rest]);
824
824
  chainTags.push(placeholderTag);
@@ -151,7 +151,7 @@ function detectImplementation(options) {
151
151
 
152
152
  if (currentPath === historyPath) {
153
153
  implementation = 'history';
154
- } else if (currentPath.substr(0, 2) === '/#') {
154
+ } else if (currentPath.substring(0, 2) === '/#') {
155
155
  history.replaceState({
156
156
  path: historyPath
157
157
  }, '', historyPath);
@@ -201,15 +201,15 @@ export function getHistoryPath(rootURL, location) {
201
201
  // with `#/`. Anything else should NOT be considered a route and should
202
202
  // be passed straight through, without transformation.
203
203
 
204
- if (hash.substr(0, 2) === '#/') {
204
+ if (hash.substring(0, 2) === '#/') {
205
205
  // There could be extra hash segments after the route
206
- hashParts = hash.substr(1).split('#'); // The first one is always the route url
206
+ hashParts = hash.substring(1).split('#'); // The first one is always the route url
207
207
 
208
208
  routeHash = hashParts.shift(); // If the path already has a trailing slash, remove the one
209
209
  // from the hashed route so we don't double up.
210
210
 
211
211
  if (path.charAt(path.length - 1) === '/') {
212
- routeHash = routeHash.substr(1);
212
+ routeHash = routeHash.substring(1);
213
213
  } // This is the "expected" final order
214
214
 
215
215
 
@@ -236,7 +236,7 @@ export function getHistoryPath(rootURL, location) {
236
236
  export function getHashPath(rootURL, location) {
237
237
  let path = rootURL;
238
238
  let historyPath = getHistoryPath(rootURL, location);
239
- let routePath = historyPath.substr(rootURL.length);
239
+ let routePath = historyPath.substring(rootURL.length);
240
240
 
241
241
  if (routePath !== '') {
242
242
  if (routePath[0] !== '/') {
@@ -68,7 +68,7 @@ export default class HashLocation extends EmberObject {
68
68
 
69
69
 
70
70
  getURL() {
71
- let originalPath = this.getHash().substr(1);
71
+ let originalPath = this.getHash().substring(1);
72
72
  let outPath = originalPath;
73
73
 
74
74
  if (outPath[0] !== '/') {
@@ -29,7 +29,7 @@ export function getQuery(location) {
29
29
 
30
30
  export function getHash(location) {
31
31
  if (location.hash !== undefined) {
32
- return location.hash.substr(0);
32
+ return location.hash.substring(0);
33
33
  }
34
34
 
35
35
  return '';
@@ -21,7 +21,7 @@ function cleanURL(url, rootURL) {
21
21
  return url;
22
22
  }
23
23
 
24
- return url.substr(rootURL.length, url.length);
24
+ return url.substring(rootURL.length);
25
25
  }
26
26
 
27
27
  class RouterService extends Service.extend(Evented) {
@@ -113,7 +113,7 @@ export function calculateCacheKey(prefix, parts = [], values) {
113
113
 
114
114
  if (values) {
115
115
  if (cacheValuePrefix && cacheValuePrefix in values) {
116
- let partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part;
116
+ let partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substring(cacheValuePrefix.length + 1) : part;
117
117
  value = get(values[cacheValuePrefix], partRemovedPrefix);
118
118
  } else {
119
119
  value = get(values, part);
@@ -11,8 +11,8 @@ import { ENV } from '@ember/-internals/environment';
11
11
  */
12
12
 
13
13
  export const DEFAULT_FEATURES = {
14
- EMBER_LIBRARIES_ISREGISTERED: null,
15
- EMBER_IMPROVED_INSTRUMENTATION: null,
14
+ EMBER_LIBRARIES_ISREGISTERED: false,
15
+ EMBER_IMPROVED_INSTRUMENTATION: false,
16
16
  EMBER_UNIQUE_ID_HELPER: true,
17
17
  EMBER_DEFAULT_HELPER_MANAGER: true
18
18
  };
@@ -1 +1 @@
1
- export default "4.6.0-alpha.5";
1
+ export default "4.6.0-beta.2";
package/docs/data.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "The Ember API",
4
4
  "description": "The Ember API: a framework for building ambitious web applications",
5
5
  "url": "https://emberjs.com/",
6
- "version": "4.6.0-alpha.5"
6
+ "version": "4.6.0-beta.2"
7
7
  },
8
8
  "files": {
9
9
  "node_modules/rsvp/lib/rsvp/promise/all.js": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-source",
3
- "version": "4.6.0-alpha.5",
3
+ "version": "4.6.0-beta.2",
4
4
  "description": "A JavaScript framework for creating ambitious web applications",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -160,9 +160,9 @@
160
160
  "ember-addon": {
161
161
  "after": "ember-cli-legacy-blueprints"
162
162
  },
163
- "_originalVersion": "4.6.0-alpha.5",
163
+ "_originalVersion": "4.6.0-beta.2",
164
164
  "_versionPreviouslyCalculated": true,
165
165
  "publishConfig": {
166
- "tag": "alpha"
166
+ "tag": "beta"
167
167
  }
168
168
  }
@@ -1,48 +0,0 @@
1
- 'use strict';
2
-
3
- const stringUtil = require('ember-cli-string-utils');
4
- const path = require('path');
5
- const inflector = require('inflection');
6
-
7
- module.exports = {
8
- description: 'Generates an import wrapper.',
9
-
10
- fileMapTokens: function () {
11
- return {
12
- __name__: function (options) {
13
- return options.dasherizedModuleName;
14
- },
15
- __path__: function (options) {
16
- return inflector.pluralize(options.locals.blueprintName);
17
- },
18
- __root__: function (options) {
19
- if (options.inRepoAddon) {
20
- return path.join('lib', options.inRepoAddon, 'app');
21
- }
22
- return 'app';
23
- },
24
- };
25
- },
26
-
27
- locals: function (options) {
28
- let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name();
29
- let addonName = stringUtil.dasherize(addonRawName);
30
- let fileName = stringUtil.dasherize(options.entity.name);
31
- let blueprintName = options.originBlueprintName;
32
- let modulePathSegments = [
33
- addonName,
34
- inflector.pluralize(options.originBlueprintName),
35
- fileName,
36
- ];
37
-
38
- if (blueprintName.match(/-addon/)) {
39
- blueprintName = blueprintName.substr(0, blueprintName.indexOf('-addon'));
40
- modulePathSegments = [addonName, inflector.pluralize(blueprintName), fileName];
41
- }
42
-
43
- return {
44
- modulePath: modulePathSegments.join('/'),
45
- blueprintName: blueprintName,
46
- };
47
- },
48
- };
@@ -1,60 +0,0 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
- const VersionChecker = require('ember-cli-version-checker');
6
-
7
- module.exports = function (blueprint) {
8
- blueprint.supportsAddon = function () {
9
- return false;
10
- };
11
-
12
- blueprint.filesPath = function () {
13
- let type;
14
- const qunitRfcVersion = 'qunit-rfc-232';
15
- const mochaRfcVersion = 'mocha-rfc-232';
16
- const mochaVersion = 'mocha-0.12';
17
-
18
- let dependencies = this.project.dependencies();
19
- if ('ember-qunit' in dependencies) {
20
- type = qunitRfcVersion;
21
- } else if ('ember-cli-qunit' in dependencies) {
22
- let checker = new VersionChecker(this.project);
23
- if (
24
- fs.existsSync(`${this.path}/${qunitRfcVersion}-files`) &&
25
- checker.for('ember-cli-qunit', 'npm').gte('4.2.0')
26
- ) {
27
- type = qunitRfcVersion;
28
- } else {
29
- type = 'qunit';
30
- }
31
- } else if ('ember-mocha' in dependencies) {
32
- let checker = new VersionChecker(this.project);
33
- if (
34
- fs.existsSync(`${this.path}/${mochaRfcVersion}-files`) &&
35
- checker.for('ember-mocha', 'npm').gte('0.14.0')
36
- ) {
37
- type = mochaRfcVersion;
38
- } else {
39
- type = mochaVersion;
40
- }
41
- } else if ('ember-cli-mocha' in dependencies) {
42
- let checker = new VersionChecker(this.project);
43
- if (
44
- fs.existsSync(`${this.path}/${mochaVersion}-files`) &&
45
- checker.for('ember-cli-mocha', 'npm').gte('0.12.0')
46
- ) {
47
- type = mochaVersion;
48
- } else {
49
- type = 'mocha';
50
- }
51
- } else {
52
- this.ui.writeLine("Couldn't determine test style - using QUnit");
53
- type = 'qunit';
54
- }
55
-
56
- return path.join(this.path, type + '-files');
57
- };
58
-
59
- return blueprint;
60
- };