Skip to content

Commit

Permalink
Extract out ICollaborativeDrive to @jupyter/collaborativedrive
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Sep 18, 2024
1 parent 7d58496 commit eb1976f
Show file tree
Hide file tree
Showing 12 changed files with 110 additions and 15 deletions.
5 changes: 5 additions & 0 deletions packages/collaboration-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -102,6 +103,10 @@
"bundled": true,
"singleton": true
},
"@jupyter/collaborativedrive": {
"bundled": true,
"singleton": true
},
"@jupyter/docprovider": {
"bundled": true,
"singleton": true
Expand Down
6 changes: 2 additions & 4 deletions packages/collaboration-extension/src/collaboration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
54 changes: 54 additions & 0 deletions packages/collaborativedrive/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"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",
"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"
}
}
10 changes: 10 additions & 0 deletions packages/collaborativedrive/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/**
* @packageDocumentation
* @module collaborativedrive
*/

export * from './tokens';
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { DocumentChange, IAwareness, YDocument } from '@jupyter/ydoc';
import { Contents } from '@jupyterlab/services';

import { Token } from '@lumino/coreutils';
import { WebSocketProvider } from './yprovider';

/**
* The collaborative drive.
Expand Down Expand Up @@ -38,7 +37,7 @@ export interface ICollaborativeDrive extends Contents.IDrive {
*/
readonly sharedModelFactory: ISharedModelFactory;

readonly providers: Map<string, WebSocketProvider>;
readonly providers: Map<string, IDocProvider>;
}

/**
Expand All @@ -56,3 +55,8 @@ export interface ISharedModelFactory extends Contents.ISharedFactory {
factory: SharedDocumentFactory
): void;
}

/**
* Yjs document provider.
*/
export interface IDocProvider {}
9 changes: 9 additions & 0 deletions packages/collaborativedrive/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"include": ["src/*"],
"exclude": ["src/__tests__/*"]
}
5 changes: 5 additions & 0 deletions packages/docprovider-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -105,6 +106,10 @@
"bundled": false,
"singleton": true
},
"@jupyter/collaborativedrive": {
"bundled": true,
"singleton": true
},
"@jupyter/docprovider": {
"bundled": true,
"singleton": true
Expand Down
10 changes: 3 additions & 7 deletions packages/docprovider-extension/src/filebrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
1 change: 1 addition & 0 deletions packages/docprovider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion packages/docprovider/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ export * from './notebookCellExecutor';
export * from './requests';
export * from './ydrive';
export * from './yprovider';
export * from './tokens';
export * from './TimelineSlider';
2 changes: 1 addition & 1 deletion packages/docprovider/src/ydrive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
ICollaborativeDrive,
ISharedModelFactory,
SharedDocumentFactory
} from './tokens';
} from '@jupyter/collaborativedrive';
import { Awareness } from 'y-protocols/awareness';

const DISABLE_RTC =
Expand Down
14 changes: 14 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eb1976f

Please sign in to comment.