Skip to content

Commit

Permalink
Merge pull request #34 from consideRatio/pr/ensure-npm-package-is-non…
Browse files Browse the repository at this point in the history
…-empty

Fix to make npm package not be empty
consideRatio authored Jul 9, 2024

Verified

This commit was signed with the committer’s verified signature.
2 parents 68679ea + 42f3613 commit 3dc0c7c
Showing 11 changed files with 48 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
29 changes: 29 additions & 0 deletions labextension/LICENSE
Original file line number Diff line number Diff line change
@@ -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.
File renamed without changes.
5 changes: 3 additions & 2 deletions package.json → labextension/package.json
Original file line number Diff line number Diff line change
@@ -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",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 12 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"


0 comments on commit 3dc0c7c

Please sign in to comment.