-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from fcollonval/ft/jlab3
Port to JupyterLab 3
- Loading branch information
Showing
28 changed files
with
354 additions
and
874 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
dist | ||
coverage | ||
**/*.d.ts | ||
tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module.exports = { | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended' | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
sourceType: 'module' | ||
}, | ||
plugins: ['@typescript-eslint'], | ||
rules: { | ||
'@typescript-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
'selector': 'interface', | ||
'format': ['PascalCase'], | ||
'custom': { | ||
'regex': '^I[A-Z]', | ||
'match': true | ||
} | ||
} | ||
], | ||
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }], | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-namespace': 'off', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'@typescript-eslint/quotes': [ | ||
'error', | ||
'single', | ||
{ avoidEscape: true, allowTemplateLiterals: false } | ||
], | ||
curly: ['error', 'all'], | ||
eqeqeq: 'error', | ||
'prefer-arrow-callback': 'error' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
**/node_modules | ||
**/lib | ||
**/package.json | ||
jupyterlab-snippets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"arrowParens": "avoid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
name: jupyterlan-snippets | ||
# a mybinder.org-ready environment for demoing jupyterlab-snippets | ||
# this environment may also be used locally on Linux/MacOS/Windows, e.g. | ||
# | ||
# conda env update --file binder/environment.yml | ||
# conda activate jupyterlab-snippets-demo | ||
# | ||
name: jupyterlab-snippets-demo | ||
|
||
channels: | ||
- conda-forge | ||
|
||
dependencies: | ||
- jupyterlab-snippets=0.3.2 | ||
- jupyterlab >=2 | ||
- nodejs | ||
# runtime dependencies | ||
- python >=3.8,<3.9.0a0 | ||
- jupyterlab >=3,<4.0.0a0 | ||
# labextension build dependencies | ||
- nodejs >=14,<15 | ||
- pip | ||
- wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"packageManager": "python", | ||
"packageName": "jupyterlab-snippets", | ||
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab-snippets" | ||
} |
4 changes: 2 additions & 2 deletions
4
jupyter-config/jupyterlab-snippets.json → ...otebook_config.d/jupyterlab_snippets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"NotebookApp": { | ||
"nbserver_extensions": { | ||
"jupyterlab-snippets": true | ||
"jupyterlab_snippets": true | ||
} | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
jupyter-config/jupyter_server_config.d/jupyterlab_snippets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"ServerApp": { | ||
"jpserver_extensions": { | ||
"jupyterlab_snippets": true | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
from ._version import __version__ | ||
from .handlers import setup_handlers | ||
from .loader import SnippetsLoader | ||
|
||
HERE = Path(__file__).parent.resolve() | ||
|
||
with (HERE / "labextension" / "package.json").open() as fid: | ||
data = json.load(fid) | ||
|
||
|
||
def _jupyter_labextension_paths(): | ||
return [{"src": "labextension", "dest": data["name"]}] | ||
|
||
|
||
def _jupyter_server_extension_points(): | ||
return [{"module": "jupyterlab_snippets"}] | ||
|
||
|
||
def _load_jupyter_server_extension(server_app): | ||
"""Registers the API handler to receive HTTP requests from the frontend extension. | ||
Parameters | ||
---------- | ||
server_app: jupyterlab.labapp.LabApp | ||
JupyterLab application instance | ||
""" | ||
loader = SnippetsLoader() | ||
setup_handlers(server_app.web_app, loader) | ||
|
||
|
||
# For backward compatibility with the classical notebook | ||
load_jupyter_server_extension = _load_jupyter_server_extension |
Oops, something went wrong.