Skip to content

Commit a3ccc4d

Browse files
authored
Merge pull request #1 from DenisaCG/blockly
Add `jupyterlab-blockly`
2 parents 332d20b + e0af5e5 commit a3ccc4d

File tree

7 files changed

+5433
-13
lines changed

7 files changed

+5433
-13
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
1919

2020
- name: Install dependencies
21-
run: python -m pip install -U jupyterlab~=3.1
21+
run: python -m pip install -U jupyterlab
2222

2323
- name: Lint the extension
2424
run: |
@@ -72,7 +72,7 @@ jobs:
7272
sudo rm -rf $(which node)
7373
sudo rm -rf $(which node)
7474
75-
pip install "jupyterlab~=3.1" jupyterlab_blockly_ipylgbst*.whl
75+
pip install jupyterlab jupyterlab_blockly_ipylgbst*.whl
7676
7777
7878
jupyter labextension list

package.json

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,20 @@
5151
"stylelint:check": "stylelint --cache \"style/**/*.css\"",
5252
"watch": "run-p watch:src watch:labextension",
5353
"watch:src": "tsc -w",
54-
"watch:labextension": "jupyter labextension watch ."
54+
"watch:labextension": "jupyter labextension watch .",
55+
"postinstall": "patch-package"
5556
},
5657
"dependencies": {
57-
"@jupyterlab/application": "^3.1.0"
58+
"@jupyter-widgets/base": "^6.0.4",
59+
"@jupyter-widgets/jupyterlab-manager": "^5.0.7",
60+
"@jupyterlab/application": "^3.4",
61+
"blockly": "^9.2.1",
62+
"jupyterlab-blockly": "^0.3.0-alpha.1",
63+
"patch-package": "^6.4.7",
64+
"postinstall-postinstall": "^2.1.0"
5865
},
5966
"devDependencies": {
60-
"@jupyterlab/builder": "^3.1.0",
67+
"@jupyterlab/builder": "^3.4.0",
6168
"@typescript-eslint/eslint-plugin": "^4.8.1",
6269
"@typescript-eslint/parser": "^4.8.1",
6370
"eslint": "^7.14.0",
@@ -71,7 +78,7 @@
7178
"stylelint-config-recommended": "^6.0.0",
7279
"stylelint-config-standard": "~24.0.0",
7380
"stylelint-prettier": "^2.0.0",
74-
"typescript": "~4.1.3"
81+
"typescript": "~4.9.5"
7582
},
7683
"sideEffects": [
7784
"style/*.css",
@@ -83,7 +90,17 @@
8390
},
8491
"jupyterlab": {
8592
"extension": true,
86-
"outputDir": "jupyterlab_blockly_ipylgbst/labextension"
93+
"outputDir": "jupyterlab_blockly_ipylgbst/labextension",
94+
"sharedPackages": {
95+
"jupyterlab-blockly": {
96+
"bundled": false,
97+
"singleton": true
98+
},
99+
"blockly": {
100+
"bundled": false,
101+
"singleton": true
102+
}
103+
}
87104
},
88105
"eslintIgnore": [
89106
"node_modules",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
diff --git a/node_modules/@jupyterlab/codeeditor/lib/editor.d.ts b/node_modules/@jupyterlab/codeeditor/lib/editor.d.ts
4+
index ffe8d1f..d63b2f8 100644
5+
--- a/node_modules/@jupyterlab/codeeditor/lib/editor.d.ts
6+
+++ b/node_modules/@jupyterlab/codeeditor/lib/editor.d.ts
7+
@@ -44,7 +44,7 @@ export declare namespace CodeEditor {
8+
/**
9+
* An interface describing editor state coordinates.
10+
*/
11+
- interface ICoordinate extends JSONObject, ClientRect {
12+
+ interface ICoordinate extends JSONObject {
13+
}
14+
/**
15+
* A range.

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["hatchling>=1.4.0", "jupyterlab>=3.4.7,<4.0.0", "hatch-nodejs-version"]
2+
requires = ["hatchling>=1.4.0", "jupyterlab~=3.6", "hatch-nodejs-version"]
33
build-backend = "hatchling.build"
44

55
[project]
@@ -23,6 +23,9 @@ classifiers = [
2323
"Programming Language :: Python :: 3.11",
2424
]
2525
dependencies = [
26+
"jupyterlab~=3.6",
27+
"jupyterlab-blockly>=0.3.0-alpha.1,<0.4",
28+
"ipywidgets==7.6.0"
2629
]
2730
dynamic = ["version", "description", "authors", "urls", "keywords"]
2831

@@ -66,7 +69,7 @@ build_dir = "jupyterlab_blockly_ipylgbst/labextension"
6669
version_cmd = "hatch version"
6770

6871
[tool.jupyter-releaser.hooks]
69-
before-build-npm = ["python -m pip install jupyterlab~=3.1", "jlpm", "jlpm build:prod"]
72+
before-build-npm = ["python -m pip install jupyterlab~=3.6", "jlpm", "jlpm build:prod"]
7073
before-build-python = ["jlpm clean:all"]
7174

7275
[tool.check-wheel-contents]

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ import {
33
JupyterFrontEndPlugin
44
} from '@jupyterlab/application';
55

6+
import { IBlocklyRegistry } from 'jupyterlab-blockly';
7+
68
/**
79
* Initialization data for the jupyterlab-blockly-ipylgbst extension.
810
*/
911
const plugin: JupyterFrontEndPlugin<void> = {
1012
id: 'jupyterlab-blockly-ipylgbst:plugin',
1113
autoStart: true,
12-
activate: (app: JupyterFrontEnd) => {
14+
requires: [IBlocklyRegistry],
15+
activate: (app: JupyterFrontEnd, blockly: IBlocklyRegistry) => {
1316
console.log(
1417
'JupyterLab extension jupyterlab-blockly-ipylgbst is activated!'
1518
);

tsconfig.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
"resolveJsonModule": true,
1616
"outDir": "lib",
1717
"rootDir": "src",
18-
"strict": true,
19-
"strictNullChecks": true,
2018
"target": "ES2018",
2119
"types": []
2220
},
23-
"include": ["src/*"]
21+
"include": ["src/**/*.ts"],
22+
"exclude": ["node_modules"]
2423
}

0 commit comments

Comments
 (0)