From d493783af4d8d1627af759e8013be4a63b2322dd Mon Sep 17 00:00:00 2001 From: Alain Bourgeois Date: Wed, 20 May 2026 20:03:54 +0200 Subject: [PATCH 1/3] uvdsl OIDC client --- src/index.ts | 6 +++++- webpack.config.mjs | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3505746f..1d0bacf9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -67,7 +67,11 @@ global.panes.runDataBrowser = function (uri?:string|$rdf.NamedNode|null) { // Authenticate the user SolidLogic.authn.checkUser() - .then(() => panes.initMainPage(SolidLogic.solidLogicSingleton.store, uri)) + .then(() => { + // Avoid rdflib type identity clashes when workspace packages resolve different node_modules paths. + const storeForPanes = SolidLogic.solidLogicSingleton.store as unknown as Parameters[0] + return panes.initMainPage(storeForPanes, uri) + }) .then(() => { // Inject render environment into pane context after outliner exists syncEnvironmentToContext('initMainPage') diff --git a/webpack.config.mjs b/webpack.config.mjs index 22b32469..8327b5b7 100644 --- a/webpack.config.mjs +++ b/webpack.config.mjs @@ -22,6 +22,8 @@ const packageAliases = { } const workspaceAliases = { + 'solid-logic': path.resolve('../solid-logic/src/index.ts'), + 'SolidLogic': path.resolve('../solid-logic/src/index.ts'), 'solid-panes$': path.resolve('../solid-panes/src/index.ts'), 'solid-ui$': path.resolve('../solid-ui/src/index.ts'), 'UI$': path.resolve('../solid-ui/src/index.ts'), @@ -29,7 +31,8 @@ const workspaceAliases = { } function getResolutionMode (env = {}) { - const resolutionMode = env.resolutionMode || process.env.MASHLIB_RESOLUTION_MODE || PACKAGE_RESOLUTION_MODE + const isDevServeOrWatch = Boolean(process.env.WEBPACK_SERVE || process.argv.includes('--watch')) + const resolutionMode = env.resolutionMode || process.env.MASHLIB_RESOLUTION_MODE || (isDevServeOrWatch ? WORKSPACE_RESOLUTION_MODE : PACKAGE_RESOLUTION_MODE) if (resolutionMode !== PACKAGE_RESOLUTION_MODE && resolutionMode !== WORKSPACE_RESOLUTION_MODE) { throw new Error(`Invalid mashlib webpack resolution mode: ${resolutionMode}. Use "${PACKAGE_RESOLUTION_MODE}" or "${WORKSPACE_RESOLUTION_MODE}".`) } From 877956daea0a289eec859fcb45585f338626e4c1 Mon Sep 17 00:00:00 2001 From: Alain Bourgeois Date: Fri, 22 May 2026 11:14:12 +0200 Subject: [PATCH 2/3] feat(auth): wire same-origin RefreshWorker from solid-logic into mashlib build copy RefreshWorker.js from solid-logic into mashlib dist via webpack CopyPlugin initialize SOLID_LOGIC_WORKER_URL early so solid-logic uses same-origin worker URL import worker runtime config before solid-logic initialization document worker asset/runtime configuration in README for deployers --- README.md | 10 ++++++++++ src/index.ts | 1 + src/worker-config.ts | 13 +++++++++++++ webpack.config.mjs | 3 ++- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/worker-config.ts diff --git a/README.md b/README.md index ad0d4633..72a73bd9 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,16 @@ Use these scripts for local workspace builds: `npm run build`, `npm run watch`, and `npm run start` stay on default package resolution. +### Authentication worker asset (solid-logic) + +mashlib relies on solid-logic authentication and should serve the refresh worker as a same-origin static asset. + +- Worker file to serve: `RefreshWorker.js` +- Runtime override (optional): `window.__SOLID_LOGIC_WORKER_URL__` + +See solid-logic runtime contract details in: +https://github.com/solidos/solid-logic#worker-asset-and-runtime-configuration + ## Goals The goals of mashlib overlap with the [SolidOS Goals](https://solidos.solidcommunity.net/Team/docs/SolidOSNorthStar.html). diff --git a/src/index.ts b/src/index.ts index 1d0bacf9..a3c9b22e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ // (they declare `solid-logic` and `rdflib` as UMD externals with // root: "SolidLogic" / "$rdf"). import './globals' +import './worker-config' import * as $rdf from 'rdflib' import * as SolidLogic from 'solid-logic' diff --git a/src/worker-config.ts b/src/worker-config.ts new file mode 100644 index 00000000..aa5be1e9 --- /dev/null +++ b/src/worker-config.ts @@ -0,0 +1,13 @@ +// Configure solid-logic worker URL before solid-logic module initialization. +// Consumers can still override this by defining __SOLID_LOGIC_WORKER_URL__ earlier. +declare global { + interface Window { + __SOLID_LOGIC_WORKER_URL__?: string | URL + } +} + +if (typeof window !== 'undefined' && !window.__SOLID_LOGIC_WORKER_URL__) { + window.__SOLID_LOGIC_WORKER_URL__ = new URL('./RefreshWorker.js', window.location.href).toString() +} + +export {} diff --git a/webpack.config.mjs b/webpack.config.mjs index 8327b5b7..f1754312 100644 --- a/webpack.config.mjs +++ b/webpack.config.mjs @@ -133,7 +133,8 @@ function createCommonConfig (resolutionMode) { new NodePolyfillPlugin(), new CopyPlugin({ patterns: [ - { from: 'static', to: '.' } + { from: 'static', to: '.' }, + { from: 'node_modules/solid-logic/dist/RefreshWorker.js', to: 'RefreshWorker.js' } ] }) ], From 65a0fbb8a5c4222362ced387e3ff3f5722d00aa7 Mon Sep 17 00:00:00 2001 From: bourgeoa Date: Fri, 22 May 2026 17:03:26 +0000 Subject: [PATCH 3/3] add RefreshWorker.js --- src/databrowser.html | 5 +++++ src/worker-config.ts | 2 +- static/browse.html | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/databrowser.html b/src/databrowser.html index 716cfd79..128f115e 100644 --- a/src/databrowser.html +++ b/src/databrowser.html @@ -4,6 +4,11 @@ SolidOS + +