Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit dc48776

Browse files
Fix build issues
1 parent 98b9a8d commit dc48776

File tree

7 files changed

+39
-39
lines changed

7 files changed

+39
-39
lines changed

packages/dataregistry-csvviewer-extension/src/data_grid.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
BasicKeyHandler,
1111
BasicMouseHandler,
1212
BasicSelectionModel,
13-
DataGrid
13+
DataGrid,
1414
} from '@lumino/datagrid';
1515
import { Message } from '@lumino/messaging';
1616
import { DSVModel } from '@jupyterlab/csvviewer';
@@ -63,7 +63,7 @@ class CSVDataGrid extends DataGrid {
6363
self.keyHandler = new BasicKeyHandler();
6464
self.mouseHandler = new BasicMouseHandler();
6565
self.selectionModel = new BasicSelectionModel({
66-
dataModel: self.dataModel
66+
dataModel: self.dataModel,
6767
});
6868
}
6969
}

packages/dataregistry-extension/src/active.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function getURL_(
8282
}
8383
const context = docManager.contextForWidget(widget);
8484
if (context) {
85-
return new URL(context.session.path, 'file:').toString();
85+
return new URL(context.path, 'file:').toString();
8686
}
8787
if (hasURL_(widget)) {
8888
return widget.url;

packages/dataregistry-extension/src/browser.tsx

+15-15
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ import {
1010
ILayoutRestorer,
1111
JupyterFrontEnd,
1212
JupyterFrontEndPlugin,
13-
ILabShell
13+
ILabShell,
1414
} from '@jupyterlab/application';
1515
import { ReactWidget } from '@jupyterlab/apputils';
1616
import {
1717
Registry,
1818
relativeNestedDataType,
1919
nestedDataType,
20-
URL_
20+
URL_,
2121
} from '@jupyterlab/dataregistry';
2222
import { IRegistry } from '@jupyterlab/dataregistry-registry-extension';
2323
import { Widget } from '@lumino/widgets';
2424
import { widgetDataType, reactDataType } from './widgets';
2525
import { IActiveDataset } from '.';
26-
import { luminoWidget } from './utils';
26+
import { LuminoWidget } from './utils';
2727
import { Observable } from 'rxjs';
2828

2929
function InnerBrowser({ registry, url }: { registry: Registry; url: URL_ }) {
@@ -56,9 +56,9 @@ function InnerBrowser({ registry, url }: { registry: Registry; url: URL_ }) {
5656
React.useEffect(() => {
5757
if (children$) {
5858
const subscription = children$.subscribe({
59-
next: value => {
59+
next: (value) => {
6060
setChildren([...value]);
61-
}
61+
},
6262
});
6363
return () => subscription.unsubscribe();
6464
}
@@ -81,7 +81,7 @@ function InnerBrowser({ registry, url }: { registry: Registry; url: URL_ }) {
8181
for (const child of children) {
8282
options.set(`child-${child}`, {
8383
value: child,
84-
type: 'child'
84+
type: 'child',
8585
});
8686
}
8787

@@ -104,14 +104,14 @@ function InnerBrowser({ registry, url }: { registry: Registry; url: URL_ }) {
104104
const widgetCreator = widgets.get(name);
105105
return (
106106
components.get(name) ||
107-
(widgetCreator && <luminoWidget widget={widgetCreator()} />)
107+
(widgetCreator && <LuminoWidget widget={widgetCreator()} />)
108108
);
109109
}, [options, label, components, widgets]);
110110
// Use the widget creator to set the current widget
111111

112112
return (
113113
<>
114-
<select value={label} onChange={event => setLabel(event.target.value)}>
114+
<select value={label} onChange={(event) => setLabel(event.target.value)}>
115115
{[...options.entries()].map(([idx, { value, type }]) => (
116116
<option key={idx} value={idx}>
117117
{type === 'child' && value.startsWith(url)
@@ -136,7 +136,7 @@ function InnerBrowser({ registry, url }: { registry: Registry; url: URL_ }) {
136136

137137
function Browser({
138138
registry,
139-
active
139+
active,
140140
}: {
141141
registry: Registry;
142142
active: IActiveDataset;
@@ -152,10 +152,10 @@ function Browser({
152152
React.useEffect(() => {
153153
if (follow) {
154154
const subscription = active.subscribe({
155-
next: value => {
155+
next: (value) => {
156156
setURL(value || '');
157157
setSubmittedURL(value || '');
158-
}
158+
},
159159
});
160160
return () => subscription.unsubscribe();
161161
}
@@ -164,7 +164,7 @@ function Browser({
164164
return (
165165
<div className="jl-dr-browser">
166166
<form
167-
onSubmit={event => {
167+
onSubmit={(event) => {
168168
setSubmittedURL(url);
169169
event.preventDefault();
170170
}}
@@ -174,7 +174,7 @@ function Browser({
174174
type="text"
175175
value={url}
176176
placeholder="file:///data.csv"
177-
onChange={event => setURL(event.target.value)}
177+
onChange={(event) => setURL(event.target.value)}
178178
className="jl-dr-browser-url-text"
179179
/>
180180
<input type="submit" value="Submit" />
@@ -184,7 +184,7 @@ function Browser({
184184
<input
185185
type="checkbox"
186186
checked={follow}
187-
onChange={e => {
187+
onChange={(e) => {
188188
if (e.target.checked) {
189189
setURL(active.value || '');
190190
}
@@ -201,7 +201,7 @@ export default {
201201
activate,
202202
id: '@jupyterlab/dataregistry-extension:browser',
203203
requires: [ILabShell, IRegistry, ILayoutRestorer, IActiveDataset],
204-
autoStart: true
204+
autoStart: true,
205205
} as JupyterFrontEndPlugin<void>;
206206

207207
function activate(

packages/dataregistry-extension/src/notebooks.ts

+9-10
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
import { IOutputModel } from '@jupyterlab/rendermime';
2727
import { IRegistry } from '@jupyterlab/dataregistry-registry-extension';
2828
import { NotebookPanel } from '@jupyterlab/notebook';
29-
import { ReadonlyJSONObject, ReadonlyJSONValue } from '@lumino/coreutils';
29+
import { ReadonlyPartialJSONObject } from '@lumino/coreutils';
3030
import { combineLatest, defer, Observable, of, from } from 'rxjs';
3131
import { map, switchMap, filter } from 'rxjs/operators';
3232
import { notebookContextDataType } from './documents';
@@ -99,15 +99,14 @@ const outputsDataType = new DataTypeNoArgs<Observable<Array<IOutputModel>>>(
9999
);
100100

101101
// The data in the mimebundle of an output cell
102-
const mimeBundleDataType = new DataTypeNoArgs<Observable<ReadonlyJSONObject>>(
103-
'application/x.jupyterlab.mime-bundle'
104-
);
102+
const mimeBundleDataType = new DataTypeNoArgs<
103+
Observable<ReadonlyPartialJSONObject>
104+
>('application/x.jupyterlab.mime-bundle');
105105

106106
// The data for a certain mimetype in an output.
107-
const mimeDataDataType = new DataTypeStringArg<Observable<ReadonlyJSONValue>>(
108-
'application/x.jupyterlab.mimedata',
109-
'mimeType'
110-
);
107+
const mimeDataDataType = new DataTypeStringArg<
108+
Observable<ReadonlyPartialJSONObject>
109+
>('application/x.jupyterlab.mimedata', 'mimeType');
111110

112111
/**
113112
* Converters
@@ -388,8 +387,8 @@ export function createConverters(
388387
)
389388
),
390389
createConverter<
391-
Observable<ReadonlyJSONValue>,
392-
Observable<ReadonlyJSONValue>,
390+
Observable<ReadonlyPartialJSONObject>,
391+
Observable<ReadonlyPartialJSONObject>,
393392
string,
394393
string
395394
>({ from: mimeDataDataType }, ({ type, data }) => ({ type, data })),

packages/dataregistry-extension/src/snippets.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default {
104104
({ type, data }) => ({
105105
type,
106106
data: async () =>
107-
notebookTracker.activeCell.model.value.insert(
107+
notebookTracker.activeCell?.model.value.insert(
108108
0,
109109
await data({
110110
path: notebookTracker.currentWidget!.context.path,

packages/dataregistry-extension/src/tableData.tsx

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ import { JupyterFrontEndPlugin } from '@jupyterlab/application';
99
import {
1010
DataTypeNoArgs,
1111
Registry,
12-
createConverter
12+
createConverter,
1313
} from '@jupyterlab/dataregistry';
1414

15-
import NteractDataExplorer, { Props } from '@nteract/data-explorer';
15+
import NteractDataExplorer from '@nteract/data-explorer';
16+
import { DataProps } from '@nteract/data-explorer/lib/utilities/types';
1617
import React from 'react';
1718
import { IRegistry } from '@jupyterlab/dataregistry-registry-extension';
1819
import { reactDataType } from './widgets';
@@ -23,7 +24,7 @@ import { UseObservable } from './utils';
2324
* Provides a table data type
2425
* https://frictionlessdata.io/specs/tabular-data-resource/
2526
*/
26-
export const TableDataType = new DataTypeNoArgs<Observable<Props['data']>>(
27+
export const TableDataType = new DataTypeNoArgs<Observable<DataProps>>(
2728
'application/vnd.dataresource+json'
2829
);
2930

@@ -38,7 +39,7 @@ const nteractDataExplorerConverter = createConverter(
3839
type: 'nteract Data Explorer',
3940
data: (
4041
<UseObservable observable={data} initial={undefined}>
41-
{data =>
42+
{(data) =>
4243
data ? (
4344
<NteractDataExplorer
4445
data={data}
@@ -51,7 +52,7 @@ const nteractDataExplorerConverter = createConverter(
5152
)
5253
}
5354
</UseObservable>
54-
)
55+
),
5556
})
5657
);
5758

@@ -61,5 +62,5 @@ export default {
6162
},
6263
id: '@jupyterlab/dataregistry-extension:table-data',
6364
requires: [IRegistry],
64-
autoStart: true
65+
autoStart: true,
6566
} as JupyterFrontEndPlugin<void>;

packages/dataregistry-extension/src/utils.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface IUseBehaviorSubjectProps<T> {
1919

2020
export function UseBehaviorSubject<T>({
2121
subject,
22-
children
22+
children,
2323
}: IUseBehaviorSubjectProps<T>) {
2424
return (
2525
<UseObservable observable={subject} initial={subject.value}>
@@ -45,7 +45,7 @@ export class UseObservable<T, U> extends React.Component<
4545

4646
componentDidMount() {
4747
this.subscription = this.props.observable.subscribe({
48-
next: value => this.setState({ value })
48+
next: (value) => this.setState({ value }),
4949
});
5050
}
5151

@@ -58,7 +58,7 @@ export class UseObservable<T, U> extends React.Component<
5858
}
5959
}
6060

61-
export function luminoWidget({ widget }: { widget: Widget }) {
61+
export function LuminoWidget({ widget }: { widget: Widget }) {
6262
const el = React.useRef<HTMLDivElement>(null);
6363

6464
React.useEffect(() => {
@@ -72,7 +72,7 @@ export function luminoWidget({ widget }: { widget: Widget }) {
7272
export function signalToObservable<T, V>(
7373
signal: ISignal<T, V>
7474
): Observable<[T, V]> {
75-
return new Observable(subscriber => {
75+
return new Observable((subscriber) => {
7676
function slot(sender: T, value: V) {
7777
subscriber.next([sender, value]);
7878
}

0 commit comments

Comments
 (0)