Skip to content

Commit

Permalink
Fix argon2 with special case (#53)
Browse files Browse the repository at this point in the history
* Fix `argon2` with special case

* Exclude argon2 from windows tests

* Fix linux emit
  • Loading branch information
styfle authored and kodiakhq[bot] committed Aug 20, 2019
1 parent 73614b5 commit ff235b7
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@zeit/ncc": "^0.17.0",
"analytics-node": "^3.4.0-beta.1",
"apollo-server-express": "^2.6.7",
"argon2": "^0.24.0",
"auth0": "^2.18.0",
"axios": "^0.19.0",
"azure-storage": "^2.10.3",
Expand Down
6 changes: 6 additions & 0 deletions src/utils/special-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ const specialCases = {
emitAssetDirectory(path.resolve(path.dirname(id), 'runtime/'));
}
},
'argon2' ({ id, emitAssetDirectory }) {
if (id.endsWith('argon2/argon2.js')) {
emitAssetDirectory(path.resolve(path.dirname(id), 'build', 'Release'));
emitAssetDirectory(path.resolve(path.dirname(id), 'prebuilds'));
}
},
'bull' ({ id, emitAssetDirectory }) {
if (id.endsWith('bull/lib/commands/index.js')) {
emitAssetDirectory(path.resolve(path.dirname(id)));
Expand Down
2 changes: 2 additions & 0 deletions test/integration/argon2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const argon2 = require('argon2');
console.log('argon is ' + typeof argon2);
4 changes: 3 additions & 1 deletion windows-prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ if (process.platform === 'win32') {
const pkg = JSON.parse(pkgJson);
unlinkSync(join(__dirname, 'yarn.lock'));
unlinkSync(join(__dirname, 'test', 'integration', 'tensorflow.js'));
unlinkSync(join(__dirname, 'test', 'integration', 'argon2.js'));
unlinkSync(join(__dirname, 'test', 'integration', 'highlights.js'));
unlinkSync(join(__dirname, 'test', 'integration', 'hot-shots.js'));
unlinkSync(join(__dirname, 'test', 'integration', 'yoga-layout.js'));
unlinkSync(join(__dirname, 'test', 'integration', 'loopback.js'));
delete pkg.devDependencies['@tensorflow/tfjs-node'];
delete pkg.devDependencies['argon2'];
delete pkg.devDependencies['highlights'];
delete pkg.devDependencies['hot-shots'];
delete pkg.devDependencies['yoga-layout'];
writeFileSync(join(__dirname, 'package.json'), JSON.stringify(pkg));
} else {
console.log('[azure-prepare] Expected current platform to be win32 but found ' + process.platform);
console.log('[windows-prepare] Expected current platform to be win32 but found ' + process.platform);
}
26 changes: 26 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,13 @@
dependencies:
core-js "^2.5.7"

"@phc/format@^0.5.0":
version "0.5.0"
resolved "https://registry.yarnpkg.com/@phc/format/-/format-0.5.0.tgz#a99d27a83d78b3100a191412adda04315e2e3aba"
integrity sha512-JWtZ5P1bfXU0bAtTzCpOLYHDXuxSVdtL/oqz4+xa97h8w9E5IlVN333wugXVFv8vZ1hbXObKQf1ptXmFFcMByg==
dependencies:
safe-buffer "^5.1.2"

"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf"
Expand Down Expand Up @@ -1852,6 +1859,15 @@ are-we-there-yet@~1.1.2:
delegates "^1.0.0"
readable-stream "^2.0.6"

argon2@^0.24.0:
version "0.24.0"
resolved "https://registry.yarnpkg.com/argon2/-/argon2-0.24.0.tgz#60a7d7e7ce2a0a3b93d4455446153546f01ca3aa"
integrity sha512-796movQU1LIW4egM+FH2mrgaTBtIhjEvuTx3sfw0W+Ijbk29IvKOh/i1IDAKCS9s6Y+2GdlPVU5q/gQZ3lyp5w==
dependencies:
"@phc/format" "^0.5.0"
node-addon-api "^1.6.3"
node-gyp-build "^4.1.0"

argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
Expand Down Expand Up @@ -8979,6 +8995,11 @@ node-abi@^2.7.0:
dependencies:
semver "^5.4.1"

node-addon-api@^1.6.3:
version "1.7.1"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.1.tgz#cf813cd69bb8d9100f6bdca6755fc268f54ac492"
integrity sha512-2+DuKodWvwRTrCfKOeR24KIc5unKjOh8mz17NCzVnHWfjAdDqbfbjqh7gUT+BkXBRQM52+xCHciKWonJ3CbJMQ==

node-fetch-npm@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7"
Expand Down Expand Up @@ -9016,6 +9037,11 @@ node-forge@^0.8.0, node-forge@^0.8.1:
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.8.5.tgz#57906f07614dc72762c84cef442f427c0e1b86ee"
integrity sha512-vFMQIWt+J/7FLNyKouZ9TazT74PRV3wgv9UT4cRjC8BffxFbKXkgIWR42URCPSnHm/QDz6BOlb2Q0U4+VQT67Q==

node-gyp-build@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.1.0.tgz#3bc3dd7dd4aafecaf64a2e3729e785bc3cdea565"
integrity sha512-rGLv++nK20BG8gc0MzzcYe1Nl3p3mtwJ74Q2QD0HTEDKZ6NvOFSelY6s2QBPWIHRR8h7hpad0LiwajfClBJfNg==

node-gyp@^3.6.2, node-gyp@^3.8.0:
version "3.8.0"
resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c"
Expand Down

0 comments on commit ff235b7

Please sign in to comment.