@tlockney/cdp-kernel 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/browser/kernel.js +9 -2
- package/dist/browser/kernel.js.map +2 -2
- package/dist/globals.d.ts +35 -4
- package/dist/kernel-core.js +3 -0
- package/dist/package.d.ts +2 -2
- package/dist/package.js +2 -2
- package/dist/transform.d.ts +10 -1
- package/dist/transform.js +20 -2
- package/package.json +1 -1
- package/runtime/comm.d.mts +87 -1
- package/runtime/display.d.mts +240 -5
- package/runtime/widget.d.mts +205 -6
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ runtime: Node or Deno over the Chrome DevTools Protocol, or Bun, workerd and
|
|
|
7
7
|
celld, which evaluate cells in-process. In principle, anything else whose
|
|
8
8
|
inspector speaks CDP works too. The kernel can also run inside a web page,
|
|
9
9
|
with cells in a Web Worker and no server
|
|
10
|
-
([The browser](https://cdp-kernel.org/docs/integration-browser)
|
|
10
|
+
([The browser](https://cdp-kernel.org/docs/integration-browser)).
|
|
11
11
|
|
|
12
12
|
**Website:** <https://cdp-kernel.org/> ·
|
|
13
13
|
**Docs:** [cdp-kernel.org/docs](https://cdp-kernel.org/docs/)
|
|
@@ -87,7 +87,9 @@ New to Jupyter? Start with
|
|
|
87
87
|
[Choosing a runtime](https://cdp-kernel.org/docs/runtimes),
|
|
88
88
|
[Widgets and comms](https://cdp-kernel.org/docs/widgets),
|
|
89
89
|
[Debugger](https://cdp-kernel.org/docs/debugger)
|
|
90
|
-
- Reference: [
|
|
90
|
+
- Reference: [`jupyter` reference](https://cdp-kernel.org/docs/jupyter-reference),
|
|
91
|
+
[Widgets and comms reference](https://cdp-kernel.org/docs/widgets-reference),
|
|
92
|
+
[Editor types](https://cdp-kernel.org/docs/editor-types),
|
|
91
93
|
[Known gaps](https://cdp-kernel.org/docs/known-gaps),
|
|
92
94
|
[Support policy](https://cdp-kernel.org/docs/support)
|
|
93
95
|
- Internals: [Architecture](https://cdp-kernel.org/docs/architecture),
|
package/dist/browser/kernel.js
CHANGED
|
@@ -28199,7 +28199,7 @@ function rewriteImport(code, node, index) {
|
|
|
28199
28199
|
if (spec.type === "ImportNamespaceSpecifier") return `${local} = ${ns}`;
|
|
28200
28200
|
return `${local} = ${ns}[${JSON.stringify(importedName(spec))}]`;
|
|
28201
28201
|
});
|
|
28202
|
-
return `var ${ns} = ${load};
|
|
28202
|
+
return `var ${ns} = ${load}; let ${bindings.join(", ")};`;
|
|
28203
28203
|
}
|
|
28204
28204
|
function parseCell(js) {
|
|
28205
28205
|
try {
|
|
@@ -28216,6 +28216,12 @@ function parseCell(js) {
|
|
|
28216
28216
|
function rewriteModuleSyntax(js) {
|
|
28217
28217
|
const program = parseCell(js);
|
|
28218
28218
|
const edits = [];
|
|
28219
|
+
for (const statement of program.body) {
|
|
28220
|
+
const decl = statement.type === "ExportNamedDeclaration" ? statement.declaration : statement;
|
|
28221
|
+
if (decl?.type === "VariableDeclaration" && decl.kind === "const") {
|
|
28222
|
+
edits.push({ start: decl.start, end: decl.start + "const".length, text: "let " });
|
|
28223
|
+
}
|
|
28224
|
+
}
|
|
28219
28225
|
let importIndex = 0;
|
|
28220
28226
|
full(program, (node) => {
|
|
28221
28227
|
switch (node.type) {
|
|
@@ -28879,6 +28885,7 @@ var KernelCore = class {
|
|
|
28879
28885
|
async run() {
|
|
28880
28886
|
this.#ensureTarget().catch((err) => this.#log(`target failed to start: ${err}`));
|
|
28881
28887
|
if (typeof this.#typeStrip === "string") await loadTypeStripper(this.#typeStrip);
|
|
28888
|
+
await this.#channels.ready;
|
|
28882
28889
|
await Promise.all([
|
|
28883
28890
|
this.#readShell(),
|
|
28884
28891
|
this.#runShell(this.#mainShell),
|
|
@@ -29583,7 +29590,7 @@ ${expression}
|
|
|
29583
29590
|
};
|
|
29584
29591
|
|
|
29585
29592
|
// stub:package
|
|
29586
|
-
var VERSION = "0.
|
|
29593
|
+
var VERSION = "0.9.0";
|
|
29587
29594
|
|
|
29588
29595
|
// src/browser/channels.ts
|
|
29589
29596
|
var PEER = "page";
|