Skip to content

Commit ede42c0

Browse files
authored
Rename the extension to jupyterlab-chat (#102)
* Rename the extension to jupyterlab-chat (javascript and python) * lint * Rename directories * Rename the typescript classes and namespaces * Rename HTML classes * Fix documentation
1 parent 05335ee commit ede42c0

File tree

89 files changed

+245
-278
lines changed

Some content is hidden

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

89 files changed

+245
-278
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ jobs:
8383
- name: Package extension
8484
run: |
8585
set -eux
86-
pip install build python/jupyterlab-collaborative-chat
87-
python -m build python/jupyterlab-collaborative-chat
88-
pip uninstall -y "jupyterlab_collaborative_chat" jupyterlab
86+
pip install build python/jupyterlab-chat
87+
python -m build python/jupyterlab-chat
88+
pip uninstall -y "jupyterlab_chat" jupyterlab
8989
9090
- name: Upload package
9191
uses: actions/upload-artifact@v3
9292
with:
93-
name: jupyterlab_collaborative_chat-artifacts
94-
path: python/jupyterlab-collaborative-chat/dist/jupyterlab_collaborative_chat*
93+
name: jupyterlab_chat-artifacts
94+
path: python/jupyterlab-chat/dist/jupyterlab_chat*
9595
if-no-files-found: error
9696

9797
integration-tests:
@@ -112,15 +112,15 @@ jobs:
112112
- name: Download extension package
113113
uses: actions/download-artifact@v3
114114
with:
115-
name: jupyterlab_collaborative_chat-artifacts
115+
name: jupyterlab_chat-artifacts
116116

117117
- name: Install the extension
118118
run: |
119119
set -eux
120-
python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_collaborative_chat*.whl
120+
python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_chat*.whl
121121
122122
- name: Install dependencies
123-
working-directory: python/jupyterlab-collaborative-chat/ui-tests
123+
working-directory: python/jupyterlab-chat/ui-tests
124124
env:
125125
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
126126
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
@@ -135,21 +135,21 @@ jobs:
135135

136136
- name: Install browser
137137
run: jlpm playwright install chromium
138-
working-directory: python/jupyterlab-collaborative-chat/ui-tests
138+
working-directory: python/jupyterlab-chat/ui-tests
139139

140140
- name: Execute integration tests
141-
working-directory: python/jupyterlab-collaborative-chat/ui-tests
141+
working-directory: python/jupyterlab-chat/ui-tests
142142
run: |
143143
jlpm playwright test --retries=2
144144
145145
- name: Upload Playwright Test report
146146
if: always()
147147
uses: actions/upload-artifact@v3
148148
with:
149-
name: jupyterlab_collaborative_chat-playwright-tests
149+
name: jupyterlab_chat-playwright-tests
150150
path: |
151-
python/jupyterlab-collaborative-chat/ui-tests/test-results
152-
python/jupyterlab-collaborative-chat/ui-tests/playwright-report
151+
python/jupyterlab-chat/ui-tests/test-results
152+
python/jupyterlab-chat/ui-tests/playwright-report
153153
154154
check_links:
155155
name: Check Links

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ jobs:
7272
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
7373

7474
- name: Install extension
75-
run: ./scripts/dev_install.sh collaborative
75+
run: ./scripts/dev_install.sh
7676

7777
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1
7878
with:
7979
github_token: ${{ secrets.GITHUB_TOKEN }}
8080
# Playwright knows how to start JupyterLab server
8181
start_server_script: 'null'
82-
test_folder: python/jupyterlab-collaborative-chat/ui-tests
82+
test_folder: python/jupyterlab-chat/ui-tests

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ python/**/_version.py
1515

1616
# jest test reports
1717
packages/jupyter-chat/junit.xml
18-
packages/jupyterlab-collaborative-chat/junit.xml
18+
packages/jupyterlab-chat/junit.xml
1919

2020
# Integration tests
21-
python/jupyterlab-collaborative-chat/ui-tests/test-results/
22-
python/jupyterlab-collaborative-chat/ui-tests/playwright-report/
21+
python/jupyterlab-chat/ui-tests/test-results/
22+
python/jupyterlab-chat/ui-tests/playwright-report/
2323

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

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@ package named `@jupyter/chat`.
2727
This package provides a frontend library (using react), and is intended to be
2828
used by a jupyterlab extension to create a chat.
2929

30-
#### jupyterlab-collaborative-chat
30+
#### jupyterlab-chat
3131

32-
The typescript package is located in *packages/jupyterlab-collaborative-chat* and
33-
builds an NPM package named `jupyterlab-collaborative-chat`.
32+
The typescript package is located in *packages/jupyterlab-chat* and
33+
builds an NPM package named `jupyterlab-chat`.
3434

3535
This package relies on `@jupyter/chat` and provides a typescript library.
36-
It is intended to be used by a jupyterlab extension to create a collaborative chat.
36+
It is intended to be used by a jupyterlab extension to create a chat.
3737

3838
### Jupyterlab extensions
3939

40-
#### Chat extension based on shared document: *python/jupyterlab-collaborative-chat*
40+
#### Chat extension based on shared document: *python/jupyterlab-chat*
4141

42-
This extension is an implementation of the `jupyter-collaborative-chat` package, relying
42+
This extension is an implementation of the `jupyter-chat` package, relying
4343
on shared document (see [jupyter_ydoc](https://github.com/jupyter-server/jupyter_ydoc)).
4444

4545
It is composed of:
4646

47-
- a Python package named `jupyterlab_collaborative_chat`, which register
47+
- a Python package named `jupyterlab_chat`, which register
4848
the `YChat` shared document in jupyter_ydoc
49-
- a NPM package named `jupyterlab-collaborative-chat-extension`.
49+
- a NPM package named `jupyterlab-chat-extension`.
5050

5151
#### REMOVED - Chat extension based on websocket
5252

binder/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: jupyterlab-collaborative-chat
1+
name: jupyterlab-chat
22
channels:
33
- conda-forge
44
dependencies:

binder/postBuild

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Copyright (c) Jupyter Development Team.
44
# Distributed under the terms of the Modified BSD License.
55

6-
# Install collaborative chat
7-
./scripts/dev_install.sh collaborative
6+
# Install chat extension
7+
./scripts/dev_install.sh
88

99
jupyter troubleshoot
1010
jupyter notebook --show-config

docs/source/developers/contributing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ maxdepth: 2
1111
---
1212
1313
./jupyter-chat
14-
./jupyterlab-collaborative-chat
14+
./jupyterlab-chat-extension
1515
```

docs/source/developers/contributing/jupyter-chat.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
The `@jupyter/chat` package is a frontend package (React) compatible with jupyterlab.
44
It is not an extension, and cannot be used on its own. It is designed to be used in an
55
extension.\
6-
In this repository, it is currently used in `jupyterlab-collaborative-chat` and
7-
`jupyterlab-ws-chat`.
6+
In this repository, it is currently used in `jupyterlab-chat` extension.
87

98
## Building the package
109

docs/source/developers/contributing/jupyterlab-collaborative-chat.md renamed to docs/source/developers/contributing/jupyterlab-chat-extension.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Collaborative chat
1+
# Jupyterlab chat
22

3-
The `jupyterlab-collaborative-chat` extension adds collaborative chats to jupyterlab.
3+
The `jupyterlab-chat` extension adds chats to jupyterlab based on collaborative documents.
44

55
## Development installation
66

@@ -17,21 +17,21 @@ The following commands install the extension in development mode:
1717

1818
```bash
1919
# Install the extension
20-
./scripts/dev_install.sh collaborative
20+
./scripts/dev_install.sh
2121

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

2626
To uninstall it, run:
2727

2828
```bash
29-
pip uninstall jupyterlab-collaborative-chat
29+
pip uninstall jupyterlab-chat
3030
```
3131

3232
## Building the assets
3333

34-
Changes in typescript sources of `@jupyter/chat` or `jupyterlab-collaborative-chat` must
34+
Changes in typescript sources of `@jupyter/chat` or `jupyterlab-chat` must
3535
be built again to be available in the jupyterlab.
3636

3737
```bash
@@ -40,31 +40,31 @@ jlpm build
4040

4141
## Testing locally the extension
4242

43-
`jupyterlab-collaborative-chat` package has unit tests and integration tests.
43+
`jupyterlab-chat` package has unit tests and integration tests.
4444

4545
### Unit tests
4646

47-
There are a few unit tests in *python/jupyterlab-collaborative-chat/src/\_\_tests\_\_*.
47+
There are a few unit tests in *python/jupyterlab-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 ./python/jupyterlab-collaborative-chat
54+
cd ./python/jupyterlab-chat
5555
jlpm test
5656
```
5757

5858
### Integration tests
5959

60-
The integration tests are located in *python/jupyterlab-collaborative-chat/ui-tests*.
60+
The integration tests are located in *python/jupyterlab-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 ./python/jupyterlab-collaborative-chat/ui-tests
67+
cd ./python/jupyterlab-chat/ui-tests
6868

6969
# Install the tests dependencies
7070
jlpm install

docs/source/developers/developing_extensions/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ maxdepth: 2
1111
---
1212
1313
./extension-providing-chat
14-
./using-chat-extensions
14+
./using-chat-extension
1515
```

docs/source/developers/developing_extensions/using-chat-extensions.md renamed to docs/source/developers/developing_extensions/using-chat-extension.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Using a chat extension in another extension
22

3-
## Collaborative chat
4-
5-
The collaborative chat depends on [jupyter collaboration](https://jupyterlab-realtime-collaboration.readthedocs.io/en/latest/index.html)
3+
The chat extension depends on [jupyter collaboration](https://jupyterlab-realtime-collaboration.readthedocs.io/en/latest/index.html)
64
to exchange the messages.
75

86
As a very brief summary, jupyter collaboration allows jupyterlab users to share a
@@ -13,39 +11,39 @@ frontend or from the backend. The shared document has an object representation i
1311
Typescript (for the frontend) and in Python (for the backend). These representations
1412
can be accessed and used by external extensions.
1513

16-
### Exposed token
14+
## Exposed token
1715

18-
`jupyterlab-collaborative-chat` expose several tokens that allow external extensions to
16+
`jupyterlab-chat` expose several tokens that allow external extensions to
1917
interact with.
2018

21-
#### IChatFactory
19+
### IChatFactory
2220

2321
This token is composed of:
2422

2523
- `widgetConfig` object, to retrieve and change the current [settings](#chat-settings)
2624
of all the chats
27-
- `tracker`, a widget tracker that allows to track all the collaborative chats, and to
25+
- `tracker`, a widget tracker that allows to track all the opened chats, and to
2826
retrieve the current one.
2927

3028
```{caution}
3129
Currently the widget tracker only tracks the main area widgets, not the ones opened in
3230
the side panel.
3331
```
3432

35-
#### IChatPanel
33+
### IChatPanel
3634

3735
This token is a pointer to the left panel containing chats.\
3836
It can be used to programmatically open chat in the panel for example, or to list the
3937
opened chats.
4038

41-
#### IAutocompletionRegistry
39+
### IAutocompletionRegistry
4240

4341
This is the [autocompletion registry](#autocompletion-registry) used by the chat
4442
widgets.
4543

4644
Autocompletion commands can be added to it, and then be used from the chat input.
4745

48-
### Interact with the chat from the backend
46+
## Interact with the chat from the backend
4947

5048
`jupyter_collaboration` provides a websocket server to handle every shared document
5149
on the server side. This websocket server allows to retrieve a shared document.
@@ -54,7 +52,7 @@ In addition, when a shared document is created, an event is emitted. We can use
5452
event to trigger a connection to the shared document.
5553

5654
Here's an example of a server extension that responds to every message received in one
57-
of the collaborative chats:
55+
of the chats:
5856

5957
```python
6058
import jupyter_collaboration
@@ -85,7 +83,7 @@ class MyExtension(ExtensionApp):
8583
name = "my_extension"
8684
app_name = "My Extension"
8785
description = """
88-
this extension interact with collaborative chats
86+
this extension interact with chats
8987
"""
9088

9189
def initialize(self):
@@ -101,7 +99,7 @@ class MyExtension(ExtensionApp):
10199
and data["action"] == "initialize"\
102100
and data["msg"] == "Room initialized":
103101

104-
self.log.info(f"Collaborative chat server is listening for {data["room"]}")
102+
self.log.info(f"Chat server is listening for {data["room"]}")
105103
chat = await self.get_chat(data["room"])
106104
callback = partial(self.on_change, chat)
107105
chat.ymessages.observe(callback)

docs/source/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This documentation includes several projects all together:
77
- `@jupyter/chat`, a front-end package (typescript), including all the components
88
required to build a chat. This package is designed to be used in an extension.
99

10-
- `jupyterlab-collaborative-chat`, an extension built on top of `@jupyter/chat`, using
10+
- `jupyterlab-chat`, an extension built on top of `@jupyter/chat`, using
1111
the collaborative edition as messaging system.
1212

1313
```{toctree}

docs/source/users/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
# Users
22

3-
## Collaborative chat
3+
## Chat extension
44

5-
The `jupyterlab-collaborative-chat` extension adds collaborative chats to jupyterlab.
5+
The `jupyterlab-chat` extension adds chats to jupyterlab.
66

7-
![collaborative chat](../_static/images/collaboarative-chat.png)
7+
![chat widgets](../_static/images/chat-widgets.png)
88

99
These chats use [jupyter_collaboration](https://jupyterlab-realtime-collaboration.readthedocs.io/en/latest/),
1010
the collaborative edition of documents in jupyterlab.
1111

12-
### Install collaborative chat
12+
### Install chat extension
1313

14-
The collaborative chat is available on [PyPI](https://pypi.org/project/jupyterlab-collaborative-chat/).
14+
The chat extension is available on [PyPI](https://pypi.org/project/jupyterlab-chat/).
1515

1616
```bash
17-
pip install jupyterlab-collaborative-chat
17+
pip install jupyterlab-chat
1818
```
1919

2020
To uninstall the package:
2121

2222
```bash
23-
pip uninstall jupyterlab-collaborative-chat
23+
pip uninstall jupyterlab-chat
2424
```
2525

2626
### Create a chat

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"workspaces": [
2525
"packages/*",
26-
"python/jupyterlab-collaborative-chat"
26+
"python/jupyterlab-chat"
2727
],
2828
"scripts": {
2929
"build": "lerna run build --stream",

packages/jupyterlab-collaborative-chat/package.json renamed to packages/jupyterlab-chat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "jupyterlab-collaborative-chat",
2+
"name": "jupyterlab-chat",
33
"version": "0.5.0",
44
"description": "The library to build a chat based on shared document",
55
"keywords": [
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Example of [Jest](https://jestjs.io/docs/getting-started) unit tests
88
*/
99

10-
describe('jupyterlab-collaborative-chat', () => {
10+
describe('jupyterlab-chat', () => {
1111
it('should be tested', () => {
1212
expect(1 + 1).toEqual(2);
1313
});

0 commit comments

Comments
 (0)