diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index d6c4ac4..ca3faff 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -12,32 +12,21 @@ permissions: jobs: check_release: runs-on: ubuntu-latest - strategy: - matrix: - group: [check_release, link_check] - python-version: ["3.9"] - node-version: ["18.x"] steps: - name: Checkout uses: actions/checkout@v3 + - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - name: Install Dependencies - run: | - pip install -e . - - - name: Check Links - if: ${{ matrix.group == 'link_check' }} - uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1 - name: Check Release - if: ${{ matrix.group == 'check_release' }} uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 with: token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Distributions - if: ${{ matrix.group == 'check_release' }} uses: actions/upload-artifact@v3 with: name: jupyter-releaser-dist-${{ github.run_number }} - path: .jupyter_releaser_checkout/dist \ No newline at end of file + path: | + .jupyter_releaser_checkout/dist diff --git a/package.json b/package.json index cadbded..42a1540 100644 --- a/package.json +++ b/package.json @@ -32,26 +32,28 @@ ], "scripts": { "build": "jlpm run build:lib && jlpm run build:labextension:dev", + "build:lib": "tsc --sourceMap", + "build:lib:prod": "tsc", + "build:prod": "jlpm run clean && jlpm run build:lib:prod && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", - "build:lib": "tsc -b", - "build:prod": "jlpm run build:lib && jlpm run build:labextension", "build:docs": "cd docs/ && make html", "clean": "jlpm run clean:lib", - "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf ../../voila_gridstack/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", + "clean:labextension": "rimraf ../../jupyter_collaboration/labextension", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension && rimraf node_modules", "develop": "python scripts/develop.py --link", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:dev": "jlpm run build:prod", + "install:extension": "jlpm run build", "prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"", "prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"", "test": "jest --coverage", "uninstall": "python scripts/develop.py --unlink", "watch": "run-p watch:src watch:labextension", - "watch:labextension": "jupyter labextension watch .", - "watch:src": "tsc -w" + "watch:src": "tsc -w", + "watch:labextension": "jupyter labextension watch ." }, "dependencies": { "@jupyter-widgets/base": "^6.0.4", diff --git a/pyproject.toml b/pyproject.toml index 31532e4..d133cd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ dynamic = ["version", "description", "authors", "urls", "keywords"] [project.optional-dependencies] dev = [ "click", - "jupyter_releaser~=0.9", + "jupyter_releaser", "hatch", "hatch-nodejs-version" ] @@ -50,6 +50,10 @@ source = "nodejs" [tool.hatch.metadata.hooks.nodejs] fields = ["description", "authors", "urls"] +[tool.hatch.build.targets.sdist] +artifacts = ["/voila_gridstack/labextension", "/voila_gridstack/nbextension", "/voila_gridstack/template", "/voila_gridstack/config"] +exclude = ["/.github", "/binder", "node_modules"] + [tool.hatch.build.targets.wheel.shared-data] "voila_gridstack/config/jpserver-voila-gridstack.json" = "etc/jupyter/jupyter_server_config.d/jpserver-voila-gridstack.json" "voila_gridstack/config/nbserver-voila-gridstack.json" = "etc/jupyter/jupyter_notebook_config.d/nbserver-voila-gridstack.json" @@ -59,9 +63,6 @@ fields = ["description", "authors", "urls"] "voila_gridstack/nbextension" = "share/jupyter/nbextensions/voila-gridstack" "voila_gridstack/template" = "share/jupyter/nbconvert/templates/gridstack" -[tool.hatch.build.targets.sdist] -exclude = [".github"] - [tool.hatch.build.hooks.jupyter-builder] dependencies = ["hatch-jupyter-builder>=0.6.2"] build-function = "hatch_jupyter_builder.npm_builder" @@ -69,19 +70,28 @@ ensured-targets = ["voila_gridstack/labextension/static/style.js", "voila_gridst skip-if-exists = ["voila_gridstack/labextension/static/style.js"] [tool.hatch.build.hooks.jupyter-builder.build-kwargs] -build_cmd = "build:prod" -npm = ["jlpm"] - -[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs] -build_cmd = "build" npm = ["jlpm"] +build_cmd = "build:prod" +editable_build_cmd = "install:extension" [tool.jupyter-releaser] skip = ["check-links"] [tool.jupyter-releaser.hooks] -before-build-npm = ["python -m pip install jupyterlab~=3.6", "jlpm", "jlpm build:prod"] -before-build-python = ["jlpm clean:all"] +before-build-npm = [ + "python -m pip install jupyterlab~=3.6", + "jlpm", + "jlpm build:prod" +] +before-build-python = [ + # Build the assets + "jlpm build:prod", + # Clean the build artifacts to not include them in sdist + "jlpm clean:lib" +] [tool.jupyter-releaser.options] version_cmd = "hatch version" + +[tool.check-wheel-contents] +ignore = ["W002"]