diff --git a/examples/react/package.json b/examples/react/package.json index 80e4b42f..fa12f424 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -5,8 +5,7 @@ "homepage": "kit", "type": "module", "scripts": { - "dev": "pnpm start", - "start": "vite", + "dev": "vite", "build": "vite build && touch ./dist/.nojekyll", "serve": "vite preview", "typecheck": "tsc --noEmit" diff --git a/package.json b/package.json index 8b8acabf..8d79e425 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,11 @@ "license": "Apache-2.0", "sideEffects": false, "scripts": { - "build": "turbo build", - "clean": "rimraf -g ./**/node_modules", - "dist:clean": "rimraf -g ./packages/**/dist", - "test": "pnpm -r test", + "dev": "turbo run dev --filter=./examples/react", + "build": "turbo run build --filter={packages/kit}", + "build:clean": "turbo run build:clean", + "reinstall": "rimraf -g ./**/node_modules && pnpm install", + "test": "turbo run test", "lint": "eslint -c .eslintrc.js 'packages/**/src/**/*.{ts,tsx}'", "lint:fix": "eslint -c .eslintrc.js --fix 'packages/**/src/**/*.{ts,tsx}'", "format": "prettier --list-different --write './{packages,examples}/*/src/**/*.{ts,tsx}'", @@ -47,12 +48,9 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "rimraf": "^5.0.5", + "turbo": "1.13.3", "typescript": "~5.4.5", "wagmi": "^2.5.20" }, - "resolutions": {}, - "workspaces": [ - "packages/*", - "examples/*" - ] + "resolutions": {} } diff --git a/packages/checkout/package.json b/packages/checkout/package.json index 5482bd5d..eedad843 100644 --- a/packages/checkout/package.json +++ b/packages/checkout/package.json @@ -3,13 +3,29 @@ "version": "2.6.1", "description": "Checkout UI for Sequence Kit", "repository": "https://github.com/0xsequence/kit/tree/master/packages/checkout", - "main": "dist/0xsequence-kit-checkout.cjs.js", - "module": "dist/0xsequence-kit-checkout.esm.js", - "types": "dist/0xsequence-kit-checkout.cjs.d.ts", "author": "Horizon Blockchain Games", "license": "Apache-2.0", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/types/index.d.ts", + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/esm/index.js", + "default": "./dist/esm/index.js" + } + }, + "files": [ + "src", + "dist" + ], "scripts": { - "build": "echo 'hi'", + "build": "pnpm build:clean && pnpm build:esm && pnpm build:cjs && pnpm build:types", + "build:cjs": "tsc --module commonjs --outDir dist/cjs/", + "build:esm": "tsc --module es2022 --outDir dist/esm/", + "build:types": "tsc --declaration --emitDeclarationOnly --outDir dist/types/", + "build:clean": "rimraf -g ./dist", "test": "echo", "typecheck": "tsc --noEmit" }, @@ -42,9 +58,5 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "wagmi": "^2.5.20" - }, - "files": [ - "src", - "dist" - ] + } } diff --git a/packages/checkout/tsconfig.json b/packages/checkout/tsconfig.json index a667e322..3669afd5 100644 --- a/packages/checkout/tsconfig.json +++ b/packages/checkout/tsconfig.json @@ -1,30 +1,24 @@ { "compilerOptions": { - "target": "es2021", - "module": "esnext", - "moduleResolution": "node", - "declaration": true, "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "target": "es2022", "allowJs": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, + "resolveJsonModule": true, + "moduleDetection": "force", "isolatedModules": true, - "skipLibCheck": true, - "jsx": "react-jsx", - "typeRoots": [ - "node_modules/@types", - "src/types" - ], - "types": [ - "node" - ], - "baseUrl": "./", - "paths": { - "~/*": ["src/*"] - } + // "verbatimModuleSyntax": true, + "strict": true, + // "noUncheckedIndexedAccess": true, + // "noImplicitOverride": true, + "module": "ESNext", + "moduleResolution": "Node", + "sourceMap": true, + "declaration": false, + // "composite": true, + // "declarationMap": true, + "lib": ["es2022", "dom", "dom.iterable"], + "jsx": "react-jsx" }, "include": ["./src/**/*.ts", "./src/**/*.tsx"] } diff --git a/packages/connectors/package.json b/packages/connectors/package.json index b59ae52d..5265a5f8 100644 --- a/packages/connectors/package.json +++ b/packages/connectors/package.json @@ -3,13 +3,29 @@ "version": "2.6.1", "description": "Wallets for Sequence Kit", "repository": "https://github.com/0xsequence/kit/tree/master/packages/connectors", - "main": "dist/0xsequence-kit-connectors.cjs.js", - "module": "dist/0xsequence-kit-connectors.esm.js", - "types": "dist/0xsequence-kit-connectors.cjs.d.ts", "author": "Horizon Blockchain Games", "license": "Apache-2.0", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/types/index.d.ts", + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/esm/index.js", + "default": "./dist/esm/index.js" + } + }, + "files": [ + "src", + "dist" + ], "scripts": { - "build": "echo 'hi'", + "build": "pnpm build:clean && pnpm build:esm && pnpm build:cjs && pnpm build:types", + "build:cjs": "tsc --module commonjs --outDir dist/cjs/", + "build:esm": "tsc --module es2022 --outDir dist/esm/", + "build:types": "tsc --declaration --emitDeclarationOnly --outDir dist/types/", + "build:clean": "rimraf -g ./dist", "test": "echo", "typecheck": "tsc --noEmit" }, @@ -34,9 +50,5 @@ "uuid": ">=8.3.2", "viem": ">=2.0.0", "wagmi": ">=2.0.0" - }, - "files": [ - "src", - "dist" - ] + } } diff --git a/packages/connectors/tsconfig.json b/packages/connectors/tsconfig.json new file mode 100644 index 00000000..3669afd5 --- /dev/null +++ b/packages/connectors/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "skipLibCheck": true, + "target": "es2022", + "allowJs": true, + "resolveJsonModule": true, + "moduleDetection": "force", + "isolatedModules": true, + // "verbatimModuleSyntax": true, + "strict": true, + // "noUncheckedIndexedAccess": true, + // "noImplicitOverride": true, + "module": "ESNext", + "moduleResolution": "Node", + "sourceMap": true, + "declaration": false, + // "composite": true, + // "declarationMap": true, + "lib": ["es2022", "dom", "dom.iterable"], + "jsx": "react-jsx" + }, + "include": ["./src/**/*.ts", "./src/**/*.tsx"] +} diff --git a/packages/kit/package.json b/packages/kit/package.json index e538378e..040e99bc 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -8,17 +8,29 @@ "wallet" ], "repository": "https://github.com/0xsequence/kit/tree/master/packages/kit", - "main": "dist/0xsequence-kit.cjs.js", - "module": "dist/0xsequence-kit.esm.js", - "types": "dist/0xsequence-kit.cjs.d.ts", "author": "Horizon Blockchain Games", "license": "Apache-2.0", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/types/index.d.ts", + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/esm/index.js", + "default": "./dist/esm/index.js" + } + }, "files": [ "src", "dist" ], "scripts": { - "build": "echo 'hi'", + "build": "pnpm build:clean && pnpm build:esm && pnpm build:cjs && pnpm build:types", + "build:cjs": "tsc --module commonjs --outDir dist/cjs/", + "build:esm": "tsc --module es2022 --outDir dist/esm/", + "build:types": "tsc --declaration --emitDeclarationOnly --outDir dist/types/", + "build:clean": "rimraf -g ./dist", "test": "echo", "typecheck": "tsc --noEmit" }, diff --git a/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx b/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx index 0823314a..5058062c 100644 --- a/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx +++ b/packages/kit/src/components/KitProvider/ConnectWalletContent/index.tsx @@ -29,6 +29,12 @@ import { KitConnectProviderProps } from '../index' import { Banner } from './Banner' import { ExtendedWalletList } from './ExtendedWalletList' +declare global { + interface Window { + ethereum: any + } +} + interface ConnectWalletContentProps extends KitConnectProviderProps { openConnectModal: boolean setOpenConnectModal: React.Dispatch> diff --git a/packages/kit/tsconfig.json b/packages/kit/tsconfig.json new file mode 100644 index 00000000..3669afd5 --- /dev/null +++ b/packages/kit/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "skipLibCheck": true, + "target": "es2022", + "allowJs": true, + "resolveJsonModule": true, + "moduleDetection": "force", + "isolatedModules": true, + // "verbatimModuleSyntax": true, + "strict": true, + // "noUncheckedIndexedAccess": true, + // "noImplicitOverride": true, + "module": "ESNext", + "moduleResolution": "Node", + "sourceMap": true, + "declaration": false, + // "composite": true, + // "declarationMap": true, + "lib": ["es2022", "dom", "dom.iterable"], + "jsx": "react-jsx" + }, + "include": ["./src/**/*.ts", "./src/**/*.tsx"] +} diff --git a/packages/wallet/package.json b/packages/wallet/package.json index d9808a96..7401569c 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -3,13 +3,29 @@ "version": "2.6.1", "description": "Wallet UI for Sequence Kit", "repository": "https://github.com/0xsequence/kit/tree/master/packages/wallet", - "main": "dist/0xsequence-kit-wallet.cjs.js", - "module": "dist/0xsequence-kit-wallet.esm.js", - "types": "dist/0xsequence-kit-wallet.cjs.d.ts", "author": "Horizon Blockchain Games", "license": "Apache-2.0", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/types/index.d.ts", + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/esm/index.js", + "default": "./dist/esm/index.js" + } + }, + "files": [ + "src", + "dist" + ], "scripts": { - "build": "echo 'hi'", + "build": "pnpm build:clean && pnpm build:esm && pnpm build:cjs && pnpm build:types", + "build:cjs": "tsc --module commonjs --outDir dist/cjs/", + "build:esm": "tsc --module es2022 --outDir dist/esm/", + "build:types": "tsc --declaration --emitDeclarationOnly --outDir dist/types/", + "build:clean": "rimraf -g ./dist", "test": "echo", "typecheck": "tsc --noEmit" }, @@ -46,9 +62,5 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "wagmi": "^2.5.20" - }, - "files": [ - "src", - "dist" - ] + } } diff --git a/packages/wallet/tsconfig.json b/packages/wallet/tsconfig.json index a667e322..3669afd5 100644 --- a/packages/wallet/tsconfig.json +++ b/packages/wallet/tsconfig.json @@ -1,30 +1,24 @@ { "compilerOptions": { - "target": "es2021", - "module": "esnext", - "moduleResolution": "node", - "declaration": true, "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "target": "es2022", "allowJs": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, + "resolveJsonModule": true, + "moduleDetection": "force", "isolatedModules": true, - "skipLibCheck": true, - "jsx": "react-jsx", - "typeRoots": [ - "node_modules/@types", - "src/types" - ], - "types": [ - "node" - ], - "baseUrl": "./", - "paths": { - "~/*": ["src/*"] - } + // "verbatimModuleSyntax": true, + "strict": true, + // "noUncheckedIndexedAccess": true, + // "noImplicitOverride": true, + "module": "ESNext", + "moduleResolution": "Node", + "sourceMap": true, + "declaration": false, + // "composite": true, + // "declarationMap": true, + "lib": ["es2022", "dom", "dom.iterable"], + "jsx": "react-jsx" }, "include": ["./src/**/*.ts", "./src/**/*.tsx"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7c6b7b89..3f3c5fba 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -68,6 +68,9 @@ importers: rimraf: specifier: ^5.0.5 version: 5.0.5 + turbo: + specifier: 1.13.3 + version: 1.13.3 typescript: specifier: ~5.4.5 version: 5.4.5 @@ -6832,6 +6835,40 @@ packages: engines: {node: '>=8.0.0'} hasBin: true + turbo-darwin-64@1.13.3: + resolution: {integrity: sha512-glup8Qx1qEFB5jerAnXbS8WrL92OKyMmg5Hnd4PleLljAeYmx+cmmnsmLT7tpaVZIN58EAAwu8wHC6kIIqhbWA==} + cpu: [x64] + os: [darwin] + + turbo-darwin-arm64@1.13.3: + resolution: {integrity: sha512-/np2xD+f/+9qY8BVtuOQXRq5f9LehCFxamiQnwdqWm5iZmdjygC5T3uVSYuagVFsZKMvX3ycySwh8dylGTl6lg==} + cpu: [arm64] + os: [darwin] + + turbo-linux-64@1.13.3: + resolution: {integrity: sha512-G+HGrau54iAnbXLfl+N/PynqpDwi/uDzb6iM9hXEDG+yJnSJxaHMShhOkXYJPk9offm9prH33Khx2scXrYVW1g==} + cpu: [x64] + os: [linux] + + turbo-linux-arm64@1.13.3: + resolution: {integrity: sha512-qWwEl5VR02NqRyl68/3pwp3c/olZuSp+vwlwrunuoNTm6JXGLG5pTeme4zoHNnk0qn4cCX7DFrOboArlYxv0wQ==} + cpu: [arm64] + os: [linux] + + turbo-windows-64@1.13.3: + resolution: {integrity: sha512-Nudr4bRChfJzBPzEmpVV85VwUYRCGKecwkBFpbp2a4NtrJ3+UP1VZES653ckqCu2FRyRuS0n03v9euMbAvzH+Q==} + cpu: [x64] + os: [win32] + + turbo-windows-arm64@1.13.3: + resolution: {integrity: sha512-ouJCgsVLd3icjRLmRvHQDDZnmGzT64GBupM1Y+TjtYn2LVaEBoV6hicFy8x5DUpnqdLy+YpCzRMkWlwhmkX7sQ==} + cpu: [arm64] + os: [win32] + + turbo@1.13.3: + resolution: {integrity: sha512-n17HJv4F4CpsYTvKzUJhLbyewbXjq1oLCi90i5tW1TiWDz16ML1eDG7wi5dHaKxzh5efIM56SITnuVbMq5dk4g==} + hasBin: true + type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -15785,6 +15822,33 @@ snapshots: wcwidth: 1.0.1 yargs: 17.7.2 + turbo-darwin-64@1.13.3: + optional: true + + turbo-darwin-arm64@1.13.3: + optional: true + + turbo-linux-64@1.13.3: + optional: true + + turbo-linux-arm64@1.13.3: + optional: true + + turbo-windows-64@1.13.3: + optional: true + + turbo-windows-arm64@1.13.3: + optional: true + + turbo@1.13.3: + optionalDependencies: + turbo-darwin-64: 1.13.3 + turbo-darwin-arm64: 1.13.3 + turbo-linux-64: 1.13.3 + turbo-linux-arm64: 1.13.3 + turbo-windows-64: 1.13.3 + turbo-windows-arm64: 1.13.3 + type-check@0.4.0: dependencies: prelude-ls: 1.2.1 diff --git a/tsconfig.json b/tsconfig.json index 2ff69d57..bd91216f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,6 @@ "isolatedModules": true, "skipLibCheck": true, "jsx": "react-jsx", - "typeRoots": ["node_modules/@types"], "types": ["node"] }, "include": ["./packages/**/src/**/*.ts", "./packages/**/src/**/*.tsx"] diff --git a/turbo.json b/turbo.json index 90014c4f..57f59878 100644 --- a/turbo.json +++ b/turbo.json @@ -1,12 +1,12 @@ { "$schema": "https://turbo.build/schema.json", + "experimentalUI": true, "pipeline": { "build": { - "dependsOn": ["^build"] - }, - "deploy": { - "dependsOn": ["build", "test", "lint"] + "dependsOn": ["^build"], + "outputs": ["dist/**"] }, + "build:clean": {}, "test": { "dependsOn": ["build"] },