Skip to content

Commit

Permalink
upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
xesrevinu committed Dec 24, 2024
1 parent 2fb9dff commit a90a340
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 30 deletions.
Binary file modified bun.lockb
Binary file not shown.
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "worker-workflow-test",
"module": "src/index.ts",
"type": "module",
"packageManager": "[email protected].34",
"packageManager": "[email protected].42",
"scripts": {
"lint": "eslint \"{src,test,scripts}/**/*.{ts,mjs}\"",
"lint-fix": "bun lint --fix",
Expand All @@ -26,36 +26,36 @@
]
},
"dependencies": {
"@effect/experimental": "^0.30.16",
"@effect/platform": "^0.69.15",
"@effect/sql": "^0.18.16",
"@effect/sql-d1": "^0.16.5",
"effect": "^3.10.9"
"@effect/experimental": "^0.36.0",
"@effect/platform": "^0.72.0",
"@effect/sql": "^0.25.0",
"@effect/sql-d1": "^0.23.0",
"effect": "^3.12.0"
},
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.5.24",
"@cloudflare/workers-types": "^4.20241022.0",
"@cloudflare/vitest-pool-workers": "^0.5.40",
"@cloudflare/workers-types": "^4.20241218.0",
"@effect/eslint-plugin": "^0.2.0",
"@effect/language-service": "^0.2.0",
"@eslint/compat": "1.1.1",
"@eslint/eslintrc": "3.1.0",
"@eslint/js": "9.11.1",
"@eslint/json": "0.5.0",
"@eslint/markdown": "6.1.1",
"@types/node": "^22.8.7",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"eslint": "^9.14.0",
"eslint-import-resolver-typescript": "^3.6.3",
"@types/node": "^22.10.2",
"@typescript-eslint/eslint-plugin": "^8.18.2",
"@typescript-eslint/parser": "^8.18.2",
"eslint": "^9.17.0",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-sort-destructure-keys": "^2.0.0",
"lefthook": "^1.8.2",
"lefthook": "^1.10.0",
"madge": "^8.0.0",
"prettier": "^3.3.3",
"typescript": "^5.6.3",
"vitest": "^2.1.4",
"wrangler": "^3.84.1"
"prettier": "^3.4.2",
"typescript": "^5.7.2",
"vitest": "^2.1.8",
"wrangler": "^3.99.0"
}
}
9 changes: 5 additions & 4 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import * as HttpApi from "@effect/platform/HttpApi"
import * as OpenApi from "@effect/platform/OpenApi"
import { AppApi } from "./delcare"

export class MyHttpApi extends HttpApi.empty.add(AppApi).annotateContext(
OpenApi.annotations({
export class MyHttpApi extends HttpApi.make("api")
.add(AppApi)
.annotateContext(OpenApi.annotations({
title: "Public Api",
description: "Public Api"
})
) {}
}))
{}
7 changes: 3 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ declare global {
type WorkflowsBinding = typeof workflows
}

const HttpLive = Layer.mergeAll(HttpAppLive).pipe(
const HttpLive = HttpApiBuilder.api(MyHttpApi).pipe(
Layer.provide([HttpAppLive]),
Layer.provide(
Workflows.fromRecord(() => workflows)
)
)

const Live = pipe(
HttpApiBuilder.Router.Live,
Layer.provideMerge(
HttpApiBuilder.api(MyHttpApi).pipe(Layer.provide(HttpLive))
),
Layer.provideMerge(HttpLive),
Layer.provideMerge(HttpPlatform.layer),
Layer.provideMerge(Etag.layerWeak),
Layer.provideMerge(Path.layer),
Expand Down
4 changes: 1 addition & 3 deletions src/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ export const runEffectWorkflow = <A, I, E = never, Env = unknown>(
const cause = exit.cause

if (Cause.isDieType(cause)) {
// biome-ignore lint/performance/noDelete: <explanation>
delete (cause.defect as any).cause

return Effect.failCause(cause)
Expand Down Expand Up @@ -479,7 +478,6 @@ export const runEffectWorkflow = <A, I, E = never, Env = unknown>(
const cause = exit.cause

if (Cause.isDieType(cause)) {
// biome-ignore lint/performance/noDelete: <explanation>
delete (cause.defect as any).cause

return Effect.failCause(cause)
Expand Down Expand Up @@ -516,7 +514,7 @@ export const runEffectWorkflow = <A, I, E = never, Env = unknown>(
console.error("parse exit error", error)
}

if (error && Cause.isCause(error)) {
if (Cause.isCause(error)) {
return Effect.failCause(error)
}

Expand Down
2 changes: 1 addition & 1 deletion worker-configuration.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated by Wrangler by running `wrangler types`

interface Env {
MY_WORKFLOW: Workflow;
MY_WORKFLOW: Workflow;
}

0 comments on commit a90a340

Please sign in to comment.