Skip to content

Commit 078b7b8

Browse files
committed
Replace samselikoff/ember-cli-mirage with miragejs/ember-cli-mirage
1 parent 22b6c73 commit 078b7b8

File tree

9 files changed

+203
-211
lines changed

9 files changed

+203
-211
lines changed

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ install:
2424

2525
notifications:
2626
email: false
27-
27+
2828
# Identifies `a.b.c-xxx.n` tags as pre-releases, and `a.b.c` as stable releases
2929
before_deploy: |
3030
function npm_dist_tag() {
@@ -60,13 +60,12 @@ jobs:
6060
- env: EMBER_TRY_SCENARIO=ember-canary
6161
- env: EMBER_TRY_SCENARIO=ember-default
6262
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
63-
63+
6464
- stage: deploy
6565
if: (branch = master OR tag IS present) AND type = push
6666
env: NAME=deploy
6767
script: node_modules/.bin/ember deploy production
6868

69-
7069
- stage: npm release
7170
install: skip
7271
script: skip
@@ -78,7 +77,7 @@ jobs:
7877
secure: O6cP0nTiCbA+MuD6hRKdyyd6DWTFR/dc9klB10zXTnrwajjzLmenvvshPUv+F6lHCpb2SfrWW6cpFjZ61BPwKaaalF9u8encNkGlDYGtO77sWJu6LuJFeWPZnAC9rdAw4hPjz+gqTL+leeDMHzjB32VRqy2cpwFzet3e+W2eUuk=
7978
on:
8079
tags: true
81-
repo: samselikoff/ember-cli-mirage
80+
repo: miragejs/ember-cli-mirage
8281

8382
allow_failures:
8483
- env: EMBER_TRY_SCENARIO=ember-beta

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Ember CLI Mirage Change log
22

3-
Releases (along with upgrade instructions) are documented on the Github [Releases](https://github.com/samselikoff/ember-cli-mirage/releases) page.
3+
Releases (along with upgrade instructions) are documented on the Github [Releases](https://github.com/miragejs/ember-cli-mirage/releases) page.

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ If you're just making a change to a single page in the docs, look for the "Edit
1515
To make more substantial changes, you'll want to be able to develop the docs site locally. To run an AddonDocs site,
1616

1717
```shell
18-
git clone [email protected]:samselikoff/ember-cli-mirage.git
18+
git clone [email protected]:miragejs/ember-cli-mirage.git
1919
cd ember-cli-mirage
2020
yarn install # (or npm install)
2121
ember s
2222
```
2323

2424
You should be able to visit `localhost:4200` and see the docs site running locally. Now checkout a new branch, make your changes, and submit a PR!
2525

26-
2726
## Mirage development
2827

2928
To help out with Mirage development, first pull down the project locally and verify that all tests on `master` are passing.

ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ If this is a feature request, add a 👍 reaction to it. We use these to help us
66

77
If possible, please use the Mirage Boilerplate to demonstrate your issue or bug:
88

9-
1. Visit the [Ember CLI Mirage Boilerplate](https://github.com/samselikoff/ember-cli-mirage-boilerplate) repo
9+
1. Visit the [Ember CLI Mirage Boilerplate](https://github.com/miragejs/ember-cli-mirage-boilerplate) repo
1010

1111
2. Click Fork
1212

config/deploy.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
/* eslint-env node */
2-
'use strict';
2+
"use strict";
33

44
module.exports = function(deployTarget) {
55
let ENV = {
66
build: {},
77
git: {
8-
repo: '[email protected]:samselikoff/ember-cli-mirage.git'
8+
repo: "[email protected]:miragejs/ember-cli-mirage.git"
99
}
1010
};
1111

12-
if (deployTarget === 'development') {
13-
ENV.build.environment = 'development';
12+
if (deployTarget === "development") {
13+
ENV.build.environment = "development";
1414
// configure other plugins for development deploy target here
1515
}
1616

17-
if (deployTarget === 'staging') {
18-
ENV.build.environment = 'production';
17+
if (deployTarget === "staging") {
18+
ENV.build.environment = "production";
1919
// configure other plugins for staging deploy target here
2020
}
2121

22-
if (deployTarget === 'production') {
23-
ENV.build.environment = 'production';
22+
if (deployTarget === "production") {
23+
ENV.build.environment = "production";
2424
// configure other plugins for production deploy target here
2525
}
2626

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
],
1212
"repository": {
1313
"type": "git",
14-
"url": "https://github.com/samselikoff/ember-cli-mirage.git"
14+
"url": "https://github.com/miragejs/ember-cli-mirage.git"
1515
},
1616
"license": "MIT",
1717
"author": "Sam Selikoff",
1818
"directories": {
1919
"doc": "doc",
2020
"test": "tests"
2121
},
22-
"homepage": "https://github.com/samselikoff/ember-cli-mirage",
22+
"homepage": "https://github.com/miragejs/ember-cli-mirage",
2323
"bugs": {
24-
"url": "https://github.com/samselikoff/ember-cli-mirage/issues"
24+
"url": "https://github.com/miragejs/ember-cli-mirage/issues"
2525
},
2626
"scripts": {
2727
"build": "ember build",

tests/dummy/app/adapters/post.js

Lines changed: 84 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,70 @@
1-
import $ from 'jquery';
2-
import { Promise } from 'rsvp';
3-
import DS from 'ember-data';
1+
import $ from "jquery";
2+
import { Promise } from "rsvp";
3+
import DS from "ember-data";
44

5-
const BASE_URL = 'https://api.github.com/repos/samselikoff/ember-cli-mirage';
5+
const BASE_URL = "https://api.github.com/repos/miragejs/ember-cli-mirage";
66

77
export default DS.JSONAPIAdapter.extend({
8-
98
findRecord(store, type, id, snapshot) {
109
let url = `${BASE_URL}/issues/${id}`;
1110

1211
return new Promise((resolve, reject) => {
13-
$.getJSON(url).then(json => {
14-
let jsonApiDocument = {
15-
data: {
16-
id,
17-
type: 'posts',
18-
attributes: {
19-
title: json.title,
20-
body: json.body,
21-
'issue-url': json.html_url
22-
},
23-
relationships: {
24-
comments: {
25-
links: {
26-
related: json.comments_url
12+
$.getJSON(url).then(
13+
json => {
14+
let jsonApiDocument = {
15+
data: {
16+
id,
17+
type: "posts",
18+
attributes: {
19+
title: json.title,
20+
body: json.body,
21+
"issue-url": json.html_url
22+
},
23+
relationships: {
24+
comments: {
25+
links: {
26+
related: json.comments_url
27+
}
2728
}
2829
}
2930
}
30-
}
31-
};
31+
};
3232

33-
resolve(jsonApiDocument);
34-
}, jqXHR => {
35-
reject(jqXHR);
36-
});
33+
resolve(jsonApiDocument);
34+
},
35+
jqXHR => {
36+
reject(jqXHR);
37+
}
38+
);
3739
});
3840
},
3941

4042
findAll(store, type) {
4143
let url = `${BASE_URL}/issues?state=closed&labels=Blog%20post`;
4244

4345
return new Promise((resolve, reject) => {
44-
$.getJSON(url).then(json => {
45-
this.hasLoadedAllPosts = true;
46+
$.getJSON(url).then(
47+
json => {
48+
this.hasLoadedAllPosts = true;
4649

47-
let jsonApiDocument = {
48-
data: json.map(obj => ({
49-
id: obj.number,
50-
type: 'posts',
51-
attributes: {
52-
title: obj.title,
53-
body: obj.body,
54-
'issue-url': obj.html_url
55-
}
56-
}))
57-
};
50+
let jsonApiDocument = {
51+
data: json.map(obj => ({
52+
id: obj.number,
53+
type: "posts",
54+
attributes: {
55+
title: obj.title,
56+
body: obj.body,
57+
"issue-url": obj.html_url
58+
}
59+
}))
60+
};
5861

59-
resolve(jsonApiDocument);
60-
}, jqXHR => {
61-
reject(jqXHR);
62-
});
62+
resolve(jsonApiDocument);
63+
},
64+
jqXHR => {
65+
reject(jqXHR);
66+
}
67+
);
6368
});
6469
},
6570

@@ -69,46 +74,49 @@ export default DS.JSONAPIAdapter.extend({
6974

7075
findHasMany(store, snapshot, url, relationship) {
7176
return new Promise((resolve, reject) => {
72-
$.getJSON(url).then(json => {
73-
let jsonApiDocument = { data: [], included: [] };
74-
let includedUserHash = {};
77+
$.getJSON(url).then(
78+
json => {
79+
let jsonApiDocument = { data: [], included: [] };
80+
let includedUserHash = {};
7581

76-
json.forEach(obj => {
77-
jsonApiDocument.data.push({
78-
id: obj.id,
79-
type: 'comments',
80-
attributes: {
81-
body: obj.body,
82-
permalink: obj.html_url,
83-
'created-at': obj.created_at
84-
},
85-
relationships: {
86-
user: {
87-
data: { type: 'users', id: obj.user.id }
82+
json.forEach(obj => {
83+
jsonApiDocument.data.push({
84+
id: obj.id,
85+
type: "comments",
86+
attributes: {
87+
body: obj.body,
88+
permalink: obj.html_url,
89+
"created-at": obj.created_at
90+
},
91+
relationships: {
92+
user: {
93+
data: { type: "users", id: obj.user.id }
94+
}
8895
}
89-
}
90-
});
96+
});
9197

92-
includedUserHash[obj.user.id] = obj.user;
93-
});
98+
includedUserHash[obj.user.id] = obj.user;
99+
});
94100

95-
Object.keys(includedUserHash).forEach(key => {
96-
let user = includedUserHash[key];
97-
jsonApiDocument.included.push({
98-
type: 'users',
99-
id: user.id,
100-
attributes: {
101-
'avatar-url': user.avatar_url,
102-
'profile-url': user.html_url,
103-
username: user.login
104-
}
101+
Object.keys(includedUserHash).forEach(key => {
102+
let user = includedUserHash[key];
103+
jsonApiDocument.included.push({
104+
type: "users",
105+
id: user.id,
106+
attributes: {
107+
"avatar-url": user.avatar_url,
108+
"profile-url": user.html_url,
109+
username: user.login
110+
}
111+
});
105112
});
106-
});
107113

108-
resolve(jsonApiDocument);
109-
}, jqXHR => {
110-
reject(jqXHR);
111-
});
114+
resolve(jsonApiDocument);
115+
},
116+
jqXHR => {
117+
reject(jqXHR);
118+
}
119+
);
112120
});
113121
}
114122
});

tests/dummy/app/pods/docs/getting-started/installation/template.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ There's an Ember CLI bug that exposes itself when using Prettier + Mirage. A lon
2525

2626
You might expect Mirage to serve network requests made by your FastBoot app, but because Mirage runs only in the browser, it currently disables itself if your app is being served by FastBoot.
2727

28-
[FastBoot support](https://github.com/samselikoff/ember-cli-mirage/issues/1411) is a highly requested feature we are working on. In the meantime, you'll need to develop your FastBoot pages against a local server.
28+
[FastBoot support](https://github.com/miragejs/ember-cli-mirage/issues/1411) is a highly requested feature we are working on. In the meantime, you'll need to develop your FastBoot pages against a local server.
2929

3030
You can always bypass FastBoot page generation locally by running
3131

3232
```sh
3333
FASTBOOT_DISABLED=true ember serve
3434
```
35+
3536
Mirage will then run in the browser as expected, and you can develop your client app as normal.

0 commit comments

Comments
 (0)