diff --git a/bun.lock b/bun.lock index c397e9b..f6adc41 100644 --- a/bun.lock +++ b/bun.lock @@ -5,6 +5,7 @@ "": { "name": "bun-react-template", "dependencies": { + "@ng-eventually/client": "/home/sylvain/projects/nextgraph/ng-eventually-js/packages/client", "@ng-org/alien-deepsignals": "0.1.2-alpha.11", "@ng-org/orm": "0.1.2-alpha.18", "@ng-org/shex-orm": "0.1.2-alpha.8", @@ -187,6 +188,8 @@ "@mdx-js/react": ["@mdx-js/react@3.1.1", "", { "dependencies": { "@types/mdx": "^2.0.0" }, "peerDependencies": { "@types/react": ">=16", "react": ">=16" } }, "sha512-f++rKLQgUVYDAtECQ6fn/is15GkEH9+nZPM3MS0RcxVqoTfawHvDlSCH7JbMhAM6uJ32v3eXLvLmLvjGu7PTQw=="], + "@ng-eventually/client": ["@ng-eventually/client@file:../../nextgraph/ng-eventually-js/packages/client", { "peerDependencies": { "@ng-org/orm": "*", "@ng-org/web": "*" }, "optionalPeers": ["@ng-org/orm", "@ng-org/web"] }], + "@ng-org/alien-deepsignals": ["@ng-org/alien-deepsignals@0.1.2-alpha.11", "", { "dependencies": { "alien-signals": "^2.0.7" }, "peerDependencies": { "react": "^19.0.0 || ^18.0.0", "svelte": "^5.0.0 || ^4.0.0", "vue": "^3.0.0" }, "optionalPeers": ["react", "svelte", "vue"] }, "sha512-nPgqOrheAda/pW5FHgSb45SrSZWuyMyEVqO683ijEsVPpD105bngfh92PPfcRoRnFzGSoKXa3CfuqUHi2+qVIQ=="], "@ng-org/orm": ["@ng-org/orm@0.1.2-alpha.18", "", { "dependencies": { "@ng-org/alien-deepsignals": "0.1.2-alpha.11" }, "peerDependencies": { "react": "^19.0.0 || ^18.0.0", "svelte": "^5.0.0 || ^4.0.0", "vue": "^3.0.0" }, "optionalPeers": ["react", "svelte", "vue"] }, "sha512-LlCXFsGJWoKULn+EemsKntASEG3224AaT4mBC1DisTVtfGeGMaIowTimG31nQ7hTL3fssmCEWkZguP2/c6quUA=="], diff --git a/package.json b/package.json index d60c7df..b574d72 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "build-storybook": "storybook build" }, "dependencies": { + "@ng-eventually/client": "/home/sylvain/projects/nextgraph/ng-eventually-js/packages/client", "@ng-org/alien-deepsignals": "0.1.2-alpha.11", "@ng-org/orm": "0.1.2-alpha.18", "@ng-org/shex-orm": "0.1.2-alpha.8", diff --git a/src/shared/hooks/useShapeWithDefaults.ts b/src/shared/hooks/useShapeWithDefaults.ts index 9d43234..4ee549b 100644 --- a/src/shared/hooks/useShapeWithDefaults.ts +++ b/src/shared/hooks/useShapeWithDefaults.ts @@ -8,7 +8,7 @@ * Must only be called when NG is connected (inside NgDataProvider). */ -import { useShape } from '@ng-org/orm/react'; +import { useShape } from '@ng-eventually/client'; import type { ShapeType, BaseType } from '@ng-org/shex-orm'; import type { DeepSignalSet } from '@ng-org/alien-deepsignals'; export interface ShapeWithDefaults { diff --git a/src/shared/test-harness/harness-ng.tsx b/src/shared/test-harness/harness-ng.tsx index dbb9b36..5f23eba 100644 --- a/src/shared/test-harness/harness-ng.tsx +++ b/src/shared/test-harness/harness-ng.tsx @@ -11,7 +11,7 @@ import React, { useEffect, useState } from 'react'; import { createRoot } from 'react-dom/client'; import { NextGraphProvider, useNextGraph } from '../context/NextGraphContext'; import { FestipodDataProvider, useFestipodData } from '../context/FestipodDataContext'; -import { useShape } from '@ng-org/orm/react'; +import { useShape } from '@ng-eventually/client'; import type { DeepSignalSet } from '@ng-org/alien-deepsignals'; import { FpEventShapeType, diff --git a/src/shared/utils/ngSession.ts b/src/shared/utils/ngSession.ts index 7c134b9..46deb1b 100644 --- a/src/shared/utils/ngSession.ts +++ b/src/shared/utils/ngSession.ts @@ -1,6 +1,14 @@ import { ng, init as initNgWeb } from "@ng-org/web"; import type { NG } from "@ng-org/web"; import { initNg as initNgSignals } from "@ng-org/orm"; +import { useShape as realUseShape } from "@ng-org/orm/react"; +import { configure as configureEventually } from "@ng-eventually/client/polyfill"; + +// Inject the REAL SDK into the ng-eventually polyfill. The app imports the +// SDK-shaped exports (`useShape`, `ng`, `inbox`) from `@ng-eventually/client`, +// which delegate to what we inject here. This is the single injection point — +// removed at migration (the app then points back at the real SDK). +configureEventually({ ng, useShape: realUseShape }); export let session: NextGraphSession | undefined;