Skip to content

Commit 47158d9

Browse files
authored
Update extension template (#107)
* Update template * Update yarn.lock --------- Co-authored-by: Frédéric Collonval <[email protected]>
1 parent 610c407 commit 47158d9

12 files changed

+1114
-1008
lines changed

.copier-answers.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: v4.0.10
2+
_commit: v4.3.6
33
_src_path: https://github.com/jupyterlab/extension-template
44
author_email: [email protected]
55
author_name: Frederic Collonval
6-
data_format: string
7-
file_extension: ''
86
has_binder: true
97
has_settings: true
108
kind: server
119
labextension_name: jupyterlab-rise
12-
mimetype: ''
13-
mimetype_name: ''
1410
project_short_description: 'RISE: "Live" Reveal.js JupyterLab Slideshow extension.'
1511
python_name: jupyterlab_rise
1612
repository: https://github.com/jupyterlab-contrib/rise
1713
test: true
18-
viewer_name: ''
1914

.github/workflows/binder-on-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
steps:
1212
- uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1
1313
with:
14-
github_token: ${{ secrets.github_token }}
14+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ on:
66
pull_request:
77
branches: '*'
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build:
1115
runs-on: ubuntu-latest
1216

1317
steps:
1418
- name: Checkout
15-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
1620

1721
- name: Base Setup
1822
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
@@ -47,7 +51,7 @@ jobs:
4751
pip uninstall -y "jupyterlab_rise" jupyterlab
4852
4953
- name: Upload extension packages
50-
uses: actions/upload-artifact@v3
54+
uses: actions/upload-artifact@v4
5155
with:
5256
name: extension-artifacts
5357
path: dist/jupyterlab_rise*
@@ -59,11 +63,11 @@ jobs:
5963

6064
steps:
6165
- name: Install Python
62-
uses: actions/setup-python@v4
66+
uses: actions/setup-python@v5
6367
with:
6468
python-version: '3.9'
6569
architecture: 'x64'
66-
- uses: actions/download-artifact@v3
70+
- uses: actions/download-artifact@v4
6771
with:
6872
name: extension-artifacts
6973
- name: Install and Test
@@ -93,13 +97,13 @@ jobs:
9397

9498
steps:
9599
- name: Checkout
96-
uses: actions/checkout@v3
100+
uses: actions/checkout@v4
97101

98102
- name: Base Setup
99103
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
100104

101105
- name: Download extension package
102-
uses: actions/download-artifact@v3
106+
uses: actions/download-artifact@v4
103107
with:
104108
name: extension-artifacts
105109

@@ -111,11 +115,12 @@ jobs:
111115
- name: Install dependencies
112116
working-directory: ui-tests
113117
env:
118+
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
114119
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
115120
run: jlpm install
116121

117122
- name: Set up browser cache
118-
uses: actions/cache@v3
123+
uses: actions/cache@v4
119124
with:
120125
path: |
121126
${{ github.workspace }}/pw-browsers
@@ -132,7 +137,7 @@ jobs:
132137
133138
- name: Upload Playwright Test report
134139
if: always()
135-
uses: actions/upload-artifact@v3
140+
uses: actions/upload-artifact@v4
136141
with:
137142
name: jupyterlab_rise-playwright-tests
138143
path: |
@@ -144,7 +149,7 @@ jobs:
144149
runs-on: ubuntu-latest
145150
timeout-minutes: 15
146151
steps:
147-
- uses: actions/checkout@v3
152+
- uses: actions/checkout@v4
148153
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
149154
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
150155
with:

.github/workflows/check-release.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ on:
55
pull_request:
66
branches: ["*"]
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
check_release:
1014
runs-on: ubuntu-latest
1115
steps:
1216
- name: Checkout
13-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1418
- name: Base Setup
1519
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
1620
- name: Install Dependencies
@@ -24,7 +28,7 @@ jobs:
2428
token: ${{ secrets.GITHUB_TOKEN }}
2529

2630
- name: Upload Distributions
27-
uses: actions/upload-artifact@v3
31+
uses: actions/upload-artifact@v4
2832
with:
2933
name: jupyterlab_rise-releaser-dist-${{ github.run_number }}
3034
path: .jupyter_releaser_checkout/dist

.github/workflows/prep-release.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
post_version_spec:
1313
description: "Post Version Specifier"
1414
required: false
15+
# silent:
16+
# description: "Set a placeholder in the changelog and don't publish the release."
17+
# required: false
18+
# type: boolean
1519
since:
1620
description: "Use PRs with activity since this date or git reference"
1721
required: false
@@ -22,15 +26,18 @@ on:
2226
jobs:
2327
prep_release:
2428
runs-on: ubuntu-latest
29+
permissions:
30+
contents: write
2531
steps:
2632
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
2733

2834
- name: Prep Release
2935
id: prep-release
3036
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
3137
with:
32-
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
38+
token: ${{ secrets.GITHUB_TOKEN }}
3339
version_spec: ${{ github.event.inputs.version_spec }}
40+
# silent: ${{ github.event.inputs.silent }}
3441
post_version_spec: ${{ github.event.inputs.post_version_spec }}
3542
branch: ${{ github.event.inputs.branch }}
3643
since: ${{ github.event.inputs.since }}

.github/workflows/publish-release.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,34 @@ on:
1515
jobs:
1616
publish_release:
1717
runs-on: ubuntu-latest
18+
environment: release
1819
permissions:
19-
# This is useful if you want to use PyPI trusted publisher
20-
# and NPM provenance
2120
id-token: write
2221
steps:
2322
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
2423

24+
- uses: actions/create-github-app-token@v1
25+
id: app-token
26+
with:
27+
app-id: ${{ vars.APP_ID }}
28+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
29+
2530
- name: Populate Release
2631
id: populate-release
2732
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
2833
with:
29-
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
34+
token: ${{ steps.app-token.outputs.token }}
3035
branch: ${{ github.event.inputs.branch }}
3136
release_url: ${{ github.event.inputs.release_url }}
3237
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
3338

3439
- name: Finalize Release
3540
id: finalize-release
3641
env:
37-
# The following are needed if you use legacy PyPI set up
38-
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
39-
# PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }}
40-
# TWINE_USERNAME: __token__
4142
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42-
uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2
43+
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
4344
with:
44-
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
45+
token: ${{ steps.app-token.outputs.token }}
4546
release_url: ${{ steps.populate-release.outputs.release_url }}
4647

4748
- name: "** Next Step **"

RELEASE.md

+7-38
Original file line numberDiff line numberDiff line change
@@ -45,52 +45,21 @@ npm publish --access public
4545

4646
## Automated releases with the Jupyter Releaser
4747

48-
The extension repository should already be compatible with the Jupyter Releaser.
49-
50-
Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html) for more information.
48+
The extension repository should already be compatible with the Jupyter Releaser. But
49+
the GitHub repository and the package managers need to be properly set up. Please
50+
follow the instructions of the Jupyter Releaser [checklist](https://jupyter-releaser.readthedocs.io/en/latest/how_to_guides/convert_repo_from_repo.html).
5151

5252
Here is a summary of the steps to cut a new release:
5353

54-
- Add tokens to the [Github Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) in the repository:
55-
- `ADMIN_GITHUB_TOKEN` (with "public_repo" and "repo:status" permissions); see the [documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
56-
- `NPM_TOKEN` (with "automation" permission); see the [documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens)
57-
- Set up PyPI
58-
59-
<details><summary>Using PyPI trusted publisher (modern way)</summary>
60-
61-
- Set up your PyPI project by [adding a trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
62-
- The _workflow name_ is `publish-release.yml` and the _environment_ should be left blank.
63-
- Ensure the publish release job as `permissions`: `id-token : write` (see the [documentation](https://docs.pypi.org/trusted-publishers/using-a-publisher/))
64-
65-
</details>
66-
67-
<details><summary>Using PyPI token (legacy way)</summary>
68-
69-
- If the repo generates PyPI release(s), create a scoped PyPI [token](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#saving-credentials-on-github). We recommend using a scoped token for security reasons.
70-
71-
- You can store the token as `PYPI_TOKEN` in your fork's `Secrets`.
72-
73-
- Advanced usage: if you are releasing multiple repos, you can create a secret named `PYPI_TOKEN_MAP` instead of `PYPI_TOKEN` that is formatted as follows:
74-
75-
```text
76-
owner1/repo1,token1
77-
owner2/repo2,token2
78-
```
79-
80-
If you have multiple Python packages in the same repository, you can point to them as follows:
81-
82-
```text
83-
owner1/repo1/path/to/package1,token1
84-
owner1/repo1/path/to/package2,token2
85-
```
86-
87-
</details>
88-
8954
- Go to the Actions panel
9055
- Run the "Step 1: Prep Release" workflow
9156
- Check the draft changelog
9257
- Run the "Step 2: Publish Release" workflow
9358

59+
> [!NOTE]
60+
> Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html)
61+
> for more information.
62+
9463
## Publishing to `conda-forge`
9564

9665
If the package is not on conda forge yet, check the documentation to learn how to add it: https://conda-forge.org/docs/maintainer/adding_pkgs.html

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"stylelint": "^15.10.1",
6969
"stylelint-config-recommended": "^13.0.0",
7070
"stylelint-config-standard": "^34.0.0",
71+
"stylelint-csstree-validator": "^3.0.0",
7172
"stylelint-prettier": "^4.0.0",
7273
"typescript": "~5.0.4"
7374
},
@@ -155,7 +156,11 @@
155156
"stylelint-config-standard",
156157
"stylelint-prettier/recommended"
157158
],
159+
"plugins": [
160+
"stylelint-csstree-validator"
161+
],
158162
"rules": {
163+
"csstree/validator": true,
159164
"property-no-vendor-prefix": null,
160165
"selector-class-pattern": null,
161166
"selector-no-vendor-prefix": null,

pyproject.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version"]
2+
requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version>=0.3.2"]
33
build-backend = "hatchling.build"
44

55
[project]
@@ -20,6 +20,7 @@ classifiers = [
2020
"Programming Language :: Python :: 3.9",
2121
"Programming Language :: Python :: 3.10",
2222
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
2324
]
2425
dependencies = [
2526
"jupyter_server>=2.0.1,<3",
@@ -40,7 +41,7 @@ test = [
4041
source = "nodejs"
4142

4243
[tool.hatch.metadata.hooks.nodejs]
43-
fields = ["description", "authors", "urls"]
44+
fields = ["description", "authors", "urls", "keywords"]
4445

4546
[tool.hatch.build.targets.sdist]
4647
artifacts = ["jupyterlab_rise/labextension", "jupyterlab_rise/schemas", "jupyterlab_rise/static"]

ui-tests/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This folder contains the integration tests of the extension.
44

55
They are defined using [Playwright](https://playwright.dev/docs/intro) test runner
6-
and [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) helper.
6+
and [Galata](https://github.com/jupyterlab/jupyterlab/tree/main/galata) helper.
77

88
The Playwright configuration is defined in [playwright.config.js](./playwright.config.js).
99

@@ -12,7 +12,7 @@ in [jupyter_server_test_config.py](./jupyter_server_test_config.py).
1212

1313
The default configuration will produce video for failing tests and an HTML report.
1414

15-
> There is a new experimental UI mode that you may fall in love with; see [that video](https://www.youtube.com/watch?v=jF0yA-JLQW0).
15+
> There is a UI mode that you may like; see [that video](https://www.youtube.com/watch?v=jF0yA-JLQW0).
1616
1717
## Run the tests
1818

ui-tests/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"test:update": "jlpm playwright test --update-snapshots"
1010
},
1111
"devDependencies": {
12-
"@jupyterlab/galata": "^5.0.0",
13-
"@playwright/test": "^1.32.0"
12+
"@jupyterlab/galata": "^5.0.5",
13+
"@playwright/test": "^1.37.0"
1414
}
1515
}

0 commit comments

Comments
 (0)