diff --git a/apps/relay/package.json b/apps/relay/package.json index 239090b..928b41a 100644 --- a/apps/relay/package.json +++ b/apps/relay/package.json @@ -41,6 +41,8 @@ "dotenv": "^16.4.5", "ethers": "^6.12.1", "fastify": "^4.27.0", + "hono": "^4.4.3", + "hono-rate-limiter": "^0.3.0", "ioredis": "^5.4.1", "siwe": "^2.3.2", "undici": "^6.18.0", diff --git a/apps/relay/src/channel.ts b/apps/relay/src/channel.ts index 37d9096..1df1d75 100644 --- a/apps/relay/src/channel.ts +++ b/apps/relay/src/channel.ts @@ -21,6 +21,7 @@ const { baseUrl, authKey } = getConfig() export const channel = new Hono().use( rateLimiter({ + keyGenerator: () => crypto.randomUUID(), limit: 1000, }), channelMiddleware, diff --git a/examples/frontend-only/turbo.json b/examples/frontend-only/turbo.json index 9877c79..63a4f09 100644 --- a/examples/frontend-only/turbo.json +++ b/examples/frontend-only/turbo.json @@ -3,7 +3,7 @@ "extends": ["//"], "pipeline": { "build": { - "dependsOn": ["@fc-auth/core#build"], + "dependsOn": ["@fc-auth/core#build", "@fc-auth/react#build"], "inputs": [ "src/**", "vite.config.ts", diff --git a/examples/with-next-auth/package.json b/examples/with-next-auth/package.json index f8c08e7..4ec7cae 100644 --- a/examples/with-next-auth/package.json +++ b/examples/with-next-auth/package.json @@ -9,6 +9,7 @@ "lint": "next lint" }, "dependencies": { + "@fc-auth/core": "workspace:*", "@fc-auth/react": "workspace:*", "@tanstack/react-query": "^5.37.1", "ethers": "^6.12.1", diff --git a/examples/with-next-auth/turbo.json b/examples/with-next-auth/turbo.json index ab42178..3c62e02 100644 --- a/examples/with-next-auth/turbo.json +++ b/examples/with-next-auth/turbo.json @@ -3,7 +3,7 @@ "extends": ["//"], "pipeline": { "build": { - "dependsOn": ["@fc-auth/core#build"], + "dependsOn": ["@fc-auth/core#build", "@fc-auth/react#build"], "inputs": [ "src/**", "vite.config.ts", diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json index edc8c64..b248a38 100644 --- a/packages/react/tsconfig.json +++ b/packages/react/tsconfig.json @@ -1,5 +1,5 @@ { "extends": "./tsconfig.build.json", "include": ["src/**/*.ts", "src/**/*.tsx", "test/**/*.ts"], - "exclude": [] + "exclude": ["vite.config.ts"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0671276..7eae625 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -92,6 +92,12 @@ importers: fastify: specifier: ^4.27.0 version: 4.27.0 + hono: + specifier: ^4.4.3 + version: 4.4.3 + hono-rate-limiter: + specifier: ^0.3.0 + version: 0.3.0(hono@4.4.3) ioredis: specifier: ^5.4.1 version: 5.4.1 @@ -215,6 +221,9 @@ importers: examples/with-next-auth: dependencies: + '@fc-auth/core': + specifier: workspace:* + version: link:../../packages/core '@fc-auth/react': specifier: workspace:* version: link:../../packages/react @@ -8646,6 +8655,19 @@ packages: minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 + /hono-rate-limiter@0.3.0(hono@4.4.3): + resolution: {integrity: sha512-QUS1N+DCZs8CKjpoHugvEvAp/+e+LUllPPnaIlATK9GyT26niQxn4H4V+O5kHwcsXjD3P3JOc0jMb7fnW6gpFQ==} + peerDependencies: + hono: ^4.1.1 + dependencies: + hono: 4.4.3 + dev: false + + /hono@4.4.3: + resolution: {integrity: sha512-G7rTruKzrHXPz1KB4B50deKydPA9+aeei+WC1hikP0abN9N+a6yORuweageaqWocYfYNkpoqA5ezGV2mzQasvw==} + engines: {node: '>=16.0.0'} + dev: false + /hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: true