From ae4675a769ac2eeaa5028ae52048855dddf64328 Mon Sep 17 00:00:00 2001 From: Leonardo Zizzamia Date: Sat, 27 Jan 2024 14:16:49 -0800 Subject: [PATCH 1/2] dope --- .changeset/mean-students-search.md | 6 ++++++ README.md | 33 +++++++++++++++++++++++++++++- package.json | 4 ++-- 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 .changeset/mean-students-search.md diff --git a/.changeset/mean-students-search.md b/.changeset/mean-students-search.md new file mode 100644 index 0000000000..41743fcbee --- /dev/null +++ b/.changeset/mean-students-search.md @@ -0,0 +1,6 @@ +--- +"@coinbase/onchainkit": patch +--- + +- **docs**: kickoff docs for `generateFrameNextMetadata` core utility +- **fix**: set correctly the `main` and `types` file in the `package.json` diff --git a/README.md b/README.md index b995f9a981..217ba7dc96 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,34 @@ # [OnchainKit](https://github.com/coinbase/onchainkit/) -> OnchainKit is a collection of CSS and React components specifically crafted to enhance your creativity when building onchain applications. +> OnchainKit is a collection of CSS, React components and Core utilities specifically crafted to enhance your creativity when building onchain applications. + +## Core utilities + +### generateFrameNextMetadata + +Next App `page.ts` +```ts +// Steps 1. import generateFrameNextMetadata from @coinbase/onchainkit +import { generateFrameNextMetadata } from '@coinbase/onchainkit'; +import type { Metadata } from 'next'; +import HomePage from './home'; + +// Step 2. Use generateFrameNextMetadata to shape your Frame metadata +const frameMetadata = generateFrameNextMetadata({ + buttons: ['boat'], + image: 'https://build-onchain-apps.vercel.app/release/v-0-17.png', + post_url: 'https://build-onchain-apps.vercel.app/api/frame', +}); + +// Step 3. Add your metadata in the Next.js metadata utility +export const metadata: Metadata = { + manifest: '/manifest.json', + other: { + ...frameMetadata + }, +}; + +export default function Page() { + return ; +} +``` \ No newline at end of file diff --git a/package.json b/package.json index 36996feeac..3a673f6f9f 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "dist/" ], "type": "commonjs", - "main": "./dist/src/index.js", - "typings": "./dist/src/index.d.ts", + "main": "./dist/lib/index.js", + "typings": "./dist/types/index.d.ts", "packageManager": "yarn@4.0.2" } From 59f16c98dc8482095cbc584c42475d5e4b76c238 Mon Sep 17 00:00:00 2001 From: Leonardo Zizzamia Date: Sat, 27 Jan 2024 14:18:56 -0800 Subject: [PATCH 2/2] types --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 3caa4f790f..4435e17210 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ // ☕️ -const version = '0.1.1'; +const version = '0.1.2'; // TODO remove this line from here export { generateFrameNextMetadata } from './core/generateFrameNextMetadata';