Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call npm run format, add format github action #240

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check format

on: [push, pull_request]

jobs:
format-check:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm install

- name: Run format check
run: npm run format
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
Cashu Wallet

## One-liner build & run

```
docker-compose up -d
```

access at http://localhost:3000 or serve it behind a reverse proxy.

## Install the dependencies
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: '2'
version: "2"
services:
cashu.me:
image: cashu.me
build: .
container_name: cashu.me
restart: always
ports:
- "127.0.0.1:3000:80"
- "127.0.0.1:3000:80"
2 changes: 1 addition & 1 deletion extension/embedder.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<title><%= productName %></title>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build:pwa": "quasar build -m pwa",
"quasar": "quasar",
"lint": "eslint --ext .js,.vue ./",
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
"format": "prettier --write .",
"test": "vitest",
"test:ci": "vitest run"
},
Expand Down
19 changes: 18 additions & 1 deletion src-capacitor/android/app/debug/output.json
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-debug.apk","fullName":"debug","baseName":"debug","dirName":""},"path":"app-debug.apk","properties":{}}]
[
{
"outputType": { "type": "APK" },
"apkData": {
"type": "MAIN",
"splits": [],
"versionCode": 1,
"versionName": "1.0",
"enabled": true,
"outputFile": "app-debug.apk",
"fullName": "debug",
"baseName": "debug",
"dirName": ""
},
"path": "app-debug.apk",
"properties": {}
}
]
4 changes: 2 additions & 2 deletions src-pwa/custom-service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if (process.env.MODE !== "ssr" || process.env.PROD) {
registerRoute(
new NavigationRoute(
createHandlerBoundToURL(process.env.PWA_FALLBACK_HTML),
{ denylist: [/sw\.js$/, /workbox-(.)*\.js$/] }
)
{ denylist: [/sw\.js$/, /workbox-(.)*\.js$/] },
),
);
}
4 changes: 2 additions & 2 deletions src/boot/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ window.windowMixin = {
type = "null",
position = "top",
caption = null,
color = null
color = null,
) {
// failure
this.$q.notify({
Expand Down Expand Up @@ -194,7 +194,7 @@ window.windowMixin = {
if (this.$q.localStorage.getItem("cashu.theme")) {
document.body.setAttribute(
"data-theme",
this.$q.localStorage.getItem("cashu.theme")
this.$q.localStorage.getItem("cashu.theme"),
);
} else {
this.changeColor("monochrome");
Expand Down
16 changes: 10 additions & 6 deletions src/components/BalanceView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
<!-- <q-card class="q-my-md q-py-sm">
<q-card-section class="q-mt-sm q-py-xs"> -->
<div class="q-pt-xl q-pb-md">
<div class="row justify-center q-pb-lg" style="height:80px">
<div class="row justify-center q-pb-lg" style="height: 80px">
<div v-if="globalMutexLock">
<transition
appear
enter-active-class="animated fadeIn"
leave-active-class="animated fadeOut"
>
<q-spinner-hourglass class="q-mt-lg q-mb-none" size="lg" color="primary" />
</transition>
<q-spinner-hourglass
class="q-mt-lg q-mb-none"
size="lg"
color="primary"
/>
</transition>
</div>
<div v-else >
<div v-else>
<transition
appear
enter-active-class="animated fadeIn"
Expand Down Expand Up @@ -60,7 +64,7 @@
{{
formatCurrency(
(bitcoinPrice / 100000000) * getTotalBalance,
"USD"
"USD",
)
}}
</strong>
Expand All @@ -70,7 +74,7 @@
{{
formatCurrency(
(getTotalBalance / 100 / bitcoinPrice) * 100000000,
"sat"
"sat",
)
}}
</strong>
Expand Down
2 changes: 1 addition & 1 deletion src/components/InvoiceDetailDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export default defineComponent({
let display = this.formatCurrency(
this.invoiceData.amount,
this.invoiceData.unit,
true
true,
);
return display;
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/MintSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
mintSwap(
swapData.from_url.url,
swapData.to_url.url,
swapData.amount
swapData.amount,
)
"
:disable="
Expand Down
6 changes: 3 additions & 3 deletions src/components/PayInvoiceDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
formatCurrency(
payInvoiceData.meltQuote.response.amount,
activeUnit,
true
true,
)
}}
</h6>
Expand Down Expand Up @@ -59,8 +59,8 @@
payInvoiceData.meltQuote.error != ''
? 'Error'
: !payInvoiceData.blocking
? 'Pay'
: 'Processing...'
? 'Pay'
: 'Processing...'
"
:loading="globalMutexLock && !payInvoiceData.blocking"
class="q-px-lg"
Expand Down
2 changes: 1 addition & 1 deletion src/components/QrcodeReader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default {
highlightScanRegion: true,
highlightCodeOutline: true,
onDecodeError: () => {},
}
},
);
this.qrScanner.start();
this.urDecoder = new URDecoder();
Expand Down
4 changes: 2 additions & 2 deletions src/components/ReceiveTokenDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default defineComponent({
// get the private key for the token we want to receive if it is locked with P2PK
receiveStore.receiveData.p2pkPrivateKey =
this.getPrivateKeyForP2PKEncodedToken(
receiveStore.receiveData.tokensBase64
receiveStore.receiveData.tokensBase64,
);

const tokenJson = token.decode(receiveStore.receiveData.tokensBase64);
Expand Down Expand Up @@ -314,7 +314,7 @@ export default defineComponent({
// get amount from decodedToken.token.proofs[..].amount
const amount = this.getProofs(decodedToken).reduce(
(sum, el) => (sum += el.amount),
0
0,
);

tokensStore.addPendingToken({
Expand Down
2 changes: 1 addition & 1 deletion src/components/SendPaymentRequest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default defineComponent({
clickPaymentRequest: function () {
this.parseAndPayPaymentRequest(
this.sendData.paymentRequest,
this.sendData.tokensBase64
this.sendData.tokensBase64,
);
},
getPaymentRequestTransportType: function (request) {
Expand Down
8 changes: 4 additions & 4 deletions src/components/SendTokenDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ export default defineComponent({
let selectedProofs = this.coinSelect(
spendableProofs,
this.sendData.amount * this.activeUnitCurrencyMultiplyer,
this.includeFeesInSendAmount
this.includeFeesInSendAmount,
);
const feesToAdd = this.includeFeesInSendAmount
? this.getFeesForProofs(selectedProofs)
Expand Down Expand Up @@ -607,7 +607,7 @@ export default defineComponent({
}
console.log(
"### this.currentFragmentInterval",
this.currentFragmentInterval
this.currentFragmentInterval,
);
this.startQrCodeLoop();
},
Expand Down Expand Up @@ -658,7 +658,7 @@ export default defineComponent({
let { _, sendProofs } = await this.sendToLock(
this.activeProofs,
sendAmount,
this.sendData.p2pkPubkey
this.sendData.p2pkPubkey,
);
// update UI
this.sendData.tokens = sendProofs;
Expand Down Expand Up @@ -698,7 +698,7 @@ export default defineComponent({
this.activeProofs,
sendAmount,
true,
this.includeFeesInSendAmount
this.includeFeesInSendAmount,
);

// update UI
Expand Down
2 changes: 1 addition & 1 deletion src/components/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ export default defineComponent({
for (let mint of mints) {
const mintIds = mint.keysets.map((keyset) => keyset.id);
const keysetCounterThisMint = this.keysetCounters.filter((entry) =>
mintIds.includes(entry.id)
mintIds.includes(entry.id),
);
keysetCountersByMint[mint.url] = keysetCounterThisMint;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/TokenInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default defineComponent({
let uniqueIds = [...new Set(proofs.map((p) => p.id))];
// mints that have any of the keyset IDs
let mints_keysets = this.mints.filter((m) =>
m.keysets.some((r) => uniqueIds.indexOf(r) >= 0)
m.keysets.some((r) => uniqueIds.indexOf(r) >= 0),
);
// what we put into the JSON
let mints = mints_keysets.map((m) => [{ url: m.url, ids: m.keysets }][0]);
Expand All @@ -116,7 +116,7 @@ export default defineComponent({
// mints that have any of the keyset IDs
return (
this.mints.filter((m) =>
m.keysets.some((r) => uniqueIds.indexOf(r.id) >= 0)
m.keysets.some((r) => uniqueIds.indexOf(r.id) >= 0),
).length > 0
);
},
Expand Down
8 changes: 6 additions & 2 deletions src/css/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,18 @@ video {
}

.q-card {
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2), 0 2px 2px rgba(0, 0, 0, 0.14),
box-shadow:
0 1px 5px rgba(0, 0, 0, 0.2),
0 2px 2px rgba(0, 0, 0, 0.14),
0 3px 1px -2px rgba(0, 0, 0, 0.12);
border-radius: 4px;
vertical-align: top;
}

.shadow-2 {
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2), 0 2px 2px rgba(0, 0, 0, 0.14),
box-shadow:
0 1px 5px rgba(0, 0, 0, 0.2),
0 2px 2px rgba(0, 0, 0, 0.14),
0 3px 1px -2px rgba(0, 0, 0, 0.12);
}

Expand Down
Loading