Skip to content

Commit

Permalink
Merge pull request #5645 from emberjs/cleanup-project
Browse files Browse the repository at this point in the history
[CHORE] fix up module imports
  • Loading branch information
runspired authored Sep 20, 2018
2 parents 5de712c + 0de3b97 commit 58cd257
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 1,053 deletions.
1,022 changes: 0 additions & 1,022 deletions MODULE_REPORT.md

This file was deleted.

6 changes: 4 additions & 2 deletions addon/-legacy-private/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@module ember-data
*/

import { registerWaiter, unregisterWaiter } from '@ember/test';

import { A } from '@ember/array';
import EmberError from '@ember/error';
import MapWithDefault from './map-with-default';
Expand Down Expand Up @@ -270,7 +272,7 @@ Store = Service.extend({
return shouldTrack !== true || isSettled;
};

Ember.Test.registerWaiter(this.__asyncWaiter);
registerWaiter(this.__asyncWaiter);
}
},

Expand Down Expand Up @@ -3004,7 +3006,7 @@ Store = Service.extend({
this.unloadAll();

if (DEBUG) {
Ember.Test.unregisterWaiter(this.__asyncWaiter);
unregisterWaiter(this.__asyncWaiter);
let shouldTrack = this.shouldTrackAsyncRequests;
let tracked = this._trackedAsyncRequests;
let isSettled = tracked.length === 0;
Expand Down
3 changes: 2 additions & 1 deletion addon/-private/core.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Namespace from '@ember/application/namespace';
import Ember from 'ember';
import VERSION from 'ember-data/version';

Expand All @@ -17,7 +18,7 @@ import VERSION from 'ember-data/version';
@type String
@static
*/
const DS = Ember.Namespace.create({
const DS = Namespace.create({
VERSION: VERSION,
name: 'DS',
});
Expand Down
6 changes: 3 additions & 3 deletions addon/-private/features.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ember from 'ember';
import { isEnabled } from '@ember/canary-features';

export default function isEnabled() {
return Ember.FEATURES.isEnabled(...arguments);
export default function featureIsEnabled() {
return isEnabled(...arguments);
}
3 changes: 2 additions & 1 deletion addon/-private/system/backburner.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { registerWaiter } from '@ember/test';
import Ember from 'ember';
import { DEBUG } from '@glimmer/env';

Expand All @@ -8,7 +9,7 @@ const backburner = new Ember._Backburner([
]);

if (DEBUG) {
Ember.Test.registerWaiter(() => {
registerWaiter(() => {
return !backburner.currentInstance && !backburner.hasTimers();
});
}
Expand Down
6 changes: 4 additions & 2 deletions addon/-record-data-private/system/store.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
@module ember-data
*/
import { registerWaiter, unregisterWaiter } from '@ember/test';

import { A } from '@ember/array';
import EmberError from '@ember/error';
import MapWithDefault from './map-with-default';
Expand Down Expand Up @@ -277,7 +279,7 @@ Store = Service.extend({
return shouldTrack !== true || isSettled;
};

Ember.Test.registerWaiter(this.__asyncWaiter);
registerWaiter(this.__asyncWaiter);
}
},

Expand Down Expand Up @@ -3241,7 +3243,7 @@ Store = Service.extend({
this.unloadAll();

if (DEBUG) {
Ember.Test.unregisterWaiter(this.__asyncWaiter);
unregisterWaiter(this.__asyncWaiter);
let shouldTrack = this.shouldTrackAsyncRequests;
let tracked = this._trackedAsyncRequests;
let isSettled = tracked.length === 0;
Expand Down
6 changes: 3 additions & 3 deletions addon/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { VERSION } from '@ember/version';
import EmberError from '@ember/error';
import Ember from 'ember';

/**
Ember Data
@module ember-data
@main ember-data
*/

if (Ember.VERSION.match(/^1\.([0-9]|1[0-2])\./)) {
if (VERSION.match(/^1\.([0-9]|1[0-2])\./)) {
throw new EmberError(
'Ember Data requires at least Ember 1.13.0, but you have ' +
Ember.VERSION +
VERSION +
'. Please upgrade your version of Ember, then upgrade Ember Data.'
);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/calculate-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ var npmGitInfo = require('npm-git-info');

module.exports = function() {
var gitPath = path.join(__dirname, '..', '.git');
var package = require('../package.json');
var packageVersion = package.version;
var pkg = require('../package.json');
var packageVersion = pkg.version;
var suffix = '';

var info;
Expand All @@ -18,7 +18,7 @@ module.exports = function() {

suffix = '+' + info.sha.slice(0, 10);
} else {
info = npmGitInfo(package);
info = npmGitInfo(pkg);
if (info.isInstalledAsNpmPackage() && !info.hasVersionInRef()) {
suffix = '+' + info.abbreviatedSha;
}
Expand Down
4 changes: 1 addition & 3 deletions tests/helpers/watch-property.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Ember from 'ember';
import { removeObserver, addObserver } from '@ember/object/observers';
import QUnit from 'qunit';

const { addObserver, removeObserver } = Ember;

function makeCounter() {
let count = 0;
const counter = Object.create(null);
Expand Down
6 changes: 1 addition & 5 deletions tests/integration/application-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Namespace from '@ember/application/namespace';
import Service, { inject as service } from '@ember/service';
import Controller from '@ember/controller';
import Application from '@ember/application';
Expand All @@ -9,7 +10,6 @@ import { module, test } from 'qunit';
import DS from 'ember-data';

const Store = DS.Store;
const Namespace = Ember.Namespace;

let app, App, container;

Expand Down Expand Up @@ -43,7 +43,6 @@ module('integration/application - Injecting a Custom Store', {

afterEach() {
run(app, app.destroy);
Ember.BOOTED = false;
},
});

Expand Down Expand Up @@ -83,7 +82,6 @@ module('integration/application - Injecting the Default Store', {

afterEach() {
run(app, 'destroy');
Ember.BOOTED = false;
},
});

Expand Down Expand Up @@ -118,7 +116,6 @@ if (Ember.inject && service) {

afterEach() {
run(app, 'destroy');
Ember.BOOTED = false;
},
});

Expand All @@ -139,7 +136,6 @@ module('integration/application - Attaching initializer', {
if (app) {
run(app, app.destroy);
}
Ember.BOOTED = false;
},
});

Expand Down
3 changes: 1 addition & 2 deletions tests/integration/store/query-test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { run } from '@ember/runloop';
import setupStore from 'dummy/tests/helpers/store';
import Ember from 'ember';
import RSVP from 'rsvp';

import { module, test } from 'qunit';

import DS from 'ember-data';

var Person, store, env;
var run = Ember.run;

module('integration/store/query', {
beforeEach() {
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/model-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ test('supports canonical updates via pushedData in root.deleted.saved', function

adapter.shouldBackgroundReloadRecord = () => false;
adapter.deleteRecord = () => {
return Ember.RSVP.resolve();
return resolve();
};

let record = run(() =>
Expand Down Expand Up @@ -733,7 +733,7 @@ test('Does not support dirtying in root.deleted.saved', function(assert) {

adapter.shouldBackgroundReloadRecord = () => false;
adapter.deleteRecord = () => {
return Ember.RSVP.resolve();
return resolve();
};

let record = run(() =>
Expand Down Expand Up @@ -1640,8 +1640,8 @@ test('ID mutation (complicated)', function(assert) {
let idChange = 0;
const Person = DS.Model.extend({
name: DS.attr('string'),
idComputed: Ember.computed('id', function() {}),
idDidChange: Ember.observer('id', () => idChange++),
idComputed: computed('id', function() {}),
idDidChange: observer('id', () => idChange++),
});

let { store } = setupStore({
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/store/peek-record-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import EmberObject from '@ember/object';
import { run } from '@ember/runloop';
import setupStore from 'dummy/tests/helpers/store';
import Ember from 'ember';
import testInDebug from 'dummy/tests/helpers/test-in-debug';

import { module, test } from 'qunit';
Expand Down Expand Up @@ -64,7 +64,7 @@ testInDebug('peekRecord should assert if passed a model class instead of model n
) {
run(() => {
assert.expectAssertion(() => {
let modelClass = Ember.Object.extend();
let modelClass = EmberObject.extend();
store.peekRecord(modelClass, 'id');
}, /Passing classes to store methods has been removed/);
});
Expand Down

0 comments on commit 58cd257

Please sign in to comment.