Skip to content

Commit 7b1f25c

Browse files
committed
Import shared model
1 parent 8566cbc commit 7b1f25c

File tree

19 files changed

+6749
-9
lines changed

19 files changed

+6749
-9
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,22 @@ jobs:
4848
python-version: "3.7"
4949
- name: Install dependencies
5050
run: |
51-
mamba install python=${{ matrix.python-version }} pip nodejs
51+
mamba install python=${{ matrix.python-version }} pip nodejs=16 yarn
5252
pip install .[test]
53-
cd tests; npm install
54-
- name: Run tests
53+
54+
- name: Build JavaScript assets
55+
working-directory: javascript
56+
run: |
57+
yarn
58+
yarn build
59+
cd ../tests; npm install
60+
61+
- name: Run Python tests
5562
run: |
5663
pytest -v
64+
65+
- name: Run JS tests
66+
working-directory: javascript
67+
run: |
68+
yarn build:test
69+
yarn test:cov

.gitignore

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

128128
# Pyre type checker
129129
.pyre/
130+
131+
node_modules/
132+
tests/package-lock.json

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.js

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.js

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

javascript/package.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "@jupyter-notebook/ydoc",
3+
"version": "0.2.0",
4+
"type": "module",
5+
"description": "Jupyter document structures for collaborative editing using YJS",
6+
"homepage": "https://github.com/jupyter-server/jupyter_ydoc",
7+
"bugs": {
8+
"url": "https://github.com/jupyter-server/jupyter_ydoc/issues"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/jupyter-server/jupyter_ydoc.git"
13+
},
14+
"license": "BSD-3-Clause",
15+
"author": "Project Jupyter",
16+
"main": "lib/index.js",
17+
"types": "lib/index.d.ts",
18+
"directories": {
19+
"lib": "lib/"
20+
},
21+
"files": [
22+
"lib/**/*.{d.ts,js,js.map,json}"
23+
],
24+
"scripts": {
25+
"build": "tsc -b",
26+
"build:test": "tsc --build tsconfig.test.json",
27+
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
28+
"docs": "typedoc src",
29+
"test": "jest",
30+
"test:cov": "jest --collect-coverage",
31+
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
32+
"test:debug:watch": "node --inspect-brk node_modules/.bin/jest --runInBand --watch",
33+
"watch": "tsc -b --watch"
34+
},
35+
"dependencies": {
36+
"@jupyterlab/nbformat": "^3.0.0 || ^4.0.0-alpha.15",
37+
"@lumino/coreutils": "^1.11.0 || ^2.0.0-alpha.6",
38+
"@lumino/disposable": "^1.10.0 || ^2.0.0-alpha.6",
39+
"@lumino/signaling": "^1.10.0 || ^2.0.0-alpha.6",
40+
"y-protocols": "^1.0.5",
41+
"yjs": "^13.5.40"
42+
},
43+
"devDependencies": {
44+
"@types/jest": "^26.0.10",
45+
"jest": "^26.4.2",
46+
"rimraf": "~3.0.0",
47+
"ts-jest": "^26.3.0",
48+
"typescript": "~4.7.3"
49+
},
50+
"publishConfig": {
51+
"access": "public"
52+
}
53+
}

0 commit comments

Comments
 (0)