From 90ea4f0f21f59aefb399830d157b85bb44f58eeb Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Fri, 6 Jul 2018 13:38:57 -0700 Subject: [PATCH] Update all the awkward browserify imports to plain ol' es6 imports --- ui/app/adapters/watchable.js | 2 +- ui/app/components/distribution-bar.js | 4 ++-- ui/app/components/json-viewer.js | 6 +----- ui/app/mixins/searchable.js | 2 +- ui/app/models/allocation.js | 2 +- ui/app/models/node-attributes.js | 2 +- ui/app/serializers/job.js | 2 +- ui/app/utils/classes/abstract-logger.js | 2 +- ui/app/utils/classes/log.js | 2 +- ui/tests/integration/attributes-table-test.js | 6 ++---- ui/tests/test-helper.js | 2 +- 11 files changed, 13 insertions(+), 19 deletions(-) diff --git a/ui/app/adapters/watchable.js b/ui/app/adapters/watchable.js index 9f7c072cc..7974bef40 100644 --- a/ui/app/adapters/watchable.js +++ b/ui/app/adapters/watchable.js @@ -1,7 +1,7 @@ import { get, computed } from '@ember/object'; import { assign } from '@ember/polyfills'; import { inject as service } from '@ember/service'; -import queryString from 'npm:query-string'; +import queryString from 'query-string'; import ApplicationAdapter from './application'; import { AbortError } from 'ember-data/adapters/errors'; diff --git a/ui/app/components/distribution-bar.js b/ui/app/components/distribution-bar.js index 50bd6fc69..f29f3b672 100644 --- a/ui/app/components/distribution-bar.js +++ b/ui/app/components/distribution-bar.js @@ -3,8 +3,8 @@ import { computed, observer } from '@ember/object'; import { run } from '@ember/runloop'; import { assign } from '@ember/polyfills'; import { guidFor, copy } from '@ember/object/internals'; -import d3 from 'npm:d3-selection'; -import 'npm:d3-transition'; +import d3 from 'd3-selection'; +import 'd3-transition'; import WindowResizable from '../mixins/window-resizable'; import styleStringProperty from '../utils/properties/style-string'; diff --git a/ui/app/components/json-viewer.js b/ui/app/components/json-viewer.js index 3408de044..092491917 100644 --- a/ui/app/components/json-viewer.js +++ b/ui/app/components/json-viewer.js @@ -2,11 +2,7 @@ import Component from '@ember/component'; import { computed } from '@ember/object'; import { run } from '@ember/runloop'; import { copy } from '@ember/object/internals'; -import JSONFormatterPkg from 'npm:json-formatter-js'; - -// json-formatter-js is packaged in a funny way that ember-cli-browserify -// doesn't unwrap properly. -const { default: JSONFormatter } = JSONFormatterPkg; +import JSONFormatter from 'json-formatter-js'; export default Component.extend({ classNames: ['json-viewer'], diff --git a/ui/app/mixins/searchable.js b/ui/app/mixins/searchable.js index 815956c69..180e4e1b3 100644 --- a/ui/app/mixins/searchable.js +++ b/ui/app/mixins/searchable.js @@ -1,7 +1,7 @@ import Mixin from '@ember/object/mixin'; import { get, computed } from '@ember/object'; import { reads } from '@ember/object/computed'; -import Fuse from 'npm:fuse.js'; +import Fuse from 'fuse.js'; /** Searchable mixin diff --git a/ui/app/models/allocation.js b/ui/app/models/allocation.js index d1ffe385e..b65232ce2 100644 --- a/ui/app/models/allocation.js +++ b/ui/app/models/allocation.js @@ -4,7 +4,7 @@ import Model from 'ember-data/model'; import attr from 'ember-data/attr'; import { belongsTo } from 'ember-data/relationships'; import { fragment, fragmentArray } from 'ember-data-model-fragments/attributes'; -import intersection from 'npm:lodash.intersection'; +import intersection from 'lodash.intersection'; import shortUUIDProperty from '../utils/properties/short-uuid'; import AllocationStats from '../utils/classes/allocation-stats'; diff --git a/ui/app/models/node-attributes.js b/ui/app/models/node-attributes.js index 232dae160..fef464c5f 100644 --- a/ui/app/models/node-attributes.js +++ b/ui/app/models/node-attributes.js @@ -1,7 +1,7 @@ import { get, computed } from '@ember/object'; import attr from 'ember-data/attr'; import Fragment from 'ember-data-model-fragments/fragment'; -import flat from 'npm:flat'; +import flat from 'flat'; const { unflatten } = flat; diff --git a/ui/app/serializers/job.js b/ui/app/serializers/job.js index e57c07e1c..a723f7f3d 100644 --- a/ui/app/serializers/job.js +++ b/ui/app/serializers/job.js @@ -1,6 +1,6 @@ import { assign } from '@ember/polyfills'; import ApplicationSerializer from './application'; -import queryString from 'npm:query-string'; +import queryString from 'query-string'; export default ApplicationSerializer.extend({ attrs: { diff --git a/ui/app/utils/classes/abstract-logger.js b/ui/app/utils/classes/abstract-logger.js index 55eb2da1e..1cb62ec67 100644 --- a/ui/app/utils/classes/abstract-logger.js +++ b/ui/app/utils/classes/abstract-logger.js @@ -2,7 +2,7 @@ import { assert } from '@ember/debug'; import Mixin from '@ember/object/mixin'; import { computed } from '@ember/object'; import { assign } from '@ember/polyfills'; -import queryString from 'npm:query-string'; +import queryString from 'query-string'; const MAX_OUTPUT_LENGTH = 50000; diff --git a/ui/app/utils/classes/log.js b/ui/app/utils/classes/log.js index 7791aef49..989570e95 100644 --- a/ui/app/utils/classes/log.js +++ b/ui/app/utils/classes/log.js @@ -4,7 +4,7 @@ import { assert } from '@ember/debug'; import Evented from '@ember/object/evented'; import EmberObject, { computed } from '@ember/object'; import { assign } from '@ember/polyfills'; -import queryString from 'npm:query-string'; +import queryString from 'query-string'; import { task } from 'ember-concurrency'; import StreamLogger from 'nomad-ui/utils/classes/stream-logger'; import PollLogger from 'nomad-ui/utils/classes/poll-logger'; diff --git a/ui/tests/integration/attributes-table-test.js b/ui/tests/integration/attributes-table-test.js index ea0fe99d5..b7f59464c 100644 --- a/ui/tests/integration/attributes-table-test.js +++ b/ui/tests/integration/attributes-table-test.js @@ -1,7 +1,7 @@ import { find, findAll } from 'ember-native-dom-helpers'; import { test, moduleForComponent } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; -import flat from 'npm:flat'; +import flat from 'flat'; const { flatten } = flat; @@ -59,9 +59,7 @@ test('should render the full path of key/value pair from the root of the object' assert.equal(deepRow.querySelector('[data-test-value]').textContent.trim(), 'properties'); }); -test('should render a row for key/value pairs even when the value is another object', function( - assert -) { +test('should render a row for key/value pairs even when the value is another object', function(assert) { this.set('attributes', commonAttributes); this.render(hbs`{{attributes-table attributes=attributes}}`); diff --git a/ui/tests/test-helper.js b/ui/tests/test-helper.js index 6bec495ff..3d00b17e9 100644 --- a/ui/tests/test-helper.js +++ b/ui/tests/test-helper.js @@ -1,4 +1,4 @@ -import 'npm:core-js'; +import 'core-js'; import resolver from './helpers/resolver'; import { setResolver } from 'ember-qunit'; import { start } from 'ember-cli-qunit';