Skip to content

Commit

Permalink
Add prettier config
Browse files Browse the repository at this point in the history
Resolves #1457
  • Loading branch information
kieranhall committed Feb 27, 2024
1 parent 33577c2 commit ce58cf3
Show file tree
Hide file tree
Showing 269 changed files with 4,626 additions and 4,154 deletions.
127 changes: 63 additions & 64 deletions web-wallet/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,73 +1,72 @@
module.exports = {
"env": {
"browser": true,
"es2022": true,
"node": true
env: {
browser: true,
es2022: true,
node: true,
},
"extends": [
extends: [
"@dusk-network/eslint-config/js",
"@dusk-network/eslint-config/svelte"
"@dusk-network/eslint-config/svelte",
],
"globals": {
"CONFIG": false
globals: {
CONFIG: false,
},
"overrides": [{
"files": ["*.svelte"],
"rules": {
"no-undef-init": 0,
"svelte/require-optimized-style-attribute": 0
}
}, {
"files": ["*.spec.js", "*.test.js"],
"rules": {
"brace-style": [
"error",
"1tbs",
{ "allowSingleLine": true }
],
"jsdoc/require-jsdoc": 0,
"max-len": [
"error", {
"code": 110,
"comments": 110,
"ignorePattern": "^\\s*it\\(",
"ignoreUrls": true
}
],
"max-nested-callbacks": [
"error",
5
],
"max-statements": 0,
"max-statements-per-line": [
"error", {
"max": 2
}
],
"object-curly-newline": 0,
"quote-props": [
"error",
"consistent"
],
"sort-keys": 0
}
}],
"root": true,
"settings": {
overrides: [
{
files: ["*.svelte"],
rules: {
"no-undef-init": 0,
"svelte/require-optimized-style-attribute": 0,
},
},
{
files: ["*.spec.js", "*.test.js"],
rules: {
"brace-style": ["error", "1tbs", {allowSingleLine: true}],
"jsdoc/require-jsdoc": 0,
"max-len": [
"error",
{
code: 110,
comments: 110,
ignorePattern: "^\\s*it\\(",
ignoreUrls: true,
},
],
"max-nested-callbacks": ["error", 5],
"max-statements": 0,
"max-statements-per-line": [
"error",
{
max: 2,
},
],
"object-curly-newline": 0,
"sort-keys": 0,
},
},
],
root: true,
settings: {
"import/resolver": {
"eslint-import-resolver-custom-alias": {
"alias": {
"$app": "node_modules/@sveltejs/kit/src/runtime/app",
"$config": "./src/config",
"$lib": "./src/lib",
"@sveltejs/kit": "node_modules/@sveltejs/kit/src/exports/index.js",
"@testing-library/svelte": "node_modules/@testing-library/svelte/src/index.js",
"svelte/motion": "node_modules/svelte/src/runtime/motion/index.js",
"svelte/store": "node_modules/svelte/src/runtime/store/index.js",
"svelte/transition": "node_modules/svelte/src/runtime/transition/index.js"
alias: {
$app: "node_modules/@sveltejs/kit/src/runtime/app",
$config: "./src/config",
$lib: "./src/lib",
"@sveltejs/kit":
"node_modules/@sveltejs/kit/src/exports/index.js",
"@testing-library/svelte":
"node_modules/@testing-library/svelte/src/index.js",
"svelte/motion":
"node_modules/svelte/src/runtime/motion/index.js",
"svelte/store":
"node_modules/svelte/src/runtime/store/index.js",
"svelte/transition":
"node_modules/svelte/src/runtime/transition/index.js",
},
"extensions": [".cjs", ".js", ".json", ".svelte"]
}
}
}
extensions: [".cjs", ".js", ".json", ".svelte"],
},
},
},
};
11 changes: 11 additions & 0 deletions web-wallet/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import duskJsPrettierConfig from "@dusk-network/prettier-config/js/index.js";
import duskSveltePrettierConfig from "@dusk-network/prettier-config/svelte/index.js";

export default {
plugins: ["prettier-plugin-svelte"],
overrides: [{files: "*.svelte", options: {parser: "svelte"}}],
...duskJsPrettierConfig,
...duskSveltePrettierConfig,
arrowParens: "avoid",
bracketSpacing: false,
};
81 changes: 42 additions & 39 deletions web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,83 +8,85 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Add Create Wallet flow tests [#1443]
- Add visible version, commit hash and build date [#1441]
- Add Address validation (Transfer flow) [#1377]

- Add Create Wallet flow tests [#1443]
- Add visible version, commit hash and build date [#1441]
- Add Address validation (Transfer flow) [#1377]

### Changed

- Change Get Quote API Endpoint to env variable [#1311]
- Change Get Quote API Endpoint to env variable [#1311]

### Removed

- Remove the use of `checkValidity()` in Send and Stake flow amounts validity checks [#1391]
- Remove the use of `checkValidity()` in Send and Stake flow amounts validity checks [#1391]

### Fixed

- Fix typo in routes/welcome/\_\_tests\_\_/page.spec.js [#1445]
- Fix missing whitespace when Transaction list is empty [#1460]
- Fix typo in routes/welcome/\_\_tests\_\_/page.spec.js [#1445]
- Fix missing whitespace when Transaction list is empty [#1460]

## [0.2.1] - 2024-02-20

### Added

- Add wallet restore flow tests [#1416]
- Add missing login flow tests [#1423]
- Add wallet restore flow tests [#1416]
- Add missing login flow tests [#1423]

### Fixed

- Fix restore flow allowing invalid mnemonic to be used to log in [#1416]
- Fix can't unlock the wallet with upper case words [#1417]
- Fix restore flow allowing invalid mnemonic to be used to log in [#1416]
- Fix can't unlock the wallet with upper case words [#1417]

## [0.2.0] - 2024-02-15

### Added

- Add running node requirement notice in Staking flow [#1359]
- Add `fiatPrice` optional property to Balance component [#1323]
- Add ability to revert words when entering the mnemonic phrase [#1290]
- Add missing error handling when querying the quote API [#1322]
- Add gas settings validation to settings page [#1352]
- Add forced log out on inactive tabs [#1373]
- Add gas settings validation to block Send and Stake operations if invalid gas settings [#1354]
- Add abortable sync [#1401]
- Add `existing wallet notice` to wallet create, restore and login flows [#1360]
- Add `userId` value to localStorage preferences object during wallet create and restore [#1360]
- Add running node requirement notice in Staking flow [#1359]
- Add `fiatPrice` optional property to Balance component [#1323]
- Add ability to revert words when entering the mnemonic phrase [#1290]
- Add missing error handling when querying the quote API [#1322]
- Add gas settings validation to settings page [#1352]
- Add forced log out on inactive tabs [#1373]
- Add gas settings validation to block Send and Stake operations if invalid gas settings [#1354]
- Add abortable sync [#1401]
- Add `existing wallet notice` to wallet create, restore and login flows [#1360]
- Add `userId` value to localStorage preferences object during wallet create and restore [#1360]

### Changed

- Change Holdings component design [#1361]
- Change `fiatCurrency`, `locale`, `tokenCurrency`, `token` to required properties in Balance component [#1323]
- Change `package.json` fields to reflect repo change [#1367]
- Change `walletStore.js` to receive gasPrice and gasLimit when `transfer` , `stake`, `unstake` and `withdrawRewards` are called [#1353]
- Update deprecated Node actions in CI [#1343]
- Change `setGasSettings` event to `gasSettings` and include `isValidGas` property in event data [#1354]
- Change "withdraw stake" label to "unstake" [#1403]
- Change logout flow to abort a sync if in progress [#1401]
- Update dusk-wallet-js to from 0.3.2 to 0.4.2 [#1401]
- Change Holdings component design [#1361]
- Change `fiatCurrency`, `locale`, `tokenCurrency`, `token` to required properties in Balance component [#1323]
- Change `package.json` fields to reflect repo change [#1367]
- Change `walletStore.js` to receive gasPrice and gasLimit when `transfer` , `stake`, `unstake` and `withdrawRewards` are called [#1353]
- Update deprecated Node actions in CI [#1343]
- Change `setGasSettings` event to `gasSettings` and include `isValidGas` property in event data [#1354]
- Change "withdraw stake" label to "unstake" [#1403]
- Change logout flow to abort a sync if in progress [#1401]
- Update dusk-wallet-js to from 0.3.2 to 0.4.2 [#1401]

### Removed

- Remove `fiat` property from Balance component [#1323]
- Remove `gasSettings` store update from `dashboard/+page.svelte.js` [#1353]
- Remove `fiat` property from Balance component [#1323]
- Remove `gasSettings` store update from `dashboard/+page.svelte.js` [#1353]

### Fixed

- Fix Transactions table remains hidden for some screen resolutions [#1412]
- Fix Stake button is always disabled [#1410]
- Fix wizard progression on Stake flow [#1398]
- Fix Seed Phrase words size [#1335]
- Fix colors on red background [#1334]
- Fix Transactions table design [#1309]
- Fix Transactions table remains hidden for some screen resolutions [#1412]
- Fix Stake button is always disabled [#1410]
- Fix wizard progression on Stake flow [#1398]
- Fix Seed Phrase words size [#1335]
- Fix colors on red background [#1334]
- Fix Transactions table design [#1309]

## [0.1.0-beta] - 2024-02-02

### Added

- Add initial commit
- Add initial commit

<!-- ISSUES -->

[#1359]: https://github.com/dusk-network/rusk/issues/1359
[#1311]: https://github.com/dusk-network/rusk/issues/1311
[#1323]: https://github.com/dusk-network/rusk/issues/1323
Expand Down Expand Up @@ -117,6 +119,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#1443]: https://github.com/dusk-network/rusk/issues/1443

<!-- VERSIONS -->

[Unreleased]: https://github.com/dusk-network/rusk/tree/master/web-wallet
[0.2.1]: https://github.com/dusk-network/rusk/tree/web-wallet-0.2.1
[0.2.0]: https://github.com/dusk-network/rusk/tree/web-wallet-0.2.0
Expand Down
39 changes: 20 additions & 19 deletions web-wallet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Web Wallet website.

## TOC

- [Web Wallet](#web-wallet)
- [TOC](#toc)
- [Build system and dev environment](#build-system-and-dev-environment)
- [Environment variables](#environment-variables)
- [NPM scripts](#npm-scripts)
- [Running a local Rusk node](#running-a-local-rusk-node)
- [Web Wallet](#web-wallet)
- [TOC](#toc)
- [Build system and dev environment](#build-system-and-dev-environment)
- [Environment variables](#environment-variables)
- [NPM scripts](#npm-scripts)
- [Running a local Rusk node](#running-a-local-rusk-node)

## Build system and dev environment

Expand All @@ -23,6 +23,7 @@ As the application uses the [Web Crypto API](https://developer.mozilla.org/en-US
The staging environment is at https://web-wallet-staging-oxs3z.ondigitalocean.app/

## Environment variables

The `dusk-wallet-js` library uses some [environment variables](https://github.com/dusk-network/dusk-wallet-js/blob/main/.env).

The application defines these variables by reading a local `.env` file containing the same variables used in the `dusk-wallet-js`, with the addition of the `VITE_` prefix.
Expand Down Expand Up @@ -53,19 +54,19 @@ To run a local node different steps are needed, so please read the [related sect

## NPM scripts

- `npm run build` generates the production build
- `npm run checks` runs all checks (lint, typecheck and test)
- `npm run dev` generates the development build and starts the dev server
- `npm run dev:host` generates the development build, starts the dev server and exposes it to the local network
- `npm run lint`: performs the linting checks
- `npm run lint:fix`: runs ESLint with the `--fix` flag to fix formatting errors
- `npm run preview` previews the production build
- `npm test` runs the test suite
- `npm run test:coverage` runs the test suite and generate the code coverage report in the `coverage` folder
- `npm run test:watch` runs the test suite in watch mode
- `npm run typecheck` runs the type checker
- `npm run typecheck:watch` runs the type checker in watch mode
- `npm run build` generates the production build
- `npm run checks` runs all checks (lint, typecheck and test)
- `npm run dev` generates the development build and starts the dev server
- `npm run dev:host` generates the development build, starts the dev server and exposes it to the local network
- `npm run lint`: performs the linting checks
- `npm run lint:fix`: runs ESLint with the `--fix` flag to fix formatting errors
- `npm run preview` previews the production build
- `npm test` runs the test suite
- `npm run test:coverage` runs the test suite and generate the code coverage report in the `coverage` folder
- `npm run test:watch` runs the test suite in watch mode
- `npm run typecheck` runs the type checker
- `npm run typecheck:watch` runs the type checker in watch mode

## Running a local Rusk node

To run a local node, follow the instructions outlined in the [Rusk's readme](https://github.com/dusk-network/rusk).
To run a local node, follow the instructions outlined in the [Rusk's readme](https://github.com/dusk-network/rusk).
24 changes: 12 additions & 12 deletions web-wallet/__mocks__/Wallet.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Wallet {
constructor (seed, gasLimit = 2900000000, gasPrice = 1) {
constructor(seed, gasLimit = 2900000000, gasPrice = 1) {
this.gasLimit = gasLimit;
this.gasPrice = gasPrice;
this.seed = seed;
Expand All @@ -11,17 +11,17 @@ class Wallet {
seed;
wasm;

async history () {}
async getBalance () {}
async getPsks () {}
async stake () {}
async stakeAllow () {}
async stakeInfo () {}
async reset () {}
async sync () {}
async transfer () {}
async unstake () {}
async withdrawReward () {}
async history() {}
async getBalance() {}
async getPsks() {}
async stake() {}
async stakeAllow() {}
async stakeInfo() {}
async reset() {}
async sync() {}
async transfer() {}
async unstake() {}
async withdrawReward() {}
}

export default Wallet;
4 changes: 1 addition & 3 deletions web-wallet/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
"$lib": ["./src/lib"],
"$lib/*": ["./src/lib/*"]
},
"types": [
"./node_modules/@testing-library/jest-dom/types/vitest.d.ts"
]
"types": ["./node_modules/@testing-library/jest-dom/types/vitest.d.ts"]
}
}
Loading

0 comments on commit ce58cf3

Please sign in to comment.