Skip to content

Commit 8a43dd9

Browse files
committed
Version 2.0.2
1 parent 6cb9d33 commit 8a43dd9

File tree

9 files changed

+51
-12
lines changed

9 files changed

+51
-12
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 2.0.2 (6 Sept 2021)
4+
* Excellent support for [arquero](https://uwdata.github.io/arquero/) (rich HTML output)
5+
* New notebooks default cells to `typescript`
6+
* Displaying cell execution errors on Linux
7+
8+
## 2.0.1 (2 Sept 2021)
9+
* Updated readme
10+
311
## 2.0.0 (2 Sept 2021)
412
* Run & debug JavaScript, TypeScript code in node.js
513
* Built in support for typescript (ships with [TypeScript](https://www.typescriptlang.org/) & [ts-node](https://typestrong.org/ts-node/)).

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Built in support for [plotly](https://plotly.com/javascript/) (plotly.js is shipped with the extension)
66
* Rich (inline visualizations) using [@tensforflow/tfjs-vis](https://www.npmjs.com/package/@tensorflow/tfjs-vis) & [Tensorboards](https://www.tensorflow.org/tensorboard)
77
* Excellent support for [danfo.js](https://danfo.jsdata.org/) (rich HTML output and plots)
8+
* Excellent support for [arquero](https://uwdata.github.io/arquero/) (rich HTML output)
89
* Run shell scripts within the notebook cell.
910
* Quickly prototype and view HTML/JavaScript/CSS output
1011

@@ -30,8 +31,10 @@ Use the command [Open a sample node.js notebook](command:node.notebook.sample) t
3031
* node.js needs to be in the current path
3132

3233
## Roadmap
34+
* Support for [observable inspector](https://github.com/observablehq/inspector)
3335
* Support user input (node.js `readline` for basic input in scripts)
3436
* Open a plain js/ts file as a notebook & vice versa.
37+
* Better renderers for tabular data (arquero, danfo.js, etc)
3538
* [Vega](https://vega.github.io/vega/) plots without having to install vega
3639
* Custom node arguments
3740

@@ -47,3 +50,4 @@ Thanks to the various packages we provide integrations with which help make this
4750
* [plotly](https://plotly.com/javascript/)
4851
* [danfo.js](https://danfo.jsdata.org/)
4952
* [node-pty](https://github.com/microsoft/node-pty)
53+
* [arquero](https://uwdata.github.io/arquero/)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"onCommand:node.notebook.sample.basics.tips",
6969
"onCommand:node.notebook.sample.basics.richOutput",
7070
"onCommand:node.notebook.sample.basics.debug",
71+
"onCommand:node.notebook.sample.arquero.htmlOutput",
7172
"onCommand:node.notebook.new",
7273
"onRenderer:node-notebook-plot-renderer",
7374
"onRenderer:tensorflow-vis-renderer"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"cells": [
3+
{
4+
"language": "javascript",
5+
"source": [
6+
"const { loadArrow } = require('arquero');\nconst flights = await loadArrow('https://vega.github.io/vega-datasets/data/flights-200k.arrow');\nflights"
7+
],
8+
"outputs": []
9+
}
10+
]
11+
}

resources/scripts/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extension/content/provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class ContentProvider implements NotebookSerializer {
4848
};
4949
const kind = item.language === 'markdown' ? NotebookCellKind.Markup : NotebookCellKind.Code;
5050
const source = typeof item.source === 'string' ? item.source : item.source.join(EOL);
51-
const cell = new NotebookCellData(kind, source, item.language || 'javascript');
51+
const cell = new NotebookCellData(kind, source, item.language || 'typescript');
5252
cell.metadata = metadata;
5353
cell.outputs = (item.outputs || []).map(storageFormatToOutput);
5454
return cell;
@@ -93,7 +93,7 @@ export class ContentProvider implements NotebookSerializer {
9393
);
9494
context.subscriptions.push(
9595
commands.registerCommand('node.notebook.new', async () => {
96-
const data = new NotebookData([new NotebookCellData(NotebookCellKind.Code, '', 'javascript')]);
96+
const data = new NotebookData([new NotebookCellData(NotebookCellKind.Code, '', 'typescript')]);
9797
await workspace.openNotebookDocument(notebookType, data);
9898
// const doc = await workspace.openNotebookDocument(notebookType, data);
9999
// await notebooks.showNotebookDocument(doc);

src/extension/content/walkThrough.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ samples.push({
5959
// danfo.js
6060
samples.push({
6161
command: 'node.notebook.sample.danfojs.htmlOutput',
62-
label: 'View dataframe and series in HTML tables',
62+
label: 'View dataframe and series as HTML tables',
6363
description: 'danfo.js',
6464
path: path.join('resources', 'docs', 'danfojs', 'htmlOutput.nnb')
6565
});
@@ -81,6 +81,14 @@ samples.push({
8181
description: 'basics',
8282
path: path.join('resources', 'docs', 'basics', 'tips.nnb')
8383
});
84+
// arquero
85+
samples.push({
86+
command: 'node.notebook.sample.arquero.htmlOutput',
87+
label: 'View tables as HTML tables',
88+
description: 'arquero',
89+
path: path.join('resources', 'docs', 'arquero', 'htmlOutput.nnb')
90+
});
91+
8492

8593
export class Samples {
8694
public static regsiter(context: ExtensionContext) {

src/extension/kernel/controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ export class Controller implements IDisposable {
5555
if (type === 'node') {
5656
controller.description = '';
5757
controller.detail = 'Execute & debug JavaScript/TypeScript in node.js';
58-
controller.supportedLanguages = ['javascript', 'typescript', 'html', 'shellscript', 'powershell'];
58+
controller.supportedLanguages = ['typescript', 'javascript', 'html', 'shellscript', 'powershell'];
5959
} else {
6060
controller.description = 'JavaScript/TypeScript Kernel running in Browser';
6161
controller.detail = 'Support for JavaScript in Notebooks';
62-
controller.supportedLanguages = ['javascript', 'typescript', 'html', 'shellscript', 'powershell'];
62+
controller.supportedLanguages = ['typescript', 'javascript', 'html', 'shellscript', 'powershell'];
6363
}
6464
controller.executeHandler = this.executeHandler;
6565
controller.interruptHandler = this.interrupt;

src/extension/kernel/shellKernel.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,14 @@ class ShellPty {
192192
return true;
193193
} catch (ex) {
194194
console.log('Unable to load nodepty', ex);
195-
return false;
195+
try {
196+
// eslint-disable-next-line @typescript-eslint/no-var-requires
197+
ShellPty.pty = require(path.join(ShellPty.nodePtyPath, 'lib', 'index.js')) as typeof import('node-pty');
198+
return true;
199+
} catch (ex) {
200+
console.log('Unable to load nodepty (lib/index.js)', ex);
201+
return false;
202+
}
196203
}
197204
}
198205
public static get(cwd?: string) {

0 commit comments

Comments
 (0)