fix(store): drop unreachable legacy StoreRuntime fallback

Fix round 2 for task 1: store-codegen.ts stopped emitting runtime:
"legacy" actions in round 1, making the StoreRuntime variant and its
resolution fallback dead. Narrows StoreRuntime to three variants and
adds a regression test for the remaining options.runtime -> shared
fallback chain.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-20 00:58:26 +05:30
co-authored by Claude Opus 5
parent b7796b103a
commit d19595c7ba
3 changed files with 43 additions and 3 deletions
+1 -2
View File
@@ -382,8 +382,7 @@ export function createStoreInstance<
const definitions = Array.isArray(rawDefinitions) ? rawDefinitions : [rawDefinitions];
const selected =
definitions.find((entry) => entry.runtime === options.runtime) ??
definitions.find((entry) => entry.runtime === "shared") ??
definitions.find((entry) => entry.runtime === "legacy");
definitions.find((entry) => entry.runtime === "shared");
if (!selected) continue;
Reflect.set(actions, name, async (...args: unknown[]) => {
currentAction = name;
+1 -1
View File
@@ -1,5 +1,5 @@
export type StoreKind = "global" | "page";
export type StoreRuntime = "shared" | "client" | "server" | "legacy";
export type StoreRuntime = "shared" | "client" | "server";
export type PersistenceStorage = "memory" | "session" | "local";
/** Broad callable constraint that preserves each action's concrete parameters and return type. */
export type StoreFunction = (...args: any[]) => unknown;