├── .gitignore ├── {{cookiecutter.python_name}} ├── style │ ├── base.css │ ├── index.js │ └── index.css ├── {{cookiecutter.python_name}} │ ├── _version.py │ └── __init__.py ├── setup.py ├── install.json ├── lib │ └── index.js ├── MANIFEST.in ├── binder │ ├── environment.yml │ └── postBuild ├── .github │ └── workflows │ │ └── build.yml ├── LICENSE ├── package.json ├── .gitignore ├── README.md └── pyproject.toml ├── cookiecutter.json ├── README.md ├── .github └── workflows │ └── main.yml └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | myextension 2 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/style/base.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/style/index.js: -------------------------------------------------------------------------------- 1 | import './base.css'; 2 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/style/index.css: -------------------------------------------------------------------------------- 1 | @import url('base.css'); 2 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/{{cookiecutter.python_name}}/_version.py: -------------------------------------------------------------------------------- 1 | __version__ = "0.1.0" 2 | 3 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/setup.py: -------------------------------------------------------------------------------- 1 | # setup.py shim for use with applications that require it. 2 | __import__("setuptools").setup() 3 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/install.json: -------------------------------------------------------------------------------- 1 | { 2 | "packageManager": "python", 3 | "packageName": "{{ cookiecutter.python_name }}", 4 | "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package {{ cookiecutter.python_name }}" 5 | } 6 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/lib/index.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | id: '{{ cookiecutter.labextension_name }}', 4 | autoStart: true, 5 | activate: function (app) { 6 | console.log( 7 | 'JupyterLab extension {{ cookiecutter.labextension_name }} is activated!' 8 | ); 9 | console.log(app.commands); 10 | } 11 | } 12 | ]; 13 | -------------------------------------------------------------------------------- /cookiecutter.json: -------------------------------------------------------------------------------- 1 | { 2 | "author_name": "My Name", 3 | "author_email": "me@me.com", 4 | "python_name": "myextension", 5 | "labextension_name": "{{ cookiecutter.python_name }}", 6 | "project_short_description": "A JupyterLab extension.", 7 | "has_binder": "n", 8 | "repository": "https://github.com/github_username/{{ cookiecutter.python_name }}" 9 | } 10 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/{{cookiecutter.python_name}}/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | import json 3 | from pathlib import Path 4 | 5 | from ._version import __version__ 6 | 7 | HERE = Path(__file__).parent.resolve() 8 | 9 | with (HERE / "labextension" / "package.json").open() as fid: 10 | data = json.load(fid) 11 | 12 | def _jupyter_labextension_paths(): 13 | return [{ 14 | "src": "labextension", 15 | "dest": data["name"] 16 | }] 17 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include *.md 3 | include pyproject.toml 4 | 5 | include package.json 6 | include install.json 7 | include ts*.json 8 | include yarn.lock 9 | 10 | graft {{ cookiecutter.python_name }}/labextension 11 | 12 | # Javascript files 13 | graft lib 14 | graft style 15 | prune **/node_modules 16 | 17 | # Patterns to exclude from any directory 18 | global-exclude *~ 19 | global-exclude *.pyc 20 | global-exclude *.pyo 21 | global-exclude .git 22 | global-exclude .ipynb_checkpoints 23 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/binder/environment.yml: -------------------------------------------------------------------------------- 1 | # a mybinder.org-ready environment for demoing {{ cookiecutter.python_name }} 2 | # this environment may also be used locally on Linux/MacOS/Windows, e.g. 3 | # 4 | # conda env update --file binder/environment.yml 5 | # conda activate {{ cookiecutter.python_name }}-demo 6 | # 7 | name: {{ cookiecutter.python_name }}-demo 8 | 9 | channels: 10 | - conda-forge 11 | 12 | dependencies: 13 | # runtime dependencies 14 | - python >=3.10,<3.11.0a0 15 | - jupyterlab >=3,<4.0.0a0 16 | # labextension build dependencies 17 | - nodejs >=18,<19 18 | - pip 19 | - wheel 20 | # additional packages for demos 21 | # - ipywidgets 22 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: main 6 | pull_request: 7 | branches: '*' 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v2 15 | - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 16 | - name: Install dependencies 17 | run: python -m pip install -U jupyterlab~=3.0 jupyter_packaging~=0.10 18 | - name: Build the extension 19 | run: | 20 | python -m pip install -e . 21 | jupyter labextension list 2>&1 | grep -ie "{{ cookiecutter.labextension_name }}.*OK" 22 | python -m jupyterlab.browser_check 23 | pip uninstall -y myextension 24 | pip install -v -e . 25 | jupyter labextension develop . --overwrite 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JupyterLab extension-cookiecutter-js 2 | 3 | ![Github Actions Status](https://github.com/jupyterlab/extension-cookiecutter-js/workflows/CI/badge.svg) 4 | 5 | A [cookiecutter](https://github.com/cookiecutter/cookiecutter) template for creating 6 | a JupyterLab extension in CommonJS JavaScript. (See also 7 | [extension-cookiecutter-ts](https://github.com/jupyterlab/extension-cookiecutter-ts) 8 | for an extension in TypeScript.) 9 | 10 | ## Use the template to create package 11 | 12 | Install cookiecutter. 13 | 14 | ``` 15 | pip install cookiecutter 16 | ``` 17 | 18 | Use cookiecutter to generate a package, following the prompts to fill in the name and authorship of your new JupyterLab extension. 19 | 20 | ``` 21 | cookiecutter https://github.com/jupyterlab/extension-cookiecutter-js 22 | ``` 23 | 24 | ## A simple example 25 | 26 | The ``lib/`` directory of your new extension includes a very simple example of a working extension, written in JavaScript using CommonJS modules. Use this example as a guide to build your own extension. 27 | 28 | ## Package name 29 | 30 | We suggest that simple extension names start with `jupyterlab_` and use underscores if needed to improve readability, such as `jupyterlab_myextension`. 31 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | schedule: 9 | - cron: '0 0 * * *' 10 | 11 | concurrency: 12 | group: ci-${{ github.ref }} 13 | cancel-in-progress: true 14 | 15 | defaults: 16 | run: 17 | shell: bash -eux {0} 18 | 19 | jobs: 20 | build: 21 | runs-on: ${{ matrix.os }} 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | os: [ubuntu-latest, windows-latest, macos-latest] 26 | python-version: ["3.7", "3.10"] 27 | steps: 28 | - name: Checkout 29 | uses: actions/checkout@v2 30 | - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 31 | - name: Install dependencies 32 | run: | 33 | python -m pip install jupyterlab~=3.0 cookiecutter 34 | 35 | - name: Create pure frontend extension 36 | run: | 37 | cookiecutter . --no-input 38 | cd myextension 39 | pip install -v -e . 40 | jupyter labextension list 41 | jupyter labextension list 2>&1 | grep -ie "myextension.*OK" 42 | python -m jupyterlab.browser_check 43 | pip uninstall -y myextension 44 | pip install -v -e . 45 | jupyter labextension develop . --overwrite 46 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/binder/postBuild: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ perform a development install of {{ cookiecutter.python_name }} 3 | 4 | On Binder, this will run _after_ the environment has been fully created from 5 | the environment.yml in this directory. 6 | 7 | This script should also run locally on Linux/MacOS/Windows: 8 | 9 | python3 binder/postBuild 10 | """ 11 | import subprocess 12 | import sys 13 | from pathlib import Path 14 | 15 | 16 | ROOT = Path.cwd() 17 | 18 | def _(*args, **kwargs): 19 | """ Run a command, echoing the args 20 | 21 | fails hard if something goes wrong 22 | """ 23 | print("\n\t", " ".join(args), "\n") 24 | return_code = subprocess.call(args, **kwargs) 25 | if return_code != 0: 26 | print("\nERROR", return_code, " ".join(args)) 27 | sys.exit(return_code) 28 | 29 | # verify the environment is self-consistent before even starting 30 | _(sys.executable, "-m", "pip", "check") 31 | 32 | # install the labextension 33 | _(sys.executable, "-m", "pip", "install", "-e", ".") 34 | 35 | # verify the environment the extension didn't break anything 36 | _(sys.executable, "-m", "pip", "check") 37 | 38 | # list the extensions 39 | _("jupyter", "server", "extension", "list") 40 | 41 | # initially list installed extensions to determine if there are any surprises 42 | _("jupyter", "labextension", "list") 43 | 44 | 45 | print("JupyterLab with {{ cookiecutter.python_name }} is ready to run with:\n") 46 | print("\tjupyter lab\n") 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2017-2020, Project Jupyter Contributors 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, {{ cookiecutter.author_name }} All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | * Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ cookiecutter.labextension_name }}", 3 | "version": "0.1.0", 4 | "description": "{{ cookiecutter.project_short_description }}", 5 | "keywords": [ 6 | "jupyter", 7 | "jupyterlab", 8 | "jupyterlab-extension" 9 | ], 10 | "homepage": "{{ cookiecutter.repository }}", 11 | "bugs": { 12 | "url": "{{ cookiecutter.repository }}/issues" 13 | }, 14 | "license": "BSD-3-Clause", 15 | "author": { 16 | "name": "{{ cookiecutter.author_name }}", 17 | "email": "{{ cookiecutter.author_email }}" 18 | }, 19 | "files": [ 20 | "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}", 21 | "style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}" 22 | ], 23 | "main": "lib/index.js", 24 | "style": "style/index.css", 25 | "repository": { 26 | "type": "git", 27 | "url": "{{ cookiecutter.repository }}.git" 28 | }, 29 | "scripts": { 30 | "build": "npm run build:labextension:dev", 31 | "build:prod": "npm run build:labextension", 32 | "build:labextension": "jupyter labextension build .", 33 | "build:labextension:dev": "jupyter labextension build --development True .", 34 | "clean:labextension": "rimraf {{ cookiecutter.python_name }}/labextension", 35 | "clean:all": "npm run clean:labextension", 36 | "prepare": "npm run build:prod", 37 | "watch": "npm run watch:labextension", 38 | "watch:labextension": "jupyter labextension watch ." 39 | }, 40 | "dependencies": {}, 41 | "devDependencies": { 42 | "@jupyterlab/builder": "^3.0.0", 43 | "rimraf": "^3.0.2" 44 | }, 45 | "sideEffects": [ 46 | "style/*.css", 47 | "style/index.js" 48 | ], 49 | "styleModule": "style/index.js", 50 | "jupyterlab": { 51 | "extension": true, 52 | "outputDir": "{{cookiecutter.python_name}}/labextension" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/.gitignore: -------------------------------------------------------------------------------- 1 | *.bundle.* 2 | node_modules/ 3 | *.egg-info/ 4 | .ipynb_checkpoints 5 | *.tsbuildinfo 6 | {{cookiecutter.python_name}}/labextension 7 | 8 | # Created by https://www.gitignore.io/api/python 9 | # Edit at https://www.gitignore.io/?templates=python 10 | 11 | ### Python ### 12 | # Byte-compiled / optimized / DLL files 13 | __pycache__/ 14 | *.py[cod] 15 | *$py.class 16 | 17 | # C extensions 18 | *.so 19 | 20 | # Distribution / packaging 21 | .Python 22 | build/ 23 | develop-eggs/ 24 | dist/ 25 | downloads/ 26 | eggs/ 27 | .eggs/ 28 | lib64/ 29 | parts/ 30 | sdist/ 31 | var/ 32 | wheels/ 33 | pip-wheel-metadata/ 34 | share/python-wheels/ 35 | .installed.cfg 36 | *.egg 37 | MANIFEST 38 | 39 | # PyInstaller 40 | # Usually these files are written by a python script from a template 41 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 42 | *.manifest 43 | *.spec 44 | 45 | # Installer logs 46 | pip-log.txt 47 | pip-delete-this-directory.txt 48 | 49 | # Unit test / coverage reports 50 | htmlcov/ 51 | .tox/ 52 | .nox/ 53 | .coverage 54 | .coverage.* 55 | .cache 56 | nosetests.xml 57 | coverage.xml 58 | *.cover 59 | .hypothesis/ 60 | .pytest_cache/ 61 | 62 | # Translations 63 | *.mo 64 | *.pot 65 | 66 | # Scrapy stuff: 67 | .scrapy 68 | 69 | # Sphinx documentation 70 | docs/_build/ 71 | 72 | # PyBuilder 73 | target/ 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Spyder project settings 85 | .spyderproject 86 | .spyproject 87 | 88 | # Rope project settings 89 | .ropeproject 90 | 91 | # Mr Developer 92 | .mr.developer.cfg 93 | .project 94 | .pydevproject 95 | 96 | # mkdocs documentation 97 | /site 98 | 99 | # mypy 100 | .mypy_cache/ 101 | .dmypy.json 102 | dmypy.json 103 | 104 | # Pyre type checker 105 | .pyre/ 106 | 107 | # End of https://www.gitignore.io/api/python 108 | 109 | # OSX files 110 | .DS_Store 111 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/README.md: -------------------------------------------------------------------------------- 1 | # {{ cookiecutter.python_name }} 2 | 3 | ![Github Actions Status]({{ cookiecutter.repository }}/workflows/Build/badge.svg) 4 | {%- if cookiecutter.has_binder.lower().startswith('y') -%} 5 | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/{{ cookiecutter.repository|replace("https://github.com/", "") }}/main?urlpath=lab) 6 | {%- endif %} 7 | 8 | {{ cookiecutter.project_short_description }} 9 | 10 | ## Requirements 11 | 12 | * JupyterLab >= 3.1 13 | 14 | ## Install 15 | 16 | ```bash 17 | pip install {{ cookiecutter.python_name }} 18 | ``` 19 | 20 | ## Contributing 21 | 22 | ### Development install 23 | 24 | Note: You will need NodeJS to build the extension package. 25 | 26 | The `jlpm` command is JupyterLab's pinned version of 27 | [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use 28 | `yarn` or `npm` in lieu of `jlpm` below. 29 | 30 | ```bash 31 | # Clone the repo to your local environment 32 | # Change directory to the {{ cookiecutter.python_name }} directory 33 | # Install package in development mode 34 | pip install -e . 35 | # Link your development version of the extension with JupyterLab 36 | jupyter labextension develop . --overwrite 37 | # Rebuild extension Typescript source after making changes 38 | jlpm run build 39 | ``` 40 | 41 | 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. 42 | 43 | ```bash 44 | # Watch the source directory in one terminal, automatically rebuilding when needed 45 | jlpm run watch 46 | # Run JupyterLab in another terminal 47 | jupyter lab 48 | ``` 49 | 50 | 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). 51 | 52 | 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: 53 | 54 | ```bash 55 | jupyter lab build --minimize=False 56 | ``` 57 | 58 | ### Uninstall 59 | 60 | ```bash 61 | pip uninstall {{ cookiecutter.python_name }} 62 | ``` 63 | 64 | ## Updating the version 65 | 66 | To update the version, install tbump and use it to bump the version. 67 | By default it will also create a tag. 68 | 69 | ```bash 70 | pip install tbump 71 | tbump 72 | ``` 73 | -------------------------------------------------------------------------------- /{{cookiecutter.python_name}}/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "hatchling>=1.3.1", 4 | "jupyterlab~=3.1", 5 | ] 6 | build-backend = "hatchling.build" 7 | 8 | [project] 9 | name = "{{ cookiecutter.python_name }}" 10 | description = "{{ cookiecutter.project_short_description }}" 11 | readme = "README.md" 12 | requires-python = ">=3.7" 13 | authors = [ 14 | { name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.author_email }}" }, 15 | ] 16 | keywords = [ 17 | "Jupyter", 18 | "JupyterLab", 19 | "JupyterLab3", 20 | ] 21 | classifiers = [ 22 | "Framework :: Jupyter", 23 | "Framework :: Jupyter :: JupyterLab", 24 | "Framework :: Jupyter :: JupyterLab :: 3", 25 | "Framework :: Jupyter :: JupyterLab :: Extensions", 26 | "Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt", 27 | "License :: OSI Approved :: BSD License", 28 | "Programming Language :: Python", 29 | "Programming Language :: Python :: 3", 30 | "Programming Language :: Python :: 3.7", 31 | "Programming Language :: Python :: 3.8", 32 | "Programming Language :: Python :: 3.9", 33 | "Programming Language :: Python :: 3.10", 34 | ] 35 | version = "0.1.0" 36 | 37 | [project.license] 38 | file = "LICENSE" 39 | 40 | [project.urls] 41 | Homepage = "{{ cookiecutter.repository }}" 42 | 43 | [tool.hatch.build] 44 | artifacts = [ 45 | "{{ cookiecutter.python_name }}/labextension", 46 | ] 47 | 48 | [tool.hatch.build.targets.wheel.shared-data] 49 | "{{ cookiecutter.python_name }}/labextension/static" = "share/jupyter/labextensions/{{ cookiecutter.labextension_name }}/static" 50 | "install.json" = "share/jupyter/labextensions/{{ cookiecutter.labextension_name }}/install.json" 51 | "{{ cookiecutter.python_name }}/labextension/package.json" = "share/jupyter/labextensions/{{ cookiecutter.labextension_name }}/package.json" 52 | 53 | [tool.hatch.build.targets.sdist] 54 | exclude = [ 55 | ".github", 56 | ] 57 | 58 | [tool.hatch.build.hooks.jupyter-builder] 59 | dependencies = [ 60 | "hatch-jupyter-builder>=0.5.0", 61 | ] 62 | build-function = "hatch_jupyter_builder.npm_builder" 63 | ensured-targets = [ 64 | "{{ cookiecutter.python_name }}/labextension/static/style.js", 65 | "{{ cookiecutter.python_name }}/labextension/package.json", 66 | ] 67 | skip-if-exists = [ 68 | "{{ cookiecutter.python_name }}/labextension/static/style.js", 69 | ] 70 | 71 | [tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs] 72 | build_dir = "{{ cookiecutter.python_name }}/labextension" 73 | source_dir = "lib" 74 | build_cmd = "build" 75 | 76 | [tool.hatch.build.hooks.jupyter-builder.build-kwargs] 77 | build_cmd = "build:prod" 78 | 79 | [tool.tbump] 80 | field = [ 81 | { name = "channel", default = "" }, 82 | { name = "release", default = "" }, 83 | ] 84 | file = [ 85 | { src = "pyproject.toml" }, 86 | { src = "{{ cookiecutter.python_name }}/_version.py" }, 87 | { src = "package.json" }, 88 | ] 89 | 90 | [tool.tbump.version] 91 | current = "0.1.0" 92 | regex = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)((?Pa|b|rc|.dev)(?P\\d+))?" 93 | 94 | [tool.tbump.git] 95 | message_template = "Bump to {new_version}" 96 | tag_template = "v{new_version}" 97 | 98 | [license] 99 | file = "LICENSE" 100 | --------------------------------------------------------------------------------