From aae569603cf3725f3bb99d89dd998a6b23d51509 Mon Sep 17 00:00:00 2001 From: srosset81 Date: Fri, 7 Aug 2026 17:46:31 +0200 Subject: [PATCH] Last fixes --- examples/antd-app/package.json | 6 +- examples/antd-app/src/pages/posts/list.tsx | 4 +- package.json | 4 +- pnpm-lock.yaml | 91 +++------------------- src/data-provider.ts | 9 ++- src/getObjects.ts | 26 ------- 6 files changed, 23 insertions(+), 117 deletions(-) delete mode 100644 src/getObjects.ts diff --git a/examples/antd-app/package.json b/examples/antd-app/package.json index 67f6532..2afb737 100644 --- a/examples/antd-app/package.json +++ b/examples/antd-app/package.json @@ -25,8 +25,8 @@ "dependencies": { "@ant-design/icons": "^5.5.1", "@ant-design/v5-patch-for-react-19": "^1.0.3", - "@ng-org/orm": "0.1.2-alpha.19", - "@ng-org/web": "0.1.2-alpha.13", + "@ng-org/orm": "0.1.2-alpha.21", + "@ng-org/web": "0.1.2-alpha.14", "@ng-org/refine-providers": "workspace:*", "@refinedev/antd": "^6.0.3", "@refinedev/cli": "^2.16.52", @@ -39,7 +39,7 @@ "react-router": "^7.0.2" }, "devDependencies": { - "@ng-org/shex-orm": "0.1.2-alpha.8", + "@ng-org/shex-orm": "0.1.2-alpha.9", "@types/node": "^20", "@types/react": "^19.1.0", "@types/react-dom": "^19.1.0", diff --git a/examples/antd-app/src/pages/posts/list.tsx b/examples/antd-app/src/pages/posts/list.tsx index eb2d717..1905576 100644 --- a/examples/antd-app/src/pages/posts/list.tsx +++ b/examples/antd-app/src/pages/posts/list.tsx @@ -29,8 +29,8 @@ export const PostList = () => { })} > - - + + title="Actions" dataIndex="actions" diff --git a/package.json b/package.json index 627c78a..4d426f6 100644 --- a/package.json +++ b/package.json @@ -96,13 +96,13 @@ "peerDependencies": { "@refinedev/core": "^5.0.12", "@ng-org/alien-deepsignals": "0.1.2-alpha.13", - "@ng-org/orm": "0.1.2-alpha.20", + "@ng-org/orm": "0.1.2-alpha.21", "@ng-org/shex-orm": "0.1.2-alpha.9", "@ng-org/web": "0.1.2-alpha.14" }, "devDependencies": { "@ng-org/alien-deepsignals": "0.1.2-alpha.13", - "@ng-org/orm": "0.1.2-alpha.20", + "@ng-org/orm": "0.1.2-alpha.21", "@ng-org/shex-orm": "0.1.2-alpha.9", "@ng-org/web": "0.1.2-alpha.14", "@refinedev/core": "^5.0.12", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9f5d98d..f8b975e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: 0.1.2-alpha.13 version: 0.1.2-alpha.13(react@19.2.7) '@ng-org/orm': - specifier: 0.1.2-alpha.20 - version: 0.1.2-alpha.20(react@19.2.7) + specifier: 0.1.2-alpha.21 + version: 0.1.2-alpha.21(react@19.2.7) '@ng-org/shex-orm': specifier: 0.1.2-alpha.9 version: 0.1.2-alpha.9(typescript@5.9.3) @@ -42,14 +42,14 @@ importers: specifier: ^1.0.3 version: 1.0.3(antd@5.29.3(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(react-dom@19.2.7(react@19.2.7))(react@19.2.7) '@ng-org/orm': - specifier: 0.1.2-alpha.19 - version: 0.1.2-alpha.19(react@19.2.7) + specifier: 0.1.2-alpha.21 + version: 0.1.2-alpha.21(react@19.2.7) '@ng-org/refine-providers': specifier: workspace:* version: link:../.. '@ng-org/web': - specifier: 0.1.2-alpha.13 - version: 0.1.2-alpha.13 + specifier: 0.1.2-alpha.14 + version: 0.1.2-alpha.14 '@refinedev/antd': specifier: ^6.0.3 version: 6.0.3(@refinedev/core@5.0.12(@tanstack/react-query@5.101.2(react@19.2.7))(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(antd@5.29.3(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(dayjs@1.11.21)(react-dom@19.2.7(react@19.2.7))(react@19.2.7) @@ -79,8 +79,8 @@ importers: version: 7.18.1(react-dom@19.2.7(react@19.2.7))(react@19.2.7) devDependencies: '@ng-org/shex-orm': - specifier: 0.1.2-alpha.8 - version: 0.1.2-alpha.8(typescript@5.9.3) + specifier: 0.1.2-alpha.9 + version: 0.1.2-alpha.9(typescript@5.9.3) '@types/node': specifier: ^20 version: 20.19.43 @@ -615,20 +615,6 @@ packages: cpu: [x64] os: [win32] - '@ng-org/alien-deepsignals@0.1.2-alpha.12': - resolution: {integrity: sha512-STIfMLJvwNDnAIdi/wFToLtnZDjbf0PaeYfshfMal2HbYirSPFEBue393nlYKv9rLlCrqjYOBNeSBK9FO7/Qng==} - peerDependencies: - react: ^19.0.0 || ^18.0.0 - svelte: ^5.0.0 || ^4.0.0 - vue: ^3.0.0 - peerDependenciesMeta: - react: - optional: true - svelte: - optional: true - vue: - optional: true - '@ng-org/alien-deepsignals@0.1.2-alpha.13': resolution: {integrity: sha512-yOEh/J+9IrCo8WDXTdZLxRcO9IHAczrUA4pjSD4BaZzmWhnCFE/amy/0PsAdh/yePurBrtQj3tG/y+hReM15Ew==} peerDependencies: @@ -643,8 +629,8 @@ packages: vue: optional: true - '@ng-org/orm@0.1.2-alpha.19': - resolution: {integrity: sha512-wPDQ0OEitpoEKrvj4IJKIRxeTHr3X5+rApvZJOh54CNV1Q1b5MaT2XvyJ9YDvlgyUX2CxNkcmumV4k4ASmBXNA==} + '@ng-org/orm@0.1.2-alpha.21': + resolution: {integrity: sha512-+Dtt9jEa+277wonExxqC1BHqVwvWhXeXM51zcGg2w+Mc6C1F74qaXMGYZT3CcWCQISGEMOWV3n2movP3yQ8xJA==} peerDependencies: react: ^19.0.0 || ^18.0.0 svelte: ^5.0.0 || ^4.0.0 @@ -657,35 +643,12 @@ packages: vue: optional: true - '@ng-org/orm@0.1.2-alpha.20': - resolution: {integrity: sha512-T7lzAi2QRI0WWHMXab63zqvP7x6hCwQYzYWvZxfMWLYuwJVycLgnHP97gemPrBwXg+GEa2KZ9LqzLMR2bA3oVw==} - peerDependencies: - react: ^19.0.0 || ^18.0.0 - svelte: ^5.0.0 || ^4.0.0 - vue: ^3.0.0 - peerDependenciesMeta: - react: - optional: true - svelte: - optional: true - vue: - optional: true - - '@ng-org/shex-orm@0.1.2-alpha.8': - resolution: {integrity: sha512-jogxiLfUtI3WkuF5O3PPwRBRWylpapk/JlvElGUqZnEavXXlEMmEGbK3VwqMUsbp1pweNA0sEKIFLIk3Lzt2Gg==} - hasBin: true - peerDependencies: - typescript: ^4.9.0 || ^5.0.0 || ^6.0.0 - '@ng-org/shex-orm@0.1.2-alpha.9': resolution: {integrity: sha512-M69oIHrcjl24xKXIaiZjZ64rJvispAPIqn73asLPR73GWpEMvbiot/EN0vDkcfrbRy3cMEql36A9e1Nwv2csOA==} hasBin: true peerDependencies: typescript: ^4.9.0 || ^5.0.0 || ^6.0.0 - '@ng-org/web@0.1.2-alpha.13': - resolution: {integrity: sha512-/xO0c+3NTphnws5Do2LDqgZWmAf+aNnYdChJKdU0dnp1U1iVSgi/y3yb8AYryf0v9sooj0aYJxt08B6DpirFMQ==} - '@ng-org/web@0.1.2-alpha.14': resolution: {integrity: sha512-FPQ7kyngMhAXK/WJtZ6pkoEJwGcau6GaBH2nhjjYorMq7OG//I+zwghat90FsIeMrfYsps0+5Y0UrRqfxNdUXA==} @@ -4904,46 +4867,18 @@ snapshots: '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.4': optional: true - '@ng-org/alien-deepsignals@0.1.2-alpha.12(react@19.2.7)': - dependencies: - alien-signals: 2.0.8 - optionalDependencies: - react: 19.2.7 - '@ng-org/alien-deepsignals@0.1.2-alpha.13(react@19.2.7)': dependencies: alien-signals: 2.0.8 optionalDependencies: react: 19.2.7 - '@ng-org/orm@0.1.2-alpha.19(react@19.2.7)': - dependencies: - '@ng-org/alien-deepsignals': 0.1.2-alpha.12(react@19.2.7) - optionalDependencies: - react: 19.2.7 - - '@ng-org/orm@0.1.2-alpha.20(react@19.2.7)': + '@ng-org/orm@0.1.2-alpha.21(react@19.2.7)': dependencies: '@ng-org/alien-deepsignals': 0.1.2-alpha.13(react@19.2.7) optionalDependencies: react: 19.2.7 - '@ng-org/shex-orm@0.1.2-alpha.8(typescript@5.9.3)': - dependencies: - '@ldo/traverser-shexj': 1.0.0-alpha.28 - '@ldo/type-traverser': 1.0.0-alpha.28 - '@shexjs/parser': 1.0.0-alpha.28 - commander: 14.0.3 - dts-dom: 3.6.0 - ejs: 3.1.10 - fs-extra: 10.1.0 - jsonld2graphobject: 0.0.5 - loading-cli: 1.1.2 - prettier: 3.9.5 - typescript: 5.9.3 - transitivePeerDependencies: - - encoding - '@ng-org/shex-orm@0.1.2-alpha.9(typescript@5.9.3)': dependencies: '@ldo/traverser-shexj': 1.0.0-alpha.28 @@ -4960,10 +4895,6 @@ snapshots: transitivePeerDependencies: - encoding - '@ng-org/web@0.1.2-alpha.13': - dependencies: - async-proxy: 0.4.1 - '@ng-org/web@0.1.2-alpha.14': dependencies: async-proxy: 0.4.1 diff --git a/src/data-provider.ts b/src/data-provider.ts index 7c8c5e3..54ff559 100644 --- a/src/data-provider.ts +++ b/src/data-provider.ts @@ -1,10 +1,9 @@ import { DataProvider } from "@refinedev/core"; import { ng } from "@ng-org/web"; import { addIdToObject, isGraphKey, getSignalObject } from "./utils"; -import { getObjects } from "./getObjects"; +import { getObjects } from "@ng-org/orm"; import { DataProviderConfig } from "./types"; - const dataProvider = ({ shapeTypes, authProvider }: DataProviderConfig) : DataProvider => ({ // Note: the `pagination` parameter is not used, because the ORM handle currently handle pagination within the ORM objects. // In the future, it may use offset-based or cursor-based pagination, which would work with this stateless data provider. @@ -29,9 +28,11 @@ const dataProvider = ({ shapeTypes, authProvider }: DataProviderConfig) : DataPr : undefined }); + const objectsArray = [...objects]; + return { - data: [...objects].map(addIdToObject) as any, - total: objects.size, + data: objectsArray.map(addIdToObject) as any, + total: objectsArray.length, }; }, create: async ({ resource, variables, meta }) => { diff --git a/src/getObjects.ts b/src/getObjects.ts deleted file mode 100644 index 15b2531..0000000 --- a/src/getObjects.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { BaseType, ShapeType } from "@ng-org/shex-orm"; -import { RdfOrmSubscription, normalizeConf } from "@ng-org/orm"; -import type { RdfOrmConfig } from "@ng-org/orm/all"; -import { RAW_KEY } from "@ng-org/alien-deepsignals"; - -/** - * Local copy of `@ng-org/orm`'s `getObjects` until the fix is released - * https://git.nextgraph.org/NextGraph/nextgraph-rs/commit/02cb531f53dfb7a64014917e9b38cd5134efcdd8 - */ -export async function getObjects( - shapeType: ShapeType, - config: Omit, "pageSize" | "maxActivePages"> -) { - const connection = RdfOrmSubscription.getOrCreate( - shapeType, - normalizeConf(config) as any - ); - await connection.readyPromise; - - setTimeout(() => { - connection.close(); - }, 1_000); - - return structuredClone(connection.signalObject[RAW_KEY]); -} -