Skip to content

Commit 3b9bbca

Browse files
ellyxirEllyse
andauthored
Storage refactor (#526)
* first pass refactor moving storage.ts from common-charm to common-runner, unit tests pass, still running integration testing * added env AI_URL which allows you to use local toolshed but point the AI endpoints to another environment * add dummy test since CI is complaining * breaking out imports to individual files rather than using index.ts * modified common-cli/main.ts import to point to common-memory/src/storage.ts --------- Co-authored-by: Ellyse <ellyse@common.tools>
1 parent 93b96cb commit 3b9bbca

File tree

13 files changed

+34
-26
lines changed

13 files changed

+34
-26
lines changed

typescript/packages/common-charm/src/charm.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ import {
1919
isCell,
2020
run,
2121
} from "@commontools/runner";
22-
import { storage } from "./storage.ts";
2322
import { syncRecipeBlobby } from "./syncRecipe.ts";
24-
import { getSpace, Space } from "@commontools/runner";
23+
import { storage, getSpace, Space } from "@commontools/runner";
2524
import { DID, Identity, Signer } from "@commontools/identity";
2625

2726
export type Charm = {

typescript/packages/common-charm/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ export {
1010
saveNewRecipeVersion,
1111
} from "./iterate.ts";
1212
export { getIframeRecipe, type IFrameRecipe } from "./iframe/recipe.ts";
13-
export { storage } from "./storage.ts";
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { describe } from "@std/testing/bdd";
2+
3+
describe("noop", () => {
4+
});

typescript/packages/common-cli/charm_demo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Charm, CharmManager } from "../common-charm/src/charm.ts";
99
import { Cell } from "../common-runner/src/cell.ts";
1010
import { DocImpl, getDoc } from "../common-runner/src/doc.ts";
1111
import { EntityId } from "../common-runner/src/doc-map.ts";
12-
import { storage } from "../common-charm/src/storage.ts";
12+
import { storage } from "../common-runner/src/storage.ts";
1313
import { getSpace, Space } from "../common-runner/src/space.ts";
1414
import { Identity } from "../common-identity/src/index.ts";
1515

typescript/packages/common-cli/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import {
44
CharmManager,
55
compileRecipe,
66
setBobbyServerUrl,
7-
storage,
87
} from "@commontools/charm";
9-
import { getEntityId, isStream } from "@commontools/runner";
8+
import { storage, getEntityId, isStream } from "@commontools/runner";
109
import { Identity } from "@commontools/identity";
1110

1211
const { space, charmId, recipeFile, cause, quit } = parseArgs(Deno.args, {

typescript/packages/common-runner/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ export {
4343
} from "./recipe-map.ts";
4444
export { type AddCancel, type Cancel, noOp, useCancelGroup } from "./cancel.ts";
4545
export { getSpace, type Space } from "./space.ts";
46+
export { storage } from "./storage.ts";

typescript/packages/common-charm/src/storage.ts renamed to typescript/packages/common-runner/src/storage.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
import {
2-
type AddCancel,
3-
type Cancel,
4-
Cell,
52
type DocImpl,
63
type DocLink,
7-
type EntityId,
8-
getDocByEntityId,
9-
getDocLinkOrThrow,
10-
idle,
11-
isCell,
124
isDoc,
135
isDocLink,
14-
isQueryResultForDereferencing,
15-
Space,
16-
useCancelGroup,
17-
} from "@commontools/runner";
18-
6+
} from "./doc.ts";
7+
import { type AddCancel, type Cancel, useCancelGroup } from "./cancel.ts";
8+
import { Cell, isCell } from "./cell.ts";
9+
import { type EntityId, getDocByEntityId } from "./cell-map.ts";
10+
import { getDocLinkOrThrow, isQueryResultForDereferencing } from "./query-result-proxy.ts";
11+
import { idle } from "./scheduler.ts";
12+
import { Space } from "./space.ts";
1913
import { isStatic, markAsStatic } from "@commontools/builder";
2014
import { StorageProvider, StorageValue } from "./storage/base.ts";
2115
import { RemoteStorageProvider } from "./storage/remote.ts";

0 commit comments

Comments
 (0)