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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"build": "tsc -b tsconfig.build.json",
"build:clean": "tsc -b tsconfig.build.json --clean",
"test": "npm test -w @interactive-os/json-document",
"test:projects": "vitest run --config vitest.config.ts",
"test:collaboration:soak": "npm run test:soak -w @interactive-os/json-document-collaboration",
"typecheck": "npm run typecheck -w @interactive-os/json-document",
"smoke:package": "npm run smoke:package -w @interactive-os/json-document",
Expand Down
2 changes: 1 addition & 1 deletion packages/contenteditable-collaboration/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"node"
],
"noEmit": true,
"rootDir": ".",
"rootDir": "../..",
"skipLibCheck": true
},
"include": [
Expand Down
8 changes: 2 additions & 6 deletions packages/contenteditable-collaboration/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from "vitest/config";
import { defineDOMProject } from "../../test/vitest.shared.js";

export default defineConfig({
export default defineDOMProject("contenteditable-collaboration", {
resolve: {
alias: [
{
Expand All @@ -26,8 +26,4 @@ export default defineConfig({
},
],
},
test: {
environment: "jsdom",
include: ["tests/**/*.test.ts"],
},
});
2 changes: 1 addition & 1 deletion packages/json-document-ajv/tests/ajv-connector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { describe, expect, test } from "vitest";

import { createAjvValidator } from "../src/index.js";

describe("Ajv connector", () => {
describe("Ajv Connector", () => {
test("translates the first nested error instancePath into a JSON Pointer", () => {
const ajv = new Ajv();
const validate = createAjvValidator(ajv.compile({
Expand Down
2 changes: 1 addition & 1 deletion packages/json-document-ajv/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": false,
"noEmit": true,
"rootDir": ".",
"rootDir": "../..",
"types": ["node", "vitest/globals"]
},
"include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"]
Expand Down
8 changes: 2 additions & 6 deletions packages/json-document-ajv/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { defineConfig } from "vitest/config";
import { defineNodeProject } from "../../test/vitest.shared.js";

export default defineConfig({
export default defineNodeProject("json-document-ajv", {
resolve: {
alias: {
"@interactive-os/json-document": new URL("../json-document/src/application/document/index.ts", import.meta.url).pathname,
},
},
test: {
environment: "node",
include: ["tests/**/*.test.ts"],
},
});
7 changes: 2 additions & 5 deletions packages/json-document-collaboration/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from "vitest/config";
import { defineNodeProject } from "../../test/vitest.shared.js";

export default defineConfig({
export default defineNodeProject("json-document-collaboration", {
resolve: {
alias: {
"@interactive-os/json-document": new URL(
Expand All @@ -13,7 +13,4 @@ export default defineConfig({
).pathname,
},
},
test: {
include: ["tests/**/*.test.ts"],
},
});
2 changes: 1 addition & 1 deletion packages/json-document-contenteditable/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": ["./tsconfig.json", "../../tsconfig/test-dom.json"],
"compilerOptions": {
"rootDir": "."
"rootDir": "../.."
},
"include": ["src/**/*.ts", "src/**/*.tsx", "tests/**/*.ts", "tests/**/*.tsx", "vitest.config.ts"]
}
8 changes: 2 additions & 6 deletions packages/json-document-contenteditable/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import react from "@vitejs/plugin-react";
import { defineConfig } from "vitest/config";
import { defineDOMReactProject } from "../../test/vitest.shared.js";

export default defineConfig({
export default defineDOMReactProject("json-document-contenteditable", {
plugins: [react()],
resolve: {
alias: {
"@interactive-os/json-document": new URL("../json-document/src/application/document/index.ts", import.meta.url).pathname,
},
dedupe: ["react", "react-dom"],
},
test: {
environment: "jsdom",
include: ["tests/**/*.test.ts", "tests/**/*.test.tsx"],
},
});
2 changes: 1 addition & 1 deletion packages/json-document-editing/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": false,
"noEmit": true,
"rootDir": ".",
"rootDir": "../..",
"types": ["node", "vitest/globals"]
},
"include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"]
Expand Down
5 changes: 2 additions & 3 deletions packages/json-document-editing/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { defineConfig } from "vitest/config";
import { defineNodeProject } from "../../test/vitest.shared.js";

export default defineConfig({
export default defineNodeProject("json-document-editing", {
resolve: {
alias: {
"@interactive-os/json-document": new URL("../json-document/src/application/document/index.ts", import.meta.url).pathname,
"@interactive-os/json-document-selection": new URL("../json-document-selection/src/index.ts", import.meta.url).pathname,
},
},
test: { include: ["tests/**/*.test.ts"] },
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface ProfileForm {

afterEach(cleanup);

describe("React Hook Form connector", () => {
describe("React Hook Form Connector", () => {
test("keeps drafts local, then commits all submitted fields as one history entry", async () => {
const document = createProfileDocument();
render(<ProfileEditor document={document} />);
Expand Down
2 changes: 1 addition & 1 deletion packages/json-document-react-hook-form/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": ["./tsconfig.json", "../../tsconfig/test-dom.json"],
"compilerOptions": {
"rootDir": "."
"rootDir": "../.."
},
"include": ["src/**/*.ts", "tests/**/*.ts", "tests/**/*.tsx", "vitest.config.ts"]
}
8 changes: 2 additions & 6 deletions packages/json-document-react-hook-form/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import react from "@vitejs/plugin-react";
import { defineConfig } from "vitest/config";
import { defineDOMReactProject } from "../../test/vitest.shared.js";

export default defineConfig({
export default defineDOMReactProject("json-document-react-hook-form", {
plugins: [react()],
resolve: {
alias: {
Expand All @@ -12,8 +12,4 @@ export default defineConfig({
},
dedupe: ["react", "react-dom", "react-hook-form"],
},
test: {
environment: "jsdom",
include: ["tests/**/*.test.ts", "tests/**/*.test.tsx"],
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {

afterEach(cleanup);

describe("React connector", () => {
describe("React Connector", () => {
test("exposes the shared document through the official Connector entry point", () => {
const document = createJSONDocument({ title: "Draft" });
function View() {
Expand Down
2 changes: 1 addition & 1 deletion packages/json-document-react/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": ["./tsconfig.json", "../../tsconfig/test-dom.json"],
"compilerOptions": {
"rootDir": "."
"rootDir": "../.."
},
"include": ["src/**/*.ts", "tests/**/*.ts", "tests/**/*.tsx", "vitest.config.ts"]
}
8 changes: 2 additions & 6 deletions packages/json-document-react/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import react from "@vitejs/plugin-react";
import { defineConfig } from "vitest/config";
import { defineDOMReactProject } from "../../test/vitest.shared.js";

export default defineConfig({
export default defineDOMReactProject("json-document-react", {
plugins: [react()],
resolve: {
alias: {
Expand All @@ -10,8 +10,4 @@ export default defineConfig({
},
dedupe: ["react", "react-dom"],
},
test: {
environment: "jsdom",
include: ["tests/**/*.test.ts", "tests/**/*.test.tsx"],
},
});
2 changes: 1 addition & 1 deletion packages/json-document-rich-text-react/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["./tsconfig.json", "../../tsconfig/test-dom.json"],
"compilerOptions": { "rootDir": "." },
"compilerOptions": { "rootDir": "../.." },
"include": ["src/**/*.ts", "src/**/*.tsx", "tests/**/*.ts", "tests/**/*.tsx"]
}
7 changes: 3 additions & 4 deletions packages/json-document-rich-text-react/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
import { defineNodeReactProject } from "../../test/vitest.shared.js";

export default defineNodeReactProject("json-document-rich-text-react", {
test: {
environment: "node",
include: ["tests/**/*.test.ts", "tests/**/*.test.tsx"],
environmentMatchGlobs: [["tests/render-locality.test.tsx", "jsdom"]],
},
});
2 changes: 1 addition & 1 deletion packages/json-document-rich-text-web/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["./tsconfig.json", "../../tsconfig/test-dom.json"],
"compilerOptions": { "rootDir": "." },
"compilerOptions": { "rootDir": "../.." },
"include": ["src/**/*.ts", "tests/**/*.ts"]
}
5 changes: 3 additions & 2 deletions packages/json-document-rich-text-web/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import { defineConfig } from "vitest/config";
export default defineConfig({ test: { environment: "jsdom", include: ["tests/**/*.test.ts"] } });
import { defineDOMProject } from "../../test/vitest.shared.js";

export default defineDOMProject("json-document-rich-text-web");
2 changes: 1 addition & 1 deletion packages/json-document-rich-text/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": false,
"noEmit": true,
"rootDir": ".",
"rootDir": "../..",
"types": ["node", "vitest/globals"]
},
"include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"]
Expand Down
6 changes: 2 additions & 4 deletions packages/json-document-rich-text/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { defineConfig } from "vitest/config";
import { defineNodeProject } from "../../test/vitest.shared.js";

export default defineConfig({
test: { include: ["tests/**/*.test.ts"] },
});
export default defineNodeProject("json-document-rich-text");
2 changes: 1 addition & 1 deletion packages/json-document-selection/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": false,
"noEmit": true,
"rootDir": ".",
"rootDir": "../..",
"types": ["node", "vitest/globals"]
},
"include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"]
Expand Down
6 changes: 2 additions & 4 deletions packages/json-document-selection/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { defineConfig } from "vitest/config";
import { defineNodeProject } from "../../test/vitest.shared.js";

export default defineConfig({
test: { include: ["tests/**/*.test.ts"] },
});
export default defineNodeProject("json-document-selection");
2 changes: 1 addition & 1 deletion packages/json-document-tanstack-table/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": ["./tsconfig.json", "../../tsconfig/test-dom.json"],
"compilerOptions": {
"rootDir": "."
"rootDir": "../.."
},
"include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"]
}
8 changes: 2 additions & 6 deletions packages/json-document-tanstack-table/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { defineConfig } from "vitest/config";
import { defineNodeProject } from "../../test/vitest.shared.js";

export default defineConfig({
export default defineNodeProject("json-document-tanstack-table", {
resolve: {
alias: {
"@interactive-os/json-document": new URL("../json-document/src/application/document/index.ts", import.meta.url).pathname,
"@interactive-os/json-document-editing": new URL("../json-document-editing/src/index.ts", import.meta.url).pathname,
},
},
test: {
environment: "node",
include: ["tests/**/*.test.ts"],
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
type WebClipboardEvent,
} from "../src/index.js";

describe("Web clipboard Connector", () => {
describe("Web clipboard Adapter", () => {
test("copies and pastes a structured Document payload through ClipboardEvent contracts", () => {
const editor = createDocumentEditor({
blocks: [
Expand Down Expand Up @@ -270,7 +270,7 @@ describe("Web input modifiers", () => {
});
});

describe("Web keyboard adapter", () => {
describe("Web keyboard Adapter", () => {
const adapter = createWebKeyboardAdapter();
const grid = {
rowIds: ["r1", "r2", "r3"],
Expand Down
2 changes: 1 addition & 1 deletion packages/json-document-web/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": ["./tsconfig.json", "../../tsconfig/test-dom.json"],
"compilerOptions": {
"rootDir": "."
"rootDir": "../.."
},
"include": ["src/**/*.ts", "tests/**/*.ts"]
}
8 changes: 2 additions & 6 deletions packages/json-document-web/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { defineConfig } from "vitest/config";
import { defineNodeProject } from "../../test/vitest.shared.js";

export default defineConfig({
export default defineNodeProject("json-document-web", {
resolve: {
alias: {
"@interactive-os/json-document": new URL("../json-document/src/application/document/index.ts", import.meta.url).pathname,
"@interactive-os/json-document-selection": new URL("../json-document-selection/src/index.ts", import.meta.url).pathname,
"@interactive-os/json-document-editing": new URL("../json-document-editing/src/index.ts", import.meta.url).pathname,
},
},
test: {
environment: "node",
include: ["tests/**/*.test.ts"],
},
});
2 changes: 1 addition & 1 deletion packages/json-document-zod/tests/zod-connector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as z from "zod/v4";

import { createZodValidator } from "../src/index.js";

describe("Zod connector", () => {
describe("Zod Connector", () => {
test("translates the first nested issue path into an escaped JSON Pointer", () => {
const validate = createZodValidator(z.object({
profile: z.object({
Expand Down
2 changes: 1 addition & 1 deletion packages/json-document-zod/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"composite": false,
"noEmit": true,
"rootDir": ".",
"rootDir": "../..",
"types": ["node", "vitest/globals"]
},
"include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"]
Expand Down
8 changes: 2 additions & 6 deletions packages/json-document-zod/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { defineConfig } from "vitest/config";
import { defineNodeProject } from "../../test/vitest.shared.js";

export default defineConfig({
export default defineNodeProject("json-document-zod", {
resolve: {
alias: {
"@interactive-os/json-document": new URL("../json-document/src/application/document/index.ts", import.meta.url).pathname,
},
},
test: {
environment: "node",
include: ["tests/**/*.test.ts"],
},
});
4 changes: 2 additions & 2 deletions packages/json-document/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from "vitest/config";
import { defineNodeProject } from "../../test/vitest.shared.js";

export default defineConfig({
export default defineNodeProject("json-document", {
resolve: {
alias: {
"@interactive-os/json-document": new URL("./src/application/document/index.ts", import.meta.url).pathname,
Expand Down
Loading