ember-source 4.4.0-alpha.3 → 4.4.0-alpha.6
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/CHANGELOG.md +5 -1
- package/blueprints/-addon-import.js +9 -0
- package/blueprints/-maybe-polyfill-typescript-blueprints.js +17 -0
- package/blueprints/acceptance-test/index.js +8 -0
- package/blueprints/acceptance-test/mocha-rfc-232-files/tests/acceptance/{__name__-test.js → __name__-test.ts} +1 -1
- package/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/{__name__-test.js → __name__-test.ts} +1 -1
- package/blueprints/component/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/component/index.js +6 -1
- package/blueprints/component-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/component-addon/index.js +9 -0
- package/blueprints/component-class/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/component-class/index.js +5 -0
- package/blueprints/component-class-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/component-class-addon/index.js +9 -0
- package/blueprints/component-test/index.js +8 -0
- package/blueprints/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +2 -2
- package/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +3 -3
- package/blueprints/controller/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/controller/index.js +10 -0
- package/blueprints/controller-test/index.js +10 -0
- package/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +1 -1
- package/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +1 -1
- package/blueprints/helper/files/__root__/__collection__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/helper/index.js +9 -0
- package/blueprints/helper-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/helper-test/index.js +9 -0
- package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/{__name__-test.js → __name__-test.ts} +1 -1
- package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/{__name__-test.js → __name__-test.ts} +1 -1
- package/blueprints/initializer/files/__root__/initializers/__name__.ts +6 -0
- package/blueprints/initializer/index.js +9 -0
- package/blueprints/initializer-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/initializer-test/index.js +8 -0
- package/blueprints/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__name__-test.js → __name__-test.ts} +3 -1
- package/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts +37 -0
- package/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.ts +6 -0
- package/blueprints/instance-initializer/index.js +9 -0
- package/blueprints/instance-initializer-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/instance-initializer-test/index.js +8 -0
- package/blueprints/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__name__-test.js → __name__-test.ts} +5 -1
- package/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/{__name__-test.js → __name__-test.ts} +6 -1
- package/blueprints/route/files/__root__/__path__/{__name__.js → __name__.ts} +2 -4
- package/blueprints/route/index.js +9 -0
- package/blueprints/route-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/route-addon/index.js +9 -0
- package/blueprints/route-test/index.js +9 -0
- package/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +1 -1
- package/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +1 -1
- package/blueprints/service/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/service/index.js +10 -0
- package/blueprints/service-test/index.js +8 -0
- package/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +1 -1
- package/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +1 -1
- package/blueprints/util/files/__root__/utils/{__name__.js → __name__.ts} +0 -0
- package/blueprints/util/index.js +10 -0
- package/blueprints/util-test/index.js +8 -0
- package/blueprints/util-test/mocha-rfc-232-files/__root__/__testType__/{__name__-test.js → __name__-test.ts} +0 -0
- package/blueprints/util-test/qunit-rfc-232-files/__root__/__testType__/{__name__-test.js → __name__-test.ts} +0 -0
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +15 -13
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +8 -4
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +478 -1149
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/container/index.js +1 -25
- package/dist/packages/@ember/-internals/extension-support/lib/container_debug_adapter.js +10 -19
- package/dist/packages/@ember/-internals/extension-support/lib/data_adapter.js +113 -112
- package/dist/packages/@ember/-internals/glimmer/index.js +117 -749
- package/dist/packages/@ember/-internals/metal/index.js +17 -22
- package/dist/packages/@ember/-internals/routing/lib/services/router.js +140 -145
- package/dist/packages/@ember/-internals/routing/lib/system/router.js +3 -1
- package/dist/packages/@ember/-internals/runtime/lib/ext/rsvp.js +8 -4
- package/dist/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +1 -1
- package/dist/packages/@ember/-internals/runtime/lib/mixins/array.js +1 -1
- package/dist/packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js +16 -16
- package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +8 -8
- package/dist/packages/@ember/-internals/views/lib/system/utils.js +4 -2
- package/dist/packages/@ember/-internals/views/lib/views/core_view.js +5 -22
- package/dist/packages/@ember/canary-features/index.js +1 -5
- package/dist/packages/@ember/debug/index.js +1 -1
- package/dist/packages/@ember/debug/lib/deprecate.js +6 -2
- package/dist/packages/@ember/renderer/index.js +21 -0
- package/dist/packages/ember/version.js +1 -1
- package/docs/data.json +447 -260
- package/package.json +15 -12
- package/blueprints/initializer/files/__root__/initializers/__name__.js +0 -5
- package/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +0 -34
- package/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.js +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Ember Changelog
|
|
2
2
|
|
|
3
|
+
### v4.3.0-beta.2 (March 1, 2022)
|
|
4
|
+
|
|
5
|
+
- [#19971](https://github.com/emberjs/ember.js/pull/19971) [BUGFIX] Don't serialize default Query Params on RouterService
|
|
6
|
+
|
|
3
7
|
### v4.3.0-beta.1 (February 7, 2022)
|
|
4
8
|
|
|
5
9
|
No public API changes or bugfixes.
|
|
@@ -3144,7 +3148,7 @@ Clearly, `component-a` has subscribed to `some-other-component`'s `action`. Prev
|
|
|
3144
3148
|
* CollectionView context is now its content
|
|
3145
3149
|
* Various enhancements to bound helpers: adds multiple property support to bound helpers, adds bind-able options hash properties, adds {{unbound}} helper support to render unbound form of helpers.
|
|
3146
3150
|
* Add App.inject
|
|
3147
|
-
* Add Ember.
|
|
3151
|
+
* Add Ember.EnumerableUtils.intersection
|
|
3148
3152
|
* Deprecate Controller#controllerFor in favor of Controller#needs
|
|
3149
3153
|
* Adds `bubbles` property to Ember.TextField
|
|
3150
3154
|
* Allow overriding of Ember.Router#handleURL
|
|
@@ -4,9 +4,18 @@ const stringUtil = require('ember-cli-string-utils');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const inflector = require('inflection');
|
|
6
6
|
|
|
7
|
+
const maybePolyfillTypeScriptBlueprints = require('./-maybe-polyfill-typescript-blueprints');
|
|
8
|
+
|
|
7
9
|
module.exports = {
|
|
8
10
|
description: 'Generates an import wrapper.',
|
|
9
11
|
|
|
12
|
+
shouldTransformTypeScript: true,
|
|
13
|
+
|
|
14
|
+
init() {
|
|
15
|
+
this._super && this._super.init.apply(this, arguments);
|
|
16
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
17
|
+
},
|
|
18
|
+
|
|
10
19
|
fileMapTokens: function () {
|
|
11
20
|
return {
|
|
12
21
|
__name__: function (options) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const typescriptBlueprintPolyfill = require('ember-cli-typescript-blueprint-polyfill');
|
|
2
|
+
const EMBER_TYPESCRIPT_BLUEPRINTS = false;
|
|
3
|
+
|
|
4
|
+
function canEmitTypeScript() {
|
|
5
|
+
return 'EMBER_TYPESCRIPT_BLUEPRINTS' in process.env
|
|
6
|
+
? process.env.EMBER_TYPESCRIPT_BLUEPRINTS
|
|
7
|
+
: EMBER_TYPESCRIPT_BLUEPRINTS;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
module.exports = function (context) {
|
|
11
|
+
if (canEmitTypeScript()) {
|
|
12
|
+
typescriptBlueprintPolyfill(context);
|
|
13
|
+
} else {
|
|
14
|
+
// Use the plain old JS templates from before
|
|
15
|
+
context.path = context.path.replace('blueprints', 'blueprints-js');
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -5,11 +5,19 @@ const path = require('path');
|
|
|
5
5
|
const pathUtil = require('ember-cli-path-utils');
|
|
6
6
|
const stringUtils = require('ember-cli-string-utils');
|
|
7
7
|
|
|
8
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
8
9
|
const useTestFrameworkDetector = require('../test-framework-detector');
|
|
9
10
|
|
|
10
11
|
module.exports = useTestFrameworkDetector({
|
|
11
12
|
description: 'Generates an acceptance test for a feature.',
|
|
12
13
|
|
|
14
|
+
shouldTransformTypeScript: true,
|
|
15
|
+
|
|
16
|
+
init() {
|
|
17
|
+
this._super && this._super.init.apply(this, arguments);
|
|
18
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
19
|
+
},
|
|
20
|
+
|
|
13
21
|
locals: function (options) {
|
|
14
22
|
let testFolderRoot = stringUtils.dasherize(options.project.name());
|
|
15
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it } from 'mocha';
|
|
2
2
|
import { expect } from 'chai';
|
|
3
|
-
import { setupApplicationTest } from '
|
|
3
|
+
import { setupApplicationTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
4
4
|
import { visit, currentURL } from '@ember/test-helpers';
|
|
5
5
|
|
|
6
6
|
describe('<%= friendlyTestName %>', function () {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { module, test } from 'qunit';
|
|
2
2
|
import { visit, currentURL } from '@ember/test-helpers';
|
|
3
|
-
import { setupApplicationTest } from '
|
|
3
|
+
import { setupApplicationTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
4
4
|
|
|
5
5
|
module('<%= friendlyTestName %>', function (hooks) {
|
|
6
6
|
setupApplicationTest(hooks);
|
|
File without changes
|
|
@@ -10,6 +10,8 @@ const normalizeEntityName = require('ember-cli-normalize-entity-name');
|
|
|
10
10
|
const { EOL } = require('os');
|
|
11
11
|
const { has } = require('@ember/edition-utils');
|
|
12
12
|
|
|
13
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
14
|
+
|
|
13
15
|
const OCTANE = has('octane');
|
|
14
16
|
|
|
15
17
|
// TODO: this should be reading from the @ember/canary-features module
|
|
@@ -21,6 +23,8 @@ const EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = true;
|
|
|
21
23
|
module.exports = {
|
|
22
24
|
description: 'Generates a component.',
|
|
23
25
|
|
|
26
|
+
shouldTransformTypeScript: true,
|
|
27
|
+
|
|
24
28
|
availableOptions: [
|
|
25
29
|
{
|
|
26
30
|
name: 'path',
|
|
@@ -51,6 +55,7 @@ module.exports = {
|
|
|
51
55
|
|
|
52
56
|
init() {
|
|
53
57
|
this._super && this._super.init.apply(this, arguments);
|
|
58
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
54
59
|
let isOctane = has('octane');
|
|
55
60
|
|
|
56
61
|
this.availableOptions.forEach((option) => {
|
|
@@ -203,7 +208,7 @@ module.exports = {
|
|
|
203
208
|
|
|
204
209
|
if (this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE && this.options.componentClass === '') {
|
|
205
210
|
files = files.filter((file) => {
|
|
206
|
-
if (file.endsWith('.js')) {
|
|
211
|
+
if (file.endsWith('.js') || file.endsWith('.ts')) {
|
|
207
212
|
this.skippedJsFiles.add(file);
|
|
208
213
|
return false;
|
|
209
214
|
} else {
|
|
File without changes
|
|
@@ -5,9 +5,18 @@ const stringUtil = require('ember-cli-string-utils');
|
|
|
5
5
|
const getPathOption = require('ember-cli-get-component-path-option');
|
|
6
6
|
const normalizeEntityName = require('ember-cli-normalize-entity-name');
|
|
7
7
|
|
|
8
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
9
|
+
|
|
8
10
|
module.exports = {
|
|
9
11
|
description: 'Generates a component.',
|
|
10
12
|
|
|
13
|
+
shouldTransformTypeScript: true,
|
|
14
|
+
|
|
15
|
+
init() {
|
|
16
|
+
this._super && this._super.init.apply(this, arguments);
|
|
17
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
18
|
+
},
|
|
19
|
+
|
|
11
20
|
fileMapTokens: function () {
|
|
12
21
|
return {
|
|
13
22
|
__path__: function (options) {
|
|
File without changes
|
|
@@ -9,6 +9,8 @@ const normalizeEntityName = require('ember-cli-normalize-entity-name');
|
|
|
9
9
|
const { EOL } = require('os');
|
|
10
10
|
const { has } = require('@ember/edition-utils');
|
|
11
11
|
|
|
12
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
13
|
+
|
|
12
14
|
const OCTANE = has('octane');
|
|
13
15
|
|
|
14
16
|
// TODO: this should be reading from the @ember/canary-features module
|
|
@@ -20,6 +22,8 @@ const EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = true;
|
|
|
20
22
|
module.exports = {
|
|
21
23
|
description: 'Generates a component class.',
|
|
22
24
|
|
|
25
|
+
shouldTransformTypeScript: true,
|
|
26
|
+
|
|
23
27
|
availableOptions: [
|
|
24
28
|
{
|
|
25
29
|
name: 'path',
|
|
@@ -47,6 +51,7 @@ module.exports = {
|
|
|
47
51
|
|
|
48
52
|
init() {
|
|
49
53
|
this._super && this._super.init.apply(this, arguments);
|
|
54
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
50
55
|
let isOctane = has('octane');
|
|
51
56
|
|
|
52
57
|
this.availableOptions.forEach((option) => {
|
package/blueprints/component-class-addon/files/__root__/__path__/{__name__.js → __name__.ts}
RENAMED
|
File without changes
|
|
@@ -5,9 +5,18 @@ const stringUtil = require('ember-cli-string-utils');
|
|
|
5
5
|
const getPathOption = require('ember-cli-get-component-path-option');
|
|
6
6
|
const normalizeEntityName = require('ember-cli-normalize-entity-name');
|
|
7
7
|
|
|
8
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
9
|
+
|
|
8
10
|
module.exports = {
|
|
9
11
|
description: 'Generates a component class.',
|
|
10
12
|
|
|
13
|
+
shouldTransformTypeScript: true,
|
|
14
|
+
|
|
15
|
+
init() {
|
|
16
|
+
this._super && this._super.init.apply(this, arguments);
|
|
17
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
18
|
+
},
|
|
19
|
+
|
|
11
20
|
fileMapTokens: function () {
|
|
12
21
|
return {
|
|
13
22
|
__path__: function (options) {
|
|
@@ -6,6 +6,7 @@ const isPackageMissing = require('ember-cli-is-package-missing');
|
|
|
6
6
|
const getPathOption = require('ember-cli-get-component-path-option');
|
|
7
7
|
const semver = require('semver');
|
|
8
8
|
|
|
9
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
9
10
|
const useTestFrameworkDetector = require('../test-framework-detector');
|
|
10
11
|
|
|
11
12
|
function invocationFor(options) {
|
|
@@ -16,6 +17,13 @@ function invocationFor(options) {
|
|
|
16
17
|
module.exports = useTestFrameworkDetector({
|
|
17
18
|
description: 'Generates a component integration or unit test.',
|
|
18
19
|
|
|
20
|
+
shouldTransformTypeScript: true,
|
|
21
|
+
|
|
22
|
+
init() {
|
|
23
|
+
this._super && this._super.init.apply(this, arguments);
|
|
24
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
25
|
+
},
|
|
26
|
+
|
|
19
27
|
availableOptions: [
|
|
20
28
|
{
|
|
21
29
|
name: 'test-type',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<% if (testType === 'integration') { %>import { expect } from 'chai';
|
|
2
2
|
import { describe, it } from 'mocha';
|
|
3
|
-
import { setupRenderingTest } from '
|
|
3
|
+
import { setupRenderingTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
4
4
|
import { render } from '@ember/test-helpers';
|
|
5
5
|
<%= hbsImportStatement %>
|
|
6
6
|
|
|
@@ -26,7 +26,7 @@ describe('<%= friendlyTestDescription %>', function () {
|
|
|
26
26
|
});
|
|
27
27
|
});<% } else if (testType === 'unit') { %>import { expect } from 'chai';
|
|
28
28
|
import { describe, it } from 'mocha';
|
|
29
|
-
import { setupTest } from '
|
|
29
|
+
import { setupTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
30
30
|
|
|
31
31
|
describe('<%= friendlyTestDescription %>', function () {
|
|
32
32
|
setupTest();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<% if (testType === 'integration') { %>import { module, test } from 'qunit';
|
|
2
|
-
import { setupRenderingTest } from '
|
|
2
|
+
import { setupRenderingTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
3
3
|
import { render } from '@ember/test-helpers';
|
|
4
4
|
<%= hbsImportStatement %>
|
|
5
5
|
|
|
@@ -24,7 +24,7 @@ module('<%= friendlyTestDescription %>', function (hooks) {
|
|
|
24
24
|
assert.dom(this.element).hasText('template block text');
|
|
25
25
|
});
|
|
26
26
|
});<% } else if (testType === 'unit') { %>import { module, test } from 'qunit';
|
|
27
|
-
import { setupTest } from '
|
|
27
|
+
import { setupTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
28
28
|
|
|
29
29
|
module('<%= friendlyTestDescription %>', function (hooks) {
|
|
30
30
|
setupTest(hooks);
|
|
@@ -33,4 +33,4 @@ module('<%= friendlyTestDescription %>', function (hooks) {
|
|
|
33
33
|
let component = this.owner.factoryFor('component:<%= componentPathName %>').create();
|
|
34
34
|
assert.ok(component);
|
|
35
35
|
});
|
|
36
|
-
})
|
|
36
|
+
}); <% } %>
|
|
File without changes
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
4
|
+
|
|
3
5
|
module.exports = {
|
|
4
6
|
description: 'Generates a controller.',
|
|
7
|
+
|
|
8
|
+
shouldTransformTypeScript: true,
|
|
9
|
+
|
|
10
|
+
init() {
|
|
11
|
+
this._super && this._super.init.apply(this, arguments);
|
|
12
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
13
|
+
},
|
|
14
|
+
|
|
5
15
|
normalizeEntityName: function (entityName) {
|
|
6
16
|
return entityName.replace(/\.js$/, ''); //Prevent generation of ".js.js" files
|
|
7
17
|
},
|
|
@@ -5,8 +5,18 @@ const stringUtil = require('ember-cli-string-utils');
|
|
|
5
5
|
const useTestFrameworkDetector = require('../test-framework-detector');
|
|
6
6
|
const path = require('path');
|
|
7
7
|
|
|
8
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
9
|
+
|
|
8
10
|
module.exports = useTestFrameworkDetector({
|
|
9
11
|
description: 'Generates a controller unit test.',
|
|
12
|
+
|
|
13
|
+
shouldTransformTypeScript: true,
|
|
14
|
+
|
|
15
|
+
init() {
|
|
16
|
+
this._super && this._super.init.apply(this, arguments);
|
|
17
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
18
|
+
},
|
|
19
|
+
|
|
10
20
|
locals: function (options) {
|
|
11
21
|
let dasherizedModuleName = stringUtil.dasherize(options.entity.name);
|
|
12
22
|
let controllerPathName = dasherizedModuleName;
|
|
File without changes
|
|
@@ -2,11 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
const normalizeEntityName = require('ember-cli-normalize-entity-name');
|
|
4
4
|
|
|
5
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
6
|
+
|
|
5
7
|
const path = require('path');
|
|
6
8
|
|
|
7
9
|
module.exports = {
|
|
8
10
|
description: 'Generates a helper function.',
|
|
9
11
|
|
|
12
|
+
shouldTransformTypeScript: true,
|
|
13
|
+
|
|
14
|
+
init() {
|
|
15
|
+
this._super && this._super.init.apply(this, arguments);
|
|
16
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
17
|
+
},
|
|
18
|
+
|
|
10
19
|
filesPath() {
|
|
11
20
|
let rootPath = 'files';
|
|
12
21
|
return path.join(this.path, rootPath);
|
|
File without changes
|
|
@@ -4,11 +4,20 @@ const stringUtils = require('ember-cli-string-utils');
|
|
|
4
4
|
const isPackageMissing = require('ember-cli-is-package-missing');
|
|
5
5
|
const semver = require('semver');
|
|
6
6
|
|
|
7
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
8
|
+
|
|
7
9
|
const useTestFrameworkDetector = require('../test-framework-detector');
|
|
8
10
|
|
|
9
11
|
module.exports = useTestFrameworkDetector({
|
|
10
12
|
description: 'Generates a helper integration test.',
|
|
11
13
|
|
|
14
|
+
shouldTransformTypeScript: true,
|
|
15
|
+
|
|
16
|
+
init() {
|
|
17
|
+
this._super && this._super.init.apply(this, arguments);
|
|
18
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
19
|
+
},
|
|
20
|
+
|
|
12
21
|
fileMapTokens: function () {
|
|
13
22
|
return {
|
|
14
23
|
__root__() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import { describe, it } from 'mocha';
|
|
3
|
-
import { setupRenderingTest } from '
|
|
3
|
+
import { setupRenderingTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
4
4
|
import { render } from '@ember/test-helpers';
|
|
5
5
|
<%= hbsImportStatement %>
|
|
6
6
|
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
4
|
+
|
|
3
5
|
module.exports = {
|
|
4
6
|
description: 'Generates an initializer.',
|
|
7
|
+
|
|
8
|
+
shouldTransformTypeScript: true,
|
|
9
|
+
|
|
10
|
+
init() {
|
|
11
|
+
this._super && this._super.init.apply(this, arguments);
|
|
12
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
13
|
+
},
|
|
5
14
|
};
|
|
File without changes
|
|
@@ -4,11 +4,19 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const stringUtils = require('ember-cli-string-utils');
|
|
6
6
|
|
|
7
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
7
8
|
const useTestFrameworkDetector = require('../test-framework-detector');
|
|
8
9
|
|
|
9
10
|
module.exports = useTestFrameworkDetector({
|
|
10
11
|
description: 'Generates an initializer unit test.',
|
|
11
12
|
|
|
13
|
+
shouldTransformTypeScript: true,
|
|
14
|
+
|
|
15
|
+
init() {
|
|
16
|
+
this._super && this._super.init.apply(this, arguments);
|
|
17
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
18
|
+
},
|
|
19
|
+
|
|
12
20
|
fileMapTokens: function () {
|
|
13
21
|
return {
|
|
14
22
|
__root__() {
|
|
@@ -12,7 +12,9 @@ describe('<%= friendlyTestName %>', function () {
|
|
|
12
12
|
initialize,
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
this.application = this.TestApplication.create({
|
|
15
|
+
this.application = this.TestApplication.create({
|
|
16
|
+
autoboot: false
|
|
17
|
+
});
|
|
16
18
|
});
|
|
17
19
|
|
|
18
20
|
afterEach(function () {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Application from '@ember/application';
|
|
2
|
+
|
|
3
|
+
import config from '<%= modulePrefix %>/config/environment';
|
|
4
|
+
import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
|
|
5
|
+
import { module, test } from 'qunit';
|
|
6
|
+
import Resolver from 'ember-resolver';
|
|
7
|
+
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app'; <% } else { %>import { run } from '@ember/runloop'; <% } %>
|
|
8
|
+
|
|
9
|
+
module('<%= friendlyTestName %>', function (hooks) {
|
|
10
|
+
hooks.beforeEach(function () {
|
|
11
|
+
this.TestApplication = class TestApplication extends Application {
|
|
12
|
+
modulePrefix = config.modulePrefix;
|
|
13
|
+
podModulePrefix = config.podModulePrefix;
|
|
14
|
+
Resolver = Resolver;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
this.TestApplication.initializer({
|
|
18
|
+
name: 'initializer under test',
|
|
19
|
+
initialize,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
this.application = this.TestApplication.create({
|
|
23
|
+
autoboot: false
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
hooks.afterEach(function () {
|
|
28
|
+
<% if (destroyAppExists) { %> destroyApp(this.application); <% } else { %> run(this.application, 'destroy'); <% } %>
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// TODO: Replace this with your real tests.
|
|
32
|
+
test('it works', async function (assert) {
|
|
33
|
+
await this.application.boot();
|
|
34
|
+
|
|
35
|
+
assert.ok(true);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
4
|
+
|
|
3
5
|
module.exports = {
|
|
6
|
+
shouldTransformTypeScript: true,
|
|
7
|
+
|
|
4
8
|
description: 'Generates an instance initializer.',
|
|
9
|
+
|
|
10
|
+
init() {
|
|
11
|
+
this._super && this._super.init.apply(this, arguments);
|
|
12
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
13
|
+
},
|
|
5
14
|
};
|
package/blueprints/instance-initializer-addon/files/__root__/__path__/{__name__.js → __name__.ts}
RENAMED
|
File without changes
|
|
@@ -4,11 +4,19 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const stringUtils = require('ember-cli-string-utils');
|
|
6
6
|
|
|
7
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
7
8
|
const useTestFrameworkDetector = require('../test-framework-detector');
|
|
8
9
|
|
|
9
10
|
module.exports = useTestFrameworkDetector({
|
|
10
11
|
description: 'Generates an instance initializer unit test.',
|
|
11
12
|
|
|
13
|
+
shouldTransformTypeScript: true,
|
|
14
|
+
|
|
15
|
+
init() {
|
|
16
|
+
this._super && this._super.init.apply(this, arguments);
|
|
17
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
18
|
+
},
|
|
19
|
+
|
|
12
20
|
fileMapTokens: function () {
|
|
13
21
|
return {
|
|
14
22
|
__root__() {
|
|
@@ -11,7 +11,11 @@ describe('<%= friendlyTestName %>', function () {
|
|
|
11
11
|
name: 'initializer under test',
|
|
12
12
|
initialize,
|
|
13
13
|
});
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
this.application = this.TestApplication.create({
|
|
16
|
+
autoboot: false
|
|
17
|
+
});
|
|
18
|
+
|
|
15
19
|
this.instance = this.application.buildInstance();
|
|
16
20
|
});
|
|
17
21
|
afterEach(function () {
|
|
@@ -13,11 +13,16 @@ module('<%= friendlyTestName %>', function (hooks) {
|
|
|
13
13
|
podModulePrefix = config.podModulePrefix;
|
|
14
14
|
Resolver = Resolver;
|
|
15
15
|
};
|
|
16
|
+
|
|
16
17
|
this.TestApplication.instanceInitializer({
|
|
17
18
|
name: 'initializer under test',
|
|
18
19
|
initialize,
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
this.application = this.TestApplication.create({
|
|
23
|
+
autoboot: false
|
|
24
|
+
});
|
|
25
|
+
|
|
21
26
|
this.instance = this.application.buildInstance();
|
|
22
27
|
});
|
|
23
28
|
hooks.afterEach(function () {
|
|
@@ -2,10 +2,8 @@ import Route from '@ember/routing/route';
|
|
|
2
2
|
|
|
3
3
|
export default class <%= classifiedModuleName %>Route extends Route {<% if (hasDynamicSegment) {%>
|
|
4
4
|
model(params) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* based on that dynamic segment here in the model hook.
|
|
8
|
-
*/
|
|
5
|
+
// This route was generated with a dynamic segment. Implement data loading
|
|
6
|
+
// based on that dynamic segment here in the model hook.
|
|
9
7
|
return params;
|
|
10
8
|
}
|
|
11
9
|
<%}%>}
|
|
@@ -6,9 +6,13 @@ const chalk = require('chalk');
|
|
|
6
6
|
const stringUtil = require('ember-cli-string-utils');
|
|
7
7
|
const EmberRouterGenerator = require('ember-router-generator');
|
|
8
8
|
|
|
9
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
10
|
+
|
|
9
11
|
module.exports = {
|
|
10
12
|
description: 'Generates a route and a template, and registers the route with the router.',
|
|
11
13
|
|
|
14
|
+
shouldTransformTypeScript: true,
|
|
15
|
+
|
|
12
16
|
availableOptions: [
|
|
13
17
|
{
|
|
14
18
|
name: 'path',
|
|
@@ -26,6 +30,11 @@ module.exports = {
|
|
|
26
30
|
},
|
|
27
31
|
],
|
|
28
32
|
|
|
33
|
+
init() {
|
|
34
|
+
this._super && this._super.init.apply(this, arguments);
|
|
35
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
36
|
+
},
|
|
37
|
+
|
|
29
38
|
fileMapTokens: function () {
|
|
30
39
|
return {
|
|
31
40
|
__name__(options) {
|
|
File without changes
|
|
@@ -4,9 +4,18 @@ const path = require('path');
|
|
|
4
4
|
const stringUtil = require('ember-cli-string-utils');
|
|
5
5
|
const inflector = require('inflection');
|
|
6
6
|
|
|
7
|
+
const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
|
|
8
|
+
|
|
7
9
|
module.exports = {
|
|
8
10
|
description: 'Generates import wrappers for a route and its template.',
|
|
9
11
|
|
|
12
|
+
shouldTransformTypeScript: true,
|
|
13
|
+
|
|
14
|
+
init() {
|
|
15
|
+
this._super && this._super.init.apply(this, arguments);
|
|
16
|
+
maybePolyfillTypeScriptBlueprints(this);
|
|
17
|
+
},
|
|
18
|
+
|
|
10
19
|
fileMapTokens: function () {
|
|
11
20
|
return {
|
|
12
21
|
__templatepath__: function (options) {
|