diff --git a/examples/components/package.json b/examples/components/package.json new file mode 100644 index 00000000..9e683397 --- /dev/null +++ b/examples/components/package.json @@ -0,0 +1,13 @@ +{ + "name": "@0xsequence/kit-example-shared-components", + "exports": { + ".": "./src/index.ts" + }, + "dependencies": { + "typescript": "latest" + }, + "peerDependencies": { + "@0xsequence/design-system": "*", + "wagmi": "*" + } +} diff --git a/examples/react/src/components/Header.tsx b/examples/components/src/Header.tsx similarity index 100% rename from examples/react/src/components/Header.tsx rename to examples/components/src/Header.tsx diff --git a/examples/components/src/index.ts b/examples/components/src/index.ts new file mode 100644 index 00000000..e0e2673a --- /dev/null +++ b/examples/components/src/index.ts @@ -0,0 +1 @@ +export { Header } from './Header' diff --git a/examples/components/tsconfig.json b/examples/components/tsconfig.json new file mode 100644 index 00000000..411367e1 --- /dev/null +++ b/examples/components/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "preserveWatchOutput": true, + "skipLibCheck": true, + "noEmit": true, + "strict": true, + "jsx": "react-jsx" + }, + "exclude": ["node_modules"] +} diff --git a/examples/react/package.json b/examples/react/package.json index 5eceed04..ae3857f4 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -16,6 +16,7 @@ "@0xsequence/kit-checkout": "workspace:*", "@0xsequence/kit-connectors": "workspace:*", "@0xsequence/kit-wallet": "workspace:*", + "@0xsequence/kit-example-shared-components": "workspace:*", "@0xsequence/network": "^1.9.27", "@tanstack/react-query": "^5.37.1", "framer-motion": "^8.5.2", diff --git a/examples/react/src/components/Connected.tsx b/examples/react/src/components/Connected.tsx index b28d3af3..c37d8151 100644 --- a/examples/react/src/components/Connected.tsx +++ b/examples/react/src/components/Connected.tsx @@ -20,6 +20,7 @@ import { getModalPositionCss } from '@0xsequence/kit' import { useCheckoutModal, useAddFundsModal } from '@0xsequence/kit-checkout' +import { Header } from '@0xsequence/kit-example-shared-components' import { useOpenWalletModal } from '@0xsequence/kit-wallet' import { allNetworks, ChainId } from '@0xsequence/network' import { ethers } from 'ethers' @@ -41,8 +42,6 @@ import { import { messageToSign, abi } from '../constants' import { delay, getCheckoutSettings } from '../utils' -import { Header } from './Header' - // append ?debug to url to enable debug mode const searchParams = new URLSearchParams(location.search) const isDebugMode = searchParams.has('debug') diff --git a/examples/react/tsconfig.json b/examples/react/tsconfig.json index 6f3e83f2..0870318d 100644 --- a/examples/react/tsconfig.json +++ b/examples/react/tsconfig.json @@ -1,11 +1,7 @@ { "compilerOptions": { "target": "ESNext", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, @@ -14,14 +10,12 @@ "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "Bundler", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", - "types": ["vite/client", "vite-plugin-svgr/client"], + "types": ["vite/client", "vite-plugin-svgr/client"] }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8831a423..1b7136f6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,6 +78,18 @@ importers: specifier: ^2.9.5 version: 2.9.5(@tanstack/query-core@5.36.1)(@tanstack/react-query@5.37.1(react@18.3.1))(@types/react@18.3.2)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-i18next@13.5.0(i18next@22.5.1)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5(@babel/core@7.24.5))(@types/react@18.3.2)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@6.0.4))(react@18.3.1))(react-native@0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5(@babel/core@7.24.5))(@types/react@18.3.2)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@6.0.4))(react@18.3.1)(rollup@4.18.0)(typescript@5.4.5)(utf-8-validate@6.0.4)(viem@2.12.0(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@6.0.4)(zod@3.23.8))(zod@3.23.8) + examples/components: + dependencies: + '@0xsequence/design-system': + specifier: '*' + version: 1.7.1(@types/react-dom@18.3.0)(@types/react@18.3.2)(framer-motion@8.5.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + typescript: + specifier: latest + version: 5.4.5 + wagmi: + specifier: '*' + version: 2.9.5(@tanstack/query-core@5.36.1)(@tanstack/react-query@5.37.1(react@18.3.1))(@types/react@18.3.2)(bufferutil@4.0.8)(react-dom@18.3.1(react@18.3.1))(react-i18next@13.5.0(i18next@22.5.1)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5(@babel/core@7.24.5))(@types/react@18.3.2)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@6.0.4))(react@18.3.1))(react-native@0.74.1(@babel/core@7.24.5)(@babel/preset-env@7.24.5(@babel/core@7.24.5))(@types/react@18.3.2)(bufferutil@4.0.8)(react@18.3.1)(utf-8-validate@6.0.4))(react@18.3.1)(rollup@4.18.0)(typescript@5.4.5)(utf-8-validate@6.0.4)(viem@2.12.0(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@6.0.4)(zod@3.23.8))(zod@3.23.8) + examples/next: dependencies: '@0xsequence/design-system': @@ -153,6 +165,9 @@ importers: '@0xsequence/kit-connectors': specifier: workspace:* version: link:../../packages/connectors + '@0xsequence/kit-example-shared-components': + specifier: workspace:* + version: link:../components '@0xsequence/kit-wallet': specifier: workspace:* version: link:../../packages/wallet @@ -6297,6 +6312,7 @@ packages: rimraf@2.6.3: resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rimraf@3.0.2: