Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-monorepo",
"version": "0.9.98",
"version": "0.9.99",
"private": true,
"engines": {
"node": ">=24"
Expand Down
2 changes: 1 addition & 1 deletion packages/data-ai/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adobe-data-ai",
"version": "0.9.98",
"version": "0.9.99",
"description": "Architecture skills for @adobe/data — data-oriented modelling, archetype iteration, hot-path performance, and related conventions.",
"author": {
"name": "Adobe"
Expand Down
2 changes: 1 addition & 1 deletion packages/data-ai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-ai",
"version": "0.9.98",
"version": "0.9.99",
"description": "Cross-agent architecture skills for @adobe/data — installable as a Claude Code plugin or copied into any Agent-Skills-compatible agent (Cursor, Codex).",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-gpu-hopper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-gpu-hopper",
"version": "0.9.98",
"version": "0.9.99",
"description": "Hopper sample - real-time ECS game rendered as colored cubes via @adobe/data-gpu",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-gpu-samples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-gpu-samples",
"version": "0.9.98",
"version": "0.9.99",
"description": "WebGPU samples built on @adobe/data-gpu",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-gpu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-gpu",
"version": "0.9.98",
"version": "0.9.99",
"description": "Adobe data WebGPU plugins and types for graphics and compute",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-lit-space-rock-game/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-lit-space-rock-game",
"version": "0.9.98",
"version": "0.9.99",
"description": "Space Rock Game sample - real-time ECS game with Lit and @adobe/data",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-lit-tictactoe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-lit-tictactoe",
"version": "0.9.98",
"version": "0.9.99",
"description": "Tic-Tac-Toe sample - Lit web components with @adobe/data-lit and AgenticService",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-lit-todo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-lit-todo",
"version": "0.9.98",
"version": "0.9.99",
"description": "Todo application - Lit web components with @adobe/data ECS",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-lit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-lit",
"version": "0.9.98",
"version": "0.9.99",
"description": "Adobe data Lit bindings - hooks, elements, decorators",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-p2p-tictactoe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-p2p-tictactoe",
"version": "0.9.98",
"version": "0.9.99",
"description": "Serverless P2P tic-tac-toe — WebRTC DataChannel + @adobe/data-sync",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-persistence/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-persistence",
"version": "0.9.98",
"version": "0.9.99",
"description": "Worker-based incremental persistence layer for @adobe/data ECS over OPFS (browser) and node:fs (server).",
"type": "module",
"sideEffects": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-react-hello/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-react-hello",
"version": "0.9.98",
"version": "0.9.99",
"description": "Hello World sample - click counter using @adobe/data-react",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-react-pixie/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-react-pixie",
"version": "0.9.98",
"version": "0.9.99",
"description": "PixiJS React sample - ECS sprites (bunny, fox) with @adobe/data-react",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-react",
"version": "0.9.98",
"version": "0.9.99",
"description": "Adobe data React bindings — hooks and context for ECS database",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-solid-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-solid-dashboard",
"version": "0.9.98",
"version": "0.9.99",
"description": "Mini dashboard sample — multiple components sharing one @adobe/data ECS database with SolidJS",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-solid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-solid",
"version": "0.9.98",
"version": "0.9.99",
"description": "Adobe data SolidJS bindings — context and provider for ECS database",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-sync/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-sync",
"version": "0.9.98",
"version": "0.9.99",
"description": "Multi-user real-time synchronisation for @adobe/data ECS — server, client, and in-process loopback.",
"type": "module",
"sideEffects": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-testing",
"version": "0.9.98",
"version": "0.9.99",
"description": "Conformance-testing utilities (Match + Conformance runners) for @adobe/data ECS features",
"type": "module",
"sideEffects": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data",
"version": "0.9.98",
"version": "0.9.99",
"description": "Adobe data oriented programming library",
"type": "module",
"sideEffects": false,
Expand Down
31 changes: 31 additions & 0 deletions packages/data/src/cache/blob-ref-namespace.type-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// © 2026 Adobe. MIT License. See /LICENSE for details.

import { BlobRef } from "./blob-store.js";
import { Schema } from "../schema/index.js";
import { Nullable } from "../schema/nullable.js";
import type { Assert } from "../types/assert.js";
import type { Equal } from "../types/equal.js";

/**
* The namespaced `BlobRef` exposes `schema` and `is` under the type's own name,
* so consumers reach them without importing the standalone `BlobRefSchema` /
* `isBlobRef` — mirroring `BlobHandle` / `BlobMeta`.
*/

// `BlobRef.schema` is a Schema whose `ToType` is exactly `BlobRef`.
type _SchemaMatchesType = Assert<Equal<Schema.ToType<typeof BlobRef.schema>, BlobRef>>;

// `BlobRef.is` is the type guard.
function narrows(value: unknown) {
if (BlobRef.is(value)) {
const _ok: BlobRef = value;
}
}

// An ECS component that stores a BlobRef has no natural empty value; the honest
// model is a nullable column with a `null` default — no `as unknown as` cast.
const imageComponent = { ...Nullable(BlobRef.schema), default: null } as const;
type _NullableType = Assert<Equal<
Schema.ToType<typeof imageComponent>,
BlobRef | null
>>;
15 changes: 15 additions & 0 deletions packages/data/src/cache/blob-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ export function isBlobRef(value: unknown): value is BlobRef {
return isRemoteBlobRef(value) || isLocalBlobRef(value);
}

/**
* Namespaced surface for {@link BlobRef}, mirroring `BlobHandle` / `BlobMeta`
* in `../blob/`. Lets consumers reach the schema and guard through the type's
* own name — `BlobRef.schema`, `BlobRef.is(x)` — instead of importing the
* standalone `BlobRefSchema` / `isBlobRef`. An ECS component that stores a
* BlobRef has no natural empty value, so model the column as
* `Nullable(BlobRef.schema)` with a `null` default (no cast) rather than a
* `null as unknown as BlobRef` placeholder.
*/
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace BlobRef {
export const schema = BlobRefSchema;
export const is = isBlobRef;
}

function isRemoteUrl(url: string): url is RemoteUrl {
return url.startsWith(remoteUrlPrefix);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/data/src/cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export {
type BlobStore,
type BlobRef,
BlobRef,
blobStore,
isBlobRef,
BlobRefSchema,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// © 2026 Adobe. MIT License. See /LICENSE for details.

import { createPlugin } from "./create-plugin.js";
import { Database } from "./database.js";
import type { Observe } from "../../observe/index.js";
import type { Assert } from "../../types/assert.js";
import type { Equal } from "../../types/equal.js";

/**
* Regression: action inference must survive when `computed` and `actions` are
* declared in the SAME `Database.Plugin.create` call.
*
* The bug: the `computed` factory's `db` type referenced the plugin's OWN
* action declarations (`AD`) — the same type parameter being inferred from the
* `actions` property. That self-reference made `AD` un-inferable whenever a
* sibling `computed` was present in the same call, so it collapsed to `{}` and
* every action vanished (`db.actions.x` → TS2339 on `ToActionFunctions<{}>`).
* Splitting the facets across layered `create`s hid the bug because each layer
* inferred `AD` in isolation.
*
* The fix: a `computed` factory's `db` surfaces only the BASE plugin's actions
* (`XP['actions'] & IP['actions']`), never the same-call `actions`. Those are
* declared AFTER `computed` in the enforced property order, so reading one from
* a sibling computed was always a forward reference — the action factory `db`
* already excludes them for the same reason.
*/

// ============================================================================
// 1. POSITIVE — computed + actions in one create; actions stay fully typed.
// ============================================================================

const combined = createPlugin({
components: { count: { type: "number" } },
computed: {
doubled: (_db): Observe<number> => (() => () => {}),
},
actions: {
bump: (_db, _n: number) => { },
},
});

function combinedActionsAreCallable() {
const db = Database.create(combined);
db.actions.bump(1); // was TS2339 before the fix
}

// The declared action survives into the resolved database surface — before the
// fix this key was absent (the action map collapsed to `{}`).
type _ActionResolved = Assert<Equal<
"bump" extends keyof Database.FromPlugin<typeof combined>["actions"] ? true : false,
true
>>;

// Negative guard: a genuinely-absent action is still rejected.
function combinedRejectsUnknownAction() {
const db = Database.create(combined);
// @ts-expect-error — `nope` was never declared.
db.actions.nope();
}

// ============================================================================
// 2. Layered create (control) — always worked; must keep working.
// ============================================================================

const base = createPlugin({ components: { count: { type: "number" } } });
const withComputed = createPlugin({
extends: base,
computed: { doubled: (_db): Observe<number> => (() => () => {}) },
});
const withActions = createPlugin({
extends: withComputed,
actions: { bump: (_db, _n: number) => { } },
});

function layeredActionsAreCallable() {
const db = Database.create(withActions);
db.actions.bump(1);
}

// ============================================================================
// 3. Semantics — a computed sees BASE actions but not same-create siblings.
// ============================================================================

const actionBase = createPlugin({
components: { count: { type: "number" } },
actions: { baseAct: (_db) => { } },
});

createPlugin({
extends: actionBase,
computed: {
// A computed CAN compose on a base plugin's already-resolved action.
readsBaseAction: (db): Observe<unknown> => {
db.actions.baseAct();
return (() => () => {});
},
},
actions: {
siblingAct: (_db) => { },
},
});

createPlugin({
components: { count: { type: "number" } },
computed: {
noSiblingActions: (db): Observe<unknown> => {
// @ts-expect-error — a same-create sibling action is a forward
// reference (actions are declared after computed) and must be absent.
db.actions.siblingAct2();
return (() => () => {});
},
},
actions: {
siblingAct2: (_db) => { },
},
});
Loading