Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d780a0f
Merge branch 'main' into dev
flyon Nov 2, 2026
51448b7
Describe the host app generically in comments and docs; no app named …
flyon Nov 2, 2026
7d74971
worktree add / branch start --worktree --dataset: print the app's clo…
flyon Nov 2, 2026
2b915b0
Report 049 and changeset: dataset clone hint from the app's npm script
flyon Nov 2, 2026
f69a38a
linkedOntologies keyed by the ontology's name; the suggested prefix r…
flyon Nov 10, 2026
aadcb29
README: ontologies keyed by name, the suggested prefix from vann data…
flyon Nov 10, 2026
50fcbb2
Format the ontology generator's vann reading
flyon Nov 10, 2026
a79ed98
Report 050 and changeset: ontology names and the vann prefix
flyon Nov 10, 2026
a112a15
linkedOntologies entries name their module and may be hand-written: "…
flyon Nov 10, 2026
190a044
Changeset: ontology module names and hand-written modules
flyon Nov 10, 2026
c25fd79
Report 051: ontology module names and hand-written modules
flyon Nov 10, 2026
fdc8b99
Ontology modules: terms as {id} literals and one generated index per …
flyon Nov 10, 2026
826eca9
linked.app.json: schema v1, its reader, the add-only prefix builder (…
flyon Nov 10, 2026
a245342
Loading the app's prefix map leaves a core without Prefix.load as it …
flyon Nov 10, 2026
497bb30
Report 052, changeset (major) and backlog 018: the ontology index and…
flyon Nov 10, 2026
a562c94
generate-ontology replaces an import of a register module deleted by …
flyon Nov 10, 2026
8145399
linked.app.json holds the app's settings (cssMode, syncShapesOnBoot, …
flyon Nov 10, 2026
b9a65cb
Report 053, changeset (major) and backlog 018: an app's settings in l…
flyon Nov 10, 2026
fc6432c
Describe the host app generically
flyon Nov 10, 2026
532f5d9
Backlog 019: generic names for the host app's env vars
flyon Nov 10, 2026
d1514ce
Name linked.app.json, not the removed linked.config.js, in comments a…
flyon Nov 11, 2026
48c3c6d
debugInfo: drop a stale commented-out TODO about linked.config.json
flyon Nov 11, 2026
53d0398
Refuse namespaces with characters that cannot appear in a SPARQL or T…
flyon Nov 11, 2026
fd9b10c
Merge remote-tracking branch 'origin/main' into ont-addr
flyon Nov 11, 2026
c810539
branch land: build the build tool before the packages that build with it
flyon Nov 11, 2026
f360a09
One dependency order with the build tool first
flyon Nov 11, 2026
a93b8fe
Merge remote-tracking branch 'origin/main' into dev--coordinated-major
flyon Nov 24, 2026
2f4980e
Core ^3.0.0; the package template's ranges move to core ^3.0.0 and cl…
flyon Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/app-json-wording.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@_linked/cli': patch
---

Comments and the architecture notes name `linked.app.json`, not the removed `linked.config.js`.
16 changes: 16 additions & 0 deletions .changeset/app-settings-in-linked-app-json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"@_linked/cli": major
---

`linked.app.json` holds every setting of an app; `linked.config.js` is no longer read.

**Breaking.**

- An app with a `linked.config.js` (or `lincd.config.js`) is refused when its server starts (`linked start`, `linked serve-app`, a compiled server) and when it is built (`linked build-app`); the error shows the JSON to move its settings into. Move them into `linked.app.json` and delete the file.
- Schema version 1 gains `cssMode` (`tailwind` | `postcss`), `syncShapesOnBoot`, `datasetCloneScript`, `publish` (`staticAssets`, `releasePrefix`) and `server` (`rpcExposure`, `rawQueries`, `apiOnly`, `cachePaths`, `cacheTimeout`). Each is checked; an unknown key, also inside `server` or `publish`, is refused. `linked prefixes` keeps them when it adds prefixes.
- `LINKED_RPC_EXPOSURE`, when set, wins over `server.rpcExposure`; a value other than `warn` or `enforce` is refused at start.
- `defineConfig` (`@_linked/cli/defineConfig` and the package entry) is removed: nothing reads a settings module any more.
- Types: `ModuleConfig`, `AdjustedModuleConfig` (the old webpack build's) and `LinkedServerConfig.multiCore` are removed; `LinkedConfig` is the configuration the cli gives `LinkedServer` (`cssMode`, `syncShapesOnBoot`, `server`), and loses `datasetCloneScript`. New: `AppServerSettings`, `CssMode`, `RpcExposureMode`, `RawQueriesMode`. `server.loadAppComponent` and `server.loadRoutes` are set by the cli only.
- `resolveLinkedConfigPath` and `LINKED_CONFIG_FILES` (`@_linked/cli/commands/start`) are removed; `readDatasetCloneScript` is synchronous.

**Fixed.** `linked generate-ontology` replaces a side-effect import of a `src/ontologies/<name>.register.js` that no longer exists (a register module deleted by hand) with the import of the ontology index, as it does for the register modules it removes itself.
13 changes: 13 additions & 0 deletions .changeset/dataset-clone-script.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@_linked/cli": minor
---

`linked worktree add --dataset <name>` and `linked branch start <m> --worktree --dataset <name>` now print how to fill the new dataset from the app's own clone script instead of fixed script paths:

- The app adds an npm script `clone-dataset` to its root `package.json` that copies its data into the dataset named by its one argument. The hint is then `Clone the data into <name> first (from <root>): npm run clone-dataset -- <name>`.
- To use another script name, set `datasetCloneScript` in `linked.config.js`: `defineConfig({datasetCloneScript: 'data:clone'})` (new optional `LinkedConfig` key).
- Without the script (or when `datasetCloneScript` names a script `package.json` lacks), a warning says the dataset starts empty unless it is cloned by hand, and how to add the script.

New exports from the worktree command module: `datasetCloneHint`, `datasetCloneMessages`, `readDatasetCloneScript`, `DEFAULT_DATASET_CLONE_SCRIPT`, `appPort`; `DEFAULT_APP_PORT` (4040) from the start command.

Wording: `worktree add` without `--port` names the app's own port (its `.env` `PORT`, else 4040) as the main checkout's, and `branch land` says "Restart the app on …". See `docs/integration-branches-and-worktrees.md`, "Cloning a dataset".
5 changes: 5 additions & 0 deletions .changeset/debuginfo-stale-todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@_linked/cli': patch
---

Removes a stale commented-out TODO about `linked.config.json` from `debugInfo`.
5 changes: 5 additions & 0 deletions .changeset/host-app-generic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@_linked/cli": patch
---

Comments and docs describe the host app generically.
5 changes: 5 additions & 0 deletions .changeset/land-build-order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@_linked/cli': patch
---

One dependency order for release PRs, `checkout` and `branch land`, with the build tool ordered as `linked build-all` orders it: the build tool's own dependencies, then the build tool (`@_linked/cli`), then everything else. The packages that devDepend on the build tool while it depends on one of them (`@_linked/core`) formed a cycle, which fell back to name order and could put a package before the build tool. `branch land` therefore built such a package with the old build tool. When the build tool fails to build in `branch land`, the packages after it are not built (and so not pushed).
5 changes: 5 additions & 0 deletions .changeset/namespace-iri-characters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@_linked/cli": patch
---

`linkedOntologies` namespaces and the namespaces of `linked.app.json` prefixes refuse the characters that cannot appear in a SPARQL or Turtle IRI (`<`, `>`, `"`, `{`, `}`, `|`, `^`, backtick, backslash, whitespace and control characters). `NAMESPACE_IRI` is exported from `utils/ontologyConfig`.
23 changes: 23 additions & 0 deletions .changeset/ontology-index-and-app-prefixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
"@_linked/cli": major
---

One ontology index per package, and an app's own prefix map in `linked.app.json`.

**Ontology modules (breaking).** `linked generate-ontology` writes, per package:

- `src/ontologies/<module>.ts` for each generated ontology: only its terms, each `export const Term = {id: '<namespace>Term'};` (the value `createNameSpace(namespace)('Term')` returns). It imports nothing; use `createNameSpace` from `@_linked/core/utils/NameSpace` where code needs a namespace function.
- `src/ontologies/index.ts`: imports every ontology module of the package (those with `"generated": false` too) and registers them all with one `registerOntologies([{name, namespace, terms, data, suggestedPrefix}], import.meta.url)` call. `registerOntologies` comes from the package's `src/package.ts` (`linkedPackage(...)`), so it needs the `@_linked/core` major that provides it.
- The package entry (`src/index.ts[x]`) imports `./ontologies/index.js`; side-effect imports of a removed `<module>.register.js` become an import of the index.
- `<module>.data.ts` and `<module>.register.ts` are no longer generated: the command removes the ones it wrote before. Their exports (`ns`, `dataFiles`, `loadData`, `_ontologyResource`) are gone; import `createNameSpace` from core instead of `ns`.
- `linked build`'s ontology check also fails when the entry does not import the index or such a file is left. Run `linked generate-ontology` and commit the result.
- A module written by hand (`"generated": false`) no longer registers itself: the index does.
- `create-package --kind ontology` and `create-ontology` write this layout; the package template's `src/package.ts` exports `registerOntologies` instead of `linkedOntology`.
- The build's shape check expects a package's ontologies to register through `ontologies/index.js` (or `src/ontologies/index.ts` before it is built).
- `@_linked/cli/utils/ontologyModules`: `generateOntologyModules(specs, handWritten?)` returns every module of a package (terms modules and `src/ontologies/index.ts`); new `generateOntologyIndexModule`; `generateOntologyDataModule` and `generateOntologyRegisterModule` are removed; `OntologyModuleSpec.ontology` is removed. `generatePackageOntologies` returns `{ontologies, files, edits, remove}`.

**`linked.app.json` (new).** An app's declarative settings at its root: `{"$schema": "https://linked.cm/schema/app/1.json", "schemaVersion": 1, "prefixes": {"<prefix>": "<namespace>"}}`. The schema ships as `schema/app/1.json`; an unknown `schemaVersion` or key is refused; a prefix is `^[A-Za-z][A-Za-z0-9_]*$`.

- `linked prefixes` adds a prefix for every installed ontology whose namespace the map lacks: its suggested prefix (from its vann data), or `<prefix>_2`, `_3`, … when taken. It never changes or removes an entry, and creates the file when the app has none. `linked generate-ontology` runs it for the app the package belongs to (same git repository).
- The map is loaded into core (`Prefix.load`) at server start (`linked start` and a compiled server) and in the browser bundle (the `linked:app-prefixes` Vite plugin of `createViteConfig`; the client entry imports it first). An app with no `linked.app.json` loads nothing; a core without `Prefix.load` is warned about and left as it is.
- `linked create-app` writes `linked.app.json` and fills it after the install; the React Native template's API service has one.
17 changes: 17 additions & 0 deletions .changeset/ontology-module-and-hand-written.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@_linked/cli": minor
---

A `linkedOntologies` entry names its module and may keep its modules written by hand.

- `"module"` (optional, the same pattern as a name, default the name) is the modules' file name in `src/ontologies/`: a generated ontology's files are `<module>.ts`, `<module>.data.ts` and `<module>.register.ts`, imported as `<package>/ontologies/<module>`. The registration still uses the name: `linkedOntology(terms, ns, '<name>', …)`. Two entries with one module are refused.
- `"generated": false` (default `true`) declares an ontology whose modules hold more than the generator writes. `linked generate-ontology` writes nothing for it and `linked build` skips its staleness check, but its data must carry the same vann triples, and the build refuses it without them:

```json
"linkedOntologies": {
"core": {"namespace": "https://example.org/core/", "module": "linked-core", "generated": false}
}
```

- New pure module `@_linked/cli/utils/ontologyConfig`: `readOntologyConfigs(pkgJson)` returns `{name, namespace, module, generated, data}` per ontology, sorted by name. `OntologyConfig`, `ONTOLOGIES_KEY`, `ONTOLOGY_NAMESPACE` and `readOntologyConfigs` move there from `@_linked/cli/utils/generateOntology`.
- `OntologyModuleSpec.module` (optional) names the generated files.
22 changes: 22 additions & 0 deletions .changeset/ontology-names-and-vann-prefix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
"@_linked/cli": minor
---

Ontologies are keyed by their name within the package, and their suggested prefix is data.

- `package.json` `"linkedOntologies"` is keyed by the ontology's **name** (lowercase letters and digits, single `-` or `_` between them). The name names the modules (`src/ontologies/<name>.ts`, `.data.ts`, `.register.ts`) and is the third argument of the generated `linkedOntology(terms, ns, '<name>', loadData, dataFiles)`. It is no longer a prefix.
- `linked generate-ontology` reads the suggested prefix from the `vann:preferredNamespacePrefix` of the ontology's `owl:Ontology` node and writes `Prefix.add('<that prefix>', '<namespace>')` in `<name>.data.ts`.
- **A package without vann data now fails its build** (and `linked generate-ontology`): every ontology's `owl:Ontology` node must carry exactly one `vann:preferredNamespacePrefix` and one `vann:preferredNamespaceUri` equal to its configured `namespace`. The message names the package, the ontology and its files, and shows the triples to add. To fix it, add to one of the ontology's data files (for a published vocabulary shipped unedited, a `src/data/<name>-added.ttl` listed in its `data`):

```turtle
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix vann: <http://purl.org/vocab/vann/> .

<http://example.org/ont/> a owl:Ontology ;
vann:preferredNamespacePrefix "ex" ;
vann:preferredNamespaceUri "http://example.org/ont/" .
```

Write the prefix the package registers today, so its Turtle output does not change, then run `linked generate-ontology`.
- `create-package --kind ontology` and `create-ontology <name>` write both triples (the name as the prefix).
- API of `@_linked/cli/utils/ontologyModules` and `ontologyTerms`: `OntologyModuleSpec.prefix` is replaced by `name` and `suggestedPrefix`; `ONTOLOGY_PREFIX` by `ONTOLOGY_NAME` (lowercase only) and `SUGGESTED_PREFIX`; `OntologyConfig.prefix` by `name`; `OntologyNameCollisionError.prefix` by `ontologyName`. `ontologyTermsFromQuads` also returns `preferredPrefixes` and `preferredNamespaces`; new `ontologySuggestedPrefix(result, namespace)` and `OntologyVannError`.
Loading
Loading