diff --git a/.copier-answers.yml b/.copier-answers.yml index c03c22d..9deb760 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d478933..1dfc6a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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: @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index a9e12ec..161adc1 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -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 diff --git a/.gitignore b/.gitignore index 13838e1..6541c49 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/.prettierignore b/.prettierignore index 3668575..f78e957 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,4 +3,4 @@ node_modules **/lib **/package.json !/package.json -floating_chat +jupyter_floating_chat diff --git a/README.md b/README.md index f722b5a..e733fb5 100644 --- a/README.md +++ b/README.md @@ -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. @@ -13,7 +13,7 @@ A JupyterLab extension to add a floating chat. To install the extension, execute: ```bash -pip install floating_chat +pip install jupyter_floating_chat ``` ## Uninstall @@ -21,7 +21,7 @@ pip install floating_chat To remove the extension, execute: ```bash -pip uninstall floating_chat +pip uninstall jupyter_floating_chat ``` ## Contributing @@ -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 @@ -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 diff --git a/RELEASE.md b/RELEASE.md index 22b88f5..1398e11 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -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). diff --git a/install.json b/install.json index 23a424f..52e8454 100644 --- a/install.json +++ b/install.json @@ -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" } diff --git a/floating_chat/__init__.py b/jupyter_floating_chat/__init__.py similarity index 85% rename from floating_chat/__init__.py rename to jupyter_floating_chat/__init__.py index 850ec95..386bd1c 100644 --- a/floating_chat/__init__.py +++ b/jupyter_floating_chat/__init__.py @@ -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" diff --git a/package.json b/package.json index e113f06..2d99737 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "floating-chat", + "name": "jupyter-floating-chat", "version": "0.1.0", "description": "A JupyterLab extension to add a floating chat.", "keywords": [ @@ -7,9 +7,9 @@ "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": { @@ -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", @@ -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", @@ -106,7 +106,7 @@ }, "jupyterlab": { "extension": true, - "outputDir": "floating_chat/labextension", + "outputDir": "jupyter_floating_chat/labextension", "schemaDir": "schema" }, "eslintIgnore": [ diff --git a/pyproject.toml b/pyproject.toml index 72c3c1d..b84a79c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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" @@ -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" diff --git a/schema/plugin.json b/schema/plugin.json index 0aba72a..49c4f89 100644 --- a/schema/plugin.json +++ b/schema/plugin.json @@ -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 diff --git a/src/__tests__/floating_chat.spec.ts b/src/__tests__/floating_chat.spec.ts index 8a41aa5..0ba49d0 100644 --- a/src/__tests__/floating_chat.spec.ts +++ b/src/__tests__/floating_chat.spec.ts @@ -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); }); diff --git a/src/index.ts b/src/index.ts index 1eeabce..0ec8f9e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 = { - id: 'floating-chat:plugin', + id: 'jupyter-floating-chat:plugin', description: 'A JupyterLab extension to add a floating chat.', autoStart: true, optional: [ISettingRegistry, INotebookTracker], @@ -22,7 +22,7 @@ const plugin: JupyterFrontEndPlugin = { 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 = {}; @@ -86,10 +86,16 @@ const plugin: JupyterFrontEndPlugin = { 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 + ); }); } diff --git a/src/tokens.ts b/src/tokens.ts index c845f98..1ba2fba 100644 --- a/src/tokens.ts +++ b/src/tokens.ts @@ -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'; } /** @@ -20,6 +20,6 @@ export interface IFloatingInputOptions { * The token providing the floating chat options. */ export const IFloatingInputOptions = new Token( - 'floating-chat:options', + 'jupyter-floating-chat:options', 'The default options for the floating chat.' ); diff --git a/ui-tests/package.json b/ui-tests/package.json index 73bf3af..119c77f 100644 --- a/ui-tests/package.json +++ b/ui-tests/package.json @@ -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", diff --git a/ui-tests/tests/floating_chat.spec.ts b/ui-tests/tests/floating_chat.spec.ts index 14ef096..1f30657 100644 --- a/ui-tests/tests/floating_chat.spec.ts +++ b/ui-tests/tests/floating_chat.spec.ts @@ -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); }); diff --git a/yarn.lock b/yarn.lock index 851f60d..cf07c26 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5864,49 +5864,6 @@ __metadata: languageName: node linkType: hard -"floating-chat@workspace:.": - version: 0.0.0-use.local - resolution: "floating-chat@workspace:." - dependencies: - "@jupyter/chat": ^0.18.1 - "@jupyter/react-components": ^0.16.0 - "@jupyterlab/application": ^4.0.0 - "@jupyterlab/apputils": ^4.0.0 - "@jupyterlab/builder": ^4.0.0 - "@jupyterlab/cells": ^4.0.0 - "@jupyterlab/notebook": ^4.0.0 - "@jupyterlab/settingregistry": ^4.0.0 - "@jupyterlab/testutils": ^4.0.0 - "@jupyterlab/ui-components": ^4.0.0 - "@lumino/coreutils": ^2.2.1 - "@lumino/messaging": ^2.0.3 - "@lumino/widgets": ^2.7.1 - "@types/jest": ^29.2.0 - "@types/json-schema": ^7.0.11 - "@types/react": ^18.0.26 - "@types/react-addons-linked-state-mixin": ^0.14.22 - "@typescript-eslint/eslint-plugin": ^6.1.0 - "@typescript-eslint/parser": ^6.1.0 - css-loader: ^6.7.1 - eslint: ^8.36.0 - eslint-config-prettier: ^8.8.0 - eslint-plugin-prettier: ^5.0.0 - jest: ^29.2.0 - npm-run-all2: ^7.0.1 - prettier: ^3.0.0 - rimraf: ^5.0.1 - source-map-loader: ^1.0.2 - style-loader: ^3.3.1 - stylelint: ^15.10.1 - stylelint-config-recommended: ^13.0.0 - stylelint-config-standard: ^34.0.0 - stylelint-csstree-validator: ^3.0.0 - stylelint-prettier: ^4.0.0 - typescript: ~5.8.0 - yjs: ^13.5.0 - languageName: unknown - linkType: soft - "foreground-child@npm:^3.1.0": version: 3.3.1 resolution: "foreground-child@npm:3.3.1" @@ -7345,6 +7302,49 @@ __metadata: languageName: node linkType: hard +"jupyter-floating-chat@workspace:.": + version: 0.0.0-use.local + resolution: "jupyter-floating-chat@workspace:." + dependencies: + "@jupyter/chat": ^0.18.1 + "@jupyter/react-components": ^0.16.0 + "@jupyterlab/application": ^4.0.0 + "@jupyterlab/apputils": ^4.0.0 + "@jupyterlab/builder": ^4.0.0 + "@jupyterlab/cells": ^4.0.0 + "@jupyterlab/notebook": ^4.0.0 + "@jupyterlab/settingregistry": ^4.0.0 + "@jupyterlab/testutils": ^4.0.0 + "@jupyterlab/ui-components": ^4.0.0 + "@lumino/coreutils": ^2.2.1 + "@lumino/messaging": ^2.0.3 + "@lumino/widgets": ^2.7.1 + "@types/jest": ^29.2.0 + "@types/json-schema": ^7.0.11 + "@types/react": ^18.0.26 + "@types/react-addons-linked-state-mixin": ^0.14.22 + "@typescript-eslint/eslint-plugin": ^6.1.0 + "@typescript-eslint/parser": ^6.1.0 + css-loader: ^6.7.1 + eslint: ^8.36.0 + eslint-config-prettier: ^8.8.0 + eslint-plugin-prettier: ^5.0.0 + jest: ^29.2.0 + npm-run-all2: ^7.0.1 + prettier: ^3.0.0 + rimraf: ^5.0.1 + source-map-loader: ^1.0.2 + style-loader: ^3.3.1 + stylelint: ^15.10.1 + stylelint-config-recommended: ^13.0.0 + stylelint-config-standard: ^34.0.0 + stylelint-csstree-validator: ^3.0.0 + stylelint-prettier: ^4.0.0 + typescript: ~5.8.0 + yjs: ^13.5.0 + languageName: unknown + linkType: soft + "keyv@npm:^4.5.3": version: 4.5.4 resolution: "keyv@npm:4.5.4"