From af239103f1bac831e069c309bc8b6d10fcbce255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=CC=81=20Verheij?= <341567+flyon@users.noreply.github.com> Date: Tue, 10 Nov 2026 13:47:42 +0000 Subject: [PATCH 1/4] registerOntologies replaces linkedOntology; the component index declares the core namespace itself --- .changeset/register-ontologies.md | 5 +++++ src/package.ts | 4 ++-- src/utils/componentIndex.ts | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .changeset/register-ontologies.md diff --git a/.changeset/register-ontologies.md b/.changeset/register-ontologies.md new file mode 100644 index 0000000..26beeb9 --- /dev/null +++ b/.changeset/register-ontologies.md @@ -0,0 +1,5 @@ +--- +'@_linked/react': major +--- + +`linkedPackage` (and the package's own exports) give `registerOntologies` in place of `linkedOntology`, which the core this release builds on no longer has. A package registers its ontologies from a generated `src/ontologies/index.ts` with `registerOntologies([...], import.meta.url)`; no package registers a prefix. The component index (`components.ttl`) declares the `core` namespace itself instead of reading it from core's ontology module; its bytes are unchanged. diff --git a/src/package.ts b/src/package.ts index 8d9857d..609d1a0 100644 --- a/src/package.ts +++ b/src/package.ts @@ -16,7 +16,7 @@ const registry = sharedState('@_linked/react', 'componentRegistry', () => ({ const { linkedUtil, - linkedOntology, + registerOntologies, linkedShape, registerPackageExport, registerPackageModule, @@ -67,7 +67,7 @@ export { linkedSetComponent, linkedShape, linkedUtil, - linkedOntology, + registerOntologies, registerPackageExport, registerPackageModule, packageExports, diff --git a/src/utils/componentIndex.ts b/src/utils/componentIndex.ts index 5dc7321..ef61e08 100644 --- a/src/utils/componentIndex.ts +++ b/src/utils/componentIndex.ts @@ -9,7 +9,7 @@ import {QueryBuilder} from '@_linked/core/queries/QueryBuilder'; import {isLinkedInstance} from '@_linked/core/utils/linkedError'; import {getPackageUri} from '@_linked/core/shapes/SHACL'; -import {coreOntology, ns as coreNs} from '@_linked/core/ontologies/linked-core'; +import {coreOntology} from '@_linked/core/ontologies/linked-core'; import {rdf, ns as rdfNs} from '@_linked/core/ontologies/rdf'; export interface ComponentIndexEntry { @@ -27,9 +27,12 @@ export interface ComponentIndexEntry { query: string; } +// The file declares its own prefixes: it is a self-contained document, written whatever map the +// running app has loaded. +const CORE = 'https://linked.cm/ont/core/'; const XSD = 'http://www.w3.org/2001/XMLSchema#'; const PREFIXES: [string, string][] = [ - ['core', coreNs('').id], + ['core', CORE], ['rdf', rdfNs('').id], ['xsd', XSD], ]; From 2e38070b5d632a08341c342f8e60b20bcc51244d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=CC=81=20Verheij?= <341567+flyon@users.noreply.github.com> Date: Tue, 10 Nov 2026 13:49:30 +0000 Subject: [PATCH 2/4] Report: registerOntologies in place of linkedOntology --- docs/reports/006-register-ontologies.md | 67 +++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 docs/reports/006-register-ontologies.md diff --git a/docs/reports/006-register-ontologies.md b/docs/reports/006-register-ontologies.md new file mode 100644 index 0000000..8fbc9bb --- /dev/null +++ b/docs/reports/006-register-ontologies.md @@ -0,0 +1,67 @@ +--- +date: 2026-11-10 +summary: > + `@_linked/react` compiles against the core that replaced `linkedOntology` with + `registerOntologies` and dropped `ns` from its ontology module: the package object gives + `registerOntologies`, and the component index declares the `core` namespace itself. Major. +packages: [react] +--- + +# 006 — `registerOntologies` in place of `linkedOntology` + +## PR + +**What changed.** The core this release builds on registers a package's ontologies with +`registerOntologies(ontologies, import.meta.url)` from a generated `ontologies/index`, registers no +prefix, and its `ontologies/linked-core` module holds only literal terms (no `ns`). + +- `src/package.ts`: `linkedPackage(...)` and the package's own exports give `registerOntologies` + in place of `linkedOntology` (the rest of core's package object is spread as before). +- `src/utils/componentIndex.ts`: the `core` prefix of `components.ttl` is a literal namespace + (`https://linked.cm/ont/core/`) next to the `xsd` one, instead of `ns('')` from core's ontology + module. The file is self-contained and declares its own prefixes, so it does not depend on the + app's prefix map; its bytes are unchanged. + +Major changeset (`.changeset/register-ontologies.md`): `linkedOntology` leaves the public exports. + +**Verification** + +`npx linked build`: + +``` +✔ Writing components.ttl +✔ Checking sideEffects +✔ Checking dependencies +✔ Build successful +``` + +`npm test`: + +``` +Test Suites: 7 passed, 7 total +Tests: 84 passed, 84 total +``` + +`npm run typecheck` (`tsc -p tsconfig-test.json --noEmit`): exit 0, no output. +`component-index.test.tsx` asserts the prefix line `@prefix core: .`. + +**Deviations.** None. + +**Follow-ups.** None in this repo. Raising the `@_linked/core` range to the new major happens at +release, with every package of the coordinated major. + +## Details + +### Phases + +1. Inventory: a grep of `src` for the removed core API (`linkedOntology`, `ns` from ontology + modules, `Prefix.add`, `toFullIfPossible`, `resolvePrefixedUri`) and for prefixed strings that + rely on a globally registered prefix. Two hits, both fixed; no prefixed strings. +2. Fix, build, test, typecheck (above). + +### Decisions + +| # | Problem | Choice | Alternative | Rationale | +|---|---|---|---|---| +| 1 | `components.ttl` needs the core namespace; core's module no longer exports `ns` | a literal, like the `xsd` one beside it | `createNameSpace` or reading the registry | the file's prefix section is fixed text; a literal states it directly | +| 2 | changeset level | major | minor | `linkedOntology` is removed from the exports | From 09089233726668d1a4cc37033020131983f53ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=CC=81=20Verheij?= <341567+flyon@users.noreply.github.com> Date: Tue, 10 Nov 2026 15:30:30 +0000 Subject: [PATCH 3/4] Docs: describe the host app generically --- CHANGELOG.md | 2 +- README.md | 2 +- docs/reports/004-component-index.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8328cb3..97068da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -89,7 +89,7 @@ The old range long predated the core versions this package is actually built and tested against; ^2.22.8 states the real requirement. Checked against every package that depends on `@_linked/react` — auth, primitives, rdfs, schema, - shape-ui, sioc and the Create Now app — each already declares or resolves core + shape-ui, sioc and the host app — each already declares or resolves core 2.22.8, so none of them warns on this. Narrowing a peer range is in principle a breaking change; it is released as a diff --git a/README.md b/README.md index 94cdddf..5439424 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ Both formats are supported. For linked-set wrappers, the external API is also `o ### Export your components from `src/components/index.ts` -A package offers its components to builders (Create Now's drag-and-drop builder) through +A package offers its components to builders (such as a host app's drag-and-drop builder) through `src/components/index.ts`: export each linked component by name. ```ts diff --git a/docs/reports/004-component-index.md b/docs/reports/004-component-index.md index 4550a22..258957a 100644 --- a/docs/reports/004-component-index.md +++ b/docs/reports/004-component-index.md @@ -1,7 +1,7 @@ --- date: 2026-10-29 summary: > - The react half of the component index (CN plan 282 step CI, K8): `componentIndexTurtle` and + The react half of the component index (the host app's component plan, step CI, K8): `componentIndexTurtle` and `componentIndexEntries` in `@_linked/react/utils/componentIndex` turn a package's `components/index` exports into the Turtle `linked build` writes as `lib/esm/data/components.ttl`; `linkedSetComponent` marks its result. Minor. The whole step: cli report 042. From e9038a1779da749dc524e49d44a534c4484a01a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=CC=81=20Verheij?= <341567+flyon@users.noreply.github.com> Date: Tue, 24 Nov 2026 14:38:08 +0000 Subject: [PATCH 4/4] Ranges move to the released majors: @_linked/core: ^3.0.0, @_linked/xsd: ^2.0.0 --- package-lock.json | 27 +++++++++++++++++++-------- package.json | 6 +++--- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0dd93d0..e2e6eef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,8 +10,8 @@ "license": "MIT", "devDependencies": { "@_linked/cli": "^1.45.5", - "@_linked/core": "^2.46.0", - "@_linked/xsd": "^1.4.1", + "@_linked/core": "^3.0.0", + "@_linked/xsd": "^2.0.0", "@changesets/changelog-github": "^1.0.0", "@changesets/cli": "^3.0.0", "@jest/globals": "^30.0.0", @@ -30,7 +30,7 @@ "typescript": "^5.7.3" }, "peerDependencies": { - "@_linked/core": "^2.46.0", + "@_linked/core": "^3.0.0", "react": "^18.2.0 || ^19.0.0", "react-native": ">=0.76" }, @@ -81,7 +81,7 @@ "linked": "lib/esm/launch.js" } }, - "node_modules/@_linked/core": { + "node_modules/@_linked/cli/node_modules/@_linked/core": { "version": "2.48.0", "resolved": "https://registry.npmjs.org/@_linked/core/-/core-2.48.0.tgz", "integrity": "sha512-w+WC2xSmI4dAISUIaDNho00eUlTftWQctd69kCQsHrhZ1X1WobkGk59nc2/zO9DRsQpDFeDiFGJusPdEp3PY8w==", @@ -92,14 +92,25 @@ "ulid": "^3.0.2" } }, + "node_modules/@_linked/core": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@_linked/core/-/core-3.0.0.tgz", + "integrity": "sha512-r/IRn6xLvVdfaV95WeO9a5OU5dYp8Z3jKJh1mXqt1aYGrY6VUN3P9yxH2Ke3TLE4nWoaw7xK3KEr1VbUBs2dIw==", + "dev": true, + "license": "MIT", + "dependencies": { + "n3": "^2.13.12", + "ulid": "^3.0.2" + } + }, "node_modules/@_linked/xsd": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@_linked/xsd/-/xsd-1.4.4.tgz", - "integrity": "sha512-7+liHAFEAG+6U1HPLuB6tv+CM5d0XdKL3254RiVZnXFIuH6HnkY0AzPMl1QBl0wZhnQmswO+Vbsfm/N8PjNXhg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@_linked/xsd/-/xsd-2.0.0.tgz", + "integrity": "sha512-jtzFoQscT4NuYGYNlkwY8ZsW8B45eZtVbTdGIqEwkLNISRAcCOJTqfYBhnqNBz/BB6zmgSGckP99hTGriXMiOA==", "dev": true, "license": "MIT AND W3C-20150513", "dependencies": { - "@_linked/core": "^2.41.0" + "@_linked/core": "^3.0.0" } }, "node_modules/@adobe/css-tools": { diff --git a/package.json b/package.json index 1230923..788907f 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "setup": "npx semantu-agents" }, "peerDependencies": { - "@_linked/core": "^2.46.0", + "@_linked/core": "^3.0.0", "react": "^18.2.0 || ^19.0.0", "react-native": ">=0.76" }, @@ -69,8 +69,8 @@ }, "devDependencies": { "@_linked/cli": "^1.45.5", - "@_linked/core": "^2.46.0", - "@_linked/xsd": "^1.4.1", + "@_linked/core": "^3.0.0", + "@_linked/xsd": "^2.0.0", "@changesets/changelog-github": "^1.0.0", "@changesets/cli": "^3.0.0", "@jest/globals": "^30.0.0",