From 3d0a30652db1dc0bb5e6745e021587629492c7de Mon Sep 17 00:00:00 2001 From: Steve Calvert Date: Wed, 25 Apr 2018 18:52:02 -0700 Subject: [PATCH] Converting imports to use ember modules --- addon/index.js | 5 +- test-support/helpers/ember-test-selectors.js | 4 +- .../app/components/data-test-component.js | 4 +- .../app/components/print-test-attributes.js | 4 +- tests/dummy/app/controllers/bind-test.js | 4 +- tests/helpers/destroy-app.js | 4 +- tests/helpers/module-for-acceptance.js | 4 +- tests/helpers/start-app.js | 5 +- ...ta-test-attributes-from-components-test.js | 5 +- yarn.lock | 179 +++++++++++++----- 10 files changed, 146 insertions(+), 72 deletions(-) diff --git a/addon/index.js b/addon/index.js index 71538099..f0933350 100644 --- a/addon/index.js +++ b/addon/index.js @@ -1,6 +1,5 @@ -import Ember from 'ember'; - -const { isNone, deprecate } = Ember; +import { isNone } from '@ember/utils'; +import { deprecate } from '@ember/application/deprecations'; const message = `Using the "testSelector" helper function is deprecated as it obfuscates the selectors, making the tests harder to understand. Please use the actual attribute selectors instead, e.g. "[data-test-my-element]" instead of "testSelector('my-element')".`; diff --git a/test-support/helpers/ember-test-selectors.js b/test-support/helpers/ember-test-selectors.js index 9f79c59b..5704a55b 100644 --- a/test-support/helpers/ember-test-selectors.js +++ b/test-support/helpers/ember-test-selectors.js @@ -1,8 +1,6 @@ -import Ember from 'ember'; +import { deprecate } from '@ember/application/deprecations'; import testSelector from 'ember-test-selectors'; -const { deprecate } = Ember; - let message = 'Importing testSelector() from "/tests/helpers/ember-test-selectors" is deprecated. ' + 'Please import testSelector() from "ember-test-selectors" instead.'; diff --git a/tests/dummy/app/components/data-test-component.js b/tests/dummy/app/components/data-test-component.js index fbbfa0b6..9fbb61c9 100644 --- a/tests/dummy/app/components/data-test-component.js +++ b/tests/dummy/app/components/data-test-component.js @@ -1,6 +1,4 @@ -import Ember from 'ember'; - -const { Component } = Ember; +import Component from '@ember/component'; export default Component.extend({ // we're explicitly setting attributeBindings here to test that diff --git a/tests/dummy/app/components/print-test-attributes.js b/tests/dummy/app/components/print-test-attributes.js index 0e5bb2f1..88cf761d 100644 --- a/tests/dummy/app/components/print-test-attributes.js +++ b/tests/dummy/app/components/print-test-attributes.js @@ -1,6 +1,4 @@ -import Ember from 'ember'; - -const { Component } = Ember; +import Component from '@ember/component'; const component = Component.extend(); diff --git a/tests/dummy/app/controllers/bind-test.js b/tests/dummy/app/controllers/bind-test.js index eccfa039..08394341 100644 --- a/tests/dummy/app/controllers/bind-test.js +++ b/tests/dummy/app/controllers/bind-test.js @@ -1,8 +1,6 @@ -import Ember from 'ember'; +import Controller from '@ember/controller'; import { hasPositionalParams } from 'dummy/version-checks'; -const { Controller } = Ember; - export default Controller.extend({ hasPositionalParams, }); diff --git a/tests/helpers/destroy-app.js b/tests/helpers/destroy-app.js index 926d7563..e7f983bd 100644 --- a/tests/helpers/destroy-app.js +++ b/tests/helpers/destroy-app.js @@ -1,6 +1,4 @@ -import Ember from 'ember'; - -const { run } = Ember; +import { run } from '@ember/runloop'; export default function destroyApp(application) { run(application, 'destroy'); diff --git a/tests/helpers/module-for-acceptance.js b/tests/helpers/module-for-acceptance.js index 76996fd0..0daf9c9a 100644 --- a/tests/helpers/module-for-acceptance.js +++ b/tests/helpers/module-for-acceptance.js @@ -1,10 +1,8 @@ +import { Promise } from 'rsvp'; import { module } from 'qunit'; -import Ember from 'ember'; import startApp from '../helpers/start-app'; import destroyApp from '../helpers/destroy-app'; -const { RSVP: { Promise } } = Ember; - export default function(name, options = {}) { module(name, { beforeEach() { diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js index 83f842c5..af5b14de 100644 --- a/tests/helpers/start-app.js +++ b/tests/helpers/start-app.js @@ -1,9 +1,8 @@ -import Ember from 'ember'; +import { merge } from '@ember/polyfills'; +import { run } from '@ember/runloop'; import Application from '../../app'; import config from '../../config/environment'; -const { merge, run } = Ember; - export default function startApp(attrs) { let application; diff --git a/tests/integration/strip-data-test-attributes-from-components-test.js b/tests/integration/strip-data-test-attributes-from-components-test.js index e5ec3442..d983d9d0 100644 --- a/tests/integration/strip-data-test-attributes-from-components-test.js +++ b/tests/integration/strip-data-test-attributes-from-components-test.js @@ -2,7 +2,10 @@ import { moduleForComponent, test, skip } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; import config from 'dummy/config/environment'; -import { hasReliablePositionalParams, hasEmberVersion } from 'dummy/version-checks'; +import { + hasReliablePositionalParams, + hasEmberVersion +} from 'dummy/version-checks'; moduleForComponent('print-test-attributes', 'StripTestSelectorsTransform plugin', { integration: true diff --git a/yarn.lock b/yarn.lock index 86e36956..9d573f4b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -97,9 +97,9 @@ amd-name-resolver@0.0.7: dependencies: ensure-posix-path "^1.0.1" -amd-name-resolver@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/amd-name-resolver/-/amd-name-resolver-1.0.0.tgz#0e593b28d6fa3326ab1798107edaea961046e8d8" +amd-name-resolver@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/amd-name-resolver/-/amd-name-resolver-1.2.0.tgz#fc41b3848824b557313897d71f8d5a0184fbe679" dependencies: ensure-posix-path "^1.0.1" @@ -270,6 +270,10 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" +assertion-error@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" @@ -1224,6 +1228,10 @@ broccoli-stew@^1.2.0, broccoli-stew@^1.3.3, broccoli-stew@^1.4.0: symlink-or-copy "^1.1.8" walk-sync "^0.3.0" +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" @@ -1374,6 +1382,14 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" +chai@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247" + dependencies: + assertion-error "^1.0.1" + deep-eql "^0.1.3" + type-detect "^1.0.0" + chalk@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174" @@ -1828,6 +1844,12 @@ decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" +deep-eql@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2" + dependencies: + type-detect "0.1.1" + deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -1912,6 +1934,10 @@ detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" +diff@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" + diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -2146,11 +2172,11 @@ ember-cli-version-checker@^2.1.0: resolve "^1.3.3" semver "^5.3.0" -ember-cli@~3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.0.2.tgz#2272a2b2ffd9932cae247130d148aded60b446e7" +ember-cli@~3.1.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.1.2.tgz#bd8198b19f37b28d2ab7a795fe19efb7516a7e54" dependencies: - amd-name-resolver "1.0.0" + amd-name-resolver "^1.2.0" babel-plugin-transform-es2015-modules-amd "^6.24.0" bower-config "^1.3.0" bower-endpoint-parser "0.2.2" @@ -2183,19 +2209,20 @@ ember-cli@~3.0.0: ember-cli-preprocess-registry "^3.1.0" ember-cli-string-utils "^1.0.0" ensure-posix-path "^1.0.2" - execa "^0.8.0" + execa "^0.9.0" exists-sync "0.0.4" exit "^0.1.2" express "^4.12.3" filesize "^3.1.3" find-up "^2.1.0" - fs-extra "^4.0.0" + find-yarn-workspace-root "^1.0.0" + fs-extra "^5.0.0" fs-tree-diff "^0.5.2" get-caller-file "^1.0.0" git-repo-info "^1.4.1" - glob "7.1.1" + glob "^7.1.2" heimdalljs "^0.2.3" - heimdalljs-fs-monitor "^0.1.0" + heimdalljs-fs-monitor "^0.2.0" heimdalljs-graph "^0.3.1" heimdalljs-logger "^0.1.7" http-proxy "^1.9.0" @@ -2231,7 +2258,7 @@ ember-cli@~3.0.0: validate-npm-package-name "^3.0.0" walk-sync "^0.3.0" watch-detector "^0.1.0" - yam "0.0.22" + yam "^0.0.24" ember-disable-prototype-extensions@^1.1.2: version "1.1.2" @@ -2283,9 +2310,9 @@ ember-source-channel-url@^1.0.1: dependencies: got "^8.0.1" -ember-source@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-3.0.0.tgz#51811cae98d2ceec53bcfbaa876d02b2b5b2159f" +ember-source@~3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-3.1.1.tgz#9cf95e8a6d7568d60b8eda2aeda17ac8944e654b" dependencies: broccoli-funnel "^2.0.1" broccoli-merge-trees "^2.0.0" @@ -2298,8 +2325,8 @@ ember-source@~3.0.0: ember-cli-version-checker "^2.1.0" ember-router-generator "^1.2.3" inflection "^1.12.0" - jquery "^3.2.1" - resolve "^1.3.3" + jquery "^3.3.1" + resolve "^1.5.0" ember-test-helpers@^0.6.3: version "0.6.3" @@ -2592,18 +2619,6 @@ execa@^0.6.0, execa@^0.6.3: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - execa@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" @@ -2863,6 +2878,13 @@ find-up@^2.1.0: dependencies: locate-path "^2.0.0" +find-yarn-workspace-root@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.1.0.tgz#9817b6748cb90719f4dc37b4538bb200c697356f" + dependencies: + fs-extra "^4.0.3" + micromatch "^3.1.4" + findup-sync@0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.4.3.tgz#40043929e7bc60adf0b7f4827c4c6e75a0deca12" @@ -2993,9 +3015,17 @@ fs-extra@^2.0.0: graceful-fs "^4.1.2" jsonfile "^2.1.0" -fs-extra@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.2.tgz#f91704c53d1b461f893452b0c307d9997647ab6b" +fs-extra@^4.0.2, fs-extra@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd" dependencies: graceful-fs "^4.1.2" jsonfile "^4.0.0" @@ -3207,6 +3237,10 @@ growl@1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" +growl@1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" + growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" @@ -3341,12 +3375,14 @@ he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" -heimdalljs-fs-monitor@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/heimdalljs-fs-monitor/-/heimdalljs-fs-monitor-0.1.0.tgz#d404a65688c6714c485469ed3495da4853440272" +heimdalljs-fs-monitor@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/heimdalljs-fs-monitor/-/heimdalljs-fs-monitor-0.2.0.tgz#42504bc6da0e0016d0b7c8172fc71bb63185a518" dependencies: + chai "^3.5.0" heimdalljs "^0.2.0" heimdalljs-logger "^0.1.7" + mocha "^3.2.0" heimdalljs-graph@^0.3.1: version "0.3.3" @@ -3837,9 +3873,9 @@ isurl@^1.0.0-alpha5: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" -jquery@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787" +jquery@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca" js-reporters@1.2.0: version "1.2.0" @@ -4048,6 +4084,10 @@ lodash._basecopy@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" +lodash._basecreate@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" + lodash._baseflatten@^3.0.0: version "3.1.4" resolved "https://registry.yarnpkg.com/lodash._baseflatten/-/lodash._baseflatten-3.1.4.tgz#0770ff80131af6e34f3b511796a7ba5214e65ff7" @@ -4099,6 +4139,14 @@ lodash.clonedeep@^4.4.1: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" +lodash.create@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" + dependencies: + lodash._baseassign "^3.0.0" + lodash._basecreate "^3.0.0" + lodash._isiterateecall "^3.0.0" + lodash.debounce@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-3.1.1.tgz#812211c378a94cc29d5aa4e3346cf0bfce3a7df5" @@ -4136,7 +4184,7 @@ lodash.keys@^3.0.0: lodash.isarguments "^3.0.0" lodash.isarray "^3.0.0" -lodash.merge@^4.3.0, lodash.merge@^4.4.0, lodash.merge@^4.6.0: +lodash.merge@^4.3.0, lodash.merge@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.0.tgz#69884ba144ac33fe699737a6086deffadd0f89c5" @@ -4471,6 +4519,23 @@ mktemp@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/mktemp/-/mktemp-0.4.0.tgz#6d0515611c8a8c84e484aa2000129b98e981ff0b" +mocha@^3.2.0: + version "3.5.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.5.3.tgz#1e0480fe36d2da5858d1eb6acc38418b26eaa20d" + dependencies: + browser-stdout "1.3.0" + commander "2.9.0" + debug "2.6.8" + diff "3.2.0" + escape-string-regexp "1.0.5" + glob "7.1.1" + growl "1.9.2" + he "1.1.1" + json3 "3.3.2" + lodash.create "3.1.1" + mkdirp "0.5.1" + supports-color "3.1.2" + mocha@^5.0.0: version "5.0.4" resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.0.4.tgz#6b7aa328472da1088e69d47e75925fd3a3bb63c6" @@ -5119,9 +5184,9 @@ quick-temp@^0.1.2, quick-temp@^0.1.3, quick-temp@^0.1.5, quick-temp@^0.1.8: rimraf "^2.5.4" underscore.string "~3.3.4" -qunit-dom@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/qunit-dom/-/qunit-dom-0.5.0.tgz#b08db6f919656e0589ebf8bd85bc313febb454d8" +qunit-dom@^0.6.0: + version "0.6.2" + resolved "https://registry.yarnpkg.com/qunit-dom/-/qunit-dom-0.6.2.tgz#0b37012cbbc838f09eba760b3d39924ad5ccbccb" dependencies: broccoli-funnel "^2.0.0" broccoli-merge-trees "^2.0.0" @@ -5379,6 +5444,12 @@ resolve@^1.1.6, resolve@^1.3.0, resolve@^1.3.3: dependencies: path-parse "^1.0.5" +resolve@^1.5.0: + version "1.7.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3" + dependencies: + path-parse "^1.0.5" + responselike@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -5945,6 +6016,12 @@ sum-up@^1.0.1: dependencies: chalk "^1.0.0" +supports-color@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" + dependencies: + has-flag "^1.0.0" + supports-color@4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" @@ -6191,6 +6268,14 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +type-detect@0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822" + +type-detect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2" + type-is@~1.6.15: version "1.6.15" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.15.tgz#cab10fb4909e441c82842eafe1ad646c81804410" @@ -6521,12 +6606,12 @@ yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" -yam@0.0.22: - version "0.0.22" - resolved "https://registry.yarnpkg.com/yam/-/yam-0.0.22.tgz#38a76cb79a19284d9206ed49031e359a1340bd06" +yam@^0.0.24: + version "0.0.24" + resolved "https://registry.yarnpkg.com/yam/-/yam-0.0.24.tgz#11e9630444735f66a561d29221407de6d037cd95" dependencies: - fs-extra "^0.30.0" - lodash.merge "^4.4.0" + fs-extra "^4.0.2" + lodash.merge "^4.6.0" yargs-parser@^4.2.0: version "4.2.1"