NOTION_HOME
NOTION_NODE=10.3.0
NOTION_NPM=6.4.0
NOTION_YARN=1.7.0
NOTION_PACKAGES='typescript:2.9.2'
(most likely should be separated as future work)
- Notion consults these env vars first; they take precedence over config
- Just like config, they install just-in-time if necessary
- Unclear how to implement
NOTION_PACKAGES
; needs investigation:- whether package managers make this possible without mutating the manifest/lockfile
- could potentially work with some more aggressive copying/moving directories, but seems nonobvious
- possibly could be made efficient in conjunction with Yarn plug n play / tink?
notion exec --node=10.3.0 --npm=6.4.0 node -v
notion exec --typescript=2.9.2 tsc
I might prefer something like:
notion shell --node=10.3.0
instead of the nvm nvm use
approach. It boots up a subshell with the environment variables you choose set up, instead of mutating an environment variable in the current shell.
The reasons I prefer it:
- Mutation operations can only be supported in shells that implement the shell function wrapper; this doesn't require that.
- We don't really want to encourage people to set these environment variables permanently -- they should be for temporary overrides. The
nvm use
style means you always have the cognitive overhead of having to remember the current environment variable. Overrides should be understood as something you need for temporary situations.