diff --git a/docs/API.md b/docs/API.md index 9831b18..eafd3e1 100644 --- a/docs/API.md +++ b/docs/API.md @@ -1456,7 +1456,7 @@ function SentShareStatus({ shareId }: { shareId: string }) { | Type | Type | | ---------- | ---------- | -| `ClientApiProviderProps` | `PropsWithChildren<{ clientApi: MapeoClientApi }>` | +| `ClientApiProviderProps` | `PropsWithChildren<{ clientApi: ComapeoCoreClientApi }>` | ### MapServerApiOptions diff --git a/package-lock.json b/package-lock.json index 8fba421..faf4eac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,14 +16,14 @@ }, "devDependencies": { "@comapeo/core": "7.3.0", - "@comapeo/ipc": "8.0.0", + "@comapeo/ipc": "9.0.0", "@eslint/js": "10.0.1", "@ianvs/prettier-plugin-sort-imports": "4.7.1", "@mapeo/crypto": "1.1.0", "@mapeo/default-config": "6.0.0", "@mapeo/mock-data": "5.0.0", - "@tanstack/eslint-plugin-query": "5.101.0", - "@tanstack/react-query": "5.101.0", + "@tanstack/eslint-plugin-query": "5.101.2", + "@tanstack/react-query": "5.101.2", "@testing-library/dom": "10.4.1", "@testing-library/react": "16.3.2", "@types/jsdom": "28.0.3", @@ -31,7 +31,7 @@ "@types/react": "19.2.17", "@types/react-dom": "19.2.3", "@vitest/eslint-plugin": "1.6.20", - "eslint": "10.5.0", + "eslint": "10.6.0", "eslint-plugin-react-hooks": "7.1.1", "eslint-plugin-testing-library": "7.16.2", "fastify": "4.29.1", @@ -41,7 +41,7 @@ "ky": "2.0.2", "lint-staged": "17.0.8", "npm-run-all2": "9.0.2", - "prettier": "3.8.4", + "prettier": "3.9.4", "random-access-memory": "6.2.1", "react": "19.2.7", "react-dom": "19.2.7", @@ -49,13 +49,13 @@ "tsdoc-markdown": "1.5.0", "tshy": "4.1.3", "typescript": "6.0.3", - "typescript-eslint": "8.61.1", + "typescript-eslint": "8.62.1", "uint8array-extras": "1.5.0", "vitest": "4.1.9" }, "peerDependencies": { "@comapeo/core": "^7.2.0", - "@comapeo/ipc": "^8.0.0", + "@comapeo/ipc": "^9.0.0", "@tanstack/react-query": "^5", "react": "^18 || ^19" } @@ -548,15 +548,15 @@ } }, "node_modules/@comapeo/ipc": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@comapeo/ipc/-/ipc-8.0.0.tgz", - "integrity": "sha512-kzlcoB0fXj/w1CZxqp9rK86LKqeYSJ3dwh+I7TT1EzjNd9y66iXIviuwjuIb2hcNjT6BWv4pyvUfC9DWc1xIVQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@comapeo/ipc/-/ipc-9.0.0.tgz", + "integrity": "sha512-zAoZnj4eZqDaYnYzhaFmCVh2eYnYJtSl8OY0Mzxfb5q4/4IP373lVx4Fa43t+tfBD7/WquUaOBWHarUUGq1eeA==", "dev": true, "license": "MIT", "dependencies": { - "eventemitter3": "^5.0.4", + "custom-error-creator": "^1.4.0", "p-defer": "^4.0.1", - "rpc-reflector": "^3.0.1" + "rpc-reflector": "^4.2.0" }, "engines": { "node": ">=18.17.1" @@ -2729,9 +2729,9 @@ "license": "MIT" }, "node_modules/@tanstack/eslint-plugin-query": { - "version": "5.101.0", - "resolved": "https://registry.npmjs.org/@tanstack/eslint-plugin-query/-/eslint-plugin-query-5.101.0.tgz", - "integrity": "sha512-wsfg821y4yw21J7nKI2oM5yyGSz3vASXqgWbmWCXZpnyY9ObLrBCcXivwZKj4YHF2fUWiqoOIRX2pbE79cf6gQ==", + "version": "5.101.2", + "resolved": "https://registry.npmjs.org/@tanstack/eslint-plugin-query/-/eslint-plugin-query-5.101.2.tgz", + "integrity": "sha512-cPE99s3XZwlObfn8lCezT4j4JLj2CVzpIEywx0H4hzfPsX/o9QhdwaOwcDXxrQAqx2ds7TbvTinxhB8B/ywb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -2752,9 +2752,9 @@ } }, "node_modules/@tanstack/query-core": { - "version": "5.101.0", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.101.0.tgz", - "integrity": "sha512-cQetA74EB+seWySv1TTKr828TnP0u39m6LykwDXIo84SNortpDkp30TMEjkqtYCNP9c40uT/iwl6MLiufEt0Ow==", + "version": "5.101.2", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.101.2.tgz", + "integrity": "sha512-hH5MLoJhF7KaIGd7q3xTXGXvslI+GYlM1Z/35aSHHWaCJWB7XvTSHYuV3eM7tw+aE0mT/xMro4M4Q9rCGHT0lw==", "dev": true, "license": "MIT", "funding": { @@ -2763,13 +2763,13 @@ } }, "node_modules/@tanstack/react-query": { - "version": "5.101.0", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.101.0.tgz", - "integrity": "sha512-rLlJXSpkqfizLWgkR5+eLeIk0MvTx/meEIR7LRjxic+qxiQP8zVjq7BqQkiCMNLQBlLfuOLqqr6KO5GtrDlmSg==", + "version": "5.101.2", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.101.2.tgz", + "integrity": "sha512-seDkr6kzGzX1okaaTtZPtgA688CDPlXUz1C6xSg0ESqn04Vuc8tlrYms1s3de+znBqhPVxFRfpAfUf+6XvfPWg==", "dev": true, "license": "MIT", "dependencies": { - "@tanstack/query-core": "5.101.0" + "@tanstack/query-core": "5.101.2" }, "funding": { "type": "github", @@ -3042,17 +3042,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.61.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.61.1.tgz", - "integrity": "sha512-ZPlVl3PB3et/59Ne0fv/sci6ZXz4T4Hp4nTJ56i/Y0gR89ARb+KphojTq6j+56E5PIezmOIOOWyY+aWQFd+IkQ==", + "version": "8.62.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.62.1.tgz", + "integrity": "sha512-4EQM77WgVNxj7OkL/5b/D/xZsw00G577+UriYTC7JF5opcF3T2AuoeY7ueLaZgSVjSgCS6yOAJB5bRGLPSJUzA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.61.1", - "@typescript-eslint/type-utils": "8.61.1", - "@typescript-eslint/utils": "8.61.1", - "@typescript-eslint/visitor-keys": "8.61.1", + "@typescript-eslint/scope-manager": "8.62.1", + "@typescript-eslint/type-utils": "8.62.1", + "@typescript-eslint/utils": "8.62.1", + "@typescript-eslint/visitor-keys": "8.62.1", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" @@ -3065,7 +3065,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.61.1", + "@typescript-eslint/parser": "^8.62.1", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } @@ -3081,16 +3081,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.61.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.61.1.tgz", - "integrity": "sha512-PJ5vePq5/ognBbrIcoC5+SHO5dfpeLPzP9FpLkzWrguoYQEeeSjlJpVwOpo1JRSTEi7dRcwNy4h4dzV70PqHcg==", + "version": "8.62.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.62.1.tgz", + "integrity": "sha512-sPhE4iHuJDSvoAiec+Ro8JyXw8f0ql13HFR82P99nCm9GwTEKG0KYLvDe6REk8BCXuit6vJAv/Yxg5ABaNS2rA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.61.1", - "@typescript-eslint/types": "8.61.1", - "@typescript-eslint/typescript-estree": "8.61.1", - "@typescript-eslint/visitor-keys": "8.61.1", + "@typescript-eslint/scope-manager": "8.62.1", + "@typescript-eslint/types": "8.62.1", + "@typescript-eslint/typescript-estree": "8.62.1", + "@typescript-eslint/visitor-keys": "8.62.1", "debug": "^4.4.3" }, "engines": { @@ -3106,14 +3106,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.61.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.61.1.tgz", - "integrity": "sha512-PrC4JYGmR241lYnfhmKGTXkFqv8+ymbTFgSAY0fVXpY82/QkMw5TZPl+vGzuDDU2QYJk9fIDOBTntF+yDv9LEA==", + "version": "8.62.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.62.1.tgz", + "integrity": "sha512-yQ3RgY5RkSBpsNS1Bx/JQEcA24FOSdfGktoyprAr5u18390UQdtVcfnEv4nIrIshNnavlVyZBKxQwT1fIAE6cg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.61.1", - "@typescript-eslint/types": "^8.61.1", + "@typescript-eslint/tsconfig-utils": "^8.62.1", + "@typescript-eslint/types": "^8.62.1", "debug": "^4.4.3" }, "engines": { @@ -3128,14 +3128,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.61.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.61.1.tgz", - "integrity": "sha512-L2bdIeoQS8FlKAvONAr20w6OcLXeB+qiDKbAooS9A0Ben+iSIkBef0FxqwKWYqt5sa0i4KJtxVyVmhMylKzF5w==", + "version": "8.62.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.62.1.tgz", + "integrity": "sha512-r4d249KbQ1SFdpeStvob8Ih6aPPIzfqllPVOtvhve6ZcpuVcYo5/7zUWckKpHE7StASX4kTKZTLf0WQm/wPkcg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.61.1", - "@typescript-eslint/visitor-keys": "8.61.1" + "@typescript-eslint/types": "8.62.1", + "@typescript-eslint/visitor-keys": "8.62.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3146,9 +3146,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.61.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.61.1.tgz", - "integrity": "sha512-UN/H4di+OO7EWx2ovME+8t31YO+KVnK0RRKEHR3kOt21/Ay8BOq3M1OMvWs5vNiqcFCYGYoxK3MXPZzmMUE+yg==", + "version": "8.62.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.62.1.tgz", + "integrity": "sha512-xadytJqX9vJVQ2fdQjkcIVigwaOJNWkpjdLt6cEQ+xPnrI1fkp+/jZE/I97k9KUjqtpd25i0HeyZf3T6dutv2g==", "dev": true, "license": "MIT", "engines": { @@ -3163,15 +3163,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.61.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.61.1.tgz", - "integrity": "sha512-GYRicKmVK0C4fsKgaACaknOUAq9Oa2kwsjnpFhFcS/5p4Ht5IP9OVLbgIgcK4SRk92nVHFluurg1lumD9dBcLw==", + "version": "8.62.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.62.1.tgz", + "integrity": "sha512-aXM5xlqXiTxPibXB93cLAURfT3rlizf7uMXISCXy66Isr/9hISJx3yDsKl0L7lKa51b8JpFuNKby0/O0pEm9jg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.61.1", - "@typescript-eslint/typescript-estree": "8.61.1", - "@typescript-eslint/utils": "8.61.1", + "@typescript-eslint/types": "8.62.1", + "@typescript-eslint/typescript-estree": "8.62.1", + "@typescript-eslint/utils": "8.62.1", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, @@ -3188,9 +3188,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.61.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.61.1.tgz", - "integrity": "sha512-G+CRlPqLv7Bz1IZVs03x5K59F1veqL0EJUROAdGhKsEq8qOiRiZbI+HUojPq5l0fEGOKModD9br6lObhB8zkoA==", + "version": "8.62.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.62.1.tgz", + "integrity": "sha512-ooCzJFaf+Hg+uG6fA3NRFGuFjlfNlDhBthbv4ZPU/0elCAFUfnyXUvf/WOpHz/jYwSmvU2GkR2LtyUfy1AxZ1Q==", "dev": true, "license": "MIT", "engines": { @@ -3202,16 +3202,16 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.61.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.61.1.tgz", - "integrity": "sha512-u+oQD3BqYWPc8YV9Zab4vaJElJuwOLPRc10Jm1o/qS+6Qwen14HCWwx0Seo4LnSn2wxea2Ik8DxPt2/FHmuhrg==", + "version": "8.62.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.62.1.tgz", + "integrity": "sha512-xMcW9oP9u7fAMXYs9A65CVmtLQe2r//oXINHfi8HV+oiqhih17sbLdhXr4540YWlgpDKQdY854OL5ZrdCiQsAA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.61.1", - "@typescript-eslint/tsconfig-utils": "8.61.1", - "@typescript-eslint/types": "8.61.1", - "@typescript-eslint/visitor-keys": "8.61.1", + "@typescript-eslint/project-service": "8.62.1", + "@typescript-eslint/tsconfig-utils": "8.62.1", + "@typescript-eslint/types": "8.62.1", + "@typescript-eslint/visitor-keys": "8.62.1", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", @@ -3240,9 +3240,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", - "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", + "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", "dev": true, "license": "MIT", "dependencies": { @@ -3269,16 +3269,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.61.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.61.1.tgz", - "integrity": "sha512-1+P/3Dj6jvtybE1q0HQ6yBt/gq+oKJyLdEv4HdnqasaEXRSYCAsD59mXEVQnM/ULNdQxbX77tdG4jPRjIS6knA==", + "version": "8.62.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.62.1.tgz", + "integrity": "sha512-sHtbPfuKNZCG+ih8SyjjucqRntSVmp8XgL5u6o9mAhiSn8ds5o/M/XdM0abweme2Tln3szOstOrZ9OXitvPh0g==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.61.1", - "@typescript-eslint/types": "8.61.1", - "@typescript-eslint/typescript-estree": "8.61.1" + "@typescript-eslint/scope-manager": "8.62.1", + "@typescript-eslint/types": "8.62.1", + "@typescript-eslint/typescript-estree": "8.62.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3293,13 +3293,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.61.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.61.1.tgz", - "integrity": "sha512-6fJ9MHWtK14C1DSkiMlHUSOmrVebL7150xZJBlJiL62jjhIA4JmOq6flwBgDxIdBKKdoiZRel+dfPD5MLfny3w==", + "version": "8.62.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.62.1.tgz", + "integrity": "sha512-4g3BLxfdTMy8iZG0MaBkadnlRrCJ74cQiFbyEVMrkwIoqdyaXXQM22cotDvrl4x28wgIZ9rEJRoM+mmhSJpJ1g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.61.1", + "@typescript-eslint/types": "8.62.1", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -5311,9 +5311,9 @@ } }, "node_modules/eslint": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.5.0.tgz", - "integrity": "sha512-1y+7C+vi12bUK1IpZeaV3gsH9fHLBmPvYmPx42pvT/E9yG0IC8g3PUZZgp0+JLJl7ZDK0flc2gc+Aw9dpCvIsQ==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.6.0.tgz", + "integrity": "sha512-6lVbcqSodALYo+4ELD0heG6lFiFxnLMuLkiMi2qV8LMp54N8tE8FT1GMH+ev4Ti00nFjNze2+Su6DsV5OQW3Dg==", "dev": true, "license": "MIT", "workspaces": [ @@ -6520,6 +6520,8 @@ }, "node_modules/is-plain-obj": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", "dev": true, "license": "MIT", "engines": { @@ -8309,9 +8311,9 @@ } }, "node_modules/prettier": { - "version": "3.8.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.4.tgz", - "integrity": "sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==", + "version": "3.9.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.4.tgz", + "integrity": "sha512-yWG/o/4oJfo036EKAfK6ACAoDOfHeRHx4tuxkfBZiauURiaSmYwlpOr5LQqKtIkRD2z1PLteme2WoxEnj4tHTg==", "dev": true, "license": "MIT", "bin": { @@ -9025,14 +9027,16 @@ } }, "node_modules/rpc-reflector": { - "version": "3.0.1", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/rpc-reflector/-/rpc-reflector-4.3.1.tgz", + "integrity": "sha512-k0dhNgA4DD15jkYjfbhynaWYAShNP0ZjB5QN6dUjTNtFVuphtcw3MY/3jiaddsYfgz1dMAvgmKGJTinA6KDbrw==", "dev": true, "license": "ISC", "dependencies": { - "@types/node": "^18.19.115", "abstract-logging": "^2.0.1", + "custom-error-creator": "^1.4.0", "ensure-error": "^4.0.0", - "eventemitter3": "^5.0.1", + "eventemitter3": "^5.0.4", "is-plain-obj": "^4.1.0", "is-stream": "^4.0.1", "p-defer": "^4.0.1", @@ -9041,16 +9045,10 @@ "serialize-error": "^12.0.0" } }, - "node_modules/rpc-reflector/node_modules/@types/node": { - "version": "18.19.127", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~5.26.4" - } - }, "node_modules/rpc-reflector/node_modules/ensure-error": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ensure-error/-/ensure-error-4.0.0.tgz", + "integrity": "sha512-7Xenn3+R6tp2UqAbH9Jqs6QCSABQok+1VAhaPaF0jjm3iuhVHCblfBh18nYtpm3K9/V4Jpxz1JIqFZyrjstBtw==", "dev": true, "license": "MIT", "engines": { @@ -9060,11 +9058,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/rpc-reflector/node_modules/undici-types": { - "version": "5.26.5", - "dev": true, - "license": "MIT" - }, "node_modules/run-applescript": { "version": "7.1.0", "dev": true, @@ -9224,6 +9217,8 @@ }, "node_modules/serialize-error": { "version": "12.0.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-12.0.0.tgz", + "integrity": "sha512-ZYkZLAvKTKQXWuh5XpBw7CdbSzagarX39WyZ2H07CDLC5/KfsRGlIXV8d4+tfqX1M7916mRqR1QfNHSij+c9Pw==", "dev": true, "license": "MIT", "dependencies": { @@ -9238,6 +9233,8 @@ }, "node_modules/serialize-error/node_modules/type-fest": { "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -10477,16 +10474,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.61.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.61.1.tgz", - "integrity": "sha512-V7PayAfJokV3pEHgN7/v03D1SpujhRfQtYLbLIiBfDDncdg4PAiRBfoS4cnCANK4jmAPncczi59QO3afiXUlNw==", + "version": "8.62.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.62.1.tgz", + "integrity": "sha512-vymnnM5g0AKQDSAyfP12nMIBvgwgA42syg74kkuZ4x1VuTzwQKwc5h9rGxeShCjny5o+zWAb6OEoz7XLgrIkIw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.61.1", - "@typescript-eslint/parser": "8.61.1", - "@typescript-eslint/typescript-estree": "8.61.1", - "@typescript-eslint/utils": "8.61.1" + "@typescript-eslint/eslint-plugin": "8.62.1", + "@typescript-eslint/parser": "8.62.1", + "@typescript-eslint/typescript-estree": "8.62.1", + "@typescript-eslint/utils": "8.62.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/package.json b/package.json index 358a06f..28d1b19 100644 --- a/package.json +++ b/package.json @@ -71,20 +71,20 @@ }, "peerDependencies": { "@comapeo/core": "^7.2.0", - "@comapeo/ipc": "^8.0.0", + "@comapeo/ipc": "^9.0.0", "@tanstack/react-query": "^5", "react": "^18 || ^19" }, "devDependencies": { "@comapeo/core": "7.3.0", - "@comapeo/ipc": "8.0.0", + "@comapeo/ipc": "9.0.0", "@eslint/js": "10.0.1", "@ianvs/prettier-plugin-sort-imports": "4.7.1", "@mapeo/crypto": "1.1.0", "@mapeo/default-config": "6.0.0", "@mapeo/mock-data": "5.0.0", - "@tanstack/eslint-plugin-query": "5.101.0", - "@tanstack/react-query": "5.101.0", + "@tanstack/eslint-plugin-query": "5.101.2", + "@tanstack/react-query": "5.101.2", "@testing-library/dom": "10.4.1", "@testing-library/react": "16.3.2", "@types/jsdom": "28.0.3", @@ -92,7 +92,7 @@ "@types/react": "19.2.17", "@types/react-dom": "19.2.3", "@vitest/eslint-plugin": "1.6.20", - "eslint": "10.5.0", + "eslint": "10.6.0", "eslint-plugin-react-hooks": "7.1.1", "eslint-plugin-testing-library": "7.16.2", "fastify": "4.29.1", @@ -102,7 +102,7 @@ "ky": "2.0.2", "lint-staged": "17.0.8", "npm-run-all2": "9.0.2", - "prettier": "3.8.4", + "prettier": "3.9.4", "random-access-memory": "6.2.1", "react": "19.2.7", "react-dom": "19.2.7", @@ -110,7 +110,7 @@ "tsdoc-markdown": "1.5.0", "tshy": "4.1.3", "typescript": "6.0.3", - "typescript-eslint": "8.61.1", + "typescript-eslint": "8.62.1", "uint8array-extras": "1.5.0", "vitest": "4.1.9" } diff --git a/src/contexts/ClientApi.ts b/src/contexts/ClientApi.ts index d1d4107..8fcdffb 100644 --- a/src/contexts/ClientApi.ts +++ b/src/contexts/ClientApi.ts @@ -1,4 +1,4 @@ -import type { MapeoClientApi } from '@comapeo/ipc' +import type { ComapeoCoreClientApi } from '@comapeo/ipc' import { useQueryClient } from '@tanstack/react-query' import { createContext, @@ -11,11 +11,11 @@ import { import { getInvitesQueryKey } from '../lib/react-query.js' -export const ClientApiContext: Context = - createContext(null) +export const ClientApiContext: Context = + createContext(null) export type ClientApiProviderProps = PropsWithChildren<{ - clientApi: MapeoClientApi + clientApi: ComapeoCoreClientApi }> /** diff --git a/src/contexts/MapShares.ts b/src/contexts/MapShares.ts index e5001a9..8bcde6d 100644 --- a/src/contexts/MapShares.ts +++ b/src/contexts/MapShares.ts @@ -1,4 +1,4 @@ -import type { MapeoClientApi } from '@comapeo/ipc' +import type { ComapeoCoreClientApi } from '@comapeo/ipc' import type { QueryClient } from '@tanstack/react-query' import { createContext, @@ -35,7 +35,7 @@ export const SentMapSharesContext: Context = createContext(null) type MapSharesProviderProps = PropsWithChildren<{ - clientApi: MapeoClientApi + clientApi: ComapeoCoreClientApi mapServerApi: MapServerApi }> diff --git a/src/hooks/client.ts b/src/hooks/client.ts index 55ff174..a1ead65 100644 --- a/src/hooks/client.ts +++ b/src/hooks/client.ts @@ -1,5 +1,5 @@ import type { DeviceInfo } from '@comapeo/core/schema.js' -import type { MapeoClientApi } from '@comapeo/ipc' +import type { ComapeoCoreClientApi } from '@comapeo/ipc' import { useMutation, useQueryClient, @@ -43,7 +43,7 @@ import { * ``` * */ -export function useClientApi(): MapeoClientApi { +export function useClientApi(): ComapeoCoreClientApi { const clientApi = useContext(ClientApiContext) if (!clientApi) { @@ -67,7 +67,9 @@ export function useClientApi(): MapeoClientApi { */ export function useOwnDeviceInfo(): // NOTE: Needs explicit return type due to TS2742 Pick< - UseSuspenseQueryResult>>, + UseSuspenseQueryResult< + Awaited> + >, 'data' | 'error' | 'isRefetching' > { const clientApi = useClientApi() diff --git a/src/hooks/documents.ts b/src/hooks/documents.ts index 31219e9..4f2a657 100644 --- a/src/hooks/documents.ts +++ b/src/hooks/documents.ts @@ -1,4 +1,4 @@ -import type { MapeoProjectApi } from '@comapeo/ipc' +import type { ComapeoProjectClientApi } from '@comapeo/ipc' import { useMutation, useQueryClient, @@ -59,7 +59,7 @@ export function useSingleDocByDocId({ Pick< UseSuspenseQueryResult< // NOTE: Using NonNullable here to get the return type associated with the overload that uses `mustBeFound: true` - NonNullable>> + NonNullable>> >, 'data' | 'error' | 'isRefetching' > { @@ -126,7 +126,7 @@ export function useSingleDocByVersionId({ }): // NOTE: Needs explicit return type due to TS struggles with inference Pick< UseSuspenseQueryResult< - Awaited> + Awaited> >, 'data' | 'error' | 'isRefetching' > { @@ -199,7 +199,9 @@ export function useManyDocs({ lang?: string }): // NOTE: Needs explicit return type due to TS struggles with inference Pick< - UseSuspenseQueryResult>>, + UseSuspenseQueryResult< + Awaited> + >, 'data' | 'error' | 'isRefetching' > { const { data: projectApi } = useSingleProject({ projectId }) @@ -243,7 +245,7 @@ export function useCreateDocument({ }): // NOTE: Needs explicit return type due to TS struggles with inference FilteredMutationResult< UseMutationResult< - Awaited>, + Awaited>, Error, { value: Omit, 'schemaName'> } > @@ -293,7 +295,7 @@ export function useUpdateDocument({ }): // NOTE: Needs explicit return type due to TS struggles with inference FilteredMutationResult< UseMutationResult< - Awaited>, + Awaited>, Error, { value: Omit, 'schemaName'>; versionId: string } > @@ -345,7 +347,7 @@ export function useDeleteDocument({ }): // NOTE: Needs explicit return type due to TS2742 FilteredMutationResult< UseMutationResult< - Awaited>, + Awaited>, Error, { docId: string } > diff --git a/src/hooks/projects.ts b/src/hooks/projects.ts index 3fe3cf7..1a45ed4 100644 --- a/src/hooks/projects.ts +++ b/src/hooks/projects.ts @@ -4,7 +4,10 @@ import type { IconApi, MemberApi, } from '@comapeo/core' -import type { MapeoClientApi, MapeoProjectApi } from '@comapeo/ipc' +import type { + ComapeoCoreClientApi, + ComapeoProjectClientApi, +} from '@comapeo/ipc' import { matchQuery, useMutation, @@ -54,7 +57,7 @@ export function useProjectSettings({ }): // NOTE: Needs explicit return type due to TS2742 Pick< UseSuspenseQueryResult< - Awaited> + Awaited> >, 'data' | 'error' | 'isRefetching' > { @@ -91,7 +94,7 @@ export function useSingleProject({ projectId: string }): // NOTE: Needs explicit return type due to TS2742 Pick< - UseSuspenseQueryResult, + UseSuspenseQueryResult, 'data' | 'error' | 'isRefetching' > { const clientApi = useClientApi() @@ -127,7 +130,9 @@ Pick< */ export function useManyProjects(): // NOTE: Needs explicit return type due to TS2742 Pick< - UseSuspenseQueryResult>>, + UseSuspenseQueryResult< + Awaited> + >, 'data' | 'error' | 'isRefetching' > { const clientApi = useClientApi() @@ -167,7 +172,7 @@ export function useSingleMember({ }): // NOTE: Needs explicit return type due to TS2742 Pick< UseSuspenseQueryResult< - Awaited> + Awaited> >, 'data' | 'error' | 'isRefetching' > { @@ -371,7 +376,11 @@ const FAKE_BLOB_ID: BlobApi.BlobId = { * @internal * Hack to retrieve the media server origin (protocol + host). */ -function useMediaServerOrigin({ projectApi }: { projectApi: MapeoProjectApi }) { +function useMediaServerOrigin({ + projectApi, +}: { + projectApi: ComapeoProjectClientApi +}) { const { data, error, isRefetching } = useSuspenseQuery({ ...baseQueryOptions(), // HACK: The server doesn't yet expose a method to get its origin, so we use @@ -455,7 +464,9 @@ export function useOwnRoleInProject({ projectId: string }): // NOTE: Needs explicit return type due to TS2742 Pick< - UseSuspenseQueryResult>>, + UseSuspenseQueryResult< + Awaited> + >, 'data' | 'error' | 'isRefetching' > { const { data: projectApi } = useSingleProject({ projectId }) @@ -536,7 +547,7 @@ export function useCreateProject() { useMutation({ ...baseMutationOptions(), mutationFn: async ( - opts?: Parameters[0], + opts?: Parameters[0], ) => { // Have to avoid passing `undefined` explicitly // See https://github.com/digidem/rpc-reflector/issues/21 @@ -849,7 +860,7 @@ export function useCreateBlob({ projectId }: { projectId: string }) { ) } -const PROJECT_SYNC_STORE_MAP = new WeakMap() +const PROJECT_SYNC_STORE_MAP = new WeakMap() function useSyncStore({ projectId }: { projectId: string }) { const { data: projectApi } = useSingleProject({ projectId }) diff --git a/src/lib/map-shares-stores.ts b/src/lib/map-shares-stores.ts index 316c9d5..35e5cad 100644 --- a/src/lib/map-shares-stores.ts +++ b/src/lib/map-shares-stores.ts @@ -1,5 +1,5 @@ import type { MapShare } from '@comapeo/core' -import type { MapeoClientApi } from '@comapeo/ipc' +import type { ComapeoCoreClientApi } from '@comapeo/ipc' import { type MapShareState as ServerMapShareState } from '@comapeo/map-server' import { CUSTOM_MAP_ID } from '@comapeo/map-server/constants.js' import { errors } from '@comapeo/map-server/errors.js' @@ -359,7 +359,7 @@ export function createReceivedMapSharesStore({ mapServerApi, queryClient, }: { - clientApi: MapeoClientApi + clientApi: ComapeoCoreClientApi mapServerApi: MapServerApi queryClient: QueryClient }) { @@ -487,7 +487,7 @@ export function createSentMapSharesStore({ clientApi, mapServerApi, }: { - clientApi: MapeoClientApi + clientApi: ComapeoCoreClientApi mapServerApi: MapServerApi }) { const { subscribe, getSnapshot, update, add, handleError, monitor } = diff --git a/src/lib/sync.ts b/src/lib/sync.ts index ad72bbd..9d30362 100644 --- a/src/lib/sync.ts +++ b/src/lib/sync.ts @@ -1,7 +1,7 @@ -import type { MapeoProjectApi } from '@comapeo/ipc' +import type { ComapeoProjectClientApi } from '@comapeo/ipc' export type SyncState = Awaited< - ReturnType + ReturnType > function getDataSyncCountForDevice( @@ -12,7 +12,7 @@ function getDataSyncCountForDevice( } export class SyncStore { - #project: MapeoProjectApi + #project: ComapeoProjectClientApi #listeners = new Set<() => void>() #isSubscribedInternal = false @@ -22,7 +22,7 @@ export class SyncStore { // Used for calculating sync progress #perDeviceMaxSyncCount = new Map() - constructor(project: MapeoProjectApi) { + constructor(project: ComapeoProjectClientApi) { this.#project = project } diff --git a/test/helpers/ipc.ts b/test/helpers/ipc.ts index 926cdab..204d756 100644 --- a/test/helpers/ipc.ts +++ b/test/helpers/ipc.ts @@ -1,9 +1,11 @@ import { createRequire } from 'node:module' import path from 'node:path' -import { MessageChannel } from 'node:worker_threads' import { FastifyController, MapeoManager } from '@comapeo/core' -import { closeMapeoClient, createMapeoClient } from '@comapeo/ipc/client.js' -import { createMapeoServer } from '@comapeo/ipc/server.js' +import { + closeComapeoCoreClient, + createComapeoCoreClient, +} from '@comapeo/ipc/client.js' +import { createComapeoCoreServer } from '@comapeo/ipc/server.js' import { KeyManager } from '@mapeo/crypto' import Fastify from 'fastify' import RAM from 'random-access-memory' @@ -36,8 +38,8 @@ export function setupCoreIpc() { fastify, }) - const server = createMapeoServer(manager, port1) - const client = createMapeoClient(port2) + const server = createComapeoCoreServer(manager, port1) + const client = createComapeoCoreClient(port2) port1.start() port2.start() @@ -53,7 +55,7 @@ export function setupCoreIpc() { cleanup: async () => { server.close() fastifyController.stop() - await closeMapeoClient(client) + await closeComapeoCoreClient(client) port1.close() port2.close() }, diff --git a/test/helpers/react.tsx b/test/helpers/react.tsx index 0839b2d..3ca77aa 100644 --- a/test/helpers/react.tsx +++ b/test/helpers/react.tsx @@ -1,4 +1,4 @@ -import { type MapeoClientApi } from '@comapeo/ipc' +import type { ComapeoCoreClientApi } from '@comapeo/ipc' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { type PropsWithChildren } from 'react' @@ -6,11 +6,11 @@ import { ComapeoCoreProvider } from '../../src/index.js' import { createMockClientApi } from './client-api-mock.js' export function createWrapper({ - clientApi = createMockClientApi() as unknown as MapeoClientApi, + clientApi = createMockClientApi() as unknown as ComapeoCoreClientApi, queryClient = new QueryClient(), getMapServerBaseUrl = async () => new URL('http://localhost:3000'), }: { - clientApi?: MapeoClientApi + clientApi?: ComapeoCoreClientApi queryClient?: QueryClient getMapServerBaseUrl?: () => Promise } = {}) { diff --git a/test/hooks/map-shares.test.tsx b/test/hooks/map-shares.test.tsx index 9fe3d7e..c43ce64 100644 --- a/test/hooks/map-shares.test.tsx +++ b/test/hooks/map-shares.test.tsx @@ -11,7 +11,7 @@ // Set up minimal DOM globals needed for React rendering in this test file import '../helpers/jsdom-setup.js' -import { type MapeoClientApi } from '@comapeo/ipc' +import type { ComapeoCoreClientApi } from '@comapeo/ipc' import { act, renderHook, waitFor } from '@testing-library/react' import { Suspense, @@ -104,7 +104,7 @@ describe('Received Map Shares Hooks', () => { // Receiver wrapper - for testing received hooks receiverWrapper = createWrapper({ - clientApi: mockClientApi as unknown as MapeoClientApi, + clientApi: mockClientApi as unknown as ComapeoCoreClientApi, getMapServerBaseUrl: async () => new URL(receiver.localBaseUrl), }) @@ -1023,7 +1023,7 @@ describe('Sent Map Shares Hooks', () => { // For sent hooks, we use the sender's map server wrapper = createWrapper({ - clientApi: mockClientApi as unknown as MapeoClientApi, + clientApi: mockClientApi as unknown as ComapeoCoreClientApi, getMapServerBaseUrl: async () => new URL(sender.localBaseUrl), }) }) diff --git a/test/lib/sent-map-shares-store.test.ts b/test/lib/sent-map-shares-store.test.ts index f9a5c84..0a09171 100644 --- a/test/lib/sent-map-shares-store.test.ts +++ b/test/lib/sent-map-shares-store.test.ts @@ -1,7 +1,7 @@ /** * @vitest-environment node */ -import type { MapeoClientApi } from '@comapeo/ipc' +import type { ComapeoCoreClientApi } from '@comapeo/ipc' import type { MapShareState as ServerMapShareState } from '@comapeo/map-server' import ky from 'ky' import { beforeEach, describe, expect, it, vi } from 'vitest' @@ -36,7 +36,7 @@ describe('SentMapSharesStore', () => { receiver = await startMapServer(t) sentStore = createSentMapSharesStore({ - clientApi: mockClientApi as unknown as MapeoClientApi, + clientApi: mockClientApi as unknown as ComapeoCoreClientApi, mapServerApi: createMapServerApi({ getBaseUrl: async () => new URL(sender.localBaseUrl), }),