aboutsummaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorMark Stacey <markjstacey@gmail.com>2019-07-31 02:36:23 +0800
committerGitHub <noreply@github.com>2019-07-31 02:36:23 +0800
commit1fd3dc9ecf16f00d721078e114138e529a7b8e16 (patch)
treeeec89c15e0ab57173f24931ba286f972c4c97936 /CONTRIBUTING.md
parent618c1caf407d5497f4c7ba793f9163640b007e03 (diff)
downloadtangerine-wallet-browser-1fd3dc9ecf16f00d721078e114138e529a7b8e16.tar.gz
tangerine-wallet-browser-1fd3dc9ecf16f00d721078e114138e529a7b8e16.tar.zst
tangerine-wallet-browser-1fd3dc9ecf16f00d721078e114138e529a7b8e16.zip
Switch from `npm` to `yarn` (#6843)
As a solution to the constant lockfile churn issues we've had with `npm`, the project now uses `yarn` to manage dependencies. The `package-lock.json` file has been replaced with `yarn.lock`, which was created using `yarn import`. It should approximate the contents of `package-lock.json` fairly well, though there may be some changes due to deduplication. The codeowners file has been updated to reference this new lockfile. All documentation and npm scripts have been updated to reference `yarn` rather than `npm`. Note that running scripts using `npm run` still works fine, but it seemed better to switch those to `yarn` as well to avoid confusion. The `npm-audit` Bash script has been replaced with `yarn-audit`. The output of `yarn audit` is a bit different than `npm audit` in that it returns a bitmask to describe which severity issues were found. This made it simpler to check the results directly from the Bash script, so the associated `npm-audit-check.js` script was no longer required. The output should be exactly the same, and the information is still sourced from the same place (the npm registry). The new `yarn-audit` script does have an external dependency: `jq`. However, `jq` is already assumed to be present by another CI script, and is present on all CI images we use. `jq` was not added to `package.json` as a dependency because there is no official package on the npm registry, just wrapper scripts. We don't need it anywhere exept on CI anyway. The section in `CONTRIBUTING` about how to develop inside the `node_modules` folder was removed, as the advice was a bit dated, and wasn't specific to this project anyway.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md27
1 files changed, 0 insertions, 27 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 63d19c633..19fdf3242 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -22,30 +22,3 @@ When you're done with your project / bugfix / feature and ready to submit a PR,
- [ ] **Get reviewed by a core contributor**: Make sure you get a `:thumbsup`, `:+1`, or `LGTM` from a user with a `Member` badge before merging.
And that's it! Thanks for helping out.
-
-### Developing inside a node_modules folder
-
-First make sure you are comfortable with [how require works](https://github.com/maxogden/art-of-node#how-require-works) in node.
-
-We recommend creating a folder somewhere manually called `node_modules`. For example in `~/code/node_modules`. Clone all of your git copies of modules that you want to work on into here, so for example:
-
-- `~/code/node_modules/dat`
-- `~/code/node_modules/hyperdrive`
-
-When you run `npm install` inside of `~/code/node_modules/dat`, dat will get its own copy of `hyperdrive` (one if its dependencies) inside `~/code/node_modules/dat/node_modules`. However, if you encounter a bug in hyperdrive that you need to fix, but you want to test your fix in dat, you want dat to use your git copy of hyperdrive at `~/code/node_modules/hyperdrive` and not the npm copy of hyperdrive at `~/code/node_modules/dat/node_modules/hyperdrive`.
-
-How do you get dat to use the git copy of hyperdrive? Just delete the npm copy!
-
-```
-rm -rf ~/code/node_modules/dat/node_modules/hyperdrive
-```
-
-Now when you run dat, and it tries to `require('hyperdrive')` it first looks in its own `node_modules` folder at `~/code/node_modules/dat/node_modules` but doesnt find hyperdrive. So it goes up to `~/code/node_modules` and finds `hyperdrive` there and uses that one, your git copy.
-
-If you want to switch back to an npm copy, just run `npm install` inside `~/code/node_modules/dat/` and npm will download any missing modules into `~/code/node_modules/dat/node_modules` but wont touch anything in `~/code/node_modules`.
-
-This might seem a bit complicated at first, but is simple once you get the hang of it. Here are some rules to help you get started:
-
-- Never make any meaningful edits to code inside an "npm-managed" node_modules folder (such as `~/code/node_modules/dat/node_modules`), because when you run `npm install` inside those folders it could inadvertently delete all of your edits when installing an updated copy of a module. This has happened to me many times, so I just always use my git copy and delete the npm copy (as described above) to make edits to a module.
-- You should never need to run any npm commands in terminal when at your "manually managed"" node_modules folder at `~/code/node_modules`. Never running npm commands at that folder also prevents npm from accidentally erasing your git copies of modules
-- The location of your "manually managed" node_modules folder should be somewhere isolated from your normal require path. E.g. if you put it at `~/node_modules`, then when you run `npm install dat` at `~/Desktop` npm might decide to erase your git copy of dat at `~/node_modules/dat` and replace it with a copy from npm, which could make you lose work. Putting your manually managed `node_modules` folder in a sub-folder like `~/code` gets it "out of the way" and prevents accidents like that from happening.