Skip to content

Commit 9b437b1

Browse files
committed
chore: enable all extensions
1 parent 50da5e5 commit 9b437b1

File tree

34 files changed

+199
-116
lines changed

34 files changed

+199
-116
lines changed

.eslintignore

-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ tests
66

77
**/__tests__
88
ui-tests
9-
10-
# TODO enable eslint on source.
11-
src/**

examples/ipywidgets.ipynb

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 2,
6+
"id": "b0b29d63-8f43-4359-9301-8b5e2a57a0dc",
7+
"metadata": {},
8+
"outputs": [
9+
{
10+
"data": {
11+
"application/vnd.jupyter.widget-view+json": {
12+
"model_id": "3c3ff6314ce0430cb401b46aef474af4",
13+
"version_major": 2,
14+
"version_minor": 0
15+
},
16+
"text/plain": [
17+
"Dropdown(description='Number:', index=1, options=('1', '2', '3'), value='2')"
18+
]
19+
},
20+
"execution_count": 2,
21+
"metadata": {},
22+
"output_type": "execute_result"
23+
}
24+
],
25+
"source": [
26+
"import IPython\n",
27+
"import ipywidgets as widgets\n",
28+
"widgets.Dropdown(\n",
29+
" options=['1', '2', '3'],\n",
30+
" value='2',\n",
31+
" description='Number:',\n",
32+
" disabled=False,\n",
33+
")"
34+
]
35+
},
36+
{
37+
"cell_type": "code",
38+
"execution_count": null,
39+
"id": "863a71c0-99d0-4fa1-8fbc-89897e3a3ce1",
40+
"metadata": {},
41+
"outputs": [],
42+
"source": []
43+
}
44+
],
45+
"metadata": {
46+
"kernelspec": {
47+
"display_name": "Python 3 (ipykernel)",
48+
"language": "python",
49+
"name": "python3"
50+
},
51+
"language_info": {
52+
"codemirror_mode": {
53+
"name": "ipython",
54+
"version": 3
55+
},
56+
"file_extension": ".py",
57+
"mimetype": "text/x-python",
58+
"name": "python",
59+
"nbconvert_exporter": "python",
60+
"pygments_lexer": "ipython3",
61+
"version": "3.9.13"
62+
}
63+
},
64+
"nbformat": 4,
65+
"nbformat_minor": 5
66+
}

examples/python.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print('Hello python")

examples/table.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
],
4646
"metadata": {
4747
"kernelspec": {
48-
"display_name": "Python 3",
48+
"display_name": "Python 3 (ipykernel)",
4949
"language": "python",
5050
"name": "python3"
5151
},
@@ -59,7 +59,7 @@
5959
"name": "python",
6060
"nbconvert_exporter": "python",
6161
"pygments_lexer": "ipython3",
62-
"version": "3.8.6"
62+
"version": "3.9.13"
6363
}
6464
},
6565
"nbformat": 4,

examples/tmp.ipynb

+4-22
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
11
{
2-
"cells": [
3-
{
4-
"cell_type": "code",
5-
"execution_count": null,
6-
"metadata": {},
7-
"outputs": [],
8-
"source": []
9-
}
10-
],
2+
"cells": [],
113
"metadata": {
124
"kernelspec": {
13-
"display_name": "Python 3 (ipykernel)",
14-
"language": "python",
15-
"name": "python3"
5+
"display_name": "",
6+
"name": ""
167
},
178
"language_info": {
18-
"codemirror_mode": {
19-
"name": "ipython",
20-
"version": 3
21-
},
22-
"file_extension": ".py",
23-
"mimetype": "text/x-python",
24-
"name": "python",
25-
"nbconvert_exporter": "python",
26-
"pygments_lexer": "ipython3",
27-
"version": "3.8.10"
9+
"name": ""
2810
}
2911
},
3012
"nbformat": 4,

examples/untitled.py

Whitespace-only changes.

examples/untitled1.py

Whitespace-only changes.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"@jupyter-widgets/base": "6.0.1",
8484
"@jupyterlab/builder": "^3.1.0",
8585
"@jupyterlab/testutils": "^3.1.0",
86+
"@types/fixed-data-table-2": "0.8.8",
8687
"@types/jest": "^26.0.0",
8788
"@types/react-sparklines": "1.7.2",
8889
"@types/node": "18.7.18",

schema/kernel-memory.json

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
"title": "Kernel Memory",
33
"description": "Kernel Memory",
44
"properties": {
5+
"memor": {
6+
"title": "Memory",
7+
"description": "Memory",
8+
"default": 1000,
9+
"type": "number"
10+
}
511
},
612
"additionalProperties": false,
713
"type": "object"

src/architecture/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import {
22
JupyterFrontEnd,
33
JupyterFrontEndPlugin
44
} from '@jupyterlab/application';
5+
56
import { IDocumentManager } from '@jupyterlab/docmanager';
7+
68
import { DocumentRegistry } from '@jupyterlab/docregistry';
79

810
const architecture: JupyterFrontEndPlugin<void> = {
9-
id: 'jupyterlabextensions-architecture:plugin',
11+
id: 'jupyterlabextensions:architecture:plugin',
1012
autoStart: true,
1113
requires: [ IDocumentManager],
1214
activate: (
@@ -15,20 +17,24 @@ const architecture: JupyterFrontEndPlugin<void> = {
1517
) => {
1618
const fileTypes = docManager.registry.fileTypes();
1719
let ft: DocumentRegistry.IFileType;
20+
// eslint-disable-next-line no-cond-assign
1821
while (ft = fileTypes.next()) {
1922
console.log('fileType', ft, ft.mimeTypes, docManager.registry.defaultWidgetFactory('test.' + ft.extensions[0]));
2023
}
2124
const modelFactories = docManager.registry.modelFactories();
2225
let mf: DocumentRegistry.IModelFactory<any>;
26+
// eslint-disable-next-line no-cond-assign
2327
while (mf = modelFactories.next()) {
2428
console.log('modelFactory', mf);
2529
}
2630
const widgetFactories = docManager.registry.widgetFactories();
2731
let wf: DocumentRegistry.WidgetFactory;
32+
// eslint-disable-next-line no-cond-assign
2833
while (wf = widgetFactories.next()) {
2934
console.log('widgetFactory', wf, wf.fileTypes);
3035
const widgetExtensions = docManager.registry.widgetExtensions(wf.name);
3136
let we: DocumentRegistry.WidgetExtension;
37+
// eslint-disable-next-line no-cond-assign
3238
while (we = widgetExtensions.next()) {
3339
console.log('--- widgetExtension', we);
3440
}

src/auto-create/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import {
22
JupyterFrontEnd,
33
JupyterFrontEndPlugin
4-
} from "@jupyterlab/application";
4+
} from '@jupyterlab/application';
55

66
import { IDocumentManager } from '@jupyterlab/docmanager';
77

8-
import { INotebookTracker } from "@jupyterlab/notebook";
8+
import { INotebookTracker } from '@jupyterlab/notebook';
99

1010
/**
1111
* Initialization for the autoCreate extension.
1212
*/
1313
const autoCreate: JupyterFrontEndPlugin<void> = {
14-
id: "@datalayer-examples/auto-create",
14+
id: 'jupyterlabextensions:auto-create',
1515
autoStart: true,
1616
requires: [INotebookTracker, IDocumentManager],
1717
activate: (

src/cell-flash/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const PLUGIN_ID = 'jupyterlabextensions';
1313
* Initialization data for the jupyterlab-cell-flash extension.
1414
*/
1515
const cellFlash: JupyterFrontEndPlugin<void> = {
16-
id: 'jupyterlab-cell-flash:plugin',
16+
id: 'jupyterlabextensions:cell-flash',
1717
autoStart: true,
1818
optional: [ISettingRegistry],
1919
activate: async (app: JupyterFrontEnd, settingRegistry: ISettingRegistry) => {

src/certificate/index.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
2+
23
import { JSONObject } from '@lumino/coreutils';
4+
35
import { Widget } from '@lumino/widgets';
46

57
/**
@@ -30,10 +32,10 @@ export class OutputWidget extends Widget implements IRenderMime.IRenderer {
3032
*/
3133
renderModel(model: IRenderMime.IMimeModel): Promise<void> {
3234

33-
let data = model.data[this._mimeType] as JSONObject;
35+
const data = model.data[this._mimeType] as JSONObject;
3436
// this.node.textContent = JSON.stringify(data);
35-
let given = data['given'];
36-
let event = data['event'];
37+
const given = data['given'];
38+
const event = data['event'];
3739
this.node.innerHTML = `
3840
<div class="certificate">
3941
<div class="paper">
@@ -66,7 +68,7 @@ export const rendererFactory: IRenderMime.IRendererFactory = {
6668
* Extension definition.
6769
*/
6870
const certificate: IRenderMime.IExtension = {
69-
id: '@datalayer-examples/jlab3-rendermime-certificate:plugin',
71+
id: 'jupyterlabextensions:rendermime-certificate:plugin',
7072
rendererFactory,
7173
rank: 0,
7274
dataType: 'json',

src/christmas-theme/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import {
66
import { IThemeManager } from '@jupyterlab/apputils';
77

88
/**
9-
* Initialization data for the jupyterlabextensions extension.
9+
* Initialization data for the christmas theme extension.
1010
*/
1111
const christmasTheme: JupyterFrontEndPlugin<void> = {
12-
id: 'jupyterlabextensions',
12+
id: 'jupyterlabextensions:theme:christmas-tree',
1313
requires: [IThemeManager],
1414
autoStart: true,
1515
activate: (app: JupyterFrontEnd, themeManager: IThemeManager) => {

src/codecell-btn/index.tsx

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
import React from 'react';
2+
23
import { ReactWidget } from '@jupyterlab/apputils';
3-
import { JupyterFrontEnd, JupyterFrontEndPlugin } from '@jupyterlab/application';
4-
import { INotebookTracker, NotebookPanel, NotebookActions } from '@jupyterlab/notebook';
4+
5+
import {
6+
JupyterFrontEnd,
7+
JupyterFrontEndPlugin
8+
} from '@jupyterlab/application';
9+
10+
import {
11+
INotebookTracker,
12+
NotebookPanel,
13+
NotebookActions
14+
} from '@jupyterlab/notebook';
15+
516
import { ICellFooter, Cell } from '@jupyterlab/cells';
17+
618
import { ReadonlyPartialJSONObject } from '@lumino/coreutils';
19+
720
import { CommandRegistry } from '@lumino/commands';
21+
822
import { IEditorServices } from '@jupyterlab/codeeditor';
923

1024
/**
@@ -27,7 +41,7 @@ export class CellFooterWithButton extends ReactWidget implements ICellFooter {
2741
this.commands = commands;
2842
this.addClass(CELL_FOOTER_CLASS);
2943
}
30-
render() {
44+
render(): JSX.Element {
3145
return (
3246
<div className={CELL_FOOTER_DIV_CLASS}>
3347
<button
@@ -67,7 +81,7 @@ export class ContentFactoryWithFooterButton extends NotebookPanel.ContentFactory
6781
* The footer button extension for the code cell.
6882
*/
6983
export const footerButtonExtension: JupyterFrontEndPlugin<void> = {
70-
id: 'jupyterlab-cellcodebtn',
84+
id: 'jupyterlabextensions:cell-code-btn',
7185
autoStart: true,
7286
requires: [INotebookTracker],
7387
activate(
@@ -111,7 +125,7 @@ export const footerButtonExtension: JupyterFrontEndPlugin<void> = {
111125
* The notebook cell factory.
112126
*/
113127
export const cellFactory: JupyterFrontEndPlugin<NotebookPanel.IContentFactory> = {
114-
id: 'jupyterlab-cellcodebtn:factory',
128+
id: 'jupyterlabextensions:cellcodebtn:factory',
115129
requires: [IEditorServices],
116130
provides: NotebookPanel.IContentFactory,
117131
autoStart: true,

src/context-menu/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import { showDialog, Dialog } from '@jupyterlab/apputils';
99

1010
import { buildIcon, runIcon } from '@jupyterlab/ui-components';
1111

12-
const COMMAND_ID = '@datalayer-examples/context-menu:open';
12+
const COMMAND_ID = 'jupyterlabextensions/context-menu:open';
1313

1414
const contextMenu: JupyterFrontEndPlugin<void> = {
15-
id: '@datalayer-examples/context-menu',
15+
id: 'jupyterlabextensions:context-menu',
1616
autoStart: true,
1717
requires: [IFileBrowserFactory],
1818
optional: [],

src/exec-time/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ExecuteTimeWidgetExtension implements DocumentRegistry.WidgetExtension {
3333
* Initialization data for the extension.
3434
*/
3535
const execTime: JupyterFrontEndPlugin<void> = {
36-
id: 'exec-time',
36+
id: 'jupyterlabextensions:exec-time',
3737
autoStart: true,
3838
requires: [INotebookTracker, ISettingRegistry],
3939
activate: (

src/exec-time/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { differenceInMilliseconds, format } from 'date-fns';
22

3-
export const getTimeString = (date: Date) => {
3+
export const getTimeString = (date: Date): string => {
44
return format(date, 'yyy-MM-dd HH:mm:ss');
55
};
66

77
/*
88
* Human format based on loosely on ideas from:
99
* https://github.com/ipython-contrib/jupyter_contrib_nbextensions/blob/master/src/jupyter_contrib_nbextensions/nbextensions/execute_time/ExecuteTime.js#L194
1010
*/
11-
export const getTimeDiff = (end: Date, start: Date) => {
11+
export const getTimeDiff = (end: Date, start: Date): string => {
1212

1313
const MS_IN_SEC = 1000;
1414
const MS_IN_MIN = 60 * MS_IN_SEC;

src/extensions.ts

-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import architecture from './architecture';
2-
/*
32
import autoCreate from './auto-create';
43
import cellFlash from './cell-flash';
54
import christmasTheme from './christmas-theme';
@@ -18,9 +17,7 @@ import runAll from './run-all';
1817
import themeToggle from './themetoggle';
1918
import server from './server';
2019
import topBar from './topbar';
21-
*/
2220
import '../style/index.css';
23-
/*
2421
export default [
2522
architecture,
2623
autoCreate,
@@ -42,7 +39,3 @@ export default [
4239
themeToggle,
4340
topBar,
4441
];
45-
*/
46-
export default [
47-
architecture,
48-
];

0 commit comments

Comments
 (0)