Skip to content

Commit

Permalink
Merge pull request #61 from ianhi/dev-install-instructions
Browse files Browse the repository at this point in the history
Update dev-install instructions and update package.json scripts
  • Loading branch information
martinRenou authored Mar 2, 2021
2 parents 170718c + a437149 commit 7ac312d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 19 deletions.
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,40 @@ is used instead.

```bash
# Create a new conda environment
conda create -n jupyterlab-sidecar -c conda-forge jupyterlab ipywidgets nodejs
conda create -n jupyterlab-sidecar -c conda-forge jupyterlab ipywidgets nodejs -y

# Activate the conda environment
conda activate jupyterlab-sidecar

# Install dependencies
jlpm

# Build Typescript source
jlpm build
# Install package in development mode
pip install -e .

# Link your development version of the extension with JupyterLab
jupyter labextension link .
jupyter labextension develop . --overwrite

# Rebuild extension Typescript source after making changes
jlpm run build
```
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.

```bash
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab
```

# Rebuild Typescript source after making changes
jlpm build

# Rebuild JupyterLab after making any changes
jupyter lab build
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).

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:

```bash
jupyter lab build --minimize=False
```

## Uninstall

# Install the sidecar Python package
python -m pip install -e .
```
pip uninstall jupyterlab-sidecar
```
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,25 @@
"url": "https://github.com/jupyter-widgets/jupyterlab-sidecar"
},
"scripts": {
"build": "jlpm run build:lib && jlpm run build:labextension",
"build": "jlpm run build:lib && jlpm run build:labextension:dev",
"build:prod": "jlpm run build:lib && jlpm run build:labextension",
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:lib": "tsc",
"clean": "jlpm run clean:lib && jlpm run clean:labextension",
"clean:lib": "rimraf lib",
"clean": "jlpm run clean:lib",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:labextension": "rimraf sidecar/labextension",
"prepare": "jlpm run build",
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
"test": "jlpm run test:firefox",
"test:chrome": "karma start --browsers=Chrome tests/karma.conf.js",
"test:debug": "karma start --browsers=Chrome --singleRun=false --debug=true tests/karma.conf.js",
"test:firefox": "karma start --browsers=Firefox tests/karma.conf.js",
"test:ie": "karma start --browsers=IE tests/karma.conf.js",
"watch": "npm-run-all -p watch:*",
"watch:lib": "tsc"
"install:extension": "jupyter labextension develop --overwrite .",
"prepare": "jlpm run clean && jlpm run build:prod",
"watch": "run-p watch:src watch:labextension",
"watch:src": "tsc -w",
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyter-widgets/base": "^4.0.0",
Expand Down

0 comments on commit 7ac312d

Please sign in to comment.