Skip to content

Commit ed9678c

Browse files
Merge branch 'main' into start-ckhub-api-gha
2 parents 73b836d + 71d770e commit ed9678c

Some content is hidden

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

51 files changed

+2596
-152
lines changed

.github/inject-gh-pages-config.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set -eux
2+
# Inject service URL
3+
cat jupyter-lite.json | jq '.["jupyter-config-data"]["sharing_service_api_url"] = "https://jupytereverywhere.coursekata.org/api/v1"' > jupyter-lite.json.tmp
4+
mv jupyter-lite.json.tmp jupyter-lite.json

.github/workflows/build.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
key: playwright-browsers-${{ runner.os }}-v1
5656
restore-keys: |
5757
playwright-browsers-${{ runner.os }}-
58-
58+
5959
- name: Build the extension
6060
run: |
6161
set -eux
@@ -106,35 +106,47 @@ jobs:
106106
run: |
107107
pip install jupytereverywhere*.whl
108108
109+
- name: Install jlpm
110+
run: |
111+
set -eux
112+
python -m pip install "jupyterlab>=4.0.0,<5"
113+
109114
- name: Build the JupyterLite app
110115
run: |
111116
cd lite
112-
jupyter lite build --output-dir dist
117+
bash ../.github/inject-gh-pages-config.sh
118+
cd ..
119+
jlpm install
120+
jlpm build:all
113121
114122
- name: Upload artifact
115123
uses: actions/upload-artifact@v4
116124
with:
117125
name: lite-app
118-
path: ./lite/dist
126+
path: ./dist
119127
if-no-files-found: error
120128

121129
- name: Upload GitHub Pages artifact
122130
uses: actions/upload-pages-artifact@v3
123131
with:
124-
path: ./lite/dist
132+
path: ./dist
125133

126-
- name: Build the JupyterLite app (in test mode)
134+
- name: Build landing page and JupyterLite app (in test mode)
127135
run: |
136+
rm -rf dist dist-test
128137
cd lite
129-
rm -r dist # jupyter lite will not build in `dist-test/` if `dist/` exists...?
130138
bash ../ui-tests/inject-test-config.sh
131-
jupyter lite build --output-dir dist-test
139+
cd ..
140+
jlpm install
141+
jlpm build:all
142+
mv dist dist-test
143+
132144
133145
- name: Upload artifact
134146
uses: actions/upload-artifact@v4
135147
with:
136148
name: lite-app-test
137-
path: ./lite/dist-test
149+
path: ./dist-test
138150
if-no-files-found: error
139151

140152
- name: Leave instructions for testing

.github/workflows/update-integration-tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ jobs:
8282
jlpm
8383
python -m pip install .
8484
85-
- name: Build the JupyterLite app
85+
- name: Build landing page and JupyterLite app
8686
run: |
87+
rm -rf dist dist-test
8788
cd lite
8889
bash ../ui-tests/inject-test-config.sh
89-
jupyter lite build --output-dir ../dist
90+
cd ..
91+
jlpm install
92+
jlpm build:all
93+
mv dist dist-test
9094
9195
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1
9296
with:
@@ -96,3 +100,4 @@ jobs:
96100
test_folder: ui-tests
97101
npm_client: jlpm
98102
server_url: http-get://localhost:3000
103+
browser: chromium

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@
3333
"build": "jlpm build:lib && jlpm build:labextension:dev",
3434
"build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:labextension",
3535
"build:labextension": "jupyter labextension build .",
36+
"copy:landing:template": "cp templates/index.html dist/index.html",
37+
"build:landing:css": "esbuild style/landing.css --bundle --minify --outfile=dist/landing.css",
38+
"build:base:css": "esbuild style/base.css --bundle --minify --outfile=dist/base.css",
39+
"build:css": "jlpm build:landing:css && jlpm build:base:css",
40+
"build:landing": "esbuild src/landing.tsx --bundle --outfile=dist/landing.js --minify --loader:.svg=dataurl --loader:.png=dataurl --loader:.jpeg=dataurl && jlpm copy:landing:template && jlpm build:css",
41+
"build:jupyterlite": "cd lite && jupyter lite build --output-dir=../dist && cd .. && jlpm build:landing",
42+
"build:all": "jlpm build && jlpm build:jupyterlite",
3643
"build:labextension:dev": "jupyter labextension build --development True .",
3744
"build:lib": "tsc --sourceMap",
3845
"build:lib:prod": "tsc",
@@ -78,11 +85,13 @@
7885
"@jupyterlab/testutils": "^4.0.0",
7986
"@types/jest": "^29.2.0",
8087
"@types/json-schema": "^7.0.11",
81-
"@types/react": "^18.0.26",
88+
"@types/react": "^19.1.8",
8289
"@types/react-addons-linked-state-mixin": "^0.14.22",
90+
"@types/react-dom": "^19.1.6",
8391
"@typescript-eslint/eslint-plugin": "^6.1.0",
8492
"@typescript-eslint/parser": "^6.1.0",
8593
"css-loader": "^6.7.1",
94+
"esbuild": "^0.25.5",
8695
"eslint": "^8.36.0",
8796
"eslint-config-prettier": "^8.8.0",
8897
"eslint-plugin-prettier": "^5.0.0",

schema/plugin.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,27 @@
33
"title": "jupytereverywhere",
44
"description": "jupytereverywhere settings.",
55
"type": "object",
6-
"properties": {},
76
"additionalProperties": false,
87
"jupyter.lab.toolbars": {
8+
"ViewOnlyNotebook": [
9+
{
10+
"name": "createCopy",
11+
"caption": "Create a new editable copy of this notebook",
12+
"rank": 30
13+
},
14+
{ "name": "spacer", "type": "spacer", "rank": 32 },
15+
{
16+
"name": "share",
17+
"rank": 35
18+
},
19+
{
20+
"name": "downloadDropdown",
21+
"rank": 36
22+
}
23+
],
924
"Notebook": [
1025
{
1126
"name": "save",
12-
"command": "",
13-
"disabled": true,
1427
"rank": 10
1528
},
1629
{
@@ -106,5 +119,13 @@
106119
"disabled": true
107120
}
108121
]
122+
},
123+
"jupyter.lab.transform": true,
124+
"properties": {
125+
"toolbar": {
126+
"title": "View-only notebook panel toolbar items",
127+
"type": "array",
128+
"default": []
129+
}
109130
}
110131
}

setup.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export namespace Commands {
44
export const downloadNotebookCommand = 'jupytereverywhere:download-notebook';
55
export const downloadPDFCommand = 'jupytereverywhere:download-pdf';
66
export const shareNotebookCommand = 'jupytereverywhere:share-notebook';
7+
export const createCopyNotebookCommand = 'jupytereverywhere:create-copy-notebook';
78
}

src/icons.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import refreshSvg from '../style/icons/refresh.svg';
2525
import stopSvg from '../style/icons/stop.svg';
2626
import fastForwardSvg from '../style/icons/fast-forward.svg';
2727
import downloadCaretSvg from '../style/icons/download-caret.svg';
28+
import imageIconSvg from '../style/icons/image-icon.svg';
29+
import fileIconSvg from '../style/icons/file-icon.svg';
2830

2931
export namespace EverywhereIcons {
3032
// Overwrite Jupyter default icons
@@ -64,7 +66,7 @@ export namespace EverywhereIcons {
6466
name: fastForwardIcon.name,
6567
svgstr: fastForwardSvg
6668
});
67-
// Addd custom icons
69+
// Add custom icons
6870
export const folderSidebar = new LabIcon({
6971
name: 'everywhere:folder-sidebar',
7072
svgstr: folderSidebarSvg
@@ -85,4 +87,12 @@ export namespace EverywhereIcons {
8587
name: 'everywhere:download-caret',
8688
svgstr: downloadCaretSvg
8789
});
90+
export const imageIcon = new LabIcon({
91+
name: 'everywhere:image-icon',
92+
svgstr: imageIconSvg
93+
});
94+
export const fileIcon = new LabIcon({
95+
name: 'everywhere:file-icon',
96+
svgstr: fileIconSvg
97+
});
8898
}

0 commit comments

Comments
 (0)