Closed Lord-Valen closed 2 years ago
Upon further inspection (I included pwd
in the build script), tsc is run in the correct directory; however, tsconfig.json is not present in the nix store.
The issue was that package.json
is shared between the derivations for nixt and the node-dependencies so when the node-dependencies are built, the preinstall script (the build script, by proxy) is run, BUT tsconfig.json and the source tree are not present in that derivation. Worked around this by checking for tsconfig.json
in the build script and exiting cleanly if it is missing. This could be an issue as if tsc for any reason throws, the error will be ignored and the script will still return 0.
Currently nix build works as intended, it runs the
preinstall
script without issue and outputs nixt inresult/bin
. Nix develop fails to build. It appears thattsc
is not running with the correct working directory, causingtsc
to print its help screen instead of transpiling. If the shell node2nix provides is meant for dev use thennpm install
probably shouldn't be running at all. If it's meant to be run,npm install
should return the same result as it does when building. I may have to roll my own devShell.