Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CF Collaborator #7499

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
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
45 changes: 45 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions plugins/text-editor-resources/src/provider/cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ export interface DatalakeCollabProviderParameters {
token: string

document: YDoc
content: Ref<Blob> | null
source: Ref<Blob> | null
}

export class CloudCollabProvider extends WebsocketProvider implements Provider {
readonly loaded: Promise<void>

constructor ({ document, url, name, content }: DatalakeCollabProviderParameters) {
const params = content != null ? { content } : undefined
constructor ({ document, url, name, source, token }: DatalakeCollabProviderParameters) {
const params = { token, source: source ?? '' }

super(url, encodeURIComponent(name), document, { params })

Expand Down
2 changes: 1 addition & 1 deletion plugins/text-editor-resources/src/provider/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function createRemoteProvider (ydoc: Ydoc, doc: CollaborativeDoc, content
url: collaboratorUrl,
name: documentId,
document: ydoc,
content,
source: content,
token
})
: new HocuspocusCollabProvider({
Expand Down
5 changes: 5 additions & 0 deletions rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,11 @@
"packageName": "@hcengineering/cloud-transactor",
"projectFolder": "workers/transactor",
"shouldPublish": false
},
{
"packageName": "@hcengineering/cloud-collaborator",
"projectFolder": "workers/collaborator",
"shouldPublish": false
}
]
}
7 changes: 7 additions & 0 deletions workers/collaborator/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: ['./node_modules/@hcengineering/platform-rig/profiles/node/eslint.config.json'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json'
}
}
7 changes: 7 additions & 0 deletions workers/collaborator/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
roots: ["./src"],
coverageReporters: ["text-summary", "html"]
}
46 changes: 46 additions & 0 deletions workers/collaborator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "@hcengineering/cloud-collaborator",
"version": "0.6.0",
"main": "lib/index.js",
"types": "types/index.d.ts",
"template": "@hcengineering/cloud-package",
"scripts": {
"deploy": "wrangler deploy",
"dev": "wrangler dev --port 4021",
"start": "wrangler dev --port 4021",
"cf-typegen": "wrangler types",
"build": "compile",
"build:watch": "compile",
"test": "jest --passWithNoTests --silent --forceExit",
"format": "format src",
"_phase:build": "compile transpile src",
"_phase:test": "jest --passWithNoTests --silent --forceExit",
"_phase:format": "format src",
"_phase:validate": "compile validate"
},
"devDependencies": {
"@hcengineering/platform-rig": "^0.6.0",
"@cloudflare/workers-types": "^4.20241022.0",
"typescript": "^5.3.3",
"wrangler": "^3.97.0",
"jest": "^29.7.0",
"prettier": "^3.1.0",
"ts-jest": "^29.1.1",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"eslint-config-standard-with-typescript": "^40.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.4.0",
"eslint-plugin-promise": "^6.1.1",
"eslint": "^8.54.0",
"@types/jest": "^29.5.5",
"@hcengineering/cloud-datalake": "^0.6.0"
},
"dependencies": {
"itty-router": "^5.0.18",
"lib0": "^0.2.88",
"yjs": "^13.6.19",
"y-protocols": "^1.0.6",
"y-prosemirror": "^1.2.12"
}
}
Loading
Loading