Skip to content

Commit da36c29

Browse files
authored
Micheldiz/fix type error (#230)
* upgrade deps * change error logic * remove typo * upgrade some libs
1 parent 3cf80a7 commit da36c29

File tree

5 files changed

+4847
-1846
lines changed

5 files changed

+4847
-1846
lines changed

scripts/local.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ if [[ $1 == "-p" || $1 == "--preview" ]]; then
1010
hugo \
1111
--destination=public \
1212
--config config.toml,releases.json \
13-
--baseURL="$2" 1> /dev/null
13+
--baseURL="$2/tour/" 1> /dev/null
1414
echo -e "$(date) $GREEN Done building. $RESET"
1515
else
16-
hugo server -w --baseURL=http://localhost:1313 --config config.toml,releases.json
16+
hugo server -w --baseURL=http://localhost:1313/tour/ --config config.toml,releases.json
1717
fi

themes/hugo-tutorials/static/js/build/dgraph-tour.js

Lines changed: 2699 additions & 120 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/hugo-tutorials/static/js/runnable.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,12 @@ $(document).on('click', '.runnable [data-action="run"]', async function(e) {
201201
$currentRunnable.find('.output-container').addClass('error');
202202
// Ideally we should check that xhr.status === 404, but because we are doing
203203
// CORS, status is always 0
204-
var defaultError = 'Error: Is Dgraph running locally?';
205-
let message = error || defaultError;
204+
var defaultError = 'Error: Is Dgraph running locally? or reachable?';
205+
let message;
206+
207+
let res = await error.toString().match(/APIError/g);
208+
209+
!res ? message = defaultError : message = error
206210

207211
codeEl.text(message);
208212
}

themes/hugo-tutorials/static/package.json

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,27 @@
44
"main": "js/index.js",
55
"license": "MIT",
66
"scripts": {
7-
"build": "webpack --config webpack.prod.js"
7+
"build": "webpack --config webpack.prod.js",
8+
"rebuild": "yarn clean && yarn build",
9+
"clean": "rm -rf node_modules && yarn"
810
},
911
"dependencies": {
10-
"codemirror": "^5.48.2",
11-
"dgraph-js-http": "^1.1.0-rc18",
12+
"codemirror": "^5.58.1",
13+
"dgraph-js-http": "^20.7.1",
1214
"highlight.js": "^9.15.9",
13-
"jquery": "^3.4.1"
15+
"jquery": "^3.5.1"
1416
},
1517
"devDependencies": {
16-
"@babel/core": "^7.4.5",
17-
"@babel/plugin-transform-runtime": "^7.4.4",
18-
"@babel/preset-env": "^7.4.5",
19-
"@babel/runtime": "^7.4.5",
20-
"babel-loader": "^8.0.6",
21-
"css-loader": "^3.1.0",
22-
"style-loader": "^0.23.1",
23-
"webpack": "^4.33.0",
24-
"webpack-cli": "^3.3.2",
25-
"webpack-dev-server": "^3.6.0",
26-
"webpack-merge": "^4.2.1"
18+
"@babel/core": "^7.11.6",
19+
"@babel/plugin-transform-runtime": "^7.11.5",
20+
"@babel/preset-env": "^7.11.5",
21+
"@babel/runtime": "^7.11.2",
22+
"babel-loader": "^8.1.0",
23+
"css-loader": "^4.3.0",
24+
"style-loader": "^1.3.0",
25+
"webpack": "^4.44.2",
26+
"webpack-cli": "^3.3.12",
27+
"webpack-dev-server": "^3.11.0",
28+
"webpack-merge": "^5.2.0"
2729
}
2830
}

0 commit comments

Comments
 (0)