Skip to content

Commit 952bf0a

Browse files
Merge pull request #86 from fcollonval/import-yjs-models
Import shared model
2 parents 8566cbc + 2b1df54 commit 952bf0a

23 files changed

+8770
-27
lines changed

.github/workflows/test.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Tests
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [0.2.x]
66
pull_request:
7-
branches: [main]
7+
branches: [0.2.x]
88

99
jobs:
1010
pre-commit:
@@ -46,11 +46,31 @@ jobs:
4646
mamba-version: "*"
4747
channels: conda-forge
4848
python-version: "3.7"
49+
4950
- name: Install dependencies
5051
run: |
51-
mamba install python=${{ matrix.python-version }} pip nodejs
52+
mamba install python=${{ matrix.python-version }} pip nodejs=16 yarn
5253
pip install .[test]
53-
cd tests; npm install
54-
- name: Run tests
54+
55+
- name: Build JavaScript assets
56+
working-directory: javascript
57+
run: |
58+
yarn
59+
yarn build
60+
cd ../tests; npm install
61+
62+
- name: Linter check
63+
if: ${{ !contains(matrix.os, 'windows') }}
64+
working-directory: javascript
65+
run: |
66+
yarn lint:check
67+
68+
- name: Run Python tests
5569
run: |
5670
pytest -v
71+
72+
- name: Run JS tests
73+
working-directory: javascript
74+
run: |
75+
yarn build:test
76+
yarn test:cov

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,8 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
node_modules/
132+
tests/package-lock.json
133+
javascript/tsconfig.tsbuildinfo
134+
javascript/.eslintcache

CHANGELOG.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -231,59 +231,59 @@ Back-port of #56, #57 and #59.
231231

232232
## 0.1.4
233233

234-
([Full Changelog](https://github.com/davidbrochart/jupyter_ydoc/compare/v0.1.3...d6e754a8c957582029d923cadc4e6547a324718c))
234+
([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.3...d6e754a8c957582029d923cadc4e6547a324718c))
235235

236236
### Merged PRs
237237

238-
- Update ypy>=0.5.0 [#9](https://github.com/davidbrochart/jupyter_ydoc/pull/9) ([@davidbrochart](https://github.com/davidbrochart))
238+
- Update ypy>=0.5.0 [#9](https://github.com/jupyter-server/jupyter_ydoc/pull/9) ([@davidbrochart](https://github.com/davidbrochart))
239239

240240
### Contributors to this release
241241

242-
([GitHub contributors page for this release](https://github.com/davidbrochart/jupyter_ydoc/graphs/contributors?from=2022-05-05&to=2022-05-09&type=c))
242+
([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-05&to=2022-05-09&type=c))
243243

244-
[@davidbrochart](https://github.com/search?q=repo%3Adavidbrochart%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-05..2022-05-09&type=Issues)
244+
[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-05..2022-05-09&type=Issues)
245245

246246
## 0.1.3
247247

248-
([Full Changelog](https://github.com/davidbrochart/jupyter_ydoc/compare/v0.1.2...c68ebe54e500edde4eb34aa598dfb7bbb4d22b63))
248+
([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.2...c68ebe54e500edde4eb34aa598dfb7bbb4d22b63))
249249

250250
### Merged PRs
251251

252-
- Add setuptools to install_requires [#7](https://github.com/davidbrochart/jupyter_ydoc/pull/7) ([@davidbrochart](https://github.com/davidbrochart))
252+
- Add setuptools to install_requires [#7](https://github.com/jupyter-server/jupyter_ydoc/pull/7) ([@davidbrochart](https://github.com/davidbrochart))
253253

254254
### Contributors to this release
255255

256-
([GitHub contributors page for this release](https://github.com/davidbrochart/jupyter_ydoc/graphs/contributors?from=2022-05-05&to=2022-05-05&type=c))
256+
([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-05&to=2022-05-05&type=c))
257257

258-
[@davidbrochart](https://github.com/search?q=repo%3Adavidbrochart%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-05..2022-05-05&type=Issues)
258+
[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-05..2022-05-05&type=Issues)
259259

260260
## 0.1.2
261261

262-
([Full Changelog](https://github.com/davidbrochart/jupyter_ydoc/compare/v0.1.1...6a1fc44531344e1f930a7fd52b62cbd289873be0))
262+
([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.1...6a1fc44531344e1f930a7fd52b62cbd289873be0))
263263

264264
### Merged PRs
265265

266-
- Improve jupyter_ydoc.ydocs [#5](https://github.com/davidbrochart/jupyter_ydoc/pull/5) ([@davidbrochart](https://github.com/davidbrochart))
266+
- Improve jupyter_ydoc.ydocs [#5](https://github.com/jupyter-server/jupyter_ydoc/pull/5) ([@davidbrochart](https://github.com/davidbrochart))
267267

268268
### Contributors to this release
269269

270-
([GitHub contributors page for this release](https://github.com/davidbrochart/jupyter_ydoc/graphs/contributors?from=2022-05-04&to=2022-05-05&type=c))
270+
([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-04&to=2022-05-05&type=c))
271271

272-
[@davidbrochart](https://github.com/search?q=repo%3Adavidbrochart%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-04..2022-05-05&type=Issues)
272+
[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-04..2022-05-05&type=Issues)
273273

274274
## 0.1.1
275275

276-
([Full Changelog](https://github.com/davidbrochart/jupyter_ydoc/compare/0.1.0...9db91b826c38116ab1e00b26140dd49950e1a793))
276+
([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/0.1.0...9db91b826c38116ab1e00b26140dd49950e1a793))
277277

278278
### Merged PRs
279279

280-
- Add test [#3](https://github.com/davidbrochart/jupyter_ydoc/pull/3) ([@davidbrochart](https://github.com/davidbrochart))
281-
- Update README [#1](https://github.com/davidbrochart/jupyter_ydoc/pull/1) ([@davidbrochart](https://github.com/davidbrochart))
280+
- Add test [#3](https://github.com/jupyter-server/jupyter_ydoc/pull/3) ([@davidbrochart](https://github.com/davidbrochart))
281+
- Update README [#1](https://github.com/jupyter-server/jupyter_ydoc/pull/1) ([@davidbrochart](https://github.com/davidbrochart))
282282

283283
### Contributors to this release
284284

285-
([GitHub contributors page for this release](https://github.com/davidbrochart/jupyter_ydoc/graphs/contributors?from=2022-05-02&to=2022-05-04&type=c))
285+
([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-02&to=2022-05-04&type=c))
286286

287-
[@davidbrochart](https://github.com/search?q=repo%3Adavidbrochart%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-02..2022-05-04&type=Issues)
287+
[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-02..2022-05-04&type=Issues)
288288

289289
## 0.1.0

javascript/.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
lib

javascript/.eslintrc.cjs

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
commonjs: true,
6+
node: true,
7+
'jest/globals': true
8+
},
9+
globals: {
10+
BigInt: 'readonly',
11+
HTMLCollectionOf: 'readonly',
12+
NodeJS: 'readonly',
13+
RequestInit: 'readonly',
14+
RequestInfo: 'readonly',
15+
ScrollLogicalPosition: 'readonly'
16+
},
17+
root: true,
18+
extends: [
19+
'eslint:recommended',
20+
'plugin:@typescript-eslint/eslint-recommended',
21+
'plugin:@typescript-eslint/recommended',
22+
'prettier'
23+
],
24+
parser: '@typescript-eslint/parser',
25+
plugins: ['@typescript-eslint'],
26+
overrides: [
27+
{
28+
files: ['test/**/*.spec.ts'],
29+
plugins: ['jest'],
30+
extends: ['plugin:jest/recommended'],
31+
rules: {
32+
'jest/no-conditional-expect': 'warn',
33+
'jest/valid-title': 'warn',
34+
'jest/no-standalone-expect': [
35+
'error',
36+
{
37+
additionalTestBlockFunctions: ['it']
38+
}
39+
]
40+
}
41+
}
42+
],
43+
rules: {
44+
'@typescript-eslint/naming-convention': [
45+
'error',
46+
{
47+
selector: 'interface',
48+
format: ['PascalCase'],
49+
custom: {
50+
regex: '^I[A-Z]',
51+
match: true
52+
}
53+
}
54+
],
55+
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
56+
'@typescript-eslint/no-use-before-define': 'off',
57+
'@typescript-eslint/no-explicit-any': 'off',
58+
'@typescript-eslint/no-non-null-assertion': 'off',
59+
'@typescript-eslint/no-namespace': 'off',
60+
'@typescript-eslint/interface-name-prefix': 'off',
61+
'@typescript-eslint/explicit-function-return-type': 'off',
62+
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
63+
'@typescript-eslint/ban-types': 'warn',
64+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'warn',
65+
'@typescript-eslint/no-var-requires': 'off',
66+
'@typescript-eslint/no-empty-interface': 'off',
67+
'@typescript-eslint/triple-slash-reference': 'warn',
68+
'@typescript-eslint/no-inferrable-types': 'off',
69+
camelcase: [
70+
'error',
71+
{
72+
allow: [
73+
'cell_type',
74+
'display_name',
75+
'execution_count',
76+
'orig_nbformat',
77+
'outputs_hidden',
78+
'nbformat_minor'
79+
]
80+
}
81+
],
82+
'id-match': ['error', '^[a-zA-Z_]+[a-zA-Z0-9_]*$'], // https://certitude.consulting/blog/en/invisible-backdoor/
83+
'no-inner-declarations': 'off',
84+
'no-prototype-builtins': 'off',
85+
'no-control-regex': 'warn',
86+
'no-undef': 'warn',
87+
'no-case-declarations': 'warn',
88+
'no-useless-escape': 'off',
89+
'prefer-const': 'off',
90+
'sort-imports': [
91+
'error',
92+
{
93+
ignoreCase: true,
94+
ignoreDeclarationSort: true,
95+
ignoreMemberSort: false,
96+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
97+
allowSeparatedGroups: false
98+
}
99+
]
100+
}
101+
};

javascript/.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
lib
3+
package.json

javascript/.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "none",
4+
"arrowParens": "avoid"
5+
}

javascript/.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "attach",
7+
"name": "Attach to jest",
8+
// Usage:
9+
// Open the parent directory in VSCode
10+
// Run `jlpm test:debug:watch` in a terminal
11+
// Run this debugging task
12+
"port": 9229
13+
}
14+
]
15+
}

javascript/babel.config.cjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) Jupyter Development Team.
3+
* Distributed under the terms of the Modified BSD License.
4+
*/
5+
6+
module.exports = {
7+
presets: [
8+
[
9+
'@babel/preset-env',
10+
{
11+
targets: {
12+
node: 'current'
13+
}
14+
}
15+
]
16+
]
17+
};

javascript/jest.config.cjs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright (c) Jupyter Development Team.
3+
* Distributed under the terms of the Modified BSD License.
4+
*/
5+
6+
const path = require('path');
7+
const esModules = ['lib0', 'y-protocols', 'y-websocket', 'yjs'].join('|');
8+
9+
module.exports = {
10+
preset: 'ts-jest/presets/js-with-babel',
11+
testTimeout: 10000,
12+
testPathIgnorePatterns: ['/lib/', '/node_modules/'],
13+
moduleFileExtensions: [
14+
'ts',
15+
'tsx',
16+
'js',
17+
'jsx',
18+
'json',
19+
'node',
20+
'mjs',
21+
'cjs'
22+
],
23+
transformIgnorePatterns: [`/node_modules/(?!${esModules}).+`],
24+
reporters: ['default'],
25+
coverageReporters: ['json', 'lcov', 'text', 'html'],
26+
coverageDirectory: path.join(__dirname, 'coverage'),
27+
testRegex: '/test/.*.spec.ts[x]?$',
28+
globals: {
29+
'ts-jest': {
30+
tsconfig: `./tsconfig.test.json`
31+
}
32+
}
33+
};

0 commit comments

Comments
 (0)