-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from v1xingyue/main
一个基本的脚手架
- Loading branch information
Showing
30 changed files
with
1,404 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"plugin:react/recommended", | ||
"standard", | ||
"prettier" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
}, | ||
"plugins": [ | ||
"react", | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"no-debugger":"off", | ||
"react/prop-types": "off", | ||
"react/jsx-curly-brace-presence": "error", | ||
"react/jsx-uses-react": "off", | ||
"react/react-in-jsx-scope": "off", | ||
"react/self-closing-comp": [ | ||
"error", | ||
{ | ||
"component": true, | ||
"html": true | ||
} | ||
], | ||
"react/jsx-boolean-value": "error", | ||
"prefer-template": "error", | ||
"jsx-quotes": ["error", "prefer-double"], | ||
"react/jsx-tag-spacing": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
aptos-dapp-scaffold.movefuns.xyz |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;padding:1.5rem} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/assets/favicon-2e5a0f62.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>aptos dapp scaffold</title> | ||
<script type="module" crossorigin src="/assets/index-79067bd9.js"></script> | ||
<link rel="stylesheet" href="/assets/index-774029a4.css"> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
|
||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>aptos dapp scaffold</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build/* | ||
.aptos/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = 'playground' | ||
version = '1.0.0' | ||
|
||
[addresses] | ||
playground = "_" | ||
|
||
[dependencies.AptosFramework] | ||
local = "../../aptos-core/aptos-move/framework/aptos-framework" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
module playground::mycounter { | ||
|
||
use std::signer; | ||
use std::string; | ||
use std::error; | ||
|
||
const E_DATA_EXIST:u64 = 0; | ||
const E_DATA_NOT_FOUND:u64 = 1; | ||
const E_NOT_ALLOW:u64 = 2; | ||
|
||
struct CounterHolder has key { | ||
value: u64, | ||
creator: address, | ||
allow:address, | ||
description: string::String | ||
} | ||
|
||
public fun allow_write(address:address,counter:&mut CounterHolder):bool { | ||
counter.allow == address || counter.creator == address | ||
} | ||
|
||
public fun counter_exist(address:address):bool { | ||
exists<CounterHolder>(address) | ||
} | ||
|
||
public entry fun make_counter(account:&signer,allow:address,value:u64,description:string::String) { | ||
let creator = signer::address_of(account); | ||
assert!(!counter_exist(creator), error::already_exists(E_DATA_EXIST)); | ||
move_to(account,CounterHolder{value,creator,allow,description}); | ||
} | ||
|
||
public entry fun update_counter(account:&signer,holder:address,value:u64,description:string::String) acquires CounterHolder { | ||
assert!(counter_exist(holder), error::already_exists(E_DATA_NOT_FOUND)); | ||
let current = signer::address_of(account); | ||
let mut_counter = borrow_global_mut<CounterHolder>(holder); | ||
assert!(allow_write(current,mut_counter), error::not_found(E_NOT_ALLOW)); | ||
mut_counter.value = value; | ||
mut_counter.description = description; | ||
} | ||
|
||
public entry fun delete_counter(account:&signer) acquires CounterHolder { | ||
let current = signer::address_of(account); | ||
assert!(counter_exist(current), error::not_found(E_DATA_NOT_FOUND)); | ||
let counter = move_from<CounterHolder>(current); | ||
let CounterHolder {value:_,creator:_,allow:_,description:_ } = counter; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"name": "aptos-dapp-scaffold", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview", | ||
"pub": "/bin/bash scripts/pub_page.sh" | ||
}, | ||
"dependencies": { | ||
"@aptos-labs/wallet-adapter-mui-design": "^1.0.0", | ||
"@aptos-labs/wallet-adapter-react": "^1.2.1", | ||
"@blocto/aptos-wallet-adapter-plugin": "^0.1.8", | ||
"@emotion/react": "^11.11.1", | ||
"@emotion/styled": "^11.11.0", | ||
"@martianwallet/aptos-wallet-adapter": "^0.0.4", | ||
"@mui/material": "^5.13.5", | ||
"@nightlylabs/aptos-wallet-adapter-plugin": "^0.2.12", | ||
"@openblockhq/aptos-wallet-adapter": "^0.1.5", | ||
"@pontem/wallet-adapter-plugin": "^0.2.0", | ||
"@rise-wallet/wallet-adapter": "^0.1.2", | ||
"@tp-lab/aptos-wallet-adapter": "^1.0.1", | ||
"@trustwallet/aptos-wallet-adapter": "^0.1.6", | ||
"@welldone-studio/aptos-wallet-adapter": "^0.1.4", | ||
"fewcha-plugin-wallet-adapter": "^0.1.2", | ||
"msafe-plugin-wallet-adapter": "^0.1.0", | ||
"petra-plugin-wallet-adapter": "^0.1.5", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.0.37", | ||
"@types/react-dom": "^18.0.11", | ||
"@typescript-eslint/eslint-plugin": "^5.59.0", | ||
"@typescript-eslint/parser": "^5.59.0", | ||
"@vitejs/plugin-react": "^4.0.0", | ||
"eslint": "^8.38.0", | ||
"eslint-config-prettier": "^8.6.0", | ||
"eslint-config-standard": "^17.0.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-n": "^15.6.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.3.4", | ||
"eslint-plugin-standard": "^5.0.0", | ||
"eslint-plugin-tailwindcss": "^3.8.3", | ||
"typescript": "^5.0.2", | ||
"vite": "^4.3.9" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
echo "build pages" | ||
yarn build | ||
echo "clean old pages" | ||
rm -rf docs/index.html docs/assets/ | ||
echo "copy generated files" | ||
cp -R dist/index.html dist/assets docs/ | ||
git add docs | ||
now=$(date +%Y%m%d%H%m%S) | ||
git commit -m "publish pages ${now} " | ||
git push origin main |
Oops, something went wrong.