From 313dd9700f92e34e57f7417b3d0aa702cf8cbb61 Mon Sep 17 00:00:00 2001 From: JunichiSugiura Date: Thu, 12 Dec 2024 13:13:28 +0900 Subject: [PATCH 01/24] Setup vite to Keychain --- packages/keychain/index.html | 60 +++ packages/keychain/package.json | 11 +- packages/keychain/src/components/app.tsx | 25 ++ .../keychain/src/components/connect/index.tsx | 1 + .../{pages/index.tsx => components/home.tsx} | 26 +- packages/keychain/src/main.tsx | 0 packages/keychain/tsconfig.json | 5 +- packages/keychain/vite.config.ts | 18 + pnpm-lock.yaml | 366 +++++++++++++++++- 9 files changed, 477 insertions(+), 35 deletions(-) create mode 100644 packages/keychain/index.html create mode 100644 packages/keychain/src/components/app.tsx rename packages/keychain/src/{pages/index.tsx => components/home.tsx} (86%) create mode 100644 packages/keychain/src/main.tsx create mode 100644 packages/keychain/vite.config.ts diff --git a/packages/keychain/index.html b/packages/keychain/index.html new file mode 100644 index 000000000..4e4a2065c --- /dev/null +++ b/packages/keychain/index.html @@ -0,0 +1,60 @@ + + + + Cartridge Controller + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/packages/keychain/package.json b/packages/keychain/package.json index 896cade6e..ce480f9c9 100644 --- a/packages/keychain/package.json +++ b/packages/keychain/package.json @@ -3,10 +3,10 @@ "version": "0.5.6", "private": true, "scripts": { - "dev": "TARGET_ORIGIN=\"*\" next dev -p 3001", - "build": "TARGET_ORIGIN=\"https://x.cartridge.gg/\" next build", - "start": "next start", - "lint": "next lint", + "dev": "TARGET_ORIGIN=\"*\" vite -p 3001", + "build": "TARGET_ORIGIN=\"https://x.cartridge.gg/\" vite build", + "preview": "vite preview", + "lint": "eslint .", "format": "prettier --write --ignore-path .gitignore .", "format:check": "prettier --check --ignore-path .gitignore .", "test": "jest --watch", @@ -44,6 +44,7 @@ "react": "^18.3.1", "react-dom": "^18.2.0", "react-query": "^3.39.2", + "react-router-dom": "^6.27.0", "use-sound": "^4.0.1", "usehooks-ts": "^2.9.1", "viem": "^1.20.2", @@ -67,6 +68,7 @@ "@types/js-cookie": "^3.0.2", "@types/node": "^20.6.0", "@types/react-dom": "^18.3.1", + "@vitejs/plugin-react-swc": "^3.5.0", "autoprefixer": "^10.4.18", "concurrently": "^9.0.1", "eslint": "^8.23.0", @@ -81,6 +83,7 @@ "storybook": "^8.2.9", "tailwindcss": "^3.4.3", "typescript": "^5.4.5", + "vite": "^6.0.3", "wait-on": "^8.0.1" }, "peerDependencies": { diff --git a/packages/keychain/src/components/app.tsx b/packages/keychain/src/components/app.tsx new file mode 100644 index 000000000..51f13d925 --- /dev/null +++ b/packages/keychain/src/components/app.tsx @@ -0,0 +1,25 @@ +import { Outlet, Route, Routes, Navigate } from "react-router-dom"; + +export function App() { + return ( + + }> + } /> + }> + } /> + } + /> + } + /> + + Success} /> + Failure} /> + Page not found} /> + + + ); +} diff --git a/packages/keychain/src/components/connect/index.tsx b/packages/keychain/src/components/connect/index.tsx index a95dd524b..3792a1571 100644 --- a/packages/keychain/src/components/connect/index.tsx +++ b/packages/keychain/src/components/connect/index.tsx @@ -4,3 +4,4 @@ export * from "./CreateSession"; export * from "./RegisterSession"; export * from "./Logout"; export * from "./SessionConsent"; +export * from "./Upgrade"; diff --git a/packages/keychain/src/pages/index.tsx b/packages/keychain/src/components/home.tsx similarity index 86% rename from packages/keychain/src/pages/index.tsx rename to packages/keychain/src/components/home.tsx index f8b56fe30..92be6a0a3 100644 --- a/packages/keychain/src/pages/index.tsx +++ b/packages/keychain/src/components/home.tsx @@ -1,20 +1,20 @@ import dynamic from "next/dynamic"; import { Signature } from "starknet"; -import { ResponseCodes } from "@cartridge/controller"; -import { DeployController, ConfirmTransaction, SignMessage } from "components"; -import { CreateController, CreateSession, Logout } from "components/connect"; -import { useConnection } from "hooks/connection"; -import { DeployCtx, SignMessageCtx } from "utils/connection"; -import { LoginMode } from "components/connect/types"; -import { ErrorPage } from "components/ErrorBoundary"; -import { Settings } from "components/Settings"; -import { Upgrade } from "components/connect/Upgrade"; -import { PurchaseCredits } from "components/Funding/PurchaseCredits"; import { useEffect, useState } from "react"; import { usePostHog } from "posthog-js/react"; -import { PageLoading } from "components/Loading"; - -function Home() { +import { ResponseCodes } from "@cartridge/controller"; +import { useConnection } from "@/hooks/connection"; +import { DeployCtx, SignMessageCtx } from "@/utils/connection"; +import { SignMessage } from "./SignMessage"; +import { ConfirmTransaction } from "./ConfirmTransaction"; +import { DeployController } from "./DeployController" +import { CreateController, CreateSession, Logout, Upgrade } from "./connect"; +import { LoginMode } from "./connect/types"; +import { ErrorPage } from "./ErrorBoundary"; +import { Settings } from "./Settings"; +import { PurchaseCredits } from "./Funding/PurchaseCredits"; + +export function Home() { const { context, controller, error, policies, upgrade } = useConnection(); const [hasSessionForPolicies, setHasSessionForPolicies] = useState< boolean | undefined diff --git a/packages/keychain/src/main.tsx b/packages/keychain/src/main.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/packages/keychain/tsconfig.json b/packages/keychain/tsconfig.json index e1279a9bd..272c13a91 100644 --- a/packages/keychain/tsconfig.json +++ b/packages/keychain/tsconfig.json @@ -5,7 +5,10 @@ "baseUrl": "./src", "rootDir": ".", "types": ["@emotion/react/types/css-prop"], - "noEmit": true + "noEmit": true, + "paths": { + "@/*": ["./src/*"] + }, }, "include": [ "next-env.d.ts", diff --git a/packages/keychain/vite.config.ts b/packages/keychain/vite.config.ts new file mode 100644 index 000000000..6c1cd5527 --- /dev/null +++ b/packages/keychain/vite.config.ts @@ -0,0 +1,18 @@ +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react-swc"; +import process from "node:process"; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [react()], + server: { + port: process.env.NODE_ENV === "development" ? 3003 : undefined, + }, + resolve: { + alias: { + "@": "/src", + }, + }, + root: "./", + publicDir: "public", +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ddde73e51..f72cb6c91 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,7 +26,7 @@ importers: version: 2.8.8 tsup: specifier: ^8.0.1 - version: 8.3.0(@microsoft/api-extractor@7.43.0(@types/node@16.18.11))(@swc/core@1.7.35(@swc/helpers@0.5.5))(jiti@2.3.3)(postcss@8.4.47)(tsx@4.19.2)(typescript@4.9.5)(yaml@2.5.1) + version: 8.3.0(@microsoft/api-extractor@7.43.0(@types/node@16.18.11))(@swc/core@1.7.35(@swc/helpers@0.5.5))(jiti@2.3.3)(postcss@8.4.49)(tsx@4.19.2)(typescript@4.9.5)(yaml@2.5.1) turbo: specifier: ^2.0.12 version: 2.1.3 @@ -178,7 +178,7 @@ importers: version: link:../tsconfig tsup: specifier: ^8.0.1 - version: 8.3.0(@microsoft/api-extractor@7.43.0(@types/node@22.10.1))(@swc/core@1.7.35(@swc/helpers@0.5.5))(jiti@2.3.3)(postcss@8.4.47)(tsx@4.19.2)(typescript@5.5.4)(yaml@2.5.1) + version: 8.3.0(@microsoft/api-extractor@7.43.0(@types/node@22.10.1))(@swc/core@1.7.35(@swc/helpers@0.5.5))(jiti@2.3.3)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.5.4)(yaml@2.5.1) typescript: specifier: ^5.0.3 version: 5.5.4 @@ -340,6 +340,9 @@ importers: react-query: specifier: ^3.39.2 version: 3.39.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-router-dom: + specifier: ^6.27.0 + version: 6.27.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) starknet: specifier: ^6.11.0 version: 6.11.0 @@ -407,6 +410,9 @@ importers: '@types/react-dom': specifier: ^18.3.1 version: 18.3.1 + '@vitejs/plugin-react-swc': + specifier: ^3.5.0 + version: 3.7.1(@swc/helpers@0.5.5)(vite@6.0.3(@types/node@20.16.11)(jiti@2.3.3)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1)) autoprefixer: specifier: ^10.4.18 version: 10.4.20(postcss@8.4.47) @@ -449,6 +455,9 @@ importers: typescript: specifier: ^5.4.5 version: 5.5.4 + vite: + specifier: ^6.0.3 + version: 6.0.3(@types/node@20.16.11)(jiti@2.3.3)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1) wait-on: specifier: ^8.0.1 version: 8.0.1 @@ -1853,6 +1862,12 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/aix-ppc64@0.24.0': + resolution: {integrity: sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/android-arm64@0.18.20': resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} @@ -1871,6 +1886,12 @@ packages: cpu: [arm64] os: [android] + '@esbuild/android-arm64@0.24.0': + resolution: {integrity: sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm@0.18.20': resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} @@ -1889,6 +1910,12 @@ packages: cpu: [arm] os: [android] + '@esbuild/android-arm@0.24.0': + resolution: {integrity: sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-x64@0.18.20': resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} @@ -1907,6 +1934,12 @@ packages: cpu: [x64] os: [android] + '@esbuild/android-x64@0.24.0': + resolution: {integrity: sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/darwin-arm64@0.18.20': resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} @@ -1925,6 +1958,12 @@ packages: cpu: [arm64] os: [darwin] + '@esbuild/darwin-arm64@0.24.0': + resolution: {integrity: sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-x64@0.18.20': resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} @@ -1943,6 +1982,12 @@ packages: cpu: [x64] os: [darwin] + '@esbuild/darwin-x64@0.24.0': + resolution: {integrity: sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/freebsd-arm64@0.18.20': resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} @@ -1961,6 +2006,12 @@ packages: cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-arm64@0.24.0': + resolution: {integrity: sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-x64@0.18.20': resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} @@ -1979,6 +2030,12 @@ packages: cpu: [x64] os: [freebsd] + '@esbuild/freebsd-x64@0.24.0': + resolution: {integrity: sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/linux-arm64@0.18.20': resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} @@ -1997,6 +2054,12 @@ packages: cpu: [arm64] os: [linux] + '@esbuild/linux-arm64@0.24.0': + resolution: {integrity: sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm@0.18.20': resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} @@ -2015,6 +2078,12 @@ packages: cpu: [arm] os: [linux] + '@esbuild/linux-arm@0.24.0': + resolution: {integrity: sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-ia32@0.18.20': resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} @@ -2033,6 +2102,12 @@ packages: cpu: [ia32] os: [linux] + '@esbuild/linux-ia32@0.24.0': + resolution: {integrity: sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-loong64@0.18.20': resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} @@ -2051,6 +2126,12 @@ packages: cpu: [loong64] os: [linux] + '@esbuild/linux-loong64@0.24.0': + resolution: {integrity: sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-mips64el@0.18.20': resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} @@ -2069,6 +2150,12 @@ packages: cpu: [mips64el] os: [linux] + '@esbuild/linux-mips64el@0.24.0': + resolution: {integrity: sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-ppc64@0.18.20': resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} @@ -2087,6 +2174,12 @@ packages: cpu: [ppc64] os: [linux] + '@esbuild/linux-ppc64@0.24.0': + resolution: {integrity: sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-riscv64@0.18.20': resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} @@ -2105,6 +2198,12 @@ packages: cpu: [riscv64] os: [linux] + '@esbuild/linux-riscv64@0.24.0': + resolution: {integrity: sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-s390x@0.18.20': resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} @@ -2123,6 +2222,12 @@ packages: cpu: [s390x] os: [linux] + '@esbuild/linux-s390x@0.24.0': + resolution: {integrity: sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-x64@0.18.20': resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} @@ -2141,6 +2246,12 @@ packages: cpu: [x64] os: [linux] + '@esbuild/linux-x64@0.24.0': + resolution: {integrity: sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + '@esbuild/netbsd-x64@0.18.20': resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} @@ -2159,12 +2270,24 @@ packages: cpu: [x64] os: [netbsd] + '@esbuild/netbsd-x64@0.24.0': + resolution: {integrity: sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + '@esbuild/openbsd-arm64@0.23.1': resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-arm64@0.24.0': + resolution: {integrity: sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-x64@0.18.20': resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} @@ -2183,6 +2306,12 @@ packages: cpu: [x64] os: [openbsd] + '@esbuild/openbsd-x64@0.24.0': + resolution: {integrity: sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + '@esbuild/sunos-x64@0.18.20': resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} @@ -2201,6 +2330,12 @@ packages: cpu: [x64] os: [sunos] + '@esbuild/sunos-x64@0.24.0': + resolution: {integrity: sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/win32-arm64@0.18.20': resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} @@ -2219,6 +2354,12 @@ packages: cpu: [arm64] os: [win32] + '@esbuild/win32-arm64@0.24.0': + resolution: {integrity: sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-ia32@0.18.20': resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} @@ -2237,6 +2378,12 @@ packages: cpu: [ia32] os: [win32] + '@esbuild/win32-ia32@0.24.0': + resolution: {integrity: sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-x64@0.18.20': resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} @@ -2255,6 +2402,12 @@ packages: cpu: [x64] os: [win32] + '@esbuild/win32-x64@0.24.0': + resolution: {integrity: sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@eslint-community/eslint-utils@4.4.0': resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -7531,6 +7684,11 @@ packages: engines: {node: '>=18'} hasBin: true + esbuild@0.24.0: + resolution: {integrity: sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==} + engines: {node: '>=18'} + hasBin: true + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -10263,6 +10421,9 @@ packages: picocolors@1.1.0: resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} @@ -10498,6 +10659,10 @@ packages: resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} engines: {node: ^10 || ^12 || >=14} + postcss@8.4.49: + resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} + engines: {node: ^10 || ^12 || >=14} + posthog-js@1.181.0: resolution: {integrity: sha512-bI+J+f4E8x4JwbGtG6LReQv1Xvss01F6cs7UDlvffHySpVhNq4ptkNjV88B92IVEsrCtNYhy/TjFnGxk6RN0Qw==} @@ -12568,6 +12733,46 @@ packages: terser: optional: true + vite@6.0.3: + resolution: {integrity: sha512-Cmuo5P0ENTN6HxLSo6IHsjCLn/81Vgrp81oaiFFMRa8gGDj5xEjIcEpf2ZymZtZR8oU0P2JX5WuUp/rlXcHkAw==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + jiti: '>=1.21.0' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + vitefu@0.2.5: resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} peerDependencies: @@ -14278,6 +14483,9 @@ snapshots: '@esbuild/aix-ppc64@0.23.1': optional: true + '@esbuild/aix-ppc64@0.24.0': + optional: true + '@esbuild/android-arm64@0.18.20': optional: true @@ -14287,6 +14495,9 @@ snapshots: '@esbuild/android-arm64@0.23.1': optional: true + '@esbuild/android-arm64@0.24.0': + optional: true + '@esbuild/android-arm@0.18.20': optional: true @@ -14296,6 +14507,9 @@ snapshots: '@esbuild/android-arm@0.23.1': optional: true + '@esbuild/android-arm@0.24.0': + optional: true + '@esbuild/android-x64@0.18.20': optional: true @@ -14305,6 +14519,9 @@ snapshots: '@esbuild/android-x64@0.23.1': optional: true + '@esbuild/android-x64@0.24.0': + optional: true + '@esbuild/darwin-arm64@0.18.20': optional: true @@ -14314,6 +14531,9 @@ snapshots: '@esbuild/darwin-arm64@0.23.1': optional: true + '@esbuild/darwin-arm64@0.24.0': + optional: true + '@esbuild/darwin-x64@0.18.20': optional: true @@ -14323,6 +14543,9 @@ snapshots: '@esbuild/darwin-x64@0.23.1': optional: true + '@esbuild/darwin-x64@0.24.0': + optional: true + '@esbuild/freebsd-arm64@0.18.20': optional: true @@ -14332,6 +14555,9 @@ snapshots: '@esbuild/freebsd-arm64@0.23.1': optional: true + '@esbuild/freebsd-arm64@0.24.0': + optional: true + '@esbuild/freebsd-x64@0.18.20': optional: true @@ -14341,6 +14567,9 @@ snapshots: '@esbuild/freebsd-x64@0.23.1': optional: true + '@esbuild/freebsd-x64@0.24.0': + optional: true + '@esbuild/linux-arm64@0.18.20': optional: true @@ -14350,6 +14579,9 @@ snapshots: '@esbuild/linux-arm64@0.23.1': optional: true + '@esbuild/linux-arm64@0.24.0': + optional: true + '@esbuild/linux-arm@0.18.20': optional: true @@ -14359,6 +14591,9 @@ snapshots: '@esbuild/linux-arm@0.23.1': optional: true + '@esbuild/linux-arm@0.24.0': + optional: true + '@esbuild/linux-ia32@0.18.20': optional: true @@ -14368,6 +14603,9 @@ snapshots: '@esbuild/linux-ia32@0.23.1': optional: true + '@esbuild/linux-ia32@0.24.0': + optional: true + '@esbuild/linux-loong64@0.18.20': optional: true @@ -14377,6 +14615,9 @@ snapshots: '@esbuild/linux-loong64@0.23.1': optional: true + '@esbuild/linux-loong64@0.24.0': + optional: true + '@esbuild/linux-mips64el@0.18.20': optional: true @@ -14386,6 +14627,9 @@ snapshots: '@esbuild/linux-mips64el@0.23.1': optional: true + '@esbuild/linux-mips64el@0.24.0': + optional: true + '@esbuild/linux-ppc64@0.18.20': optional: true @@ -14395,6 +14639,9 @@ snapshots: '@esbuild/linux-ppc64@0.23.1': optional: true + '@esbuild/linux-ppc64@0.24.0': + optional: true + '@esbuild/linux-riscv64@0.18.20': optional: true @@ -14404,6 +14651,9 @@ snapshots: '@esbuild/linux-riscv64@0.23.1': optional: true + '@esbuild/linux-riscv64@0.24.0': + optional: true + '@esbuild/linux-s390x@0.18.20': optional: true @@ -14413,6 +14663,9 @@ snapshots: '@esbuild/linux-s390x@0.23.1': optional: true + '@esbuild/linux-s390x@0.24.0': + optional: true + '@esbuild/linux-x64@0.18.20': optional: true @@ -14422,6 +14675,9 @@ snapshots: '@esbuild/linux-x64@0.23.1': optional: true + '@esbuild/linux-x64@0.24.0': + optional: true + '@esbuild/netbsd-x64@0.18.20': optional: true @@ -14431,9 +14687,15 @@ snapshots: '@esbuild/netbsd-x64@0.23.1': optional: true + '@esbuild/netbsd-x64@0.24.0': + optional: true + '@esbuild/openbsd-arm64@0.23.1': optional: true + '@esbuild/openbsd-arm64@0.24.0': + optional: true + '@esbuild/openbsd-x64@0.18.20': optional: true @@ -14443,6 +14705,9 @@ snapshots: '@esbuild/openbsd-x64@0.23.1': optional: true + '@esbuild/openbsd-x64@0.24.0': + optional: true + '@esbuild/sunos-x64@0.18.20': optional: true @@ -14452,6 +14717,9 @@ snapshots: '@esbuild/sunos-x64@0.23.1': optional: true + '@esbuild/sunos-x64@0.24.0': + optional: true + '@esbuild/win32-arm64@0.18.20': optional: true @@ -14461,6 +14729,9 @@ snapshots: '@esbuild/win32-arm64@0.23.1': optional: true + '@esbuild/win32-arm64@0.24.0': + optional: true + '@esbuild/win32-ia32@0.18.20': optional: true @@ -14470,6 +14741,9 @@ snapshots: '@esbuild/win32-ia32@0.23.1': optional: true + '@esbuild/win32-ia32@0.24.0': + optional: true + '@esbuild/win32-x64@0.18.20': optional: true @@ -14479,6 +14753,9 @@ snapshots: '@esbuild/win32-x64@0.23.1': optional: true + '@esbuild/win32-x64@0.24.0': + optional: true + '@eslint-community/eslint-utils@4.4.0(eslint@8.57.1)': dependencies: eslint: 8.57.1 @@ -19391,6 +19668,13 @@ snapshots: transitivePeerDependencies: - '@swc/helpers' + '@vitejs/plugin-react-swc@3.7.1(@swc/helpers@0.5.5)(vite@6.0.3(@types/node@20.16.11)(jiti@2.3.3)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1))': + dependencies: + '@swc/core': 1.7.35(@swc/helpers@0.5.5) + vite: 6.0.3(@types/node@20.16.11)(jiti@2.3.3)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1) + transitivePeerDependencies: + - '@swc/helpers' + '@vitejs/plugin-react@3.1.0(vite@4.5.5(@types/node@20.16.11)(terser@5.34.1))': dependencies: '@babel/core': 7.25.8 @@ -22106,6 +22390,33 @@ snapshots: '@esbuild/win32-ia32': 0.23.1 '@esbuild/win32-x64': 0.23.1 + esbuild@0.24.0: + optionalDependencies: + '@esbuild/aix-ppc64': 0.24.0 + '@esbuild/android-arm': 0.24.0 + '@esbuild/android-arm64': 0.24.0 + '@esbuild/android-x64': 0.24.0 + '@esbuild/darwin-arm64': 0.24.0 + '@esbuild/darwin-x64': 0.24.0 + '@esbuild/freebsd-arm64': 0.24.0 + '@esbuild/freebsd-x64': 0.24.0 + '@esbuild/linux-arm': 0.24.0 + '@esbuild/linux-arm64': 0.24.0 + '@esbuild/linux-ia32': 0.24.0 + '@esbuild/linux-loong64': 0.24.0 + '@esbuild/linux-mips64el': 0.24.0 + '@esbuild/linux-ppc64': 0.24.0 + '@esbuild/linux-riscv64': 0.24.0 + '@esbuild/linux-s390x': 0.24.0 + '@esbuild/linux-x64': 0.24.0 + '@esbuild/netbsd-x64': 0.24.0 + '@esbuild/openbsd-arm64': 0.24.0 + '@esbuild/openbsd-x64': 0.24.0 + '@esbuild/sunos-x64': 0.24.0 + '@esbuild/win32-arm64': 0.24.0 + '@esbuild/win32-ia32': 0.24.0 + '@esbuild/win32-x64': 0.24.0 + escalade@3.2.0: {} escape-html@1.0.3: {} @@ -22136,8 +22447,8 @@ snapshots: '@typescript-eslint/parser': 5.62.0(eslint@8.57.1)(typescript@5.5.4) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 2.7.1(eslint-plugin-import@2.31.0(eslint@8.57.1))(eslint@8.57.1) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.5.4))(eslint-import-resolver-typescript@2.7.1(eslint-plugin-import@2.31.0(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 2.7.1(eslint-plugin-import@2.31.0)(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.5.4))(eslint-import-resolver-typescript@2.7.1)(eslint@8.57.1) eslint-plugin-jsx-a11y: 6.10.0(eslint@8.57.1) eslint-plugin-react: 7.37.1(eslint@8.57.1) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.1) @@ -22163,11 +22474,11 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@2.7.1(eslint-plugin-import@2.31.0(eslint@8.57.1))(eslint@8.57.1): + eslint-import-resolver-typescript@2.7.1(eslint-plugin-import@2.31.0)(eslint@8.57.1): dependencies: debug: 4.3.7 eslint: 8.57.1 - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.5.4))(eslint-import-resolver-typescript@2.7.1(eslint-plugin-import@2.31.0(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.5.4))(eslint-import-resolver-typescript@2.7.1)(eslint@8.57.1) glob: 7.2.3 is-glob: 4.0.3 resolve: 1.22.8 @@ -22182,11 +22493,11 @@ snapshots: '@typescript-eslint/parser': 5.62.0(eslint@8.57.1)(typescript@5.5.4) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 2.7.1(eslint-plugin-import@2.31.0(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 2.7.1(eslint-plugin-import@2.31.0)(eslint@8.57.1) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.5.4))(eslint-import-resolver-typescript@2.7.1(eslint-plugin-import@2.31.0(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.5.4))(eslint-import-resolver-typescript@2.7.1)(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -24558,7 +24869,7 @@ snapshots: launch-editor@2.9.1: dependencies: - picocolors: 1.1.0 + picocolors: 1.1.1 shell-quote: 1.8.1 optional: true @@ -25508,6 +25819,8 @@ snapshots: picocolors@1.1.0: {} + picocolors@1.1.1: {} + picomatch@2.3.1: {} picomatch@4.0.2: {} @@ -25651,12 +25964,12 @@ snapshots: postcss: 8.4.47 ts-node: 10.9.2(@swc/core@1.7.35(@swc/helpers@0.5.5))(@types/node@22.10.1)(typescript@5.5.4) - postcss-load-config@6.0.1(jiti@2.3.3)(postcss@8.4.47)(tsx@4.19.2)(yaml@2.5.1): + postcss-load-config@6.0.1(jiti@2.3.3)(postcss@8.4.49)(tsx@4.19.2)(yaml@2.5.1): dependencies: lilconfig: 3.1.2 optionalDependencies: jiti: 2.3.3 - postcss: 8.4.47 + postcss: 8.4.49 tsx: 4.19.2 yaml: 2.5.1 @@ -25734,6 +26047,12 @@ snapshots: picocolors: 1.1.0 source-map-js: 1.2.1 + postcss@8.4.49: + dependencies: + nanoid: 3.3.7 + picocolors: 1.1.1 + source-map-js: 1.2.1 + posthog-js@1.181.0: dependencies: core-js: 3.39.0 @@ -27533,7 +27852,7 @@ snapshots: tslib@2.7.0: {} - tsup@8.3.0(@microsoft/api-extractor@7.43.0(@types/node@16.18.11))(@swc/core@1.7.35(@swc/helpers@0.5.5))(jiti@2.3.3)(postcss@8.4.47)(tsx@4.19.2)(typescript@4.9.5)(yaml@2.5.1): + tsup@8.3.0(@microsoft/api-extractor@7.43.0(@types/node@16.18.11))(@swc/core@1.7.35(@swc/helpers@0.5.5))(jiti@2.3.3)(postcss@8.4.49)(tsx@4.19.2)(typescript@4.9.5)(yaml@2.5.1): dependencies: bundle-require: 5.0.0(esbuild@0.23.1) cac: 6.7.14 @@ -27544,7 +27863,7 @@ snapshots: execa: 5.1.1 joycon: 3.1.1 picocolors: 1.1.0 - postcss-load-config: 6.0.1(jiti@2.3.3)(postcss@8.4.47)(tsx@4.19.2)(yaml@2.5.1) + postcss-load-config: 6.0.1(jiti@2.3.3)(postcss@8.4.49)(tsx@4.19.2)(yaml@2.5.1) resolve-from: 5.0.0 rollup: 4.24.0 source-map: 0.8.0-beta.0 @@ -27554,7 +27873,7 @@ snapshots: optionalDependencies: '@microsoft/api-extractor': 7.43.0(@types/node@16.18.11) '@swc/core': 1.7.35(@swc/helpers@0.5.5) - postcss: 8.4.47 + postcss: 8.4.49 typescript: 4.9.5 transitivePeerDependencies: - jiti @@ -27562,7 +27881,7 @@ snapshots: - tsx - yaml - tsup@8.3.0(@microsoft/api-extractor@7.43.0(@types/node@22.10.1))(@swc/core@1.7.35(@swc/helpers@0.5.5))(jiti@2.3.3)(postcss@8.4.47)(tsx@4.19.2)(typescript@5.5.4)(yaml@2.5.1): + tsup@8.3.0(@microsoft/api-extractor@7.43.0(@types/node@22.10.1))(@swc/core@1.7.35(@swc/helpers@0.5.5))(jiti@2.3.3)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.5.4)(yaml@2.5.1): dependencies: bundle-require: 5.0.0(esbuild@0.23.1) cac: 6.7.14 @@ -27573,7 +27892,7 @@ snapshots: execa: 5.1.1 joycon: 3.1.1 picocolors: 1.1.0 - postcss-load-config: 6.0.1(jiti@2.3.3)(postcss@8.4.47)(tsx@4.19.2)(yaml@2.5.1) + postcss-load-config: 6.0.1(jiti@2.3.3)(postcss@8.4.49)(tsx@4.19.2)(yaml@2.5.1) resolve-from: 5.0.0 rollup: 4.24.0 source-map: 0.8.0-beta.0 @@ -27583,7 +27902,7 @@ snapshots: optionalDependencies: '@microsoft/api-extractor': 7.43.0(@types/node@22.10.1) '@swc/core': 1.7.35(@swc/helpers@0.5.5) - postcss: 8.4.47 + postcss: 8.4.49 typescript: 5.5.4 transitivePeerDependencies: - jiti @@ -28130,6 +28449,19 @@ snapshots: fsevents: 2.3.3 terser: 5.34.1 + vite@6.0.3(@types/node@20.16.11)(jiti@2.3.3)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1): + dependencies: + esbuild: 0.24.0 + postcss: 8.4.49 + rollup: 4.24.0 + optionalDependencies: + '@types/node': 20.16.11 + fsevents: 2.3.3 + jiti: 2.3.3 + terser: 5.34.1 + tsx: 4.19.2 + yaml: 2.5.1 + vitefu@0.2.5(vite@5.4.8(@types/node@22.10.1)(terser@5.34.1)): optionalDependencies: vite: 5.4.8(@types/node@22.10.1)(terser@5.34.1) From 13fbbfe712e50901d584768fb6319b053a2e76e3 Mon Sep 17 00:00:00 2001 From: JunichiSugiura Date: Fri, 13 Dec 2024 10:39:16 +0900 Subject: [PATCH 02/24] Add @ prefix to all module import path --- examples/next/src/app/layout.tsx | 2 +- examples/next/src/app/page.tsx | 20 ++-- examples/next/src/app/token/page.tsx | 4 +- packages/keychain/global.d.ts | 2 +- packages/keychain/next.config.js | 72 ------------ .../src/components/ConfirmTransaction.tsx | 10 +- .../ControllerErrorAlert.stories.tsx | 2 +- .../keychain/src/components/CopyAddress.tsx | 2 +- .../src/components/DeployController.tsx | 10 +- .../keychain/src/components/ErrorAlert.tsx | 6 +- .../keychain/src/components/ErrorBoundary.tsx | 2 +- .../src/components/ErrorBoundry.stories.tsx | 2 +- .../src/components/ExecutionContainer.tsx | 10 +- packages/keychain/src/components/Fees.tsx | 2 +- .../src/components/Funding/Balance.tsx | 2 +- .../src/components/Funding/DepositEth.tsx | 10 +- .../components/Funding/PurchaseCredits.tsx | 6 +- .../src/components/Funding/StripeCheckout.tsx | 8 +- .../keychain/src/components/Funding/index.tsx | 4 +- .../src/components/Provider/connection.tsx | 8 +- .../src/components/Provider/index.tsx | 4 +- .../src/components/Provider/theme.tsx | 4 +- .../src/components/Settings/Delegate.tsx | 6 +- .../src/components/Settings/Recovery.tsx | 6 +- .../src/components/Settings/index.tsx | 4 +- .../keychain/src/components/SignMessage.tsx | 4 +- .../keychain/src/components/Transaction.tsx | 4 +- .../src/components/bridge/Transactions.tsx | 2 +- .../src/components/bridge/TransferButton.tsx | 2 +- .../connect/Authenticate/Unsupported.tsx | 2 +- .../components/connect/Authenticate/index.tsx | 4 +- .../connect/CreateSession.stories.tsx | 2 +- .../src/components/connect/CreateSession.tsx | 18 +-- .../src/components/connect/Logout.tsx | 4 +- .../components/connect/RegisterSession.tsx | 18 +-- .../src/components/connect/SessionConsent.tsx | 2 +- .../src/components/connect/Upgrade.tsx | 6 +- .../connect/create/CreateController.tsx | 6 +- .../src/components/connect/create/index.tsx | 2 +- .../connect/create/useCreateController.ts | 8 +- packages/keychain/src/components/home.tsx | 6 +- .../layout/Container/Header/Banner.tsx | 2 +- .../layout/Container/Header/CloseButton.tsx | 2 +- .../layout/Container/Header/NetworkStatus.tsx | 4 +- .../layout/Container/Header/TopBar.tsx | 2 +- .../src/components/layout/Footer/index.tsx | 2 +- .../src/components/session/AggregateCard.tsx | 4 +- .../src/components/session/ContractCard.tsx | 2 +- .../session/UnverifiedSessionSummary.tsx | 2 +- .../session/VerifiedSessionSummary.tsx | 2 +- packages/keychain/src/const.ts | 5 +- packages/keychain/src/hooks/account.ts | 2 +- packages/keychain/src/hooks/connection.ts | 10 +- packages/keychain/src/hooks/upgrade.ts | 4 +- packages/keychain/src/main.tsx | 16 +++ packages/keychain/src/pages/_app.tsx | 110 ------------------ packages/keychain/src/pages/_document.tsx | 15 --- packages/keychain/src/pages/authenticate.tsx | 5 +- packages/keychain/src/pages/failure.tsx | 2 +- packages/keychain/src/pages/pending.tsx | 6 +- packages/keychain/src/pages/session.tsx | 8 +- packages/keychain/src/pages/slot/consent.tsx | 4 +- packages/keychain/src/pages/slot/index.tsx | 6 +- packages/keychain/src/pages/success.tsx | 2 +- .../keychain/src/utils/connection/connect.ts | 2 +- .../src/utils/connection/fetchControllers.ts | 2 +- .../keychain/src/utils/connection/index.ts | 4 +- .../keychain/src/utils/connection/probe.ts | 2 +- .../keychain/src/utils/connection/sign.ts | 2 +- packages/keychain/src/utils/controller.ts | 1 - packages/keychain/tsconfig.json | 14 +-- 71 files changed, 178 insertions(+), 364 deletions(-) delete mode 100644 packages/keychain/next.config.js delete mode 100644 packages/keychain/src/pages/_app.tsx delete mode 100644 packages/keychain/src/pages/_document.tsx diff --git a/examples/next/src/app/layout.tsx b/examples/next/src/app/layout.tsx index 7a7e47858..f4da6ba8d 100644 --- a/examples/next/src/app/layout.tsx +++ b/examples/next/src/app/layout.tsx @@ -1,4 +1,4 @@ -import { Providers } from "components/providers"; +import { Providers } from "@/components/providers"; import { Metadata } from "next"; import { PropsWithChildren } from "react"; diff --git a/examples/next/src/app/page.tsx b/examples/next/src/app/page.tsx index 46f4984ec..6237ddf07 100644 --- a/examples/next/src/app/page.tsx +++ b/examples/next/src/app/page.tsx @@ -1,13 +1,13 @@ -import { Transfer } from "components/Transfer"; -import { ManualTransferEth } from "components/ManualTransferEth"; -import { ConnectWallet } from "components/ConnectWallet"; -import { InvalidTxn } from "components/InvalidTxn"; -import { SignMessage } from "components/SignMessage"; -import { DelegateAccount } from "components/DelegateAccount"; -import { ColorModeToggle } from "components/ColorModeToggle"; -import { Profile } from "components/Profile"; -import { Settings } from "components/Settings"; -import { LookupControllers } from "components/LookupControllers"; +import { Transfer } from "@/components/Transfer"; +import { ManualTransferEth } from "@/components/ManualTransferEth"; +import { ConnectWallet } from "@/components/ConnectWallet"; +import { InvalidTxn } from "@/components/InvalidTxn"; +import { SignMessage } from "@/components/SignMessage"; +import { DelegateAccount } from "@/components/DelegateAccount"; +import { ColorModeToggle } from "@/components/ColorModeToggle"; +import { Profile } from "@/components/Profile"; +import { Settings } from "@/components/Settings"; +import { LookupControllers } from "@/components/LookupControllers"; export default function Home() { return ( diff --git a/examples/next/src/app/token/page.tsx b/examples/next/src/app/token/page.tsx index a41d385f3..0d3c7d92d 100644 --- a/examples/next/src/app/token/page.tsx +++ b/examples/next/src/app/token/page.tsx @@ -7,8 +7,8 @@ import { } from "@starknet-react/core"; import { useCallback, useMemo, useState } from "react"; import { cairo, uint256 } from "starknet"; -import { ConnectWallet } from "components/ConnectWallet"; -import { useTokenContract } from "hooks/token"; +import { ConnectWallet } from "@/components/ConnectWallet"; +import { useTokenContract } from "@/hooks/token"; import { Abi } from "starknet"; import Erc20Abi from "abi/erc20.json"; import { Button, Input } from "@cartridge/ui-next"; diff --git a/packages/keychain/global.d.ts b/packages/keychain/global.d.ts index d2248f526..49a25a356 100644 --- a/packages/keychain/global.d.ts +++ b/packages/keychain/global.d.ts @@ -1,4 +1,4 @@ -import Controller from "utils/controller"; +import { Controller } from "@/utils/controller"; declare global { interface Window { diff --git a/packages/keychain/next.config.js b/packages/keychain/next.config.js deleted file mode 100644 index 638ef2b2a..000000000 --- a/packages/keychain/next.config.js +++ /dev/null @@ -1,72 +0,0 @@ -/** @type {import('next').NextConfig} */ -const nextConfig = { - productionBrowserSourceMaps: true, - reactStrictMode: true, - experimental: { - externalDir: true, - }, - images: { - domains: ["static.cartridge.gg", "static.localhost"], - }, - webpack: function (config, { isServer, dev }) { - config.output.environment = { - ...config.output.environment, - asyncFunction: true, - }; - - // Since Webpack 5 doesn't enable WebAssembly by default, we should do it manually - config.experiments = { - ...config.experiments, - asyncWebAssembly: true, - topLevelAwait: true, - }; - - // https://github.com/vercel/next.js/issues/29362#issuecomment-971377869 - if (!dev && isServer) { - config.output.webassemblyModuleFilename = "chunks/[id].wasm"; - config.plugins.push(new WasmChunksFixPlugin()); - } - - return config; - }, - redirects: async function () { - return [ - { - source: "/slot/auth", - destination: "/slot", - permanent: true, - }, - { - source: "/slot/auth/success", - destination: "/success", - permanent: true, - }, - { - source: "/slot/auth/failure", - destination: "/failure", - permanent: true, - }, - ]; - }, -}; - -module.exports = nextConfig; - -class WasmChunksFixPlugin { - apply(compiler) { - compiler.hooks.thisCompilation.tap("WasmChunksFixPlugin", (compilation) => { - compilation.hooks.processAssets.tap( - { name: "WasmChunksFixPlugin" }, - (assets) => - Object.entries(assets).forEach(([pathname, source]) => { - if (!pathname.match(/\.wasm$/)) return; - compilation.deleteAsset(pathname); - - const name = pathname.split("/")[1]; - const info = compilation.assetsInfo.get(pathname); - compilation.emitAsset(name, source, info); - }), - ); - }); - } -} diff --git a/packages/keychain/src/components/ConfirmTransaction.tsx b/packages/keychain/src/components/ConfirmTransaction.tsx index 9141fdec9..455266238 100644 --- a/packages/keychain/src/components/ConfirmTransaction.tsx +++ b/packages/keychain/src/components/ConfirmTransaction.tsx @@ -1,12 +1,12 @@ import { useEffect, useMemo, useState } from "react"; import { ResponseCodes, SessionPolicies, toArray } from "@cartridge/controller"; -import { Content, FOOTER_MIN_HEIGHT } from "components/layout"; +import { Content, FOOTER_MIN_HEIGHT } from "@/components/layout"; import { TransactionDuoIcon } from "@cartridge/ui"; -import { useConnection } from "hooks/connection"; -import { Policies } from "components/Policies"; -import { ExecuteCtx } from "utils/connection"; +import { useConnection } from "@/hooks/connection"; +import { Policies } from "@/components/Policies"; +import { ExecuteCtx } from "@/utils/connection"; import { getChecksumAddress, num } from "starknet"; -import { ExecutionContainer } from "components/ExecutionContainer"; +import { ExecutionContainer } from "@/components/ExecutionContainer"; import { CreateSession } from "./connect"; export function ConfirmTransaction() { diff --git a/packages/keychain/src/components/ControllerErrorAlert.stories.tsx b/packages/keychain/src/components/ControllerErrorAlert.stories.tsx index f68e35ab1..c2d4414c2 100644 --- a/packages/keychain/src/components/ControllerErrorAlert.stories.tsx +++ b/packages/keychain/src/components/ControllerErrorAlert.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react"; import { ControllerErrorAlert as CtrlErrAlert } from "./ErrorAlert"; import { VStack } from "@chakra-ui/react"; import { ErrorCode } from "@cartridge/account-wasm/controller"; -import { starknetTransactionExecutionErrorTestCases } from "utils/errors"; +import { starknetTransactionExecutionErrorTestCases } from "@/utils/errors"; const meta = { component: ControllerErrorAlert, diff --git a/packages/keychain/src/components/CopyAddress.tsx b/packages/keychain/src/components/CopyAddress.tsx index a4374fe6d..16de61687 100644 --- a/packages/keychain/src/components/CopyAddress.tsx +++ b/packages/keychain/src/components/CopyAddress.tsx @@ -1,7 +1,7 @@ import { CopyIcon } from "@cartridge/ui"; import { HStack, Text } from "@chakra-ui/react"; import { formatAddress } from "@cartridge/utils"; -import { useToast } from "hooks/toast"; +import { useToast } from "@/hooks/toast"; import { addAddressPadding } from "starknet"; export function CopyAddress({ address }: { address: string }) { diff --git a/packages/keychain/src/components/DeployController.tsx b/packages/keychain/src/components/DeployController.tsx index fae8f4311..47334a440 100644 --- a/packages/keychain/src/components/DeployController.tsx +++ b/packages/keychain/src/components/DeployController.tsx @@ -3,17 +3,17 @@ import { TransactionExecutionStatus, TransactionFinalityStatus, } from "starknet"; -import { Container, Footer, Content } from "components/layout"; +import { Container, Footer, Content } from "@/components/layout"; import { useCallback, useEffect, useState } from "react"; import { Button, Link, Spinner } from "@chakra-ui/react"; import { CheckIcon, ExternalIcon, WandIcon } from "@cartridge/ui"; import { Funding } from "./Funding"; -import { useConnection } from "hooks/connection"; +import { useConnection } from "@/hooks/connection"; import { ControllerErrorAlert, ErrorAlert } from "./ErrorAlert"; -import { useDeploy } from "hooks/deploy"; +import { useDeploy } from "@/hooks/deploy"; import { Fees } from "./Fees"; -import { ControllerError } from "utils/connection"; -import { Policies } from "components/Policies"; +import { ControllerError } from "@/utils/connection"; +import { Policies } from "@/components/Policies"; import { ETH_CONTRACT_ADDRESS, useERC20Balance } from "@cartridge/utils"; export function DeployController({ diff --git a/packages/keychain/src/components/ErrorAlert.tsx b/packages/keychain/src/components/ErrorAlert.tsx index c9f26529c..2c0b5f172 100644 --- a/packages/keychain/src/components/ErrorAlert.tsx +++ b/packages/keychain/src/components/ErrorAlert.tsx @@ -23,10 +23,10 @@ import { import { motion } from "framer-motion"; import React, { ReactElement, useEffect, useState } from "react"; import { ErrorCode } from "@cartridge/account-wasm/controller"; -import { ControllerError } from "utils/connection"; -import { useConnection } from "hooks/connection"; +import { ControllerError } from "@/utils/connection"; +import { useConnection } from "@/hooks/connection"; import { constants } from "starknet"; -import { parseExecutionError, parseValidationError } from "utils/errors"; +import { parseExecutionError, parseValidationError } from "@/utils/errors"; import { formatAddress } from "@cartridge/utils"; export function ErrorAlert({ diff --git a/packages/keychain/src/components/ErrorBoundary.tsx b/packages/keychain/src/components/ErrorBoundary.tsx index ff814ca04..507da7f3c 100644 --- a/packages/keychain/src/components/ErrorBoundary.tsx +++ b/packages/keychain/src/components/ErrorBoundary.tsx @@ -2,7 +2,7 @@ import React, { PropsWithChildren, useEffect } from "react"; import { Container, Content, Footer } from "./layout"; import { AlertIcon, ExternalIcon } from "@cartridge/ui"; import { Button, HStack, Link, Text } from "@chakra-ui/react"; -import { useConnection } from "hooks/connection"; +import { useConnection } from "@/hooks/connection"; import NextLink from "next/link"; import { CARTRIDGE_DISCORD_LINK } from "const"; import { usePostHog } from "posthog-js/react"; diff --git a/packages/keychain/src/components/ErrorBoundry.stories.tsx b/packages/keychain/src/components/ErrorBoundry.stories.tsx index fcca53f85..5d0c9e532 100644 --- a/packages/keychain/src/components/ErrorBoundry.stories.tsx +++ b/packages/keychain/src/components/ErrorBoundry.stories.tsx @@ -2,7 +2,7 @@ import { Meta, StoryObj } from "@storybook/react"; import { ErrorPage } from "./ErrorBoundary"; const meta: Meta = { - title: "components/ErrorPage", + title: "@/components/ErrorPage", component: ErrorPage, parameters: { layout: "centered", diff --git a/packages/keychain/src/components/ExecutionContainer.tsx b/packages/keychain/src/components/ExecutionContainer.tsx index a64f14402..7739841c4 100644 --- a/packages/keychain/src/components/ExecutionContainer.tsx +++ b/packages/keychain/src/components/ExecutionContainer.tsx @@ -1,15 +1,15 @@ import { useState, useCallback, useEffect, useRef } from "react"; -import { Container, Footer } from "components/layout"; +import { Container, Footer } from "@/components/layout"; import { Button } from "@chakra-ui/react"; -import { useConnection } from "hooks/connection"; -import { ControllerError } from "utils/connection"; -import { ControllerErrorAlert, ErrorAlert } from "components/ErrorAlert"; +import { useConnection } from "@/hooks/connection"; +import { ControllerError } from "@/utils/connection"; +import { ControllerErrorAlert, ErrorAlert } from "@/components/ErrorAlert"; import { Fees } from "./Fees"; import { Funding } from "./Funding"; import { DeployController } from "./DeployController"; import { ErrorCode } from "@cartridge/account-wasm/controller"; import { BannerProps } from "./layout/Container/Header/Banner"; -import { parseControllerError } from "utils/connection/execute"; +import { parseControllerError } from "@/utils/connection/execute"; interface ExecutionContainerProps { transactions: any; diff --git a/packages/keychain/src/components/Fees.tsx b/packages/keychain/src/components/Fees.tsx index b34715e3a..413398741 100644 --- a/packages/keychain/src/components/Fees.tsx +++ b/packages/keychain/src/components/Fees.tsx @@ -9,7 +9,7 @@ import { } from "@chakra-ui/react"; import { formatUnits } from "viem"; -import { useChainId } from "hooks/connection"; +import { useChainId } from "@/hooks/connection"; import { EthereumIcon, InfoIcon, WarningIcon } from "@cartridge/ui"; export function Fees({ diff --git a/packages/keychain/src/components/Funding/Balance.tsx b/packages/keychain/src/components/Funding/Balance.tsx index 1fefbd08e..686347cac 100644 --- a/packages/keychain/src/components/Funding/Balance.tsx +++ b/packages/keychain/src/components/Funding/Balance.tsx @@ -8,7 +8,7 @@ import { useCreditBalance, useERC20Balance, } from "@cartridge/utils"; -import { useController } from "hooks/controller"; +import { useController } from "@/hooks/controller"; type BalanceProps = { showBalances: ("credits" | "eth" | "strk")[]; diff --git a/packages/keychain/src/components/Funding/DepositEth.tsx b/packages/keychain/src/components/Funding/DepositEth.tsx index 9df69893e..3591703a8 100644 --- a/packages/keychain/src/components/Funding/DepositEth.tsx +++ b/packages/keychain/src/components/Funding/DepositEth.tsx @@ -1,4 +1,4 @@ -import { Container, Content, Footer } from "components/layout"; +import { Container, Content, Footer } from "@/components/layout"; import { Button, HStack, Text, VStack, Divider } from "@chakra-ui/react"; import { PropsWithChildren, useCallback, useState } from "react"; import { mainnet, sepolia } from "@starknet-react/chains"; @@ -25,11 +25,11 @@ import { EthereumIcon, StarknetColorIcon, } from "@cartridge/ui"; -import { useConnection } from "hooks/connection"; -import { useToast } from "hooks/toast"; -import { ETH_CONTRACT_ADDRESS } from "utils/token"; +import { useConnection } from "@/hooks/connection"; +import { useToast } from "@/hooks/toast"; +import { ETH_CONTRACT_ADDRESS } from "@/utils/token"; import { ErrorAlert } from "../ErrorAlert"; -import { CopyAddress } from "components/CopyAddress"; +import { CopyAddress } from "@/components/CopyAddress"; import { parseEther } from "viem"; import AmountSelection, { DEFAULT_AMOUNT } from "./AmountSelection"; import { Balance } from "./Balance"; diff --git a/packages/keychain/src/components/Funding/PurchaseCredits.tsx b/packages/keychain/src/components/Funding/PurchaseCredits.tsx index 7ee9fd302..42626f99a 100644 --- a/packages/keychain/src/components/Funding/PurchaseCredits.tsx +++ b/packages/keychain/src/components/Funding/PurchaseCredits.tsx @@ -1,11 +1,11 @@ -import { Container, Content, Footer } from "components/layout"; +import { Container, Content, Footer } from "@/components/layout"; import { Button, Divider } from "@chakra-ui/react"; import { useCallback, useMemo, useState } from "react"; import { CheckIcon, CoinsIcon } from "@cartridge/ui"; -import { useConnection } from "hooks/connection"; +import { useConnection } from "@/hooks/connection"; import { CopyAddress } from "../CopyAddress"; import AmountSelection, { DEFAULT_AMOUNT } from "./AmountSelection"; -import { ErrorAlert } from "components/ErrorAlert"; +import { ErrorAlert } from "@/components/ErrorAlert"; import { Elements } from "@stripe/react-stripe-js"; import { Appearance, loadStripe } from "@stripe/stripe-js"; import { Balance } from "./Balance"; diff --git a/packages/keychain/src/components/Funding/StripeCheckout.tsx b/packages/keychain/src/components/Funding/StripeCheckout.tsx index 429f64b2e..626940f63 100644 --- a/packages/keychain/src/components/Funding/StripeCheckout.tsx +++ b/packages/keychain/src/components/Funding/StripeCheckout.tsx @@ -6,11 +6,11 @@ import { } from "@stripe/react-stripe-js"; import { StripePaymentElementOptions } from "@stripe/stripe-js"; import { Button } from "@chakra-ui/react"; -import { Container, Content, Footer } from "components/layout"; -import { useController } from "hooks/controller"; +import { Container, Content, Footer } from "@/components/layout"; +import { useController } from "@/hooks/controller"; import { CoinsIcon } from "@cartridge/ui"; -import { CopyAddress } from "components/CopyAddress"; -import { ErrorAlert } from "components/ErrorAlert"; +import { CopyAddress } from "@/components/CopyAddress"; +import { ErrorAlert } from "@/components/ErrorAlert"; type StripeCheckoutProps = { creditsAmount: number; diff --git a/packages/keychain/src/components/Funding/index.tsx b/packages/keychain/src/components/Funding/index.tsx index 1ab45aa9b..6a40f9ea9 100644 --- a/packages/keychain/src/components/Funding/index.tsx +++ b/packages/keychain/src/components/Funding/index.tsx @@ -1,7 +1,7 @@ -import { Container, Content, Footer } from "components/layout"; +import { Container, Content, Footer } from "@/components/layout"; import { Button } from "@chakra-ui/react"; import { useState } from "react"; -import { useConnection } from "hooks/connection"; +import { useConnection } from "@/hooks/connection"; import { CopyAddress } from "../CopyAddress"; import { ArrowLineDownIcon, CoinsIcon, EthereumIcon } from "@cartridge/ui"; import { DepositEth } from "./DepositEth"; diff --git a/packages/keychain/src/components/Provider/connection.tsx b/packages/keychain/src/components/Provider/connection.tsx index d08c00ed0..1d4c75630 100644 --- a/packages/keychain/src/components/Provider/connection.tsx +++ b/packages/keychain/src/components/Provider/connection.tsx @@ -1,10 +1,10 @@ import { createContext } from "react"; -import Controller from "utils/controller"; -import { ConnectionCtx } from "utils/connection"; +import Controller from "@/utils/controller"; +import { ConnectionCtx } from "@/utils/connection"; import { Prefund } from "@cartridge/controller"; -import { UpgradeInterface } from "hooks/upgrade"; +import { UpgradeInterface } from "@/hooks/upgrade"; import { ControllerTheme } from "@cartridge/presets"; -import { ParsedSessionPolicies } from "hooks/session"; +import { ParsedSessionPolicies } from "@/hooks/session"; export const ConnectionContext = createContext< ConnectionContextValue | undefined diff --git a/packages/keychain/src/components/Provider/index.tsx b/packages/keychain/src/components/Provider/index.tsx index 7aba441b5..a0d903100 100644 --- a/packages/keychain/src/components/Provider/index.tsx +++ b/packages/keychain/src/components/Provider/index.tsx @@ -1,8 +1,8 @@ import { PropsWithChildren, useCallback, useMemo } from "react"; import { QueryClient, QueryClientProvider } from "react-query"; -import { useConnectionValue } from "hooks/connection"; +import { useConnectionValue } from "@/hooks/connection"; import { CartridgeAPIProvider } from "@cartridge/utils/api/cartridge"; -import { ENDPOINT } from "utils/graphql"; +import { ENDPOINT } from "@/utils/graphql"; import { PostHogProvider } from "posthog-js/react"; import posthog from "posthog-js"; import { ConnectionContext } from "./connection"; diff --git a/packages/keychain/src/components/Provider/theme.tsx b/packages/keychain/src/components/Provider/theme.tsx index bb1272ffe..c0f9aba63 100644 --- a/packages/keychain/src/components/Provider/theme.tsx +++ b/packages/keychain/src/components/Provider/theme.tsx @@ -1,8 +1,8 @@ import { ColorMode } from "@cartridge/presets"; import { useThemeEffect } from "@cartridge/ui-next"; import { ChakraProvider, useColorMode } from "@chakra-ui/react"; -import { useConnection } from "hooks/connection"; -import { ControllerThemeContext, useChakraTheme } from "hooks/theme"; +import { useConnection } from "@/hooks/connection"; +import { ControllerThemeContext, useChakraTheme } from "@/hooks/theme"; import { useRouter } from "next/router"; import { PropsWithChildren, useEffect, useMemo } from "react"; diff --git a/packages/keychain/src/components/Settings/Delegate.tsx b/packages/keychain/src/components/Settings/Delegate.tsx index 3a1b1d2ed..9133ae57d 100644 --- a/packages/keychain/src/components/Settings/Delegate.tsx +++ b/packages/keychain/src/components/Settings/Delegate.tsx @@ -1,10 +1,10 @@ import { AlertIcon } from "@cartridge/ui"; import { Button, VStack, Text, HStack, Input } from "@chakra-ui/react"; -import { Container, Content, Footer } from "components/layout"; -import { useConnection } from "hooks/connection"; +import { Container, Content, Footer } from "@/components/layout"; +import { useConnection } from "@/hooks/connection"; import { useCallback, useEffect, useState } from "react"; import { CallData, num } from "starknet"; -import { ExecuteCtx } from "utils/connection"; +import { ExecuteCtx } from "@/utils/connection"; export function Delegate({ onBack }: { onBack: () => void }) { const { controller, context, setContext } = useConnection(); diff --git a/packages/keychain/src/components/Settings/Recovery.tsx b/packages/keychain/src/components/Settings/Recovery.tsx index 2acb4109a..8d224865b 100644 --- a/packages/keychain/src/components/Settings/Recovery.tsx +++ b/packages/keychain/src/components/Settings/Recovery.tsx @@ -1,10 +1,10 @@ import { AlertIcon } from "@cartridge/ui"; import { Button, VStack, Text, HStack, Input } from "@chakra-ui/react"; -import { Container, Content, Footer } from "components/layout"; -import { useConnection } from "hooks/connection"; +import { Container, Content, Footer } from "@/components/layout"; +import { useConnection } from "@/hooks/connection"; import { useCallback, useEffect, useState } from "react"; import { CallData, num } from "starknet"; -import { ExecuteCtx } from "utils/connection"; +import { ExecuteCtx } from "@/utils/connection"; export function Recovery({ onBack }: { onBack: () => void }) { const { controller, context, setContext } = useConnection(); diff --git a/packages/keychain/src/components/Settings/index.tsx b/packages/keychain/src/components/Settings/index.tsx index ec21500ce..021db4a86 100644 --- a/packages/keychain/src/components/Settings/index.tsx +++ b/packages/keychain/src/components/Settings/index.tsx @@ -1,10 +1,10 @@ import { Button } from "@chakra-ui/react"; import { GearIcon } from "@cartridge/ui"; import { useState } from "react"; -import { Container, Footer } from "components/layout"; +import { Container, Footer } from "@/components/layout"; import { Recovery } from "./Recovery"; import { Delegate } from "./Delegate"; -import { useConnection } from "hooks/connection"; +import { useConnection } from "@/hooks/connection"; enum State { SETTINGS, diff --git a/packages/keychain/src/components/SignMessage.tsx b/packages/keychain/src/components/SignMessage.tsx index 47271e152..39abf4264 100644 --- a/packages/keychain/src/components/SignMessage.tsx +++ b/packages/keychain/src/components/SignMessage.tsx @@ -1,9 +1,9 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import { Button, Flex, Text } from "@chakra-ui/react"; import { shortString, Signature, TypedData } from "starknet"; -import { Container, Footer, Content } from "components/layout"; +import { Container, Footer, Content } from "@/components/layout"; import { TransferDuoIcon } from "@cartridge/ui"; -import { useController } from "hooks/controller"; +import { useController } from "@/hooks/controller"; export function SignMessage({ origin, diff --git a/packages/keychain/src/components/Transaction.tsx b/packages/keychain/src/components/Transaction.tsx index 5629680a1..9e74b3922 100644 --- a/packages/keychain/src/components/Transaction.tsx +++ b/packages/keychain/src/components/Transaction.tsx @@ -11,8 +11,8 @@ import { import { constants } from "starknet"; import { CheckIcon, ExternalIcon, StarknetIcon } from "@cartridge/ui"; -import { useController } from "hooks/controller"; -import { useChainName } from "hooks/chain"; +import { useController } from "@/hooks/controller"; +import { useChainName } from "@/hooks/chain"; import { StarkscanUrl } from "@cartridge/utils"; export type TransactionState = "pending" | "success" | "error"; diff --git a/packages/keychain/src/components/bridge/Transactions.tsx b/packages/keychain/src/components/bridge/Transactions.tsx index f3cb6a15a..02140e0df 100644 --- a/packages/keychain/src/components/bridge/Transactions.tsx +++ b/packages/keychain/src/components/bridge/Transactions.tsx @@ -13,7 +13,7 @@ import { constants } from "starknet"; import { mainnet, useWaitForTransaction } from "wagmi"; import { sepolia } from "wagmi/chains"; import { CheckIcon, ExternalIcon, TransferDuoIcon } from "@cartridge/ui"; -import { Container, Content } from "components/layout"; +import { Container, Content } from "@/components/layout"; enum CardState { PENDING = "PENDING", diff --git a/packages/keychain/src/components/bridge/TransferButton.tsx b/packages/keychain/src/components/bridge/TransferButton.tsx index dfaf8da3e..002b6d6d5 100644 --- a/packages/keychain/src/components/bridge/TransferButton.tsx +++ b/packages/keychain/src/components/bridge/TransferButton.tsx @@ -13,7 +13,7 @@ import { EthL2BridgeSepolia, } from "./constants"; import EthL1BridgeABI from "./abis/EthL1Bridge.json"; -import Controller from "utils/controller"; +import Controller from "@/utils/controller"; export function TransferButton({ account, diff --git a/packages/keychain/src/components/connect/Authenticate/Unsupported.tsx b/packages/keychain/src/components/connect/Authenticate/Unsupported.tsx index 7c8f2cbb0..cbe8b703e 100644 --- a/packages/keychain/src/components/connect/Authenticate/Unsupported.tsx +++ b/packages/keychain/src/components/connect/Authenticate/Unsupported.tsx @@ -1,5 +1,5 @@ import { AlertIcon } from "@cartridge/ui"; -import { Container } from "components/layout"; +import { Container } from "@/components/layout"; import { useEffect, useState } from "react"; export function Unsupported({ message }: { message: string }) { diff --git a/packages/keychain/src/components/connect/Authenticate/index.tsx b/packages/keychain/src/components/connect/Authenticate/index.tsx index a58a250be..d925d69a0 100644 --- a/packages/keychain/src/components/connect/Authenticate/index.tsx +++ b/packages/keychain/src/components/connect/Authenticate/index.tsx @@ -1,8 +1,8 @@ import React, { useState, useCallback } from "react"; import { Button } from "@chakra-ui/react"; import { Unsupported, useIsSupported } from "./Unsupported"; -import { doSignup } from "hooks/account"; -import { Container, Content, Footer } from "components/layout"; +import { doSignup } from "@/hooks/account"; +import { Container, Content, Footer } from "@/components/layout"; import { FaceIDDuoImage } from "./FaceID"; export type AuthAction = "signup" | "login"; diff --git a/packages/keychain/src/components/connect/CreateSession.stories.tsx b/packages/keychain/src/components/connect/CreateSession.stories.tsx index 92eca60d7..d08e5aa61 100644 --- a/packages/keychain/src/components/connect/CreateSession.stories.tsx +++ b/packages/keychain/src/components/connect/CreateSession.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react"; import { CreateSession } from "./CreateSession"; import { ETH_CONTRACT_ADDRESS } from "@cartridge/utils"; -import { parseSessionPolicies } from "hooks/session"; +import { parseSessionPolicies } from "@/hooks/session"; import { controllerConfigs } from "@cartridge/presets"; const meta: Meta = { diff --git a/packages/keychain/src/components/connect/CreateSession.tsx b/packages/keychain/src/components/connect/CreateSession.tsx index 86704818f..574ac45c1 100644 --- a/packages/keychain/src/components/connect/CreateSession.tsx +++ b/packages/keychain/src/components/connect/CreateSession.tsx @@ -1,18 +1,18 @@ -import { Container, Content, Footer } from "components/layout"; +import { Container, Content, Footer } from "@/components/layout"; import { BigNumberish, shortString } from "starknet"; -import { ControllerError } from "utils/connection"; +import { ControllerError } from "@/utils/connection"; import { Button, HStack, Text, Checkbox } from "@chakra-ui/react"; import { useCallback, useEffect, useMemo, useState } from "react"; -import { useConnection } from "hooks/connection"; -import { ControllerErrorAlert } from "components/ErrorAlert"; -import { SessionConsent } from "components/connect"; -import { DEFAULT_SESSION_DURATION } from "const"; +import { useConnection } from "@/hooks/connection"; +import { ControllerErrorAlert } from "@/components/ErrorAlert"; +import { SessionConsent } from "@/components/connect"; import { Upgrade } from "./Upgrade"; import { ErrorCode } from "@cartridge/account-wasm"; import { TypedDataPolicy } from "@cartridge/presets"; -import { ParsedSessionPolicies } from "hooks/session"; -import { UnverifiedSessionSummary } from "components/session/UnverifiedSessionSummary"; -import { VerifiedSessionSummary } from "components/session/VerifiedSessionSummary"; +import { ParsedSessionPolicies } from "@/hooks/session"; +import { UnverifiedSessionSummary } from "@/components/session/UnverifiedSessionSummary"; +import { VerifiedSessionSummary } from "@/components/session/VerifiedSessionSummary"; +import { DEFAULT_SESSION_DURATION } from "@/const"; import { Select, SelectContent, diff --git a/packages/keychain/src/components/connect/Logout.tsx b/packages/keychain/src/components/connect/Logout.tsx index 25e33ada0..3c3395357 100644 --- a/packages/keychain/src/components/connect/Logout.tsx +++ b/packages/keychain/src/components/connect/Logout.tsx @@ -1,7 +1,7 @@ import { Button } from "@chakra-ui/react"; -import { Container, Footer } from "components/layout"; +import { Container, Footer } from "@/components/layout"; import { LogoutDuoIcon } from "@cartridge/ui"; -import { useConnection } from "hooks/connection"; +import { useConnection } from "@/hooks/connection"; import { ResponseCodes } from "@cartridge/controller"; export function Logout() { diff --git a/packages/keychain/src/components/connect/RegisterSession.tsx b/packages/keychain/src/components/connect/RegisterSession.tsx index dac9c7180..56d34cce0 100644 --- a/packages/keychain/src/components/connect/RegisterSession.tsx +++ b/packages/keychain/src/components/connect/RegisterSession.tsx @@ -1,16 +1,16 @@ -import { Content } from "components/layout"; -import { useCallback, useEffect, useState } from "react"; -import { useConnection } from "hooks/connection"; -import { SessionConsent } from "components/connect"; -import { ExecutionContainer } from "components/ExecutionContainer"; +import { Content } from "@/components/layout"; +import { useCallback, useState, useEffect } from "react"; +import { useConnection } from "@/hooks/connection"; +import { SessionConsent } from "@/components/connect"; +import { ExecutionContainer } from "@/components/ExecutionContainer"; import { TransactionExecutionStatus, TransactionFinalityStatus, } from "starknet"; -import { SESSION_EXPIRATION } from "const"; -import { UnverifiedSessionSummary } from "components/session/UnverifiedSessionSummary"; -import { VerifiedSessionSummary } from "components/session/VerifiedSessionSummary"; -import { ParsedSessionPolicies } from "hooks/session"; +import { SESSION_EXPIRATION } from "@/const"; +import { UnverifiedSessionSummary } from "@/components/session/UnverifiedSessionSummary"; +import { VerifiedSessionSummary } from "@/components/session/VerifiedSessionSummary"; +import { ParsedSessionPolicies } from "@/hooks/session"; export function RegisterSession({ policies, diff --git a/packages/keychain/src/components/connect/SessionConsent.tsx b/packages/keychain/src/components/connect/SessionConsent.tsx index 60fd5fbd8..d19462420 100644 --- a/packages/keychain/src/components/connect/SessionConsent.tsx +++ b/packages/keychain/src/components/connect/SessionConsent.tsx @@ -1,6 +1,6 @@ import { HStack, Text } from "@chakra-ui/react"; import { VerifiedIcon } from "@cartridge/ui"; -import { useConnection } from "hooks/connection"; +import { useConnection } from "@/hooks/connection"; import { useMemo } from "react"; import Link from "next/link"; diff --git a/packages/keychain/src/components/connect/Upgrade.tsx b/packages/keychain/src/components/connect/Upgrade.tsx index 90917751b..800c301c5 100644 --- a/packages/keychain/src/components/connect/Upgrade.tsx +++ b/packages/keychain/src/components/connect/Upgrade.tsx @@ -1,8 +1,8 @@ import { BoltIcon } from "@cartridge/ui"; import { ListItem, Text, UnorderedList, VStack } from "@chakra-ui/react"; -import { ExecutionContainer } from "components/ExecutionContainer"; -import { Content } from "components/layout"; -import { useConnection } from "hooks/connection"; +import { ExecutionContainer } from "@/components/ExecutionContainer"; +import { Content } from "@/components/layout"; +import { useConnection } from "@/hooks/connection"; export const Upgrade = () => { const { upgrade, controller } = useConnection(); diff --git a/packages/keychain/src/components/connect/create/CreateController.tsx b/packages/keychain/src/components/connect/create/CreateController.tsx index 139ddb8e1..8700cac0f 100644 --- a/packages/keychain/src/components/connect/create/CreateController.tsx +++ b/packages/keychain/src/components/connect/create/CreateController.tsx @@ -1,10 +1,10 @@ import { useRef, useState } from "react"; -import { Container, Footer, Content } from "components/layout"; +import { Container, Footer, Content } from "@/components/layout"; import { Field } from "@cartridge/ui"; import { Box, Button } from "@chakra-ui/react"; -import { useControllerTheme } from "hooks/theme"; +import { useControllerTheme } from "@/hooks/theme"; import { usePostHog } from "posthog-js/react"; -import { useDebounce } from "hooks/debounce"; +import { useDebounce } from "@/hooks/debounce"; import { useUsernameValidation } from "./useUsernameValidation"; import { LoginMode } from "../types"; import { Legal, StatusTray } from "."; diff --git a/packages/keychain/src/components/connect/create/index.tsx b/packages/keychain/src/components/connect/create/index.tsx index 3dbbd648d..7f1953020 100644 --- a/packages/keychain/src/components/connect/create/index.tsx +++ b/packages/keychain/src/components/connect/create/index.tsx @@ -3,7 +3,7 @@ import { AccountQuery, AccountQueryVariables, } from "@cartridge/utils/api/cartridge"; -import { fetchData } from "utils/graphql"; +import { fetchData } from "@/utils/graphql"; export * from "./CreateController"; export * from "./Legal"; diff --git a/packages/keychain/src/components/connect/create/useCreateController.ts b/packages/keychain/src/components/connect/create/useCreateController.ts index 3daad4db3..8b547ee10 100644 --- a/packages/keychain/src/components/connect/create/useCreateController.ts +++ b/packages/keychain/src/components/connect/create/useCreateController.ts @@ -1,11 +1,11 @@ import { useState, useCallback } from "react"; -import { useConnection } from "hooks/connection"; +import { useConnection } from "@/hooks/connection"; import { LoginMode } from "../types"; -import { doLogin, doSignup } from "hooks/account"; +import { doLogin, doSignup } from "@/hooks/account"; import { constants } from "starknet"; -import Controller from "utils/controller"; +import Controller from "@/utils/controller"; import { fetchAccount } from "."; -import { PopupCenter } from "utils/url"; +import { PopupCenter } from "@/utils/url"; import { useAccountQuery } from "@cartridge/utils/api/cartridge"; export function useCreateController({ diff --git a/packages/keychain/src/components/home.tsx b/packages/keychain/src/components/home.tsx index 92be6a0a3..d6a3cac20 100644 --- a/packages/keychain/src/components/home.tsx +++ b/packages/keychain/src/components/home.tsx @@ -5,14 +5,14 @@ import { usePostHog } from "posthog-js/react"; import { ResponseCodes } from "@cartridge/controller"; import { useConnection } from "@/hooks/connection"; import { DeployCtx, SignMessageCtx } from "@/utils/connection"; -import { SignMessage } from "./SignMessage"; import { ConfirmTransaction } from "./ConfirmTransaction"; -import { DeployController } from "./DeployController" import { CreateController, CreateSession, Logout, Upgrade } from "./connect"; import { LoginMode } from "./connect/types"; +import { DeployController } from "./DeployController"; import { ErrorPage } from "./ErrorBoundary"; -import { Settings } from "./Settings"; import { PurchaseCredits } from "./Funding/PurchaseCredits"; +import { Settings } from "./Settings"; +import { SignMessage } from "./SignMessage"; export function Home() { const { context, controller, error, policies, upgrade } = useConnection(); diff --git a/packages/keychain/src/components/layout/Container/Header/Banner.tsx b/packages/keychain/src/components/layout/Container/Header/Banner.tsx index 78ddbc191..88b2cd6fe 100644 --- a/packages/keychain/src/components/layout/Container/Header/Banner.tsx +++ b/packages/keychain/src/components/layout/Container/Header/Banner.tsx @@ -10,7 +10,7 @@ import { Square, HStack, } from "@chakra-ui/react"; -import { useControllerTheme } from "hooks/theme"; +import { useControllerTheme } from "@/hooks/theme"; import { useMemo } from "react"; import { useLayoutVariant } from "../"; import { TOP_BAR_HEIGHT } from "./TopBar"; diff --git a/packages/keychain/src/components/layout/Container/Header/CloseButton.tsx b/packages/keychain/src/components/layout/Container/Header/CloseButton.tsx index 00615ab18..62713e253 100644 --- a/packages/keychain/src/components/layout/Container/Header/CloseButton.tsx +++ b/packages/keychain/src/components/layout/Container/Header/CloseButton.tsx @@ -1,7 +1,7 @@ import { TimesIcon } from "@cartridge/ui"; import { isIframe } from "@cartridge/utils"; import { IconButton } from "@chakra-ui/react"; -import { useConnection } from "hooks/connection"; +import { useConnection } from "@/hooks/connection"; import { useCallback } from "react"; export function CloseButton({ onClose }: { onClose?: () => void }) { diff --git a/packages/keychain/src/components/layout/Container/Header/NetworkStatus.tsx b/packages/keychain/src/components/layout/Container/Header/NetworkStatus.tsx index 49a90a954..592ddbe1c 100644 --- a/packages/keychain/src/components/layout/Container/Header/NetworkStatus.tsx +++ b/packages/keychain/src/components/layout/Container/Header/NetworkStatus.tsx @@ -1,8 +1,8 @@ import { StarknetColorIcon, StarknetIcon, SlotIcon } from "@cartridge/ui"; import { QuestionIcon } from "@cartridge/ui"; import { Button, Circle, Tooltip } from "@chakra-ui/react"; -import { useConnection } from "hooks/connection"; -import { useToast } from "hooks/toast"; +import { useConnection } from "@/hooks/connection"; +import { useToast } from "@/hooks/toast"; import { constants } from "starknet"; import { isSlotChain } from "@cartridge/utils"; import { Hex, hexToString } from "viem"; diff --git a/packages/keychain/src/components/layout/Container/Header/TopBar.tsx b/packages/keychain/src/components/layout/Container/Header/TopBar.tsx index dec1c2e2b..77b795b6b 100644 --- a/packages/keychain/src/components/layout/Container/Header/TopBar.tsx +++ b/packages/keychain/src/components/layout/Container/Header/TopBar.tsx @@ -3,7 +3,7 @@ import { CloseButton } from "./CloseButton"; import { NetworkStatus } from "./NetworkStatus"; import { SettingsButton } from "./SettingsButton"; import { BackButton } from "./BackButton"; -import { useConnection } from "hooks/connection"; +import { useConnection } from "@/hooks/connection"; import { useMemo } from "react"; export type TopBarProps = { diff --git a/packages/keychain/src/components/layout/Footer/index.tsx b/packages/keychain/src/components/layout/Footer/index.tsx index 3ae7c9d9f..b9a27315a 100644 --- a/packages/keychain/src/components/layout/Footer/index.tsx +++ b/packages/keychain/src/components/layout/Footer/index.tsx @@ -1,7 +1,7 @@ import { HStack, VStack, Text } from "@chakra-ui/react"; import { CartridgeLogo } from "@cartridge/ui"; import React, { useEffect, useRef } from "react"; -import { FOOTER_HEIGHT, useLayout } from "components/layout"; +import { FOOTER_HEIGHT, useLayout } from "@/components/layout"; import NextLink from "next/link"; export function Footer({ diff --git a/packages/keychain/src/components/session/AggregateCard.tsx b/packages/keychain/src/components/session/AggregateCard.tsx index 773348f98..22eebc0ab 100644 --- a/packages/keychain/src/components/session/AggregateCard.tsx +++ b/packages/keychain/src/components/session/AggregateCard.tsx @@ -21,8 +21,8 @@ import { import { useExplorer } from "@starknet-react/core"; import { constants } from "starknet"; import { Method } from "@cartridge/presets"; -import { useChainId } from "hooks/connection"; -import { ParsedSessionPolicies } from "hooks/session"; +import { useChainId } from "@/hooks/connection"; +import { ParsedSessionPolicies } from "@/hooks/session"; interface AggregateCardProps { title: string; diff --git a/packages/keychain/src/components/session/ContractCard.tsx b/packages/keychain/src/components/session/ContractCard.tsx index 92fe7b32f..be698621e 100644 --- a/packages/keychain/src/components/session/ContractCard.tsx +++ b/packages/keychain/src/components/session/ContractCard.tsx @@ -21,7 +21,7 @@ import { import { useExplorer } from "@starknet-react/core"; import { constants } from "starknet"; import { Method } from "@cartridge/presets"; -import { useChainId } from "hooks/connection"; +import { useChainId } from "@/hooks/connection"; interface ContractCardProps { address: string; diff --git a/packages/keychain/src/components/session/UnverifiedSessionSummary.tsx b/packages/keychain/src/components/session/UnverifiedSessionSummary.tsx index 5cf246972..f9c86e0dd 100644 --- a/packages/keychain/src/components/session/UnverifiedSessionSummary.tsx +++ b/packages/keychain/src/components/session/UnverifiedSessionSummary.tsx @@ -1,6 +1,6 @@ import React from "react"; import { toArray } from "@cartridge/controller"; -import { ParsedSessionPolicies } from "hooks/session"; +import { ParsedSessionPolicies } from "@/hooks/session"; import { MessageCard } from "./MessageCard"; import { ContractCard } from "./ContractCard"; diff --git a/packages/keychain/src/components/session/VerifiedSessionSummary.tsx b/packages/keychain/src/components/session/VerifiedSessionSummary.tsx index 808b86813..ac741dedb 100644 --- a/packages/keychain/src/components/session/VerifiedSessionSummary.tsx +++ b/packages/keychain/src/components/session/VerifiedSessionSummary.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { ParsedSessionPolicies } from "hooks/session"; +import { ParsedSessionPolicies } from "@/hooks/session"; import { AggregateCard } from "./AggregateCard"; import { CodeIcon } from "@cartridge/ui-next"; import { ContractCard } from "./ContractCard"; diff --git a/packages/keychain/src/const.ts b/packages/keychain/src/const.ts index cf3ba415c..3b71e0dfa 100644 --- a/packages/keychain/src/const.ts +++ b/packages/keychain/src/const.ts @@ -1,5 +1,4 @@ export const CARTRIDGE_DISCORD_LINK = "https://discord.gg/cartridge"; -export const SESSION_EXPIRATION = BigInt( - Math.floor(Date.now() / 1000) + 7 * 24 * 60 * 60, -); // 1 week export const DEFAULT_SESSION_DURATION = BigInt(7 * 24 * 60 * 60); +export const SESSION_EXPIRATION = + BigInt(Math.floor(Date.now() / 1000)) + DEFAULT_SESSION_DURATION; // 1 week diff --git a/packages/keychain/src/hooks/account.ts b/packages/keychain/src/hooks/account.ts index 21a1d11e6..7aa2e18e1 100644 --- a/packages/keychain/src/hooks/account.ts +++ b/packages/keychain/src/hooks/account.ts @@ -7,7 +7,7 @@ import { FinalizeRegistrationMutation, } from "@cartridge/utils/api/cartridge"; -import { client, ENDPOINT } from "utils/graphql"; +import { client, ENDPOINT } from "@/utils/graphql"; import base64url from "base64url"; type RawAssertion = PublicKeyCredential & { diff --git a/packages/keychain/src/hooks/connection.ts b/packages/keychain/src/hooks/connection.ts index 683c247ad..2c2f854f0 100644 --- a/packages/keychain/src/hooks/connection.ts +++ b/packages/keychain/src/hooks/connection.ts @@ -1,11 +1,11 @@ import { AsyncMethodReturns } from "@cartridge/penpal"; import { useContext, useState, useEffect, useCallback, useMemo } from "react"; -import Controller from "utils/controller"; +import Controller from "@/utils/controller"; import { connectToController, ConnectionCtx, OpenSettingsCtx, -} from "utils/connection"; +} from "@/utils/connection"; import { getChainName, isIframe } from "@cartridge/utils"; import { RpcProvider } from "starknet"; import { @@ -13,12 +13,12 @@ import { ResponseCodes, toSessionPolicies, } from "@cartridge/controller"; -import { mergeDefaultETHPrefund } from "utils/token"; -import { setIsSignedUp } from "utils/cookie"; +import { mergeDefaultETHPrefund } from "@/utils/token"; +import { setIsSignedUp } from "@/utils/cookie"; import { ConnectionContext, ConnectionContextValue, -} from "components/Provider/connection"; +} from "@/components/Provider/connection"; import { UpgradeInterface, useUpgrade } from "./upgrade"; import posthog from "posthog-js"; import { Policies } from "@cartridge/presets"; diff --git a/packages/keychain/src/hooks/upgrade.ts b/packages/keychain/src/hooks/upgrade.ts index 5efa4ce72..c3e015d99 100644 --- a/packages/keychain/src/hooks/upgrade.ts +++ b/packages/keychain/src/hooks/upgrade.ts @@ -1,8 +1,8 @@ import { JsCall } from "@cartridge/account-wasm"; import { useCallback, useEffect, useState } from "react"; import { addAddressPadding, Call } from "starknet"; -import { ControllerError } from "utils/connection"; -import Controller from "utils/controller"; +import { ControllerError } from "@/utils/connection"; +import Controller from "@/utils/controller"; enum OutsideExecutionVersion { V2, diff --git a/packages/keychain/src/main.tsx b/packages/keychain/src/main.tsx index e69de29bb..325472c1d 100644 --- a/packages/keychain/src/main.tsx +++ b/packages/keychain/src/main.tsx @@ -0,0 +1,16 @@ +import { StrictMode } from "react"; +import { createRoot } from "react-dom/client"; +import { SonnerToaster } from "@cartridge/ui-next"; +import { App } from "@/components/app"; +import { Provider } from "@/components/Provider"; + +import "./index.css"; + +createRoot(document.getElementById("root")!).render( + + + + + + , +); diff --git a/packages/keychain/src/pages/_app.tsx b/packages/keychain/src/pages/_app.tsx deleted file mode 100644 index 95f6bcc76..000000000 --- a/packages/keychain/src/pages/_app.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import NextHead from "next/head"; -import type { AppProps } from "next/app"; -import { CartridgeTheme } from "@cartridge/ui"; -import { Inter, IBM_Plex_Mono } from "next/font/google"; -import { useEffect } from "react"; -import { Provider } from "components/Provider"; -import { ErrorBoundary } from "components/ErrorBoundary"; - -import "../index.css"; -import Script from "next/script"; -import { SonnerToaster } from "@cartridge/ui-next"; - -const inter = Inter({ subsets: ["latin"] }); -const ibmPlexMono = IBM_Plex_Mono({ - weight: "600", - subsets: ["latin"], -}); - -export default function Keychain({ Component, pageProps }: AppProps) { - useGlobalInjection(); - - return ( - <> - - Cartridge Controller - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -