Skip to content

Commit 29a2e8f

Browse files
authored
Merge pull request #146 from jcoady/master
Added support for JupyterLab 2
2 parents c772c25 + 06dd941 commit 29a2e8f

File tree

3 files changed

+28
-23
lines changed

3 files changed

+28
-23
lines changed

labextension/vpython/package.json

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vpython",
3-
"version": "1.0.0",
4-
"description": "VPython extension for Jupyterlab",
3+
"version": "2.0.1",
4+
"description": "VPython extension for JupyterLab",
55
"keywords": [
66
"jupyter",
77
"jupyterlab",
@@ -20,33 +20,38 @@
2020
"vpython_libraries/*"
2121
],
2222
"main": "lib/index.js",
23-
"typings": "lib/index.d.ts",
23+
"types": "lib/index.d.ts",
2424
"style": "style/index.css",
2525
"repository": {
2626
"type": "git",
2727
"url": ""
2828
},
2929
"scripts": {
3030
"build": "tsc",
31-
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
32-
"prepare": "npm run clean && npm run build",
31+
"clean": "rimraf lib tsconfig.tsbuildinfo",
32+
"eslint": "eslint . --ext .ts,.tsx --fix",
33+
"eslint:check": "eslint . --ext .ts,.tsx",
34+
"prepare": "jlpm run clean && jlpm run build",
3335
"watch": "tsc -w"
3436
},
3537
"dependencies": {
36-
"@jupyterlab/application": "^1.2.1",
37-
"@jupyterlab/apputils": "^1.2.1",
38-
"@jupyterlab/coreutils": "^3.2.0",
39-
"@jupyterlab/docregistry": "^1.2.1",
40-
"@jupyterlab/notebook": "^1.2.2",
41-
"@phosphor/disposable": "^1.3.1",
38+
"@jupyterlab/application": "^2.1.2",
39+
"@jupyterlab/apputils": "^2.1.1",
40+
"@jupyterlab/coreutils": "^4.1.0",
41+
"@jupyterlab/docregistry": "^2.1.2",
42+
"@jupyterlab/notebook": "^2.1.2",
43+
"@lumino/disposable": "^1.4.0",
4244
"script-loader": "^0.7.2"
4345
},
4446
"devDependencies": {
45-
"file-loader": "^4.2.0",
46-
"webpack": "^4.0.0",
47-
"@babel/types": "^7.6.1",
47+
"@typescript-eslint/eslint-plugin": "^2.25.0",
48+
"@typescript-eslint/parser": "^2.25.0",
49+
"eslint": "^6.8.0",
50+
"eslint-config-prettier": "^6.10.1",
51+
"eslint-plugin-prettier": "^3.1.2",
52+
"prettier": "1.16.4",
4853
"rimraf": "^2.6.1",
49-
"typescript": "^3.6.3"
54+
"typescript": "~3.7.0"
5055
},
5156
"sideEffects": [
5257
"style/*.css"

labextension/vpython/src/glowcommlab.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ export function setupWebsocket(msg,serviceUrl) {
8383
wscheckfontsloaded(msg,serviceUrl)
8484
}
8585

86-
var datadir = './static/lab/vpython_data/'
87-
window.Jupyter_VPython = "./static/lab/vpython_data/" // prefix used by glow.min.js for textures
86+
var datadir = '/static/lab/vpython_data/'
87+
window.Jupyter_VPython = "/static/lab/vpython_data/" // prefix used by glow.min.js for textures
8888

8989
function fontloading() {
9090
"use strict";

labextension/vpython/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
22
IDisposable, DisposableDelegate
3-
} from '@phosphor/disposable';
3+
} from '@lumino/disposable';
44

55
import {
66
JupyterFrontEnd, JupyterFrontEndPlugin
@@ -35,13 +35,13 @@ class VPythonExtension implements DocumentRegistry.IWidgetExtension<NotebookPane
3535
*/
3636
createNew(panel: NotebookPanel, context: DocumentRegistry.IContext<INotebookModel>): IDisposable {
3737

38-
Promise.all([panel.revealed, panel.session.ready, context.ready]).then(function() {
39-
const session = context.session;
38+
Promise.all([panel.revealed, panel.sessionContext.ready, context.ready]).then(function() {
39+
const session = context.sessionContext.session;
4040
const kernelInstance = session.kernel;
4141
(<any>window).JLab_VPython = true;
4242

43-
try {
44-
kernelInstance.registerCommTarget('glow', (vp_comm, commMsg) => {
43+
try {
44+
kernelInstance.registerCommTarget('glow', (vp_comm: any, commMsg: any) => {
4545
// Use Dynamic import() Expression to import glowcomm when comm is opened
4646
import("./glowcommlab").then(glowcommlab => {
4747
glowcommlab.comm = vp_comm
@@ -56,7 +56,7 @@ class VPythonExtension implements DocumentRegistry.IWidgetExtension<NotebookPane
5656
glowcommlab.setupWebsocket(commMsg, serviceUrl)
5757
});
5858

59-
vp_comm.onClose = (msg) => {console.log("comm onClose");};
59+
vp_comm.onClose = (msg: any) => {console.log("comm onClose");};
6060
});
6161
}
6262
catch(err) {

0 commit comments

Comments
 (0)