-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
0 parents
commit 1db69fa
Showing
13 changed files
with
2,232 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
dist | ||
coverage | ||
**/*.d.ts | ||
tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module.exports = { | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended' | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
sourceType: 'module' | ||
}, | ||
plugins: ['@typescript-eslint'], | ||
rules: { | ||
'@typescript-eslint/interface-name-prefix': [ | ||
'error', | ||
{ prefixWithI: 'always' } | ||
], | ||
'@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' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: master | ||
pull_request: | ||
branches: '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Install node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '10.x' | ||
- name: Install Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.7' | ||
architecture: 'x64' | ||
- name: Install dependencies | ||
run: python -m pip install jupyterlab | ||
- name: Build the extension | ||
run: | | ||
jlpm | ||
jlpm run eslint:check | ||
jupyter labextension install . | ||
python -m jupyterlab.browser_check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*.bundle.* | ||
lib/ | ||
node_modules/ | ||
*.egg-info/ | ||
.ipynb_checkpoints | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
**/node_modules | ||
**/lib | ||
**/package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2020, Alex Archambault All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# almond-scalafmt | ||
|
||
![Github Actions Status](https://github.com/almond-sh/almond-scalafmt/workflows/Build/badge.svg) | ||
|
||
Scalafmt extension for almond | ||
|
||
|
||
|
||
## Requirements | ||
|
||
* JupyterLab >= 2.0 | ||
|
||
## Install | ||
|
||
```bash | ||
jupyter labextension install almond-scalafmt | ||
``` | ||
|
||
## Contributing | ||
|
||
### Install | ||
|
||
The `jlpm` command is JupyterLab's pinned version of | ||
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use | ||
`yarn` or `npm` in lieu of `jlpm` below. | ||
|
||
```bash | ||
# Clone the repo to your local environment | ||
# Move to almond-scalafmt directory | ||
|
||
# Install dependencies | ||
jlpm | ||
# Build Typescript source | ||
jlpm build | ||
# Link your development version of the extension with JupyterLab | ||
jupyter labextension install . | ||
# Rebuild Typescript source after making changes | ||
jlpm build | ||
# Rebuild JupyterLab after making any changes | ||
jupyter lab build | ||
``` | ||
|
||
You can watch the source directory and run JupyterLab in watch mode to watch for changes in the extension's source and automatically rebuild the extension and application. | ||
|
||
```bash | ||
# Watch the source directory in another terminal tab | ||
jlpm watch | ||
# Run jupyterlab in watch mode in one terminal tab | ||
jupyter lab --watch | ||
``` | ||
|
||
Now every change will be built locally and bundled into JupyterLab. Be sure to refresh your browser page after saving file changes to reload the extension (note: you'll need to wait for webpack to finish, which can take 10s+ at times). | ||
|
||
### Uninstall | ||
|
||
```bash | ||
|
||
jupyter labextension uninstall almond-scalafmt | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "almond-scalafmt", | ||
"version": "0.1.0", | ||
"description": "Scalafmt extension for almond", | ||
"keywords": [ | ||
"jupyter", | ||
"jupyterlab", | ||
"jupyterlab-extension" | ||
], | ||
"homepage": "https://github.com/almond-sh/almond-scalafmt", | ||
"bugs": { | ||
"url": "https://github.com/almond-sh/almond-scalafmt/issues" | ||
}, | ||
"license": "BSD-3-Clause", | ||
"author": "Alex Archambault", | ||
"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}" | ||
], | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"style": "style/index.css", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/almond-sh/almond-scalafmt.git" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"clean": "rimraf lib tsconfig.tsbuildinfo", | ||
"eslint": "eslint . --ext .ts,.tsx --fix", | ||
"eslint:check": "eslint . --ext .ts,.tsx", | ||
"prepare": "jlpm run clean && jlpm run build", | ||
"watch": "tsc -w" | ||
}, | ||
"dependencies": { | ||
"@jupyterlab/application": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^2.25.0", | ||
"@typescript-eslint/parser": "^2.25.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.10.1", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"prettier": "1.16.4", | ||
"rimraf": "^2.6.1", | ||
"typescript": "~3.7.0" | ||
}, | ||
"sideEffects": [ | ||
"style/*.css" | ||
], | ||
"jupyterlab": { | ||
"extension": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
JupyterFrontEnd, | ||
JupyterFrontEndPlugin | ||
} from '@jupyterlab/application'; | ||
|
||
/** | ||
* Initialization data for the almond-scalafmt extension. | ||
*/ | ||
const extension: JupyterFrontEndPlugin<void> = { | ||
id: 'almond-scalafmt', | ||
autoStart: true, | ||
activate: (app: JupyterFrontEnd) => { | ||
console.log('JupyterLab extension almond-scalafmt is activated!'); | ||
} | ||
}; | ||
|
||
export default extension; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowSyntheticDefaultImports": true, | ||
"composite": true, | ||
"declaration": true, | ||
"esModuleInterop": true, | ||
"incremental": true, | ||
"jsx": "react", | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"noEmitOnError": true, | ||
"noImplicitAny": true, | ||
"noUnusedLocals": true, | ||
"preserveWatchOutput": true, | ||
"resolveJsonModule": true, | ||
"outDir": "lib", | ||
"rootDir": "src", | ||
"strict": true, | ||
"strictNullChecks": false, | ||
"target": "es2017", | ||
"types": [] | ||
}, | ||
"include": ["src/*"] | ||
} |
Oops, something went wrong.