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

Dev #47

Merged
merged 119 commits into from
Jun 11, 2023
Merged

Dev #47

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
731e550
fix QR code in dark mode by adding white border
KKA11010 Jun 5, 2023
276db11
add shim & remove pkg patches
BilligsterUser Jun 5, 2023
84f131e
update buffer imports
BilligsterUser Jun 5, 2023
61a98da
move disclaimer in its own container
KKA11010 Jun 5, 2023
5352f2f
Merge pull request #17 from BilligsterUser/add-shim-&-remove-pkg-patches
KKA11010 Jun 5, 2023
7522a2d
only apply white border in darkmode
KKA11010 Jun 5, 2023
cf575ab
Merge pull request #18 from cashubtc/fix-QR
BilligsterUser Jun 5, 2023
a1aa33d
add localization helper & update @styles imports
BilligsterUser Jun 6, 2023
5f3e9a9
update after review
BilligsterUser Jun 6, 2023
c46ca8c
Merge pull request #21 from BilligsterUser/localization-helper
KKA11010 Jun 6, 2023
bf6a989
add openLinkInBrowser helper && update jest setup
BilligsterUser Jun 6, 2023
e03e39e
Update index.ts
BilligsterUser Jun 6, 2023
34655d4
update fn name from openLinkInBrowser to openUrl
BilligsterUser Jun 6, 2023
48a240a
Update node.js.yml
BilligsterUser Jun 6, 2023
c07ef9b
update npm script
BilligsterUser Jun 6, 2023
69c5921
Merge pull request #22 from BilligsterUser/add-openLinkInBrowser-help…
KKA11010 Jun 7, 2023
6f3cc93
update type of mint states to handle custom mint name
KKA11010 Jun 7, 2023
dad3036
show custom mint names on all components using mint_url. closes #2
KKA11010 Jun 7, 2023
dc730a8
update after review
KKA11010 Jun 7, 2023
a7c6dd2
update after review
KKA11010 Jun 7, 2023
b29b00f
update formatInt
KKA11010 Jun 7, 2023
c035634
update jsDocs for formatInt()
KKA11010 Jun 7, 2023
4dfdd7e
use getLanguageCode() in localeDateString. closes #19
KKA11010 Jun 7, 2023
1490bb0
Merge pull request #24 from cashubtc/custom-mint-name
BilligsterUser Jun 8, 2023
9a2d842
show compact notation using 'en' locale
KKA11010 Jun 8, 2023
4295d0a
update var name from createSpendableToken to isSendingToken
KKA11010 Jun 8, 2023
7057187
add memo input to send token page #1
KKA11010 Jun 8, 2023
2135ae1
show memo in success pages & prompts #1
KKA11010 Jun 8, 2023
d4c9426
fix styling of text-input fields
KKA11010 Jun 8, 2023
d0f2d97
update address book contact modal
KKA11010 Jun 8, 2023
e718974
change new mint popup into a bottom slide modal
KKA11010 Jun 8, 2023
d67e078
Show msg not enough funds if selected mint bal is 0
KKA11010 Jun 8, 2023
4d041eb
update header text from payment page
KKA11010 Jun 8, 2023
3f8b742
replace a popup with a txt msg
KKA11010 Jun 8, 2023
64fde14
update payment process from empty mints, remove popups
KKA11010 Jun 8, 2023
a227c72
add a toaster component
KKA11010 Jun 8, 2023
f0f4522
update toaster, use it in mint settings page
KKA11010 Jun 8, 2023
5ada04b
use toaster in dashboard
KKA11010 Jun 8, 2023
7774795
Merge pull request #25 from cashubtc/memo
BilligsterUser Jun 8, 2023
e9f1c89
update sql stuff
BilligsterUser Jun 8, 2023
8f7ff9f
Merge pull request #27 from BilligsterUser/sql
KKA11010 Jun 8, 2023
6468093
add base layout for mint proofs page #3
KKA11010 Jun 8, 2023
eddace3
add mint proofs page #3
KKA11010 Jun 8, 2023
ae62d9f
add a few jsDocs for proofs-list components
KKA11010 Jun 8, 2023
ee9ae6d
setup Reactotron
BilligsterUser Jun 8, 2023
24aa6d4
update after review
KKA11010 Jun 8, 2023
802b117
Merge pull request #29 from BilligsterUser/Reactotron
KKA11010 Jun 8, 2023
7a8979b
Merge pull request #28 from cashubtc/3-add-a-mint-option-to-show-proofs
BilligsterUser Jun 8, 2023
6b194da
setup bugsnag & add ErrorBoundary
BilligsterUser Jun 8, 2023
be3645a
add basic test
KKA11010 Jun 8, 2023
62d8399
fix
BilligsterUser Jun 8, 2023
9abb613
test the Txt component
KKA11010 Jun 8, 2023
5660277
fix imports
BilligsterUser Jun 8, 2023
9d18ad0
Merge pull request #30 from BilligsterUser/bugsnag
KKA11010 Jun 8, 2023
06ccdad
Merge branch 'dev' into component-test
KKA11010 Jun 8, 2023
086fc73
small fix
BilligsterUser Jun 8, 2023
0cfef2e
Merge pull request #31 from BilligsterUser/small-fix
KKA11010 Jun 8, 2023
def17e6
Merge branch 'dev' into component-test
KKA11010 Jun 8, 2023
b6fda07
fix selected mint state, fix bugsnack missing api key
KKA11010 Jun 8, 2023
f92a85c
use the Txt component whenever possible
KKA11010 Jun 8, 2023
ccf1bbf
remove TODO
KKA11010 Jun 8, 2023
606ced5
Update the cashu token QR
BilligsterUser Jun 9, 2023
a6a86e5
claimToken
BilligsterUser Jun 9, 2023
e8cfceb
Update index.ts
BilligsterUser Jun 9, 2023
96dfe5f
Merge pull request #32 from BilligsterUser/Update-the-cashu-token-QR
KKA11010 Jun 9, 2023
be4981a
update getMintsUrls
BilligsterUser Jun 9, 2023
86a28d2
add isTrustedMint overload
BilligsterUser Jun 9, 2023
aeddf21
Merge pull request #34 from BilligsterUser/getMintsUrls
KKA11010 Jun 9, 2023
94b06d2
Feature request! "eCash" -> "Ecash" The 90s are long gone!!! 😁
BilligsterUser Jun 9, 2023
23548fa
add jscpd & add @consts path alias
BilligsterUser Jun 9, 2023
ac76c92
Merge pull request #35 from BilligsterUser/naming
KKA11010 Jun 9, 2023
1ff969a
fix tests
BilligsterUser Jun 9, 2023
ac89d49
Update package.json
BilligsterUser Jun 9, 2023
f618c8f
Merge branch 'dev' into component-test
KKA11010 Jun 9, 2023
bb0540b
add AsyncStore tests
BilligsterUser Jun 9, 2023
b693bdd
Merge branch 'dev' into add-jscpd-&-add-@consts-path-alias
BilligsterUser Jun 9, 2023
b69d42d
update QR scan page
KKA11010 Jun 9, 2023
297051e
update qr marker border width
KKA11010 Jun 9, 2023
1de4113
add utils hasTrustedMint tests
BilligsterUser Jun 9, 2023
4a4224c
Merge pull request #36 from BilligsterUser/add-jscpd-&-add-@consts-pa…
KKA11010 Jun 9, 2023
f27df44
Merge branch 'dev' into component-test
KKA11010 Jun 9, 2023
97bcd0d
update jest config for tsx components
KKA11010 Jun 9, 2023
5947eb2
add test, handle getLanguageCode, update theme context
KKA11010 Jun 9, 2023
d7e5fce
Merge pull request #37 from cashubtc/component-test
BilligsterUser Jun 9, 2023
f2f0bc4
update jest config
BilligsterUser Jun 9, 2023
322949a
add success page basic test
KKA11010 Jun 9, 2023
383dac1
Merge pull request #38 from BilligsterUser/update-jest-config
KKA11010 Jun 9, 2023
650755c
Merge branch 'dev' into component-test
KKA11010 Jun 9, 2023
5ad5d5f
test successpage. navigation hook error
KKA11010 Jun 9, 2023
875f42f
add success page test
KKA11010 Jun 9, 2023
1b68d7c
lint
KKA11010 Jun 9, 2023
d704444
remove unused import
KKA11010 Jun 9, 2023
6c3f258
add eslint jest plugin
BilligsterUser Jun 10, 2023
048a75d
fix tests
BilligsterUser Jun 10, 2023
34e5227
Merge pull request #39 from cashubtc/component-test
BilligsterUser Jun 10, 2023
b2ce2c6
update lint & update Success component navigation test
BilligsterUser Jun 10, 2023
bb7f034
Merge pull request #40 from BilligsterUser/update-lint-&-update-Succe…
KKA11010 Jun 10, 2023
f2321db
indicate latest keyset ids in proof lists #33
KKA11010 Jun 10, 2023
8735041
Merge branch 'dev' into 33-indicate-keyset-ids-with-a-font-color
KKA11010 Jun 10, 2023
8fe6255
add scrollview to proof list page
KKA11010 Jun 10, 2023
9d2d542
add keysetHint #33
KKA11010 Jun 10, 2023
2b7ecfd
add mint icon next to mintUrl in proof list
KKA11010 Jun 10, 2023
a132900
fix linter hook warnings
KKA11010 Jun 10, 2023
24f4a9c
add comment
BilligsterUser Jun 10, 2023
b525859
Merge pull request #41 from cashubtc/33-indicate-keyset-ids-with-a-fo…
BilligsterUser Jun 10, 2023
99b12ac
update spelling of ecash to Ecash
KKA11010 Jun 10, 2023
03b113a
add getMintCurrentKeySetId & getMintKeySetIds fns
BilligsterUser Jun 10, 2023
67b892b
Merge pull request #42 from BilligsterUser/add-getMintCurrentKeySetId…
KKA11010 Jun 10, 2023
b8d40bc
update bugsnag error boundary
KKA11010 Jun 10, 2023
52e7ed4
update errorDetails component
KKA11010 Jun 10, 2023
66f4380
Merge branch 'dev' into bugsnag
KKA11010 Jun 10, 2023
6d1fc71
example bugsnag notify
KKA11010 Jun 10, 2023
c169773
remove useless code
KKA11010 Jun 10, 2023
cde75c9
add .example.env
KKA11010 Jun 10, 2023
96e8c2a
update example env, remove error test
KKA11010 Jun 10, 2023
37b66d2
remove error test
KKA11010 Jun 10, 2023
f1a810a
Merge pull request #43 from cashubtc/bugsnag
KKA11010 Jun 10, 2023
b769ed5
Add options to the history entry of an ecash tx #20 (#45)
KKA11010 Jun 10, 2023
9b0f643
update eas ci workflow (#46)
BilligsterUser Jun 11, 2023
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
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ build
.vscode
coverage
patches
test
babel.config.js
jest.config.js
jest.config.js
report
86 changes: 56 additions & 30 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
{
"env": {
"es6": true,
"node": true,
"es2021": true,
// "react-native/react-native": true,
"jest/globals": true
},
"settings": {
"react": {
"pragma": "React",
"version": "detect"
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
} /* ,
"import/resolver": {
/* "typescript": {
"paths": "./tsconfig.json",
"alwaysTryTypes": true
},
// "typescript": {}, // this loads <rootdir>/tsconfig.json to ESLint
"node": {
"extensions": [
".js",
".jsx",
".ts",
".tsx"
]
}
} */
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
Expand All @@ -7,16 +38,29 @@
"plugin:promise/recommended",
"plugin:json/recommended",
// "plugin:import/recommended",
"plugin:import/typescript"
"plugin:import/typescript",
"plugin:jest/recommended",
// "eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:react/jsx-runtime"
// "plugin:import/errors",
// "plugin:import/warnings"
],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.d.ts"]
}
],
"globals": {
"__dirname": true,
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
// "sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"globalReturn": true,
Expand All @@ -25,6 +69,9 @@
"project": "tsconfig.json"
},
"plugins": [
"react",
"react-hooks",
"jest",
"es5",
"html",
"@typescript-eslint",
Expand All @@ -41,6 +88,8 @@
"jsdoc"
],
"rules": {
"react/no-unescaped-entities": "warn",
"no-dupe-class-members": 0,
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
"import/first": "warn",
Expand All @@ -49,25 +98,16 @@
"promise/always-return": ["warn", { "ignoreLastCallback": true }],
// to enforce using type for object type definitions, can be type or interface
"@typescript-eslint/consistent-type-definitions": ["warn", "interface"],
"@typescript-eslint/array-type": [
"warn",
{
"default": "array"
}
],
"@typescript-eslint/array-type": ["warn", { "default": "array" }],
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/consistent-type-exports": "warn",
"@typescript-eslint/restrict-template-expressions": [
"warn",
{
"allowNumber": true,
"allowBoolean": true,
"allowNullish": true
}
{ "allowNumber": true, "allowBoolean": true, "allowNullish": true }
],
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
// "@typescript-eslint/explicit-module-boundary-types": 0,
/* "@typescript-eslint/naming-convention": [
"warn",
{
Expand Down Expand Up @@ -156,7 +196,7 @@
"@getify/proper-arrows/return": ["warn", {
"object": true
}] */
"@getify/proper-arrows/where": 0,
// "@getify/proper-arrows/where": 0,
"@typescript-eslint/no-unused-vars": [
"warn",
{
Expand Down Expand Up @@ -185,21 +225,7 @@
"no-else-return": "warn",
"prefer-const": "warn",
"no-console": 1,
"no-unused-vars": [
"warn",
{
// "varsIgnorePattern": "^_",
// "caughtErrorsIgnorePattern": "^ignore"
"argsIgnorePattern": "^_"
}
],
"indent": [
"warn",
"tab",
{
"SwitchCase": 1
}
],
"indent": ["warn", "tab", { "SwitchCase": 1 }],
"linebreak-style": ["warn", "windows"],
"quotes": ["warn", "single"],
"semi": ["warn", "never"]
Expand Down
7 changes: 7 additions & 0 deletions .example.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BUGSNAG_APIKEY=
BUGSNAG_API_KEY=

NODE_ENV=development
NODE_ENV_SHORT=dev
APP_VARIANT=dev
DEBUG=dev
21 changes: 21 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
changelog:
exclude:
labels:
- ignore-for-release
- bot
categories:
- title: Pull requests
labels:
- release
- title: Breaking Changes 🛠
labels:
- breaking-change
- title: New Features 🎉
labels:
- enhancement
- title: Tests
labels:
- "test"
- title: Documentation
labels:
- "documentation"
2 changes: 2 additions & 0 deletions .github/workflows/eas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:

jobs:
build:
env:
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
push:
branches: [main, dev]
pull_request:
types: [opened, reopened]
# types: [opened, reopened]
# types: [opened, synchronize, edited, ready_for_review]

jobs:
build:
Expand All @@ -29,6 +30,7 @@ jobs:
- run: npm run lint
- run: npm run build --if-present
- run: npm run test:coverage
# - run: npm run testtsx:coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ web-build/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
.env*
.env
report/
6 changes: 5 additions & 1 deletion app.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@

const configPath = `${__dirname}/config/app.config.ts`;

require('ts-node/register');
module.exports = require('./config/app.config.ts');

module.exports = require(configPath);
7 changes: 6 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@

const configPath = `${__dirname}/config/babel.config.ts`;

require('ts-node/register');
module.exports = require('./config/babel.config.ts');

module.exports = require(configPath);

68 changes: 54 additions & 14 deletions config/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,55 @@
/* eslint-disable no-unused-vars */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { config as dotenvConfig } from 'dotenv'
import { ExpoConfig } from 'expo/config'

import { version } from './../package.json'

const IS_DEV = process.env.APP_VARIANT === 'dev'
const IS_PREVIEW = process.env.APP_VARIANT === 'preview'
const IS_PROD = process.env.APP_VARIANT === 'prod'


type AppVariant = 'preview' | 'prod' | 'dev' | undefined

function nodeEnvShort(): 'test' | AppVariant {
if (!process?.env?.NODE_ENV) {
process.env.NODE_ENV = 'development'
return
}
if (process.env.NODE_ENV === 'production') { return 'prod' }
if (process.env.NODE_ENV === 'development') { return 'dev' }
if (process.env.NODE_ENV === 'test') { return 'test' }
if (process.env.NODE_ENV === 'preview') { return 'preview' }
}
function appVariant(): AppVariant {
if (!process?.env?.APP_VARIANT) {
process.env.APP_VARIANT = 'dev'
return
}
if (process.env.APP_VARIANT === 'prod') { return 'prod' }
if (process.env.APP_VARIANT === 'dev') { return 'dev' }
if (process.env.APP_VARIANT === 'preview') { return 'preview' }
}


const _appVariant = appVariant() || process.env.APP_VARIANT || 'dev'

const _nodeEnvShort = nodeEnvShort()

try {
dotenvConfig({ path: `.env${_nodeEnvShort === 'prod' ? '' : `.${nodeEnvShort()}`}` })
} catch (e) { console.log('dotenv error:', e) } // eslint-disable-line no-console


// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
const IS_DEV = _appVariant === 'dev'
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
const IS_PREVIEW = _appVariant === 'preview'
const IS_PROD = _appVariant === 'prod'



const config: ExpoConfig = {
name: `eNuts${!IS_PROD ? ` (${process.env.APP_VARIANT})` : ''}`,
name: `eNuts${!IS_PROD ? ` (${_appVariant})` : ''}`,
slug: 'enuts',
version: `${version}${!IS_PROD ? `-${process.env.APP_VARIANT}` : ''}`,
owner: 'enuts_wallet',
version: `${version}${!IS_PROD ? `-${_appVariant}` : ''}`,
scheme: 'cashu',
orientation: 'portrait',
icon: './assets/icon.png',
Expand All @@ -25,6 +61,8 @@ const config: ExpoConfig = {
},
assetBundlePatterns: ['**/*'],
plugins: [
'@bugsnag/plugin-expo-eas-sourcemaps',
'expo-localization',
[
'expo-barcode-scanner',
{
Expand All @@ -49,18 +87,20 @@ const config: ExpoConfig = {
foregroundImage: './assets/adaptive-icon.png',
backgroundColor: '#5DB075'
},
package: `com.agron.enuts${!IS_PROD ? `.${process.env.APP_VARIANT}` : ''}`
package: `com.agron.enuts${!IS_PROD ? `.${_appVariant}` : ''}`
},
web: {
favicon: './assets/favicon.png'
},
extra: {
eas: {
projectId: 'edb75ccd-71ac-4934-9147-baf1c7f2b068'
}, DEBUG: process.env.DEBUG,
APP_VARIANT: process.env.APP_VARIANT,
},
owner: 'enuts_wallet'
eas: { projectId: 'edb75ccd-71ac-4934-9147-baf1c7f2b068' },
DEBUG: process.env.DEBUG,
APP_VARIANT: _appVariant,
bugsnag: { 'apiKey': process.env.BUGSNAG_API_KEY, },
NODE_ENV: process.env.NODE_ENV,
NODE_ENV_SHORT: _nodeEnvShort,
}
}


export default config
1 change: 1 addition & 0 deletions config/babel.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const fn: ConfigFunction = (api: ConfigAPI): TransformOptions => {
'@util': './src/util',
'@modal': './src/components/modal',
'@store': './src/storage/store',
'@consts': './src/consts',
},
'extensions': [
'.js',
Expand Down
17 changes: 17 additions & 0 deletions config/cpd.config.ts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"output":"./report/ts/",
"pattern": "**/*.ts",
"format": "typescript",
"silent": true,
"ignoreCase": true,
"max-lines": 10000,
"minTokens": 75,
"max-size": "30mb",
"threshold": 10,
"min-lines": 5,
"mode": "weak",
"gitignore": true,
"reporters": ["html", "console"],
"ignore": ["**/__snapshots__/**", "node_modules", "report", ".git"],
"absolute": true
}
17 changes: 17 additions & 0 deletions config/cpd.config.tsx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"output": "./report/tsx/",
"pattern": "**/*.tsx",
"format": "tsx",
"silent":true,
"ignoreCase": true,
"max-lines": 10000,
"minTokens": 75,
"max-size": "30mb",
"threshold": 10,
"min-lines": 5,
"mode": "weak",
"gitignore": true,
"reporters": ["html", "console"],
"ignore": ["**/__snapshots__/**", "node_modules", "report", ".git"],
"absolute": true
}
Loading