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 examples/cloudflare-worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/cloudflare/computer-computerd-linux-x64:0.2.1 AS computerd
FROM ghcr.io/cloudflare/computer-computerd-linux-x64:0.5.1 AS computerd

FROM debian:stable-slim

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "artifacts-sync",
"version": "0.0.3",
"version": "0.0.4",
"description": "Size-aware Git synchronization between GitHub and Cloudflare Artifacts",
"license": "Apache-2.0",
"repository": {
Expand Down Expand Up @@ -37,13 +37,13 @@
"types:example": "wrangler types --include-runtime false --config examples/cloudflare-worker/wrangler.jsonc examples/cloudflare-worker/worker-configuration.d.ts"
},
"dependencies": {
"@cloudflare/computer": "0.2.1",
"@cloudflare/computer": "0.5.1",
"@platformatic/vfs": "^0.4.0",
"isomorphic-git": "1.41.9",
"zod": "4.4.3"
"zod": "4.6.7"
},
"devDependencies": {
"@cloudflare/workers-types": "5.20260827.1",
"@cloudflare/workers-types": "5.20260921.1",
"@oxlint/plugins": "1.80.0",
"oxfmt": "0.65.0",
"oxlint": "1.80.0",
Expand Down
54 changes: 31 additions & 23 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ allowBuilds:
node-liblzma: false
workerd: true
minimumReleaseAgeExclude:
- "@cloudflare/computer@0.2.1"
- "@cloudflare/workers-types@5.20260827.1"
- "@cloudflare/computer@0.5.1"
- "@cloudflare/workers-types@5.20260921.1"
19 changes: 8 additions & 11 deletions src/sync-repos.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type DurableObjectStorageLike, Workspace, WorkspaceProxy } from "@cloudflare/computer";
import { Workspace, WorkspaceProxy } from "@cloudflare/computer";
import {
CloudflareContainerBackend,
withWorkspaceContainer,
} from "@cloudflare/computer/backends/container";
LegacyContainerBackend,
withLegacyWorkspaceContainer,
} from "@cloudflare/computer/backends/container-legacy";
import { createGitClient } from "@cloudflare/computer/git";
import {
DurableObject,
Expand Down Expand Up @@ -94,17 +94,17 @@ let configurationRegistry: SyncConfigurationRegistry | undefined;

class SyncCoordinatorBase extends DurableObject<SyncRuntimeEnv> {}

const ContainerBase = withWorkspaceContainer(SyncCoordinatorBase);
const ContainerBase = withLegacyWorkspaceContainer(SyncCoordinatorBase);

export class SyncCoordinator extends ContainerBase {
readonly #backend: CloudflareContainerBackend;
readonly #backend: LegacyContainerBackend;
readonly #workspace: Workspace;
#tail: Promise<void> = Promise.resolve();

constructor(ctx: DurableObjectState, env: SyncRuntimeEnv) {
super(ctx, env);
requireConfigurationRegistry();
this.#backend = new CloudflareContainerBackend({
this.#backend = new LegacyContainerBackend({
container: () => this,
workspace: {
binding: "SYNC_COORDINATOR",
Expand All @@ -114,10 +114,7 @@ export class SyncCoordinator extends ContainerBase {
});
try {
this.#workspace = new Workspace({
// SAFETY: Computer only uses the Durable Object storage, sync, and SQL surface.
// Cloudflare's generic SQL row signature is wider than Computer's local interface.
// oxlint-disable-next-line typescript/no-unsafe-type-assertion
storage: this.ctx.storage as DurableObjectStorageLike,
storage: this.ctx.storage,
git: createGitClient(),
backends: [this.#backend],
});
Expand Down
Loading