Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ author_name: Project Jupyter
has_binder: false
has_settings: true
kind: frontend
labextension_name: floating-chat
labextension_name: jupyter-floating-chat
project_short_description: A JupyterLab extension to add a floating chat.
python_name: floating_chat
repository: https://github.com/jupyter-ai-contrib/floating-chat
python_name: jupyter_floating_chat
repository: https://github.com/jupyter-ai-contrib/jupyter-floating-chat
test: true

14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
python -m pip install .[test]

jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "floating-chat.*OK"
jupyter labextension list 2>&1 | grep -ie "jupyter-floating-chat.*OK"
python -m jupyterlab.browser_check

- name: Package the extension
Expand All @@ -50,13 +50,13 @@ jobs:

pip install build
python -m build
pip uninstall -y "floating_chat" jupyterlab
pip uninstall -y "jupyter_floating_chat" jupyterlab

- name: Upload extension packages
uses: actions/upload-artifact@v4
with:
name: extension-artifacts
path: dist/floating_chat*
path: dist/jupyter_floating_chat*
if-no-files-found: error

test_isolated:
Expand All @@ -79,11 +79,11 @@ jobs:
sudo rm -rf $(which node)
sudo rm -rf $(which node)

pip install "jupyterlab>=4.0.0,<5" floating_chat*.whl
pip install "jupyterlab>=4.0.0,<5" jupyter_floating_chat*.whl


jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "floating-chat.*OK"
jupyter labextension list 2>&1 | grep -ie "jupyter-floating-chat.*OK"
python -m jupyterlab.browser_check --no-browser-test

integration-tests:
Expand All @@ -109,7 +109,7 @@ jobs:
- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab>=4.0.0,<5" floating_chat*.whl
python -m pip install "jupyterlab>=4.0.0,<5" jupyter_floating_chat*.whl

- name: Install dependencies
working-directory: ui-tests
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: floating_chat-playwright-tests
name: jupyter_floating_chat-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ jobs:
- name: Upload Distributions
uses: actions/upload-artifact@v4
with:
name: floating_chat-releaser-dist-${{ github.run_number }}
name: jupyter_floating_chat-releaser-dist-${{ github.run_number }}
path: .jupyter_releaser_checkout/dist
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ node_modules/
*.egg-info/
.ipynb_checkpoints
*.tsbuildinfo
floating_chat/labextension
jupyter_floating_chat/labextension
# Version file is handled by hatchling
floating_chat/_version.py
jupyter_floating_chat/_version.py

# Integration tests
ui-tests/test-results/
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ node_modules
**/lib
**/package.json
!/package.json
floating_chat
jupyter_floating_chat
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# floating_chat
# jupyter_floating_chat

[![Github Actions Status](https://github.com/jupyter-ai-contrib/floating-chat/workflows/Build/badge.svg)](https://github.com/jupyter-ai-contrib/floating-chat/actions/workflows/build.yml)
[![Github Actions Status](https://github.com/jupyter-ai-contrib/jupyter-floating-chat/workflows/Build/badge.svg)](https://github.com/jupyter-ai-contrib/jupyter-floating-chat/actions/workflows/build.yml)

A JupyterLab extension to add a floating chat.

Expand All @@ -13,15 +13,15 @@ A JupyterLab extension to add a floating chat.
To install the extension, execute:

```bash
pip install floating_chat
pip install jupyter_floating_chat
```

## Uninstall

To remove the extension, execute:

```bash
pip uninstall floating_chat
pip uninstall jupyter_floating_chat
```

## Contributing
Expand All @@ -36,7 +36,7 @@ The `jlpm` command is JupyterLab's pinned version of

```bash
# Clone the repo to your local environment
# Change directory to the floating_chat directory
# Change directory to the jupyter_floating_chat directory
# Install package in development mode
pip install -e "."
# Link your development version of the extension with JupyterLab
Expand Down Expand Up @@ -65,12 +65,12 @@ jupyter lab build --minimize=False
### Development uninstall

```bash
pip uninstall floating_chat
pip uninstall jupyter_floating_chat
```

In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
folder is located. Then you can remove the symlink named `floating-chat` within that folder.
folder is located. Then you can remove the symlink named `jupyter-floating-chat` within that folder.

### Testing the extension

Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Making a new release of floating_chat
# Making a new release of jupyter_floating_chat

The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser).

Expand Down
4 changes: 2 additions & 2 deletions install.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packageManager": "python",
"packageName": "floating_chat",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package floating_chat"
"packageName": "jupyter_floating_chat",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyter_floating_chat"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# in editable mode with pip. It is highly recommended to install
# the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs
import warnings
warnings.warn("Importing 'floating_chat' outside a proper installation.")
warnings.warn("Importing 'jupyter_floating_chat' outside a proper installation.")
__version__ = "dev"


Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "floating-chat",
"name": "jupyter-floating-chat",
"version": "0.1.0",
"description": "A JupyterLab extension to add a floating chat.",
"keywords": [
"jupyter",
"jupyterlab",
"jupyterlab-extension"
],
"homepage": "https://github.com/jupyter-ai-contrib/floating-chat",
"homepage": "https://github.com/jupyter-ai-contrib/jupyter-floating-chat",
"bugs": {
"url": "https://github.com/jupyter-ai-contrib/floating-chat/issues"
"url": "https://github.com/jupyter-ai-contrib/jupyter-floating-chat/issues"
},
"license": "BSD-3-Clause",
"author": {
Expand All @@ -27,7 +27,7 @@
"style": "style/index.css",
"repository": {
"type": "git",
"url": "https://github.com/jupyter-ai-contrib/floating-chat.git"
"url": "https://github.com/jupyter-ai-contrib/jupyter-floating-chat.git"
},
"scripts": {
"build": "jlpm build:lib && jlpm build:labextension:dev",
Expand All @@ -39,7 +39,7 @@
"clean": "jlpm clean:lib",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:lintcache": "rimraf .eslintcache .stylelintcache",
"clean:labextension": "rimraf floating_chat/labextension floating_chat/_version.py",
"clean:labextension": "rimraf jupyter_floating_chat/labextension jupyter_floating_chat/_version.py",
"clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
"eslint": "jlpm eslint:check --fix",
"eslint:check": "eslint . --cache --ext .ts,.tsx",
Expand Down Expand Up @@ -106,7 +106,7 @@
},
"jupyterlab": {
"extension": true,
"outputDir": "floating_chat/labextension",
"outputDir": "jupyter_floating_chat/labextension",
"schemaDir": "schema"
},
"eslintIgnore": [
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version>=0
build-backend = "hatchling.build"

[project]
name = "floating_chat"
name = "jupyter_floating_chat"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.9"
Expand Down Expand Up @@ -33,24 +33,24 @@ source = "nodejs"
fields = ["description", "authors", "urls", "keywords"]

[tool.hatch.build.targets.sdist]
artifacts = ["floating_chat/labextension"]
artifacts = ["jupyter_floating_chat/labextension"]
exclude = [".github", "binder"]

[tool.hatch.build.targets.wheel.shared-data]
"floating_chat/labextension" = "share/jupyter/labextensions/floating-chat"
"install.json" = "share/jupyter/labextensions/floating-chat/install.json"
"jupyter_floating_chat/labextension" = "share/jupyter/labextensions/jupyter-floating-chat"
"install.json" = "share/jupyter/labextensions/jupyter-floating-chat/install.json"

[tool.hatch.build.hooks.version]
path = "floating_chat/_version.py"
path = "jupyter_floating_chat/_version.py"

[tool.hatch.build.hooks.jupyter-builder]
dependencies = ["hatch-jupyter-builder>=0.5"]
build-function = "hatch_jupyter_builder.npm_builder"
ensured-targets = [
"floating_chat/labextension/static/style.js",
"floating_chat/labextension/package.json",
"jupyter_floating_chat/labextension/static/style.js",
"jupyter_floating_chat/labextension/package.json",
]
skip-if-exists = ["floating_chat/labextension/static/style.js"]
skip-if-exists = ["jupyter_floating_chat/labextension/static/style.js"]

[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
build_cmd = "build:prod"
Expand All @@ -60,7 +60,7 @@ npm = ["jlpm"]
build_cmd = "install:extension"
npm = ["jlpm"]
source_dir = "src"
build_dir = "floating_chat/labextension"
build_dir = "jupyter_floating_chat/labextension"

[tool.jupyter-releaser.options]
version_cmd = "hatch version"
Expand Down
4 changes: 2 additions & 2 deletions schema/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"jupyter.lab.shortcuts": [],
"title": "floating-chat",
"description": "floating-chat settings.",
"title": "jupyter-floating-chat",
"description": "jupyter-floating-chat settings.",
"type": "object",
"properties": {},
"additionalProperties": false
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/floating_chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Example of [Jest](https://jestjs.io/docs/getting-started) unit tests
*/

describe('floating-chat', () => {
describe('jupyter-floating-chat', () => {
it('should be tested', () => {
expect(1 + 1).toEqual(2);
});
Expand Down
16 changes: 11 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { FloatingInputWidget } from './widget';
import { CommandIds, IFloatingInputOptions } from './tokens';

/**
* Initialization data for the floating-chat extension.
* Initialization data for the jupyter-floating-chat extension.
*/
const plugin: JupyterFrontEndPlugin<IFloatingInputOptions> = {
id: 'floating-chat:plugin',
id: 'jupyter-floating-chat:plugin',
description: 'A JupyterLab extension to add a floating chat.',
autoStart: true,
optional: [ISettingRegistry, INotebookTracker],
Expand All @@ -22,7 +22,7 @@ const plugin: JupyterFrontEndPlugin<IFloatingInputOptions> = {
settingRegistry: ISettingRegistry | null,
notebookTracker: INotebookTracker
): IFloatingInputOptions => {
console.log('JupyterLab extension floating-chat is activated!');
console.log('JupyterLab extension jupyter-floating-chat is activated!');

const options: IFloatingInputOptions = {};

Expand Down Expand Up @@ -86,10 +86,16 @@ const plugin: JupyterFrontEndPlugin<IFloatingInputOptions> = {
settingRegistry
.load(plugin.id)
.then(settings => {
console.log('floating-chat settings loaded:', settings.composite);
console.log(
'jupyter-floating-chat settings loaded:',
settings.composite
);
})
.catch(reason => {
console.error('Failed to load settings for floating-chat.', reason);
console.error(
'Failed to load settings for jupyter-floating-chat.',
reason
);
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export namespace CommandIds {
/**
* The command to open a floating input.
*/
export const openInput = 'floating-chat:open-input';
export const openInput = 'jupyter-floating-chat:open-input';
}

/**
Expand All @@ -20,6 +20,6 @@ export interface IFloatingInputOptions {
* The token providing the floating chat options.
*/
export const IFloatingInputOptions = new Token<IFloatingInputOptions>(
'floating-chat:options',
'jupyter-floating-chat:options',
'The default options for the floating chat.'
);
4 changes: 2 additions & 2 deletions ui-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "floating-chat-ui-tests",
"name": "jupyter-floating-chat-ui-tests",
"version": "1.0.0",
"description": "JupyterLab floating-chat Integration Tests",
"description": "JupyterLab jupyter-floating-chat Integration Tests",
"private": true,
"scripts": {
"start": "jupyter lab --config jupyter_server_test_config.py",
Expand Down
4 changes: 3 additions & 1 deletion ui-tests/tests/floating_chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ test('should emit an activation console message', async ({ page }) => {
await page.goto();

expect(
logs.filter(s => s === 'JupyterLab extension floating-chat is activated!')
logs.filter(
s => s === 'JupyterLab extension jupyter-floating-chat is activated!'
)
).toHaveLength(1);
});
Loading
Loading