Skip to content

Commit

Permalink
build: implement prettier and configure lint"
Browse files Browse the repository at this point in the history
  • Loading branch information
gweiworld committed Jan 24, 2024
1 parent 8768c06 commit e564dcb
Show file tree
Hide file tree
Showing 53 changed files with 1,155 additions and 967 deletions.
8 changes: 4 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": [
"@babel/preset-env",
["@babel/preset-react", { "runtime": "automatic" }]
]
"presets": [
"@babel/preset-env",
["@babel/preset-react", { "runtime": "automatic" }]
]
}
4 changes: 2 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ module.exports = {
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
"react-hooks/exhaustive-deps": "off",
'react-hooks/exhaustive-deps': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
};
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.npm
dist
node_modules
pkg
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Download from [Node.js official website](https://nodejs.org/en/download/)

2. **Rust (rustc 1.71.1 & cargo 1.71.1)**

- Install using the following command:
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Expand All @@ -23,11 +24,13 @@
### Setup Steps

1. **Install Node Modules**

```bash
npm i
```

2. **Build wasm Package**

```bash
cd issuer
wasm-pack build --target bundler
Expand All @@ -39,4 +42,4 @@
npm run dev
```

Enjoy using **zPass Tools**!
Enjoy using **zPass Tools**!
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
display: inline-block;
position: absolute;
top: 0;
background-color: #00C0F9;
background-color: #00c0f9;
border-radius: 100%;

-webkit-animation: sk-bounce 2s infinite ease-in-out;
Expand Down
17 changes: 16 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"private": true,
"version": "0.1.0",
"type": "module",
"license": "MIT",
"license": "Apache-2.0",
"scripts": {
"dev": "vite",
"dev:webpack": "webpack-dev-server",
"build": "webpack --config webpack.config.js",
"build:vite": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"preview": "vite preview",
"prettier": "prettier --write ."
},
"dependencies": {
"@aleohq/sdk": "^0.6.5",
Expand All @@ -25,6 +26,7 @@
"axios": "^1.5.0",
"constate": "^3.3.2",
"moment": "^2.29.4",
"prettier": "^3.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.10.1",
Expand Down
2 changes: 2 additions & 0 deletions programs/datetime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
## Build Guide

To compile this Aleo program, run:

```bash
snarkvm build
```

To execute this Aleo program, run:

```bash
snarkvm run hello
```
8 changes: 4 additions & 4 deletions programs/datetime/program.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"program": "datetime.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
"program": "datetime.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
}
2 changes: 2 additions & 0 deletions programs/offchain_verifier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
## Build Guide

To compile this Aleo program, run:

```bash
snarkvm build
```

To execute this Aleo program, run:

```bash
snarkvm run hello
```
8 changes: 4 additions & 4 deletions programs/offchain_verifier/program.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"program": "offchain_verifier.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
"program": "offchain_verifier.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
}
2 changes: 2 additions & 0 deletions programs/offchain_verifier_keccak/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
## Build Guide

To compile this Aleo program, run:

```bash
snarkvm build
```

To execute this Aleo program, run:

```bash
snarkvm run hello
```
8 changes: 4 additions & 4 deletions programs/offchain_verifier_keccak/program.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"program": "offchain_verifier_keccak.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
"program": "offchain_verifier_keccak.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
}
2 changes: 2 additions & 0 deletions programs/offchain_verifier_sha3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
## Build Guide

To compile this Aleo program, run:

```bash
snarkvm build
```

To execute this Aleo program, run:

```bash
snarkvm run hello
```
8 changes: 4 additions & 4 deletions programs/offchain_verifier_sha3/program.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"program": "offchain_verifier_sha3.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
"program": "offchain_verifier_sha3.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
}
2 changes: 2 additions & 0 deletions programs/onchain_issuer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
## Build Guide

To compile this Aleo program, run:

```bash
snarkvm build
```

To execute this Aleo program, run:

```bash
snarkvm run hello
```
8 changes: 4 additions & 4 deletions programs/onchain_issuer/program.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"program": "onchain_issuer.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
"program": "onchain_issuer.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
}
2 changes: 2 additions & 0 deletions programs/onchain_issuer_keccak/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
## Build Guide

To compile this Aleo program, run:

```bash
snarkvm build
```

To execute this Aleo program, run:

```bash
snarkvm run hello
```
8 changes: 4 additions & 4 deletions programs/onchain_issuer_keccak/program.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"program": "onchain_issuer_keccak.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
"program": "onchain_issuer_keccak.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
}
2 changes: 2 additions & 0 deletions programs/onchain_issuer_sha3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
## Build Guide

To compile this Aleo program, run:

```bash
snarkvm build
```

To execute this Aleo program, run:

```bash
snarkvm run hello
```
8 changes: 4 additions & 4 deletions programs/onchain_issuer_sha3/program.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"program": "onchain_issuer_sha3.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
"program": "onchain_issuer_sha3.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
}
2 changes: 2 additions & 0 deletions programs/onchain_verifier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
## Build Guide

To compile this Aleo program, run:

```bash
snarkvm build
```

To execute this Aleo program, run:

```bash
snarkvm run hello
```
8 changes: 4 additions & 4 deletions programs/onchain_verifier/program.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"program": "onchain_verifier.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
"program": "onchain_verifier.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
}
27 changes: 17 additions & 10 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useState } from 'react';
import { ConfigProvider, Layout as AntLayout, Switch, theme } from 'antd';
import { ConfigProvider, Layout as AntLayout, theme } from 'antd';
import IssuerApp from './pages/IssuerApp';
import { Outlet } from 'react-router-dom';

Expand All @@ -10,29 +9,37 @@ const commonContentStyle = {

const App = () => {
const { Header, Content, Footer, Sider } = AntLayout;
const [darkMode, setDarkMode] = useState(false);

return (
<ConfigProvider
theme={{
algorithm: darkMode ? theme.darkAlgorithm : theme.defaultAlgorithm,
algorithm: theme.defaultAlgorithm,
token: {
colorPrimary: "#18e48f",
colorPrimary: '#18e48f',
},
}}
>
<AntLayout>
<Header>
<img
src="zpass.png"
alt="zPass"
style={{ height: '34px', width: 'auto', float: 'left', marginLeft: '-34px', marginTop: '12px' }}
<img
src="zpass.png"
alt="zPass"
style={{
height: '34px',
width: 'auto',
float: 'left',
marginLeft: '-34px',
marginTop: '12px',
}}
/>
</Header>

<Content style={{ margin: '0 10px 0 0' }}>
<AntLayout hasSider>
<Sider width={'30vw'} style={{ ...commonContentStyle, display: 'flex' }}>
<Sider
width={'30vw'}
style={{ ...commonContentStyle, display: 'flex' }}
>
<IssuerApp />
</Sider>
<Content style={{ ...commonContentStyle }}>
Expand Down
Loading

0 comments on commit e564dcb

Please sign in to comment.