Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-env node */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
Expand All @@ -11,7 +12,7 @@ module.exports = {
browser: true,
},
rules: {
"prettier/prettier": "error"
'prettier/prettier': 'error',
},
settings: {
node: {
Expand Down Expand Up @@ -43,14 +44,10 @@ module.exports = {
node: true,
},
plugins: ['node'],
rules: Object.assign(
{},
require('eslint-plugin-node').configs.recommended.rules,
{
// add your custom rules and overrides for node files here
'ember/avoid-leaking-state-in-ember-objects': 'off',
}
),
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
'ember/avoid-leaking-state-in-ember-objects': 'off',
}),
},

// test files
Expand Down
2 changes: 1 addition & 1 deletion config/deploy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env node */
'use strict';

module.exports = function(deployTarget) {
module.exports = function (deployTarget) {
let ENV = {
build: {},
// include other plugin configuration that applies to all deploy targets here
Expand Down
2 changes: 1 addition & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = function(/* environment, appConfig */) {
module.exports = function (/* environment, appConfig */) {
return {};
};
2 changes: 1 addition & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function(defaults) {
module.exports = function (defaults) {
let app = new EmberAddon(defaults, {
'ember-cli-babel': {
throwUnlessParallelizable: true,
Expand Down
60 changes: 29 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@
"dependencies": {
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4",
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
"@babel/plugin-transform-typescript": "~7.8.0",
"@babel/plugin-transform-typescript": "~7.10.4",
"ansi-to-html": "^0.6.6",
"broccoli-stew": "^3.0.0",
"debug": "^4.0.0",
"ember-cli-babel-plugin-helpers": "^1.0.0",
"execa": "^3.0.0",
"fs-extra": "^8.0.0",
"fs-extra": "^9.0.1",
"resolve": "^1.5.0",
"rsvp": "^4.8.1",
"semver": "^6.3.0",
"semver": "^7.3.2",
"stagehand": "^1.0.0",
"walk-sync": "^2.0.0"
"walk-sync": "^2.2.0"
},
"devDependencies": {
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.3.4",
"@commitlint/cli": "9.0.1",
"@commitlint/config-conventional": "9.0.1",
"@ember/optional-features": "1.3.0",
"@typed-ember/renovate-config": "1.2.1",
"@types/capture-console": "1.0.0",
Expand All @@ -65,28 +65,27 @@
"@types/console-ui": "2.2.3",
"@types/core-object": "3.0.1",
"@types/debug": "4.1.5",
"@types/ember": "3.1.2",
"@types/ember": "3.16.0",
"@types/ember-qunit": "3.4.9",
"@types/esprima": "4.0.2",
"@types/express": "4.17.6",
"@types/fs-extra": "8.1.1",
"@types/got": "8.3.5",
"@types/fs-extra": "9.0.1",
"@types/got": "9.6.11",
"@types/mocha": "7.0.2",
"@types/node": "9.6.56",
"@types/node": "14.0.14",
"@types/qunit": "2.9.1",
"@types/resolve": "1.17.1",
"@types/semver": "6.2.1",
"@types/tmp": "0.1.0",
"@typescript-eslint/eslint-plugin": "2.22.0",
"@typescript-eslint/parser": "2.22.0",
"@types/semver": "7.3.1",
"@typescript-eslint/eslint-plugin": "3.5.0",
"@typescript-eslint/parser": "3.5.0",
"broccoli-asset-rev": "3.0.0",
"broccoli-node-api": "1.7.0",
"broccoli-plugin": "4.0.3",
"capture-console": "1.0.1",
"co": "4.6.0",
"commitlint-azure-pipelines-cli": "1.0.3",
"conventional-changelog-cli": "2.0.34",
"ember-cli": "3.16.2",
"ember-cli": "3.19.0",
"ember-cli-addon-docs": "ember-learn/ember-cli-addon-docs#4f5bfd11",
"ember-cli-addon-docs-esdoc": "0.2.3",
"ember-cli-app-version": "3.2.0",
Expand All @@ -97,9 +96,8 @@
"ember-cli-deploy-build": "2.0.0",
"ember-cli-deploy-git": "1.3.4",
"ember-cli-deploy-git-ci": "1.0.1",
"ember-cli-htmlbars": "4.2.3",
"ember-cli-htmlbars": "5.2.0",
"ember-cli-inject-live-reload": "2.0.2",
"ember-cli-release": "0.2.9",
"ember-cli-sri": "2.1.1",
"ember-cli-typescript-blueprints": "3.0.0",
"ember-cli-uglify": "3.0.0",
Expand All @@ -109,29 +107,29 @@
"ember-load-initializers": "2.1.1",
"ember-maybe-import-regenerator": "0.1.6",
"ember-qunit": "4.6.0",
"ember-resolver": "7.0.0",
"ember-source": "3.17.3",
"ember-resolver": "8.0.0",
"ember-source": "3.19.0",
"ember-try": "1.4.0",
"eslint": "6.8.0",
"eslint": "7.3.1",
"eslint-config-prettier": "6.11.0",
"eslint-plugin-ember": "7.10.1",
"eslint-plugin-node": "11.0.0",
"eslint-plugin-ember": "8.9.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "3.1.4",
"esprima": "4.0.1",
"fixturify": "1.3.0",
"got": "10.7.0",
"fixturify": "2.1.0",
"got": "11.3.0",
"handlebars": "4.7.6",
"husky": "4.2.5",
"in-repo-a": "link:tests/dummy/lib/in-repo-a",
"in-repo-b": "link:tests/dummy/lib/in-repo-b",
"loader.js": "4.7.0",
"mocha": "7.2.0",
"prettier": "1.18.2",
"prettier-eslint": "9.0.2",
"qunit-dom": "1.1.0",
"testdouble": "3.13.1",
"tmp": "0.1.0",
"ts-node": "8.6.2",
"mocha": "8.0.1",
"prettier": "2.0.5",
"prettier-eslint": "11.0.0",
"qunit-dom": "1.2.0",
"rimraf": "^3.0.2",
"testdouble": "3.16.0",
"ts-node": "8.10.2",
"typescript": "3.7.5"
},
"resolutions": {
Expand Down
10 changes: 5 additions & 5 deletions tests/dummy/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ const Router = AddonDocsRouter.extend({
rootURL: config.rootURL,
});

Router.map(function() {
docsRoute(this, function() {
Router.map(function () {
docsRoute(this, function () {
this.route('upgrade-notes');
this.route('configuration');
this.route('ts-guide', function() {
this.route('ts-guide', function () {
this.route('with-addons');
this.route('using-ts-effectively');
this.route('current-limitations');
});
this.route('troubleshooting', function() {
this.route('troubleshooting', function () {
this.route('conflicting-types');
});
this.route('type-defs', function() {
this.route('type-defs', function () {
this.route('package-names');
});
});
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

module.exports = function(environment) {
module.exports = function (environment) {
let ENV = {
modulePrefix: 'dummy',
environment,
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/components/js-importing-ts-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

module('Integration | Component | js importing ts', function(hooks) {
module('Integration | Component | js importing ts', function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function(assert) {
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/components/ts-component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

module('Integration | Component | ts component', function(hooks) {
module('Integration | Component | ts component', function (hooks) {
setupRenderingTest(hooks);

test('it renders', async function(assert) {
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

Expand Down
12 changes: 6 additions & 6 deletions tests/unit/build-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ import fileB from 'dummy/b';
import { description as fromAts } from 'in-repo-a/test-support/from-ats';
import { description as fromTs } from 'dummy/tests/from-ts';

module('Unit | Build', function() {
test("in-repo addons' addon trees wind up in the right place", function(assert) {
module('Unit | Build', function () {
test("in-repo addons' addon trees wind up in the right place", function (assert) {
assert.equal(addonFileA, 'in-repo-a/test-file');
assert.equal(addonFileB, 'in-repo-b/test-file');
});

test("in-repo addons' app trees wind up in the right place", function(assert) {
test("in-repo addons' app trees wind up in the right place", function (assert) {
assert.equal(fileA, 'dummy/a');
assert.equal(fileB, 'dummy/b');
});

test("addon's addon-test-support files end up in <addon-name>/test-support/*", function(assert) {
test("addon's addon-test-support files end up in <addon-name>/test-support/*", function (assert) {
assert.ok(fromAts);
assert.equal(fromAts, 'From addon-test-support');
});

test("addon's test-support files end up in dummy/tests/*", function(assert) {
test("addon's test-support files end up in dummy/tests/*", function (assert) {
assert.ok(fromTs);
assert.equal(fromTs, 'From test-support');
});

test('property initialization occurs in the right order', function(assert) {
test('property initialization occurs in the right order', function (assert) {
class TestClass {
// we shouldn't encourage folks to write code like this, but tsc ensures
// that constructor param fields are set before field initializers run
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/helpers/js-help-test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { jsHelp } from 'dummy/helpers/js-help';
import { module, test } from 'qunit';

module('Unit | Helper | js help', function() {
module('Unit | Helper | js help', function () {
// Replace this with your real tests.
test('it works', function(assert) {
test('it works', function (assert) {
let result = jsHelp([42]);
assert.ok(result);
});
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/helpers/typed-help-test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { typedHelp } from 'dummy/helpers/typed-help';
import { module, test } from 'qunit';

module('Unit | Helper | typed help', function() {
module('Unit | Helper | typed help', function () {
// Replace this with your real tests.
test('it works', function(assert) {
test('it works', function (assert) {
let result = typedHelp([42]);
assert.ok(result);
});
Expand Down
6 changes: 3 additions & 3 deletions ts/addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default addon({
let checked = false;
let stew = require('broccoli-stew') as typeof import('broccoli-stew');

return stew.afterBuild(input, function() {
return stew.afterBuild(input, function () {
if (!checked) {
checked = true;
addon._checkForFileCollisions(this.inputPaths[0]);
Expand Down Expand Up @@ -148,7 +148,7 @@ export default addon({
},

_checkBabelVersion() {
let babel = this.parent.addons.find(addon => addon.name === 'ember-cli-babel');
let babel = this.parent.addons.find((addon) => addon.name === 'ember-cli-babel');
let version = babel && babel.pkg.version;
if (!babel || !(semver.gte(version!, '7.7.3') && semver.lt(version!, '8.0.0'))) {
let versionString = babel ? `version ${babel.pkg.version}` : `no instance of ember-cli-babel`;
Expand Down Expand Up @@ -259,7 +259,7 @@ export default addon({
let childProcess = fork(`${__dirname}/lib/typechecking/worker/launch`);
let worker = await connect<TypecheckWorker>(childProcess);

await worker.onTypecheck(status => {
await worker.onTypecheck((status) => {
for (let error of status.errors) {
this.ui.writeLine(error);
}
Expand Down
17 changes: 9 additions & 8 deletions ts/blueprints/ember-cli-typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ module.exports = {
}

return {
includes: JSON.stringify(includes.map(include => `${include}/**/*`), null, 2).replace(
/\n/g,
'\n '
),
pathsFor: dasherizedName => {
includes: JSON.stringify(
includes.map((include) => `${include}/**/*`),
null,
2
).replace(/\n/g, '\n '),
pathsFor: (dasherizedName) => {
// We need to wait to use this module until `ember-cli-typescript-blueprints` has been installed
let updatePathsForAddon = require('ember-cli-typescript-blueprints/lib/utilities/update-paths-for-addon');
let appName = isAddon ? 'dummy' : dasherizedName;
Expand Down Expand Up @@ -105,12 +106,12 @@ module.exports = {

return JSON.stringify(paths, null, 2).replace(/\n/g, '\n ');
},
indexDeclarations: dasherizedName => {
indexDeclarations: (dasherizedName) => {
const isDummyApp = dasherizedName === 'dummy';
const useAppDeclarations = !(isAddon || isDummyApp);
return useAppDeclarations ? APP_DECLARATIONS : '';
},
globalDeclarations: dasherizedName => {
globalDeclarations: (dasherizedName) => {
/** @type {'classic' | 'pods'} */
let projectLayout;
if (isPods) projectLayout = 'pods';
Expand Down Expand Up @@ -179,7 +180,7 @@ module.exports = {
let files = this._super.files.apply(this, arguments);

if (!this._has('ember-data')) {
files = files.filter(file => file !== 'types/ember-data/types/registries/model.d.ts');
files = files.filter((file) => file !== 'types/ember-data/types/registries/model.d.ts');
}

return files;
Expand Down
2 changes: 1 addition & 1 deletion ts/lib/commands/precompile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default command({
// Ensure that if we are dealing with an addon that is using a different
// addon name from its package name, we use the addon name, since that is
// how it will be written for imports.
let addon = this.project.addons.find(addon => addon.root === this.project.root);
let addon = this.project.addons.find((addon) => addon.root === this.project.root);
if (addon && addon.name !== packageName) {
packageName = addon.name;
}
Expand Down
Loading