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
1 change: 1 addition & 0 deletions e2e/next-sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@liveblocks/eslint-config": "*",
"@playwright/test": "^1.55.0",
"@types/lodash": "^4.17.13",
"eslint": "^9.39.4",
"eslint-config-next": "16.1.4",
"lodash": "^4.17.21",
"playwright": "^1.55.0"
Expand Down
7 changes: 4 additions & 3 deletions e2e/node-sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
"dependencies": {
"@liveblocks/client": "*",
"@liveblocks/node": "*",
"dotenv": "^16.0.0",
"ws": "^8.5.0"
"dotenv": "^16.0.0"
},
"devDependencies": {
"@liveblocks/vitest-config": "*",
"@types/ws": "^8.5.0"
"@types/ws": "^8.5.0",
"eslint": "^9.39.4",
"vitest": "^4.1.4"
}
}
1 change: 0 additions & 1 deletion e2e/node-sandbox/test/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import type { BaseUserMeta, JsonObject, User } from "@liveblocks/client";
import { Liveblocks } from "@liveblocks/node";
import { config } from "dotenv";
import WebSocket from "ws";
import { describe, test, expect, onTestFinished } from "vitest";

type OpaqueUser = User<JsonObject, BaseUserMeta>;
Expand All @@ -16,7 +15,7 @@
console.log(`Running against Liveblocks base URL: ${BASE_URL}`);

// First, create the room with proper permissions
const nodeClient = new Liveblocks({

Check failure on line 18 in e2e/node-sandbox/test/client.test.ts

View workflow job for this annotation

GitHub Actions / e2e-node-sandbox

test/client.test.ts

Error: Invalid value for field 'secret'. Secret keys must start with 'sk_'. Please provide the secret key from your Liveblocks dashboard at https://liveblocks.io/dashboard/apikeys. ❯ assertSecretKey ../../packages/liveblocks-node/src/utils.ts:54:11 ❯ new Liveblocks ../../packages/liveblocks-node/src/client.ts:747:5 ❯ test/client.test.ts:18:20
secret: process.env.LIVEBLOCKS_SECRET_KEY!,
baseUrl: BASE_URL,
});
Expand Down
5,375 changes: 1,141 additions & 4,234 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion packages/liveblocks-chat-sdk-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"devDependencies": {
"@liveblocks/eslint-config": "*",
"@liveblocks/vitest-config": "*",
"chat": "^4.21.0"
"chat": "^4.21.0",
"eslint": "^9.39.4",
"vitest": "^4.1.4"
},
"sideEffects": false,
"bugs": {
Expand Down
4 changes: 3 additions & 1 deletion packages/liveblocks-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
},
"devDependencies": {
"@liveblocks/eslint-config": "*",
"@liveblocks/vitest-config": "*"
"@liveblocks/vitest-config": "*",
"eslint": "^9.39.4",
"vitest": "^4.1.4"
},
"sideEffects": false,
"bugs": {
Expand Down
2 changes: 2 additions & 0 deletions packages/liveblocks-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@
"@liveblocks/query-parser": "^0.1.1",
"@liveblocks/vitest-config": "*",
"@types/ws": "^8.5.10",
"eslint": "^9.39.4",
"fast-check": "^4.6.0",
"msw": "^2.10.4",
"vitest": "^4.1.4",
"ws": "^8.17.1"
},
"peerDependencies": {
Expand Down
8 changes: 2 additions & 6 deletions packages/liveblocks-core/src/__tests__/client.node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* @vitest-environment node
*/

// We're using node-fetch 2.X because 3+ only support ESM and jest is a pain to use with ESM
import { Response as NodeFetchResponse } from "node-fetch";
import { afterAll, beforeAll, describe, expect, test, vi } from "vitest";

import type { ClientOptions } from "../client";
Expand All @@ -16,10 +14,8 @@ import { waitUntilStatus } from "./_waitUtils";
const token =
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NjQ1NjY0MTAsImV4cCI6MTY2NDU3MDAxMCwicGlkIjoiNjA1YTRmZDMxYTM2ZDVlYTdhMmUwOGYxIiwidWlkIjoidXNlcjEiLCJwZXJtcyI6eyJvcmcxKiI6WyJyb29tOndyaXRlIl19LCJrIjoiYWNjIn0.H9EpvO91L5R20ACSIXoJgjmTUeWJRHt91yCxgZ7J0km_FsjaqhYmlyD-ln3N9HpIXnei2y7shyoVTsSKwuYandwVQYLbPXP0tnZSlyp7WbTVcXEz--5ngDj0ePDw5OkDHcDiY243DGJconYZrbru9J86BpgBLsO0d4zJfnmF4hgyGXD7nm7TdJ0DudT_2_gUDECYXcgCT7cRUFfYtkFvC2IYJK0MeFKd3OX06u3k5tw9umUTDRdGs42BAWs6lvUxU4SPkjy24gQVmRK0FCf2sYmtKYA6WmRebp2Y4wR_NLV7GVznZY4-jy8AxmPhzB3GgXj3-uOz_3KC04XHQv8wxg";

const fetchMock = (async () =>
Promise.resolve(
new NodeFetchResponse(JSON.stringify({ token })) as unknown as Response
)) as typeof fetch;
const fetchMock = () =>
Promise.resolve(new Response(JSON.stringify({ token })));

function authEndpointCallback() {
return Promise.resolve({ token });
Expand Down
3 changes: 0 additions & 3 deletions packages/liveblocks-core/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { defaultLiveblocksVitestConfig } from "@liveblocks/vitest-config";

export default defaultLiveblocksVitestConfig({
test: {
// Don't run the e2e/* tests, only the "normal" tests in src/*
// e2e/* tests will be run by `npm run test:e2e`
exclude: ["e2e/**"],

environment: "happy-dom",

// Collect code coverage for this project, when using the --coverage flag
Expand Down
4 changes: 3 additions & 1 deletion packages/liveblocks-emails/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@
"@liveblocks/eslint-config": "*",
"@liveblocks/vitest-config": "*",
"csstype": "3.0.2",
"eslint": "^9.39.4",
"eslint-plugin-react-hooks": "^5.2.0",
"msw": "^2.10.4"
"msw": "^2.10.4",
"vitest": "^4.1.4"
},
"sideEffects": false,
"bugs": {
Expand Down
4 changes: 3 additions & 1 deletion packages/liveblocks-node-lexical/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
},
"devDependencies": {
"@liveblocks/eslint-config": "*",
"@liveblocks/vitest-config": "*"
"@liveblocks/vitest-config": "*",
"eslint": "^9.39.4",
"vitest": "^4.1.4"
},
"bugs": {
"url": "https://github.com/liveblocks/liveblocks/issues"
Expand Down
4 changes: 3 additions & 1 deletion packages/liveblocks-node-prosemirror/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"devDependencies": {
"@liveblocks/eslint-config": "*",
"@liveblocks/vitest-config": "*",
"msw": "^2.10.4"
"eslint": "^9.39.4",
"msw": "^2.10.4",
"vitest": "^4.1.4"
},
"bugs": {
"url": "https://github.com/liveblocks/liveblocks/issues"
Expand Down
4 changes: 3 additions & 1 deletion packages/liveblocks-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
"@liveblocks/eslint-config": "*",
"@liveblocks/vitest-config": "*",
"@types/node-fetch": "^2.6.6",
"eslint": "^9.39.4",
"msw": "^2.10.4",
"svix": "^0.75.0"
"svix": "^0.75.0",
"vitest": "^4.1.4"
},
"bugs": {
"url": "https://github.com/liveblocks/liveblocks/issues"
Expand Down
7 changes: 5 additions & 2 deletions packages/liveblocks-react-blocknote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,19 @@
},
"devDependencies": {
"@liveblocks/eslint-config": "*",
"@liveblocks/vitest-config": "*",
"@liveblocks/rollup-config": "*",
"@liveblocks/vitest-config": "*",
"@testing-library/jest-dom": "^5.16.5",
"eslint": "^9.39.4",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^5.2.0",
"msw": "^2.10.4",
"rollup": "3.28.1",
"stylelint": "^15.10.2",
"stylelint-config-standard": "^34.0.0",
"stylelint-order": "^6.0.3",
"stylelint-plugin-logical-css": "^0.13.2"
"stylelint-plugin-logical-css": "^0.13.2",
"vitest": "^4.1.4"
},
"sideEffects": false,
"bugs": {
Expand Down
5 changes: 4 additions & 1 deletion packages/liveblocks-react-flow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,15 @@
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^13.1.1",
"@xyflow/react": "^12.10.1",
"eslint": "^9.39.4",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^5.2.0",
"rollup": "3.28.1",
"stylelint": "^15.10.2",
"stylelint-config-standard": "^34.0.0",
"stylelint-order": "^6.0.3",
"stylelint-plugin-logical-css": "^0.13.2"
"stylelint-plugin-logical-css": "^0.13.2",
"vitest": "^4.1.4"
},
"sideEffects": false,
"bugs": {
Expand Down
5 changes: 4 additions & 1 deletion packages/liveblocks-react-lexical/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@
"@liveblocks/rollup-config": "*",
"@liveblocks/vitest-config": "*",
"@testing-library/jest-dom": "^5.16.5",
"eslint": "^9.39.4",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^5.2.0",
"msw": "^2.10.4",
"rollup": "3.28.1",
"stylelint": "^15.10.2",
"stylelint-config-standard": "^34.0.0",
"stylelint-order": "^6.0.3",
"stylelint-plugin-logical-css": "^0.13.2"
"stylelint-plugin-logical-css": "^0.13.2",
"vitest": "^4.1.4"
},
"sideEffects": false,
"bugs": {
Expand Down
5 changes: 4 additions & 1 deletion packages/liveblocks-react-tiptap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,16 @@
"@liveblocks/rollup-config": "*",
"@liveblocks/vitest-config": "*",
"@testing-library/jest-dom": "^5.16.5",
"eslint": "^9.39.4",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^5.2.0",
"msw": "^2.10.4",
"rollup": "3.28.1",
"stylelint": "^15.10.2",
"stylelint-config-standard": "^34.0.0",
"stylelint-order": "^6.0.3",
"stylelint-plugin-logical-css": "^0.13.2"
"stylelint-plugin-logical-css": "^0.13.2",
"vitest": "^4.1.4"
},
"sideEffects": false,
"bugs": {
Expand Down
5 changes: 4 additions & 1 deletion packages/liveblocks-react-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,16 @@
"@liveblocks/vitest-config": "*",
"@testing-library/jest-dom": "^6.8.0",
"@testing-library/react": "^16.3.0",
"eslint": "^9.39.4",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^5.2.0",
"msw": "^2.10.4",
"rollup": "3.28.1",
"stylelint": "^15.10.2",
"stylelint-config-standard": "^34.0.0",
"stylelint-order": "^6.0.3",
"stylelint-plugin-logical-css": "^0.13.2"
"stylelint-plugin-logical-css": "^0.13.2",
"vitest": "^4.1.4"
},
"sideEffects": false,
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ export const DropdownItem = forwardRef<HTMLDivElement, DropdownItemProps>(
}
);

export const DropdownTrigger = DropdownMenuPrimitive.Trigger;
export const DropdownTrigger: typeof DropdownMenuPrimitive.Trigger =
DropdownMenuPrimitive.Trigger;
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,5 @@ export const EmojiPicker = forwardRef<HTMLDivElement, EmojiPickerProps>(
}
);

export const EmojiPickerTrigger = PopoverPrimitive.Trigger;
export const EmojiPickerTrigger: typeof PopoverPrimitive.Trigger =
PopoverPrimitive.Trigger;
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,5 @@ function ShortcutTooltipKey({ name, ...props }: ShortcutTooltipKeyProps) {
);
}

export const TooltipProvider = TooltipPrimitive.Provider;
export const TooltipProvider: typeof TooltipPrimitive.Provider =
TooltipPrimitive.Provider;
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function AiMessageToolInvocation({
// re-render. The reason this is needed is that `part` gets mutated
// in-place by the delta handling, rather than part being replaced by a new
// object on every chunk.
partialArgs;
partialArgs; // eslint-disable-line @typescript-eslint/no-unused-expressions

const { type: _, ...rest } = part;
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function getDOMRange(

try {
return ReactEditor.toDOMRange(editor, range);
} catch (error) {
} catch {
return getDOMRange(
editor,
{
Expand Down
6 changes: 4 additions & 2 deletions packages/liveblocks-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,17 @@
},
"devDependencies": {
"@liveblocks/eslint-config": "*",
"@liveblocks/vitest-config": "*",
"@liveblocks/query-parser": "^0.1.1",
"@liveblocks/vitest-config": "*",
"@testing-library/jest-dom": "^6.8.0",
"@testing-library/react": "^16.3.0",
"date-fns": "^3.6.0",
"eslint": "^9.39.4",
"eslint-plugin-react-hooks": "^5.2.0",
"itertools": "^2.3.2",
"msw": "^2.10.4",
"react-error-boundary": "^4.0.13"
"react-error-boundary": "^4.0.13",
"vitest": "^4.1.4"
},
"sideEffects": false,
"bugs": {
Expand Down
4 changes: 3 additions & 1 deletion packages/liveblocks-redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
"@liveblocks/vitest-config": "*",
"@reduxjs/toolkit": "^2.8.2",
"@testing-library/dom": "^10.4.0",
"redux": "^5.0.1"
"eslint": "^9.39.4",
"redux": "^5.0.1",
"vitest": "^4.1.4"
},
"sideEffects": false,
"bugs": {
Expand Down
4 changes: 3 additions & 1 deletion packages/liveblocks-yjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
"devDependencies": {
"@liveblocks/eslint-config": "*",
"@liveblocks/vitest-config": "*",
"@testing-library/jest-dom": "^6.4.6"
"@testing-library/jest-dom": "^6.4.6",
"eslint": "^9.39.4",
"vitest": "^4.1.4"
},
"sideEffects": false,
"bugs": {
Expand Down
2 changes: 2 additions & 0 deletions packages/liveblocks-zustand/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"@liveblocks/eslint-config": "*",
"@liveblocks/vitest-config": "*",
"@testing-library/dom": "^10.4.0",
"eslint": "^9.39.4",
"vitest": "^4.1.4",
"zustand": "^5.0.1"
},
"sideEffects": false,
Expand Down
1 change: 1 addition & 0 deletions shared/vitest-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function defaultLiveblocksVitestConfig(options = {}) {
}),
],
test: {
include: ["src/**/*.test.[jt]s?(x)", "test/**/*.test.[jt]s?(x)"],
setupFiles: [path.join(__dirname, "setup.js")],

coverage: {
Expand Down
1 change: 1 addition & 0 deletions tools/liveblocks-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"react-dom": "18.2.0",
"reactflow": "^11.7.4",
"unquoted-property-validator": "^1.1.0",
"zustand": "^4.4.1",
"use-resize-observer": "^9.1.0",
"yjs": "^13.6.14"
},
Expand Down
4 changes: 3 additions & 1 deletion tools/liveblocks-devtools/src/lib/stringify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export function stringify(
value?: Json | YjsContentData | YjsContentData[],
maxDepth = 2,
depth = 0,
seen = new WeakSet<JsonObject | Json[] | YjsContentData>()
seen = new WeakSet<
JsonObject | Json[] | Exclude<YjsContentData, string | number | boolean>
>()
): string {
if (Array.isArray(value)) {
const isCircular = seen.has(value);
Expand Down
Loading