diff --git a/addon/db-collection.js b/addon/db-collection.js index 935d44c6a..c7298dee0 100644 --- a/addon/db-collection.js +++ b/addon/db-collection.js @@ -1,6 +1,6 @@ -import _assign from 'lodash/assign'; -import _map from 'lodash/map'; -import _isEqual from 'lodash/isEqual'; +import { assign as _assign } from 'lodash-es'; +import { map as _map } from 'lodash-es'; +import { isEqual as _isEqual } from 'lodash-es'; function duplicate(data) { if (Array.isArray(data)) { diff --git a/addon/db.js b/addon/db.js index 5fd3a933b..99180fdb2 100644 --- a/addon/db.js +++ b/addon/db.js @@ -1,7 +1,7 @@ import DbCollection from './db-collection'; import IdentityManager from './identity-manager'; import { singularize } from './utils/inflector'; -import _cloneDeep from 'lodash/cloneDeep'; +import { cloneDeep as _cloneDeep } from 'lodash-es'; /** Your Mirage server has a database which you can interact with in your route handlers. You’ll typically use models to interact with your database data, but you can always reach into the db directly in the event you want more control. diff --git a/addon/factory.js b/addon/factory.js index 8fe4d590b..b66ebe8b5 100644 --- a/addon/factory.js +++ b/addon/factory.js @@ -1,8 +1,8 @@ -import _assign from 'lodash/assign'; -import _isFunction from 'lodash/isFunction'; -import _mapValues from 'lodash/mapValues'; +import { assign as _assign } from 'lodash-es'; +import { isFunction as _isFunction } from 'lodash-es'; +import { mapValues as _mapValues } from 'lodash-es'; import referenceSort from './utils/reference-sort'; -import _isPlainObject from 'lodash/isPlainObject'; +import { isPlainObject as _isPlainObject} from 'lodash-es'; let Factory = function() { this.build = function(sequence) { diff --git a/addon/orm/associations/belongs-to.js b/addon/orm/associations/belongs-to.js index 3f94ad795..750e21247 100644 --- a/addon/orm/associations/belongs-to.js +++ b/addon/orm/associations/belongs-to.js @@ -1,5 +1,5 @@ import Association from './association'; -import _assign from 'lodash/assign'; +import { assign as _assign } from 'lodash-es'; import { capitalize, camelize } from 'ember-cli-mirage/utils/inflector'; import { toCollectionName } from 'ember-cli-mirage/utils/normalize-name'; import assert from 'ember-cli-mirage/assert'; diff --git a/addon/orm/associations/has-many.js b/addon/orm/associations/has-many.js index dd1e124db..d75c10602 100644 --- a/addon/orm/associations/has-many.js +++ b/addon/orm/associations/has-many.js @@ -1,8 +1,8 @@ import Association from './association'; import Collection from '../collection'; import PolymorphicCollection from '../polymorphic-collection'; -import _assign from 'lodash/assign'; -import _compact from 'lodash/compact'; +import { assign as _assign } from 'lodash-es'; +import { compact as _compact } from 'lodash-es'; import { capitalize, camelize, singularize } from 'ember-cli-mirage/utils/inflector'; import { toCollectionName } from 'ember-cli-mirage/utils/normalize-name'; import assert from 'ember-cli-mirage/assert'; diff --git a/addon/orm/collection.js b/addon/orm/collection.js index cc2f4d9d9..40dbbf06a 100644 --- a/addon/orm/collection.js +++ b/addon/orm/collection.js @@ -1,5 +1,5 @@ import assert from '../assert'; -import _invokeMap from 'lodash/invokeMap'; +import { invokeMap as _invokeMap } from 'lodash-es'; /** Collections represent arrays of models. They are returned by a hasMany association, or by one of the ModelClass query methods: diff --git a/addon/orm/model.js b/addon/orm/model.js index 84429ed5c..c8083804c 100644 --- a/addon/orm/model.js +++ b/addon/orm/model.js @@ -5,9 +5,9 @@ import extend from '../utils/extend'; import assert from '../assert'; import Collection from './collection'; import PolymorphicCollection from './polymorphic-collection'; -import _values from 'lodash/values'; -import _compact from 'lodash/compact'; -import _assign from 'lodash/assign'; +import { values as _values } from 'lodash-es'; +import { compact as _compact } from 'lodash-es'; +import { assign as _assign } from 'lodash-es'; /** Models wrap your database and allow you to define relationships. diff --git a/addon/orm/polymorphic-collection.js b/addon/orm/polymorphic-collection.js index 6bc5a2156..85bb21318 100644 --- a/addon/orm/polymorphic-collection.js +++ b/addon/orm/polymorphic-collection.js @@ -1,5 +1,5 @@ -import _invokeMap from 'lodash/invokeMap'; -import _isEqual from 'lodash/isEqual'; +import { invokeMap as _invokeMap } from 'lodash-es'; +import { isEqual as _isEqual } from 'lodash-es'; /** * An array of models, returned from one of the schema query diff --git a/addon/orm/schema.js b/addon/orm/schema.js index 26a6dc6d7..99efcdaa1 100644 --- a/addon/orm/schema.js +++ b/addon/orm/schema.js @@ -2,9 +2,9 @@ import { pluralize, camelize, dasherize } from '../utils/inflector'; import { toCollectionName, toModelName } from 'ember-cli-mirage/utils/normalize-name'; import Association from './associations/association'; import Collection from './collection'; -import _assign from 'lodash/assign'; -import _forIn from 'lodash/forIn'; -import _includes from 'lodash/includes'; +import { assign as _assign } from 'lodash-es'; +import { forIn as _forIn } from 'lodash-es'; +import { includes as _includes } from 'lodash-es'; import assert from '../assert'; /** diff --git a/addon/serializer-registry.js b/addon/serializer-registry.js index 2ae885f39..c76ffcf11 100644 --- a/addon/serializer-registry.js +++ b/addon/serializer-registry.js @@ -6,7 +6,7 @@ import JsonApiSerializer from 'ember-cli-mirage/serializers/json-api-serializer' import { pluralize, camelize } from './utils/inflector'; import assert from './assert'; -import _assign from 'lodash/assign'; +import { assign as _assign } from 'lodash-es'; /** * @hide diff --git a/addon/serializer.js b/addon/serializer.js index d75d13548..0a680f907 100644 --- a/addon/serializer.js +++ b/addon/serializer.js @@ -4,15 +4,15 @@ import PolymorphicCollection from './orm/polymorphic-collection'; import extend from './utils/extend'; import { singularize, pluralize, camelize } from './utils/inflector'; import assert from './assert'; -import _isFunction from 'lodash/isFunction'; -import _isArray from 'lodash/isArray'; -import _isEmpty from 'lodash/isEmpty'; -import _includes from 'lodash/includes'; -import _assign from 'lodash/assign'; -import _get from 'lodash/get'; -import _flatten from 'lodash/flatten'; -import _compact from 'lodash/compact'; -import _uniqBy from 'lodash/uniqBy'; +import { isFunction as _isFunction } from 'lodash-es'; +import { isArray as _isArray } from 'lodash-es'; +import { isEmpty as _isEmpty } from 'lodash-es'; +import { includes as _includes } from 'lodash-es'; +import { assign as _assign } from 'lodash-es'; +import { get as _get } from 'lodash-es'; +import { flatten as _flatten } from 'lodash-es'; +import { compact as _compact } from 'lodash-es'; +import { uniqBy as _uniqBy } from 'lodash-es'; /** Serializers are responsible for formatting your route handler's response. diff --git a/addon/serializers/json-api-serializer.js b/addon/serializers/json-api-serializer.js index fe0d7677d..90156a3d2 100644 --- a/addon/serializers/json-api-serializer.js +++ b/addon/serializers/json-api-serializer.js @@ -1,10 +1,10 @@ import Serializer from '../serializer'; import { dasherize, pluralize, camelize } from '../utils/inflector'; -import _get from 'lodash/get'; -import _flatten from 'lodash/flatten'; -import _compact from 'lodash/compact'; -import _uniqBy from 'lodash/uniqBy'; -import _isEmpty from 'lodash/isEmpty'; +import { get as _get } from 'lodash-es'; +import { flatten as _flatten } from 'lodash-es'; +import { compact as _compact } from 'lodash-es'; +import { uniqBy as _uniqBy } from 'lodash-es'; +import { isEmpty as _isEmpty } from 'lodash-es'; import assert from 'ember-cli-mirage/assert'; /** diff --git a/addon/server.js b/addon/server.js index a52a1d37b..34338f62f 100644 --- a/addon/server.js +++ b/addon/server.js @@ -13,11 +13,11 @@ import SerializerRegistry from './serializer-registry'; import RouteHandler from './route-handler'; import BelongsTo from './orm/associations/belongs-to'; -import _pick from 'lodash/pick'; -import _assign from 'lodash/assign'; -import _find from 'lodash/find'; -import _isPlainObject from 'lodash/isPlainObject'; -import _isInteger from 'lodash/isInteger'; +import { pick as _pick } from 'lodash-es'; +import { assign as _assign } from 'lodash-es'; +import { find as _find } from 'lodash-es'; +import { isPlainObject as _isPlainObject } from 'lodash-es'; +import { isInteger as _isInteger } from 'lodash-es'; /** * Creates a new Pretender instance. diff --git a/addon/start-mirage.js b/addon/start-mirage.js index 3d3fd5e2f..ea27e3459 100644 --- a/addon/start-mirage.js +++ b/addon/start-mirage.js @@ -1,7 +1,7 @@ import { getWithDefault } from '@ember/object'; import readModules from 'ember-cli-mirage/utils/read-modules'; import Server from 'ember-cli-mirage/server'; -import _assign from 'lodash/assign'; +import { assign as _assign } from 'lodash-es'; /** Helper to start mirage. This should not be called directly. In rfc232/rfc268 diff --git a/addon/utils/ember-data.js b/addon/utils/ember-data.js index a7a36355a..eb562090e 100644 --- a/addon/utils/ember-data.js +++ b/addon/utils/ember-data.js @@ -1,6 +1,6 @@ /* global requirejs */ -import _find from 'lodash/find'; +import { find as _find } from 'lodash-es'; function _hasEmberData() { let matchRegex = /^ember-data/i; diff --git a/addon/utils/extend.js b/addon/utils/extend.js index 75a03016d..9aa4da2ac 100644 --- a/addon/utils/extend.js +++ b/addon/utils/extend.js @@ -1,5 +1,5 @@ -import _assign from 'lodash/assign'; -import _has from 'lodash/has'; +import { assign as _assign } from 'lodash-es'; +import { has as _has } from 'lodash-es'; /** @hide diff --git a/addon/utils/is-association.js b/addon/utils/is-association.js index 3f1079547..85aca44a6 100644 --- a/addon/utils/is-association.js +++ b/addon/utils/is-association.js @@ -1,4 +1,4 @@ -import _isPlainObject from 'lodash/isPlainObject'; +import { isPlainObject as _isPlainObject } from 'lodash-es'; /** @hide diff --git a/addon/utils/read-modules.js b/addon/utils/read-modules.js index 2d4105342..b2f784c98 100644 --- a/addon/utils/read-modules.js +++ b/addon/utils/read-modules.js @@ -3,7 +3,7 @@ 'use strict'; import { assert } from '@ember/debug'; -import _camelCase from 'lodash/camelCase'; +import { camelCase as _camelCase } from 'lodash-es'; import { pluralize } from 'ember-cli-mirage/utils/inflector'; import require from 'require'; diff --git a/addon/utils/reference-sort.js b/addon/utils/reference-sort.js index 93b3627d4..d47d366d3 100644 --- a/addon/utils/reference-sort.js +++ b/addon/utils/reference-sort.js @@ -1,6 +1,6 @@ // jscs:disable disallowVar, requireArrayDestructuring -import _uniq from 'lodash/uniq'; -import _flatten from 'lodash/flatten'; +import { uniq as _uniq } from 'lodash-es'; +import { flatten as _flatten } from 'lodash-es'; /** @hide diff --git a/package.json b/package.json index 6b57eefbb..a22756cf6 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,7 @@ "test": "ember test", "test:all": "ember try:each", "test:browser": "ember test --test-port=0", - "test:test-projects": "./scripts/test.sh", - "prepare": "./scripts/link.sh" + "test:test-projects": "./scripts/test.sh" }, "dependencies": { "broccoli-file-creator": "^2.1.1", @@ -44,7 +43,7 @@ "ember-cli-babel": "^7.5.0", "ember-get-config": "^0.2.2", "ember-inflector": "^2.0.0 || ^3.0.0", - "lodash": "^4.17.11", + "lodash-es": "^4.17.11", "pretender": "3.0.1" }, "devDependencies": { diff --git a/tests/integration/route-handlers/function-handler/serialize-test.js b/tests/integration/route-handlers/function-handler/serialize-test.js index 9bea8f3f0..c4dfd42fb 100644 --- a/tests/integration/route-handlers/function-handler/serialize-test.js +++ b/tests/integration/route-handlers/function-handler/serialize-test.js @@ -1,7 +1,7 @@ import { module, test } from 'qunit'; import { Model, Collection, ActiveModelSerializer } from 'ember-cli-mirage'; import Server from 'ember-cli-mirage/server'; -import _uniqBy from 'lodash/uniqBy'; +import { uniqBy as _uniqBy } from 'lodash-es'; import promiseAjax from '../../../helpers/promise-ajax'; module('Integration | Route handlers | Function handler | #serialize', function(hooks) { diff --git a/tests/integration/serializers/base/basic-test.js b/tests/integration/serializers/base/basic-test.js index dabef7757..ba7f80c91 100644 --- a/tests/integration/serializers/base/basic-test.js +++ b/tests/integration/serializers/base/basic-test.js @@ -2,7 +2,7 @@ import SerializerRegistry from 'ember-cli-mirage/serializer-registry'; import schemaHelper from '../schema-helper'; import { module, test } from 'qunit'; -import _uniqBy from 'lodash/uniqBy'; +import { uniqBy as _uniqBy } from 'lodash-es'; module('Integration | Serializers | Base | Basic', function(hooks) { hooks.beforeEach(function() { diff --git a/yarn.lock b/yarn.lock index f95986933..42a83e1c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9255,6 +9255,11 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" +lodash-es@^4.17.11: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.11.tgz#145ab4a7ac5c5e52a3531fb4f310255a152b4be0" + integrity sha1-FFq0p6xcXlKjUx+08xAlWhUrS+A= + lodash._baseassign@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e"