Skip to content

Commit

Permalink
[wip] Adds support for JupyterLab 2.x (#19)
Browse files Browse the repository at this point in the history
* back to compiling

* more work on files for debugging

* fix another version

* more version work

* remove lumino deps altogether

* strict null checking

* try some more version work

* try some other install stuff

* try more version things

* back to peering

* add custom build scripts for now

* fix missing lumino prefix

* fix more lumino prefixes

* global editor passing again

* clobber some old console.logs

* linting, all tests pass

* fix license viewing

* add an alpha tag, changelog

* work on icons

* clean up icons in test
  • Loading branch information
bollwyvl committed Apr 4, 2020
1 parent b93e5b6 commit d4f027c
Show file tree
Hide file tree
Showing 45 changed files with 2,196 additions and 1,509 deletions.
16 changes: 3 additions & 13 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
bracketSpacing: false
printWidth: 88
semi: true
singleQuote: true

overrides:
- files: "*.ts"
options:
arrowParens: always
trailingComma: es5
- files: "*.css"
options:
singleQuote: false
{
"singleQuote": true
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.0.0-alpha0

- Support JupyterLab 2.0

## v0.5.0

- Support JupyterLab 0.34
Expand Down
12 changes: 8 additions & 4 deletions anaconda-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ name: jupyterlab-fonts-dev

commands:
lab:
unix: jupyter lab --no-browser --debug
unix: python -m scripts.lab
postBuild:
unix: bash postBuild
demo:
unix: ./scripts/build_demo.sh && ./scripts/serve_demo.py
lab:clean:
unix: jupyter lab clean --all
lab:watch:
unix: python -m scripts.watch
lab:build:
unix: python -m scripts.build

env_specs:
jupyterlab-fonts-dev:
Expand All @@ -18,7 +22,7 @@ env_specs:
- flake8
- fonttools
- geckodriver
- jupyterlab >=1.2.2,<1.3
- jupyterlab >=2,<2.1.0a0
- nodejs
- python >=3.7,<3.8.0a0
- robotframework-lint
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- flake8
- fonttools
- geckodriver
- jupyterlab >=1.2.2,<1.3
- jupyterlab >=2,<2.1.0a0
- nodejs
- python >=3.7,<3.8.0a0
- robotframework-lint
Expand Down
4 changes: 4 additions & 0 deletions labex.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
./packages/jupyterlab-fonts
./packages/jupyterlab-font-anonymous-pro
./packages/jupyterlab-font-fira-code
./packages/jupyterlab-font-dejavu-sans-mono
31 changes: 14 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
{
"devDependencies": {
"eslint": "^6.7.2",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-prettier": "^3.1.1",
"json-schema-to-typescript": "^8.2.0",
"lerna": "^3.19.0",
"prettier": "^1.19.1",
"rimraf": "~2.6.2",
"typescript": "~3.5.1",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.0",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-prettier": "^3.0.1",
"lerna": "^3.13.2",
"prettier": "^1.18.2",
"tslint": "^5.15.0",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
"tslint-react": "^4.0.0"
"tslint-react": "^4.1.0",
"typescript": "~3.7.2",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.0"
},
"private": true,
"scripts": {
"bootstrap": "jlpm || jlpm || jlpm && jlpm lint && jlpm bootstrap:py && jlpm bootstrap:js && jlpm bootstrap:lab",
"bootstrap": "jlpm || jlpm || jlpm && jlpm lint && jlpm bootstrap:js",
"bootstrap:js": "jlpm lerna bootstrap && jlpm build",
"bootstrap:lab": "jlpm lab:link && jlpm lab:build",
"bootstrap:py": "python -m pip install -e . --no-deps --ignore-installed",
"build": "jlpm build:schema && lerna run prebuild && jlpm build:ts",
"build:ts": "cd packages && cd _meta && tsc -b",
"build:schema": "lerna run build:schema",
"build:static": "jlpm webpack -p",
"clean": "jlpm clean:lib && jlpm clean:test",
"clean:lib": "lerna exec --parallel -- rimraf lib",
"clean:test": "rimraf _testoutput",
"lab:build": "jupyter lab build",
"lab:link": "lerna exec --scope '@deathbeds/jupyterlab-*' -- jupyter labextension install . --no-build",
"lint": "jlpm lint:py && jlpm lint:ts && jlpm lint:sh",
"lint:py": "black nbjss setup.py && flake8 nbjss setup.py",
"lint:robot": "python -m robot.tidy --inplace tests/{acceptance,resources}/*.robot && rflint --configure TooManyTestSteps:40 --configure TooFewKeywordSteps:0 tests/**/*.robot",
"lint:robot": "python -m robot.tidy --inplace tests/**/*.robot && rflint --configure TooManyTestSteps:40 --configure TooFewKeywordSteps:0 tests/**/*.robot",
"lint:sh": "beautysh -i 2 postBuild",
"lint:ts": "jlpm lint:prettier && jlpm lint:tslint",
"lint:prettier": "prettier --write *.json *.md *.yml && prettier --write 'packages/**/*.{ts,tsx,css,json,md}'",
"lint:tslint": "tslint --fix -c tslint.json --project tsconfigbase.json 'packages/**/*{.ts,.tsx}'",
"test": "jlpm test:robot",
"test:robot": "python -m robot -d _testoutput tests/acceptance",
"test:robot": "python -m robot -d _testoutput -X tests/acceptance",
"watch:schema": "jlpm lerna run watch:schema --parallel",
"watch": "cd packages/_meta && tsc -b -w"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/_meta/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@deathbeds/META-jupyterlab-fonts",
"version": "0.7.0",
"version": "1.0.0-alpha0",
"dependencies": {
"@deathbeds/jupyterlab-fonts": "^0.7.0",
"@deathbeds/jupyterlab-font-anonymous-pro": "^0.7.0",
"@deathbeds/jupyterlab-font-dejavu-sans-mono": "^0.7.0",
"@deathbeds/jupyterlab-font-fira-code": "^0.7.0"
"@deathbeds/jupyterlab-fonts": "file:../jupyterlab-fonts",
"@deathbeds/jupyterlab-font-anonymous-pro": "file:../jupyterlab-font-anonymous-pro",
"@deathbeds/jupyterlab-font-dejavu-sans-mono": "file:../jupyterlab-font-dejavu-sans-mono",
"@deathbeds/jupyterlab-font-fira-code": "file:../jupyterlab-font-fira-code"
}
}
13 changes: 5 additions & 8 deletions packages/jupyterlab-font-anonymous-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
"bugs": {
"url": "https://github.com/deathbeds/jupyterlab-fonts/issues"
},
"peerDependencies": {
"@deathbeds/jupyterlab-fonts": "^0.7.0",
"@jupyterlab/application": "1"
},
"dependencies": {
"@jupyterlab/application": "~2.0.2",
"typeface-anonymous-pro": "^0.0.54"
},
"devDependencies": {
"@jupyterlab/application": "1"
"peerDependencies": {
"@deathbeds/jupyterlab-fonts": "1"
},
"description": "Anonymous Pro Fonts for JupyterLab",
"files": [
"{lib,style}/*.{d.ts,js,css}",
"{lib,style,src}/**/*.{d.ts,js,css,ts,tsx,js.map}",
"{README.md,LICENSE}",
"vendor/anonymous-pro/LICENSE"
],
Expand All @@ -35,5 +32,5 @@
"url": "https://github.com/deathbeds/jupyterlab-fonts.git"
},
"types": "lib/index.d.ts",
"version": "0.7.0"
"version": "1.0.0-alpha0"
}
2 changes: 1 addition & 1 deletion packages/jupyterlab-font-anonymous-pro/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
id: '@deathbeds/jupyterlab-font-anonymous-pro',
autoStart: true,
requires: [IFontManager],
activate: async function(_app: JupyterLab, fonts: IFontManager) {
activate: function(_app: JupyterLab, fonts: IFontManager) {
fonts.ready
.then(() => {
register(fonts);
Expand Down
16 changes: 8 additions & 8 deletions packages/jupyterlab-font-anonymous-pro/style/index.css
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
@font-face {
font-family: "Fira Code Light";
src: url("~firacode/distr/woff2/FiraCode-Light.woff2") format("woff2");
font-family: 'Fira Code Light';
src: url('~firacode/distr/woff2/FiraCode-Light.woff2') format('woff2');
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: "Fira Code Regular";
src: url("~firacode/distr/woff2/FiraCode-Regular.woff2") format("woff2");
font-family: 'Fira Code Regular';
src: url('~firacode/distr/woff2/FiraCode-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: "Fira Code Medium";
src: url("~firacode/distr/woff2/FiraCode-Medium.woff2") format("woff2");
font-family: 'Fira Code Medium';
src: url('~firacode/distr/woff2/FiraCode-Medium.woff2') format('woff2');
font-weight: 500;
font-style: normal;
}

@font-face {
font-family: "Fira Code Bold";
src: url("~firacode/distr/woff2/FiraCode-Bold.woff2") format("woff2");
font-family: 'Fira Code Bold';
src: url('~firacode/distr/woff2/FiraCode-Bold.woff2') format('woff2');
font-weight: 700;
font-style: normal;
}
17 changes: 9 additions & 8 deletions packages/jupyterlab-font-dejavu-sans-mono/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
"bugs": {
"url": "https://github.com/deathbeds/jupyterlab-fonts/issues"
},
"peerDependencies": {
"@deathbeds/jupyterlab-fonts": "^0.7.0",
"@jupyterlab/application": "1"
},
"devDependencies": {
"dejavu-fonts-ttf": "2.37.3",
"@jupyterlab/application": "1"
"dejavu-fonts-ttf": "2.37.3"
},
"dependencies": {
"@jupyterlab/application": "~2.0.2"
},
"peerDependencies": {
"@deathbeds/jupyterlab-fonts": "1"
},
"description": "Dejavu Sans Mono Fonts for JupyterLab",
"files": [
"{lib,style}/**/*.{d.ts,js,css,woff2}",
"{lib,style,src}/**/*.{d.ts,js,css,woff2,ts,tsx,js.map}",
"{README.md,LICENSE}",
"vendor/dejavu-fonts-ttf/LICENSE"
],
Expand All @@ -33,7 +34,7 @@
"url": "https://github.com/deathbeds/jupyterlab-fonts.git"
},
"types": "lib/index.d.ts",
"version": "0.7.0",
"version": "1.0.0-alpha0",
"scripts": {
"prebuild": "python scripts/convert.py"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyterlab-font-dejavu-sans-mono/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
id: '@deathbeds/jupyterlab-font-dejavu-sans-mono',
autoStart: true,
requires: [IFontManager],
activate: async function(_app: JupyterLab, fonts: IFontManager) {
activate: function(_app: JupyterLab, fonts: IFontManager) {
fonts.ready
.then(() => {
register(fonts);
Expand Down
14 changes: 5 additions & 9 deletions packages/jupyterlab-font-fira-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
"bugs": {
"url": "https://github.com/deathbeds/jupyterlab-fonts/issues"
},
"peerDependencies": {
"@deathbeds/jupyterlab-fonts": "^0.7.0",
"@jupyterlab/application": "1"
},
"dependencies": {
"@jupyterlab/application": "~2.0.2",
"firacode": "^2.0.0"
},
"devDependencies": {
"@deathbeds/jupyterlab-fonts": "^0.7.0",
"@jupyterlab/application": "1"
"peerDependencies": {
"@deathbeds/jupyterlab-fonts": "1"
},
"description": "Fira Code Fonts for JupyterLab",
"files": [
"{lib,style}/*.{d.ts,js,css}",
"{lib,style,src}/*.{d.ts,js,css,ts,tsx,js.map}",
"{README.md,LICENSE}"
],
"jupyterlab": {
Expand All @@ -35,5 +31,5 @@
"url": "https://github.com/deathbeds/jupyterlab-fonts.git"
},
"types": "lib/index.d.ts",
"version": "0.7.0"
"version": "1.0.0-alpha0"
}
2 changes: 1 addition & 1 deletion packages/jupyterlab-font-fira-code/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
id: '@deathbeds/jupyterlab-font-fira-code',
autoStart: true,
requires: [IFontManager],
activate: async function(_app: JupyterLab, fonts: IFontManager) {
activate: function(_app: JupyterLab, fonts: IFontManager) {
fonts.ready
.then(() => {
register(fonts);
Expand Down
16 changes: 8 additions & 8 deletions packages/jupyterlab-font-fira-code/style/index.css
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
@font-face {
font-family: "Fira Code Light";
src: url("~firacode/distr/woff2/FiraCode-Light.woff2") format("woff2");
font-family: 'Fira Code Light';
src: url('~firacode/distr/woff2/FiraCode-Light.woff2') format('woff2');
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: "Fira Code Regular";
src: url("~firacode/distr/woff2/FiraCode-Regular.woff2") format("woff2");
font-family: 'Fira Code Regular';
src: url('~firacode/distr/woff2/FiraCode-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: "Fira Code Medium";
src: url("~firacode/distr/woff2/FiraCode-Medium.woff2") format("woff2");
font-family: 'Fira Code Medium';
src: url('~firacode/distr/woff2/FiraCode-Medium.woff2') format('woff2');
font-weight: 500;
font-style: normal;
}

@font-face {
font-family: "Fira Code Bold";
src: url("~firacode/distr/woff2/FiraCode-Bold.woff2") format("woff2");
font-family: 'Fira Code Bold';
src: url('~firacode/distr/woff2/FiraCode-Bold.woff2') format('woff2');
font-weight: 700;
font-style: normal;
}
18 changes: 7 additions & 11 deletions packages/jupyterlab-fonts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"description": "Code Fonts for JupyterLab",
"files": [
"{lib,style,schema}/**/*.{d.ts,js,css,svg,json}",
"{lib,style,schema,src}/**/*.{d.ts,js,css,svg,json,ts,tsx,js.map}",
"{LICENSE,README.md}"
],
"keywords": [
Expand All @@ -22,28 +22,24 @@
"url": "https://github.com/deathbeds/jupyterlab-fonts.git"
},
"types": "lib/index.d.ts",
"version": "0.7.0",
"version": "1.0.0-alpha0",
"dependencies": {
"@jupyterlab/application": "1",
"@jupyterlab/mainmenu": "1",
"@jupyterlab/notebook": "1",
"@phosphor/commands": "1",
"@phosphor/coreutils": "1",
"@phosphor/widgets": "1",
"jss-preset-default": "^4.5.0",
"jss": "^9.8.7"
"jss": "^9.8.7",
"@jupyterlab/application": "~2.0.2",
"@jupyterlab/mainmenu": "~2.0.2",
"@jupyterlab/notebook": "~2.0.2"
},
"jupyterlab": {
"extension": "lib/extension.js",
"schemaDir": "schema"
},
"devDependencies": {
"@types/jss": "^9.5.3",
"dtsgenerator": "^1.0.0",
"watch": "^1.0.2"
},
"scripts": {
"build:schema": "dtsgen schema/fonts.json | prettier --config=../../.prettierrc --stdin --stdin-filepath src/_schema.d.ts > src/_schema.d.ts",
"build:schema": "json2ts schema/fonts.json --strictIndexSignatures | prettier --config=../../.prettierrc --stdin --stdin-filepath src/_schema.d.ts > src/_schema.d.ts",
"prebuild": "jlpm build:schema && jlpm copy:schema",
"copy:schema": "mkdir -p lib && cp src/_schema.d.ts lib/",
"watch": "tsc -w",
Expand Down
Loading

0 comments on commit d4f027c

Please sign in to comment.