Skip to content

Commit

Permalink
install stockfish.pexe via npm
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Nov 6, 2018
1 parent 1c2628c commit 9fe48e0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public/compiled
public/vendor/stockfish
public/vendor/stockfish.wasm
public/vendor/stockfish-mv.wasm
public/vendor/stockfish.pexe
target
bin/.translate_version
data/
Expand Down
2 changes: 1 addition & 1 deletion ui/ceval/src/ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function(opts: CevalOpts): CevalCtrl {
const sfPath = 'vendor/stockfish/stockfish';
const pool = new Pool({
asmjs: li.assetUrl(sfPath + '.js', {sameDomain: true}),
pnacl: pnaclSupported && li.assetUrl(sfPath + '.nmf'),
pnacl: pnaclSupported && li.assetUrl('vendor/stockfish.pexe/stockfish.nmf'),
wasm: wasmSupported && li.assetUrl(sfPath + '.wasm.js', {sameDomain: true}),
wasmThreaded: wasmThreadsSupported && (officialStockfish(opts.variant.key) ? 'vendor/stockfish.wasm/stockfish.js' : 'vendor/stockfish-mv.wasm/stockfish.js'),
onCrash: opts.onCrash
Expand Down
11 changes: 7 additions & 4 deletions ui/site/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ function downloadGithubRelease(repo, dest, cb) {
});
}

gulp.task('stockfish.pexe', function(cb) {
downloadGithubRelease('niklasf/stockfish.pexe', '../../public/vendor/stockfish/', cb);
gulp.task('stockfish.pexe', function() {
gulp.src([
require.resolve('stockfish.pexe/stockfish.nmf'),
require.resolve('stockfish.pexe/stockfish.pexe'),
require.resolve('stockfish.pexe/stockfish.bc')
]).pipe(gulp.dest('../../public/vendor/stockfish.pexe'));
});

gulp.task('stockfish.js', function(cb) {
Expand Down Expand Up @@ -156,10 +160,9 @@ gulp.task('user-mod', function() {
.pipe(gulp.dest(destination));
});

const tasks = ['git-sha', 'jquery-fill', 'ab', 'standalones', 'user-mod', 'stockfish.wasm', 'stockfish-mv.wasm'];
const tasks = ['git-sha', 'jquery-fill', 'ab', 'standalones', 'user-mod', 'stockfish.wasm', 'stockfish-mv.wasm', 'stockfish.pexe'];
if (!process.env.TRAVIS || process.env.GITHUB_API_TOKEN) {
if (!process.env.NO_SF) { // to skip SF download
tasks.push('stockfish.pexe');
tasks.push('stockfish.js');
}
}
Expand Down
1 change: 1 addition & 0 deletions ui/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"dependencies": {
"stockfish-mv.wasm": "^0.2.0",
"stockfish.pexe": "^9.0.0",
"stockfish.wasm": "^0.2.0",
"tablesort": "^5.0.0"
}
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4430,6 +4430,11 @@ stockfish-mv.wasm@^0.2.0:
resolved "https://registry.yarnpkg.com/stockfish-mv.wasm/-/stockfish-mv.wasm-0.2.0.tgz#b402050ccca5455ed4419ffe2ad96d52a19c5f34"
integrity sha512-a2E/J0kBJIfoKdC8KPNy+xGQ4hvT/E10THMxjqmy1aHCgoV0pvOY+lgcLqvm6Q4c5IyFX5iDiY59ZrrtHedbEg==

stockfish.pexe@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/stockfish.pexe/-/stockfish.pexe-9.0.0.tgz#8b444f0487e05e3c8d12ad59a7245489da34c602"
integrity sha512-UrRdnDQi7VZ3f8ZPqGmT70fN9ymcdhZ430j+cJX2atGfBtRsKEnF0A5+LhZzdzN8ElmbDUXx2PwRvjzecBiIrA==

stockfish.wasm@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/stockfish.wasm/-/stockfish.wasm-0.2.0.tgz#f92ee6a35c0ca3dacbd704adfec2df5101116503"
Expand Down

0 comments on commit 9fe48e0

Please sign in to comment.