From 88b5361dc0b11b7130f527d69ce3c3045189a7c8 Mon Sep 17 00:00:00 2001 From: Vladyslav Dalechyn Date: Tue, 9 Jul 2024 02:36:45 +0300 Subject: [PATCH 01/18] feat: signatures latest spec update (#398) * refactor: update `.signature` handler to the latest spec * fix: `Button.Signature` invalid `post_url` generation --- .changeset/loud-camels-try.md | 5 +++++ .changeset/sharp-crabs-own.md | 12 ++++++++++++ playground/src/signature.tsx | 1 - src/types/signature.ts | 13 +++---------- src/utils/getSignatureContext.ts | 4 +--- src/utils/parseIntents.ts | 6 +++++- 6 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 .changeset/loud-camels-try.md create mode 100644 .changeset/sharp-crabs-own.md diff --git a/.changeset/loud-camels-try.md b/.changeset/loud-camels-try.md new file mode 100644 index 00000000..0d88f2c8 --- /dev/null +++ b/.changeset/loud-camels-try.md @@ -0,0 +1,5 @@ +--- +"frog": patch +--- + +Fixed a bug where `Button.Signature` would not set a correct `post_url`. diff --git a/.changeset/sharp-crabs-own.md b/.changeset/sharp-crabs-own.md new file mode 100644 index 00000000..c02c58ea --- /dev/null +++ b/.changeset/sharp-crabs-own.md @@ -0,0 +1,12 @@ +--- +"frog": minor +--- + +Removed `chainId` property from the `.signature` handler response. [See more](https://warpcast.notion.site/Frames-Wallet-Signatures-debe97a82e2643d094d4088f1badd791). +```diff +app.signature('/sign', (c) => + c.signTypedData({ +- chainId: 'eip155:8543', + /**/ + }) +``` diff --git a/playground/src/signature.tsx b/playground/src/signature.tsx index d7be3a43..7ee3afb1 100644 --- a/playground/src/signature.tsx +++ b/playground/src/signature.tsx @@ -19,7 +19,6 @@ export const app = new Frog({ verify: 'silent', title: 'Signature' }) // Sign Typed Data .signature('/sign', (c) => c.signTypedData({ - chainId: 'eip155:84532', domain: { name: 'Ether Mail', version: '1', diff --git a/src/types/signature.ts b/src/types/signature.ts index 96120b69..305e8645 100644 --- a/src/types/signature.ts +++ b/src/types/signature.ts @@ -1,16 +1,10 @@ import type { TypedData, TypedDataDefinition } from 'viem' -import type { ChainIdEip155, ChainNamespace } from './transaction.js' - import type { TypedResponse } from './response.js' -export type SignatureParameters = { - /** A CAIP-2 Chain ID to identify the signature network. */ - chainId: `${ChainNamespace}:${ChainIdEip155}` -} & EthSignTypedDataV4Schema +export type SignatureParameters = EthSignTypedDataV4Schema -export type SignatureResponse = Pick & - EthSignTypedDataV4Schema +export type SignatureResponse = EthSignTypedDataV4Schema export type EthSignTypedDataV4Parameters< typedData extends TypedData | Record, @@ -37,8 +31,7 @@ export type SignatureResponseFn = ( export type SignTypedDataParameters< typedData extends TypedData | Record, primaryType extends keyof typedData | 'EIP712Domain', -> = Pick & - EthSignTypedDataV4Parameters +> = EthSignTypedDataV4Parameters export type SignTypedDataResponseFn = < const typedData extends TypedData | Record, diff --git a/src/utils/getSignatureContext.ts b/src/utils/getSignatureContext.ts index a0b9a3b6..2f3f096a 100644 --- a/src/utils/getSignatureContext.ts +++ b/src/utils/getSignatureContext.ts @@ -70,11 +70,10 @@ export function getSignatureContext< previousState, req, res(parameters) { - const { chainId, method, params } = parameters + const { method, params } = parameters const { domain, types, primaryType, message } = params const response: SignatureResponse = { - chainId, method, params: { domain, @@ -90,7 +89,6 @@ export function getSignatureContext< signTypedData(parameters) { return this.res({ params: parameters as any, - chainId: parameters.chainId, method: 'eth_signTypedData_v4', }) }, diff --git a/src/utils/parseIntents.ts b/src/utils/parseIntents.ts index 08e63339..ef99ccf5 100644 --- a/src/utils/parseIntents.ts +++ b/src/utils/parseIntents.ts @@ -67,7 +67,11 @@ function parseIntent( index: counter.button++, } - if (value?.startsWith(buttonPrefix.transaction) && node.props.target) { + if ( + (value?.startsWith(buttonPrefix.transaction) || + value?.startsWith(buttonPrefix.signature)) && + node.props.target + ) { const search = (node.props.target ?? '').split('?')[1] buttonProps.target = node.props.target?.startsWith('http') ? node.props.target From 41d9acb0cb0a1e28f2543f2f09d9debdfa055894 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:40:10 +0300 Subject: [PATCH 02/18] chore: version packages (#399) Co-authored-by: github-actions[bot] --- .changeset/loud-camels-try.md | 5 ----- .changeset/sharp-crabs-own.md | 12 ------------ src/CHANGELOG.md | 17 +++++++++++++++++ src/package.json | 7 +++++-- src/version.ts | 2 +- 5 files changed, 23 insertions(+), 20 deletions(-) delete mode 100644 .changeset/loud-camels-try.md delete mode 100644 .changeset/sharp-crabs-own.md diff --git a/.changeset/loud-camels-try.md b/.changeset/loud-camels-try.md deleted file mode 100644 index 0d88f2c8..00000000 --- a/.changeset/loud-camels-try.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"frog": patch ---- - -Fixed a bug where `Button.Signature` would not set a correct `post_url`. diff --git a/.changeset/sharp-crabs-own.md b/.changeset/sharp-crabs-own.md deleted file mode 100644 index c02c58ea..00000000 --- a/.changeset/sharp-crabs-own.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -"frog": minor ---- - -Removed `chainId` property from the `.signature` handler response. [See more](https://warpcast.notion.site/Frames-Wallet-Signatures-debe97a82e2643d094d4088f1badd791). -```diff -app.signature('/sign', (c) => - c.signTypedData({ -- chainId: 'eip155:8543', - /**/ - }) -``` diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 85479513..eb2bb4bf 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,5 +1,22 @@ # frog +## 0.13.0 + +### Minor Changes + +- [#398](https://github.com/wevm/frog/pull/398) [`88b5361`](https://github.com/wevm/frog/commit/88b5361dc0b11b7130f527d69ce3c3045189a7c8) Thanks [@dalechyn](https://github.com/dalechyn)! - Removed `chainId` property from the `.signature` handler response. [See more](https://warpcast.notion.site/Frames-Wallet-Signatures-debe97a82e2643d094d4088f1badd791). + ```diff + app.signature('/sign', (c) => + c.signTypedData({ + - chainId: 'eip155:8543', + /**/ + }) + ``` + +### Patch Changes + +- [#398](https://github.com/wevm/frog/pull/398) [`88b5361`](https://github.com/wevm/frog/commit/88b5361dc0b11b7130f527d69ce3c3045189a7c8) Thanks [@dalechyn](https://github.com/dalechyn)! - Fixed a bug where `Button.Signature` would not set a correct `post_url`. + ## 0.12.3 ### Patch Changes diff --git a/src/package.json b/src/package.json index 06fb64d1..ab2f2abc 100644 --- a/src/package.json +++ b/src/package.json @@ -1,7 +1,7 @@ { "name": "frog", "description": "Framework for Farcaster Frames", - "version": "0.12.3", + "version": "0.13.0", "type": "module", "module": "_lib/index.js", "types": "_lib/index.d.ts", @@ -121,7 +121,10 @@ "license": "MIT", "homepage": "https://frog.fm", "repository": "wevm/frog", - "authors": ["awkweb.eth", "jxom.eth"], + "authors": [ + "awkweb.eth", + "jxom.eth" + ], "funding": [ { "type": "github", diff --git a/src/version.ts b/src/version.ts index 18f10252..11d7a57f 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '0.12.3' +export const version = '0.13.0' From d994a4432e136ce5bcfcf47d05fd0367fcfc4cb7 Mon Sep 17 00:00:00 2001 From: Vladyslav Dalechyn Date: Tue, 9 Jul 2024 02:44:47 +0300 Subject: [PATCH 03/18] nit: lint (#400) --- src/package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/package.json b/src/package.json index ab2f2abc..9cde8e6c 100644 --- a/src/package.json +++ b/src/package.json @@ -121,10 +121,7 @@ "license": "MIT", "homepage": "https://frog.fm", "repository": "wevm/frog", - "authors": [ - "awkweb.eth", - "jxom.eth" - ], + "authors": ["awkweb.eth", "jxom.eth"], "funding": [ { "type": "github", From 5cd9839c65165eb5ef793612f08ea856c9f15fa9 Mon Sep 17 00:00:00 2001 From: Vladyslav Dalechyn Date: Tue, 9 Jul 2024 03:19:43 +0300 Subject: [PATCH 04/18] fix: `bigint` message sign (#401) * fix: signing typed data with `bigint`s * chore: changesets --- .changeset/happy-pigs-press.md | 5 +++++ playground/src/signature.tsx | 3 +++ src/frog-base.tsx | 8 +++++++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/happy-pigs-press.md diff --git a/.changeset/happy-pigs-press.md b/.changeset/happy-pigs-press.md new file mode 100644 index 00000000..4bec7fc6 --- /dev/null +++ b/.changeset/happy-pigs-press.md @@ -0,0 +1,5 @@ +--- +"frog": patch +--- + +Fixed an issue with serializing typed data messages that have `bigint` fields. diff --git a/playground/src/signature.tsx b/playground/src/signature.tsx index 7ee3afb1..46617893 100644 --- a/playground/src/signature.tsx +++ b/playground/src/signature.tsx @@ -29,6 +29,7 @@ export const app = new Frog({ verify: 'silent', title: 'Signature' }) Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, + { name: 'balance', type: 'uint256' }, ], Mail: [ { name: 'from', type: 'Person' }, @@ -41,10 +42,12 @@ export const app = new Frog({ verify: 'silent', title: 'Signature' }) from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + balance: 0n, }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + balance: 1n, }, contents: 'Hello, Bob!', }, diff --git a/src/frog-base.tsx b/src/frog-base.tsx index ba949b05..8f5381c2 100644 --- a/src/frog-base.tsx +++ b/src/frog-base.tsx @@ -1049,7 +1049,13 @@ export class FrogBase< return c.json({ message: response.error.message }) } - return c.json(response.data) + return c.text( + JSON.stringify(response.data, (_, value) => + typeof value === 'bigint' ? value.toString() : value, + ), + 200, + { 'Content-Type': 'application/json' }, + ) }) return this From 7735a24787f53915723c63d6e8267b11d0a63eac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 03:22:42 +0300 Subject: [PATCH 05/18] chore: version packages (#402) * chore: version packages * Update src/package.json --------- Co-authored-by: github-actions[bot] Co-authored-by: Vladyslav Dalechyn --- .changeset/happy-pigs-press.md | 5 ----- src/CHANGELOG.md | 6 ++++++ src/package.json | 2 +- src/version.ts | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 .changeset/happy-pigs-press.md diff --git a/.changeset/happy-pigs-press.md b/.changeset/happy-pigs-press.md deleted file mode 100644 index 4bec7fc6..00000000 --- a/.changeset/happy-pigs-press.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"frog": patch ---- - -Fixed an issue with serializing typed data messages that have `bigint` fields. diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index eb2bb4bf..d23def7d 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,5 +1,11 @@ # frog +## 0.13.1 + +### Patch Changes + +- [#401](https://github.com/wevm/frog/pull/401) [`5cd9839`](https://github.com/wevm/frog/commit/5cd9839c65165eb5ef793612f08ea856c9f15fa9) Thanks [@dalechyn](https://github.com/dalechyn)! - Fixed an issue with serializing typed data messages that have `bigint` fields. + ## 0.13.0 ### Minor Changes diff --git a/src/package.json b/src/package.json index 9cde8e6c..0a8151ea 100644 --- a/src/package.json +++ b/src/package.json @@ -1,7 +1,7 @@ { "name": "frog", "description": "Framework for Farcaster Frames", - "version": "0.13.0", + "version": "0.13.1", "type": "module", "module": "_lib/index.js", "types": "_lib/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 11d7a57f..e622a425 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '0.13.0' +export const version = '0.13.1' From 2d55ef7272ce50fb935b851d77d01bded5a92c51 Mon Sep 17 00:00:00 2001 From: Vladyslav Dalechyn Date: Wed, 10 Jul 2024 19:32:42 +0300 Subject: [PATCH 06/18] ci: fix prerelease job (#395) * ci: fix prerelease job * fix: requested changes --- .github/workflows/on-push-to-main.yml | 3 ++- package.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-push-to-main.yml b/.github/workflows/on-push-to-main.yml index 610101c1..2d0947c2 100644 --- a/.github/workflows/on-push-to-main.yml +++ b/.github/workflows/on-push-to-main.yml @@ -42,7 +42,7 @@ jobs: with: title: 'chore: version packages' commit: 'chore: version packages' - publish: pnpm changeset:release + publish: pnpm changeset:publish version: pnpm changeset:version env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -59,4 +59,5 @@ jobs: git reset --hard origin/main pnpm clean pnpm changeset version --no-git-tag --snapshot canary + pnpm changeset:prepublish pnpm changeset publish --no-git-tag --snapshot canary --tag canary diff --git a/package.json b/package.json index fb499e00..055b22b0 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "build:create-frog": "rimraf create-frog/_lib && tsc -p create-frog/tsconfig.build.json", "build:ui": "pnpm --filter ui build", "changeset": "changeset", - "changeset:release": "pnpm build && changeset publish", + "changeset:prepublish": "bun .scripts/postversion.ts && pnpm build", + "changeset:publish": "pnpm changeset:prepublish && changeset publish", "changeset:version": "changeset version && pnpm install --lockfile-only && bun .scripts/postversion.ts", "clean": "rimraf src/_lib src/protobufs/generated src/ui/icons/index.ts src/ui/icons/**/index.ts src/ui/icons/**/package.json src/ui/.frog src/tsconfig.build.tsbuildinfo", "create-frog": "node --import tsx ./create-frog/bin.ts", From 902f03dbcfa77afa027b94c90d755f09cb2380e4 Mon Sep 17 00:00:00 2001 From: Vladyslav Dalechyn Date: Wed, 10 Jul 2024 19:32:54 +0300 Subject: [PATCH 07/18] feat: bring `chainId` back to `.signature` handler (#407) --- .changeset/chatty-numbers-joke.md | 13 +++++++++++++ playground/src/signature.tsx | 1 + src/types/signature.ts | 12 +++++++++--- src/utils/getSignatureContext.ts | 7 +++++-- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 .changeset/chatty-numbers-joke.md diff --git a/.changeset/chatty-numbers-joke.md b/.changeset/chatty-numbers-joke.md new file mode 100644 index 00000000..f0cb7149 --- /dev/null +++ b/.changeset/chatty-numbers-joke.md @@ -0,0 +1,13 @@ +--- +"frog": minor +--- + +**Breaking Change**. Added `chainId` back as a parameter to `.signature` handler. + +```diff +app.signature('/sign', (c) => + c.signTypedData({ ++ chainId: 'eip155:8543', + /**/ + }) +``` diff --git a/playground/src/signature.tsx b/playground/src/signature.tsx index 46617893..5a8d9f53 100644 --- a/playground/src/signature.tsx +++ b/playground/src/signature.tsx @@ -19,6 +19,7 @@ export const app = new Frog({ verify: 'silent', title: 'Signature' }) // Sign Typed Data .signature('/sign', (c) => c.signTypedData({ + chainId: 'eip155:84532', domain: { name: 'Ether Mail', version: '1', diff --git a/src/types/signature.ts b/src/types/signature.ts index 305e8645..dc5562f3 100644 --- a/src/types/signature.ts +++ b/src/types/signature.ts @@ -1,10 +1,15 @@ import type { TypedData, TypedDataDefinition } from 'viem' +import type { ChainIdEip155, ChainNamespace } from './transaction.js' import type { TypedResponse } from './response.js' -export type SignatureParameters = EthSignTypedDataV4Schema +export type SignatureParameters = { + /** A CAIP-2 Chain ID to identify the signature network. */ + chainId: `${ChainNamespace}:${ChainIdEip155}` +} & EthSignTypedDataV4Schema -export type SignatureResponse = EthSignTypedDataV4Schema +export type SignatureResponse = Pick & + EthSignTypedDataV4Schema export type EthSignTypedDataV4Parameters< typedData extends TypedData | Record, @@ -31,7 +36,8 @@ export type SignatureResponseFn = ( export type SignTypedDataParameters< typedData extends TypedData | Record, primaryType extends keyof typedData | 'EIP712Domain', -> = EthSignTypedDataV4Parameters +> = Pick & + EthSignTypedDataV4Parameters export type SignTypedDataResponseFn = < const typedData extends TypedData | Record, diff --git a/src/utils/getSignatureContext.ts b/src/utils/getSignatureContext.ts index 2f3f096a..04f3641e 100644 --- a/src/utils/getSignatureContext.ts +++ b/src/utils/getSignatureContext.ts @@ -70,10 +70,11 @@ export function getSignatureContext< previousState, req, res(parameters) { - const { method, params } = parameters + const { chainId, method, params } = parameters const { domain, types, primaryType, message } = params const response: SignatureResponse = { + chainId, method, params: { domain, @@ -87,8 +88,10 @@ export function getSignatureContext< return { data: response, format: 'signature', status: 'success' } }, signTypedData(parameters) { + const { chainId, ...params } = parameters return this.res({ - params: parameters as any, + params: params as any, + chainId, method: 'eth_signTypedData_v4', }) }, From 34c60d60c0c8bbe6dea387f03572f7ffab1fbb6c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 19:47:20 +0300 Subject: [PATCH 08/18] chore: version packages (#408) * chore: version packages * Update src/CHANGELOG.md * chore: format --------- Co-authored-by: github-actions[bot] Co-authored-by: Vladyslav Dalechyn Co-authored-by: dalechyn --- .changeset/chatty-numbers-joke.md | 13 ------------- src/CHANGELOG.md | 14 ++++++++++++++ src/package.json | 2 +- src/version.ts | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 .changeset/chatty-numbers-joke.md diff --git a/.changeset/chatty-numbers-joke.md b/.changeset/chatty-numbers-joke.md deleted file mode 100644 index f0cb7149..00000000 --- a/.changeset/chatty-numbers-joke.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"frog": minor ---- - -**Breaking Change**. Added `chainId` back as a parameter to `.signature` handler. - -```diff -app.signature('/sign', (c) => - c.signTypedData({ -+ chainId: 'eip155:8543', - /**/ - }) -``` diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index d23def7d..dc753450 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,5 +1,19 @@ # frog +## 0.14.0 + +### Minor Changes + +- [#407](https://github.com/wevm/frog/pull/407) [`902f03d`](https://github.com/wevm/frog/commit/902f03dbcfa77afa027b94c90d755f09cb2380e4) Thanks [@dalechyn](https://github.com/dalechyn)! - **Breaking Change**. Added `chainId` back as a parameter to `.signature` handler's `c.signTypedData` response. + + ```diff + app.signature('/sign', (c) => + c.signTypedData({ + + chainId: 'eip155:8543', + /**/ + }) + ``` + ## 0.13.1 ### Patch Changes diff --git a/src/package.json b/src/package.json index 0a8151ea..356cb0bb 100644 --- a/src/package.json +++ b/src/package.json @@ -1,7 +1,7 @@ { "name": "frog", "description": "Framework for Farcaster Frames", - "version": "0.13.1", + "version": "0.14.0", "type": "module", "module": "_lib/index.js", "types": "_lib/index.d.ts", diff --git a/src/version.ts b/src/version.ts index e622a425..656d5596 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '0.13.1' +export const version = '0.14.0' From 930456770370cd0f553d78e05071a07149cebda4 Mon Sep 17 00:00:00 2001 From: Vladyslav Dalechyn Date: Thu, 11 Jul 2024 00:18:59 +0300 Subject: [PATCH 09/18] fix: don't check for `status ==="response"` to derive state (#409) --- .changeset/smooth-plants-deliver.md | 5 +++++ src/utils/getFrameContext.ts | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .changeset/smooth-plants-deliver.md diff --git a/.changeset/smooth-plants-deliver.md b/.changeset/smooth-plants-deliver.md new file mode 100644 index 00000000..47ccd3b6 --- /dev/null +++ b/.changeset/smooth-plants-deliver.md @@ -0,0 +1,5 @@ +--- +"frog": patch +--- + +Fixed an issue where `c.deriveState` would not modify state in initial frame handler. diff --git a/src/utils/getFrameContext.ts b/src/utils/getFrameContext.ts index 7d715823..13ca6c1a 100644 --- a/src/utils/getFrameContext.ts +++ b/src/utils/getFrameContext.ts @@ -63,7 +63,6 @@ export function getFrameContext< function deriveState( derive?: (state: _state) => void | Promise, ): _state | Promise<_state> { - if (status !== 'response') return previousState as _state if (!derive) return previousState as _state const clone = structuredClone(previousState) From 13d8d35daee945026eb703abc35030bd0f0ddc71 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 00:23:13 +0300 Subject: [PATCH 10/18] chore: version packages (#410) * chore: version packages * Update src/package.json --------- Co-authored-by: github-actions[bot] Co-authored-by: Vladyslav Dalechyn --- .changeset/smooth-plants-deliver.md | 5 ----- src/CHANGELOG.md | 6 ++++++ src/package.json | 2 +- src/version.ts | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 .changeset/smooth-plants-deliver.md diff --git a/.changeset/smooth-plants-deliver.md b/.changeset/smooth-plants-deliver.md deleted file mode 100644 index 47ccd3b6..00000000 --- a/.changeset/smooth-plants-deliver.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"frog": patch ---- - -Fixed an issue where `c.deriveState` would not modify state in initial frame handler. diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index dc753450..709ea014 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,5 +1,11 @@ # frog +## 0.14.1 + +### Patch Changes + +- [#409](https://github.com/wevm/frog/pull/409) [`9304567`](https://github.com/wevm/frog/commit/930456770370cd0f553d78e05071a07149cebda4) Thanks [@dalechyn](https://github.com/dalechyn)! - Fixed an issue where `c.deriveState` would not modify state in initial frame handler. + ## 0.14.0 ### Minor Changes diff --git a/src/package.json b/src/package.json index 356cb0bb..a2e8ad7a 100644 --- a/src/package.json +++ b/src/package.json @@ -1,7 +1,7 @@ { "name": "frog", "description": "Framework for Farcaster Frames", - "version": "0.14.0", + "version": "0.14.1", "type": "module", "module": "_lib/index.js", "types": "_lib/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 656d5596..249583ab 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '0.14.0' +export const version = '0.14.1' From 10e522d1a0b5bf05090a5f829993f44495412afc Mon Sep 17 00:00:00 2001 From: Vladyslav Dalechyn Date: Thu, 11 Jul 2024 12:36:44 +0300 Subject: [PATCH 11/18] =?UTF-8?q?revert:=20"fix:=20don't=20check=20for=20`?= =?UTF-8?q?status=20=3D=3D=3D"response"`=20to=20derive=20state=20=E2=80=A6?= =?UTF-8?q?=20(#412)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * revert: "fix: don't check for `status ==="response"` to derive state (#409)" This reverts commit 930456770370cd0f553d78e05071a07149cebda4. * chore: changesets --- .changeset/angry-apes-train.md | 5 +++++ src/utils/getFrameContext.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/angry-apes-train.md diff --git a/.changeset/angry-apes-train.md b/.changeset/angry-apes-train.md new file mode 100644 index 00000000..14b866a5 --- /dev/null +++ b/.changeset/angry-apes-train.md @@ -0,0 +1,5 @@ +--- +"frog": patch +--- + +Reverted the changes introduced in 0.14.1. diff --git a/src/utils/getFrameContext.ts b/src/utils/getFrameContext.ts index 13ca6c1a..7d715823 100644 --- a/src/utils/getFrameContext.ts +++ b/src/utils/getFrameContext.ts @@ -63,6 +63,7 @@ export function getFrameContext< function deriveState( derive?: (state: _state) => void | Promise, ): _state | Promise<_state> { + if (status !== 'response') return previousState as _state if (!derive) return previousState as _state const clone = structuredClone(previousState) From f59042ddfe84f6d23b386b9e9f48f5e82f9085b6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 12:59:50 +0300 Subject: [PATCH 12/18] chore: version packages (#413) * chore: version packages * Update src/package.json --------- Co-authored-by: github-actions[bot] Co-authored-by: Vladyslav Dalechyn --- .changeset/angry-apes-train.md | 5 ----- src/CHANGELOG.md | 6 ++++++ src/package.json | 2 +- src/version.ts | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 .changeset/angry-apes-train.md diff --git a/.changeset/angry-apes-train.md b/.changeset/angry-apes-train.md deleted file mode 100644 index 14b866a5..00000000 --- a/.changeset/angry-apes-train.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"frog": patch ---- - -Reverted the changes introduced in 0.14.1. diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 709ea014..e7db10d5 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,5 +1,11 @@ # frog +## 0.14.2 + +### Patch Changes + +- [#412](https://github.com/wevm/frog/pull/412) [`10e522d`](https://github.com/wevm/frog/commit/10e522d1a0b5bf05090a5f829993f44495412afc) Thanks [@dalechyn](https://github.com/dalechyn)! - Reverted the changes introduced in 0.14.1. + ## 0.14.1 ### Patch Changes diff --git a/src/package.json b/src/package.json index a2e8ad7a..01a98522 100644 --- a/src/package.json +++ b/src/package.json @@ -1,7 +1,7 @@ { "name": "frog", "description": "Framework for Farcaster Frames", - "version": "0.14.1", + "version": "0.14.2", "type": "module", "module": "_lib/index.js", "types": "_lib/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 249583ab..db0a8e39 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '0.14.1' +export const version = '0.14.2' From 51f567877c8b8c6775e91d8e4ec5c066056830b7 Mon Sep 17 00:00:00 2001 From: Vladyslav Dalechyn Date: Sat, 13 Jul 2024 01:42:59 +0300 Subject: [PATCH 13/18] fix(ui): expand props of `Box` to other components (#414) * fix(ui): expand props of `Box` to `VStack`, `HStack` * chore: changesets --- .changeset/metal-rocks-relax.md | 5 +++++ src/ui/HStack.tsx | 26 +------------------------- src/ui/VStack.tsx | 26 +------------------------- 3 files changed, 7 insertions(+), 50 deletions(-) create mode 100644 .changeset/metal-rocks-relax.md diff --git a/.changeset/metal-rocks-relax.md b/.changeset/metal-rocks-relax.md new file mode 100644 index 00000000..19d59ed8 --- /dev/null +++ b/.changeset/metal-rocks-relax.md @@ -0,0 +1,5 @@ +--- +"frog": patch +--- + +Fixed an issue where `Box` props weren't accessible in `HStack` and `VStack` components. diff --git a/src/ui/HStack.tsx b/src/ui/HStack.tsx index 805928e5..cb83b0c4 100644 --- a/src/ui/HStack.tsx +++ b/src/ui/HStack.tsx @@ -1,31 +1,7 @@ import { Box, type BoxProps } from './Box.js' import type { DefaultVars, Vars } from './vars.js' -export type HStackProps = Pick< - BoxProps, - | 'bottom' - | 'children' - | 'flex' - | 'flexBasis' - | 'flexFlow' - | 'flexShrink' - | 'gap' - | 'grow' - | 'height' - | 'left' - | 'maxHeight' - | 'maxWidth' - | 'maxWidth' - | 'minWidth' - | 'padding' - | 'paddingBottom' - | 'paddingLeft' - | 'paddingRight' - | 'paddingTop' - | 'right' - | 'top' - | 'width' -> & { +export type HStackProps = BoxProps & { /** Horizontally aligns the contents. */ alignHorizontal?: 'left' | 'center' | 'right' | 'space-between' /** Vertically aligns the contents. */ diff --git a/src/ui/VStack.tsx b/src/ui/VStack.tsx index f973f1a3..5f22326f 100644 --- a/src/ui/VStack.tsx +++ b/src/ui/VStack.tsx @@ -1,31 +1,7 @@ import { Box, type BoxProps } from './Box.js' import type { DefaultVars, Vars } from './vars.js' -export type VStackProps = Pick< - BoxProps, - | 'bottom' - | 'children' - | 'flex' - | 'flexBasis' - | 'flexFlow' - | 'flexShrink' - | 'gap' - | 'grow' - | 'height' - | 'left' - | 'maxHeight' - | 'maxWidth' - | 'maxWidth' - | 'minWidth' - | 'padding' - | 'paddingBottom' - | 'paddingLeft' - | 'paddingRight' - | 'paddingTop' - | 'right' - | 'top' - | 'width' -> & { +export type VStackProps = BoxProps & { /** Horizontally aligns the contents. */ alignHorizontal?: 'left' | 'center' | 'right' /** Vertically aligns the contents. */ From 24e7fd04a3fda767442f0b43e2fd1fd16d5f28c1 Mon Sep 17 00:00:00 2001 From: Vladyslav Dalechyn Date: Wed, 17 Jul 2024 21:20:42 +0300 Subject: [PATCH 14/18] fix: route check for `undefined` instead of falsish value (#417) * fix: route check for `undefined` instead of falsish value * chore: changesets --- .changeset/modern-turkeys-care.md | 5 +++++ src/frog-base.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/modern-turkeys-care.md diff --git a/.changeset/modern-turkeys-care.md b/.changeset/modern-turkeys-care.md new file mode 100644 index 00000000..b764532e --- /dev/null +++ b/.changeset/modern-turkeys-care.md @@ -0,0 +1,5 @@ +--- +"frog": patch +--- + +Fixed an issue where `verify` value would be the same as the parent's Frog instance even if `false` is passed. diff --git a/src/frog-base.tsx b/src/frog-base.tsx index 8f5381c2..804e921b 100644 --- a/src/frog-base.tsx +++ b/src/frog-base.tsx @@ -978,7 +978,7 @@ export class FrogBase< if (!frog.origin) frog.origin = this.origin if (!frog.secret) frog.secret = this.secret if (!frog.ui) frog.ui = this.ui - if (!frog.verify) frog.verify = this.verify + if (typeof frog.verify === 'undefined') frog.verify = this.verify this.hono.route(path, frog.hono) From 4be5242cd8b7b372493a44047a3a45402044ab8e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 21:30:31 +0300 Subject: [PATCH 15/18] chore: version packages (#415) * chore: version packages * Update src/package.json --------- Co-authored-by: github-actions[bot] Co-authored-by: Vladyslav Dalechyn --- .changeset/metal-rocks-relax.md | 5 ----- .changeset/modern-turkeys-care.md | 5 ----- src/CHANGELOG.md | 8 ++++++++ src/package.json | 2 +- src/version.ts | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) delete mode 100644 .changeset/metal-rocks-relax.md delete mode 100644 .changeset/modern-turkeys-care.md diff --git a/.changeset/metal-rocks-relax.md b/.changeset/metal-rocks-relax.md deleted file mode 100644 index 19d59ed8..00000000 --- a/.changeset/metal-rocks-relax.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"frog": patch ---- - -Fixed an issue where `Box` props weren't accessible in `HStack` and `VStack` components. diff --git a/.changeset/modern-turkeys-care.md b/.changeset/modern-turkeys-care.md deleted file mode 100644 index b764532e..00000000 --- a/.changeset/modern-turkeys-care.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"frog": patch ---- - -Fixed an issue where `verify` value would be the same as the parent's Frog instance even if `false` is passed. diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index e7db10d5..8f2dd789 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,5 +1,13 @@ # frog +## 0.14.3 + +### Patch Changes + +- [#414](https://github.com/wevm/frog/pull/414) [`51f5678`](https://github.com/wevm/frog/commit/51f567877c8b8c6775e91d8e4ec5c066056830b7) Thanks [@dalechyn](https://github.com/dalechyn)! - Fixed an issue where `Box` props weren't accessible in `HStack` and `VStack` components. + +- [#417](https://github.com/wevm/frog/pull/417) [`24e7fd0`](https://github.com/wevm/frog/commit/24e7fd04a3fda767442f0b43e2fd1fd16d5f28c1) Thanks [@dalechyn](https://github.com/dalechyn)! - Fixed an issue where `verify` value would be the same as the parent's Frog instance even if `false` is passed. + ## 0.14.2 ### Patch Changes diff --git a/src/package.json b/src/package.json index 01a98522..91c190f2 100644 --- a/src/package.json +++ b/src/package.json @@ -1,7 +1,7 @@ { "name": "frog", "description": "Framework for Farcaster Frames", - "version": "0.14.2", + "version": "0.14.3", "type": "module", "module": "_lib/index.js", "types": "_lib/index.d.ts", diff --git a/src/version.ts b/src/version.ts index db0a8e39..8426c345 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '0.14.2' +export const version = '0.14.3' From 34c21cf320f20c8c1cc8426f4feceb4a4f9103a1 Mon Sep 17 00:00:00 2001 From: Tom Meagher Date: Wed, 17 Jul 2024 19:37:27 -0400 Subject: [PATCH 16/18] chore: remove sponsors from site --- site/pages/index.mdx | 3 - site/vocs.config.tsx | 164 ------------------------------------------- 2 files changed, 167 deletions(-) diff --git a/site/pages/index.mdx b/site/pages/index.mdx index 241e8508..aff67491 100644 --- a/site/pages/index.mdx +++ b/site/pages/index.mdx @@ -19,6 +19,3 @@ import { CollaborationBadge } from '../components/CollaborationBadge' -# Sponsors - -::sponsors \ No newline at end of file diff --git a/site/vocs.config.tsx b/site/vocs.config.tsx index 3b2fb4e7..0ca2e30d 100644 --- a/site/vocs.config.tsx +++ b/site/vocs.config.tsx @@ -79,170 +79,6 @@ export default defineConfig({ link: 'https://warpcast.com/wevm', }, ], - sponsors: [ - { - name: 'Collaborator', - height: 120, - items: [ - [ - { - name: 'Paradigm', - link: 'https://paradigm.xyz', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/paradigm-light.svg', - }, - ], - ], - }, - { - name: 'Large Enterprise', - height: 60, - items: [ - [ - { - name: 'WalletConnect', - link: 'https://walletconnect.com', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/walletconnect-light.svg', - }, - { - name: 'Stripe', - link: 'https://www.stripe.com', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/stripe-light.svg', - }, - ], - [ - { - name: 'PancakeSwap', - link: 'https://pancakeswap.finance/', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/pancake-light.svg', - }, - { - name: 'zkSync', - link: 'https://zksync.io', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/zksync-light.svg', - }, - ], - ], - }, - { - name: 'Small Enterprise', - height: 40, - items: [ - [ - { - name: 'Family', - link: 'https://twitter.com/family', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/family-light.svg', - }, - { - name: 'Context', - link: 'https://twitter.com/context', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/context-light.svg', - }, - { - name: 'PartyDAO', - link: 'https://twitter.com/prtyDAO', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/partydao-light.svg', - }, - ], - [ - { - name: 'SushiSwap', - link: 'https://www.sushi.com', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/sushi-light.svg', - }, - { - name: 'Dynamic', - link: 'https://www.dynamic.xyz', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/dynamic-light.svg', - }, - { - name: 'BitKeep', - link: 'https://bitkeep.com', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/bitkeep-light.svg', - }, - ], - [ - { - name: 'Privy', - link: 'https://privy.io', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/privy-light.svg', - }, - { - name: 'Spruce', - link: 'https://spruceid.com', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/spruce-light.svg', - }, - { - name: 'rollup.id', - link: 'https://rollup.id', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/rollup.id-light.svg', - }, - ], - [ - { - name: 'Celo', - link: 'https://celo.org', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/celo-light.svg', - }, - { - name: 'Rainbow', - link: 'https://rainbow.me', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/rainbow-light.svg', - }, - { - name: 'Pimlico', - link: 'https://pimlico.io', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/pimlico-light.svg', - }, - ], - [ - { - name: 'Zora', - link: 'https://zora.co', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/zora-light.svg', - }, - { - name: 'Lattice', - link: 'https://lattice.xyz', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/lattice-light.svg', - }, - ], - [ - { - name: 'Supa', - link: 'https://twitter.com/supafinance', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/supa-light.svg', - }, - { - name: 'Blocto', - link: 'https://blocto.io/', - image: - 'https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/blocto-light.svg', - }, - ], - ], - }, - ], sidebar: { '/': [ { From 6114139cb7b56ca5bc95ae2af7722f9ba0ec7f80 Mon Sep 17 00:00:00 2001 From: Vladyslav Dalechyn Date: Thu, 18 Jul 2024 15:01:29 +0300 Subject: [PATCH 17/18] fix: don't run `tag` if its name is `'meta'` (#420) * fix: don't run `tag` if its name is `'meta'` * chore: changesets * nit: lint --- .changeset/strong-pumpkins-chew.md | 5 +++++ src/utils/parseIntents.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/strong-pumpkins-chew.md diff --git a/.changeset/strong-pumpkins-chew.md b/.changeset/strong-pumpkins-chew.md new file mode 100644 index 00000000..80ca9599 --- /dev/null +++ b/.changeset/strong-pumpkins-chew.md @@ -0,0 +1,5 @@ +--- +"frog": patch +--- + +Fixed an issue where `TextInput` component was unnecessarily unwrapped causing an issue with getting button values. diff --git a/src/utils/parseIntents.ts b/src/utils/parseIntents.ts index ef99ccf5..39c1b11b 100644 --- a/src/utils/parseIntents.ts +++ b/src/utils/parseIntents.ts @@ -95,7 +95,8 @@ function parseIntent( if (typeof intent?.tag === 'function' && typeof node.tag === 'function') { if (intent.children.length > 1) throw new InvalidIntentComponentError() - return parseIntent(node.tag(node.props), options, counter) + if (intent.tag.name !== 'meta') + return parseIntent(node.tag(node.props), options, counter) } return intent } From ddb510f7d7664fb0a7f3200359ddc091b2c553d6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:21:17 +0300 Subject: [PATCH 18/18] chore: version packages (#421) * chore: version packages * Update src/package.json --------- Co-authored-by: github-actions[bot] Co-authored-by: Vladyslav Dalechyn --- .changeset/strong-pumpkins-chew.md | 5 ----- src/CHANGELOG.md | 6 ++++++ src/package.json | 2 +- src/version.ts | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 .changeset/strong-pumpkins-chew.md diff --git a/.changeset/strong-pumpkins-chew.md b/.changeset/strong-pumpkins-chew.md deleted file mode 100644 index 80ca9599..00000000 --- a/.changeset/strong-pumpkins-chew.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"frog": patch ---- - -Fixed an issue where `TextInput` component was unnecessarily unwrapped causing an issue with getting button values. diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 8f2dd789..d128ba5b 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,5 +1,11 @@ # frog +## 0.14.4 + +### Patch Changes + +- [#420](https://github.com/wevm/frog/pull/420) [`6114139`](https://github.com/wevm/frog/commit/6114139cb7b56ca5bc95ae2af7722f9ba0ec7f80) Thanks [@dalechyn](https://github.com/dalechyn)! - Fixed an issue where `TextInput` component was unnecessarily unwrapped causing an issue with getting button values. + ## 0.14.3 ### Patch Changes diff --git a/src/package.json b/src/package.json index 91c190f2..71f24ef7 100644 --- a/src/package.json +++ b/src/package.json @@ -1,7 +1,7 @@ { "name": "frog", "description": "Framework for Farcaster Frames", - "version": "0.14.3", + "version": "0.14.4", "type": "module", "module": "_lib/index.js", "types": "_lib/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 8426c345..65c72039 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '0.14.3' +export const version = '0.14.4'