Skip to content

Commit

Permalink
Merge pull request #167 from hbcarlos/update-line-endings
Browse files Browse the repository at this point in the history
Update all the examples
  • Loading branch information
jtpio authored Jul 12, 2021
2 parents 91d420e + 40f3ee3 commit 92e0814
Show file tree
Hide file tree
Showing 119 changed files with 1,985 additions and 1,706 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.ts text eol=lf
*.tsx text eol=lf
59 changes: 27 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
build_extensions:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
Expand All @@ -31,6 +32,11 @@ jobs:
- toolbar-button
- widgets
os: [ubuntu-latest, macos-latest, windows-latest]

defaults:
run:
working-directory: ${{ matrix.example }}

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -54,12 +60,10 @@ jobs:
- name: Check config files
if: steps.filter.outputs.extension == 'true'
run: |
diff hello-world/tsconfig.json ${EXAMPLE_FOLDER}/tsconfig.json
diff hello-world/.eslintignore ${EXAMPLE_FOLDER}/.eslintignore
diff hello-world/.eslintrc.js ${EXAMPLE_FOLDER}/.eslintrc.js
diff hello-world/.gitignore ${EXAMPLE_FOLDER}/.gitignore
env:
EXAMPLE_FOLDER: ${{ matrix.example }}
diff ../hello-world/tsconfig.json tsconfig.json
diff ../hello-world/.eslintignore .eslintignore
diff ../hello-world/.eslintrc.js .eslintrc.js
diff ../hello-world/.gitignore .gitignore
shell: bash
- name: Install node
if: steps.filter.outputs.extension == 'true'
Expand Down Expand Up @@ -89,33 +93,20 @@ jobs:
- name: Install the Python dependencies
if: steps.filter.outputs.extension == 'true'
run: |
python -m pip install --upgrade pip jupyter_packaging~=0.7.9 jupyterlab~=3.0
python -m pip install --upgrade pip jupyter_packaging~=0.10 jupyterlab~=3.0
- name: Install the NPM dependencies
if: steps.filter.outputs.extension == 'true'
run: |
cd ${EXAMPLE_FOLDER}
jlpm
env:
EXAMPLE_FOLDER: ${{ matrix.example }}
shell: bash
run: jlpm
- name: Lint the files
if: steps.filter.outputs.extension == 'true'
run: |
cd ${EXAMPLE_FOLDER}
jlpm run eslint:check
env:
EXAMPLE_FOLDER: ${{ matrix.example }}
shell: bash
run: jlpm run eslint:check
- name: Build and check by extension
if: steps.filter.outputs.extension == 'true'
run: |
cd ${EXAMPLE_FOLDER}
pip install -e .
jupyter labextension list 2>&1 | grep -ie "@jupyterlab-examples/*.*OK"
pip install . -vvv
jupyter labextension list 2>&1 | tee labextension.list
cat labextension.list | grep -ie "@jupyterlab-examples/*.*OK"
python -m jupyterlab.browser_check
pip uninstall -y $(python setup.py --name)
env:
EXAMPLE_FOLDER: ${{ matrix.example }}
shell: bash

build_serverextension:
Expand Down Expand Up @@ -179,7 +170,7 @@ jobs:
- name: Install the Python dependencies
if: steps.filter.outputs.extension == 'true'
run: |
python -m pip install --upgrade pip jupyter_packaging~=0.7.9 jupyterlab~=3.0
python -m pip install --upgrade pip jupyter_packaging~=0.10 jupyterlab~=3.0
- name: Install the NPM dependencies
if: steps.filter.outputs.extension == 'true'
run: |
Expand All @@ -201,8 +192,10 @@ jobs:
- name: Check extension as dev
if: steps.filter.outputs.extension == 'true' && ( startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') )
run: |
jupyter server extension list 2>&1 | grep -ie "jlab_ext_example.*OK"
jupyter labextension list 2>&1 | grep -ie "@jupyterlab-examples/server-extension.*OK"
jupyter server extension list 2>&1 | tee serverextension.list
cat serverextension.list | grep -ie "jlab_ext_example.*OK"
jupyter labextension list 2>&1 | tee labextension.list
cat labextension.list | grep -ie "@jupyterlab-examples/server-extension.*OK"
- name: Clean extension installation
if: steps.filter.outputs.extension == 'true'
run: |
Expand All @@ -214,12 +207,14 @@ jobs:
if: steps.filter.outputs.extension == 'true'
run: |
cd server-extension
pip install -e .
pip install .
- name: Check extension as dev
if: steps.filter.outputs.extension == 'true' && ( startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') )
run: |
jupyter server extension list 2>&1 | grep -ie "jlab_ext_example.*OK"
jupyter labextension list 2>&1 | grep -ie "@jupyterlab-examples/server-extension.*OK"
jupyter server extension list 2>&1 | tee serverextension.list
cat serverextension.list | grep -ie "jlab_ext_example.*OK"
jupyter labextension list 2>&1 | tee labextension.list
cat labextension.list | grep -ie "@jupyterlab-examples/server-extension.*OK"
python -m jupyterlab.browser_check
build_all:
Expand Down Expand Up @@ -262,7 +257,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Install the Python dependencies
run: python -m pip install jupyter_packaging~=0.7.9 jupyterlab~=3.0 pytest pytest-check-links
run: python -m pip install jupyter_packaging~=0.10 jupyterlab~=3.0 pytest pytest-check-links
- name: Bootstrap the jlpm deps
run: jlpm
- name: Build all the extensions
Expand Down
28 changes: 17 additions & 11 deletions command-palette/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,49 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'plugin:jsdoc/recommended',
'plugin:prettier/recommended',
'plugin:react/recommended'
'plugin:react/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module'
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'jsdoc'],
rules: {
'@typescript-eslint/interface-name-prefix': [
'@typescript-eslint/naming-convention': [
'error',
{ prefixWithI: 'always' }
{
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/camelcase': 'warn',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/quotes': [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: false }
{ avoidEscape: true, allowTemplateLiterals: false },
],
curly: ['error', 'all'],
eqeqeq: 'error',
'jsdoc/require-param-type': 'off',
'jsdoc/require-property-type': 'off',
'jsdoc/require-returns-type': 'off',
'jsdoc/no-types': 'warn',
'prefer-arrow-callback': 'error'
'prefer-arrow-callback': 'error',
},
settings: {
jsdoc: {
mode: 'typescript'
mode: 'typescript',
},
react: {
version: 'detect'
}
}
version: 'detect',
},
},
};
4 changes: 2 additions & 2 deletions command-palette/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ const extension: JupyterFrontEndPlugin<void> = {
console.log(
`jlab-examples:command-palette has been called ${args['origin']}.`
);
}
},
});

// Add the command to the command palette
const category = 'Extension Examples';
palette.addItem({ command, category, args: { origin: 'from palette' } });
}
},
```
The `ICommandPalette`
Expand Down
36 changes: 21 additions & 15 deletions command-palette/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
"url": "https://github.com/jupyterlab/extension-examples/issues"
},
"license": "BSD-3-Clause",
"author": "Project Jupyter Contributors",
"author": {
"name": "Project Jupyter Contributors",
"email": ""
},
"files": [
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
"style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}"
"style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
"style/index.js"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -30,41 +34,43 @@
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:lib": "tsc",
"build:prod": "jlpm run build:lib && jlpm run build:labextension",
"build:prod": "jlpm run clean && jlpm run build:lib && jlpm run build:labextension",
"clean": "jlpm run clean:lib",
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
"clean:labextension": "rimraf jupyterlab_examples_command_palette/labextension",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"eslint": "eslint . --ext .ts,.tsx --fix",
"eslint:check": "eslint . --ext .ts,.tsx",
"install:extension": "jupyter labextension develop --overwrite .",
"install:extension": "jlpm run build",
"prepare": "jlpm run clean && jlpm run build:prod",
"watch": "run-p watch:src watch:labextension",
"watch:labextension": "jupyter labextension watch .",
"watch:src": "tsc -w"
},
"dependencies": {
"@jupyterlab/application": "^3.0.0-rc.15"
"@jupyterlab/application": "^3.0.11"
},
"devDependencies": {
"@jupyterlab/builder": "^3.0.0-rc.15",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"eslint": "^7.5.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-jsdoc": "^22.0.0",
"eslint-plugin-prettier": "^3.1.2",
"@jupyterlab/builder": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"eslint": "^7.14.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-jsdoc": "^34.0.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.18.3",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.0",
"prettier": "^2.1.1",
"rimraf": "^3.0.2",
"typescript": "~4.1.3"
},
"sideEffects": [
"style/*.css"
"style/*.css",
"style/index.js"
],
"jupyterlab": {
"extension": true,
"outputDir": "jupyterlab_examples_command_palette/labextension"
}
},
"styleModule": "style/index.js"
}
18 changes: 16 additions & 2 deletions command-palette/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
[build-system]
requires = ["jupyter_packaging~=0.7.9", "jupyterlab>=3.0.0rc15,==3.*", "setuptools>=40.8.0", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["jupyter_packaging~=0.10,<2", "jupyterlab~=3.0"]
build-backend = "jupyter_packaging.build_api"

[tool.jupyter-packaging.options]
skip-if-exists = ["jupyterlab_examples_command_palette/labextension/static/style.js"]
ensured-targets = ["jupyterlab_examples_command_palette/labextension/static/style.js", "jupyterlab_examples_command_palette/labextension/package.json"]

[tool.jupyter-packaging.builder]
factory = "jupyter_packaging.npm_builder"

[tool.jupyter-packaging.build-args]
build_cmd = "build:prod"
npm = ["jlpm"]

[tool.check-manifest]
ignore = ["jupyterlab_examples_command_palette/labextension/**", "yarn.lock", ".*", "package-lock.json"]
Loading

0 comments on commit 92e0814

Please sign in to comment.