You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a new project that imported @iov/core and @iov/cli and added a number of helper functions for opinionated high-level access to the chain into src/wallet.ts. I ran them through tests and 💯 Then I launched ./node_modules/bin/iov-cli, which started up great and could create keys, but when I tried import * as wallet from "./src/wallet" and any variant I could think of, import failed.
I finally managed to get a workaround with an absolute path on my filesystem. import * as wallet from "PWD/src/wallet", where I manually replaces PWD with the output of pwd on my shell, so it looked like: import * as wallet from "/home/ethan/js/iov-connect/src/wallet". This let me try out the code, but is not a good user interface.
I dug into the cli code a bit and it seems that installationDir is changing the import root. And TsRepl will override the process.cwd() with the installation dir. This seems necessary for some startup scripts, but makes it very hard to import relatively inside the repl.
This root may make some sense when running inside the iov-core repo, but when imported outside, I have no idea where it is. I did not want to change this directly as I did not know why that was needed (for the setup imports?).
The text was updated successfully, but these errors were encountered:
I made a new project that imported
@iov/core
and@iov/cli
and added a number of helper functions for opinionated high-level access to the chain intosrc/wallet.ts
. I ran them through tests and 💯 Then I launched./node_modules/bin/iov-cli
, which started up great and could create keys, but when I triedimport * as wallet from "./src/wallet"
and any variant I could think of, import failed.I finally managed to get a workaround with an absolute path on my filesystem.
import * as wallet from "PWD/src/wallet"
, where I manually replacesPWD
with the output ofpwd
on my shell, so it looked like:import * as wallet from "/home/ethan/js/iov-connect/src/wallet"
. This let me try out the code, but is not a good user interface.I dug into the cli code a bit and it seems that installationDir is changing the import root. And TsRepl will override the
process.cwd()
with the installation dir. This seems necessary for some startup scripts, but makes it very hard to import relatively inside the repl.This root may make some sense when running inside the iov-core repo, but when imported outside, I have no idea where it is. I did not want to change this directly as I did not know why that was needed (for the setup imports?).
The text was updated successfully, but these errors were encountered: