Skip to content

Commit

Permalink
Merge branch 'getAlby:master' into #2788
Browse files Browse the repository at this point in the history
  • Loading branch information
volfiros authored Nov 1, 2023
2 parents 5f0d5ec + 8c37bb8 commit e6ca968
Show file tree
Hide file tree
Showing 91 changed files with 3,595 additions and 1,453 deletions.
8 changes: 0 additions & 8 deletions .swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,5 @@
"runtime": "automatic"
}
}
},
"env": {
"targets": [
"last 5 Chrome versions",
"last 5 Edge versions",
"last 5 Opera versions",
"last 5 Firefox versions"
]
}
}
35 changes: 34 additions & 1 deletion create-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,39 @@

# Extract version from package.json
VERSION=$(node -pe "require('./package.json').version")
NODE_ENV=production

if [ -z ${ALBY_OAUTH_CLIENT_ID_CHROME+x} ];
then
echo "OAuth client id for Chrome:"
read ALBY_OAUTH_CLIENT_ID_CHROME
fi

if [ -z ${ALBY_OAUTH_CLIENT_SECRET_CHROME+x} ];
then
echo "OAuth client secret for Chrome:"
read ALBY_OAUTH_CLIENT_SECRET_CHROME
fi

if [ -z ${ALBY_OAUTH_CLIENT_ID_FIREFOX+x} ];
then
echo "OAuth client id for Firefox:"
read ALBY_OAUTH_CLIENT_ID_FIREFOX
fi

if [ -z ${ALBY_OAUTH_CLIENT_SECRET_FIREFOX+x} ];
then
echo "OAuth client secret for Firefox:"
read ALBY_OAUTH_CLIENT_SECRET_FIREFOX
fi

if [ -z ${ALBY_API_URL+x} ];
then
ALBY_API_URL="https://api.getalby.com"
fi

echo "Creating the build for v$VERSION"
yarn build

echo "Creating zip packages for v$VERSION"
cd dist/production
Expand Down Expand Up @@ -38,4 +71,4 @@ echo "Created alby-opera-v$VERSION.crx (SHA512: $SHA)"

echo "done!"

cd ../../../
cd ../../../
3 changes: 0 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ const swcConfig = {
},
target: "es2016",
},
env: {
targets: "",
},
};

// eslint-disable-next-line no-undef
Expand Down
81 changes: 41 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lightning-browser-extension",
"version": "3.2.1",
"version": "3.3.0",
"description": "Lightning browser extension",
"private": true,
"repository": "https://github.com/bumi/lightning-browser-extension.git",
Expand All @@ -21,7 +21,7 @@
"build:firefox": "NODE_ENV=production TARGET_BROWSER=firefox webpack",
"build:opera": "NODE_ENV=production TARGET_BROWSER=opera webpack",
"build": "yarn build:chrome && yarn build:firefox && yarn build:opera",
"package": "yarn build && ./create-packages.sh",
"package": "./create-packages.sh",
"lint": "yarn lint:js && yarn tsc:compile && yarn format:fix",
"lint:js": "eslint src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
"lint:js:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
Expand All @@ -35,21 +35,22 @@
"prepare": "husky install"
},
"dependencies": {
"@bitcoin-design/bitcoin-icons-react": "^0.1.9",
"@bitcoin-design/bitcoin-icons-react": "^0.1.10",
"@bitcoinerlab/secp256k1": "^1.0.5",
"@getalby/sdk": "^2.2.3",
"@headlessui/react": "^1.7.16",
"@lightninglabs/lnc-web": "^0.2.4-alpha",
"@noble/curves": "^1.1.0",
"@noble/secp256k1": "^2.0.0",
"@scure/bip32": "^1.3.1",
"@scure/bip39": "^1.2.1",
"@scure/btc-signer": "^0.5.1",
"@tailwindcss/forms": "^0.5.4",
"@vespaiach/axios-fetch-adapter": "^0.3.0",
"axios": "^0.27.2",
"bech32": "^2.0.0",
"bitcoinjs-lib": "^6.1.0",
"bolt11": "^1.4.1",
"crypto-js": "^4.1.1",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.9",
"dexie": "^3.2.4",
"elliptic": "^6.5.4",
Expand All @@ -71,7 +72,7 @@
"react-loading-skeleton": "^3.3.1",
"react-modal": "^3.16.1",
"react-qr-code": "^2.0.12",
"react-router-dom": "^6.14.2",
"react-router-dom": "^6.17.0",
"slip77": "^0.2.0",
"stream": "^0.0.2",
"tailwindcss": "^3.3.3",
Expand All @@ -80,67 +81,67 @@
"zustand": "^3.7.2"
},
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@jest/types": "^29.6.1",
"@playwright/test": "^1.37.1",
"@swc/core": "^1.3.68",
"@swc/jest": "^0.2.27",
"@commitlint/cli": "^17.8.0",
"@commitlint/config-conventional": "^17.8.0",
"@jest/types": "^29.6.3",
"@playwright/test": "^1.39.0",
"@swc/core": "^1.3.92",
"@swc/jest": "^0.2.29",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/chrome": "^0.0.243",
"@types/crypto-js": "^4.1.1",
"@types/elliptic": "^6.4.14",
"@types/lodash.merge": "^4.6.7",
"@types/lodash.pick": "^4.4.0",
"@types/lodash.snakecase": "^4.1.1",
"@types/pubsub-js": "^1.8.3",
"@types/react-dom": "^18.2.7",
"@types/react-modal": "^3.16.0",
"@types/uuid": "^9.0.2",
"@types/webextension-polyfill": "^0.10.1",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"autoprefixer": "^10.4.15",
"@testing-library/user-event": "^14.5.1",
"@trivago/prettier-plugin-sort-imports": "^4.2.1",
"@types/chrome": "^0.0.248",
"@types/crypto-js": "^4.1.3",
"@types/elliptic": "^6.4.16",
"@types/lodash.merge": "^4.6.8",
"@types/lodash.pick": "^4.4.8",
"@types/lodash.snakecase": "^4.1.8",
"@types/pubsub-js": "^1.8.5",
"@types/react-dom": "^18.2.13",
"@types/react-modal": "^3.16.2",
"@types/uuid": "^9.0.6",
"@types/webextension-polyfill": "^0.10.5",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"autoprefixer": "^10.4.16",
"buffer": "^6.0.3",
"clean-webpack-plugin": "^4.0.0",
"complete-randomer": "^1.9.1",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.8.1",
"css-minimizer-webpack-plugin": "^5.0.1",
"del-cli": "^5.0.0",
"eslint": "^8.47.0",
"del-cli": "^5.1.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"fake-indexeddb": "^4.0.1",
"filemanager-webpack-plugin": "^8.0.0",
"html-webpack-plugin": "^5.5.3",
"husky": "^8.0.3",
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-webextension-mock": "^3.8.9",
"lint-staged": "^13.3.0",
"lint-staged": "^15.0.2",
"mini-css-extract-plugin": "^2.7.6",
"msw": "^1.3.1",
"postcss": "^8.4.28",
"msw": "^1.3.2",
"postcss": "^8.4.31",
"postcss-cli": "^10.1.0",
"postcss-loader": "^7.3.3",
"pptr-testing-library": "^0.7.0",
"prettier": "^3.0.1",
"process": "^0.11.10",
"puppeteer": "^21.0.3",
"puppeteer": "^21.3.6",
"stream-browserify": "^3.0.0",
"swc-loader": "^0.2.3",
"tailwindcss-3d": "^1.0.0",
"tailwindcss-3d": "^1.0.2",
"terser-webpack-plugin": "^5.3.9",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-bundle-analyzer": "^4.9.0",
"webpack": "^5.89.0",
"webpack-bundle-analyzer": "^4.9.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"webpack-sources": "^3.2.3",
Expand Down
14 changes: 7 additions & 7 deletions src/app/components/Badge/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { useTranslation } from "react-i18next";
import { classNames } from "~/app/utils";

type Props = {
label: "budget" | "auth" | "imported";
color: string;
textColor: string;
small?: boolean;
className: string;
};

export default function Badge({ label, color, textColor, small }: Props) {
export default function Badge({ label, className }: Props) {
const { t: tComponents } = useTranslation("components", {
keyPrefix: "badge",
});

return (
<span
className={`inline-block leading-none rounded-full font-medium mr-2 py-1 bg-${color} text-${textColor} ${
!small ? "px-2 text-xs" : "px-1.5 text-xxxs"
}`}
className={classNames(
"inline-block leading-none rounded-full font-medium mr-2 py-1 px-2 text-xs",
className
)}
>
{tComponents(`label.${label}`)}
</span>
Expand Down
15 changes: 3 additions & 12 deletions src/app/components/BadgesList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,20 @@ export default function BadgesList({ allowance }: Props) {
if (allowance.remainingBudget > 0) {
badges.push({
label: "budget",
color: "green-bitcoin",
textColor: "white",
className: "bg-blue-500 text-white",
});
}
if (allowance.lnurlAuth) {
badges.push({
label: "auth",
color: "green-bitcoin",
textColor: "white",
className: "bg-green-bitcoin text-white",
});
}

return (
<>
{badges?.map((b) => {
return (
<Badge
key={b.label}
label={b.label}
color={b.color}
textColor={b.textColor}
/>
);
return <Badge key={b.label} label={b.label} className={b.className} />;
})}
</>
);
Expand Down
Loading

0 comments on commit e6ca968

Please sign in to comment.