Skip to content

Commit 92e0814

Browse files
authored
Merge pull request #167 from hbcarlos/update-line-endings
Update all the examples
2 parents 91d420e + 40f3ee3 commit 92e0814

File tree

119 files changed

+1985
-1706
lines changed

Some content is hidden

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

119 files changed

+1985
-1706
lines changed

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
# Set the default behavior, in case people don't have core.autocrlf set.
3+
* text=auto
4+
5+
# Explicitly declare text files you want to always be normalized and converted
6+
# to native line endings on checkout.
7+
*.ts text eol=lf
8+
*.tsx text eol=lf

.github/workflows/main.yml

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
build_extensions:
1111
runs-on: ${{ matrix.os }}
12+
1213
strategy:
1314
fail-fast: false
1415
matrix:
@@ -31,6 +32,11 @@ jobs:
3132
- toolbar-button
3233
- widgets
3334
os: [ubuntu-latest, macos-latest, windows-latest]
35+
36+
defaults:
37+
run:
38+
working-directory: ${{ matrix.example }}
39+
3440
steps:
3541
- name: Checkout
3642
uses: actions/checkout@v2
@@ -54,12 +60,10 @@ jobs:
5460
- name: Check config files
5561
if: steps.filter.outputs.extension == 'true'
5662
run: |
57-
diff hello-world/tsconfig.json ${EXAMPLE_FOLDER}/tsconfig.json
58-
diff hello-world/.eslintignore ${EXAMPLE_FOLDER}/.eslintignore
59-
diff hello-world/.eslintrc.js ${EXAMPLE_FOLDER}/.eslintrc.js
60-
diff hello-world/.gitignore ${EXAMPLE_FOLDER}/.gitignore
61-
env:
62-
EXAMPLE_FOLDER: ${{ matrix.example }}
63+
diff ../hello-world/tsconfig.json tsconfig.json
64+
diff ../hello-world/.eslintignore .eslintignore
65+
diff ../hello-world/.eslintrc.js .eslintrc.js
66+
diff ../hello-world/.gitignore .gitignore
6367
shell: bash
6468
- name: Install node
6569
if: steps.filter.outputs.extension == 'true'
@@ -89,33 +93,20 @@ jobs:
8993
- name: Install the Python dependencies
9094
if: steps.filter.outputs.extension == 'true'
9195
run: |
92-
python -m pip install --upgrade pip jupyter_packaging~=0.7.9 jupyterlab~=3.0
96+
python -m pip install --upgrade pip jupyter_packaging~=0.10 jupyterlab~=3.0
9397
- name: Install the NPM dependencies
9498
if: steps.filter.outputs.extension == 'true'
95-
run: |
96-
cd ${EXAMPLE_FOLDER}
97-
jlpm
98-
env:
99-
EXAMPLE_FOLDER: ${{ matrix.example }}
100-
shell: bash
99+
run: jlpm
101100
- name: Lint the files
102101
if: steps.filter.outputs.extension == 'true'
103-
run: |
104-
cd ${EXAMPLE_FOLDER}
105-
jlpm run eslint:check
106-
env:
107-
EXAMPLE_FOLDER: ${{ matrix.example }}
108-
shell: bash
102+
run: jlpm run eslint:check
109103
- name: Build and check by extension
110-
if: steps.filter.outputs.extension == 'true'
111104
run: |
112-
cd ${EXAMPLE_FOLDER}
113-
pip install -e .
114-
jupyter labextension list 2>&1 | grep -ie "@jupyterlab-examples/*.*OK"
105+
pip install . -vvv
106+
jupyter labextension list 2>&1 | tee labextension.list
107+
cat labextension.list | grep -ie "@jupyterlab-examples/*.*OK"
115108
python -m jupyterlab.browser_check
116109
pip uninstall -y $(python setup.py --name)
117-
env:
118-
EXAMPLE_FOLDER: ${{ matrix.example }}
119110
shell: bash
120111

121112
build_serverextension:
@@ -179,7 +170,7 @@ jobs:
179170
- name: Install the Python dependencies
180171
if: steps.filter.outputs.extension == 'true'
181172
run: |
182-
python -m pip install --upgrade pip jupyter_packaging~=0.7.9 jupyterlab~=3.0
173+
python -m pip install --upgrade pip jupyter_packaging~=0.10 jupyterlab~=3.0
183174
- name: Install the NPM dependencies
184175
if: steps.filter.outputs.extension == 'true'
185176
run: |
@@ -201,8 +192,10 @@ jobs:
201192
- name: Check extension as dev
202193
if: steps.filter.outputs.extension == 'true' && ( startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') )
203194
run: |
204-
jupyter server extension list 2>&1 | grep -ie "jlab_ext_example.*OK"
205-
jupyter labextension list 2>&1 | grep -ie "@jupyterlab-examples/server-extension.*OK"
195+
jupyter server extension list 2>&1 | tee serverextension.list
196+
cat serverextension.list | grep -ie "jlab_ext_example.*OK"
197+
jupyter labextension list 2>&1 | tee labextension.list
198+
cat labextension.list | grep -ie "@jupyterlab-examples/server-extension.*OK"
206199
- name: Clean extension installation
207200
if: steps.filter.outputs.extension == 'true'
208201
run: |
@@ -214,12 +207,14 @@ jobs:
214207
if: steps.filter.outputs.extension == 'true'
215208
run: |
216209
cd server-extension
217-
pip install -e .
210+
pip install .
218211
- name: Check extension as dev
219212
if: steps.filter.outputs.extension == 'true' && ( startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') )
220213
run: |
221-
jupyter server extension list 2>&1 | grep -ie "jlab_ext_example.*OK"
222-
jupyter labextension list 2>&1 | grep -ie "@jupyterlab-examples/server-extension.*OK"
214+
jupyter server extension list 2>&1 | tee serverextension.list
215+
cat serverextension.list | grep -ie "jlab_ext_example.*OK"
216+
jupyter labextension list 2>&1 | tee labextension.list
217+
cat labextension.list | grep -ie "@jupyterlab-examples/server-extension.*OK"
223218
python -m jupyterlab.browser_check
224219
225220
build_all:
@@ -262,7 +257,7 @@ jobs:
262257
restore-keys: |
263258
${{ runner.os }}-pip-
264259
- name: Install the Python dependencies
265-
run: python -m pip install jupyter_packaging~=0.7.9 jupyterlab~=3.0 pytest pytest-check-links
260+
run: python -m pip install jupyter_packaging~=0.10 jupyterlab~=3.0 pytest pytest-check-links
266261
- name: Bootstrap the jlpm deps
267262
run: jlpm
268263
- name: Build all the extensions

command-palette/.eslintrc.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,49 @@ module.exports = {
55
'plugin:@typescript-eslint/recommended',
66
'plugin:jsdoc/recommended',
77
'plugin:prettier/recommended',
8-
'plugin:react/recommended'
8+
'plugin:react/recommended',
99
],
1010
parser: '@typescript-eslint/parser',
1111
parserOptions: {
1212
project: 'tsconfig.json',
13-
sourceType: 'module'
13+
sourceType: 'module',
1414
},
1515
plugins: ['@typescript-eslint', 'jsdoc'],
1616
rules: {
17-
'@typescript-eslint/interface-name-prefix': [
17+
'@typescript-eslint/naming-convention': [
1818
'error',
19-
{ prefixWithI: 'always' }
19+
{
20+
selector: 'interface',
21+
format: ['PascalCase'],
22+
custom: {
23+
regex: '^I[A-Z]',
24+
match: true,
25+
},
26+
},
2027
],
2128
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
2229
'@typescript-eslint/no-explicit-any': 'off',
23-
'@typescript-eslint/camelcase': 'warn',
2430
'@typescript-eslint/no-namespace': 'off',
2531
'@typescript-eslint/no-use-before-define': 'off',
2632
'@typescript-eslint/quotes': [
2733
'error',
2834
'single',
29-
{ avoidEscape: true, allowTemplateLiterals: false }
35+
{ avoidEscape: true, allowTemplateLiterals: false },
3036
],
3137
curly: ['error', 'all'],
3238
eqeqeq: 'error',
3339
'jsdoc/require-param-type': 'off',
3440
'jsdoc/require-property-type': 'off',
3541
'jsdoc/require-returns-type': 'off',
3642
'jsdoc/no-types': 'warn',
37-
'prefer-arrow-callback': 'error'
43+
'prefer-arrow-callback': 'error',
3844
},
3945
settings: {
4046
jsdoc: {
41-
mode: 'typescript'
47+
mode: 'typescript',
4248
},
4349
react: {
44-
version: 'detect'
45-
}
46-
}
50+
version: 'detect',
51+
},
52+
},
4753
};

command-palette/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ const extension: JupyterFrontEndPlugin<void> = {
4242
console.log(
4343
`jlab-examples:command-palette has been called ${args['origin']}.`
4444
);
45-
}
45+
},
4646
});
4747

4848
// Add the command to the command palette
4949
const category = 'Extension Examples';
5050
palette.addItem({ command, category, args: { origin: 'from palette' } });
51-
}
51+
},
5252
```
5353
5454
The `ICommandPalette`

command-palette/package.json

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212
"url": "https://github.com/jupyterlab/extension-examples/issues"
1313
},
1414
"license": "BSD-3-Clause",
15-
"author": "Project Jupyter Contributors",
15+
"author": {
16+
"name": "Project Jupyter Contributors",
17+
"email": ""
18+
},
1619
"files": [
1720
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
18-
"style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}"
21+
"style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
22+
"style/index.js"
1923
],
2024
"main": "lib/index.js",
2125
"types": "lib/index.d.ts",
@@ -30,41 +34,43 @@
3034
"build:labextension": "jupyter labextension build .",
3135
"build:labextension:dev": "jupyter labextension build --development True .",
3236
"build:lib": "tsc",
33-
"build:prod": "jlpm run build:lib && jlpm run build:labextension",
37+
"build:prod": "jlpm run clean && jlpm run build:lib && jlpm run build:labextension",
3438
"clean": "jlpm run clean:lib",
3539
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
3640
"clean:labextension": "rimraf jupyterlab_examples_command_palette/labextension",
3741
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
3842
"eslint": "eslint . --ext .ts,.tsx --fix",
3943
"eslint:check": "eslint . --ext .ts,.tsx",
40-
"install:extension": "jupyter labextension develop --overwrite .",
44+
"install:extension": "jlpm run build",
4145
"prepare": "jlpm run clean && jlpm run build:prod",
4246
"watch": "run-p watch:src watch:labextension",
4347
"watch:labextension": "jupyter labextension watch .",
4448
"watch:src": "tsc -w"
4549
},
4650
"dependencies": {
47-
"@jupyterlab/application": "^3.0.0-rc.15"
51+
"@jupyterlab/application": "^3.0.11"
4852
},
4953
"devDependencies": {
50-
"@jupyterlab/builder": "^3.0.0-rc.15",
51-
"@typescript-eslint/eslint-plugin": "^2.27.0",
52-
"@typescript-eslint/parser": "^2.27.0",
53-
"eslint": "^7.5.0",
54-
"eslint-config-prettier": "^6.10.1",
55-
"eslint-plugin-jsdoc": "^22.0.0",
56-
"eslint-plugin-prettier": "^3.1.2",
54+
"@jupyterlab/builder": "^3.0.0",
55+
"@typescript-eslint/eslint-plugin": "^4.8.1",
56+
"@typescript-eslint/parser": "^4.8.1",
57+
"eslint": "^7.14.0",
58+
"eslint-config-prettier": "^6.15.0",
59+
"eslint-plugin-jsdoc": "^34.0.0",
60+
"eslint-plugin-prettier": "^3.1.4",
5761
"eslint-plugin-react": "^7.18.3",
5862
"npm-run-all": "^4.1.5",
59-
"prettier": "^1.19.0",
63+
"prettier": "^2.1.1",
6064
"rimraf": "^3.0.2",
6165
"typescript": "~4.1.3"
6266
},
6367
"sideEffects": [
64-
"style/*.css"
68+
"style/*.css",
69+
"style/index.js"
6570
],
6671
"jupyterlab": {
6772
"extension": true,
6873
"outputDir": "jupyterlab_examples_command_palette/labextension"
69-
}
74+
},
75+
"styleModule": "style/index.js"
7076
}

command-palette/pyproject.toml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
[build-system]
2-
requires = ["jupyter_packaging~=0.7.9", "jupyterlab>=3.0.0rc15,==3.*", "setuptools>=40.8.0", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["jupyter_packaging~=0.10,<2", "jupyterlab~=3.0"]
3+
build-backend = "jupyter_packaging.build_api"
4+
5+
[tool.jupyter-packaging.options]
6+
skip-if-exists = ["jupyterlab_examples_command_palette/labextension/static/style.js"]
7+
ensured-targets = ["jupyterlab_examples_command_palette/labextension/static/style.js", "jupyterlab_examples_command_palette/labextension/package.json"]
8+
9+
[tool.jupyter-packaging.builder]
10+
factory = "jupyter_packaging.npm_builder"
11+
12+
[tool.jupyter-packaging.build-args]
13+
build_cmd = "build:prod"
14+
npm = ["jlpm"]
15+
16+
[tool.check-manifest]
17+
ignore = ["jupyterlab_examples_command_palette/labextension/**", "yarn.lock", ".*", "package-lock.json"]

0 commit comments

Comments
 (0)