Page MenuHomePhabricator

[Nix] Add node_modules/.bin to path
ClosedPublic

Authored by jon on Nov 16 2022, 9:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 25 2024, 8:25 PM
Unknown Object (File)
Nov 25 2024, 8:25 PM
Unknown Object (File)
Nov 25 2024, 8:25 PM
Unknown Object (File)
Nov 25 2024, 8:25 PM
Unknown Object (File)
Nov 25 2024, 8:24 PM
Unknown Object (File)
Nov 11 2024, 3:56 AM
Unknown Object (File)
Nov 9 2024, 4:40 PM
Unknown Object (File)
Nov 9 2024, 1:21 PM

Details

Summary

Put node_modules bin directory on PATH as part of nix develop

https://linear.app/comm/issue/ENG-2253

Test Plan
nix develop

which react-native # points to node_modules
which flow # points to node_modules

cd lib
flow

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat published this revision for review.EditedNov 16 2022, 9:39 AM

One concern here. This $PATH hack is a little different from the mainline instructions, where we use ./node_modules/.bin rather than $PRJ_ROOT/node_modules/.bin.

The workflow we have for running Flow is to cd into a directory and then run flow, eg. cd landing && flow. This will run Flow specifically for the landing workspace.

I'm not sure if cd landing && flow works specific to landing because the binary is being run from landing/node_modules/.bin vs. node_modules/.bin, or because the binary detects the current working directory that called it.

To confirm things still work correctly, @jon can you amend your test plan to actually test Flow rather than running which flow?

ashoat requested changes to this revision.Nov 16 2022, 9:39 AM
This revision now requires changes to proceed.Nov 16 2022, 9:39 AM

In the future, would be great if these test plans are more robust. Instead of testing the most immediate thing, you should be testing the full workflow.

Forgot about the per-workspace differences

This revision is now accepted and ready to land.Nov 16 2022, 8:10 PM
This revision was automatically updated to reflect the committed changes.