Allow importing from `node_modules` without having to specify `./node_modules` path
It would be nice if we could write it like this:
import "@sablier/devkit/just/base.just"
import "@sablier/devkit/just/npm.just"
Instead of this:
import "./node_modules/@sablier/devkit/just/base.just"
import "./node_modules/@sablier/devkit/just/npm.just"
just is not specifically a nodejs/npm tool, so it shouldn't treat node_modules specially. Can you think of a new generic just setting (i.e. not specific to any particular language or ecosystem) that you as justfile author could set to ./node_modules to enable this behavior?
One idea, although not sure whether this is quite what you're seeking:
# If an import path points to a nonexistant path: before erroring,
# try to resolve the import relative to ./node_modules first,
# and if that also fails, then try again relative to ~/.node_modules
set additional-import-search-paths := ['./node_modules', x'~/.node_modules']
But anything like this seems like a lot of effort. Does your production justfile have a lot of imports from node_modules?
Fair enough, I hear you about just not being a Node.js-first tool.
The additional-import-search-paths setting would be helpful!
Does your production justfile have a lot of imports from node_modules?
It's more that I have a bunch of *.just files in a shared repository that are imported by a bunch of other repos via node_modules:
- https://github.com/sablier-labs/devkit/tree/d6cf3d33a1ce85d90e01f983dabd1c63d951f0ef/just
- https://github.com/sablier-labs/lockup/blob/546e66b4ae624f5eea1383f229dbad4e949bbbf8/justfile
import "./node_modules/@sablier/devkit/just/evm.just"