@@ -66,6 +66,40 @@ Then start Jupyter Notebook with:
6666jupyter notebook
6767```
6868
69+ ### Local changes in Notebook dependencies
70+
71+ The development installation described above fetches JavaScript dependencies from [ npmjs] ( https://www.npmjs.com/ ) ,
72+ according to the versions in the _ package.json_ file.
73+ However, it is sometimes useful to be able to test changes in Notebook, with dependencies (e.g. ` @jupyterlab ` packages) that have not yet
74+ been published.
75+
76+ [ yalc] ( https://github.com/wclr/yalc ) can help use local JavaScript packages in your build of
77+ Notebook, acting as a local package repository.
78+
79+ - Install yalc globally in you environment:
80+ ` npm install -g yalc `
81+ - Publish you dependency package:\
82+ ` yalc publish ` , from the package root directory.\
83+ For instance, if you have are developing on _ @jupyterlab/ui-components_ , this command must be executed from
84+ _ path_to_jupyterlab/packages/ui-components_ .
85+ - Depend on this local repository in Notebook:
86+ - from the Notebook root directory:\
87+ ` yalc add your_package ` : this will create a _ dependencies_ entry in the main _ package.json_ file.\
88+ With the previous example, it would be ` yalc add @jupyterlab/ui-components ` .
89+ - Notebook is a monerepo, so we want this dependency to be 'linked' as a resolution (for all sub-packages) instead
90+ of a dependency.\
91+ The easiest way is to manually move the new entry in _ package.json_ from _ dependencies_ to _ resolutions_ .
92+ - Build Notebook with the local dependency:\
93+ ` jlpm install && jlpm build `
94+
95+ Changes in the dependency must then be built and pushed using ` jlpm build && yalc push ` (from the package root directory),
96+ and fetched from Notebook using ` yarn install ` .
97+
98+ ** Warning** : you need to make sure that the dependencies of Notebook and the local package match correctly,
99+ otherwise there will be errors with webpack during build.\
100+ In the previous example, both _ @jupyterlab/ui-components_ and Notebook depend on _ @jupyterlab/coreutils_ . We
101+ strongly advise you to depend on the same version.
102+
69103## Running Tests
70104
71105To run the tests:
0 commit comments