Skip to content

Commit 24df8f4

Browse files
committed
initial commit
0 parents  commit 24df8f4

27 files changed

+14434
-0
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
coverage
4+
**/*.d.ts
5+
tests

.eslintrc.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
extends: [
3+
'eslint:recommended',
4+
'plugin:@typescript-eslint/eslint-recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:prettier/recommended'
7+
],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: {
10+
project: 'tsconfig.json',
11+
sourceType: 'module'
12+
},
13+
plugins: ['@typescript-eslint'],
14+
rules: {
15+
'@typescript-eslint/naming-convention': [
16+
'error',
17+
{
18+
'selector': 'interface',
19+
'format': ['PascalCase'],
20+
'custom': {
21+
'regex': '^I[A-Z]',
22+
'match': true
23+
}
24+
}
25+
],
26+
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
27+
'@typescript-eslint/no-explicit-any': 'off',
28+
'@typescript-eslint/no-namespace': 'off',
29+
'@typescript-eslint/no-use-before-define': 'off',
30+
'@typescript-eslint/quotes': [
31+
'error',
32+
'single',
33+
{ avoidEscape: true, allowTemplateLiterals: false }
34+
],
35+
curly: ['error', 'all'],
36+
eqeqeq: 'error',
37+
'prefer-arrow-callback': 'error'
38+
}
39+
};

.github/workflows/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: main
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Base Setup
17+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
18+
19+
- name: Install dependencies
20+
run: python -m pip install -U jupyterlab~=3.1 check-manifest
21+
22+
- name: Build the extension
23+
run: |
24+
set -eux
25+
jlpm
26+
jlpm run eslint:check
27+
python -m pip install .
28+
29+
jupyter labextension list 2>&1 | grep -ie "jupyterlab-blockly.*OK"
30+
python -m jupyterlab.browser_check
31+
32+
check-manifest -v
33+
34+
pip install build
35+
python -m build --sdist
36+
cp dist/*.tar.gz myextension.tar.gz
37+
pip uninstall -y "jupyterlab_blockly" jupyterlab
38+
rm -rf myextension
39+
40+
- uses: actions/upload-artifact@v2
41+
with:
42+
name: myextension-sdist
43+
path: myextension.tar.gz
44+
45+
test_isolated:
46+
needs: build
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v2
52+
- name: Install Python
53+
uses: actions/setup-python@v2
54+
with:
55+
python-version: '3.8'
56+
architecture: 'x64'
57+
- uses: actions/download-artifact@v2
58+
with:
59+
name: myextension-sdist
60+
- name: Install and Test
61+
run: |
62+
set -eux
63+
# Remove NodeJS, twice to take care of system and locally installed node versions.
64+
sudo rm -rf $(which node)
65+
sudo rm -rf $(which node)
66+
pip install myextension.tar.gz
67+
pip install jupyterlab
68+
jupyter labextension list 2>&1 | grep -ie "jupyterlab-blockly.*OK"
69+
python -m jupyterlab.browser_check --no-chrome-test

.github/workflows/check-release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
check_release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
- name: Install Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 3.9
23+
architecture: 'x64'
24+
- name: Install node
25+
uses: actions/setup-node@v2
26+
with:
27+
node-version: '14.x'
28+
29+
30+
- name: Get pip cache dir
31+
id: pip-cache
32+
run: |
33+
echo "::set-output name=dir::$(pip cache dir)"
34+
- name: Cache pip
35+
uses: actions/cache@v1
36+
with:
37+
path: ${{ steps.pip-cache.outputs.dir }}
38+
key: ${{ runner.os }}-pip-${{ hashFiles('package.json') }}
39+
restore-keys: |
40+
${{ runner.os }}-pip-
41+
- name: Cache checked links
42+
uses: actions/cache@v2
43+
with:
44+
path: ~/.cache/pytest-link-check
45+
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links
46+
restore-keys: |
47+
${{ runner.os }}-linkcheck-
48+
- name: Upgrade packaging dependencies
49+
run: |
50+
pip install --upgrade pip setuptools wheel jupyter-packaging~=0.10 --user
51+
- name: Install Dependencies
52+
run: |
53+
pip install .
54+
- name: Check Release
55+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
56+
with:
57+
token: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- name: Upload Distributions
60+
uses: actions/upload-artifact@v2
61+
with:
62+
name: jupyterlab_blockly-releaser-dist-${{ github.run_number }}
63+
path: .jupyter_releaser_checkout/dist

.gitignore

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
*.bundle.*
2+
lib/
3+
node_modules/
4+
*.egg-info/
5+
.ipynb_checkpoints
6+
*.tsbuildinfo
7+
jupyterlab_blockly/labextension
8+
9+
# Created by https://www.gitignore.io/api/python
10+
# Edit at https://www.gitignore.io/?templates=python
11+
12+
### Python ###
13+
# Byte-compiled / optimized / DLL files
14+
__pycache__/
15+
*.py[cod]
16+
*$py.class
17+
18+
# C extensions
19+
*.so
20+
21+
# Distribution / packaging
22+
.Python
23+
build/
24+
develop-eggs/
25+
dist/
26+
downloads/
27+
eggs/
28+
.eggs/
29+
lib/
30+
lib64/
31+
parts/
32+
sdist/
33+
var/
34+
wheels/
35+
pip-wheel-metadata/
36+
share/python-wheels/
37+
.installed.cfg
38+
*.egg
39+
MANIFEST
40+
41+
# PyInstaller
42+
# Usually these files are written by a python script from a template
43+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
44+
*.manifest
45+
*.spec
46+
47+
# Installer logs
48+
pip-log.txt
49+
pip-delete-this-directory.txt
50+
51+
# Unit test / coverage reports
52+
htmlcov/
53+
.tox/
54+
.nox/
55+
.coverage
56+
.coverage.*
57+
.cache
58+
nosetests.xml
59+
coverage.xml
60+
*.cover
61+
.hypothesis/
62+
.pytest_cache/
63+
64+
# Translations
65+
*.mo
66+
*.pot
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# pyenv
78+
.python-version
79+
80+
# celery beat schedule file
81+
celerybeat-schedule
82+
83+
# SageMath parsed files
84+
*.sage.py
85+
86+
# Spyder project settings
87+
.spyderproject
88+
.spyproject
89+
90+
# Rope project settings
91+
.ropeproject
92+
93+
# Mr Developer
94+
.mr.developer.cfg
95+
.project
96+
.pydevproject
97+
98+
# mkdocs documentation
99+
/site
100+
101+
# mypy
102+
.mypy_cache/
103+
.dmypy.json
104+
dmypy.json
105+
106+
# Pyre type checker
107+
.pyre/
108+
109+
# End of https://www.gitignore.io/api/python
110+
111+
# OSX files
112+
.DS_Store

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
**/node_modules
3+
**/lib
4+
**/package.json
5+
jupyterlab_blockly

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "none",
4+
"arrowParens": "avoid"
5+
}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
<!-- <START NEW CHANGELOG ENTRY> -->
4+
5+
<!-- <END NEW CHANGELOG ENTRY> -->

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2022, quantstack
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
include LICENSE
2+
include *.md
3+
include pyproject.toml
4+
5+
include package.json
6+
include install.json
7+
include ts*.json
8+
include yarn.lock
9+
10+
graft jupyterlab_blockly/labextension
11+
12+
# Javascript files
13+
graft src
14+
graft style
15+
prune **/node_modules
16+
prune lib
17+
prune binder
18+
19+
# Patterns to exclude from any directory
20+
global-exclude *~
21+
global-exclude *.pyc
22+
global-exclude *.pyo
23+
global-exclude .git
24+
global-exclude .ipynb_checkpoints

0 commit comments

Comments
 (0)