Skip to content

Commit fe24c89

Browse files
authored
Merge pull request #3 from hbcarlos/extend_blockly
Extend jupyterlab-blockly
2 parents 7544435 + 013f84a commit fe24c89

File tree

8 files changed

+153
-7180
lines changed

8 files changed

+153
-7180
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ node_modules/
66
*.egg-info/
77
.ipynb_checkpoints
88
*.tsbuildinfo
9+
yarn-error.log
910
jupyterlab_niryo_one/labextension
1011

1112
# Integration tests

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@
5555
},
5656
"dependencies": {
5757
"@jupyterlab/application": "^3.4",
58-
"jupyterlab-blockly": "^0.1.0-alpha.2"
58+
"blockly": "^7.20211209.2",
59+
"jupyterlab-blockly": "^0.1.0-alpha.4",
60+
"patch-package": "^6.4.7",
61+
"postinstall-postinstall": "^2.1.0"
5962
},
6063
"devDependencies": {
6164
"@jupyterlab/builder": "^3.3",

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@
5454
zip_safe=False,
5555
include_package_data=True,
5656
python_requires=">=3.7",
57+
install_requires=['jupyterlab-blockly>=0.1.0a5,<0.2'],
58+
extras_require={
59+
'env': ['pyniryo']
60+
},
5761
platforms="Linux, Mac OS X, Windows",
58-
keywords=["Jupyter", "JupyterLab", "JupyterLab3"],
62+
keywords=["Jupyter", "JupyterLab", "JupyterLab3", "ROS", "Niryo", "Niryo-One"],
5963
classifiers=[
6064
"License :: OSI Approved :: BSD License",
6165
"Programming Language :: Python",

src/index.ts

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
import {
22
JupyterFrontEnd,
3-
JupyterFrontEndPlugin,
4-
ILayoutRestorer
3+
JupyterFrontEndPlugin
54
} from '@jupyterlab/application';
6-
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
7-
import { IEditorServices } from '@jupyterlab/codeeditor';
8-
import { ICommandPalette } from '@jupyterlab/apputils';
9-
import { IFileBrowserFactory } from '@jupyterlab/filebrowser';
10-
import { ILauncher } from '@jupyterlab/launcher';
11-
import { ITranslator } from '@jupyterlab/translation';
12-
import { ISettingRegistry } from '@jupyterlab/settingregistry';
135

14-
import { IBlocklyRegisty } from 'jupyterlab-blockly/lib/token';
15-
import Blocklyplugin from 'jupyterlab-blockly';
6+
import { IBlocklyRegisty } from 'jupyterlab-blockly';
167

178
import BlocklyNiryo from './niryo_one_python_generators';
189

@@ -22,46 +13,12 @@ import BlocklyNiryo from './niryo_one_python_generators';
2213
const plugin: JupyterFrontEndPlugin<void> = {
2314
id: 'jupyterlab-niryo-one:plugin',
2415
autoStart: true,
25-
requires: [
26-
ILayoutRestorer,
27-
IRenderMimeRegistry,
28-
IEditorServices,
29-
IFileBrowserFactory,
30-
ISettingRegistry,
31-
ITranslator
32-
],
33-
optional: [ILauncher, ICommandPalette],
34-
activate: (
35-
app: JupyterFrontEnd,
36-
restorer: ILayoutRestorer,
37-
rendermime: IRenderMimeRegistry,
38-
editorServices: IEditorServices,
39-
browserFactory: IFileBrowserFactory,
40-
settings: ISettingRegistry,
41-
translator: ITranslator,
42-
launcher: ILauncher | null,
43-
palette: ICommandPalette | null
44-
) => {
16+
requires: [IBlocklyRegisty],
17+
activate: (app: JupyterFrontEnd, blockly: IBlocklyRegisty) => {
4518
console.log('JupyterLab extension jupyterlab-niryo-one is activated!');
4619

47-
// Activating the Blockly plugin.
48-
const BlocklyReturn = Blocklyplugin.activate(
49-
app,
50-
restorer,
51-
rendermime,
52-
editorServices,
53-
browserFactory,
54-
settings,
55-
translator,
56-
launcher,
57-
palette
58-
);
59-
6020
//Registering the new toolbox containing all Niryo One blocks.
61-
(BlocklyReturn as IBlocklyRegisty).registerToolbox(
62-
'niryo',
63-
BlocklyNiryo.Toolbox
64-
);
21+
blockly.registerToolbox('niryo', BlocklyNiryo.Toolbox);
6522
}
6623
};
6724

0 commit comments

Comments
 (0)