Skip to content

Commit a908bf4

Browse files
imlucaskangas
authored andcommitted
📝 🚧 How to npm link
1 parent 9ed9c4b commit a908bf4

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

docs/tutorials/npm-link.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# How to `npm link`
2+
3+
Say `~/scout-ci` is your work projects folder.
4+
First, grab the money module as the first step in
5+
any debugging adventure is adding a `console.log`
6+
somewhere just to know you're env is setup.
7+
8+
```bash
9+
mkdir -p ~/scout-ci;
10+
cd ~/scout-ci;
11+
git clone [email protected]:mongodb-js/mongodb-connection-model.git;
12+
cd mongodb-connection-model;
13+
npm link;
14+
cd ../;
15+
git clone [email protected]:10gen/scout-server.git;
16+
cd scout-server;
17+
git checkout -t origin/auth;
18+
npm link;
19+
npm link mongodb-connection-model;
20+
cd ../;
21+
git clone [email protected]:10gen/scout-client.git;
22+
cd scout-client;
23+
git checkout -t origin/auth;
24+
npm link;
25+
npm link scout-server;
26+
npm link mongodb-connection-model;
27+
npm install [email protected];
28+
./node_modules/.bin/zuul --electron -- test/*.test.js;
29+
```
30+
31+
Yay. Not so bad. Yes, that did take a bit of time BUT
32+
next week we be removing aNd updating a tonnnnn of dependencies.
33+
Deep breaths :)
34+
35+
Soooooo now let's run some tests! Please open a new doc
36+
in google drive because I need to give you a list of
37+
all the places where your print out will need to be correcte...
38+
39+
Nah! Just run:
40+
41+
```bash
42+
npm start;
43+
```
44+
45+
So yeah you know... one command?! big whoop! What could that possibly do?
46+
47+
- Starts a mongodb deployment using the same tooling the nodejs
48+
driver does (ht @Judah)
49+
- Starts up `scout-server` if one not already running
50+
- [zuul](http://npm.im/zuul) watches your changes to this dir and
51+
your tests, deps, src and rebuilds your src maps, code coverage,
52+
starts up Chrome and loads your test harness... But, yeah, that
53+
was a ton of deps... :)
54+
55+
> @todo (imlucas): How to use Chrome Devtools to Debug Failing or Flakey
56+
> Tests like Dan Pasette [sneak peak](https://cldup.com/745nt7Jca_-1200x1200.png)
57+
58+
What's that you say? You think their might be something in server
59+
you want to be able to change and have it reloaded automatically?
60+
And when you're connecting to a cluster?
61+
And... on the latest unstable release of the kernel?
62+
63+
Press `ctrl+c`.
64+
65+
```bash
66+
cd ../scout-server;
67+
DEBUG=* MONGODB_VERSION=unstable MONGODB_TOPOLOGY=cluster npm start;
68+
```
69+
70+
Open another terminal window and start up the client tests... oh?
71+
But in electron? Using the same artifacts we use to build the app
72+
on our end? Well.... gee I dunno... Might take a littl.... BOOM!
73+
74+
```bash
75+
cd ~/scout-ci;
76+
cd ~/scout-client;
77+
npm install [email protected];
78+
./node_modules/.bin/zuul --electron -- test/*.test.js;
79+
```
80+
81+
> @todo (imlucas): How to use localtunnel to test real-world
82+
> latency between NYC and Sydney w/o filing a JIRA.

0 commit comments

Comments
 (0)