Page MenuHomePhabricator

[Cashtab] Convert JS common components to ts
ClosedPublic

Authored by bytesofman on Jul 10 2025, 16:46.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCaff5a718854b: [Cashtab] Convert JS common components to ts
Summary

Continue incremental implementation of ts in Cashtab

Convert Common components (except CustomIcons.js) that are still js to ts

CustomIcons.js is actually a bigger change and should be its own diff

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Tail of the build log:

Run `npm audit` for details.

> ecash-lib@3.2.0 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

/work/modules/ecash-agora /work/abc-ci-builds/cashtab-tests

added 272 packages, and audited 275 packages in 1s

37 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (1 low, 5 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@2.1.0 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/abc-ci-builds/cashtab-tests
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated eslint@8.56.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1396 packages, and audited 2833 packages in 14s

284 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (1 low, 9 moderate, 2 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> cashtab@3.30.2 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

TS2307: Cannot find module 'assets/paybutton.webp' or its corresponding type declarations.
     5 | import * as React from 'react';
     6 | import styled from 'styled-components';
  >  7 | import PayButton from 'assets/paybutton.webp';
       |                       ^^^^^^^^^^^^^^^^^^^^^^^
     8 | import XecxSrc from 'assets/xecx-logomark.png';
     9 | import SolSrc from 'assets/solanaLogoMark.png';
    10 | import TetherSrc from 'assets/tether.png';


Build cashtab-tests failed with exit code 1

back out the icons conversion as it should be its own change, correct prop types

Tail of the build log:

Run `npm audit` for details.

> ecash-lib@3.2.0 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

/work/modules/ecash-agora /work/abc-ci-builds/cashtab-tests

added 272 packages, and audited 275 packages in 1s

37 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (1 low, 5 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@2.1.0 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/abc-ci-builds/cashtab-tests
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated eslint@8.56.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1396 packages, and audited 2833 packages in 14s

284 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (1 low, 9 moderate, 2 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> cashtab@3.30.2 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

TS2307: Cannot find module 'assets/popout.svg' or its corresponding type declarations.
     6 | import styled from 'styled-components';
     7 | import Cashtab from 'assets/cashtab_xec.png';
  >  8 | import PopOut from 'assets/popout.svg';
       |                    ^^^^^^^^^^^^^^^^^^^
     9 |
    10 | interface ExtensionHeaderProps {
    11 |     path?: string;


Build cashtab-tests failed with exit code 1

modify types to allow tsx to import svg

bytesofman added inline comments.
cashtab/src/types.d.ts
7 ↗(On Diff #54803)

needed for ExtensionHeader.tsx to import svg

This revision is now accepted and ready to land.Jul 11 2025, 07:29