Skip to content

Commit

Permalink
Upgrade to ember-cli-mirage ^1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Chase McCarthy committed Oct 9, 2019
1 parent 2f6c41d commit 9423e2b
Show file tree
Hide file tree
Showing 15 changed files with 3,521 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "6"
- "8"

dist: trusty

Expand Down
11 changes: 11 additions & 0 deletions addon/initializers/github-inflector-rules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Inflector from 'ember-inflector';

export function initialize() {
const inflector = Inflector.inflector;
inflector.uncountable('githubRepositoryContents');
}

export default {
name: 'github-inflector-rules',
initialize
};
1 change: 1 addition & 0 deletions app/initializers/github-inflector-rules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-data-github/initializers/github-inflector-rules';
3 changes: 2 additions & 1 deletion config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ module.exports = function() {
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0'
'ember-source': '~2.12.0',
'ember-data': '>=3.0.0 <=3.12'
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';

module.exports = function(/* environment, appConfig */) {
return { };
return {
'ember-cli-mirage': {
trackRequests: true
}
};
};
3 changes: 2 additions & 1 deletion mirage-support/factories/github-commit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Factory, faker } from 'ember-cli-mirage';
import { Factory } from 'ember-cli-mirage';
import faker from 'faker';

export default Factory.extend({
id() {
Expand Down
3 changes: 2 additions & 1 deletion mirage-support/factories/github-compare.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Factory, faker } from 'ember-cli-mirage';
import { Factory } from 'ember-cli-mirage';
import faker from 'faker';

export default Factory.extend({
ahead_by: faker.random.number(),
Expand Down
3 changes: 2 additions & 1 deletion mirage-support/factories/github-file.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Factory, faker } from 'ember-cli-mirage';
import { Factory } from 'ember-cli-mirage';
import faker from 'faker';

export default Factory.extend({
id() {
Expand Down
3 changes: 2 additions & 1 deletion mirage-support/factories/github-pull.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Factory, faker } from 'ember-cli-mirage';
import { Factory } from 'ember-cli-mirage';
import faker from 'faker';

export default Factory.extend({
number: faker.random.number(),
Expand Down
3 changes: 2 additions & 1 deletion mirage-support/factories/github-release.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Factory, faker } from 'ember-cli-mirage';
import { Factory } from 'ember-cli-mirage';
import faker from 'faker';

export default Factory.extend({
tag_name: function(i) {
Expand Down
3 changes: 2 additions & 1 deletion mirage-support/factories/github-repository.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Factory, faker, trait } from 'ember-cli-mirage';
import { Factory, trait } from 'ember-cli-mirage';
import faker from 'faker';

export default Factory.extend({
name: function(i) {
Expand Down
3 changes: 2 additions & 1 deletion mirage-support/factories/github-user.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Factory, faker, trait } from 'ember-cli-mirage';
import { Factory, trait } from 'ember-cli-mirage';
import faker from 'faker';

export default Factory.extend({
login: function(i) {
Expand Down
8 changes: 6 additions & 2 deletions mirage-support/factories/tree.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { Factory, faker } from 'ember-cli-mirage';
import { Factory } from 'ember-cli-mirage';

const types = ['blob', 'tree'];

export default Factory.extend({
path: 'file.rb',
mode: 100644,
type: faker.list.cycle('blob', 'tree'),
type(i){
return types[i % types.length];
},
sha: '44b4fc6d56897b048c772eb4087f854f46256132',
url() {
return `https://api.github.com/repos/user1/repository1/git/blobs/${this.sha}`;
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,21 @@
"dependencies": {
"broccoli-funnel": "^2.0.1",
"broccoli-merge-trees": "^3.0.1",
"ember-cli-babel": "^6.9.0"
"ember-cli-babel": "^6.9.0",
"ember-inflector": "^3.0.1"
},
"devDependencies": {
"bootstrap": "^4.0.0",
"broccoli-asset-rev": "^2.4.5",
"ember-auto-import": "^1.5.2",
"ember-bootstrap": "^2.1.0",
"ember-cli": "~3.1.2",
"ember-cli-dependency-checker": "^2.0.0",
"ember-cli-eslint": "^4.2.1",
"ember-cli-htmlbars": "^2.0.1",
"ember-cli-htmlbars-inline-precompile": "^2.0.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-mirage": "0.4.1",
"ember-cli-mirage": "^1.1.0",
"ember-cli-qunit": "^4.1.1",
"ember-cli-release": "1.0.0-beta.2",
"ember-cli-sass": "^7.1.4",
Expand All @@ -56,11 +58,12 @@
"ember-try": "^0.2.23",
"eslint-plugin-ember": "^5.0.0",
"eslint-plugin-node": "^6.0.1",
"faker": "^4.1.0",
"lerna-changelog": "^0.8.2",
"loader.js": "^4.2.3"
},
"engines": {
"node": "^4.5 || 6.* || >= 7.*"
"node": ">= 8.*"
},
"changelog": {
"repo": "elwayman02/ember-data-github",
Expand Down
Loading

0 comments on commit 9423e2b

Please sign in to comment.