Skip to content

Commit

Permalink
build: create node_modules symlink for NODE_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
errfrom committed Jul 6, 2023
1 parent 084ca27 commit fe138b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ let
];
shellHook = ''
export NODE_PATH="${nodeModules}/lib/node_modules"
ln -sfn $NODE_PATH node_modules
export PATH="${nodeModules}/bin:$PATH"
${pkgs.lib.optionalString packageLockOnly "export NPM_CONFIG_PACKAGE_LOCK_ONLY=true"}
''
Expand Down Expand Up @@ -177,6 +178,7 @@ let
unpackPhase = ''
export HOME="$TMP"
export NODE_PATH="${nodeModules}/lib/node_modules"
ln -sfn $NODE_PATH node_modules
export PATH="${nodeModules}/bin:$PATH"
cp -r $src .
install-spago-style
Expand Down Expand Up @@ -228,6 +230,7 @@ let
# (idea taken from `plutus-playground-client`)
''
cd ${project}
ln -sfn $NODE_PATH node_modules
${nodejs}/bin/node --enable-source-maps -e 'import("./output/${testMain}/index.js").then(m => m.main())'
touch $out
'';
Expand Down Expand Up @@ -400,6 +403,7 @@ let
''
export HOME="$TMP"
export NODE_PATH="${nodeModules}/lib/node_modules"
ln -sfn $NODE_PATH node_modules
export PATH="${nodeModules}/bin:$PATH"
${pkgs.lib.optionalString browserRuntime "export BROWSER_RUNTIME=1"}
cp -r ${project}/* .
Expand Down Expand Up @@ -489,6 +493,7 @@ let
}
''
export NODE_PATH="${pursDocsSearchNpm.nodeDependencies}/lib/node_modules"
ln -sfn $NODE_PATH node_modules
export PATH="${pursDocsSearchNpm.nodeDependencies}/bin:$PATH"
cp -r ${buildPursDocs { }}/{generated-docs,output,src} .
install-spago-style
Expand Down
6 changes: 3 additions & 3 deletions test/Wallet/Cip30/SignData.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
lib = await import("@emurgo/cardano-message-signing-nodejs");
csl = await import("@emurgo/cardano-serialization-lib-nodejs");
}
import gcWrapper from "@mlabs-haskell/csl-gc-wrapper";
lib = gcWrapper(lib);
csl = gcWrapper(csl);
// import gcWrapper from "@mlabs-haskell/csl-gc-wrapper";
// lib = gcWrapper(lib);
// csl = gcWrapper(csl);

function opt_chain(maybe, obj) {
const isNothing = x => x === null || x === undefined;
Expand Down

0 comments on commit fe138b0

Please sign in to comment.