Skip to content

Commit

Permalink
Merge pull request #508 from blink1073/jlab-2.0
Browse files Browse the repository at this point in the history
Updates for JupyterLab 2.0
  • Loading branch information
minrk committed Jan 23, 2020
2 parents 6259cd0 + ce08ccf commit 425c46d
Show file tree
Hide file tree
Showing 47 changed files with 165 additions and 185 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"private": true,
"scripts": {
"install": "lerna bootstrap --hoist",
"clean": "lerna run clean",
"build": "lerna run build",
"build:dev": "tsc --build",
"updated": "lerna updated",
"clean": "lerna run clean",
"install": "lerna bootstrap --hoist",
"publish": "npm run clean && npm run build && lerna publish -m \"Publish npm packages\"",
"test": "lerna run test",
"update:all": "update-dependency --lerna --minimal --regex .*",
"update:lab": "update-dependency --lerna --minimal --regex ^@jupyterlab/",
"update:lab:next": "update-dependency --lerna --minimal --regex ^@jupyterlab/ ^next",
"test": "lerna run test",
"publish": "npm run clean && npm run build && lerna publish -m \"Publish npm packages\"",
"updated": "lerna updated",
"watch": "tsc --build --watch"
},
"devDependencies": {
"@jupyterlab/buildutils": "^2.0.0-beta.2",
"lerna": "^3.14.1",
"rimraf": "^2.6.3",
"@jupyterlab/buildutils": "^1.0.0"
"rimraf": "^2.6.3"
}
}
28 changes: 15 additions & 13 deletions packages/labextension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,26 @@
"watch": "tsc --build --watch"
},
"dependencies": {
"@jupyterlab/apputils": "^1.0.0",
"@jupyterlab/coreutils": "^3.0.0",
"@jupyterlab/notebook": "^1.0.0",
"@jupyterlab/rendermime": "^1.0.0",
"@jupyterlab/services": "^4.0.0",
"@phosphor/algorithm": "^1.1.2",
"@phosphor/coreutils": "^1.3.0",
"@phosphor/disposable": "^1.1.2",
"@phosphor/widgets": "^1.6.0",
"@jupyterlab/apputils": "^2.0.0-beta.2",
"@jupyterlab/coreutils": "^4.0.0-beta.2",
"@jupyterlab/nbformat": "^2.0.0-beta.2",
"@jupyterlab/notebook": "^2.0.0-beta.2",
"@jupyterlab/rendermime": "^2.0.0-beta.2",
"@jupyterlab/services": "^5.0.0-beta.2",
"@jupyterlab/settingregistry": "^2.0.0-beta.2",
"@lumino/algorithm": "^1.1.2",
"@lumino/coreutils": "^1.3.0",
"@lumino/disposable": "^1.1.2",
"@lumino/widgets": "^1.6.0",
"nbdime": "^5.0.0"
},
"devDependencies": {
"@jupyterlab/application": "^1.0.0",
"@jupyterlab/docregistry": "^1.0.0",
"@phosphor/commands": "^1.6.1",
"@jupyterlab/application": "^2.0.0-beta.2",
"@jupyterlab/docregistry": "^2.0.0-beta.2",
"@lumino/commands": "^1.6.1",
"mkdirp": "^0.5.1",
"rimraf": "^2.6.3",
"typescript": "^3.5.2"
"typescript": "^3.7.2"
},
"jupyterlab": {
"extension": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/labextension/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {

import {
Widget
} from '@phosphor/widgets';
} from '@lumino/widgets';

import {
NbdimeWidget
Expand Down
12 changes: 8 additions & 4 deletions packages/labextension/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@jupyterlab/apputils';

import {
PathExt, ISettingRegistry
PathExt
} from '@jupyterlab/coreutils';

import {
Expand All @@ -30,17 +30,21 @@ import {
NotebookPanel, INotebookTracker
} from '@jupyterlab/notebook';

import {
ISettingRegistry
} from '@jupyterlab/settingregistry';

import {
find
} from '@phosphor/algorithm';
} from '@lumino/algorithm';

import {
CommandRegistry
} from '@phosphor/commands';
} from '@lumino/commands';

import {
IDisposable, DisposableDelegate
} from '@phosphor/disposable';
} from '@lumino/disposable';

import {
diffNotebookGit, diffNotebook, diffNotebookCheckpoint, isNbInGit
Expand Down
10 changes: 4 additions & 6 deletions packages/labextension/src/widget.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@


import {
nbformat
} from '@jupyterlab/coreutils';
import * as nbformat from '@jupyterlab/nbformat';

import {
IRenderMimeRegistry
Expand All @@ -14,15 +12,15 @@ import {

import {
JSONObject
} from '@phosphor/coreutils';
} from '@lumino/coreutils';

import {
Message
} from '@phosphor/messaging';
} from '@lumino/messaging';

import {
Widget, Panel
} from '@phosphor/widgets';
} from '@lumino/widgets';

import {
IDiffEntry
Expand Down
29 changes: 15 additions & 14 deletions packages/nbdime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@
"watch": "tsc --build --watch"
},
"dependencies": {
"@jupyterlab/codeeditor": "^1.0.0",
"@jupyterlab/codemirror": "^1.0.0",
"@jupyterlab/coreutils": "^3.0.0",
"@jupyterlab/outputarea": "^1.0.0",
"@jupyterlab/rendermime": "^1.0.0",
"@jupyterlab/services": "^4.0.0",
"@phosphor/algorithm": "^1.1.2",
"@phosphor/coreutils": "^1.3.0",
"@phosphor/dragdrop": "^1.3.0",
"@phosphor/signaling": "^1.2.2",
"@phosphor/widgets": "^1.6.0",
"@jupyterlab/codeeditor": "^2.0.0-beta.2",
"@jupyterlab/codemirror": "^2.0.0-beta.2",
"@jupyterlab/coreutils": "^4.0.0-beta.2",
"@jupyterlab/nbformat": "^2.0.0-beta.2",
"@jupyterlab/outputarea": "^2.0.0-beta.2",
"@jupyterlab/rendermime": "^2.0.0-beta.2",
"@jupyterlab/services": "^5.0.0-beta.2",
"@lumino/algorithm": "^1.1.2",
"@lumino/coreutils": "^1.3.0",
"@lumino/dragdrop": "^1.3.0",
"@lumino/signaling": "^1.2.2",
"@lumino/widgets": "^1.6.0",
"json-stable-stringify": "^1.0.1"
},
"devDependencies": {
"@jupyterlab/apputils": "^1.0.0",
"@phosphor/messaging": "^1.2.2",
"@jupyterlab/apputils": "^2.0.0-beta.2",
"@lumino/messaging": "^1.2.2",
"@types/expect.js": "^0.3.29",
"@types/json-stable-stringify": "^1.0.32",
"@types/mocha": "^5.2.6",
Expand All @@ -56,7 +57,7 @@
"karma-typescript-es6-transform": "^4.0.0",
"mocha": "^6.0.2",
"rimraf": "^2.6.3",
"typescript": "^3.5.2"
"typescript": "^3.7.2"
},
"peerDependencies": {
"codemirror": "^5.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/nbdime/src/common/collapsiblepanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import {
Widget, Panel
} from '@phosphor/widgets';
} from '@lumino/widgets';

const COLLAPSIBLE_CLASS = 'jp-CollapsiblePanel';
const COLLAPSIBLE_HEADER = 'jp-CollapsiblePanel-header';
Expand Down
8 changes: 4 additions & 4 deletions packages/nbdime/src/common/dragpanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

import {
Panel, PanelLayout, Widget
} from '@phosphor/widgets';
} from '@lumino/widgets';

import {
Message
} from '@phosphor/messaging';
} from '@lumino/messaging';

import {
MimeData
} from '@phosphor/coreutils';
} from '@lumino/coreutils';

import {
Drag, IDragEvent, DropAction, SupportedActions
} from '@phosphor/dragdrop';
} from '@lumino/dragdrop';


/**
Expand Down
2 changes: 1 addition & 1 deletion packages/nbdime/src/common/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import {
Widget
} from '@phosphor/widgets';
} from '@lumino/widgets';

import {
CodeEditorWrapper, CodeEditor
Expand Down
2 changes: 1 addition & 1 deletion packages/nbdime/src/common/mergeview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as CodeMirror from 'codemirror';

import {
Widget, Panel
} from '@phosphor/widgets';
} from '@lumino/widgets';

import {
IStringDiffModel
Expand Down
6 changes: 2 additions & 4 deletions packages/nbdime/src/diff/model/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
// Distributed under the terms of the Modified BSD License.
'use strict';

import {
nbformat
} from '@jupyterlab/coreutils';
import * as nbformat from '@jupyterlab/nbformat';

import {
JSONObject
} from '@phosphor/coreutils';
} from '@lumino/coreutils';

import {
NotifyUserError
Expand Down
4 changes: 1 addition & 3 deletions packages/nbdime/src/diff/model/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// Distributed under the terms of the Modified BSD License.
'use strict';

import {
nbformat
} from '@jupyterlab/coreutils';
import * as nbformat from '@jupyterlab/nbformat';

import {
IDiffEntry, IDiffArrayEntry
Expand Down
4 changes: 1 addition & 3 deletions packages/nbdime/src/diff/model/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// Distributed under the terms of the Modified BSD License.
'use strict';

import {
nbformat
} from '@jupyterlab/coreutils';
import * as nbformat from '@jupyterlab/nbformat';

import {
NotifyUserError
Expand Down
14 changes: 8 additions & 6 deletions packages/nbdime/src/diff/model/renderable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
'use strict';

import {
JSONValue, JSONObject, JSONArray
} from '@phosphor/coreutils';
JSONValue, JSONObject, JSONExt, JSONArray, PartialJSONValue
} from '@lumino/coreutils';

import {
Signal
} from '@phosphor/signaling';
} from '@lumino/signaling';

import {
IDiffEntry
Expand Down Expand Up @@ -40,7 +40,7 @@ import {
* make the model from.
*/
export
abstract class RenderableDiffModel<T extends JSONValue> implements IDiffModel {
abstract class RenderableDiffModel<T extends (JSONValue | PartialJSONValue)> implements IDiffModel {
constructor(
base: T | null,
remote: T | null,
Expand Down Expand Up @@ -106,8 +106,10 @@ abstract class RenderableDiffModel<T extends JSONValue> implements IDiffModel {
}
return (obj as JSONObject)[key];
};
let base = key ? getMemberByPath(this.base, key) : this.base;
let remote = key ? getMemberByPath(this.remote, key) : this.remote;
const baseCopy = JSONExt.deepCopy(this.base) as JSONObject;
let base = key ? getMemberByPath(baseCopy, key) : baseCopy;
const remoteCopy = JSONExt.deepCopy(this.base) as JSONObject;
let remote = key ? getMemberByPath(remoteCopy, key) : remoteCopy;
let diff = (this.diff && key) ?
getMemberByPath(this.diff as any, key, getSubDiffByKey) as IDiffEntry[] | null :
this.diff;
Expand Down
15 changes: 7 additions & 8 deletions packages/nbdime/src/diff/model/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
// Distributed under the terms of the Modified BSD License.
'use strict';

import {
nbformat
} from '@jupyterlab/coreutils';
import * as nbformat from '@jupyterlab/nbformat';

import {
JSONObject, JSONArray, JSONValue
} from '@phosphor/coreutils';
JSONObject, JSONArray, JSONExt, JSONValue, PartialJSONObject
} from '@lumino/coreutils';

import {
IDiffEntry
Expand Down Expand Up @@ -333,10 +331,11 @@ namespace StringDiffModel {
* rules.
*/
export
function createPatchStringDiffModel(base: string | JSONObject | JSONArray, diff: IDiffEntry[]) : StringDiffModel {
function createPatchStringDiffModel(base: string | JSONObject | JSONArray | PartialJSONObject, diff: IDiffEntry[]) : StringDiffModel {
console.assert(!!diff, 'Patch model needs diff.');
let baseStr = stringifyAndBlankNull(base);
let out = patchStringified(base, diff);
const baseCopy = JSONExt.deepCopy(base) as JSONObject
let baseStr = stringifyAndBlankNull(baseCopy);
let out = patchStringified(baseCopy, diff);
return new StringDiffModel(baseStr, out.remote, out.additions, out.deletions);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/nbdime/src/diff/widget/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import {
Panel, Widget
} from '@phosphor/widgets';
} from '@lumino/widgets';

import {
IRenderMimeRegistry, MimeModel
Expand Down
2 changes: 1 addition & 1 deletion packages/nbdime/src/diff/widget/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import {
Panel, Widget
} from '@phosphor/widgets';
} from '@lumino/widgets';

import {
createNbdimeMergeView
Expand Down
2 changes: 1 addition & 1 deletion packages/nbdime/src/diff/widget/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import {
Panel
} from '@phosphor/widgets';
} from '@lumino/widgets';

import {
IRenderMimeRegistry
Expand Down
8 changes: 3 additions & 5 deletions packages/nbdime/src/diff/widget/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
// Distributed under the terms of the Modified BSD License.
'use strict';

import {
nbformat
} from '@jupyterlab/coreutils';
import * as nbformat from '@jupyterlab/nbformat';

import {
Panel, Widget
} from '@phosphor/widgets';
} from '@lumino/widgets';

import {
each, find, toArray
} from '@phosphor/algorithm';
} from '@lumino/algorithm';

import {
IRenderMimeRegistry, OutputModel, IRenderMime
Expand Down

0 comments on commit 425c46d

Please sign in to comment.