diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 500f0b5..c392276 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -39,7 +39,7 @@ jobs: cache: yarn node-version: "lts/*" registry-url: https://registry.npmjs.org - cache-dependency-path: yarn.lock + cache-dependency-path: labextension/yarn.lock - name: Update root build packages run: | @@ -60,7 +60,7 @@ jobs: run: | mkdir jsdist cd jsdist - npm pack ../jupyter_launcher_shortcuts/labextension + npm pack ../labextension sha256sum * | tee SHA256SUMS - name: Upload Python artifact diff --git a/RELEASE.md b/RELEASE.md index 59c9aa5..3d2cc04 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,7 +9,7 @@ instructions on how to make a release. ## Steps to make a release -1. Create a PR updating `yarn.lock` and continue only when its merged. +1. Create a PR updating `labextension/yarn.lock` and continue only when its merged. This helps us avoid leaving known vulnerabilities are unfixed. To do this, delete the file and manually perform the the `build dist` step in the @@ -18,7 +18,7 @@ instructions on how to make a release. ```shell # git clean -xfd can be needed to ensure yarn.lock # gets re-created during pyproject-build - rm yarn.lock + rm labextension/yarn.lock pip install --upgrade pip build pyproject-build diff --git a/.yarnrc.yml b/labextension/.yarnrc.yml similarity index 100% rename from .yarnrc.yml rename to labextension/.yarnrc.yml diff --git a/labextension/LICENSE b/labextension/LICENSE new file mode 100644 index 0000000..71b31c7 --- /dev/null +++ b/labextension/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2019, Yuvi Panda +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/install.json b/labextension/install.json similarity index 100% rename from install.json rename to labextension/install.json diff --git a/package.json b/labextension/package.json similarity index 98% rename from package.json rename to labextension/package.json index a651043..44560bb 100644 --- a/package.json +++ b/labextension/package.json @@ -14,6 +14,7 @@ "license": "BSD-3-Clause", "author": "Yuvi Panda", "files": [ + "LICENSE", "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}", "style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}", "src/**/*.{ts,tsx}" @@ -35,7 +36,7 @@ "clean": "jlpm clean:lib", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "clean:lintcache": "rimraf .eslintcache .stylelintcache", - "clean:labextension": "rimraf jupyter_launcher_shortcuts/labextension jupyter_launcher_shortcuts/_version.py", + "clean:labextension": "rimraf jupyter_launcher_shortcuts/labextension", "clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache", "eslint": "jlpm eslint:check --fix", "eslint:check": "eslint . --cache --ext .ts,.tsx", @@ -87,7 +88,7 @@ }, "jupyterlab": { "extension": true, - "outputDir": "jupyter_launcher_shortcuts/labextension" + "outputDir": "../jupyter_launcher_shortcuts/labextension" }, "eslintIgnore": [ "node_modules", diff --git a/src/index.ts b/labextension/src/index.ts similarity index 100% rename from src/index.ts rename to labextension/src/index.ts diff --git a/style/index.css b/labextension/style/index.css similarity index 100% rename from style/index.css rename to labextension/style/index.css diff --git a/tsconfig.json b/labextension/tsconfig.json similarity index 100% rename from tsconfig.json rename to labextension/tsconfig.json diff --git a/yarn.lock b/labextension/yarn.lock similarity index 100% rename from yarn.lock rename to labextension/yarn.lock diff --git a/pyproject.toml b/pyproject.toml index 7953e8f..755cfd5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,13 +31,16 @@ dependencies = [ ] dynamic = ["description", "authors", "urls", "keywords"] + +# hatch ref: https://hatch.pypa.io/latest/ +# [tool.hatch.build.targets.sdist] artifacts = ["jupyter_launcher_shortcuts/labextension"] exclude = [".github"] [tool.hatch.build.targets.wheel.shared-data] -"jupyter_launcher_shortcuts/labextension" = "share/jupyter/labextensions/jupyter_launcher_shortcuts" -"install.json" = "share/jupyter/labextensions/jupyter_launcher_shortcuts/install.json" +"jupyter_launcher_shortcuts/labextension" = "share/jupyter/labextensions/jupyterlab-launcher-shortcuts" +"labextension/install.json" = "share/jupyter/labextensions/jupyterlab-launcher-shortcuts/install.json" "jupyter_launcher_shortcuts/etc/serverextension.json" = "etc/jupyter/jupyter_server_config.d/jupyter_launcher_shortcuts.json" @@ -47,7 +50,8 @@ exclude = [".github"] # ref: https://github.com/agoose77/hatch-nodejs-version#readme # [tool.hatch.metadata.hooks.nodejs] -fields = ["description", "authors", "urls"] +fields = ["description", "authors", "urls", "keywords"] +path = "labextension/package.json" # jupyter-builder is used to ensure we build the jupyterlab extension when the @@ -61,17 +65,20 @@ build-function = "hatch_jupyter_builder.npm_builder" ensured-targets = [ "jupyter_launcher_shortcuts/labextension/static/style.js", "jupyter_launcher_shortcuts/labextension/package.json", + "jupyter_launcher_shortcuts/labextension/static/third-party-licenses.json", ] -skip-if-exists = ["jupyter_launcher_shortcuts/labextension/static/style.js"] +skip-if-exists = ["jupyter_launcher_shortcuts/labextension/package.json"] [tool.hatch.build.hooks.jupyter-builder.build-kwargs] +path = "labextension" build_cmd = "build:prod" npm = ["jlpm"] [tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs] +path = "labextension" build_cmd = "install:extension" npm = ["jlpm"] -source_dir = "src" +source_dir = "labextension/src" build_dir = "jupyter_launcher_shortcuts/labextension"