|
| 1 | +--- |
| 2 | +"@objectstack/metadata-core": minor |
| 3 | +"@objectstack/objectql": patch |
| 4 | +"@objectstack/service-automation": patch |
| 5 | +"@objectstack/service-datasource": patch |
| 6 | +--- |
| 7 | + |
| 8 | +feat(devx,datasource,automation): published `src/**` may only import workspace packages it declares (#10062) |
| 9 | + |
| 10 | +A package's non-test `src/**` was free to import any workspace package, |
| 11 | +declared or not, and nothing checked it. The class was filed with one member |
| 12 | +and a mitigation — the import was type-only, so nothing reached the emitted |
| 13 | +JavaScript and rollup-plugin-dts inlined the declaration rather than naming an |
| 14 | +unresolvable module. It grew to four members with no signal, and one of them |
| 15 | +killed the mitigation: `service-automation/src/flow-precedence.ts` **value** |
| 16 | +imports from `@objectstack/objectql`, which it does not declare, and because |
| 17 | +the shared tsup config externalises only `dependencies`/`peerDependencies`, the |
| 18 | +bundler answered by inlining objectql's implementation into |
| 19 | +`service-automation/dist/index.js` — a second copy of another package's code, |
| 20 | +kept correct by build configuration alone. |
| 21 | + |
| 22 | +`pnpm check:undeclared-dep-imports` is the gate, and the per-member fixes here |
| 23 | +are decided one at a time rather than by a uniform policy — declaring makes a |
| 24 | +coupling real and installable, routing it away removes it, and the two are not |
| 25 | +interchangeable: |
| 26 | + |
| 27 | +* **`@objectstack/service-datasource`** now declares `@objectstack/driver-sql` |
| 28 | + and `@objectstack/driver-memory` as **dependencies**. Both are loaded through |
| 29 | + an *unguarded* `await import(...)` on the postgres, mysql, sqlite and memory |
| 30 | + arms, so a consumer reaching one of those paths needed a package it was never |
| 31 | + told to install, and would have met `ERR_MODULE_NOT_FOUND` rather than a |
| 32 | + diagnosis. The three *guarded* driver arms — `@objectstack/driver-sqlite-wasm`, |
| 33 | + `@objectstack/driver-mongodb`, `@objectstack/driver-turso` — are deliberately |
| 34 | + left undeclared: each load sits in a `try`/`catch` that answers an absent |
| 35 | + package with the fault, the consequence and the install command, and each |
| 36 | + rides as an optional install. Declaring them would install them (turso drags |
| 37 | + `@libsql/client`'s native bindings) and, measured on this branch, takes a live |
| 38 | + assertion out of the tree: `default-datasource-driver-factory.test.ts` reaches |
| 39 | + the missing-package arm with no stub precisely because the package does not |
| 40 | + resolve from here. |
| 41 | +* **`@objectstack/metadata-core`** now owns the ADR-0029 D9.6 provenance pair, |
| 42 | + `isCodeArtifactBody` and `isTenantAuthored`, sunk out of |
| 43 | + `@objectstack/objectql`'s registry by the same criterion as the write-verb |
| 44 | + dispatch predicates and the audit governance table beside them: a second layer |
| 45 | + needs the answer and the reverse import would either close a cycle or make the |
| 46 | + consumer depend on the whole data engine for one predicate. `objectql` |
| 47 | + re-exports `isCodeArtifactBody` from its original path, so its public API is |
| 48 | + unchanged; `service-automation` imports it from `metadata-core`, which it |
| 49 | + already declared, and its bundle no longer carries a copy of objectql's code. |
| 50 | + |
| 51 | +Two members stay recorded rather than remediated, because the tree already |
| 52 | +carries the decision not to declare them together with its reason |
| 53 | +(`@objectstack/runtime` → `@objectstack/driver-turso`, whose bare `import()` is |
| 54 | +a host-replaceable default thunk under #6268; `@objectstack/rest` → |
| 55 | +`@objectstack/objectql`, whose absence must degrade to `501 NOT_IMPLEMENTED` |
| 56 | +rather than fail module load). Their ledger rows carry mechanical evidence and |
| 57 | +go red the moment that evidence stops holding — in particular, a `type-only` |
| 58 | +row reds on the day its import becomes a value import, which is exactly the |
| 59 | +transition nothing caught the first time. |
0 commit comments