Skip to content

Commit cbfc7a7

Browse files
committed
[vite-example-dapp] Create vite version of the example dapp for convenience
1 parent 5ea35e6 commit cbfc7a7

35 files changed

+2346
-61
lines changed

apps/vite-example/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_IC_FRONTEND_URL=http://localhost:3000

apps/vite-example/.env.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_IC_FRONTEND_URL=http://localhost:3000

apps/vite-example/.eslintcache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/AccountsSection/AccountsListItem.tsx":"1","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/AccountsSection/AccountsSection.tsx":"2","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/AccountsSection/index.ts":"3","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/App.tsx":"4","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/AppStateContext.ts":"5","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/DappClientContext.ts":"6","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/NewRequestSection/NewRequestSection.tsx":"7","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/NewRequestSection/index.ts":"8","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/main.tsx":"9","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/utils/makeContext.tsx":"10","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/utils/makeLocalStorageAppStateContext.ts":"11","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/utils/useAsyncAction.ts":"12","/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/vite-env.d.ts":"13"},{"size":2113,"mtime":1697658845520,"results":"14","hashOfConfig":"15"},{"size":1058,"mtime":1697658845520,"results":"16","hashOfConfig":"15"},{"size":148,"mtime":1697658845520,"results":"17","hashOfConfig":"15"},{"size":476,"mtime":1697658845520,"results":"18","hashOfConfig":"15"},{"size":620,"mtime":1697658845520,"results":"19","hashOfConfig":"15"},{"size":1546,"mtime":1697658845520,"results":"20","hashOfConfig":"15"},{"size":7438,"mtime":1697658845521,"results":"21","hashOfConfig":"15"},{"size":154,"mtime":1697658845521,"results":"22","hashOfConfig":"15"},{"size":579,"mtime":1697658845521,"results":"23","hashOfConfig":"15"},{"size":1286,"mtime":1697658845521,"results":"24","hashOfConfig":"15"},{"size":2369,"mtime":1697658845521,"results":"25","hashOfConfig":"15"},{"size":492,"mtime":1697658845521,"results":"26","hashOfConfig":"15"},{"size":303,"mtime":1697658845521,"results":"27","hashOfConfig":"15"},{"filePath":"28","messages":"29","suppressedMessages":"30","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"18orfr",{"filePath":"31","messages":"32","suppressedMessages":"33","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","suppressedMessages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","suppressedMessages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","suppressedMessages":"42","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","suppressedMessages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"46","messages":"47","suppressedMessages":"48","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","suppressedMessages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","suppressedMessages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","suppressedMessages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"58","messages":"59","suppressedMessages":"60","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","suppressedMessages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"64","messages":"65","suppressedMessages":"66","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/AccountsSection/AccountsListItem.tsx",[],[],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/AccountsSection/AccountsSection.tsx",[],[],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/AccountsSection/index.ts",[],[],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/App.tsx",[],[],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/AppStateContext.ts",[],[],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/DappClientContext.ts",["67"],[],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/NewRequestSection/NewRequestSection.tsx",[],["68","69","70","71","72","73","74","75"],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/NewRequestSection/index.ts",[],[],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/main.tsx",[],[],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/utils/makeContext.tsx",[],["76"],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/utils/makeLocalStorageAppStateContext.ts",[],["77","78"],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/utils/useAsyncAction.ts",[],[],"/Users/gabriele/workspace/identity-connect/apps/examples/dapp/src/vite-env.d.ts",[],[],{"ruleId":"79","severity":1,"message":"80","line":43,"column":6,"nodeType":"81","endLine":43,"endColumn":33,"suggestions":"82"},{"ruleId":"83","severity":1,"message":"84","line":60,"column":5,"nodeType":"85","messageId":"86","endLine":60,"endColumn":16,"suppressions":"87"},{"ruleId":"83","severity":1,"message":"84","line":69,"column":5,"nodeType":"85","messageId":"86","endLine":69,"endColumn":16,"suppressions":"88"},{"ruleId":"83","severity":1,"message":"84","line":78,"column":5,"nodeType":"85","messageId":"86","endLine":78,"endColumn":16,"suppressions":"89"},{"ruleId":"83","severity":1,"message":"84","line":105,"column":5,"nodeType":"85","messageId":"86","endLine":105,"endColumn":16,"suppressions":"90"},{"ruleId":"83","severity":1,"message":"84","line":114,"column":5,"nodeType":"85","messageId":"86","endLine":114,"endColumn":16,"suppressions":"91"},{"ruleId":"83","severity":1,"message":"84","line":123,"column":5,"nodeType":"85","messageId":"86","endLine":123,"endColumn":16,"suppressions":"92"},{"ruleId":"83","severity":1,"message":"84","line":132,"column":5,"nodeType":"85","messageId":"86","endLine":132,"endColumn":16,"suppressions":"93"},{"ruleId":"83","severity":1,"message":"84","line":148,"column":5,"nodeType":"85","messageId":"86","endLine":148,"endColumn":16,"suppressions":"94"},{"ruleId":"95","severity":2,"message":"96","line":31,"column":27,"nodeType":"97","messageId":"98","endLine":34,"endColumn":4,"fix":"99","suppressions":"100"},{"ruleId":"101","severity":2,"message":"102","line":42,"column":33,"nodeType":"103","endLine":42,"endColumn":41,"suppressions":"104"},{"ruleId":"101","severity":2,"message":"105","line":44,"column":7,"nodeType":"103","endLine":44,"endColumn":16,"suppressions":"106"},"react-hooks/exhaustive-deps","React Hook useMemo has an unnecessary dependency: 'selectedNetwork'. Either exclude it or remove the dependency array.","ArrayExpression",["107"],"no-console","Unexpected console statement.","MemberExpression","unexpected",["108"],["109"],["110"],["111"],["112"],["113"],["114"],["115"],"react/function-component-definition","Function component is not a function declaration","ArrowFunctionExpression","function-declaration",{"range":"116","text":"117"},["118"],"react-hooks/rules-of-hooks","React Hook \"useState\" is called in function \"watch\" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word \"use\".","Identifier",["119"],"React Hook \"useEffect\" is called in function \"watch\" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word \"use\".",["120"],{"desc":"121","fix":"122"},{"kind":"123","justification":"124"},{"kind":"123","justification":"124"},{"kind":"123","justification":"124"},{"kind":"123","justification":"124"},{"kind":"123","justification":"124"},{"kind":"123","justification":"124"},{"kind":"123","justification":"124"},{"kind":"123","justification":"124"},[981,1190],"function ContextProvider({ children, ...props }: PropsWithChildren<TProps>) {\n const value = valueProvider(props as TProps);\n return <Context.Provider value={value}>{children}</Context.Provider>;\n }",{"kind":"123","justification":"124"},{"kind":"123","justification":"124"},{"kind":"123","justification":"124"},"Update the dependencies array to be: [appState]",{"range":"125","text":"126"},"directive","",[1511,1538],"[appState]"]

apps/vite-example/.eslintrc.cjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright © Aptos
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
const devTools = ['./vite.config.ts'];
5+
6+
module.exports = {
7+
env: { browser: true, es2020: true },
8+
extends: ["@aptos-labs/eslint-config-adapter"],
9+
parserOptions: {
10+
project: ['tsconfig.json', 'tsconfig.node.json'],
11+
},
12+
plugins: ['react-refresh'],
13+
root: true,
14+
rules: {
15+
'import/extensions': 'off',
16+
'import/no-extraneous-dependencies': ['error', { devDependencies: devTools }],
17+
'react-refresh/only-export-components': 'warn',
18+
'react/react-in-jsx-scope': 'off',
19+
},
20+
};

apps/vite-example/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

apps/vite-example/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="icon" type="image/png" href="/favicon.ico">
7+
<title>Example Dapp</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

apps/vite-example/package.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "@aptos-labs/wallet-adapter-vite-example",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"lint": "prettier --check src",
10+
"lint:fix": "prettier --write src && eslint --cache ./src --fix",
11+
"preview": "vite preview"
12+
},
13+
"dependencies": {
14+
"@aptos-connect/wallet-api": "^0.0.3",
15+
"@aptos-labs/ts-sdk": "1.10.0-zeta.2",
16+
"@aptos-labs/wallet-adapter-ant-design": "workspace:*",
17+
"@aptos-labs/wallet-adapter-core": "workspace:*",
18+
"@aptos-labs/wallet-adapter-mui-design": "workspace:*",
19+
"@aptos-labs/wallet-adapter-react": "workspace:*",
20+
"@aptos-labs/wallet-standard": "^0.0.11",
21+
"@aptos-connect/wallet-adapter-plugin": "^0.0.3",
22+
"@bitget-wallet/aptos-wallet-adapter": "^0.1.0",
23+
"@blocto/aptos-wallet-adapter-plugin": "^0.2.2",
24+
"@flipperplatform/wallet-adapter-plugin": "^0.1.0",
25+
"@haechi-labs/face-aptos-adapter-plugin": "^0.0.4",
26+
"@haechi-labs/face-sdk": "^1.10.8",
27+
"@haechi-labs/face-types": "^1.10.8",
28+
"@identity-connect/wallet-adapter-plugin": "^1.2.5",
29+
"@martianwallet/aptos-wallet-adapter": "^0.0.5",
30+
"@msafe/aptos-wallet-adapter": "^1.0.11",
31+
"@okwallet/aptos-wallet-adapter": "^0.0.3",
32+
"@onekeyfe/aptos-wallet-adapter": "^0.1.2",
33+
"@openblockhq/aptos-wallet-adapter": "^0.1.5",
34+
"@pontem/wallet-adapter-plugin": "^0.2.1",
35+
"@rise-wallet/wallet-adapter": "^0.1.2",
36+
"@tp-lab/aptos-wallet-adapter": "^1.0.1",
37+
"@trustwallet/aptos-wallet-adapter": "^0.1.6",
38+
"@welldone-studio/aptos-wallet-adapter": "^0.1.4",
39+
"antd": "^5.1.2",
40+
"ethers": "^5.7.2",
41+
"fewcha-plugin-wallet-adapter": "^0.1.3",
42+
"petra-plugin-wallet-adapter": "^0.4.5",
43+
"react": "18.2.0",
44+
"react-dom": "18.2.0"
45+
},
46+
"devDependencies": {
47+
"@babel/core": "^7.0.0",
48+
"@types/node": "^17.0.12",
49+
"@types/react": "18.0.28",
50+
"@types/react-dom": "^18.0.11",
51+
"@vitejs/plugin-react-swc": "^3.0.0",
52+
"autoprefixer": "^10.4.13",
53+
"eslint": "8.57.0",
54+
"eslint-plugin-react-refresh": "^0.3.4",
55+
"postcss": "^8.4.19",
56+
"tailwindcss": "^3.2.4",
57+
"typescript": "5.0.4",
58+
"vite": "^4.3.9"
59+
}
60+
}

apps/vite-example/postcss.config.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

apps/vite-example/public/favicon.ico

4.19 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
identity-connect-57fa42a9-29c6-4f1e-939c-4eefa36d9ff5

0 commit comments

Comments
 (0)