Skip to content

Jl2 #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Jl2 #47

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8,458 changes: 4,080 additions & 4,378 deletions package-lock.json

Large diffs are not rendered by default.

46 changes: 25 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jupyter-widgets/jupyterlab-sidecar",
"version": "0.4.0",
"version": "0.5.0",
"description": "A sidecar output widget for JupyterLab",
"keywords": [
"jupyter",
Expand All @@ -23,7 +23,7 @@
"scripts": {
"build": "npm run build:lib",
"build:labextension": "cd sidecar && rimraf labextension && mkdirp labextension && cd labextension && npm pack ../..",
"build:lib": "tsc",
"build:lib": "tsc --sourceMap",
"build:all": "npm run build:lib && npm run build:labextension",
"clean": "npm run clean:lib",
"clean:lib": "rimraf lib",
Expand All @@ -38,33 +38,37 @@
"watch:lib": "tsc"
},
"dependencies": {
"@jupyter-widgets/base": "^2.0.1",
"@jupyter-widgets/jupyterlab-manager": "^1.0.0",
"@jupyterlab/application": "^1.0.0"
"@jupyter-widgets/base": "^3.0.0",
"@jupyter-widgets/jupyterlab-manager": "^2.0.0",
"@jupyterlab/application": "^2.1.0",
"karma-typescript-es6-transform": "^5.0.2"
},
"devDependencies": {
"core-js": "3.6.5",
"regenerator-runtime": "0.13.5",
"@types/expect.js": "^0.3.29",
"@types/mocha": "^2.2.41",
"@types/node": "^8.0.17",
"@types/mocha": "^7.0.2",
"@types/node": "^13.11.1",
"@types/jquery": "3.3.29",
"expect.js": "^0.3.1",
"fs-extra": "^4.0.2",
"fs-extra": "^8.1.0",
"json-loader": "^0.5.7",
"karma": "^1.7.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.0.1",
"karma": "^4.1.1",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^1.3.0",
"karma-ie-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.3",
"karma-typescript": "^3.0.5",
"mkdirp": "^0.5.1",
"mocha": "^3.5.0",
"npm-run-all": "^4.1.1",
"rimraf": "^2.6.2",
"source-map-loader": "^0.2.1",
"ts-loader": "^2.3.2",
"typescript": "~3.5.2"
"karma-mocha-reporter": "^2.2.5",
"karma-typescript": "^5.0.2",
"mkdirp": "^1.0.3",
"mocha": "^7.1.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"source-map-loader": "^0.2.4",
"ts-loader": "^6.2.1",
"typescript": "~3.7.5"
},
"jupyterlab": {
"extension": "lib/plugin"
}
}
}
4 changes: 2 additions & 2 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
} from '@jupyterlab/application';

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

import {
IJupyterWidgetRegistry
Expand Down
2 changes: 1 addition & 1 deletion src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SidecarModel extends OutputModel {

initialize(attributes: any, options: any) {
super.initialize(attributes, options);
this.widget_manager.display_model(undefined, this, {});
this.widget_manager.display_model(undefined as any, this, {});
}

static serializers : any = {
Expand Down
6 changes: 6 additions & 0 deletions tests/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = function (config) {
}
},
files: [
"node_modules/regenerator-runtime/runtime.js",
{ pattern: "tests/src/**/*.ts" },
{ pattern: "src/**/*.ts" }
],
Expand All @@ -24,6 +25,11 @@ module.exports = function (config) {


karmaTypescriptConfig: {
bundlerOptions: {
transforms: [
require("karma-typescript-es6-transform")()
]
},
tsconfig: 'tests/src/tsconfig.json',
reports: {
"text-summary": "",
Expand Down
14 changes: 7 additions & 7 deletions tests/src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ import {
} from './utils.spec';

import {
ExampleModel, ExampleView
SidecarModel
} from '../../src/'


describe('Example', () => {
describe('Sidecar', () => {

describe('ExampleModel', () => {
describe('SidecarModel', () => {

it('should be createable', () => {
let model = createTestModel(ExampleModel);
expect(model).to.be.an(ExampleModel);
let model = createTestModel(SidecarModel);
expect(model).to.be.an(SidecarModel);
expect(model.get('value')).to.be('Hello World');
});

it('should be createable with a value', () => {
let state = { value: 'Foo Bar!' }
let model = createTestModel(ExampleModel, state);
expect(model).to.be.an(ExampleModel);
let model = createTestModel(SidecarModel, state);
expect(model).to.be.an(SidecarModel);
expect(model.get('value')).to.be('Foo Bar!');
});

Expand Down
2 changes: 1 addition & 1 deletion tests/src/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MockComm {
on_msg(fn: Function | null) {
this._on_msg = fn;
}
_process_msg(msg: services.KernelMessage.ICommMsg) {
_process_msg(msg: services.KernelMessage.ICommMsgMsg) {
if (this._on_msg) {
return this._on_msg(msg);
} else {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"declaration": true,
"noImplicitAny": true,
"esModuleInterop": true,
"noEmitOnError": true,
"noUnusedLocals": true,
"module": "commonjs",
Expand All @@ -11,4 +12,4 @@
"types": ["node"]
},
"include": ["src/*"]
}
}
Loading