Skip to content

Commit ff235b7

Browse files
styflekodiakhq[bot]
authored andcommitted
Fix argon2 with special case (#53)
* Fix `argon2` with special case * Exclude argon2 from windows tests * Fix linux emit
1 parent 73614b5 commit ff235b7

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"@zeit/ncc": "^0.17.0",
4040
"analytics-node": "^3.4.0-beta.1",
4141
"apollo-server-express": "^2.6.7",
42+
"argon2": "^0.24.0",
4243
"auth0": "^2.18.0",
4344
"axios": "^0.19.0",
4445
"azure-storage": "^2.10.3",

src/utils/special-cases.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ const specialCases = {
88
emitAssetDirectory(path.resolve(path.dirname(id), 'runtime/'));
99
}
1010
},
11+
'argon2' ({ id, emitAssetDirectory }) {
12+
if (id.endsWith('argon2/argon2.js')) {
13+
emitAssetDirectory(path.resolve(path.dirname(id), 'build', 'Release'));
14+
emitAssetDirectory(path.resolve(path.dirname(id), 'prebuilds'));
15+
}
16+
},
1117
'bull' ({ id, emitAssetDirectory }) {
1218
if (id.endsWith('bull/lib/commands/index.js')) {
1319
emitAssetDirectory(path.resolve(path.dirname(id)));

test/integration/argon2.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const argon2 = require('argon2');
2+
console.log('argon is ' + typeof argon2);

windows-prepare.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ if (process.platform === 'win32') {
88
const pkg = JSON.parse(pkgJson);
99
unlinkSync(join(__dirname, 'yarn.lock'));
1010
unlinkSync(join(__dirname, 'test', 'integration', 'tensorflow.js'));
11+
unlinkSync(join(__dirname, 'test', 'integration', 'argon2.js'));
1112
unlinkSync(join(__dirname, 'test', 'integration', 'highlights.js'));
1213
unlinkSync(join(__dirname, 'test', 'integration', 'hot-shots.js'));
1314
unlinkSync(join(__dirname, 'test', 'integration', 'yoga-layout.js'));
1415
unlinkSync(join(__dirname, 'test', 'integration', 'loopback.js'));
1516
delete pkg.devDependencies['@tensorflow/tfjs-node'];
17+
delete pkg.devDependencies['argon2'];
1618
delete pkg.devDependencies['highlights'];
1719
delete pkg.devDependencies['hot-shots'];
1820
delete pkg.devDependencies['yoga-layout'];
1921
writeFileSync(join(__dirname, 'package.json'), JSON.stringify(pkg));
2022
} else {
21-
console.log('[azure-prepare] Expected current platform to be win32 but found ' + process.platform);
23+
console.log('[windows-prepare] Expected current platform to be win32 but found ' + process.platform);
2224
}

yarn.lock

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,13 @@
937937
dependencies:
938938
core-js "^2.5.7"
939939

940+
"@phc/format@^0.5.0":
941+
version "0.5.0"
942+
resolved "https://registry.yarnpkg.com/@phc/format/-/format-0.5.0.tgz#a99d27a83d78b3100a191412adda04315e2e3aba"
943+
integrity sha512-JWtZ5P1bfXU0bAtTzCpOLYHDXuxSVdtL/oqz4+xa97h8w9E5IlVN333wugXVFv8vZ1hbXObKQf1ptXmFFcMByg==
944+
dependencies:
945+
safe-buffer "^5.1.2"
946+
940947
"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
941948
version "1.1.2"
942949
resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf"
@@ -1852,6 +1859,15 @@ are-we-there-yet@~1.1.2:
18521859
delegates "^1.0.0"
18531860
readable-stream "^2.0.6"
18541861

1862+
argon2@^0.24.0:
1863+
version "0.24.0"
1864+
resolved "https://registry.yarnpkg.com/argon2/-/argon2-0.24.0.tgz#60a7d7e7ce2a0a3b93d4455446153546f01ca3aa"
1865+
integrity sha512-796movQU1LIW4egM+FH2mrgaTBtIhjEvuTx3sfw0W+Ijbk29IvKOh/i1IDAKCS9s6Y+2GdlPVU5q/gQZ3lyp5w==
1866+
dependencies:
1867+
"@phc/format" "^0.5.0"
1868+
node-addon-api "^1.6.3"
1869+
node-gyp-build "^4.1.0"
1870+
18551871
argparse@^1.0.7:
18561872
version "1.0.10"
18571873
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
@@ -8979,6 +8995,11 @@ node-abi@^2.7.0:
89798995
dependencies:
89808996
semver "^5.4.1"
89818997

8998+
node-addon-api@^1.6.3:
8999+
version "1.7.1"
9000+
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.1.tgz#cf813cd69bb8d9100f6bdca6755fc268f54ac492"
9001+
integrity sha512-2+DuKodWvwRTrCfKOeR24KIc5unKjOh8mz17NCzVnHWfjAdDqbfbjqh7gUT+BkXBRQM52+xCHciKWonJ3CbJMQ==
9002+
89829003
node-fetch-npm@^2.0.2:
89839004
version "2.0.2"
89849005
resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7"
@@ -9016,6 +9037,11 @@ node-forge@^0.8.0, node-forge@^0.8.1:
90169037
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.8.5.tgz#57906f07614dc72762c84cef442f427c0e1b86ee"
90179038
integrity sha512-vFMQIWt+J/7FLNyKouZ9TazT74PRV3wgv9UT4cRjC8BffxFbKXkgIWR42URCPSnHm/QDz6BOlb2Q0U4+VQT67Q==
90189039

9040+
node-gyp-build@^4.1.0:
9041+
version "4.1.0"
9042+
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.1.0.tgz#3bc3dd7dd4aafecaf64a2e3729e785bc3cdea565"
9043+
integrity sha512-rGLv++nK20BG8gc0MzzcYe1Nl3p3mtwJ74Q2QD0HTEDKZ6NvOFSelY6s2QBPWIHRR8h7hpad0LiwajfClBJfNg==
9044+
90199045
node-gyp@^3.6.2, node-gyp@^3.8.0:
90209046
version "3.8.0"
90219047
resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c"

0 commit comments

Comments
 (0)