diff --git a/examples/cloudflare-worker/Dockerfile b/examples/cloudflare-worker/Dockerfile index a5d3e5b..c641e63 100644 --- a/examples/cloudflare-worker/Dockerfile +++ b/examples/cloudflare-worker/Dockerfile @@ -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 diff --git a/package.json b/package.json index 84a326c..a32e21a 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dbdb484..dbf3637 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@cloudflare/computer': - specifier: 0.2.1 - version: 0.2.1(@platformatic/vfs@0.4.0)(supports-color@10.2.2)(zod@4.4.3) + specifier: 0.5.1 + version: 0.5.1(@cloudflare/workers-types@5.20260921.1)(@platformatic/vfs@0.4.0)(supports-color@10.2.2)(vite@8.2.1(esbuild@0.28.1)(yaml@2.9.0))(zod@4.6.7) '@platformatic/vfs': specifier: ^0.4.0 version: 0.4.0 @@ -18,12 +18,12 @@ importers: specifier: 1.41.9 version: 1.41.9 zod: - specifier: 4.4.3 - version: 4.4.3 + specifier: 4.6.7 + version: 4.6.7 devDependencies: '@cloudflare/workers-types': - specifier: 5.20260827.1 - version: 5.20260827.1 + specifier: 5.20260921.1 + version: 5.20260921.1 '@oxlint/plugins': specifier: 1.80.0 version: 1.80.0 @@ -44,24 +44,30 @@ importers: version: 4.1.11(vite@8.2.1(esbuild@0.28.1)(yaml@2.9.0)) wrangler: specifier: 4.127.0 - version: 4.127.0(@cloudflare/workers-types@5.20260827.1) + version: 4.127.0(@cloudflare/workers-types@5.20260921.1) packages: '@borewit/text-codec@0.2.2': resolution: {integrity: sha512-DDaRehssg1aNrH4+2hnj1B7vnUGEjU6OIlyRdkMd0aUdIUvKXrJfXsy8LVtXAy7DRvYVluWbMspsRhz2lcW0mQ==} - '@cloudflare/computer@0.2.1': - resolution: {integrity: sha512-jh0pa1csAExPItUYzrzBrZO1vCBjsQ6jX+aunrnKe2VSC9i8mEziQYZUL3IZId4GpceRL+v8HIzVr4kjbmQXPw==} + '@cloudflare/computer@0.5.1': + resolution: {integrity: sha512-tEA2uyZwOBnhbdBoVYLOnQFsQnAwXiUbzS8JF/2bjY4Mpcb7PXPRFAyWdfVYG0xu4eW6Ctd73v5O/Z07Fr5/Pg==} peerDependencies: + '@cloudflare/workers-types': ^4.20260616.1 || ^5.20260921.1 '@platformatic/vfs': '*' ai: ^6.0.196 || ^7.0.0 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 zod: ^4.4.3 peerDependenciesMeta: + '@cloudflare/workers-types': + optional: true '@platformatic/vfs': optional: true ai: optional: true + vite: + optional: true zod: optional: true @@ -108,8 +114,8 @@ packages: cpu: [x64] os: [win32] - '@cloudflare/workers-types@5.20260827.1': - resolution: {integrity: sha512-L5wIIHcgy67AAfe8nNmfcRHLBtO+2jva14zx1HxH2tunlteNmQvo4nYtcfef1n1MKXu3Z3xB98Fvl1BorkjFtg==} + '@cloudflare/workers-types@5.20260921.1': + resolution: {integrity: sha512-uXGGKlxIrXx9/I33MIdq1hUv+yVTKCBLIJiQ9PthEgLrqePEELYYRC75I0Qw6JUa3cYtoJI8y6ewyLYHPkIP7g==} '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} @@ -1091,8 +1097,8 @@ packages: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} - capnweb@0.8.0: - resolution: {integrity: sha512-BK/TuXUiyfLSKsmjojn70yN7oYG/JJzoURZ3tckjg5Zj2KcygPm0A5jyOlswK7SYB4f0Gh9tt+RZ132b80iLfA==} + capnweb@0.10.0: + resolution: {integrity: sha512-lQ2nlzaifkqBeNfs8RLErn7NZ8FNf3vn1W7J3nSH73edWG+0B5nHZGR51S2S9HMZEuZcEypOO469dZRY/BluFA==} chai@6.2.2: resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} @@ -1834,21 +1840,23 @@ packages: youch@4.1.0-beta.10: resolution: {integrity: sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==} - zod@4.4.3: - resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} snapshots: '@borewit/text-codec@0.2.2': {} - '@cloudflare/computer@0.2.1(@platformatic/vfs@0.4.0)(supports-color@10.2.2)(zod@4.4.3)': + '@cloudflare/computer@0.5.1(@cloudflare/workers-types@5.20260921.1)(@platformatic/vfs@0.4.0)(supports-color@10.2.2)(vite@8.2.1(esbuild@0.28.1)(yaml@2.9.0))(zod@4.6.7)': dependencies: acorn: 8.18.0 - capnweb: 0.8.0 + capnweb: 0.10.0 just-bash: 3.4.2(supports-color@10.2.2) optionalDependencies: + '@cloudflare/workers-types': 5.20260921.1 '@platformatic/vfs': 0.4.0 - zod: 4.4.3 + vite: 8.2.1(esbuild@0.28.1)(yaml@2.9.0) + zod: 4.6.7 transitivePeerDependencies: - supports-color @@ -1875,7 +1883,7 @@ snapshots: '@cloudflare/workerd-windows-64@1.20260826.1': optional: true - '@cloudflare/workers-types@5.20260827.1': {} + '@cloudflare/workers-types@5.20260921.1': {} '@cspotcode/source-map-support@0.8.1': dependencies: @@ -2487,7 +2495,7 @@ snapshots: call-bind-apply-helpers: 1.0.2 get-intrinsic: 1.3.0 - capnweb@0.8.0: {} + capnweb@0.10.0: {} chai@6.2.2: {} @@ -3254,7 +3262,7 @@ snapshots: '@cloudflare/workerd-linux-arm64': 1.20260826.1 '@cloudflare/workerd-windows-64': 1.20260826.1 - wrangler@4.127.0(@cloudflare/workers-types@5.20260827.1): + wrangler@4.127.0(@cloudflare/workers-types@5.20260921.1): dependencies: '@cloudflare/kv-asset-handler': 0.5.0 '@cloudflare/unenv-preset': 2.16.1(unenv@2.0.0-rc.24)(workerd@1.20260826.1) @@ -3265,7 +3273,7 @@ snapshots: unenv: 2.0.0-rc.24 workerd: 1.20260826.1 optionalDependencies: - '@cloudflare/workers-types': 5.20260827.1 + '@cloudflare/workers-types': 5.20260921.1 fsevents: 2.3.3 transitivePeerDependencies: - bufferutil @@ -3292,4 +3300,4 @@ snapshots: cookie: 1.1.1 youch-core: 0.3.3 - zod@4.4.3: {} + zod@4.6.7: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 2880036..e5a50ec 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -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" diff --git a/src/sync-repos.ts b/src/sync-repos.ts index 42f0db8..74fc4e4 100644 --- a/src/sync-repos.ts +++ b/src/sync-repos.ts @@ -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, @@ -94,17 +94,17 @@ let configurationRegistry: SyncConfigurationRegistry | undefined; class SyncCoordinatorBase extends DurableObject {} -const ContainerBase = withWorkspaceContainer(SyncCoordinatorBase); +const ContainerBase = withLegacyWorkspaceContainer(SyncCoordinatorBase); export class SyncCoordinator extends ContainerBase { - readonly #backend: CloudflareContainerBackend; + readonly #backend: LegacyContainerBackend; readonly #workspace: Workspace; #tail: Promise = 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", @@ -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], });