Skip to content

Commit 06f1e32

Browse files
authored
Merge pull request #576 from bollwyvl/gh-575-avoid-private-cm
Use ICodeMirror, more type imports, order plugin for fixer
2 parents 86b357b + f9e6034 commit 06f1e32

File tree

102 files changed

+790
-560
lines changed

Some content is hidden

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

102 files changed

+790
-560
lines changed

.github/workflows/job.test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ jobs:
5959
${{ env.CACHE_EPOCH }}-${{ matrix.os }}-lint-
6060
6161
- name: Set up Python and mamba
62-
uses: conda-incubator/setup-miniconda@master
62+
uses: conda-incubator/setup-miniconda@v2
6363
with:
64-
condarc-file: .github/.condarc
6564
environment-file: requirements/github-actions.yml
6665
miniforge-variant: Mambaforge
6766
use-mamba: true
@@ -108,6 +107,9 @@ jobs:
108107
- name: Lint frontend
109108
run: jlpm lint:check
110109

110+
- name: Check distributions
111+
run: python scripts/distcheck.py
112+
111113
build:
112114
name: build
113115
runs-on: ${{ matrix.os }}
@@ -138,9 +140,8 @@ jobs:
138140
${{ env.CACHE_EPOCH }}-${{ matrix.os }}-build-
139141
140142
- name: Set up Python and mamba
141-
uses: conda-incubator/setup-miniconda@master
143+
uses: conda-incubator/setup-miniconda@v2
142144
with:
143-
condarc-file: .github/.condarc
144145
miniforge-variant: Mambaforge
145146

146147
- name: Install minimal build deps
@@ -253,9 +254,8 @@ jobs:
253254
${{ env.CACHE_EPOCH }}-${{ matrix.os }}-${{ matrix.python }}-atest-
254255
255256
- name: Set up Python and mamba
256-
uses: conda-incubator/setup-miniconda@master
257+
uses: conda-incubator/setup-miniconda@v2
257258
with:
258-
condarc-file: .github/.condarc
259259
environment-file: requirements/github-actions.yml
260260
miniforge-variant: Mambaforge
261261
use-mamba: true

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
- bug fixes:
66

77
- fixes name of jupyterlab-lsp package displayed in JupyterLab UI ([#570])
8+
- remove vendored CodeMirror from distribution ([#576])
89

910
[#570]: https://github.com/krassowski/jupyterlab-lsp/pull/570
11+
[#576]: https://github.com/krassowski/jupyterlab-lsp/pull/576
1012

1113
### `@krassowski/jupyterlab-lsp 3.5.0` (2020-03-22)
1214

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ To run tests matching specific phrase, forward `-t` argument over yarn and lerna
126126
jlpm test -- -- -t match_phrase
127127
```
128128

129+
To verify the webpack build wouldn't include problematic vendored dependencies:
130+
131+
```bash
132+
python scripts/distcheck.py
133+
```
134+
129135
### Server Development
130136

131137
#### Testing `jupyter-lsp`

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"vscode-css-languageserver-bin": "^1.4.0",
2626
"vscode-html-languageserver-bin": "^1.4.0",
2727
"vscode-json-languageserver-bin": "^1.0.1",
28-
"yaml-language-server": "^0.12.0",
29-
"vscode-json-languageservice": "^3.9.1 <3.10.0"
28+
"vscode-json-languageservice": "^3.9.1 <3.10.0",
29+
"yaml-language-server": "^0.12.0"
3030
},
3131
"husky": {
3232
"hooks": {}
@@ -38,7 +38,7 @@
3838
},
3939
"private": true,
4040
"scripts": {
41-
"bootstrap": "jlpm --no-optional --prefer-offline && lerna bootstrap && jlpm lint && jlpm clean && jlpm build",
41+
"bootstrap": "jlpm --no-optional --prefer-offline && lerna bootstrap && jlpm clean && jlpm build && jlpm lint",
4242
"build": "jlpm build:schema && jlpm build:meta && jlpm build:ws && jlpm build:labextension",
4343
"build:schema": "lerna run build:schema --stream",
4444
"build:meta": "lerna run build --stream --scope @krassowski/jupyterlab-lsp-metapackage",

packages/.eslintrc.js

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ module.exports = {
1010
root: true,
1111
extends: [
1212
'eslint:recommended',
13+
'plugin:import/errors',
14+
'plugin:import/warnings',
15+
'plugin:import/typescript',
1316
'plugin:@typescript-eslint/eslint-recommended',
1417
'plugin:@typescript-eslint/recommended',
1518
'prettier/@typescript-eslint',
@@ -55,12 +58,32 @@ module.exports = {
5558
'no-undef': 'warn',
5659
'no-useless-escape': 'off',
5760
'prefer-const': 'off',
58-
// deviations from jupyterlab, should not be changed
59-
// a pitfall of enums is that they do not work correctly
60-
// when circular dependencies are present
61-
// (see https://stackoverflow.com/a/59665223/)
62-
'import/no-cycle': 'error',
61+
// the default, but for reference...
62+
'import/order': [
63+
'warn',
64+
{
65+
groups: [
66+
'builtin',
67+
'external',
68+
'parent',
69+
'sibling',
70+
'index',
71+
'object',
72+
'unknown'
73+
],
74+
pathGroups: [
75+
{ pattern: 'react/**', group: 'builtin', order: 'after' },
76+
{ pattern: 'codemirror/**', group: 'external', order: 'before' },
77+
{ pattern: '@lumino/**', group: 'external', order: 'before' },
78+
{ pattern: '@jupyterlab/**', group: 'external', order: 'after' }
79+
],
80+
'newlines-between': 'always',
81+
alphabetize: { order: 'asc' }
82+
}
83+
],
6384
// deviations from jupyterlab, should probably be fixed
85+
'import/no-cycle': 'off', // somehow we lapsed here... ~200 cycles now
86+
'import/export': 'off', // we do class/interface + NS pun exports _all over_
6487
'@typescript-eslint/triple-slash-reference': 'off',
6588
'jest/no-test-callback': 'off',
6689
'jest/valid-expect': 'off',

packages/_example-extractor/src/api.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
import { IExtractedCode } from '@krassowski/jupyterlab-lsp';
12
import { expect } from 'chai';
23

34
import { extractor } from '.';
45

5-
import { IExtractedCode } from '@krassowski/jupyterlab-lsp';
6-
76
const EXAMPLE = `%%foo
87
bar
98
`;

packages/_example-extractor/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
JupyterFrontEnd,
33
JupyterFrontEndPlugin
44
} from '@jupyterlab/application';
5-
65
import {
76
ILSPCodeExtractorsManager,
87
RegExpForeignCodeExtractor

packages/code-jumpers/src/history.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { IGlobalPosition } from './positions';
21
import { IModelDB, IObservableUndoableList } from '@jupyterlab/observables';
32
import { JSONValue } from '@lumino/coreutils';
43

4+
import { IGlobalPosition } from './positions';
5+
56
const DB_ENTRY = 'jumpy_history';
67

78
export class JumpHistory {

packages/code-jumpers/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { FileEditorJumper } from './jumpers/fileeditor';
12
import { CodeJumper } from './jumpers/jumper';
23
import { NotebookJumper } from './jumpers/notebook';
3-
import { FileEditorJumper } from './jumpers/fileeditor';
44

55
export { CodeJumper, NotebookJumper, FileEditorJumper };

packages/code-jumpers/src/jumpers/fileeditor.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import { CodeEditor } from '@jupyterlab/codeeditor';
2+
import { IDocumentManager } from '@jupyterlab/docmanager';
3+
import { IDocumentWidget } from '@jupyterlab/docregistry';
14
import { FileEditor } from '@jupyterlab/fileeditor';
5+
6+
import { JumpHistory } from '../history';
27
import { IGlobalPosition, ILocalPosition } from '../positions';
8+
39
import { CodeJumper, jumpers } from './jumper';
4-
import { JumpHistory } from '../history';
5-
import { IDocumentManager } from '@jupyterlab/docmanager';
6-
import { IDocumentWidget } from '@jupyterlab/docregistry';
7-
import { CodeEditor } from '@jupyterlab/codeeditor';
810

911
export class FileEditorJumper extends CodeJumper {
1012
editor: FileEditor;

0 commit comments

Comments
 (0)