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

Added support for Node.js version 20 #827

Merged
merged 14 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ If you would like to learn how to package Polar from source code or want to fix

### Tech Stack

- [Node.js](https://nodejs.org/download/release/v20.10.0/): nodejs version 20
jamaljsr marked this conversation as resolved.
Show resolved Hide resolved
- [Electron](https://github.com/electron/electron/): cross platform desktop app framework
- [Typescript](https://github.com/microsoft/TypeScript): increased productivity with a typed language
- [ReactJS](https://github.com/facebook/react/): declarative UI library for JavaScript
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polar",
"version": "2.0.0",
"version": "3.0.0",
jamaljsr marked this conversation as resolved.
Show resolved Hide resolved
"homepage": "https://lightningpolar.com",
"description": "One-click Bitcoin Lightning networks for local app development & testing",
"author": {
Expand All @@ -9,8 +9,11 @@
"url": "https://lightningpolar.com"
},
"main": "public/main/electron/index.js",
"engines": {
"node": ">=20.10.0"
},
jamaljsr marked this conversation as resolved.
Show resolved Hide resolved
"scripts": {
"build": "cross-env CI=false PUBLIC_URL=./ rescripts build",
"build": "cross-env CI=false PUBLIC_URL=./ rescripts --openssl-legacy-provider build",
"ci": "yarn lint:all && yarn test:ci",
"dev": "concurrently --kill-others --success first \"yarn:dev:*\"",
"dev:app": "yarn theme && cross-env BROWSER=none yarn start",
Expand All @@ -27,7 +30,7 @@
"prebuild": "tsc -p electron/tsconfig.json && yarn theme",
"prepare": "husky install",
"release": "standard-version --no-verify --skip.commit --skip.tag",
"start": "rescripts start",
"start": "rescripts --openssl-legacy-provider start",
"test": "cross-env DEBUG_PRINT_LIMIT=15000 rescripts test --env=jest-environment-jsdom-sixteen",
"test:ci": "cross-env CI=true yarn test --coverage",
"test:all": "yarn test:ci && yarn test:e2e",
Expand Down Expand Up @@ -60,6 +63,7 @@
},
"devDependencies": {
"@ant-design/icons": "5.2.6",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@commitlint/cli": "17.8.1",
"@commitlint/config-conventional": "17.8.1",
"@emotion/babel-plugin": "11.11.0",
Expand All @@ -79,9 +83,9 @@
"@types/jest": "29.5.11",
"@types/js-yaml": "4.0.9",
"@types/node": "18.17.19",
"@types/react": "17.0.66",
"@types/react": "18.2.46",
"@types/react-copy-to-clipboard": "5.0.7",
"@types/react-dom": "18.2.8",
"@types/react-dom": "18.2.18",
jamaljsr marked this conversation as resolved.
Show resolved Hide resolved
"@types/react-redux": "7.1.33",
"@types/react-router": "5.1.20",
"@types/react-router-dom": "5.3.3",
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/DetailsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ interface Props {
className?: string;
}

const DetailsList: React.SFC<Props> = ({ details, title, oneCol, className }) => {
const DetailsList: React.FC<Props> = ({ details, title, oneCol, className }) => {
return (
<>
{title && <h3>{title}</h3>}
Expand Down
5 changes: 4 additions & 1 deletion src/components/common/NavMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ const Styled = {
const NavMenu: React.FC = () => {
const { l } = usePrefixedTranslation('cmps.common.NavMenu');
const { navigateTo } = useStoreActions(s => s.app);
const handleClick: MenuProps['onClick'] = useCallback(info => navigateTo(info.key), []);
const handleClick: MenuProps['onClick'] = useCallback(
(info: { key: string }) => navigateTo(info.key),
[],
);

const items: MenuProps['items'] = [
{ label: l('createNetwork'), key: NETWORK_NEW, icon: <PlusOutlined /> },
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/StatusBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Styled = {
`,
};

const StatusBadge: React.SFC<StatusBadgeProps> = ({ status, text }) => {
const StatusBadge: React.FC<StatusBadgeProps> = ({ status, text }) => {
const { t } = useTranslation();
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/components/designer/AutoMineButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const AutoMineButton: React.FC<Props> = ({ network }) => {
}, [l]);

const handleAutoMineModeChanged: MenuProps['onClick'] = useCallback(
info => {
(info: { key: string | number }) => {
info.key == AutoMineMode.AutoOff
? setRemainingPercentage(0)
: setRemainingPercentage(100);
Expand Down
3 changes: 2 additions & 1 deletion src/components/designer/LinkContextMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactNode } from 'react';
import React, { ReactElement, ReactNode } from 'react';
import { ILink } from '@mrblenny/react-flow-chart';
import { Dropdown, MenuProps } from 'antd';
import { useStoreState } from 'store';
Expand All @@ -9,6 +9,7 @@ import CloseChannelButton from './link/CloseChannelButton';

interface Props {
link: ILink;
children: ReactElement;
}

const LinkContextMenu: React.FC<Props> = ({ link, children }) => {
Expand Down
8 changes: 4 additions & 4 deletions src/components/designer/NetworkDesigner.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ describe('NetworkDesigner Component', () => {

it('should render the dark links', async () => {
const { container } = renderComponent(undefined, 'dark');
// look for the first lineargradient tag
const query = 'lineargradient#lg-alice-backend1';
// look for the first linearGradient tag
const query = 'linearGradient#lg-alice-backend1';
const gradientEl = container.querySelector(query) as Element;
// get the color of the first stop in the gradient
const color = (gradientEl.firstElementChild as Element).getAttribute('stop-color');
Expand All @@ -290,8 +290,8 @@ describe('NetworkDesigner Component', () => {

it('should render the light links', async () => {
const { container } = renderComponent(undefined, 'light');
// look for the first lineargradient tag
const query = 'lineargradient#lg-alice-backend1';
// look for the first linearGradient tag
const query = 'linearGradient#lg-alice-backend1';
const gradientEl = container.querySelector(query) as Element;
// get the color of the first stop in the gradient
const color = (gradientEl.firstElementChild as Element).getAttribute('stop-color');
Expand Down
1 change: 1 addition & 0 deletions src/components/designer/NodeContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const addItemIf = (

interface Props {
node: INode;
children: ReactElement;
}

const NodeContextMenu: React.FC<Props> = ({ node: { id }, children }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/network/NetworkActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const NetworkActions: React.FC<Props> = ({

const mineAsync = useMiningAsync(network);

const handleClick: MenuProps['onClick'] = useCallback(info => {
const handleClick: MenuProps['onClick'] = useCallback((info: { key: any }) => {
jamaljsr marked this conversation as resolved.
Show resolved Hide resolved
switch (info.key) {
case 'rename':
onRenameClick();
Expand Down
2 changes: 1 addition & 1 deletion src/components/network/NewNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Styled = {
`,
};

const NewNetwork: React.SFC = () => {
const NewNetwork: React.FC = () => {
useEffect(() => info('Rendering NewNetwork component'), []);

const { l } = usePrefixedTranslation('cmps.network.NewNetwork');
Expand Down
4 changes: 2 additions & 2 deletions src/components/routing/Switch.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { ReactElement } from 'react';
import { AnimatedSwitch, spring } from 'react-router-transition';
import styled from '@emotion/styled';
import { useTheme } from 'hooks/useTheme';
Expand Down Expand Up @@ -52,7 +52,7 @@ const pageTransitions = {
},
};

const Switch: React.FC = ({ children }) => {
const Switch: React.FC<{ children: ReactElement[] }> = ({ children }) => {
const theme = useTheme();
return (
<Styled.AnimatedSwitch
Expand Down