Commit 084379b1 authored by Romain Casati's avatar Romain Casati
Browse files

Basthon kernel support.

parent be8219e0
......@@ -130,3 +130,4 @@ app/kernels
# generated
docs/api/ts
.vercel
app/lab/basthon-kernel/
\ No newline at end of file
......@@ -7,3 +7,4 @@ docs/_build
node_modules
docs/api/ts
.pytest_cache
app/lab/basthon-kernel/**
\ No newline at end of file
......@@ -10,10 +10,14 @@ __webpack_public_path__ = PageConfig.getOption('fullStaticUrl') + '/';
require('./build/style.js');
const serverMods = [
const serverModsDummy = [
import('@jupyterlite/javascript-kernel-extension'),
import('@jupyterlite/p5-kernel-extension'),
import('@jupyterlite/pyolite-kernel-extension'),
import('@jupyterlite/pyolite-kernel-extension')
];
const serverMods = [
import('@jupyterlite/basthon-kernel-extension'),
import('@jupyterlite/server-extension')
];
......
../../lab/basthon-kernel/
\ No newline at end of file
......@@ -21,6 +21,7 @@
"@jupyterlite/javascript-kernel-extension": "^0.1.0",
"@jupyterlite/p5-kernel-extension": "^0.1.0",
"@jupyterlite/pyolite-kernel-extension": "^0.1.0",
"@jupyterlite/basthon-kernel-extension": "^0.1.0",
"@jupyterlite/server-extension": "^0.1.0",
"@jupyterlite/theme-extension": "^0.1.0",
"@jupyterlab-classic/application": "^0.1.10",
......
......@@ -51,10 +51,14 @@ const mimeExtensions = [
import('@jupyterlab/json-extension')
];
const mods = [
const modsDummy = [
import('@jupyterlite/javascript-kernel-extension'),
import('@jupyterlite/p5-kernel-extension'),
import('@jupyterlite/pyolite-kernel-extension'),
import('@jupyterlite/pyolite-kernel-extension')
];
const mods = [
import('@jupyterlite/basthon-kernel-extension'),
import('@jupyterlite/server-extension')
];
......
......@@ -20,6 +20,7 @@
"@jupyterlite/javascript-kernel-extension": "^0.1.0",
"@jupyterlite/p5-kernel-extension": "^0.1.0",
"@jupyterlite/pyolite-kernel-extension": "^0.1.0",
"@jupyterlite/basthon-kernel-extension": "^0.1.0",
"@jupyterlite/application-extension": "^0.1.0",
"@jupyterlite/server-extension": "^0.1.0",
"@jupyterlite/theme-extension": "^0.1.0",
......
......@@ -87,6 +87,7 @@ def task_build():
],
actions=[
U.do("yarn", "build:lib"),
U.do("yarn", "build:basthon"),
],
targets=[B.META_BUILDINFO],
)
......
......@@ -20,6 +20,7 @@
"scripts": {
"bootstrap": "yarn && yarn clean && yarn build && yarn lint && yarn test",
"build": "yarn build:lib && yarn build:app",
"build:basthon": "pip3 install --upgrade basthon-kernel && mkdir -p app/lab/basthon-kernel/ && cd app/lab/basthon-kernel/ && python3 -m basthon-kernel --install && cd -",
"build:python": "lerna run build:python",
"build:lib": "lerna run build --scope @jupyterlite/metapackage",
"build:app": "lerna run build --stream --parallel --scope \"@jupyterlite/app-classic\" --scope \"@jupyterlite/app-lab\"",
......
......@@ -32,6 +32,8 @@
"@jupyterlite/p5-kernel-extension": "file:../p5-kernel-extension",
"@jupyterlite/pyolite-kernel": "file:../pyolite-kernel",
"@jupyterlite/pyolite-kernel-extension": "file:../pyolite-kernel-extension",
"@jupyterlite/basthon-kernel": "file:../basthon-kernel",
"@jupyterlite/basthon-kernel-extension": "file:../basthon-kernel-extension",
"@jupyterlite/server": "file:../server-extension",
"@jupyterlite/session": "file:../session",
"@jupyterlite/settings": "file:../settings",
......
......@@ -10,6 +10,8 @@ import '@jupyterlite/p5-kernel';
import '@jupyterlite/p5-kernel-extension';
import '@jupyterlite/pyolite-kernel-extension';
import '@jupyterlite/pyolite-kernel';
import '@jupyterlite/basthon-kernel-extension';
import '@jupyterlite/basthon-kernel';
import '@jupyterlite/server';
import '@jupyterlite/server-extension';
import '@jupyterlite/session';
......
......@@ -18,6 +18,8 @@
{ "path": "../p5-kernel-extension" },
{ "path": "../pyolite-kernel" },
{ "path": "../pyolite-kernel-extension" },
{ "path": "../basthon-kernel" },
{ "path": "../basthon-kernel-extension" },
{ "path": "../server-extension" },
{ "path": "../session" },
{ "path": "../settings" },
......
module.exports = require('@jupyterlab/testutils/lib/babel.config');
const func = require('@jupyterlab/testutils/lib/jest-config');
const upstream = func(__dirname);
let local = {
preset: 'ts-jest/presets/js-with-babel',
transformIgnorePatterns: ['/node_modules/(?!(@jupyterlab/.*)/)'],
globals: {
'ts-jest': {
tsconfig: './tsconfig.test.json'
}
},
transform: {
'\\.(ts|tsx)?$': 'ts-jest',
'\\.svg$': 'jest-raw-loader'
}
};
Object.keys(local).forEach(option => {
upstream[option] = local[option];
});
module.exports = upstream;
{
"name": "@jupyterlite/basthon-kernel-extension",
"version": "0.1.0",
"description": "JupyterLite - Basthon Kernel Extension",
"homepage": "https://github.com/jtpio/jupyterlite",
"bugs": {
"url": "https://github.com/jtpio/jupyterlite/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/jtpio/jupyterlite.git"
},
"license": "BSD-3-Clause",
"author": "JupyterLite Contributors",
"sideEffects": [
"style/*.css",
"style/index.js"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
"style": "style/index.css",
"styleModule": "style/index.js",
"directories": {
"lib": "lib/"
},
"files": [
"lib/*.d.ts",
"lib/*.js.map",
"lib/*.js",
"style/*.css",
"style/index.js"
],
"scripts": {
"build": "tsc -b",
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
"docs": "typedoc src",
"prepublishOnly": "npm run build",
"watch": "tsc -b --watch"
},
"dependencies": {
"@jupyterlab/coreutils": "^5.0.0",
"@jupyterlite/kernel": "^0.1.0",
"@jupyterlite/basthon-kernel": "^0.1.0",
"@jupyterlite/server": "^0.1.0"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.12.1",
"@types/jest": "^26.0.10",
"jest": "^26.4.2",
"rimraf": "~3.0.0",
"ts-jest": "^26.3.0",
"typescript": "~4.2.3"
},
"publishConfig": {
"access": "public"
}
}
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import { JupyterLiteServer, JupyterLiteServerPlugin } from '@jupyterlite/server';
import { IKernel, IKernelSpecs } from '@jupyterlite/kernel';
import { BasthonKernel } from '@jupyterlite/basthon-kernel';
/**
* A plugin to register the Pyodide kernel.
*/
const kernel: JupyterLiteServerPlugin<void> = {
id: '@jupyterlite/basthon-kernel-extension:kernel',
autoStart: true,
requires: [IKernelSpecs],
activate: (app: JupyterLiteServer, kernelspecs: IKernelSpecs) => {
kernelspecs.register({
spec: {
name: 'python',
display_name: 'Basthon',
language: 'python',
argv: [],
spec: {
argv: [],
env: {},
display_name: 'Basthon',
language: 'python',
interrupt_mode: 'message',
metadata: {}
},
resources: {
'logo-32x32': 'TODO',
'logo-64x64': '/kernelspecs/python.png'
}
},
create: async (options: IKernel.IOptions): Promise<IKernel> => {
return new BasthonKernel(options);
}
});
}
};
const plugins: JupyterLiteServerPlugin<any>[] = [kernel];
export default plugins;
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
@import url('./base.css');
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
import './base.css';
{
"extends": "../../tsconfigbase",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"include": ["src/**/*"],
"references": [
{
"path": "../kernel"
},
{
"path": "../basthon-kernel"
},
{
"path": "../server"
}
]
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment