Skip to content

Commit e530971

Browse files
authored
Split package in two: extension and library (#132)
* Split package in two: extension and library * Linter * Missing clean:all script
1 parent 3a02d65 commit e530971

22 files changed

+4187
-747
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ lib/
33
node_modules/
44
*.log
55
.eslintcache
6-
.stylelintcache
76
*.egg-info/
87
.ipynb_checkpoints
98
*.tsbuildinfo

lerna.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3+
"version": "independent",
4+
"npmClient": "yarn"
5+
}

package.json

Lines changed: 13 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"name": "@jupyterlite/xeus",
2+
"name": "@jupyterlite/xeus-root",
33
"version": "2.1.2",
4+
"private": true,
45
"description": "JupyterLite loader for Xeus kernels",
56
"keywords": [
67
"jupyter",
@@ -13,110 +14,37 @@
1314
},
1415
"license": "BSD-3-Clause",
1516
"author": "JupyterLite Contributors",
16-
"files": [
17-
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
18-
"style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}"
17+
"workspaces": [
18+
"packages/*"
1919
],
20-
"main": "lib/index.js",
21-
"types": "lib/index.d.ts",
22-
"style": "style/index.css",
2320
"repository": {
2421
"type": "git",
2522
"url": "https://github.com/jupyterlite/xeus.git"
2623
},
2724
"scripts": {
28-
"build": "jlpm build:lib && jlpm build:worker && jlpm build:labextension:dev",
29-
"build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:worker:prod && jlpm build:labextension",
30-
"build:worker": "webpack --config worker.webpack.config.js --mode=development",
31-
"build:worker:prod": "webpack --config worker.webpack.config.js --mode=production",
32-
"build:labextension": "jupyter labextension build .",
33-
"build:labextension:dev": "jupyter labextension build --development True .",
34-
"build:lib": "tsc --sourceMap",
35-
"build:lib:prod": "tsc",
36-
"clean": "jlpm clean:lib",
37-
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
38-
"clean:lintcache": "rimraf .eslintcache .stylelintcache",
39-
"clean:labextension": "rimraf jupyterlite_xeus/labextension jupyterlite_xeus/_version.py",
40-
"clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
25+
"build": "lerna run build",
26+
"build:prod": "lerna run build:prod",
27+
"clean": "lerna run clean",
28+
"clean:all": "lerna run clean:all",
4129
"eslint": "jlpm eslint:check --fix",
4230
"eslint:check": "eslint . --cache --ext .ts,.tsx",
43-
"install:extension": "jlpm build",
44-
"lint": "jlpm stylelint && jlpm prettier && jlpm eslint",
45-
"lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check",
31+
"lint": "jlpm prettier && jlpm eslint",
32+
"lint:check": "jlpm prettier:check && jlpm eslint:check",
4633
"prettier": "jlpm prettier:base --write --list-different",
4734
"prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
4835
"prettier:check": "jlpm prettier:base --check",
49-
"stylelint": "jlpm stylelint:check --fix",
50-
"stylelint:check": "stylelint --cache \"style/**/*.css\"",
51-
"watch": "run-p watch:src watch:labextension",
52-
"watch:src": "tsc -w --sourceMap",
53-
"watch:labextension": "jupyter labextension watch ."
54-
},
55-
"dependencies": {
56-
"@jupyterlab/coreutils": "^6",
57-
"@jupyterlab/services": "^7",
58-
"@jupyterlite/contents": "^0.2.0 || ^0.3.0 || ^0.4.0",
59-
"@jupyterlite/kernel": "^0.2.0 || ^0.3.0 || ^0.4.0",
60-
"@jupyterlite/server": "^0.2.0 || ^0.3.0 || ^0.4.0",
61-
"@lumino/coreutils": "^2",
62-
"@lumino/signaling": "^2",
63-
"coincident": "^1.2.3",
64-
"comlink": "^4.4.1"
36+
"watch": "lerna run watch"
6537
},
6638
"devDependencies": {
67-
"@jupyterlab/builder": "^4.1.0",
68-
"@types/json-schema": "^7.0.11",
69-
"@types/react": "^18.0.26",
70-
"@types/react-addons-linked-state-mixin": "^0.14.22",
7139
"@typescript-eslint/eslint-plugin": "^6.1.0",
7240
"@typescript-eslint/parser": "^6.1.0",
73-
"css-loader": "^6.7.1",
7441
"eslint": "^8.36.0",
7542
"eslint-config-prettier": "^8.8.0",
7643
"eslint-plugin-prettier": "^5.0.0",
44+
"lerna": "^8.1.9",
7745
"npm-run-all": "^4.1.5",
7846
"prettier": "^3.0.0",
79-
"rimraf": "^5.0.1",
80-
"source-map-loader": "^1.0.2",
81-
"style-loader": "^3.3.1",
82-
"stylelint": "^15.10.1",
83-
"stylelint-config-recommended": "^13.0.0",
84-
"stylelint-config-standard": "^34.0.0",
85-
"stylelint-csstree-validator": "^3.0.0",
86-
"stylelint-prettier": "^4.0.0",
87-
"ts-loader": "^9.2.6",
88-
"typescript": "~5.0.2",
89-
"webpack": "^5.87.0",
90-
"yjs": "^13.5.0"
91-
},
92-
"sideEffects": [
93-
"style/*.css",
94-
"style/index.js"
95-
],
96-
"styleModule": "style/index.js",
97-
"publishConfig": {
98-
"access": "public"
99-
},
100-
"jupyterlab": {
101-
"extension": true,
102-
"outputDir": "jupyterlite_xeus/labextension",
103-
"sharedPackages": {
104-
"@jupyterlite/kernel": {
105-
"bundled": false,
106-
"singleton": true
107-
},
108-
"@jupyterlite/server": {
109-
"bundled": false,
110-
"singleton": true
111-
},
112-
"@jupyterlite/contents": {
113-
"bundled": false,
114-
"singleton": true
115-
}
116-
}
117-
},
118-
"jupyterlite": {
119-
"liteExtension": true
47+
"rimraf": "^5.0.1"
12048
},
12149
"eslintIgnore": [
12250
"node_modules",
@@ -194,22 +122,5 @@
194122
}
195123
}
196124
]
197-
},
198-
"stylelint": {
199-
"extends": [
200-
"stylelint-config-recommended",
201-
"stylelint-config-standard",
202-
"stylelint-prettier/recommended"
203-
],
204-
"plugins": [
205-
"stylelint-csstree-validator"
206-
],
207-
"rules": {
208-
"csstree/validator": true,
209-
"property-no-vendor-prefix": null,
210-
"selector-class-pattern": "^([a-z][A-z\\d]*)(-[A-z\\d]+)*$",
211-
"selector-no-vendor-prefix": null,
212-
"value-no-vendor-prefix": null
213-
}
214125
}
215126
}

packages/xeus-extension/package.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"name": "@jupyterlite/xeus-extension",
3+
"version": "2.1.2",
4+
"description": "JupyterLite loader for Xeus kernels",
5+
"keywords": [
6+
"jupyter",
7+
"jupyterlab",
8+
"jupyterlab-extension"
9+
],
10+
"homepage": "https://github.com/jupyterlite/xeus",
11+
"bugs": {
12+
"url": "https://github.com/jupyterlite/xeus/issues"
13+
},
14+
"license": "BSD-3-Clause",
15+
"author": "JupyterLite Contributors",
16+
"files": [
17+
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}"
18+
],
19+
"main": "lib/index.js",
20+
"types": "lib/index.d.ts",
21+
"repository": {
22+
"type": "git",
23+
"url": "https://github.com/jupyterlite/xeus.git"
24+
},
25+
"scripts": {
26+
"build": "jlpm build:lib && jlpm build:labextension:dev",
27+
"build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:labextension",
28+
"build:labextension": "jupyter labextension build .",
29+
"build:labextension:dev": "jupyter labextension build --development True .",
30+
"build:lib": "tsc --sourceMap",
31+
"build:lib:prod": "tsc",
32+
"clean": "jlpm clean:lib",
33+
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
34+
"clean:labextension": "rimraf jupyterlite_xeus/labextension jupyterlite_xeus/_version.py",
35+
"clean:all": "jlpm clean:lib && jlpm clean:labextension",
36+
"watch": "run-p watch:src watch:labextension",
37+
"watch:src": "tsc -w --sourceMap",
38+
"watch:labextension": "jupyter labextension watch ."
39+
},
40+
"dependencies": {
41+
"@jupyterlab/coreutils": "^6",
42+
"@jupyterlite/contents": "^0.2.0 || ^0.3.0 || ^0.4.0",
43+
"@jupyterlite/kernel": "^0.2.0 || ^0.3.0 || ^0.4.0",
44+
"@jupyterlite/server": "^0.2.0 || ^0.3.0 || ^0.4.0",
45+
"@jupyterlite/xeus": "^2.1.2",
46+
"@lumino/coreutils": "^2"
47+
},
48+
"devDependencies": {
49+
"@jupyterlab/builder": "^4.1.0",
50+
"@types/json-schema": "^7.0.11",
51+
"@types/react": "^18.0.26",
52+
"@types/react-addons-linked-state-mixin": "^0.14.22",
53+
"css-loader": "^6.7.1",
54+
"npm-run-all": "^4.1.5",
55+
"rimraf": "^5.0.1",
56+
"source-map-loader": "^1.0.2",
57+
"ts-loader": "^9.2.6",
58+
"typescript": "~5.0.2",
59+
"webpack": "^5.87.0",
60+
"yjs": "^13.5.0"
61+
},
62+
"publishConfig": {
63+
"access": "public"
64+
},
65+
"jupyterlab": {
66+
"extension": true,
67+
"outputDir": "../../jupyterlite_xeus/labextension",
68+
"sharedPackages": {
69+
"@jupyterlite/kernel": {
70+
"bundled": false,
71+
"singleton": true
72+
},
73+
"@jupyterlite/server": {
74+
"bundled": false,
75+
"singleton": true
76+
},
77+
"@jupyterlite/contents": {
78+
"bundled": false,
79+
"singleton": true
80+
}
81+
}
82+
},
83+
"jupyterlite": {
84+
"liteExtension": true
85+
}
86+
}

src/index.ts renamed to packages/xeus-extension/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { IBroadcastChannelWrapper } from '@jupyterlite/contents';
1212
import { IKernel, IKernelSpecs } from '@jupyterlite/kernel';
1313

14-
import { WebWorkerKernel } from './web_worker_kernel';
14+
import { WebWorkerKernel } from '@jupyterlite/xeus';
1515
import { IEmpackEnvMetaFile } from './tokens';
1616

1717
/**

packages/xeus-extension/src/tokens.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Token } from '@lumino/coreutils';
2+
3+
export interface IEmpackEnvMetaFile {
4+
/**
5+
* Get empack_env_meta link.
6+
*/
7+
getLink: (kernelspec: Record<string, any>) => Promise<string>;
8+
}
9+
10+
export const IEmpackEnvMetaFile = new Token<IEmpackEnvMetaFile>(
11+
'@jupyterlite/xeus:IEmpackEnvMetaFile'
12+
);

packages/xeus-extension/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "lib",
5+
"rootDir": "src"
6+
},
7+
"include": ["src/**/*"]
8+
}

packages/xeus/package.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "@jupyterlite/xeus",
3+
"version": "2.1.2",
4+
"description": "JupyterLite Xeus kernels",
5+
"keywords": [
6+
"jupyter",
7+
"jupyterlab",
8+
"jupyterlab-extension"
9+
],
10+
"homepage": "https://github.com/jupyterlite/xeus",
11+
"bugs": {
12+
"url": "https://github.com/jupyterlite/xeus/issues"
13+
},
14+
"license": "BSD-3-Clause",
15+
"author": "JupyterLite Contributors",
16+
"files": [
17+
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}"
18+
],
19+
"main": "lib/index.js",
20+
"types": "lib/index.d.ts",
21+
"repository": {
22+
"type": "git",
23+
"url": "https://github.com/jupyterlite/xeus.git"
24+
},
25+
"scripts": {
26+
"build": "jlpm build:lib && jlpm build:worker",
27+
"build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:worker:prod",
28+
"build:worker": "webpack --config worker.webpack.config.js --mode=development",
29+
"build:worker:prod": "webpack --config worker.webpack.config.js --mode=production",
30+
"build:lib": "tsc --sourceMap",
31+
"build:lib:prod": "tsc",
32+
"clean": "jlpm clean:lib",
33+
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
34+
"clean:all": "jlpm clean:lib",
35+
"watch": "run-p watch:src",
36+
"watch:src": "tsc -w --sourceMap"
37+
},
38+
"dependencies": {
39+
"@jupyterlab/coreutils": "^6",
40+
"@jupyterlab/services": "^7",
41+
"@jupyterlite/contents": "^0.2.0 || ^0.3.0 || ^0.4.0",
42+
"@jupyterlite/kernel": "^0.2.0 || ^0.3.0 || ^0.4.0",
43+
"@jupyterlite/server": "^0.2.0 || ^0.3.0 || ^0.4.0",
44+
"@lumino/coreutils": "^2",
45+
"@lumino/signaling": "^2",
46+
"coincident": "^1.2.3",
47+
"comlink": "^4.4.1"
48+
},
49+
"devDependencies": {
50+
"@jupyterlab/builder": "^4.1.0",
51+
"@types/json-schema": "^7.0.11",
52+
"@types/react": "^18.0.26",
53+
"@types/react-addons-linked-state-mixin": "^0.14.22",
54+
"npm-run-all": "^4.1.5",
55+
"rimraf": "^5.0.1",
56+
"source-map-loader": "^1.0.2",
57+
"ts-loader": "^9.2.6",
58+
"typescript": "~5.0.2",
59+
"webpack": "^5.87.0",
60+
"yjs": "^13.5.0"
61+
},
62+
"publishConfig": {
63+
"access": "public"
64+
}
65+
}

src/coincident.worker.ts renamed to packages/xeus/src/coincident.worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
TDriveResponse
1313
} from '@jupyterlite/contents';
1414

15-
import { IXeusWorkerKernel } from './tokens';
15+
import { IXeusWorkerKernel } from './interfaces';
1616
import { XeusRemoteKernel } from './worker';
1717

1818
const workerAPI = coincident(self) as IXeusWorkerKernel;
File renamed without changes.

packages/xeus/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export * from './coincident.worker';
2+
export * from './comlink.worker';
3+
export * from './interfaces';
4+
export * from './web_worker_kernel';
5+
export * from './worker';

src/tokens.ts renamed to packages/xeus/src/interfaces.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
} from '@jupyterlite/contents';
1313

1414
import { IWorkerKernel } from '@jupyterlite/kernel';
15-
import { Token } from '@lumino/coreutils';
1615

1716
/**
1817
* An interface for Xeus workers.
@@ -89,14 +88,3 @@ export namespace IXeusWorkerKernel {
8988
empackEnvMetaLink?: string;
9089
}
9190
}
92-
93-
export interface IEmpackEnvMetaFile {
94-
/**
95-
* Get empack_env_meta link.
96-
*/
97-
getLink: (kernelspec: Record<string, any>) => Promise<string>;
98-
}
99-
100-
export const IEmpackEnvMetaFile = new Token<IEmpackEnvMetaFile>(
101-
'@jupyterlite/xeus:IEmpackEnvMetaFile'
102-
);

src/web_worker_kernel.ts renamed to packages/xeus/src/web_worker_kernel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
TDriveRequest
2121
} from '@jupyterlite/contents';
2222

23-
import { IXeusWorkerKernel } from './tokens';
23+
import { IXeusWorkerKernel } from './interfaces';
2424

2525
export class WebWorkerKernel implements IKernel {
2626
/**

0 commit comments

Comments
 (0)