Skip to content

Commit d6ab02f

Browse files
committed
Update development setup for JupyterLab 3.0
1 parent e87ed0b commit d6ab02f

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

README.md

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Using pip:
3030
pip install jupyterlab-snippets
3131
```
3232

33-
Rebuild JupyterLab:
33+
If you use JupyterLab 2.x, you will have to rebuild JupyterLab with:
3434

3535
```bash
3636
jupyter lab build
@@ -93,52 +93,44 @@ jupyter lab clean
9393
jupyter lab build
9494
```
9595

96-
## Contributing
96+
## Development Install
9797

98-
### Development Install
98+
Note: You will need NodeJS to build the extension package.
9999

100100
The `jlpm` command is JupyterLab's pinned version of
101101
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
102102
`yarn` or `npm` in lieu of `jlpm` below.
103103

104104
```bash
105105
# Clone the repo to your local environment
106-
# Move to jupyterlab-snippets directory
107-
# Install the server extension
106+
# Change directory to the jupyterlab-snippets directory
107+
# Install package in development mode
108108
pip install -e .
109-
110-
# Register the server extension
111-
jupyter serverextension enable --py jupyterlab-snippets
112-
113-
# Install the dependencies
114-
jlpm
115-
116-
# Build the TypeScript source
117-
jlpm build
118-
119109
# Link your development version of the extension with JupyterLab
120-
jupyter labextension link .
110+
jupyter labextension develop . --overwrite
111+
# Rebuild extension Typescript source after making changes
112+
jlpm run build
113+
```
121114

122-
# Rebuild the TypeScript source after making changes
123-
jlpm build
115+
You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
124116

125-
# Rebuild JupyterLab after making any changes
126-
jupyter lab build
117+
```bash
118+
# Watch the source directory in one terminal, automatically rebuilding when needed
119+
jlpm run watch
120+
# Run JupyterLab in another terminal
121+
jupyter lab
127122
```
128123

129-
You can watch the source directory and run JupyterLab in watch mode to watch for changes in the extension's source and automatically rebuild the extension and application.
124+
With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
130125

131-
```bash
132-
# Watch the source directory in another terminal tab
133-
jlpm watch
126+
By default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
134127

135-
# Run jupyterlab in watch mode in one terminal tab
136-
jupyter lab --watch
128+
```bash
129+
jupyter lab build --minimize=False
137130
```
138131

139132
### Uninstall
140133

141134
```bash
142135
pip uninstall jupyterlab-snippets
143-
jupyter labextension uninstall jupyterlab-snippets
144136
```

0 commit comments

Comments
 (0)