From f0b6b6a83f96058d9b6dd24f31299a5a88cf6b1b Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Wed, 3 Jul 2019 14:58:02 +0200 Subject: [PATCH] update for jupyterlab 1.0.0 --- .gitignore | 1 + package.json | 20 ++++++++++---------- src/index.ts | 10 +++++----- tsconfig.json | 11 +++++++---- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 6c9266e..e4a2702 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ lib/ node_modules/ *.egg-info/ .ipynb_checkpoints +tsconfig.tsbuildinfo \ No newline at end of file diff --git a/package.json b/package.json index 88b8fe3..e0deef7 100644 --- a/package.json +++ b/package.json @@ -26,23 +26,23 @@ }, "scripts": { "build": "node scripts/copyfiles.js && tsc", - "clean": "rimraf lib", + "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", "watch": "tsc -w", "prepublish": "npm run clean && npm run build" }, "dependencies": { - "@jupyterlab/application": "^0.19.1", - "@jupyterlab/apputils": "^0.19.1", - "@jupyterlab/coreutils": "^2.0.2", - "@jupyterlab/docregistry": "^0.19.1", - "@jupyterlab/filebrowser": "^0.19.1", - "@jupyterlab/launcher": "^0.19.1", - "@jupyterlab/mainmenu": "^0.8.1" + "@jupyterlab/application": "^1.0.0", + "@jupyterlab/apputils": "^1.0.0", + "@jupyterlab/coreutils": "^3.0.0", + "@jupyterlab/docregistry": "^1.0.0", + "@jupyterlab/filebrowser": "^1.0.0", + "@jupyterlab/launcher": "^1.0.0", + "@jupyterlab/mainmenu": "^1.0.0" }, "devDependencies": { "rimraf": "^2.6.1", - "typescript": "~3.1.1", - "fs-extra": "^0.30.0", + "typescript": "~3.5.2", + "fs-extra": "^8.1.0", "@phosphor/messaging": "^1.1.0" }, "jupyterlab": { diff --git a/src/index.ts b/src/index.ts index efe01e2..710ba4c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,11 +13,11 @@ // limitations under the License. import { - ILayoutRestorer, JupyterLab, JupyterLabPlugin + ILayoutRestorer, JupyterLab, JupyterFrontEndPlugin } from '@jupyterlab/application'; import { - ICommandPalette, InstanceTracker, IInstanceTracker + ICommandPalette, WidgetTracker, IWidgetTracker } from '@jupyterlab/apputils'; import { @@ -45,7 +45,7 @@ import { */ const FACTORY = 'Drawio'; -interface IDrawioTracker extends IInstanceTracker {} +interface IDrawioTracker extends IWidgetTracker {} export const IDrawioTracker = new Token('drawio/tracki'); @@ -53,7 +53,7 @@ const IDrawioTracker = new Token('drawio/tracki'); /** * The editor tracker extension. */ -const plugin: JupyterLabPlugin = { +const plugin: JupyterFrontEndPlugin = { activate, id: '@jupyterlab/drawio-extension:plugin', requires: [IFileBrowserFactory, ILayoutRestorer, IMainMenu, ICommandPalette], @@ -74,7 +74,7 @@ function activate(app: JupyterLab, const namespace = 'drawio'; const factory = new DrawioFactory({ name: FACTORY, fileTypes: ['dio'], defaultFor: ['dio'] }); const { commands } = app; - const tracker = new InstanceTracker({ namespace }); + const tracker = new WidgetTracker({ namespace }); /** * Whether there is an active DrawIO editor. diff --git a/tsconfig.json b/tsconfig.json index 14443b8..c7f690b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,12 +5,15 @@ "noEmitOnError": true, "noUnusedLocals": true, "allowJs": true, - "module": "commonjs", + "module": "esnext", + "esModuleInterop": true, + "incremental": true, + "jsx": "react", "moduleResolution": "node", - "target": "ES2015", + "target": "es2017", "outDir": "./lib", - "lib": ["ES2015", "ES2015.Promise", "DOM", "ES2015.Collection"], - "types": [] + "types": [], + "rootDir": "./src" }, "include": ["src/*"] }