From b38006900772ddca09f3b6ab55996d304d0baaa8 Mon Sep 17 00:00:00 2001 From: Vitor Marthendal Nunes Date: Mon, 4 Dec 2023 15:07:35 -0300 Subject: [PATCH] docs: add cli docs (#5) --- apps/www/__registry__/index.tsx | 35 +++++ apps/www/config/docs.ts | 45 ++++++ apps/www/content/docs/cli.mdx | 134 ++++++++++++++++++ apps/www/content/docs/components-json.mdx | 4 +- apps/www/content/docs/components/address.mdx | 14 +- apps/www/content/docs/components/balance.mdx | 14 +- .../docs/components/block-explorer-link.mdx | 14 +- .../content/docs/components/block-number.mdx | 14 +- apps/www/content/docs/components/blockie.mdx | 14 +- .../content/docs/components/ens-address.mdx | 14 +- .../content/docs/components/ens-avatar.mdx | 14 +- apps/www/content/docs/components/ens-name.mdx | 14 +- .../content/docs/components/erc20-balance.mdx | 14 +- .../docs/components/erc20-decimals.mdx | 14 +- .../content/docs/components/erc20-name.mdx | 14 +- .../components/erc20-select-and-amount.mdx | 14 +- .../content/docs/components/erc20-select.mdx | 14 +- .../content/docs/components/erc20-symbol.mdx | 14 +- .../docs/components/erc20-total-supply.mdx | 14 +- .../docs/components/erc721-metadata.mdx | 14 +- .../content/docs/components/erc721-name.mdx | 14 +- .../docs/components/erc721-owner-of.mdx | 14 +- .../content/docs/components/erc721-symbol.mdx | 14 +- .../docs/components/erc721-token-uri.mdx | 14 +- .../docs/components/erc721-total-supply.mdx | 14 +- .../content/docs/components/error-message.mdx | 14 +- apps/www/content/docs/components/fee-data.mdx | 14 +- .../content/docs/components/image-ipfs.mdx | 14 +- .../docs/components/is-wallet-connected.mdx | 14 +- .../components/is-wallet-disconnected.mdx | 14 +- apps/www/content/docs/components/nonce.mdx | 14 +- .../docs/components/sign-message-button.mdx | 14 +- .../docs/components/transaction-status.mdx | 14 +- .../content/docs/components/transaction.mdx | 14 +- .../docs/components/wallet-connect.mdx | 14 +- .../docs/components/wallet-disconnect.mdx | 14 +- apps/www/content/docs/installation/astro.mdx | 6 +- apps/www/content/docs/installation/gatsby.mdx | 4 +- .../www/content/docs/installation/laravel.mdx | 4 +- apps/www/content/docs/installation/next.mdx | 4 +- apps/www/content/docs/installation/remix.mdx | 4 +- apps/www/content/docs/installation/vite.mdx | 4 +- apps/www/public/registry/index.json | 34 ++++- .../registry/styles/default/blockie.json | 3 +- .../public/registry/styles/default/card.json | 2 +- .../public/registry/styles/default/input.json | 2 +- .../public/registry/styles/default/label.json | 3 +- .../registry/styles/default/select.json | 6 +- .../styles/default/sign-message-button.json | 2 +- .../default/example/card-with-form.tsx | 59 ++++++++ apps/www/registry/registry.ts | 29 +++- 51 files changed, 519 insertions(+), 313 deletions(-) create mode 100644 apps/www/content/docs/cli.mdx create mode 100644 apps/www/registry/default/example/card-with-form.tsx diff --git a/apps/www/__registry__/index.tsx b/apps/www/__registry__/index.tsx index 45df8b9..d81acf8 100644 --- a/apps/www/__registry__/index.tsx +++ b/apps/www/__registry__/index.tsx @@ -236,6 +236,34 @@ export const Index: Record = { component: React.lazy(() => import("@/registry/default/ui/button")), files: ["registry/default/ui/button.tsx"], }, + "card": { + name: "card", + type: "components:ui", + registryDependencies: undefined, + component: React.lazy(() => import("@/registry/default/ui/card")), + files: ["registry/default/ui/card.tsx"], + }, + "input": { + name: "input", + type: "components:ui", + registryDependencies: undefined, + component: React.lazy(() => import("@/registry/default/ui/input")), + files: ["registry/default/ui/input.tsx"], + }, + "label": { + name: "label", + type: "components:ui", + registryDependencies: undefined, + component: React.lazy(() => import("@/registry/default/ui/label")), + files: ["registry/default/ui/label.tsx"], + }, + "select": { + name: "select", + type: "components:ui", + registryDependencies: undefined, + component: React.lazy(() => import("@/registry/default/ui/select")), + files: ["registry/default/ui/select.tsx"], + }, "dialog": { name: "dialog", type: "components:ui", @@ -481,5 +509,12 @@ export const Index: Record = { component: React.lazy(() => import("@/registry/default/example/error-message-demo")), files: ["registry/default/example/error-message-demo.tsx"], }, + "card-with-form": { + name: "card-with-form", + type: "components:example", + registryDependencies: ["button","card","input","label","select"], + component: React.lazy(() => import("@/registry/default/example/card-with-form")), + files: ["registry/default/example/card-with-form.tsx"], + }, }, } diff --git a/apps/www/config/docs.ts b/apps/www/config/docs.ts index 65c09fd..02411d3 100644 --- a/apps/www/config/docs.ts +++ b/apps/www/config/docs.ts @@ -35,11 +35,56 @@ export const docsConfig: DocsConfig = { href: "/docs", items: [], }, + { + title: "Installation", + href: "/docs/installation", + items: [], + }, + { + title: "components.json", + href: "/docs/components-json", + items: [], + }, + { + title: "CLI", + href: "/docs/cli", + items: [], + }, ], }, { title: "Installation", items: [ + { + title: "Next.js", + href: "/docs/installation/next", + items: [], + }, + { + title: "Vite", + href: "/docs/installation/vite", + items: [], + }, + { + title: "Remix", + href: "/docs/installation/remix", + items: [], + }, + { + title: "Gatsby", + href: "/docs/installation/gatsby", + items: [], + }, + { + title: "Astro", + href: "/docs/installation/astro", + items: [], + }, + { + title: "Laravel", + href: "/docs/installation/laravel", + items: [], + }, { title: "Manual", href: "/docs/installation/manual", diff --git a/apps/www/content/docs/cli.mdx b/apps/www/content/docs/cli.mdx new file mode 100644 index 0000000..abdca06 --- /dev/null +++ b/apps/www/content/docs/cli.mdx @@ -0,0 +1,134 @@ +--- +title: CLI +description: Use the CLI to add components to your project. +--- + +## init + +Use the `init` command to initialize configuration and dependencies for a new project. + +The `init` command installs dependencies, adds the `cn` util, configures `tailwind.config.js`, and CSS variables for the project. + +```bash +npx buidl-cli@latest init +``` + +You will be asked a few questions to configure `components.json`: + +```txt showLineNumbers +Would you like to use TypeScript (recommended)? no/yes +Which style would you like to use? › Default +Which color would you like to use as base color? › Slate +Where is your global CSS file? › › app/globals.css +Do you want to use CSS variables for colors? › no / yes +Where is your tailwind.config.js located? › tailwind.config.js +Configure the import alias for components: › @/components +Configure the import alias for utils: › @/lib/utils +Are you using React Server Components? › no / yes +``` + +### Options + +```txt +Usage: buidl-cli init [options] + +initialize your project and install dependencies + +Options: + -y, --yes skip confirmation prompt. (default: false) + -c, --cwd the working directory. defaults to the current directory. + -h, --help display help for command +``` + +## add + +Use the `add` command to add components and dependencies to your project. + +```bash +npx buidl-cli@latest add [component] +``` + +You will be presented with a list of components to choose from: + +```txt +Which components would you like to add? › Space to select. A to toggle all. +Enter to submit. + +◯ address +◯ balance +◯ block-explorer-link +◯ block-number +◯ nonce +◯ transaction +◯ transaction-status +◯ fee-data +◯ sign-message-button +◯ blockie +``` + +### Options + +```txt +Usage: buidl-cli add [options] [components...] + +add a component to your project + +Arguments: + components the components to add + +Options: + -y, --yes skip confirmation prompt. (default: false) + -o, --overwrite overwrite existing files. (default: false) + -c, --cwd the working directory. defaults to the current directory. + -p, --path the path to add the component to. + -h, --help display help for command +``` + +## diff (experimental) + +You can use the diff command to check for updates against the registry. + +Run the following command to get a list of components that have updates available: + +```bash +npx buidl-cli diff +``` + +```txt +The following components have updates available: +- address + - /path/to/my-app/components/buidl/address.tsx +- balance + - /path/to/my-app/components/buidl/balance.tsx +- transaction + - /path/to/my-app/components/buidl/transaction.tsx +``` + +Then run `diff [component]` to see the changes: + +```bash +npx buidl-cli diff alert +``` + +```diff /pl-12/ +const alertVariants = cva( +- "relative w-full rounded-lg border", ++ "relative w-full pl-12 rounded-lg border" +) +``` + +### Options + +```txt +Usage: buidl-cli diff [options] [component] + +check for updates against the registry + +Arguments: + component the component name + +Options: + -y, --yes skip confirmation prompt. (default: false) + -c, --cwd the working directory. defaults to the current directory. + -h, --help display help for command +``` diff --git a/apps/www/content/docs/components-json.mdx b/apps/www/content/docs/components-json.mdx index 87b5f75..1efaf94 100644 --- a/apps/www/content/docs/components-json.mdx +++ b/apps/www/content/docs/components-json.mdx @@ -16,7 +16,7 @@ We use it to understand how your project is set up and how to generate component You can create a `components.json` file in your project by running the following command: ```bash -npx shadcn-ui@latest init +npx buidl-cli@latest init ``` See the CLI section for more information. @@ -37,7 +37,7 @@ The style for your components. **This cannot be changed after initialization.** ```json title="components.json" { - "style": "default" | "new-york" + "style": "default" } ``` diff --git a/apps/www/content/docs/components/address.mdx b/apps/www/content/docs/components/address.mdx index 783a58e..653be36 100644 --- a/apps/www/content/docs/components/address.mdx +++ b/apps/www/content/docs/components/address.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add address +``` diff --git a/apps/www/content/docs/components/balance.mdx b/apps/www/content/docs/components/balance.mdx index 1f39c53..64743b9 100644 --- a/apps/www/content/docs/components/balance.mdx +++ b/apps/www/content/docs/components/balance.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add balance +``` diff --git a/apps/www/content/docs/components/block-explorer-link.mdx b/apps/www/content/docs/components/block-explorer-link.mdx index f6fdcfd..f1fac99 100644 --- a/apps/www/content/docs/components/block-explorer-link.mdx +++ b/apps/www/content/docs/components/block-explorer-link.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add block-explorer-link +``` diff --git a/apps/www/content/docs/components/block-number.mdx b/apps/www/content/docs/components/block-number.mdx index 753f35d..028c506 100644 --- a/apps/www/content/docs/components/block-number.mdx +++ b/apps/www/content/docs/components/block-number.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add block-number +``` diff --git a/apps/www/content/docs/components/blockie.mdx b/apps/www/content/docs/components/blockie.mdx index adbf19a..4194c4c 100644 --- a/apps/www/content/docs/components/blockie.mdx +++ b/apps/www/content/docs/components/blockie.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add blockie +``` diff --git a/apps/www/content/docs/components/ens-address.mdx b/apps/www/content/docs/components/ens-address.mdx index f91655d..5522a4f 100644 --- a/apps/www/content/docs/components/ens-address.mdx +++ b/apps/www/content/docs/components/ens-address.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add ens-address +``` diff --git a/apps/www/content/docs/components/ens-avatar.mdx b/apps/www/content/docs/components/ens-avatar.mdx index 542ba3b..2dc7999 100644 --- a/apps/www/content/docs/components/ens-avatar.mdx +++ b/apps/www/content/docs/components/ens-avatar.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add ens-avatar +``` diff --git a/apps/www/content/docs/components/ens-name.mdx b/apps/www/content/docs/components/ens-name.mdx index 85332fb..fe9326c 100644 --- a/apps/www/content/docs/components/ens-name.mdx +++ b/apps/www/content/docs/components/ens-name.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add ens-name +``` diff --git a/apps/www/content/docs/components/erc20-balance.mdx b/apps/www/content/docs/components/erc20-balance.mdx index 573f7bf..4ef7b02 100644 --- a/apps/www/content/docs/components/erc20-balance.mdx +++ b/apps/www/content/docs/components/erc20-balance.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc20-balance +``` diff --git a/apps/www/content/docs/components/erc20-decimals.mdx b/apps/www/content/docs/components/erc20-decimals.mdx index 5093f97..2c7370d 100644 --- a/apps/www/content/docs/components/erc20-decimals.mdx +++ b/apps/www/content/docs/components/erc20-decimals.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc20-decimals +``` diff --git a/apps/www/content/docs/components/erc20-name.mdx b/apps/www/content/docs/components/erc20-name.mdx index 9ba82a1..680dc60 100644 --- a/apps/www/content/docs/components/erc20-name.mdx +++ b/apps/www/content/docs/components/erc20-name.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc20-name +``` diff --git a/apps/www/content/docs/components/erc20-select-and-amount.mdx b/apps/www/content/docs/components/erc20-select-and-amount.mdx index 4620842..ee0ea40 100644 --- a/apps/www/content/docs/components/erc20-select-and-amount.mdx +++ b/apps/www/content/docs/components/erc20-select-and-amount.mdx @@ -11,22 +11,18 @@ component: true ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc20-select-and-amount +``` diff --git a/apps/www/content/docs/components/erc20-select.mdx b/apps/www/content/docs/components/erc20-select.mdx index 2eb0fd5..d5420c9 100644 --- a/apps/www/content/docs/components/erc20-select.mdx +++ b/apps/www/content/docs/components/erc20-select.mdx @@ -11,22 +11,18 @@ component: true ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc20-select +``` diff --git a/apps/www/content/docs/components/erc20-symbol.mdx b/apps/www/content/docs/components/erc20-symbol.mdx index 8567b51..1c0ab63 100644 --- a/apps/www/content/docs/components/erc20-symbol.mdx +++ b/apps/www/content/docs/components/erc20-symbol.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc20-symbol +``` diff --git a/apps/www/content/docs/components/erc20-total-supply.mdx b/apps/www/content/docs/components/erc20-total-supply.mdx index dde82ba..fdb3d93 100644 --- a/apps/www/content/docs/components/erc20-total-supply.mdx +++ b/apps/www/content/docs/components/erc20-total-supply.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc20-total-supply +``` diff --git a/apps/www/content/docs/components/erc721-metadata.mdx b/apps/www/content/docs/components/erc721-metadata.mdx index cfe1a6f..01c9952 100644 --- a/apps/www/content/docs/components/erc721-metadata.mdx +++ b/apps/www/content/docs/components/erc721-metadata.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc721-metadata +``` diff --git a/apps/www/content/docs/components/erc721-name.mdx b/apps/www/content/docs/components/erc721-name.mdx index eea1d5f..a580af1 100644 --- a/apps/www/content/docs/components/erc721-name.mdx +++ b/apps/www/content/docs/components/erc721-name.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc721-name +``` diff --git a/apps/www/content/docs/components/erc721-owner-of.mdx b/apps/www/content/docs/components/erc721-owner-of.mdx index 24743e0..dd45b60 100644 --- a/apps/www/content/docs/components/erc721-owner-of.mdx +++ b/apps/www/content/docs/components/erc721-owner-of.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc721-owner-of +``` diff --git a/apps/www/content/docs/components/erc721-symbol.mdx b/apps/www/content/docs/components/erc721-symbol.mdx index 8f75a5e..80a56e9 100644 --- a/apps/www/content/docs/components/erc721-symbol.mdx +++ b/apps/www/content/docs/components/erc721-symbol.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc721-symbol +``` diff --git a/apps/www/content/docs/components/erc721-token-uri.mdx b/apps/www/content/docs/components/erc721-token-uri.mdx index 2cf1f14..5ba07ff 100644 --- a/apps/www/content/docs/components/erc721-token-uri.mdx +++ b/apps/www/content/docs/components/erc721-token-uri.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc721-token-uri +``` diff --git a/apps/www/content/docs/components/erc721-total-supply.mdx b/apps/www/content/docs/components/erc721-total-supply.mdx index a2b7102..a3143cd 100644 --- a/apps/www/content/docs/components/erc721-total-supply.mdx +++ b/apps/www/content/docs/components/erc721-total-supply.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add erc721-total-supply +``` diff --git a/apps/www/content/docs/components/error-message.mdx b/apps/www/content/docs/components/error-message.mdx index 9152baa..7bbaacc 100644 --- a/apps/www/content/docs/components/error-message.mdx +++ b/apps/www/content/docs/components/error-message.mdx @@ -11,22 +11,18 @@ component: true ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add error-message +``` diff --git a/apps/www/content/docs/components/fee-data.mdx b/apps/www/content/docs/components/fee-data.mdx index 8c611f5..5ea8d96 100644 --- a/apps/www/content/docs/components/fee-data.mdx +++ b/apps/www/content/docs/components/fee-data.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add fee-data +``` diff --git a/apps/www/content/docs/components/image-ipfs.mdx b/apps/www/content/docs/components/image-ipfs.mdx index 8aea640..ed43ebe 100644 --- a/apps/www/content/docs/components/image-ipfs.mdx +++ b/apps/www/content/docs/components/image-ipfs.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add image-ipfs +``` diff --git a/apps/www/content/docs/components/is-wallet-connected.mdx b/apps/www/content/docs/components/is-wallet-connected.mdx index c7a04bd..9408e56 100644 --- a/apps/www/content/docs/components/is-wallet-connected.mdx +++ b/apps/www/content/docs/components/is-wallet-connected.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add is-wallet-connected +``` diff --git a/apps/www/content/docs/components/is-wallet-disconnected.mdx b/apps/www/content/docs/components/is-wallet-disconnected.mdx index 01d616b..ca67bf8 100644 --- a/apps/www/content/docs/components/is-wallet-disconnected.mdx +++ b/apps/www/content/docs/components/is-wallet-disconnected.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add is-wallet-disconnected +``` diff --git a/apps/www/content/docs/components/nonce.mdx b/apps/www/content/docs/components/nonce.mdx index d1f7574..143279c 100644 --- a/apps/www/content/docs/components/nonce.mdx +++ b/apps/www/content/docs/components/nonce.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add nonce +``` diff --git a/apps/www/content/docs/components/sign-message-button.mdx b/apps/www/content/docs/components/sign-message-button.mdx index e1e3302..9216553 100644 --- a/apps/www/content/docs/components/sign-message-button.mdx +++ b/apps/www/content/docs/components/sign-message-button.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add sign-message-button +``` diff --git a/apps/www/content/docs/components/transaction-status.mdx b/apps/www/content/docs/components/transaction-status.mdx index 0d40f23..d0ef4d6 100644 --- a/apps/www/content/docs/components/transaction-status.mdx +++ b/apps/www/content/docs/components/transaction-status.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add transaction-status +``` diff --git a/apps/www/content/docs/components/transaction.mdx b/apps/www/content/docs/components/transaction.mdx index 807505d..41e2a8f 100644 --- a/apps/www/content/docs/components/transaction.mdx +++ b/apps/www/content/docs/components/transaction.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add transaction +``` diff --git a/apps/www/content/docs/components/wallet-connect.mdx b/apps/www/content/docs/components/wallet-connect.mdx index 85daa6b..7974d33 100644 --- a/apps/www/content/docs/components/wallet-connect.mdx +++ b/apps/www/content/docs/components/wallet-connect.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add wallet-connect +``` diff --git a/apps/www/content/docs/components/wallet-disconnect.mdx b/apps/www/content/docs/components/wallet-disconnect.mdx index 275b2f2..8d3a641 100644 --- a/apps/www/content/docs/components/wallet-disconnect.mdx +++ b/apps/www/content/docs/components/wallet-disconnect.mdx @@ -13,22 +13,18 @@ wagmi: ## Installation - + + CLI Manual - - CLI (Coming Soon) - - - -Coming soon... - - +```bash +npx buidl-cli@latest add wallet-disconnect +``` diff --git a/apps/www/content/docs/installation/astro.mdx b/apps/www/content/docs/installation/astro.mdx index 311bfba..838680e 100644 --- a/apps/www/content/docs/installation/astro.mdx +++ b/apps/www/content/docs/installation/astro.mdx @@ -84,7 +84,7 @@ Add the following code to the `tsconfig.json` file to resolve paths: Run the `shadcn-ui` init command to setup your project: ```bash -npx shadcn-ui@latest init +npx buidl-cli@latest init ``` ### Configure components.json @@ -129,7 +129,7 @@ export default defineConfig({ ### Update tailwind.config.mjs -When running `npx shadcn-ui@latest init`, your tailwind config for content will be overwritten. To fix this, change the `module.exports` to `export default` and the `content` section with the code below to your `tailwind.config.mjs` file: +When running `npx buidl-cli@latest init`, your tailwind config for content will be overwritten. To fix this, change the `module.exports` to `export default` and the `content` section with the code below to your `tailwind.config.mjs` file: ```js {1-4} showLineNumbers export default { @@ -142,7 +142,7 @@ export default { You can now start adding components to your project. ```bash -npx shadcn-ui@latest add button +npx buidl-cli@latest add button ``` The command above will add the `Button` component to your project. You can then import it like this: diff --git a/apps/www/content/docs/installation/gatsby.mdx b/apps/www/content/docs/installation/gatsby.mdx index 184e0f9..6dcaf11 100644 --- a/apps/www/content/docs/installation/gatsby.mdx +++ b/apps/www/content/docs/installation/gatsby.mdx @@ -76,7 +76,7 @@ export const onCreateWebpackConfig = ({ actions }) => { Run the `shadcn-ui` init command to setup your project: ```bash -npx shadcn-ui@latest init +npx buidl-cli@latest init ``` ### Configure components.json @@ -100,7 +100,7 @@ Are you using React Server Components? › no You can now start adding components to your project. ```bash -npx shadcn-ui@latest add button +npx buidl-cli@latest add button ``` The command above will add the `Button` component to your project. You can then import it like this: diff --git a/apps/www/content/docs/installation/laravel.mdx b/apps/www/content/docs/installation/laravel.mdx index e2ef0bf..d81a63c 100644 --- a/apps/www/content/docs/installation/laravel.mdx +++ b/apps/www/content/docs/installation/laravel.mdx @@ -18,7 +18,7 @@ laravel new my-app --typescript --breeze --stack=react --git --no-interaction Run the `shadcn-ui` init command to setup your project: ```bash -npx shadcn-ui@latest init +npx buidl-cli@latest init ``` ### Configure components.json @@ -133,7 +133,7 @@ export default { You can now start adding components to your project. ```bash -npx shadcn-ui@latest add button +npx buidl-cli@latest add button ``` The command above will add the `Button` component to your project. You can then import it like this: diff --git a/apps/www/content/docs/installation/next.mdx b/apps/www/content/docs/installation/next.mdx index 0e4375b..ca41f85 100644 --- a/apps/www/content/docs/installation/next.mdx +++ b/apps/www/content/docs/installation/next.mdx @@ -18,7 +18,7 @@ npx create-next-app@latest my-app --typescript --tailwind --eslint Run the `shadcn-ui` init command to setup your project: ```bash -npx shadcn-ui@latest init +npx buidl-cli@latest init ``` ### Configure components.json @@ -131,7 +131,7 @@ Here's how I structure my Next.js apps. You can use this as a reference: You can now start adding components to your project. ```bash -npx shadcn-ui@latest add button +npx buidl-cli@latest add button ``` The command above will add the `Button` component to your project. You can then import it like this: diff --git a/apps/www/content/docs/installation/remix.mdx b/apps/www/content/docs/installation/remix.mdx index a2e8965..e1bf6e0 100644 --- a/apps/www/content/docs/installation/remix.mdx +++ b/apps/www/content/docs/installation/remix.mdx @@ -18,7 +18,7 @@ npx create-remix@latest my-app Run the `shadcn-ui` init command to setup your project: ```bash -npx shadcn-ui@latest init +npx buidl-cli@latest init ``` ### Configure components.json @@ -97,7 +97,7 @@ export const links: LinksFunction = () => [ You can now start adding components to your project. ```bash -npx shadcn-ui@latest add button +npx buidl-cli@latest add button ``` The command above will add the `Button` component to your project. You can then import it like this: diff --git a/apps/www/content/docs/installation/vite.mdx b/apps/www/content/docs/installation/vite.mdx index eddceef..78b4d13 100644 --- a/apps/www/content/docs/installation/vite.mdx +++ b/apps/www/content/docs/installation/vite.mdx @@ -71,7 +71,7 @@ export default defineConfig({ Run the `shadcn-ui` init command to setup your project: ```bash -npx shadcn-ui@latest init +npx buidl-cli@latest init ``` ### Configure components.json @@ -95,7 +95,7 @@ Are you using React Server Components? › no / yes (no) You can now start adding components to your project. ```bash -npx shadcn-ui@latest add button +npx buidl-cli@latest add button ``` The command above will add the `Button` component to your project. You can then import it like this: diff --git a/apps/www/public/registry/index.json b/apps/www/public/registry/index.json index 92af59d..07b5afe 100644 --- a/apps/www/public/registry/index.json +++ b/apps/www/public/registry/index.json @@ -123,7 +123,8 @@ { "name": "blockie", "dependencies": [ - "wagmi" + "wagmi", + "ethereum-blockies-base64" ], "registryDependencies": [ "skeleton" @@ -444,6 +445,37 @@ ], "type": "components:ui" }, + { + "name": "card", + "files": [ + "ui/card.tsx" + ], + "type": "components:ui" + }, + { + "name": "input", + "files": [ + "ui/input.tsx" + ], + "type": "components:ui" + }, + { + "name": "label", + "files": [ + "ui/label.tsx" + ], + "type": "components:ui" + }, + { + "name": "select", + "dependencies": [ + "@radix-ui/react-select" + ], + "files": [ + "ui/select.tsx" + ], + "type": "components:ui" + }, { "name": "dialog", "dependencies": [ diff --git a/apps/www/public/registry/styles/default/blockie.json b/apps/www/public/registry/styles/default/blockie.json index 7d92c0e..b02bfb5 100644 --- a/apps/www/public/registry/styles/default/blockie.json +++ b/apps/www/public/registry/styles/default/blockie.json @@ -1,7 +1,8 @@ { "name": "blockie", "dependencies": [ - "wagmi" + "wagmi", + "ethereum-blockies-base64" ], "registryDependencies": [ "skeleton" diff --git a/apps/www/public/registry/styles/default/card.json b/apps/www/public/registry/styles/default/card.json index 97d2f67..ef31d3a 100644 --- a/apps/www/public/registry/styles/default/card.json +++ b/apps/www/public/registry/styles/default/card.json @@ -7,4 +7,4 @@ } ], "type": "components:ui" -} +} \ No newline at end of file diff --git a/apps/www/public/registry/styles/default/input.json b/apps/www/public/registry/styles/default/input.json index 24bbdb7..762ccf0 100644 --- a/apps/www/public/registry/styles/default/input.json +++ b/apps/www/public/registry/styles/default/input.json @@ -7,4 +7,4 @@ } ], "type": "components:ui" -} +} \ No newline at end of file diff --git a/apps/www/public/registry/styles/default/label.json b/apps/www/public/registry/styles/default/label.json index c01524b..15ef67d 100644 --- a/apps/www/public/registry/styles/default/label.json +++ b/apps/www/public/registry/styles/default/label.json @@ -1,6 +1,5 @@ { "name": "label", - "dependencies": ["@radix-ui/react-label"], "files": [ { "name": "label.tsx", @@ -8,4 +7,4 @@ } ], "type": "components:ui" -} +} \ No newline at end of file diff --git a/apps/www/public/registry/styles/default/select.json b/apps/www/public/registry/styles/default/select.json index b3f19ba..00e10e9 100644 --- a/apps/www/public/registry/styles/default/select.json +++ b/apps/www/public/registry/styles/default/select.json @@ -1,6 +1,8 @@ { "name": "select", - "dependencies": ["@radix-ui/react-select"], + "dependencies": [ + "@radix-ui/react-select" + ], "files": [ { "name": "select.tsx", @@ -8,4 +10,4 @@ } ], "type": "components:ui" -} +} \ No newline at end of file diff --git a/apps/www/public/registry/styles/default/sign-message-button.json b/apps/www/public/registry/styles/default/sign-message-button.json index ff45ab7..eeb3ee0 100644 --- a/apps/www/public/registry/styles/default/sign-message-button.json +++ b/apps/www/public/registry/styles/default/sign-message-button.json @@ -10,7 +10,7 @@ "files": [ { "name": "sign-message-button.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { useSignMessage } from \"wagmi\"\n\nimport { ErrorMessage } from \"@/registry/default/buidl/error-message\"\nimport { Button, ButtonProps } from \"@/registry/default/ui/button\"\n\ninterface SignMessageButtonProps extends Omit {\n message: string\n displayError?: boolean\n onSuccess?: (signature: string) => void\n}\n\nconst SignMessageButton = React.forwardRef<\n HTMLButtonElement,\n SignMessageButtonProps\n>(({ message, onSuccess, className, children, disabled, displayError=true, ...props }, ref) => {\n const { isLoading, isError, error, signMessage } = useSignMessage({\n message,\n onSuccess,\n })\n\n return (\n <>\n signMessage()}\n className={className}\n {...props}\n >\n {isLoading ? \"Check Wallet\" : children ?? \"Sign Message\"}\n \n {isError && displayError && (\n \n )}\n \n )\n})\n\nSignMessageButton.displayName = \"SignMessageButton\"\n\nexport { SignMessageButton }\n" + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { useSignMessage } from \"wagmi\"\n\nimport { ErrorMessage } from \"@/registry/default/buidl/error-message\"\nimport { Button, ButtonProps } from \"@/registry/default/ui/button\"\n\ninterface SignMessageButtonProps extends Omit {\n message: string\n displayError?: boolean\n onSuccess?: (signature: string) => void\n}\n\nconst SignMessageButton = React.forwardRef<\n HTMLButtonElement,\n SignMessageButtonProps\n>(\n (\n {\n message,\n onSuccess,\n className,\n children,\n disabled,\n displayError = true,\n ...props\n },\n ref\n ) => {\n const { isLoading, isError, error, signMessage } = useSignMessage({\n message,\n onSuccess,\n })\n\n return (\n <>\n signMessage()}\n className={className}\n {...props}\n >\n {isLoading ? \"Check Wallet\" : children ?? \"Sign Message\"}\n \n {isError && displayError && (\n \n )}\n \n )\n }\n)\n\nSignMessageButton.displayName = \"SignMessageButton\"\n\nexport { SignMessageButton }\n" } ], "type": "components:buidl" diff --git a/apps/www/registry/default/example/card-with-form.tsx b/apps/www/registry/default/example/card-with-form.tsx new file mode 100644 index 0000000..31c960e --- /dev/null +++ b/apps/www/registry/default/example/card-with-form.tsx @@ -0,0 +1,59 @@ +import * as React from "react" + +import { Button } from "@/registry/default/ui/button" +import { + Card, + CardContent, + CardDescription, + CardFooter, + CardHeader, + CardTitle, +} from "@/registry/default/ui/card" +import { Input } from "@/registry/default/ui/input" +import { Label } from "@/registry/default/ui/label" +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/registry/default/ui/select" + +export default function CardWithForm() { + return ( + + + Create project + Deploy your new project in one-click. + + +
+
+
+ + +
+
+ + +
+
+
+
+ + + + +
+ ) +} diff --git a/apps/www/registry/registry.ts b/apps/www/registry/registry.ts index 7016975..9aeeb33 100644 --- a/apps/www/registry/registry.ts +++ b/apps/www/registry/registry.ts @@ -7,6 +7,27 @@ const ui: Registry = [ dependencies: ["@radix-ui/react-slot"], files: ["ui/button.tsx"], }, + { + name: "card", + type: "components:ui", + files: ["ui/card.tsx"], + }, + { + name: "input", + type: "components:ui", + files: ["ui/input.tsx"], + }, + { + name: "label", + type: "components:ui", + files: ["ui/label.tsx"], + }, + { + name: "select", + type: "components:ui", + dependencies: ["@radix-ui/react-select"], + files: ["ui/select.tsx"], + }, { name: "dialog", type: "components:ui", @@ -92,7 +113,7 @@ const buidl: Registry = [ { name: "blockie", type: "components:buidl", - dependencies: ["wagmi"], + dependencies: ["wagmi", "ethereum-blockies-base64"], registryDependencies: ["skeleton"], files: ["buidl/blockie.tsx"], }, @@ -453,6 +474,12 @@ const example: Registry = [ registryDependencies: ["error-message"], files: ["example/error-message-demo.tsx"], }, + { + name: "card-with-form", + type: "components:example", + registryDependencies: ["button", "card", "input", "label", "select"], + files: ["example/card-with-form.tsx"], + }, ] export const registry: Registry = [...buidl, ...ui, ...example]