Skip to content

Commit 99be2d7

Browse files
authored
Merge pull request #240 from jahn96/dev_branch
Code refactoring + snippet id bug fixes
2 parents 5713c63 + a2e7211 commit 99be2d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4936
-3182
lines changed

.eslintrc.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ module.exports = {
2626
},
2727
plugins: ['@typescript-eslint', 'react'],
2828
rules: {
29-
'@typescript-eslint/interface-name-prefix': [
30-
'error',
31-
{ prefixWithI: 'always' }
32-
],
3329
'@typescript-eslint/camelcase': 'off',
3430
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
3531
'@typescript-eslint/no-explicit-any': 'off',

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v2
1515
- name: Install node
16-
uses: actions/setup-node@v1
16+
uses: actions/setup-node@v2
1717
with:
18-
node-version: '10.x'
18+
node-version: '16.x'
1919
- name: Install Python
2020
uses: actions/setup-python@v2
2121
with:
@@ -29,5 +29,5 @@ jobs:
2929
jlpm run eslint:check
3030
python -m pip install .
3131
32-
jupyter labextension list 2>&1 | grep -ie "jupyterlab-code-snippets.*OK"
32+
jupyter labextension list
3333
python -m jupyterlab.browser_check

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "chrome",
9+
"request": "launch",
10+
"name": "Launch Chrome against localhost",
11+
"url": "http://localhost:8080",
12+
"webRoot": "${workspaceFolder}"
13+
}
14+
]
15+
}

.vscode/settings.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"workbench.colorCustomizations": {
3+
"activityBar.activeBackground": "#1f6fd0",
4+
"activityBar.background": "#1f6fd0",
5+
"activityBar.foreground": "#e7e7e7",
6+
"activityBar.inactiveForeground": "#e7e7e799",
7+
"activityBarBadge.background": "#ee90bb",
8+
"activityBarBadge.foreground": "#15202b",
9+
"commandCenter.border": "#e7e7e799",
10+
"sash.hoverBorder": "#1f6fd0",
11+
"statusBar.background": "#1857a4",
12+
"statusBar.foreground": "#e7e7e7",
13+
"statusBarItem.hoverBackground": "#1f6fd0",
14+
"statusBarItem.remoteBackground": "#1857a4",
15+
"statusBarItem.remoteForeground": "#e7e7e7",
16+
"titleBar.activeBackground": "#1857a4",
17+
"titleBar.activeForeground": "#e7e7e7",
18+
"titleBar.inactiveBackground": "#1857a499",
19+
"titleBar.inactiveForeground": "#e7e7e799"
20+
},
21+
"peacock.remoteColor": "#1857a4"
22+
}

MANIFEST.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
include LICENSE
22
include README.md
33
include pyproject.toml
4-
5-
include jupyter-config/code_snippets.json
4+
include install.json
65

76
include package.json
87
include ts*.json
9-
include code_snippets/labextension/*.tgz
8+
graft jupyterlab-code-snippets/labextension
109

1110
# Javascript files
1211
graft src

install.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"packageManager": "python",
3-
"packageName": "code_snippet",
4-
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package code_snippet"
3+
"packageName": "jupyterlab-code-snippets",
4+
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab-code-snippets"
55
}

junit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<testsuites name="jest tests" tests="0" failures="0" time="0.002">
2+
<testsuites name="jest tests" tests="0" failures="0" time="0">
33
</testsuites>

package.json

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyterlab-code-snippets",
3-
"version": "2.1.1",
3+
"version": "2.2.0",
44
"description": "EXPERIMENTAL: Save, reuse, and share code snippets using JupyterLab Code Snippets",
55
"keywords": [
66
"jupyter",
@@ -12,7 +12,10 @@
1212
"url": "https://github.com/jupytercalpoly/jupyterlab-code-snippets.git/issues"
1313
},
1414
"license": "BSD-3-Clause",
15-
"author": "Jay Ahn, Kiran Pinnipati",
15+
"author": {
16+
"name": "Jay Ahn, Kiran Pinnipati",
17+
"email": "aju960219@gmail.com"
18+
},
1619
"files": [
1720
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
1821
"style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
@@ -24,23 +27,22 @@
2427
"style": "style/index.css",
2528
"repository": {
2629
"type": "git",
27-
"url": "https://github.com/jupytercalpoly/jupyterlab-code-snippets.git.git"
30+
"url": "https://github.com/jupytercalpoly/jupyterlab-code-snippets.git"
2831
},
2932
"scripts": {
3033
"build": "jlpm run build:lib && jlpm run build:labextension:dev",
31-
"build:all": "jlpm run build:labextension",
3234
"build:labextension": "jupyter labextension build .",
3335
"build:labextension:dev": "jupyter labextension build --development True .",
3436
"build:lib": "tsc",
35-
"build:prod": "jlpm run build:lib && jlpm run build:labextension",
37+
"build:prod": "jlpm run clean && jlpm run build:lib && jlpm run build:labextension",
3638
"clean": "jlpm run clean:lib",
37-
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
38-
"clean:labextension": "rimraf code_snippet/labextension",
39+
"clean:labextension": "rimraf jupyterlab-code-snippets/labextension",
3940
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
41+
"clean:all": "jlpm clean:lib && jlpm clean:labextension",
4042
"eslint": "eslint . --ext .ts,.tsx --fix",
4143
"eslint:check": "eslint . --ext .ts,.tsx",
4244
"format": "prettier \"src/**/*.{ts, tsx}\" --check",
43-
"install:extension": "jupyter labextension develop --overwrite .",
45+
"install:extension": "jlpm build",
4446
"prepare": "jlpm run clean && jlpm run build:prod",
4547
"watch": "run-p watch:src watch:labextension",
4648
"watch:labextension": "jupyter labextension watch .",
@@ -53,49 +55,50 @@
5355
"postpublish": "pinst --enable"
5456
},
5557
"dependencies": {
56-
"@jupyterlab/application": "^3.0.10",
57-
"@jupyterlab/apputils": "^3.0.8",
58-
"@jupyterlab/cells": "^3.0.10",
59-
"@jupyterlab/celltags": "^3.0.10",
60-
"@jupyterlab/docmanager": "^3.0.10",
61-
"@jupyterlab/docregistry": "^3.0.10",
62-
"@jupyterlab/fileeditor": "^3.0.10",
63-
"@jupyterlab/nbconvert-css": "^3.0.10",
64-
"@jupyterlab/nbformat": "^3.0.5",
65-
"@jupyterlab/notebook": "^3.0.10",
66-
"@jupyterlab/rendermime": "^3.0.9",
67-
"@jupyterlab/services": "^6.0.8",
58+
"@jupyterlab/application": "^3.5.2",
59+
"@jupyterlab/apputils": "^3.5.2",
60+
"@jupyterlab/cells": "^3.5.0",
61+
"@jupyterlab/celltags": "^3.5.2",
62+
"@jupyterlab/docmanager": "^3.5.2",
63+
"@jupyterlab/docregistry": "^3.5.0",
64+
"@jupyterlab/fileeditor": "^3.5.2",
65+
"@jupyterlab/nbconvert-css": "^3.5.2",
66+
"@jupyterlab/nbformat": "^3.5.2",
67+
"@jupyterlab/notebook": "^3.5.2",
68+
"@jupyterlab/rendermime": "^3.5.2",
69+
"@jupyterlab/services": "^6.5.2",
70+
"@jupyterlab/coreutils": "5.5.2",
6871
"@lumino/algorithm": "^1.3.3",
6972
"@lumino/coreutils": "^1.5.3",
7073
"@lumino/dragdrop": "^1.7.1",
7174
"@lumino/messaging": "^1.4.3",
7275
"@lumino/properties": "^1.2.3",
7376
"@lumino/signaling": "^1.4.3",
74-
"@lumino/widgets": "^1.13.2"
77+
"@lumino/widgets": "^1.36.0",
78+
"@types/react": "^16.9.56",
79+
"@types/react-dom": "^16.9.9"
7580
},
7681
"devDependencies": {
7782
"@babel/core": "^7",
7883
"@babel/preset-env": "^7.12.1",
7984
"@babel/preset-react": "^7.12.5",
80-
"@jupyterlab/builder": "^3.0.0-rc.13",
81-
"@jupyterlab/testutils": "^3.0.10",
85+
"@jupyterlab/builder": "^3.5.2",
86+
"@jupyterlab/testutils": "^3.5.2",
8287
"@testing-library/react": "^11.1.1",
8388
"@types/enzyme": "^3.10.8",
8489
"@types/enzyme-adapter-react-16": "^1.0.6",
8590
"@types/jest": "^26.0.15",
8691
"@types/node-fetch": "^2.5.7",
87-
"@types/react": "^16.9.56",
88-
"@types/react-dom": "^16.9.9",
8992
"@types/react-test-renderer": "^16.9.3",
90-
"@typescript-eslint/eslint-plugin": "^2.27.0",
91-
"@typescript-eslint/parser": "^2.27.0",
93+
"@typescript-eslint/eslint-plugin": "^4.8.1",
94+
"@typescript-eslint/parser": "^4.8.1",
9295
"babel-jest": "^26.6.3",
9396
"cypress": "^6.5.0",
9497
"enzyme": "^3.11.0",
9598
"enzyme-adapter-react-16": "^1.15.5",
96-
"eslint": "^7.5.0",
97-
"eslint-config-prettier": "^6.10.1",
98-
"eslint-plugin-prettier": "^3.1.2",
99+
"eslint": "^7.14.0",
100+
"eslint-config-prettier": "^6.15.0",
101+
"eslint-plugin-prettier": "^3.1.4",
99102
"eslint-plugin-react": "^7.20.4",
100103
"husky": "^5.1.3",
101104
"jest": "^26.6.3",

pyproject.toml

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,75 @@
11
[build-system]
2-
requires = ["jupyter_packaging~=0.7.9", "jupyterlab>=3.0.0rc13,==3.*", "setuptools>=40.8.0", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling>=1.4.0", "jupyterlab>=3.4.7,<4.0.0", "hatch-nodejs-version"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "jupyterlab-code-snippets"
7+
readme = "README.md"
8+
license = { file = "LICENSE" }
9+
requires-python = ">=3.7"
10+
classifiers = [
11+
"Framework :: Jupyter",
12+
"Framework :: Jupyter :: JupyterLab",
13+
"Framework :: Jupyter :: JupyterLab :: 3",
14+
"Framework :: Jupyter :: JupyterLab :: Extensions",
15+
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
16+
"License :: OSI Approved :: BSD License",
17+
"Programming Language :: Python",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.7",
20+
"Programming Language :: Python :: 3.8",
21+
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
24+
]
25+
dependencies = [
26+
]
27+
dynamic = ["version", "description", "authors", "urls", "keywords"]
28+
29+
[project.optional-dependencies]
30+
test = [
31+
"coverage",
32+
"pytest",
33+
"pytest-asyncio",
34+
"pytest-cov",
35+
"pytest-tornasync"
36+
]
37+
38+
[tool.hatch.version]
39+
source = "nodejs"
40+
41+
[tool.hatch.metadata.hooks.nodejs]
42+
fields = ["description", "authors", "urls"]
43+
44+
[tool.hatch.build.targets.sdist]
45+
artifacts = ["jupyterlab-code-snippets/labextension"]
46+
exclude = [".github", "binder"]
47+
48+
[tool.hatch.build.targets.wheel.shared-data]
49+
"jupyterlab-code-snippets/labextension" = "share/jupyter/labextensions/jupyterlab-code-snippets"
50+
"install.json" = "share/jupyter/labextensions/jupyterlab-code-snippets/install.json"
51+
52+
[tool.hatch.build.hooks.version]
53+
path = "jupyterlab-code-snippets/_version.py"
54+
55+
[tool.hatch.build.hooks.jupyter-builder]
56+
dependencies = ["hatch-jupyter-builder>=0.5"]
57+
build-function = "hatch_jupyter_builder.npm_builder"
58+
ensured-targets = [
59+
"jupyterlab-code-snippets/labextension/static/style.js",
60+
"jupyterlab-code-snippets/labextension/package.json",
61+
]
62+
skip-if-exists = ["jupyterlab-code-snippets/labextension/static/style.js"]
63+
64+
[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
65+
build_cmd = "build:prod"
66+
npm = ["jlpm"]
67+
68+
[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
69+
build_cmd = "install:extension"
70+
npm = ["jlpm"]
71+
source_dir = "src"
72+
build_dir = "jupyterlab-code-snippets/labextension"
73+
74+
[tool.jupyter-releaser.options]
75+
version_cmd = "hatch version"

0 commit comments

Comments
 (0)