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

[READY] Migrate signer-service to Typescript #352

Merged
merged 62 commits into from
Feb 19, 2025

Conversation

Sharqiewicz
Copy link
Contributor

@Sharqiewicz Sharqiewicz commented Jan 6, 2025

PR 🦈🟢


  • Migrate all files in signer-service to Typescript
  • Configure SWC ( TS Compiler )
  • Configure commands:
  • yarn build Compiles TypeScript code into JavaScript using the fast SWC compiler
  • yarn start Runs the compiled application
  • yarn build:start Compiles and then immediately runs the application (When you want to test production)
  • yarn dev Runs the application in development mode with automatic reloading on code changes

How to review

There are only two new files .swcrc and tsconfig.json they are short and consistent.
The challenge with the review is going through every migrated file. I tried to keep the logic the same, but sometimes there were a lot of TypeScript errors, so I had to make changes to the files.

@Sharqiewicz Sharqiewicz linked an issue Jan 6, 2025 that may be closed by this pull request
Copy link

netlify bot commented Jan 6, 2025

Deploy Preview for pendulum-pay ready!

Name Link
🔨 Latest commit 7b5f83a
🔍 Latest deploy log https://app.netlify.com/sites/pendulum-pay/deploys/67b5a88959f8810009444e0e
😎 Deploy Preview https://deploy-preview-352--pendulum-pay.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for going through this tedious process @Sharqiewicz 👌 Looks good overall, I just found a few things we might want to improve.

Some remarks:

  • IIRC our deployment currently assumes that yarn start is enough to run the signer-service. If we now split it up into yarn build and yarn start, we'll have to touch the deployment instructions of the service or it won't start. This is an important consideration before we merge this. Either we a) combine building and running in yarn start or b) change the deployment steps. b) is favorable IMO.
  • The linting seems to be broken. yarn lint finds lots of issues that doesn't seem like issues to me. Maybe we need to change the config files.

@Sharqiewicz Sharqiewicz changed the base branch from polygon-prototype-staging to staging February 7, 2025 13:46
@Sharqiewicz
Copy link
Contributor Author

@ebma
I changed the commands to:

    "build": "swc src -d dist --strip-leading-paths",
    "serve": "node dist/index.js",
    "start": "yarn build && yarn serve"

so yarn start is enough for the deployment

}
};

export const sendStatusWithPkController = async (_req: Request, res: Response, _next: NextFunction) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're not using this fn anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @gianfra-t

Copy link
Contributor

@gianfra-t gianfra-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comments @Sharqiewicz !

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just two minor things. Let's address that, resolve the merge conflict and finally get this on staging ✅

export const SUPPORTED_FIAT_CURRENCIES = ['eur', 'ars'] as const;
export type FiatCurrency = (typeof SUPPORTED_FIAT_CURRENCIES)[number];

export interface QuoteRequest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This type is unused and a duplicate of QuoteQuery

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's just me, but don't you think the comments we had were helpful @pendulum-chain/devs? I suggest we re-add them because the logic is not obvious.

@Sharqiewicz
Copy link
Contributor Author

@ebma

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go 🚀

@Sharqiewicz Sharqiewicz merged commit 9d49905 into staging Feb 19, 2025
5 checks passed
@ebma ebma deleted the 281-switch-to-typescript-in-signer-service branch February 19, 2025 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to TypeScript in signer service
3 participants