@lincyaw/addon-exec-jupyter 1.0.0-rc.5 → 1.0.0-rc.50
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/package.json +6 -6
- package/src/node/presmium.ts +1 -2
- package/src/node/terminal.ts +2 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincyaw/addon-exec-jupyter",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.50",
|
|
4
4
|
"description": "Presmium plugin: remote Jupyter kernels at build time and in the browser, and a browser terminal",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"react": "^18.3.1",
|
|
43
43
|
"react-dom": "^18.3.1",
|
|
44
|
-
"@lincyaw/host": "^1.0.0-rc.
|
|
45
|
-
"@lincyaw/kernel": "^1.0.0-rc.
|
|
44
|
+
"@lincyaw/host": "^1.0.0-rc.50",
|
|
45
|
+
"@lincyaw/kernel": "^1.0.0-rc.50"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/ws": "8.18.2",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@types/react": "18.3.28",
|
|
51
51
|
"react-dom": "18.3.1",
|
|
52
52
|
"@types/react-dom": "18.3.7",
|
|
53
|
-
"@lincyaw/cli": "1.0.0-rc.
|
|
54
|
-
"@lincyaw/host": "1.0.0-rc.
|
|
55
|
-
"@lincyaw/kernel": "1.0.0-rc.
|
|
53
|
+
"@lincyaw/cli": "1.0.0-rc.50",
|
|
54
|
+
"@lincyaw/host": "1.0.0-rc.50",
|
|
55
|
+
"@lincyaw/kernel": "1.0.0-rc.50"
|
|
56
56
|
}
|
|
57
57
|
}
|
package/src/node/presmium.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { EXEC_JUPYTER_ID } from '../domain/index.ts'
|
|
|
4
4
|
import { declaredEnvironmentsPass } from './declared.ts'
|
|
5
5
|
import { jupyterProvider } from './provider.ts'
|
|
6
6
|
import { jupyterProxy } from './proxy.ts'
|
|
7
|
-
import {
|
|
7
|
+
import { terminalPass } from './terminal.ts'
|
|
8
8
|
|
|
9
9
|
const { version } = createRequire(import.meta.url)('../../package.json') as { version: string }
|
|
10
10
|
|
|
@@ -12,7 +12,6 @@ const plugin: PresmiumNodePlugin = {
|
|
|
12
12
|
id: EXEC_JUPYTER_ID,
|
|
13
13
|
version,
|
|
14
14
|
kernel: '^1.0.0',
|
|
15
|
-
directives: [terminalDirective],
|
|
16
15
|
passes: [declaredEnvironmentsPass, terminalPass],
|
|
17
16
|
environments: { jupyter: jupyterProvider },
|
|
18
17
|
server: jupyterProxy,
|
package/src/node/terminal.ts
CHANGED
|
@@ -1,27 +1,6 @@
|
|
|
1
1
|
import { docBlocks } from '@lincyaw/kernel'
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export const terminalDirective: DirectiveSpec = {
|
|
6
|
-
name: 'terminal',
|
|
7
|
-
arg: true,
|
|
8
|
-
body: false,
|
|
9
|
-
options: { height: 'number' },
|
|
10
|
-
toIR(input, ctx) {
|
|
11
|
-
const env = input.arg?.trim() ?? ''
|
|
12
|
-
if (!env) ctx.report({ checkId: EXEC_JUPYTER_ID, severity: 'error', message: '{terminal} needs the name of a kind: jupyter environment of execute.environments, e.g. :::{terminal} gpu' })
|
|
13
|
-
const height = input.options.height
|
|
14
|
-
const rows = typeof height === 'number' && Number.isInteger(height) && height > 0 ? height : DEFAULT_TERMINAL_ROWS
|
|
15
|
-
const node: ComponentNode = {
|
|
16
|
-
type: 'component',
|
|
17
|
-
plugin: EXEC_JUPYTER_ID,
|
|
18
|
-
name: 'PmTerminal',
|
|
19
|
-
props: { env, rows },
|
|
20
|
-
fallback: { type: 'root', children: [{ type: 'paragraph', children: [{ type: 'text', value: terminalFallback(env, ctx.lang) }] }] },
|
|
21
|
-
}
|
|
22
|
-
return { node }
|
|
23
|
-
},
|
|
24
|
-
}
|
|
2
|
+
import type { IRPass } from '@lincyaw/kernel'
|
|
3
|
+
import { EXEC_JUPYTER_ID, jupyterSpecs } from '../domain/index.ts'
|
|
25
4
|
|
|
26
5
|
export const terminalPass: IRPass = {
|
|
27
6
|
name: 'presmium.execJupyter.terminals',
|