@farcaster/create-mini-app 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
 
2
2
  
3
- > @farcaster/create-mini-app@0.0.5 build /Users/deodad/Repos/frames/packages/create-mini-app
3
+ > @farcaster/create-mini-app@0.0.6 build /Users/deodad/Repos/frames/packages/create-mini-app
4
4
  > pnpm run clean && tsc --project tsconfig.build.json
5
5
 
6
6
 
7
- > @farcaster/create-mini-app@0.0.5 clean /Users/deodad/Repos/frames/packages/create-mini-app
7
+ > @farcaster/create-mini-app@0.0.6 clean /Users/deodad/Repos/frames/packages/create-mini-app
8
8
  > rm -rf dist tsconfig.tsbuildinfo
9
9
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @farcaster/create-mini-app
2
2
 
3
+ ## 0.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`79e0b7a`](https://github.com/farcasterxyz/frames/commit/79e0b7aed34a9623aaace90677eafda8e4e1f09c) Thanks [@deodad](https://github.com/deodad)! - fixed lint warnings
8
+
3
9
  ## 0.0.6
4
10
 
5
11
  ### Patch Changes
package/asd/README.md ADDED
@@ -0,0 +1 @@
1
+ This is a [Vite](https://vitejs.dev) project bootstrapped with [`@farcaster/create-mini-app`](https://github.com/farcasterxyz/frames/tree/main/packages/create-mini-app).
package/asd/biome.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "formatter": {
3
+ "enabled": true,
4
+ "indentStyle": "space",
5
+ "lineWidth": 120
6
+ },
7
+ "linter": {
8
+ "enabled": true
9
+ },
10
+ "organizeImports": {
11
+ "enabled": true
12
+ }
13
+ }
package/asd/index.html ADDED
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Create Mini App</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.tsx"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "asd",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc && vite build",
9
+ "lint": "biome check src",
10
+ "preview": "vite preview"
11
+ },
12
+ "dependencies": {
13
+ "@farcaster/frame-sdk": "latest",
14
+ "@farcaster/frame-wagmi-connector": "latest",
15
+ "@tanstack/react-query": "5.45.1",
16
+ "react": "^18.3.1",
17
+ "react-dom": "^18.3.1",
18
+ "viem": "latest",
19
+ "wagmi": "latest"
20
+ },
21
+ "devDependencies": {
22
+ "@biomejs/biome": "^1.8.0",
23
+ "@types/react": "^18.3.1",
24
+ "@types/react-dom": "^18.3.0",
25
+ "@vitejs/plugin-react": "^4.2.1",
26
+ "@wagmi/cli": "latest",
27
+ "typescript": "^5.4.5",
28
+ "vite": "^5.2.11"
29
+ }
30
+ }
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,67 @@
1
+ import { sdk } from '@farcaster/frame-sdk'
2
+ import { useEffect } from 'react'
3
+ import { useAccount, useConnect, useSignMessage } from 'wagmi'
4
+
5
+ function App() {
6
+ useEffect(() => {
7
+ sdk.actions.ready()
8
+ }, [])
9
+
10
+ return (
11
+ <>
12
+ <div>Mini App + Vite + TS + React + Wagmi</div>
13
+ <ConnectMenu />
14
+ </>
15
+ )
16
+ }
17
+
18
+ function ConnectMenu() {
19
+ const { isConnected, address } = useAccount()
20
+ const { connect, connectors } = useConnect()
21
+
22
+ if (isConnected) {
23
+ return (
24
+ <>
25
+ <div>Connected account:</div>
26
+ <div>{address}</div>
27
+ <SignButton />
28
+ </>
29
+ )
30
+ }
31
+
32
+ return (
33
+ <button type="button" onClick={() => connect({ connector: connectors[0] })}>
34
+ Connect
35
+ </button>
36
+ )
37
+ }
38
+
39
+ function SignButton() {
40
+ const { signMessage, isPending, data, error } = useSignMessage()
41
+
42
+ return (
43
+ <>
44
+ <button
45
+ type="button"
46
+ onClick={() => signMessage({ message: 'hello world' })}
47
+ disabled={isPending}
48
+ >
49
+ {isPending ? 'Signing...' : 'Sign message'}
50
+ </button>
51
+ {data && (
52
+ <>
53
+ <div>Signature</div>
54
+ <div>{data}</div>
55
+ </>
56
+ )}
57
+ {error && (
58
+ <>
59
+ <div>Error</div>
60
+ <div>{error.message}</div>
61
+ </>
62
+ )}
63
+ </>
64
+ )
65
+ }
66
+
67
+ export default App
@@ -0,0 +1,21 @@
1
+ :root {
2
+ background-color: #181818;
3
+ color: rgba(255, 255, 255, 0.87);
4
+ color-scheme: light dark;
5
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
6
+ font-synthesis: none;
7
+ font-weight: 400;
8
+ line-height: 1.5;
9
+ text-rendering: optimizeLegibility;
10
+
11
+ -webkit-font-smoothing: antialiased;
12
+ -moz-osx-font-smoothing: grayscale;
13
+ -webkit-text-size-adjust: 100%;
14
+ }
15
+
16
+ @media (prefers-color-scheme: light) {
17
+ :root {
18
+ background-color: #f8f8f8;
19
+ color: #181818;
20
+ }
21
+ }
@@ -0,0 +1,21 @@
1
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
2
+ import React from 'react'
3
+ import ReactDOM from 'react-dom/client'
4
+ import { WagmiProvider } from 'wagmi'
5
+
6
+ import App from './App.tsx'
7
+ import { config } from './wagmi.ts'
8
+
9
+ import './index.css'
10
+
11
+ const queryClient = new QueryClient()
12
+
13
+ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
14
+ <React.StrictMode>
15
+ <WagmiProvider config={config}>
16
+ <QueryClientProvider client={queryClient}>
17
+ <App />
18
+ </QueryClientProvider>
19
+ </WagmiProvider>
20
+ </React.StrictMode>,
21
+ )
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,18 @@
1
+ import { farcasterFrame } from '@farcaster/frame-wagmi-connector'
2
+ import { http, createConfig } from 'wagmi'
3
+ import { base, mainnet } from 'wagmi/chains'
4
+
5
+ export const config = createConfig({
6
+ chains: [base, mainnet],
7
+ connectors: [farcasterFrame()],
8
+ transports: {
9
+ [base.id]: http(),
10
+ [mainnet.id]: http(),
11
+ },
12
+ })
13
+
14
+ declare module 'wagmi' {
15
+ interface Register {
16
+ config: typeof config
17
+ }
18
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true,
15
+ "jsx": "react-jsx",
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "noFallthroughCasesInSwitch": true
22
+ },
23
+ "include": ["src"],
24
+ "references": [{ "path": "./tsconfig.node.json" }]
25
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "skipLibCheck": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowSyntheticDefaultImports": true
8
+ },
9
+ "include": ["vite.config.ts"]
10
+ }
@@ -0,0 +1,10 @@
1
+ import react from '@vitejs/plugin-react'
2
+ import { defineConfig } from 'vite'
3
+
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [react()],
7
+ server: {
8
+ allowedHosts: true,
9
+ },
10
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farcaster/create-mini-app",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Create Farcaster Mini Apps with one command",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,23 +1,23 @@
1
- import { sdk } from '@farcaster/frame-sdk'
2
- import { useEffect } from 'react'
3
- import { useAccount, useConnect, useSignMessage } from 'wagmi'
1
+ import { sdk } from "@farcaster/frame-sdk";
2
+ import { useEffect } from "react";
3
+ import { useAccount, useConnect, useSignMessage } from "wagmi";
4
4
 
5
5
  function App() {
6
6
  useEffect(() => {
7
- sdk.actions.ready()
8
- }, [])
7
+ sdk.actions.ready();
8
+ }, []);
9
9
 
10
10
  return (
11
11
  <>
12
12
  <div>Mini App + Vite + TS + React + Wagmi</div>
13
13
  <ConnectMenu />
14
14
  </>
15
- )
15
+ );
16
16
  }
17
17
 
18
18
  function ConnectMenu() {
19
- const { isConnected, address } = useAccount()
20
- const { connect, connectors } = useConnect()
19
+ const { isConnected, address } = useAccount();
20
+ const { connect, connectors } = useConnect();
21
21
 
22
22
  if (isConnected) {
23
23
  return (
@@ -26,27 +26,23 @@ function ConnectMenu() {
26
26
  <div>{address}</div>
27
27
  <SignButton />
28
28
  </>
29
- )
29
+ );
30
30
  }
31
31
 
32
32
  return (
33
33
  <button type="button" onClick={() => connect({ connector: connectors[0] })}>
34
34
  Connect
35
35
  </button>
36
- )
36
+ );
37
37
  }
38
38
 
39
39
  function SignButton() {
40
- const { signMessage, isPending, data, error } = useSignMessage()
40
+ const { signMessage, isPending, data, error } = useSignMessage();
41
41
 
42
42
  return (
43
43
  <>
44
- <button
45
- type="button"
46
- onClick={() => signMessage({ message: 'hello world' })}
47
- disabled={isPending}
48
- >
49
- {isPending ? 'Signing...' : 'Sign message'}
44
+ <button type="button" onClick={() => signMessage({ message: "hello world" })} disabled={isPending}>
45
+ {isPending ? "Signing..." : "Sign message"}
50
46
  </button>
51
47
  {data && (
52
48
  <>
@@ -61,7 +57,7 @@ function SignButton() {
61
57
  </>
62
58
  )}
63
59
  </>
64
- )
60
+ );
65
61
  }
66
62
 
67
- export default App
63
+ export default App;
@@ -1,16 +1,16 @@
1
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
2
- import React from 'react'
3
- import ReactDOM from 'react-dom/client'
4
- import { WagmiProvider } from 'wagmi'
1
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
2
+ import React from "react";
3
+ import ReactDOM from "react-dom/client";
4
+ import { WagmiProvider } from "wagmi";
5
5
 
6
- import App from './App.tsx'
7
- import { config } from './wagmi.ts'
6
+ import App from "./App.tsx";
7
+ import { config } from "./wagmi.ts";
8
8
 
9
- import './index.css'
9
+ import "./index.css";
10
10
 
11
- const queryClient = new QueryClient()
11
+ const queryClient = new QueryClient();
12
12
 
13
- ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
13
+ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
14
14
  <React.StrictMode>
15
15
  <WagmiProvider config={config}>
16
16
  <QueryClientProvider client={queryClient}>
@@ -18,4 +18,4 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
18
18
  </QueryClientProvider>
19
19
  </WagmiProvider>
20
20
  </React.StrictMode>,
21
- )
21
+ );
@@ -1,6 +1,6 @@
1
- import { farcasterFrame } from '@farcaster/frame-wagmi-connector'
2
- import { http, createConfig } from 'wagmi'
3
- import { base, mainnet } from 'wagmi/chains'
1
+ import { farcasterFrame } from "@farcaster/frame-wagmi-connector";
2
+ import { http, createConfig } from "wagmi";
3
+ import { base, mainnet } from "wagmi/chains";
4
4
 
5
5
  export const config = createConfig({
6
6
  chains: [base, mainnet],
@@ -9,10 +9,10 @@ export const config = createConfig({
9
9
  [base.id]: http(),
10
10
  [mainnet.id]: http(),
11
11
  },
12
- })
12
+ });
13
13
 
14
- declare module 'wagmi' {
14
+ declare module "wagmi" {
15
15
  interface Register {
16
- config: typeof config
16
+ config: typeof config;
17
17
  }
18
18
  }
@@ -1,5 +1,5 @@
1
- import react from '@vitejs/plugin-react'
2
- import { defineConfig } from 'vite'
1
+ import react from "@vitejs/plugin-react";
2
+ import { defineConfig } from "vite";
3
3
 
4
4
  // https://vitejs.dev/config/
5
5
  export default defineConfig({
@@ -7,4 +7,4 @@ export default defineConfig({
7
7
  server: {
8
8
  allowedHosts: true,
9
9
  },
10
- })
10
+ });