Skip to content

Commit cbe0cdf

Browse files
Reoganize the project to split typescript packages and extensions (#78)
* Split jupyter_collaborative_chat fontend package and python extension * Automatic application of license header * Update workflows * lint * Update doc and remove jest test in collaborative extension * update yarn.lock * Move the websocket extension to the python directory * Fix collaborative chat installation * Fix jest tests * Remove nested .gitignore and .yarnrc.yml * Remove the notebook application config and rename server config file in the websocket extension --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 4839eda commit cbe0cdf

File tree

105 files changed

+1478
-1297
lines changed

Some content is hidden

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

105 files changed

+1478
-1297
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ jobs:
6565
- name: Package extension
6666
run: |
6767
set -eux
68-
pip install build packages/jupyterlab-${{ matrix.extension }}-chat
69-
python -m build packages/jupyterlab-${{ matrix.extension }}-chat
68+
pip install build python/jupyterlab-${{ matrix.extension }}-chat
69+
python -m build python/jupyterlab-${{ matrix.extension }}-chat
7070
pip uninstall -y "jupyterlab_${{ matrix.extension }}_chat" jupyterlab
7171
7272
- name: Upload package
7373
uses: actions/upload-artifact@v3
7474
with:
7575
name: jupyterlab_${{ matrix.extension }}_chat-artifacts
76-
path: packages/jupyterlab-${{ matrix.extension }}-chat/dist/jupyterlab_${{ matrix.extension }}_chat*
76+
path: python/jupyterlab-${{ matrix.extension }}-chat/dist/jupyterlab_${{ matrix.extension }}_chat*
7777
if-no-files-found: error
7878

7979
integration-tests:
@@ -105,7 +105,7 @@ jobs:
105105
python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_${{ matrix.extension }}_chat*.whl
106106
107107
- name: Install dependencies
108-
working-directory: packages/jupyterlab-${{ matrix.extension }}-chat/ui-tests
108+
working-directory: python/jupyterlab-${{ matrix.extension }}-chat/ui-tests
109109
env:
110110
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
111111
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
@@ -120,10 +120,10 @@ jobs:
120120

121121
- name: Install browser
122122
run: jlpm playwright install chromium
123-
working-directory: packages/jupyterlab-${{ matrix.extension }}-chat/ui-tests
123+
working-directory: python/jupyterlab-${{ matrix.extension }}-chat/ui-tests
124124

125125
- name: Execute integration tests
126-
working-directory: packages/jupyterlab-${{ matrix.extension }}-chat/ui-tests
126+
working-directory: python/jupyterlab-${{ matrix.extension }}-chat/ui-tests
127127
run: |
128128
jlpm playwright test --retries=2
129129
@@ -133,8 +133,8 @@ jobs:
133133
with:
134134
name: jupyterlab_${{ matrix.extension }}_chat-playwright-tests
135135
path: |
136-
packages/jupyterlab-${{ matrix.extension }}-chat/ui-tests/test-results
137-
packages/jupyterlab-${{ matrix.extension }}-chat/ui-tests/playwright-report
136+
python/jupyterlab-${{ matrix.extension }}-chat/ui-tests/test-results
137+
python/jupyterlab-${{ matrix.extension }}-chat/ui-tests/playwright-report
138138
139139
check_links:
140140
name: Check Links

.github/workflows/update-integration-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ jobs:
7979
github_token: ${{ secrets.GITHUB_TOKEN }}
8080
# Playwright knows how to start JupyterLab server
8181
start_server_script: 'null'
82-
test_folder: packages/jupyterlab-ws-chat/ui-tests
82+
test_folder: python/jupyterlab-ws-chat/ui-tests
8383

8484
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1
8585
with:
8686
github_token: ${{ secrets.GITHUB_TOKEN }}
8787
# Playwright knows how to start JupyterLab server
8888
start_server_script: 'null'
89-
test_folder: packages/jupyterlab-collaborative-chat/ui-tests
89+
test_folder: python/jupyterlab-collaborative-chat/ui-tests

.gitignore

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@ node_modules/
77
*.egg-info/
88
.ipynb_checkpoints
99
*.tsbuildinfo
10-
jupyter_chat/labextension
1110
.jupyter_ystore.db
11+
labextension
12+
1213
# Version file is handled by hatchling
13-
jupyter_chat/_version.py
14+
python/**/_version.py
15+
16+
# jest test reports
17+
packages/jupyter-chat/junit.xml
18+
packages/jupyterlab-collaborative-chat/junit.xml
1419

1520
# Integration tests
16-
ui-tests/test-results/
17-
ui-tests/playwright-report/
21+
python/jupyterlab-collaborative-chat/ui-tests/test-results/
22+
python/jupyterlab-collaborative-chat/ui-tests/playwright-report/
1823

1924
# Created by https://www.gitignore.io/api/python
2025
# Edit at https://www.gitignore.io/?templates=python

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,36 @@ Many components of this chat project come from [jupyter-ai](https://github.com/j
1414

1515
### Typescript package
1616

17+
#### @jupyter/chat
18+
1719
The typescript package is located in *packages/jupyter-chat* and builds an NPM
1820
package named `@jupyter/chat`.
1921

2022
This package provides a frontend library (using react), and is intended to be
2123
used by a jupyterlab extension to create a chat.
2224

25+
#### jupyterlab-collaborative-chat
26+
27+
The typescript package is located in *packages/jupyterlab-collaborative-chat* and
28+
builds an NPM package named `jupyterlab-collaborative-chat`.
29+
30+
This package relies on `@jupyter/chat` and provides a typescript library.
31+
It is intended to be used by a jupyterlab extension to create a collaborative chat.
32+
2333
### Jupyterlab extensions
2434

25-
#### Chat extension based on shared document: *packages/jupyterlab-collaborative-chat*
35+
#### Chat extension based on shared document: *python/jupyterlab-collaborative-chat*
2636

27-
This extension is an implementation of the `@jupyter/chat` package, relying on
28-
shared document (see [jupyter_ydoc](https://github.com/jupyter-server/jupyter_ydoc)).
37+
This extension is an implementation of the `jupyter-collaborative-chat` package, relying
38+
on shared document (see [jupyter_ydoc](https://github.com/jupyter-server/jupyter_ydoc)).
2939

3040
It is composed of:
3141

3242
- a Python package named `jupyterlab_collaborative_chat`, which register
3343
the `YChat` shared document in jupyter_ydoc
34-
- a NPM package named `jupyterlab-collaborative-chat`.
44+
- a NPM package named `jupyterlab-collaborative-chat-extension`.
3545

36-
#### Chat extension based on websocket: *packages/jupyterlab-ws-chat*
46+
#### Chat extension based on websocket: *python/jupyterlab-ws-chat*
3747

3848
This extension is an implementation of the `@jupyter/chat` package, relying on
3949
websocket for the communication between server and front end.

docs/source/developers/contributing/jupyterlab-collaborative-chat.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The following commands install the extension in development mode:
2020
./scripts/install.sh collaborative
2121

2222
# Symlink the assets
23-
jupyter labextension develop --overwrite packages/jupyterlab-collaborative-chat
23+
jupyter labextension develop --overwrite python/jupyterlab-collaborative-chat
2424
```
2525

2626
To uninstall it, run:
@@ -44,27 +44,27 @@ jlpm build:collaborative
4444

4545
### Unit tests
4646

47-
There are a few unit tests in *packages/jupyterlab-collaborative-chat/src/\_\_tests\_\_*.
47+
There are a few unit tests in *python/jupyterlab-collaborative-chat/src/\_\_tests\_\_*.
4848

4949
They make use of [jest](https://jestjs.io/).
5050

5151
The following commands run them:
5252

5353
```bash
54-
cd ./packages/jupyterlab-collaborative-chat
54+
cd ./python/jupyterlab-collaborative-chat
5555
jlpm test
5656
```
5757

5858
### Integration tests
5959

60-
The integration tests are located in *packages/jupyterlab-collaborative-chat/ui-tests*.
60+
The integration tests are located in *python/jupyterlab-collaborative-chat/ui-tests*.
6161

6262
They make use of [playwright](https://playwright.dev/).
6363

6464
The following commands run them:
6565

6666
```bash
67-
cd ./packages/jupyterlab-collaborative-chat/ui-tests
67+
cd ./python/jupyterlab-collaborative-chat/ui-tests
6868

6969
# Install the tests dependencies
7070
jlpm install

docs/source/developers/contributing/jupyterlab-ws-chat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The following commands install the extension in development mode:
2020
./scripts/install.sh ws
2121

2222
# Symlink the assets
23-
jupyter labextension develop --overwrite packages/jupyterlab-ws-chat
23+
jupyter labextension develop --overwrite python/jupyterlab-ws-chat
2424
```
2525

2626
To uninstall it, run:

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222
"url": "https://github.com/jupyterlab/jupyter-chat.git"
2323
},
2424
"workspaces": [
25-
"packages/*"
25+
"packages/*",
26+
"python/jupyterlab-collaborative-chat",
27+
"python/jupyterlab-ws-chat"
2628
],
2729
"scripts": {
2830
"build": "lerna run build --stream",
2931
"build:core": "lerna run build --stream --scope \"@jupyter/chat\"",
30-
"build:collaborative": "lerna run build --scope=jupyterlab-collaborative-chat --include-filtered-dependencies",
31-
"build:ws": "lerna run build --scope=jupyterlab-ws-chat --include-filtered-dependencies",
32+
"build:collaborative": "lerna run build --scope=jupyterlab-collaborative-chat-extension --include-filtered-dependencies",
33+
"build:ws": "lerna run build --scope=jupyterlab-ws-chat-extension --include-filtered-dependencies",
3234
"build:prod": "lerna run build:prod --stream",
3335
"clean": "lerna run clean",
3436
"clean:all": "lerna run clean:all",

packages/jupyter-chat/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
* Distributed under the terms of the Modified BSD License.
44
*/
55

6-
module.exports = require('@jupyterlab/testutils/lib/babel.config');
6+
module.exports = require('@jupyterlab/testing/lib/babel-config');

packages/jupyter-chat/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Distributed under the terms of the Modified BSD License.
44
*/
55

6-
const jestJupyterLab = require('@jupyterlab/testutils/lib/jest-config');
6+
const jestJupyterLab = require('@jupyterlab/testing/lib/jest-config');
77

88
const esModules = [
99
'@codemirror',

packages/jupyter-chat/package.json

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"react-dom": "^18.2.0"
7171
},
7272
"devDependencies": {
73+
"@jupyterlab/testing": "^4.2.0",
7374
"@types/jest": "^29.2.0",
7475
"@types/json-schema": "^7.0.11",
7576
"@types/react": "^18.2.0",
@@ -102,20 +103,6 @@
102103
"publishConfig": {
103104
"access": "public"
104105
},
105-
"jupyterlab": {
106-
"discovery": {
107-
"server": {
108-
"managers": [
109-
"pip"
110-
],
111-
"base": {
112-
"name": "jupyter_chat"
113-
}
114-
}
115-
},
116-
"extension": false,
117-
"schemaDir": "schema"
118-
},
119106
"eslintIgnore": [
120107
"node_modules",
121108
"dist",

0 commit comments

Comments
 (0)