Skip to content

Commit

Permalink
Update extension template
Browse files Browse the repository at this point in the history
Update integration test ref snapshots
  • Loading branch information
fcollonval committed Aug 3, 2023
1 parent 0cedb7e commit 1d4d743
Show file tree
Hide file tree
Showing 49 changed files with 5,583 additions and 2,109 deletions.
39 changes: 0 additions & 39 deletions .eslintrc.js

This file was deleted.

1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

12 changes: 0 additions & 12 deletions .stylelintrc

This file was deleted.

21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,17 @@
},
"devDependencies": {
"@jupyterlab/buildutils": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-prettier": "^4.2.1",
"lerna": "^6.6.0",
"prettier": "^2.8.7",
"rimraf": "^4.4.1",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^5.0.0",
"lerna": "^7.1.0",
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
"stylelint": "^15.10.1",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-recommended": "^8.0.0",
"stylelint-config-standard": "^26.0.0",
"stylelint-prettier": "^2.0.0"
"stylelint-config-recommended": "^13.0.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-prettier": "^4.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/fasta-extension/.copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v4.0.5
_commit: v4.1.0
_src_path: https://github.com/jupyterlab/extension-template
author_email: jupyter@googlegroups.com
author_name: Project Jupyter
Expand All @@ -13,7 +13,7 @@ mimetype: ''
mimetype_name: ''
project_short_description: Fasta renderer for JupyterLab
python_name: jupyterlab_fasta
repository: https://github.com/jupyterlab/jupyter-renderers.git
repository: https://github.com/jupyterlab/jupyter-renderers
test: true
viewer_name: ''

9 changes: 9 additions & 0 deletions packages/fasta-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,12 @@ jupyter lab build --minimize=False
```bash
pip uninstall jupyterlab-fasta
```

### Testing the extension

#### Integration tests

This extension uses [Playwright](https://playwright.dev/docs/intro) for the integration tests (aka user level tests).
More precisely, the JupyterLab helper [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) is used to handle testing the extension in JupyterLab.

More information are provided within the [ui-tests](./ui-tests/README.md) README.
10 changes: 9 additions & 1 deletion packages/fasta-extension/jupyterlab_fasta/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
from ._version import __version__
try:
from ._version import __version__
except ImportError:
# Fallback when using the package in dev mode without installing
# in editable mode with pip. It is highly recommended to install
# the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs
import warnings
warnings.warn("Importing 'jupyterlab_fasta' outside a proper installation.")
__version__ = "dev"


def _jupyter_labextension_paths():
Expand Down
114 changes: 103 additions & 11 deletions packages/fasta-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,120 @@
"devDependencies": {
"@jupyterlab/builder": "^4.0.0",
"@types/json-schema": "^7.0.11",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"@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.7.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^5.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.7",
"rimraf": "^4.4.1",
"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-prettier": "^9.0.4",
"stylelint-config-recommended": "^8.0.0",
"stylelint-config-standard": "^26.0.0",
"stylelint-prettier": "^2.0.0",
"stylelint-config-recommended": "^13.0.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-prettier": "^4.0.0",
"typescript": "~5.0.2",
"yjs": "^13.5.40"
},
"jupyterlab": {
"mimeExtension": true,
"outputDir": "jupyterlab_fasta/labextension"
},
"styleModule": "style/index.js"
"sideEffects": [
"style/*.css",
"style/index.js"
],
"styleModule": "style/index.js",
"eslintIgnore": [
"node_modules",
"dist",
"coverage",
"**/*.d.ts",
"tests",
"**/__tests__",
"ui-tests"
],
"eslintConfig": {
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.eslint.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"
}
},
"prettier": {
"singleQuote": true,
"trailingComma": "none",
"arrowParens": "avoid",
"endOfLine": "auto",
"overrides": [
{
"files": "package.json",
"options": {
"tabWidth": 4
}
}
]
},
"stylelint": {
"extends": [
"stylelint-config-recommended",
"stylelint-config-standard",
"stylelint-prettier/recommended"
],
"rules": {
"property-no-vendor-prefix": null,
"selector-no-vendor-prefix": null,
"value-no-vendor-prefix": null
}
}
}
2 changes: 1 addition & 1 deletion packages/fasta-extension/setup.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('setuptools').setup()
__import__("setuptools").setup()
2 changes: 1 addition & 1 deletion packages/fasta-extension/style/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Distributed under the terms of the Modified BSD License.
*/

@import 'msa.css';
@import url('msa.css');

/* Add CSS variables to :root */
:root {
Expand Down
2 changes: 1 addition & 1 deletion packages/fasta-extension/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Distributed under the terms of the Modified BSD License.
*/

@import 'base.css';
@import url('base.css');
3 changes: 1 addition & 2 deletions packages/fasta-extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"rootDir": "src",
"strict": true,
"strictNullChecks": true,
"target": "ES2018",
"types": ["jest"]
"target": "ES2018"
},
"include": ["src/*"]
}
4 changes: 2 additions & 2 deletions packages/geojson-extension/.copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v4.0.5
_commit: v4.1.0
_src_path: https://github.com/jupyterlab/extension-template
author_email: jupyter@googlegroups.com
author_name: Project Jupyter
Expand All @@ -13,7 +13,7 @@ mimetype: ''
mimetype_name: ''
project_short_description: GeoJSON renderer for JupyterLab
python_name: jupyterlab_geojson
repository: https://github.com/jupyterlab/jupyter-renderers.git
repository: https://github.com/jupyterlab/jupyter-renderers
test: true
viewer_name: ''

13 changes: 13 additions & 0 deletions packages/geojson-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,16 @@ jupyter lab build --minimize=False
```bash
pip uninstall jupyterlab-geojson
```

In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
folder is located. Then you can remove the symlink named `@jupyterlab/geojson-extension` within that folder.

### Testing the extension

#### Integration tests

This extension uses [Playwright](https://playwright.dev/docs/intro) for the integration tests (aka user level tests).
More precisely, the JupyterLab helper [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) is used to handle testing the extension in JupyterLab.

More information are provided within the [ui-tests](./ui-tests/README.md) README.
10 changes: 9 additions & 1 deletion packages/geojson-extension/jupyterlab_geojson/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
from ._version import __version__
try:
from ._version import __version__
except ImportError:
# Fallback when using the package in dev mode without installing
# in editable mode with pip. It is highly recommended to install
# the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs
import warnings
warnings.warn("Importing 'jupyterlab_geojson' outside a proper installation.")
__version__ = "dev"


def _jupyter_labextension_paths():
Expand Down
Loading

0 comments on commit 1d4d743

Please sign in to comment.