Skip to content

Commit 9745a4b

Browse files
committed
making it use local data
1 parent b43028b commit 9745a4b

File tree

5 files changed

+14073
-13122
lines changed

5 files changed

+14073
-13122
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ local.log
4343
/.node_modules.ember-try/
4444
/bower.json.ember-try
4545
/package.json.ember-try
46+
47+
/ember-api-docs-data/

app/adapters/application.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { pluralize } from 'ember-inflector';
66
import { isBlank } from '@ember/utils';
77

88
export default class Application extends JSONAPIAdapter {
9-
host = ENV.API_HOST;
9+
// host = ENV.API_HOST;
1010
currentProject = '';
1111
currentProjectVersion = '';
1212

@@ -47,7 +47,7 @@ export default class Application extends JSONAPIAdapter {
4747

4848
async findRecord(store, { modelName }, id) {
4949
let url;
50-
let host = this.host;
50+
// let host = this.host;
5151
let projectName = this.currentProject;
5252

5353
if (['namespace', 'class', 'module'].indexOf(modelName) > -1) {
@@ -85,7 +85,7 @@ export default class Application extends JSONAPIAdapter {
8585
throw new Error('Unexpected model lookup');
8686
}
8787

88-
url = `${host}/${url}.json`;
88+
url = `/${url}.json`;
8989

9090
let response = await fetch(url);
9191
let json = await response.json();

ember-cli-build.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,10 @@ module.exports = function (defaults) {
6666
include: ['mappings.json'],
6767
destDir: '/assets/',
6868
});
69-
return mergeTrees([app.toTree(), mappingsTree]);
69+
70+
let docsJsonTree = new Funnel('ember-api-docs-data', {
71+
include: ['**/json-docs/**', '**/rev-index/**'],
72+
});
73+
74+
return mergeTrees([app.toTree(), mappingsTree, docsJsonTree]);
7075
};

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"test": "tests"
1414
},
1515
"scripts": {
16+
"clone": "rm -rf ember-api-docs-data && git clone https://github.com/ember-learn/ember-api-docs-data.git",
1617
"build": "ember build --environment=production",
1718
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'",
1819
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
@@ -112,13 +113,13 @@
112113
"qunit": "^2.16.0",
113114
"qunit-dom": "^1.6.0",
114115
"sanitize-html": "^2.3.2",
115-
"sass": "^1.25.0",
116+
"sass": "^1.54.4",
116117
"semver-compare": "^1.0.0",
117118
"spawndamnit": "2.0.0",
118119
"testem": "^2.14.0"
119120
},
120121
"engines": {
121-
"node": "10.* || 12.* || 14.*",
122+
"node": "14.* || 16.* || 18.*",
122123
"npm": "7",
123124
"yarn": "1.22.*"
124125
},

0 commit comments

Comments
 (0)