Skip to content

Commit 44d48a3

Browse files
authored
fix: add typecheck script to backend (#313)
1 parent 1321ff6 commit 44d48a3

File tree

5 files changed

+64
-67
lines changed

5 files changed

+64
-67
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
"build": "pnpm -r run build",
1111
"publish:playgrounds": "pnpm pkg-pr-new publish './playgrounds/*' ./packages/cli --template './templates/*' --peerDeps",
1212
"format": "prettier --write --cache .",
13-
"lint": "eslint --cache .",
14-
"typecheck": "tsc -p scripts --noEmit && pnpm -r --parallel run typecheck",
13+
"lint": "pnpm run \"/lint:.*/\"",
14+
"lint:js": "eslint --cache .",
15+
"lint:format": "prettier --check --cache .",
16+
"lint:types": "pnpm -r --parallel run typecheck",
1517
"release": "tsx script/release.ts",
1618
"test": "tsx e2e/publish.test.mts"
1719
},

packages/backend/package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,30 @@
88
"dev": "nitro dev",
99
"vendor:octokit": "tsx script/octokit.ts",
1010
"prepare": "nitro prepare && pnpm vendor:octokit",
11-
"preview": "wrangler pages dev dist "
11+
"preview": "wrangler pages dev dist ",
12+
"typecheck": "tsc --noEmit"
1213
},
1314
"devDependencies": {
1415
"@cloudflare/workers-types": "^4.20240512.0",
1516
"@octokit/action": "^6.1.0",
1617
"@octokit/app": "^14.1.0",
18+
"@octokit/openapi-types": "^22.2.0",
19+
"@octokit/types": "^13.5.0",
20+
"@octokit/webhooks-types": "^7.4.0",
21+
"@octokit/oauth-app": "^6.1.0",
22+
"@octokit/auth-app": "^6.0.4",
23+
"@octokit/webhooks": "^12.2.0",
24+
"@octokit/auth-unauthenticated": "^5.0.1",
25+
"@octokit/core": "^5.1.0",
26+
"h3": "^1.11.1",
1727
"@pkg-pr-new/utils": "workspace:^",
1828
"dotenv": "^16.4.5",
1929
"fast-jwt": "^4.0.2",
2030
"nitro-cloudflare-dev": "0.1.2",
2131
"nitropack": "^2.9.6",
2232
"octokit": "^3.2.1",
2333
"query-registry": "^3.0.1",
24-
"wrangler": "^3.57.1"
34+
"wrangler": "^3.57.1",
35+
"unstorage": "^1.10.2"
2536
}
2637
}

packages/backend/server/utils/bucket.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { prefixStorage, createStorage, joinKeys } from "unstorage";
22
import cloudflareR2BindingDriver from "unstorage/drivers/cloudflare-r2-binding";
3+
import { getR2Binding } from "unstorage/drivers/utils/cloudflare";
34
import { WorkflowData, Cursor } from "../types";
45
import type { H3EventContext } from "h3";
56

@@ -9,11 +10,11 @@ type Event = { context: { cloudflare: H3EventContext["cloudflare"] } };
910
export const baseKey = "bucket";
1011

1112
export function useBinding(event: Event) {
12-
return getBinding(
13+
return getR2Binding(
1314
event.context.cloudflare.env.ENV === "production"
1415
? "PROD_CR_BUCKET"
1516
: "CR_BUCKET",
16-
) as unknown as R2Bucket;
17+
);
1718
}
1819

1920
export async function setItemStream(

packages/backend/server/utils/driver.ts

Lines changed: 0 additions & 47 deletions
This file was deleted.

pnpm-lock.yaml

Lines changed: 44 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)