diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea5bc36b..fef35975 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,12 +56,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 @@ -71,6 +71,7 @@ jobs: pip install "jupyterlab>=4.0.0,<5" pip install -e . jlpm + jlpm build - name: Run Tests run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bbf07239..63f5ba4a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,7 +60,7 @@ repos: rev: v0.991 hooks: - id: mypy - exclude: "(^binder/jupyter_config\\.py$)|(/setup\\.py$)" + exclude: "(^binder/jupyter_config\\.py$)|(/setup\\.py$)|(^scripts/bump_version\\.py$)" args: ["--config-file", "pyproject.toml"] additional_dependencies: [tornado, pytest] stages: [manual] diff --git a/packages/collaboration-extension/package.json b/packages/collaboration-extension/package.json index 50202c93..5c81e9b5 100644 --- a/packages/collaboration-extension/package.json +++ b/packages/collaboration-extension/package.json @@ -54,6 +54,7 @@ }, "dependencies": { "@jupyter/collaboration": "^3.0.0-beta.4", + "@jupyter/collaborativedrive": "^3.0.0-beta.4", "@jupyter/docprovider": "^3.0.0-beta.4", "@jupyter/ydoc": "^2.0.0 || ^3.0.0-a3", "@jupyterlab/application": "^4.2.0", @@ -102,6 +103,10 @@ "bundled": true, "singleton": true }, + "@jupyter/collaborativedrive": { + "bundled": true, + "singleton": true + }, "@jupyter/docprovider": { "bundled": true, "singleton": true diff --git a/packages/collaboration-extension/src/collaboration.ts b/packages/collaboration-extension/src/collaboration.ts index cb45671b..deff16e1 100644 --- a/packages/collaboration-extension/src/collaboration.ts +++ b/packages/collaboration-extension/src/collaboration.ts @@ -14,10 +14,8 @@ import { EditorExtensionRegistry, IEditorExtensionRegistry } from '@jupyterlab/codemirror'; -import { - IGlobalAwareness, - WebSocketAwarenessProvider -} from '@jupyter/docprovider'; +import { IGlobalAwareness } from '@jupyter/collaborativedrive'; +import { WebSocketAwarenessProvider } from '@jupyter/docprovider'; import { SidePanel, usersIcon } from '@jupyterlab/ui-components'; import { URLExt } from '@jupyterlab/coreutils'; import { ServerConnection } from '@jupyterlab/services'; diff --git a/packages/collaborativedrive/package.json b/packages/collaborativedrive/package.json new file mode 100644 index 00000000..80c83a89 --- /dev/null +++ b/packages/collaborativedrive/package.json @@ -0,0 +1,55 @@ +{ + "name": "@jupyter/collaborativedrive", + "version": "3.0.0-beta.4", + "description": "JupyterLab - Collaborative Drive", + "homepage": "https://github.com/jupyterlab/jupyter-collaboration", + "bugs": { + "url": "https://github.com/jupyterlab/jupyter-collaboration/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/jupyterlab/jupyter-collaboration.git" + }, + "license": "BSD-3-Clause", + "author": "Project Jupyter", + "sideEffects": [ + "style/**/*" + ], + "main": "lib/index.js", + "types": "lib/index.d.ts", + "directories": { + "lib": "lib/" + }, + "files": [ + "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}", + "schema/*.json", + "style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}", + "style/index.js" + ], + "scripts": { + "build": "tsc -b", + "build:prod": "jlpm run build", + "build:test": "tsc --build tsconfig.test.json", + "clean": "rimraf lib tsconfig.tsbuildinfo", + "clean:lib": "jlpm run clean:all", + "clean:all": "rimraf lib tsconfig.tsbuildinfo node_modules", + "install:extension": "jlpm run build", + "watch": "tsc -b --watch" + }, + "dependencies": { + "@jupyter/ydoc": "^2.0.0 || ^3.0.0-a3", + "@jupyterlab/coreutils": "^6.2.0" + }, + "devDependencies": { + "rimraf": "^4.1.2", + "typescript": "~5.0.4" + }, + "publishConfig": { + "access": "public" + }, + "typedoc": { + "entryPoint": "./src/index.ts", + "displayName": "@jupyter/collaborativedrive", + "tsconfig": "./tsconfig.json" + } +} diff --git a/packages/collaborativedrive/src/index.ts b/packages/collaborativedrive/src/index.ts new file mode 100644 index 00000000..8b915cdd --- /dev/null +++ b/packages/collaborativedrive/src/index.ts @@ -0,0 +1,10 @@ +/* ----------------------------------------------------------------------------- +| Copyright (c) Jupyter Development Team. +| Distributed under the terms of the Modified BSD License. +|----------------------------------------------------------------------------*/ +/** + * @packageDocumentation + * @module collaborativedrive + */ + +export * from './tokens'; diff --git a/packages/docprovider/src/tokens.ts b/packages/collaborativedrive/src/tokens.ts similarity index 81% rename from packages/docprovider/src/tokens.ts rename to packages/collaborativedrive/src/tokens.ts index 5784057d..d7f8b963 100644 --- a/packages/docprovider/src/tokens.ts +++ b/packages/collaborativedrive/src/tokens.ts @@ -3,9 +3,9 @@ import { DocumentChange, IAwareness, YDocument } from '@jupyter/ydoc'; import { Contents } from '@jupyterlab/services'; +import { IDisposable } from '@lumino/disposable'; import { Token } from '@lumino/coreutils'; -import { WebSocketProvider } from './yprovider'; /** * The collaborative drive. @@ -38,7 +38,7 @@ export interface ICollaborativeDrive extends Contents.IDrive { */ readonly sharedModelFactory: ISharedModelFactory; - readonly providers: Map; + readonly providers: Map; } /** @@ -56,3 +56,13 @@ export interface ISharedModelFactory extends Contents.ISharedFactory { factory: SharedDocumentFactory ): void; } + +/** + * An interface for a document provider. + */ +export interface IDocumentProvider extends IDisposable { + /** + * Returns a Promise that resolves when the document provider is ready. + */ + readonly ready: Promise; +} diff --git a/packages/collaborativedrive/tsconfig.json b/packages/collaborativedrive/tsconfig.json new file mode 100644 index 00000000..50493532 --- /dev/null +++ b/packages/collaborativedrive/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "lib", + "rootDir": "src" + }, + "include": ["src/*"], + "exclude": ["src/__tests__/*"] +} diff --git a/packages/docprovider-extension/package.json b/packages/docprovider-extension/package.json index 36bbaf39..59568882 100644 --- a/packages/docprovider-extension/package.json +++ b/packages/docprovider-extension/package.json @@ -53,6 +53,7 @@ "watch:labextension": "jupyter labextension watch ." }, "dependencies": { + "@jupyter/collaborativedrive": "^3.0.0-beta.4", "@jupyter/docprovider": "^3.0.0-beta.4", "@jupyter/ydoc": "^2.0.0 || ^3.0.0-a3", "@jupyterlab/application": "^4.2.0", @@ -105,6 +106,10 @@ "bundled": false, "singleton": true }, + "@jupyter/collaborativedrive": { + "bundled": true, + "singleton": true + }, "@jupyter/docprovider": { "bundled": true, "singleton": true diff --git a/packages/docprovider-extension/src/filebrowser.ts b/packages/docprovider-extension/src/filebrowser.ts index 34dbb380..c2342ab9 100644 --- a/packages/docprovider-extension/src/filebrowser.ts +++ b/packages/docprovider-extension/src/filebrowser.ts @@ -29,13 +29,9 @@ import { CommandRegistry } from '@lumino/commands'; import { YFile, YNotebook } from '@jupyter/ydoc'; -import { - ICollaborativeDrive, - IForkProvider, - IGlobalAwareness, - TimelineWidget, - YDrive -} from '@jupyter/docprovider'; +import { IGlobalAwareness } from '@jupyter/collaborativedrive'; +import { IForkProvider, TimelineWidget, YDrive } from '@jupyter/docprovider'; +import { ICollaborativeDrive } from '@jupyter/collaborativedrive'; import { Awareness } from 'y-protocols/awareness'; import { URLExt } from '@jupyterlab/coreutils'; @@ -167,7 +163,7 @@ export const statusBarTimeline: JupyterFrontEndPlugin = { const [format, type] = documentId.split(':'); const provider = drive.providers.get( `${format}:${type}:${documentPath}` - ) as IForkProvider; + ) as unknown as IForkProvider; const fullPath = URLExt.join( app.serviceManager.serverSettings.baseUrl, DOCUMENT_TIMELINE_URL, diff --git a/packages/docprovider/package.json b/packages/docprovider/package.json index 8165852b..3b0a6ab0 100644 --- a/packages/docprovider/package.json +++ b/packages/docprovider/package.json @@ -41,6 +41,7 @@ "watch": "tsc -b --watch" }, "dependencies": { + "@jupyter/collaborativedrive": "^3.0.0-beta.3", "@jupyter/ydoc": "^2.0.0 || ^3.0.0-a3", "@jupyterlab/apputils": "^4.2.0", "@jupyterlab/cells": "^4.2.0", diff --git a/packages/docprovider/src/index.ts b/packages/docprovider/src/index.ts index 2ab2924c..b3cd6572 100644 --- a/packages/docprovider/src/index.ts +++ b/packages/docprovider/src/index.ts @@ -12,5 +12,4 @@ export * from './notebookCellExecutor'; export * from './requests'; export * from './ydrive'; export * from './yprovider'; -export * from './tokens'; export * from './TimelineSlider'; diff --git a/packages/docprovider/src/ydrive.ts b/packages/docprovider/src/ydrive.ts index a501d9fa..b3577b6a 100644 --- a/packages/docprovider/src/ydrive.ts +++ b/packages/docprovider/src/ydrive.ts @@ -13,7 +13,7 @@ import { ICollaborativeDrive, ISharedModelFactory, SharedDocumentFactory -} from './tokens'; +} from '@jupyter/collaborativedrive'; import { Awareness } from 'y-protocols/awareness'; const DISABLE_RTC = diff --git a/packages/docprovider/src/yprovider.ts b/packages/docprovider/src/yprovider.ts index 341187dc..bfdb9b34 100644 --- a/packages/docprovider/src/yprovider.ts +++ b/packages/docprovider/src/yprovider.ts @@ -3,12 +3,12 @@ | Distributed under the terms of the Modified BSD License. |----------------------------------------------------------------------------*/ +import { IDocumentProvider } from '@jupyter/collaborativedrive'; import { showErrorMessage, Dialog } from '@jupyterlab/apputils'; import { User } from '@jupyterlab/services'; import { TranslationBundle } from '@jupyterlab/translation'; import { PromiseDelegate } from '@lumino/coreutils'; -import { IDisposable } from '@lumino/disposable'; import { Signal } from '@lumino/signaling'; import { DocumentChange, YDocument } from '@jupyter/ydoc'; @@ -19,16 +19,6 @@ import { WebsocketProvider as YWebsocketProvider } from 'y-websocket'; import { requestDocSession } from './requests'; import { IForkProvider } from './ydrive'; -/** - * An interface for a document provider. - */ -export interface IDocumentProvider extends IDisposable { - /** - * Returns a Promise that resolves when the document provider is ready. - */ - readonly ready: Promise; -} - /** * A class to provide Yjs synchronization over WebSocket. * diff --git a/scripts/bump_version.py b/scripts/bump_version.py index 805e4512..5f0c68da 100644 --- a/scripts/bump_version.py +++ b/scripts/bump_version.py @@ -7,7 +7,7 @@ import click import tomlkit from jupyter_releaser.util import get_version, run -from pkg_resources import parse_version # type: ignore +from pkg_resources import parse_version LERNA_CMD = "jlpm run lerna version --no-push --force-publish --no-git-tag-version" diff --git a/yarn.lock b/yarn.lock index 83c41a2e..abb7c7b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2076,6 +2076,7 @@ __metadata: resolution: "@jupyter/collaboration-extension@workspace:packages/collaboration-extension" dependencies: "@jupyter/collaboration": ^3.0.0-beta.4 + "@jupyter/collaborativedrive": ^3.0.0-beta.4 "@jupyter/docprovider": ^3.0.0-beta.4 "@jupyter/ydoc": ^2.0.0 || ^3.0.0-a3 "@jupyterlab/application": ^4.2.0 @@ -2122,10 +2123,22 @@ __metadata: languageName: unknown linkType: soft +"@jupyter/collaborativedrive@^3.0.0-beta.3, @jupyter/collaborativedrive@^3.0.0-beta.4, @jupyter/collaborativedrive@workspace:packages/collaborativedrive": + version: 0.0.0-use.local + resolution: "@jupyter/collaborativedrive@workspace:packages/collaborativedrive" + dependencies: + "@jupyter/ydoc": ^2.0.0 || ^3.0.0-a3 + "@jupyterlab/coreutils": ^6.2.0 + rimraf: ^4.1.2 + typescript: ~5.0.4 + languageName: unknown + linkType: soft + "@jupyter/docprovider-extension@workspace:packages/docprovider-extension": version: 0.0.0-use.local resolution: "@jupyter/docprovider-extension@workspace:packages/docprovider-extension" dependencies: + "@jupyter/collaborativedrive": ^3.0.0-beta.4 "@jupyter/docprovider": ^3.0.0-beta.4 "@jupyter/ydoc": ^2.0.0 || ^3.0.0-a3 "@jupyterlab/application": ^4.2.0 @@ -2153,6 +2166,7 @@ __metadata: version: 0.0.0-use.local resolution: "@jupyter/docprovider@workspace:packages/docprovider" dependencies: + "@jupyter/collaborativedrive": ^3.0.0-beta.3 "@jupyter/ydoc": ^2.0.0 || ^3.0.0-a3 "@jupyterlab/apputils": ^4.2.0 "@jupyterlab/cells": ^4.2.0