Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #137 from jupyterlab/cleanup
Browse files Browse the repository at this point in the history
Finish upgrading to new JupyterLab
  • Loading branch information
saulshanabrook authored Apr 8, 2020
2 parents eed4734 + 0ab6cb9 commit ebdcf03
Show file tree
Hide file tree
Showing 61 changed files with 435 additions and 573 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ insert_final_newline = true
[*.js]
indent_style = space
indent_size = 2
quote_type = single

# Set properties for TypeScript files:
[*.ts]
indent_style = space
indent_size = 2
quote_type = single

# Set properties for TSX files:
[*.tsx]
indent_style = space
indent_size = 2
quote_type = single

# Set properties for Python files:
[*.py]
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: "3.6"
python-version: '3.6'
- uses: actions/setup-node@v1
with:
node-version: "10.x"
node-version: '10.x'
- run: python -m pip install --upgrade pip
- run: pip install --pre jupyterlab
- run: pip install jupyterlab
- run: jlpm
- run: jlpm run lint:check
test:
Expand All @@ -21,15 +21,13 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: "3.6"
python-version: '3.6'
- uses: actions/setup-node@v1
with:
node-version: "10.x"
node-version: '10.x'
- run: python -m pip install --upgrade pip
- run: pip install --pre jupyterlab
- run: pip install jupyterlab
- run: jlpm run build
- run: jlpm run registry &>/dev/null &
- run: jlpm run registry:init
- run: jupyter lab build --debug-log-path log.txt
- if: failure()
run: cat log.txt
Expand Down
13 changes: 0 additions & 13 deletions .yarnrc

This file was deleted.

15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,21 @@ Tests should accompany **all** bug fixes and features. For guidance on how to wr

Any [pull requests][github-pull-request] which include failing tests and/or lint errors will **not** be accepted.

To setup dev environment and run JupyterLab:

```bash
$ jlpm run build
$ jupyter lab build
$ jupyter lab
```

To make changes and have JupyterLab rebuild withour restarting:

```bash
$ jlpm run build:watch
$ jupyter lab --watch
```

To run tests:

```bash
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To experiment with the extension in a live notebook environment,
- Bring any data type you can imagine! **Extensible** and **type safe** data registry system.
- Register **conversions** between the different data types.
- Data changing on you? Use [`RxJS` **observables**][rxjs] to represent data over time.
- Have a new way to look at your data? Create **React** or **Phosphor** components to view a certain type.
- Have a new way to look at your data? Create **React** or **lumino** components to view a certain type.
- Built-in data **explorer UI** to find and use available datasets.
- Dataset in your dataset? Use the **nested** datatype.
- Building another data centric application? Use the [`@jupyterlab/dataregistry`][npm-package-dataregistry] package which can be used independently of [JupyterLab][jupyterlab].
Expand Down
2 changes: 1 addition & 1 deletion binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pandas
jupyterlab>=1.0
jupyterlab>=2.0
vega_datasets
12 changes: 6 additions & 6 deletions datasets.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
children:
- "test:///hi"
- 'test:///hi'
datasets:
- url: "test:///hi"
label: "Custom label!"
- url: 'test:///hi'
label: 'Custom label!'
snippets:
some code: "It's code!"
other code: "It's code!"
children:
- "test:///other"
- url: "test:///other"
- 'test:///other'
- url: 'test:///other'
snippets:
more code: "another code"
more code: 'another code'
23 changes: 15 additions & 8 deletions etc/eslint/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,38 @@ const resolve = require('path').resolve;
const config = {
env: {
browser: true,
es6: true
es6: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'prettier',
'prettier/@typescript-eslint'
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: resolve(__dirname, '..', '..'),
project: './packages/**/tsconfig.json',
project: ['./tsconfig.test.json', './packages/**/tsconfig.json'],
ecmaFeatures: {
jsx: true
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module'
sourceType: 'module',
},
plugins: ['prettier', 'react', 'react-hooks', '@typescript-eslint'],
rules: {
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'prettier/prettier': ['error', { singleQuote: true }],
'linebreak-style': ['error', 'unix'],
'no-console': ['error', { allow: ['warn', 'error'] }]
}
'no-console': ['error', { allow: ['warn', 'error'] }],
},
};

/**
Expand Down
2 changes: 1 addition & 1 deletion etc/jest/jest-environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CustomEnvironment extends PuppeteerEnvironment {
const jestScreenshot = new JestScreenshot({
page: this.global.page,
dirName: resolve(__dirname, '..', '..'),
testName
testName,
});

await jestScreenshot.setup();
Expand Down
6 changes: 3 additions & 3 deletions etc/jest/jest-puppeteer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
const config = {
launch: {
headless: process.env.HEADLESS !== 'false',
slowMo: process.env.SLOWMO === 'true'
slowMo: process.env.SLOWMO === 'true',
},
// https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-dev-server#options
server: {
command: "jupyter lab --port 8080 --no-browser --LabApp.token=''",
port: 8080
}
port: 8080,
},
};

/**
Expand Down
8 changes: 4 additions & 4 deletions etc/jest/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ const config = {
globalTeardown: 'jest-environment-puppeteer/teardown',
setupFilesAfterEnv: ['expect-puppeteer'],
transform: {
...tsjPreset.transform
...tsjPreset.transform,
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testMatch: ['**/test/**/test*.ts?(x)'],
testPathIgnorePatterns: ['/build/', '/lib/', '/node_modules/'],
globals: {
'ts-jest': {
tsConfig: resolve(ROOT, 'tsconfig.test.json')
}
}
tsConfig: resolve(ROOT, 'tsconfig.test.json'),
},
},
};

/**
Expand Down
4 changes: 2 additions & 2 deletions etc/lint-staged/lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const ignore = resolve(__dirname, '..', 'prettier', '.prettierignore');
const config = {
'**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}': [
'prettier --config=' + rc + ' --ignore-path=' + ignore + ' --write',
'git add'
]
'git add',
],
};

/**
Expand Down
9 changes: 0 additions & 9 deletions etc/prettier/.prettierignore

This file was deleted.

83 changes: 36 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,29 @@
]
},
"scripts": {
"all": "jlpm run clean && jlpm run build && jlpm run build:jupyter",
"all:watch": "jlpm run clean && jlpm run build && jlpm run build:jupyter:watch",
"build": "jlpm run build:dev",
"build:dev": "jlpm install && jlpm run clean:packages && lerna link && jlpm run build:packages && jlpm run link:packages && jupyter labextension list",
"build:jupyter": "(jupyter lab build || (jlpm run build:jupyter:remediate && jupyter lab build)) && jupyter lab",
"build:jupyter:remediate": "curr_dir=$PWD && (cd $(jupyter lab path | head -n1 | sed s/Application\\ directory:\\ *//)/staging && echo $PWD && echo '\"@jupyterlab:registry\" \"http://localhost:4873\"' >> .yarnrc && cat .yarnrc && YARN_REGISTRY=http://localhost:4873 node ./yarn.js install --non-interactive && cd $curr_dir) || cd $curr_dir",
"build:jupyter:watch": "(jupyter lab build || (jlpm run build:jupyter:remediate && jupyter lab build)) && jupyter lab --watch",
"build:packages": "lerna run build",
"build:watch": "tsc --build --watch --listEmittedFiles packages/*",
"build": "jlpm && lerna bootstrap --hoist && jlpm run build:packages && jlpm run build:packages:post && jlpm run link:packages",
"build:packages": "tsc --build packages/*",
"build:packages:post": "lerna run postBuild",
"build:watch": "jlpm run build:packages --watch --listEmittedFiles",
"clean": "jlpm run clean:jupyter && jlpm clean:packages && jlpm clean:node",
"clean:jupyter": "jlpm run uninstall:extensions && (lerna run --no-bail unlink || echo 'At least one unlink command failed, but continuing...') && jupyter lab clean",
"clean:node": "lerna clean --yes && rimraf node_modules",
"clean:jupyter": "jlpm run uninstall:extensions && jupyter lab clean",
"clean:node": "lerna clean --yes && rimraf node_modules yarn.lock",
"clean:packages": "lerna run clean",
"link:packages": "jupyter labextension link ./packages/* --no-build",
"lint": "jlpm run lint:css && jlpm run lint:typescript",
"lint:check": "jlpm run prettier:check && jlpm run lint:css:check && jlpm run lint:typescript:check",
"lint:css": "stylelint packages/**/*.css --config ./etc/stylelint/.stylelintrc.json --fix",
"lint": "jlpm run lint:css && jlpm run lint:typescript && jlpm run prettier:write",
"lint:check": "jlpm run lint:css:check && jlpm run lint:typescript:check && jlpm run prettier",
"lint:css": "jlpm run lint:css:check --fix",
"lint:css:check": "stylelint packages/**/*.css --config ./etc/stylelint/.stylelintrc.json",
"lint:typescript": "eslint --fix packages/**/src/*.ts --config ./etc/eslint/.eslintrc.js",
"lint:typescript:check": "eslint packages/**/src/*.ts --config ./etc/eslint/.eslintrc.js",
"prettier": "prettier --write '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}' --config ./etc/prettier/.prettierrc --ignore-path ./etc/prettier/.prettierignore",
"prettier:check": "prettier --list-different '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}' --config ./etc/prettier/.prettierrc --ignore-path ./etc/prettier/.prettierignore",
"lint:typescript": "jlpm run lint:typescript:check --fix",
"lint:typescript:check": "eslint . --ext 'ts,tsx' --ignore-path .gitignore --config ./etc/eslint/.eslintrc.js",
"prettier": "prettier . --config ./etc/prettier/.prettierrc --ignore-path .gitignore --check",
"prettier:write": "jlpm run prettier --write",
"rebuild:packages": "jlpm run clean:packages && jlpm run build:packages",
"registry": "verdaccio",
"registry:init": "jlpm run registry:adduser && jlpm run registry:register",
"registry:adduser": "node ./scripts/registry.adduser.js",
"registry:register": "env NPM_USER=foo NPM_PASS=bar [email protected] NPM_REGISTRY=http://localhost:4873 NPM_SCOPE=@jupyterlab npm-cli-login && lerna exec --scope @jupyterlab/dataregistry --scope @jupyterlab/dataregistry-extension --scope @jupyterlab/dataregistry-csvviewer-extension --scope @jupyterlab/dataregistry-registry-extension -- npm publish --registry http://localhost:4873",
"test": "env JEST_PUPPETEER_CONFIG=./etc/jest/jest-puppeteer.config.js jest --runInBand --config ./etc/jest/jest.config.js",
"test:debug": "env HEADLESS=false SLOWMO=true jlpm test",
"uninstall:extensions": "jupyter labextension uninstall --all --no-build",
"unlink:packages": "lerna run unlink"
"test": "jlpm run test:packages && jlpm run test:integration",
"test:packages": "lerna run test",
"test:integration": "env JEST_PUPPETEER_CONFIG=./etc/jest/jest-puppeteer.config.js jest --runInBand --config ./etc/jest/jest.config.js",
"test:integration:debug": "env HEADLESS=false SLOWMO=true jlpm test",
"uninstall:extensions": "jupyter labextension uninstall --all"
},
"husky": {
"hooks": {
Expand All @@ -45,34 +37,31 @@
},
"dependencies": {},
"devDependencies": {
"@rws-air/jestscreenshot": "^3.0.3",
"@types/expect-puppeteer": "^3.3.2",
"@types/jest": "^24.0.19",
"@rws-air/jestscreenshot": "^4.0.4",
"@types/expect-puppeteer": "^4.4.1",
"@types/jest": "^25.2.1",
"@types/jest-environment-puppeteer": "^4.3.1",
"@types/puppeteer": "^1.20.2",
"@typescript-eslint/eslint-plugin": "^2.11.0",
"@typescript-eslint/parser": "^2.11.0",
"@types/puppeteer": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"eslint": "^6.1.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^1.6.1",
"husky": "^3.0.9",
"jest": "^24.9.0",
"jest-circus": "^24.9.0",
"eslint-plugin-react-hooks": "^3.0.0",
"husky": "^4.2.3",
"jest": "^25.2.7",
"jest-circus": "^25.2.7",
"jest-puppeteer": "^4.3.0",
"lerna": "^3.16.4",
"lint-staged": "^9.4.2",
"npm-cli-login": "^0.1.1",
"npm-registry-client": "^8.6.0",
"prettier": "^1.18.2",
"lint-staged": "^10.1.2",
"prettier": "^2.0.4",
"puppeteer": "^2.0.0",
"rimraf": "^2.6.2",
"stylelint": "^11.0.0",
"stylelint-config-prettier": "^6.0.0",
"stylelint-config-standard": "^19.0.0",
"ts-jest": "^24.1.0",
"typescript": "^3.5.3",
"verdaccio": "^4.3.2"
"rimraf": "^3.0.2",
"stylelint": "^13.3.0",
"stylelint-config-prettier": "^8.0.1",
"stylelint-config-standard": "^20.0.0",
"ts-jest": "^25.3.1",
"typescript": "^3.5.3"
}
}
16 changes: 8 additions & 8 deletions packages/dataregistry-csvviewer-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@
"scripts": {
"build": "tsc --build",
"clean": "rimraf lib tsconfig.tsbuildinfo",
"link": "jupyter labextension link ./ --no-build",
"prepublishOnly": "npm run clean && npm run build",
"unlink": "jupyter labextension unlink ./ --no-build",
"watch": "tsc --build --watch --listEmittedFiles"
},
"dependencies": {
"@jupyterlab/application": "^2.0.0-alpha.4",
"@jupyterlab/csvviewer": "^2.0.0-alpha.4",
"@jupyterlab/dataregistry": "^4.0.0",
"@jupyterlab/dataregistry-registry-extension": "^1.0.0",
"@lumino/datagrid": "^0.3.0",
"@lumino/messaging": "^1.3.0",
"@jupyterlab/application": "^2.1.0",
"@jupyterlab/csvviewer": "^2.1.0",
"@lumino/datagrid": "^0.6.0",
"@lumino/messaging": "^1.2.3",
"@lumino/widgets": "^1.9.0",
"rxjs": "^6.5.2"
},
"devDependencies": {
"@jupyterlab/dataregistry": "^4.0.0",
"@jupyterlab/dataregistry-registry-extension": "^1.0.0"
},
"publishConfig": {
"access": "public"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/dataregistry-csvviewer-extension/src/activate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import csv2datagrid from './csv_to_data_grid';
*/
function activate(app: JupyterFrontEnd, registry: Registry) {
registry.addConverter(extension2mimetype());
registry.addConverter(text2csv());
registry.addConverter(csv2datagrid());
registry.addConverter(text2csv);
registry.addConverter(csv2datagrid);
}

/**
Expand Down
Loading

0 comments on commit ebdcf03

Please sign in to comment.