# Making a new release of jupyterlab_quarto

The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser).

## Manual release

### Python package

This extension can be distributed as Python packages. All of the Python
packaging instructions are in the `pyproject.toml` file to wrap your extension in a
Python package. Before generating a package, you first need to install some tools:

```bash
pip install build twine hatch
```

Bump the version using `hatch`. By default this will create a tag.
See the docs on [hatch-nodejs-version](https://github.com/agoose77/hatch-nodejs-version#semver) for details.

```bash
hatch version <new-version>
```

**Before building, note that you must temporarily update the `package.json` file to remove the `@quarto` prefix from the package name.**

To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do:

```bash
jlpm clean:all
git clean -dfX
rm dist/*
jlpm build
python -m build
twine upload dist/*
```

> `python setup.py sdist bdist_wheel` is deprecated and will not work for this package.

Then to upload the package to PyPI, do:

```bash

```

### NPM package

To publish the frontend part of the extension as a NPM package, do:

```bash
jlpm clean:all
git clean -dfX
jlpm build
npm login
npm publish --access public
```
