Skip to content

Commit d687dc2

Browse files
authored
Modernize the code (#53)
* Upgrade yarn * Update config * First compilation of component rollup bundle * Build react component * Build all * Fix test * First compilable stories v7 * Restore dynamic theming * Format the code * Fix setup * fix ESLint error * Some visual test fixes Fix format:check Fix packaging Update all snapshots
1 parent 760b8a6 commit d687dc2

File tree

371 files changed

+18994
-17499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

371 files changed

+18994
-17499
lines changed

.copier-answers.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: v4.0.6
3+
_src_path: https://github.com/jupyterlab/extension-template
4+
author_email: ''
5+
author_name: Project Jupyter
6+
has_binder: true
7+
has_settings: false
8+
kind: frontend
9+
labextension_name: 'jupyter-ui-demo'
10+
project_short_description: UI Toolkit for Jupyter.
11+
python_name: jupyter_ui_demo
12+
repository: https://github.com/jupyterlab-contrib/jupyter-ui-toolkit
13+
test: false
14+

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

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,14 @@
1-
# Reference https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html
21
name: Binder Badge
32
on:
43
pull_request_target:
54
types: [opened]
65

7-
permissions:
8-
pull-requests: write
9-
106
jobs:
117
binder:
128
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
1311
steps:
14-
- name: comment on PR with Binder link
15-
uses: actions/github-script@v3
12+
- uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1
1613
with:
17-
github-token: ${{secrets.GITHUB_TOKEN}}
18-
script: |
19-
var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO;
20-
var PR_HEAD_REF = process.env.PR_HEAD_REF;
21-
github.issues.createComment({
22-
issue_number: context.issue.number,
23-
owner: context.repo.owner,
24-
repo: context.repo.repo,
25-
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}?urlpath=lab) :point_left: Launch a binder notebook on branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_`
26-
})
27-
env:
28-
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
29-
PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }}
14+
github_token: ${{ secrets.github_token }}

.github/workflows/build.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,31 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515
- name: Install node
16-
uses: actions/setup-node@v1
16+
uses: actions/setup-node@v3
1717
with:
18-
node-version: '14.x'
18+
node-version: '18'
1919
- name: Install Python
20-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v4
2121
with:
22-
python-version: '3.8'
22+
python-version: '3.10'
2323
architecture: 'x64'
2424

2525
- name: Setup pip cache
26-
uses: actions/cache@v2
26+
uses: actions/cache@v3
2727
with:
2828
path: ~/.cache/pip
29-
key: pip-3.8-${{ hashFiles('package.json') }}
29+
key: pip-3.10-${{ hashFiles('package.json') }}
3030
restore-keys: |
31-
pip-3.8-
31+
pip-3.10-
3232
pip-
3333
3434
- name: Get yarn cache directory path
3535
id: yarn-cache-dir-path
3636
run: echo "::set-output name=dir::$(yarn cache dir)"
3737
- name: Setup yarn cache
38-
uses: actions/cache@v2
38+
uses: actions/cache@v3
3939
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
4040
with:
4141
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -44,7 +44,7 @@ jobs:
4444
yarn-
4545
4646
- name: Install dependencies
47-
run: python -m pip install -U jupyterlab~=3.1 check-manifest
47+
run: python -m pip install -U jupyterlab~=4.0
4848
- name: Build the extension
4949
run: |
5050
set -eux
@@ -55,15 +55,13 @@ jobs:
5555
jupyter labextension list 2>&1 | grep -ie "jupyter-ui-demo.*OK"
5656
python -m jupyterlab.browser_check
5757
58-
check-manifest -v
59-
6058
pip install build
6159
python -m build --sdist
6260
cp dist/*.tar.gz myextension.tar.gz
6361
pip uninstall -y jupyter_ui_demo jupyterlab
6462
rm -rf myextension
6563
66-
- uses: actions/upload-artifact@v2
64+
- uses: actions/upload-artifact@v3
6765
with:
6866
name: myextension-sdist
6967
path: myextension.tar.gz
@@ -74,13 +72,13 @@ jobs:
7472

7573
steps:
7674
- name: Checkout
77-
uses: actions/checkout@v2
75+
uses: actions/checkout@v3
7876
- name: Install Python
79-
uses: actions/setup-python@v2
77+
uses: actions/setup-python@v4
8078
with:
81-
python-version: '3.8'
79+
python-version: '3.10'
8280
architecture: 'x64'
83-
- uses: actions/download-artifact@v2
81+
- uses: actions/download-artifact@v3
8482
with:
8583
name: myextension-sdist
8684
- name: Install and Test
@@ -92,4 +90,4 @@ jobs:
9290
pip install myextension.tar.gz
9391
pip install jupyterlab
9492
jupyter labextension list 2>&1 | grep -ie "jupyter-ui-demo.*OK"
95-
python -m jupyterlab.browser_check --no-chrome-test
93+
python -m jupyterlab.browser_check --no-browser-test
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["*"]
7+
8+
jobs:
9+
check_release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Base Setup
15+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
16+
- name: Install Dependencies
17+
run: |
18+
pip install -e .
19+
- name: Check Release
20+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
21+
with:
22+
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Upload Distributions
26+
uses: actions/upload-artifact@v3
27+
with:
28+
name: jupyter_ui_demo-releaser-dist-${{ github.run_number }}
29+
path: .jupyter_releaser_checkout/dist

.github/workflows/ci.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
timeout-minutes: 10
1313
steps:
1414
- name: Checkout 🛎️
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616

1717
- name: Setup Node 💾
18-
uses: actions/setup-node@v2
18+
uses: actions/setup-node@v3
1919
with:
20-
node-version: '14'
20+
node-version: '18'
2121

2222
- name: Get yarn cache directory path
2323
id: yarn-cache-dir-path
@@ -43,18 +43,18 @@ jobs:
4343
timeout-minutes: 10
4444
steps:
4545
- name: Checkout 🛎️
46-
uses: actions/checkout@v2
46+
uses: actions/checkout@v3
4747

4848
- name: Setup Node 💾
49-
uses: actions/setup-node@v2
49+
uses: actions/setup-node@v3
5050
with:
51-
node-version: '14'
51+
node-version: '18'
5252

5353
- name: Get yarn cache directory path
5454
id: yarn-cache-dir-path
5555
run: echo "::set-output name=dir::$(yarn cache dir)"
5656
- name: Setup yarn cache
57-
uses: actions/cache@v2
57+
uses: actions/cache@v3
5858
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
5959
with:
6060
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -76,18 +76,18 @@ jobs:
7676
timeout-minutes: 10
7777
steps:
7878
- name: Checkout 🛎️
79-
uses: actions/checkout@v2
79+
uses: actions/checkout@v3
8080

8181
- name: Setup Node 💾
82-
uses: actions/setup-node@v2
82+
uses: actions/setup-node@v3
8383
with:
84-
node-version: '14'
84+
node-version: '18'
8585

8686
- name: Get yarn cache directory path
8787
id: yarn-cache-dir-path
8888
run: echo "::set-output name=dir::$(yarn cache dir)"
8989
- name: Setup yarn cache
90-
uses: actions/cache@v2
90+
uses: actions/cache@v3
9191
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
9292
with:
9393
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -99,25 +99,25 @@ jobs:
9999
run: yarn install
100100

101101
- name: Build Toolkit 🏗
102-
run: yarn run lerna run --scope @jupyter-notebook/web-components --scope @jupyter-notebook/react-components build
102+
run: yarn run lerna run --scope @jupyter/web-components --scope @jupyter/react-components build
103103

104104
build-docs:
105105
runs-on: ubuntu-latest
106106
timeout-minutes: 10
107107
steps:
108108
- name: Checkout 🛎️
109-
uses: actions/checkout@v2
109+
uses: actions/checkout@v3
110110

111111
- name: Setup Node 💾
112-
uses: actions/setup-node@v2
112+
uses: actions/setup-node@v3
113113
with:
114-
node-version: '14'
114+
node-version: '18'
115115

116116
- name: Get yarn cache directory path
117117
id: yarn-cache-dir-path
118118
run: echo "::set-output name=dir::$(yarn cache dir)"
119119
- name: Setup yarn cache
120-
uses: actions/cache@v2
120+
uses: actions/cache@v3
121121
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
122122
with:
123123
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}

.github/workflows/docs-cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
timeout-minutes: 10
1212
steps:
1313
- name: Checkout 🛎️
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515

1616
- name: Install Dependencies 📥
1717
run: yarn install
@@ -21,7 +21,7 @@ jobs:
2121
working-directory: packages/components
2222

2323
- name: Deploy Docs 🚀
24-
uses: JamesIves/github-pages-deploy-action@4.1.3
24+
uses: JamesIves/github-pages-deploy-action@v4
2525
with:
2626
branch: gh-pages
2727
folder: packages/components/storybook-static
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Enforce PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, edited, synchronize]
6+
jobs:
7+
enforce-label:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
11+
steps:
12+
- name: enforce-triage-label
13+
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1

.github/workflows/prep-release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Step 1: Prep Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version_spec:
6+
description: "New Version Specifier"
7+
default: "next"
8+
required: false
9+
branch:
10+
description: "The branch to target"
11+
required: false
12+
post_version_spec:
13+
description: "Post Version Specifier"
14+
required: false
15+
since:
16+
description: "Use PRs with activity since this date or git reference"
17+
required: false
18+
since_last_stable:
19+
description: "Use PRs with activity since the last stable git tag"
20+
required: false
21+
type: boolean
22+
jobs:
23+
prep_release:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
27+
28+
- name: Prep Release
29+
id: prep-release
30+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
31+
with:
32+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
33+
version_spec: ${{ github.event.inputs.version_spec }}
34+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
35+
branch: ${{ github.event.inputs.branch }}
36+
since: ${{ github.event.inputs.since }}
37+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
38+
39+
- name: "** Next Step **"
40+
run: |
41+
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 'Step 2: Publish Release'
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
branch:
6+
description: 'The target branch'
7+
required: false
8+
release_url:
9+
description: 'The URL of the draft GitHub release'
10+
required: false
11+
steps_to_skip:
12+
description: 'Comma separated list of steps to skip'
13+
required: false
14+
default: 'build-python'
15+
16+
jobs:
17+
publish_release:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
id-token: write
21+
steps:
22+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
23+
24+
- name: Populate Release
25+
id: populate-release
26+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
27+
with:
28+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
29+
branch: ${{ github.event.inputs.branch }}
30+
release_url: ${{ github.event.inputs.release_url }}
31+
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
32+
33+
- name: Finalize Release
34+
id: finalize-release
35+
env:
36+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2
38+
with:
39+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
40+
release_url: ${{ steps.populate-release.outputs.release_url }}
41+
42+
- name: '** Next Step **'
43+
if: ${{ success() }}
44+
run: |
45+
echo "Verify the final release"
46+
echo ${{ steps.finalize-release.outputs.release_url }}
47+
48+
- name: '** Failure Message **'
49+
if: ${{ failure() }}
50+
run: |
51+
echo "Failed to Publish the Draft Release Url:"
52+
echo ${{ steps.populate-release.outputs.release_url }}

0 commit comments

Comments
 (0)