download ceval sf from github releases
parent
0783ee5e2a
commit
99cf1eab2e
|
@ -5,6 +5,7 @@ project/project
|
|||
project/target
|
||||
public/trans
|
||||
public/compiled
|
||||
public/vendor/stockfish
|
||||
public/images/?N-bg.svg
|
||||
public/piece/alpha
|
||||
public/piece/cburnett
|
||||
|
|
|
@ -22,19 +22,12 @@
|
|||
[submodule "public/vendor/shepherd"]
|
||||
path = public/vendor/shepherd
|
||||
url = https://github.com/HubSpot/shepherd
|
||||
[submodule "public/vendor/stockfish.js"]
|
||||
path = public/vendor/stockfish.js
|
||||
url = https://github.com/niklasf/stockfish.js
|
||||
[submodule "public/vendor/flatpickr"]
|
||||
path = public/vendor/flatpickr
|
||||
url = https://github.com/chmln/flatpickr
|
||||
[submodule "public/vendor/bar-rating"]
|
||||
path = public/vendor/bar-rating
|
||||
url = https://github.com/antennaio/jquery-bar-rating
|
||||
[submodule "public/vendor/stockfish.pexe"]
|
||||
path = public/vendor/stockfish.pexe
|
||||
url = https://github.com/niklasf/stockfish.pexe
|
||||
branch = ddugovic
|
||||
[submodule "public/vendor/jquery-textcomplete"]
|
||||
path = public/vendor/jquery-textcomplete
|
||||
url = https://github.com/yuku-t/jquery-textcomplete
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 96ca31e5a405e68196cbd880dd652c48a948eb2f
|
|
@ -1 +0,0 @@
|
|||
Subproject commit a8bee13f7b45ad965499766e0c1c5d905a5c67fd
|
|
@ -30,9 +30,9 @@ module.exports = function(opts) {
|
|||
var isDeeper = m.prop(false);
|
||||
|
||||
var pool = makePool(stockfishProtocol, {
|
||||
asmjs: '/assets/vendor/stockfish.js/stockfish.js?v=18',
|
||||
pnacl: pnaclSupported && '/assets/vendor/stockfish.pexe/nacl/stockfish.nmf?v=16',
|
||||
wasm: wasmSupported && '/assets/vendor/stockfish.js/stockfish.wasm.js?v=18',
|
||||
asmjs: lichess.assetUrl('/assets/vendor/stockfish/stockfish.js'),
|
||||
pnacl: pnaclSupported && lichess.assetUrl('/assets/vendor/stockfish/stockfish.nmf'),
|
||||
wasm: wasmSupported && lichess.assetUrl('/assets/vendor/stockfish/stockfish.wasm.js'),
|
||||
onCrash: opts.onCrash
|
||||
}, {
|
||||
minDepth: minDepth,
|
||||
|
|
|
@ -5,6 +5,8 @@ var browserify = require('browserify');
|
|||
var uglify = require('gulp-uglify');
|
||||
var streamify = require('gulp-streamify');
|
||||
var concat = require('gulp-concat');
|
||||
var request = require('request');
|
||||
var download = require('gulp-download-stream');
|
||||
|
||||
var destination = '../../public/compiled/';
|
||||
var onError = function(error) {
|
||||
|
@ -31,6 +33,34 @@ gulp.task('ab', function() {
|
|||
}
|
||||
});
|
||||
|
||||
function latestGithubRelease(repo, cb) {
|
||||
request({
|
||||
url: 'https://api.github.com/repos/' + repo + '/releases/latest',
|
||||
headers: {
|
||||
'User-Agent': 'lila/gulpfile.js'
|
||||
}
|
||||
}, function(err, res, body) {
|
||||
var release = JSON.parse(body);
|
||||
cb(release.assets.map(function (asset) {
|
||||
return asset.browser_download_url;
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
gulp.task('stockfish.pexe', function() {
|
||||
latestGithubRelease('niklasf/stockfish.pexe', function(urls) {
|
||||
download(urls)
|
||||
.pipe(gulp.dest('../../public/vendor/stockfish/'));
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('stockfish.js', function() {
|
||||
latestGithubRelease('niklasf/stockfish.js', function(urls) {
|
||||
download(urls)
|
||||
.pipe(gulp.dest('../../public/vendor/stockfish/'));
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('prod-source', function() {
|
||||
return browserify('./src/index.js', {
|
||||
standalone: standalone
|
||||
|
@ -78,8 +108,10 @@ gulp.task('standalones', function() {
|
|||
.pipe(gulp.dest(destination));
|
||||
});
|
||||
|
||||
gulp.task('dev', ['jquery-fill', 'ab', 'standalones', 'dev-source'], makeBundle('lichess.site.source.js'));
|
||||
gulp.task('prod', ['jquery-fill', 'ab', 'standalones', 'prod-source'], makeBundle('lichess.site.source.min.js'));
|
||||
var tasks = ['jquery-fill', 'ab', 'standalones', 'stockfish.pexe', 'stockfish.js'];
|
||||
|
||||
gulp.task('dev', tasks.concat(['dev-source']), makeBundle('lichess.site.source.js'));
|
||||
gulp.task('prod', tasks.concat(['prod-source']), makeBundle('lichess.site.source.min.js'));
|
||||
|
||||
gulp.task('default', ['dev'], function() {
|
||||
return gulp.watch('src/*.js', ['dev']);
|
||||
|
|
|
@ -11,9 +11,11 @@
|
|||
"devDependencies": {
|
||||
"browserify": "^14",
|
||||
"gulp": "^3",
|
||||
"gulp-download-stream": "0.0.13",
|
||||
"gulp-streamify": "^1",
|
||||
"gulp-uglify": "^2",
|
||||
"gulp-util": "^3",
|
||||
"request": "^2.81.0",
|
||||
"uglify-js": "^2",
|
||||
"vinyl-source-stream": "^1"
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue