Skip to content

Commit

Permalink
Split package in two: extension and library
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Dec 12, 2024
1 parent 39e9b2a commit 9aa098f
Show file tree
Hide file tree
Showing 21 changed files with 4,184 additions and 744 deletions.
5 changes: 5 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent",
"npmClient": "yarn"
}
110 changes: 10 additions & 100 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@jupyterlite/xeus",
"name": "@jupyterlite/xeus-root",
"version": "2.1.2",
"private": true,
"description": "JupyterLite loader for Xeus kernels",
"keywords": [
"jupyter",
Expand All @@ -13,110 +14,36 @@
},
"license": "BSD-3-Clause",
"author": "JupyterLite Contributors",
"files": [
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
"style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}"
"workspaces": [
"packages/*"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
"style": "style/index.css",
"repository": {
"type": "git",
"url": "https://github.com/jupyterlite/xeus.git"
},
"scripts": {
"build": "jlpm build:lib && jlpm build:worker && jlpm build:labextension:dev",
"build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:worker:prod && jlpm build:labextension",
"build:worker": "webpack --config worker.webpack.config.js --mode=development",
"build:worker:prod": "webpack --config worker.webpack.config.js --mode=production",
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:lib": "tsc --sourceMap",
"build:lib:prod": "tsc",
"clean": "jlpm clean:lib",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:lintcache": "rimraf .eslintcache .stylelintcache",
"clean:labextension": "rimraf jupyterlite_xeus/labextension jupyterlite_xeus/_version.py",
"clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
"build": "lerna run build",
"build:prod": "lerna run build:prod",
"clean": "lerna run clean",
"eslint": "jlpm eslint:check --fix",
"eslint:check": "eslint . --cache --ext .ts,.tsx",
"install:extension": "jlpm build",
"lint": "jlpm stylelint && jlpm prettier && jlpm eslint",
"lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check",
"prettier": "jlpm prettier:base --write --list-different",
"prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"prettier:check": "jlpm prettier:base --check",
"stylelint": "jlpm stylelint:check --fix",
"stylelint:check": "stylelint --cache \"style/**/*.css\"",
"watch": "run-p watch:src watch:labextension",
"watch:src": "tsc -w --sourceMap",
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyterlab/coreutils": "^6",
"@jupyterlab/services": "^7",
"@jupyterlite/contents": "^0.2.0 || ^0.3.0 || ^0.4.0",
"@jupyterlite/kernel": "^0.2.0 || ^0.3.0 || ^0.4.0",
"@jupyterlite/server": "^0.2.0 || ^0.3.0 || ^0.4.0",
"@lumino/coreutils": "^2",
"@lumino/signaling": "^2",
"coincident": "^1.2.3",
"comlink": "^4.4.1"
"watch": "lerna run watch"
},
"devDependencies": {
"@jupyterlab/builder": "^4.1.0",
"@types/json-schema": "^7.0.11",
"@types/react": "^18.0.26",
"@types/react-addons-linked-state-mixin": "^0.14.22",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"css-loader": "^6.7.1",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^5.0.0",
"lerna": "^8.1.9",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
"source-map-loader": "^1.0.2",
"style-loader": "^3.3.1",
"stylelint": "^15.10.1",
"stylelint-config-recommended": "^13.0.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-csstree-validator": "^3.0.0",
"stylelint-prettier": "^4.0.0",
"ts-loader": "^9.2.6",
"typescript": "~5.0.2",
"webpack": "^5.87.0",
"yjs": "^13.5.0"
},
"sideEffects": [
"style/*.css",
"style/index.js"
],
"styleModule": "style/index.js",
"publishConfig": {
"access": "public"
},
"jupyterlab": {
"extension": true,
"outputDir": "jupyterlite_xeus/labextension",
"sharedPackages": {
"@jupyterlite/kernel": {
"bundled": false,
"singleton": true
},
"@jupyterlite/server": {
"bundled": false,
"singleton": true
},
"@jupyterlite/contents": {
"bundled": false,
"singleton": true
}
}
},
"jupyterlite": {
"liteExtension": true
"rimraf": "^5.0.1"
},
"eslintIgnore": [
"node_modules",
Expand Down Expand Up @@ -194,22 +121,5 @@
}
}
]
},
"stylelint": {
"extends": [
"stylelint-config-recommended",
"stylelint-config-standard",
"stylelint-prettier/recommended"
],
"plugins": [
"stylelint-csstree-validator"
],
"rules": {
"csstree/validator": true,
"property-no-vendor-prefix": null,
"selector-class-pattern": "^([a-z][A-z\\d]*)(-[A-z\\d]+)*$",
"selector-no-vendor-prefix": null,
"value-no-vendor-prefix": null
}
}
}
86 changes: 86 additions & 0 deletions packages/xeus-extension/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"name": "@jupyterlite/xeus-extension",
"version": "2.1.2",
"description": "JupyterLite loader for Xeus kernels",
"keywords": [
"jupyter",
"jupyterlab",
"jupyterlab-extension"
],
"homepage": "https://github.com/jupyterlite/xeus",
"bugs": {
"url": "https://github.com/jupyterlite/xeus/issues"
},
"license": "BSD-3-Clause",
"author": "JupyterLite Contributors",
"files": [
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/jupyterlite/xeus.git"
},
"scripts": {
"build": "jlpm build:lib && jlpm build:labextension:dev",
"build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:labextension",
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:lib": "tsc --sourceMap",
"build:lib:prod": "tsc",
"clean": "jlpm clean:lib",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:labextension": "rimraf jupyterlite_xeus/labextension jupyterlite_xeus/_version.py",
"clean:all": "jlpm clean:lib && jlpm clean:labextension",
"watch": "run-p watch:src watch:labextension",
"watch:src": "tsc -w --sourceMap",
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyterlab/coreutils": "^6",
"@jupyterlite/contents": "^0.2.0 || ^0.3.0 || ^0.4.0",
"@jupyterlite/kernel": "^0.2.0 || ^0.3.0 || ^0.4.0",
"@jupyterlite/server": "^0.2.0 || ^0.3.0 || ^0.4.0",
"@jupyterlite/xeus": "^2.1.2",
"@lumino/coreutils": "^2"
},
"devDependencies": {
"@jupyterlab/builder": "^4.1.0",
"@types/json-schema": "^7.0.11",
"@types/react": "^18.0.26",
"@types/react-addons-linked-state-mixin": "^0.14.22",
"css-loader": "^6.7.1",
"npm-run-all": "^4.1.5",
"rimraf": "^5.0.1",
"source-map-loader": "^1.0.2",
"ts-loader": "^9.2.6",
"typescript": "~5.0.2",
"webpack": "^5.87.0",
"yjs": "^13.5.0"
},
"publishConfig": {
"access": "public"
},
"jupyterlab": {
"extension": true,
"outputDir": "../../jupyterlite_xeus/labextension",
"sharedPackages": {
"@jupyterlite/kernel": {
"bundled": false,
"singleton": true
},
"@jupyterlite/server": {
"bundled": false,
"singleton": true
},
"@jupyterlite/contents": {
"bundled": false,
"singleton": true
}
}
},
"jupyterlite": {
"liteExtension": true
}
}
2 changes: 1 addition & 1 deletion src/index.ts → packages/xeus-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { IBroadcastChannelWrapper } from '@jupyterlite/contents';
import { IKernel, IKernelSpecs } from '@jupyterlite/kernel';

import { WebWorkerKernel } from './web_worker_kernel';
import { WebWorkerKernel } from '@jupyterlite/xeus';
import { IEmpackEnvMetaFile } from './tokens';

function getJson(url: string) {
Expand Down
12 changes: 12 additions & 0 deletions packages/xeus-extension/src/tokens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Token } from '@lumino/coreutils';

export interface IEmpackEnvMetaFile {
/**
* Get empack_env_meta link.
*/
getLink: (kernelspec: Record<string, any>) => Promise<string>;
}

export const IEmpackEnvMetaFile = new Token<IEmpackEnvMetaFile>(
'@jupyterlite/xeus:IEmpackEnvMetaFile'
);
8 changes: 8 additions & 0 deletions packages/xeus-extension/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"include": ["src/**/*"]
}
65 changes: 65 additions & 0 deletions packages/xeus/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "@jupyterlite/xeus",
"version": "2.1.2",
"description": "JupyterLite Xeus kernels",
"keywords": [
"jupyter",
"jupyterlab",
"jupyterlab-extension"
],
"homepage": "https://github.com/jupyterlite/xeus",
"bugs": {
"url": "https://github.com/jupyterlite/xeus/issues"
},
"license": "BSD-3-Clause",
"author": "JupyterLite Contributors",
"files": [
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/jupyterlite/xeus.git"
},
"scripts": {
"build": "jlpm build:lib && jlpm build:worker",
"build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:worker:prod",
"build:worker": "webpack --config worker.webpack.config.js --mode=development",
"build:worker:prod": "webpack --config worker.webpack.config.js --mode=production",
"build:lib": "tsc --sourceMap",
"build:lib:prod": "tsc",
"clean": "jlpm clean:lib",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:all": "jlpm clean:lib",
"watch": "run-p watch:src",
"watch:src": "tsc -w --sourceMap"
},
"dependencies": {
"@jupyterlab/coreutils": "^6",
"@jupyterlab/services": "^7",
"@jupyterlite/contents": "^0.2.0 || ^0.3.0 || ^0.4.0",
"@jupyterlite/kernel": "^0.2.0 || ^0.3.0 || ^0.4.0",
"@jupyterlite/server": "^0.2.0 || ^0.3.0 || ^0.4.0",
"@lumino/coreutils": "^2",
"@lumino/signaling": "^2",
"coincident": "^1.2.3",
"comlink": "^4.4.1"
},
"devDependencies": {
"@jupyterlab/builder": "^4.1.0",
"@types/json-schema": "^7.0.11",
"@types/react": "^18.0.26",
"@types/react-addons-linked-state-mixin": "^0.14.22",
"npm-run-all": "^4.1.5",
"rimraf": "^5.0.1",
"source-map-loader": "^1.0.2",
"ts-loader": "^9.2.6",
"typescript": "~5.0.2",
"webpack": "^5.87.0",
"yjs": "^13.5.0"
},
"publishConfig": {
"access": "public"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
TDriveResponse
} from '@jupyterlite/contents';

import { IXeusWorkerKernel } from './tokens';
import { IXeusWorkerKernel } from './interfaces';
import { XeusRemoteKernel } from './worker';

const workerAPI = coincident(self) as IXeusWorkerKernel;
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions packages/xeus/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './coincident.worker';
export * from './comlink.worker';
export * from './interfaces';
export * from './web_worker_kernel';
export * from './worker';
12 changes: 0 additions & 12 deletions src/tokens.ts → packages/xeus/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from '@jupyterlite/contents';

import { IWorkerKernel } from '@jupyterlite/kernel';
import { Token } from '@lumino/coreutils';

/**
* An interface for Xeus workers.
Expand Down Expand Up @@ -89,14 +88,3 @@ export namespace IXeusWorkerKernel {
empackEnvMetaLink?: string;
}
}

export interface IEmpackEnvMetaFile {
/**
* Get empack_env_meta link.
*/
getLink: (kernelspec: Record<string, any>) => Promise<string>;
}

export const IEmpackEnvMetaFile = new Token<IEmpackEnvMetaFile>(
'@jupyterlite/xeus:IEmpackEnvMetaFile'
);
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
TDriveRequest
} from '@jupyterlite/contents';

import { IXeusWorkerKernel } from './tokens';
import { IXeusWorkerKernel } from './interfaces';

export class WebWorkerKernel implements IKernel {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/worker.ts → packages/xeus/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { URLExt } from '@jupyterlab/coreutils';

import { IXeusWorkerKernel } from './tokens';
import { IXeusWorkerKernel } from './interfaces';

globalThis.Module = {};

Expand Down
Loading

0 comments on commit 9aa098f

Please sign in to comment.