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

Draft: refactor(common): Add type safety to loadPackage #12236

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

TheKhanj
Copy link
Contributor

@TheKhanj TheKhanj commented Aug 16, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

DESCRIPTION:
There are 2 problems in fastify-adapter.ts file on lines 438 and 453. Can anybody else fix that :) I didn't want to simply add as any to it...

@kamilmysliwiec
Copy link
Member

This will lead to compilation errors for projects with skipLibCheck set to false

@TheKhanj
Copy link
Contributor Author

@kamilmysliwiec Oh, I see. How about adding @ts-ignore:next-line before each import statement?

// @ts-ignore:next-line
import type * as Ws from 'wsss';
// @ts-ignore:next-line
import type * as Mqtt from 'mqtt';
// @ts-ignore:next-line
import type * as Nats from 'nats';
// @ts-ignore:next-line
import type * as GrpcJs from '@grpc/grpc-js';
// other imports...

@coveralls
Copy link

coveralls commented Oct 31, 2023

Pull Request Test Coverage Report for Build 20d1cbae-50c8-474b-b0d4-0a9103e7c1c8

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.26%

Totals Coverage Status
Change from base Build 3770aab0-7e99-46e0-b1a8-34ce234c1890: 0.0%
Covered Lines: 6687
Relevant Lines: 7248

💛 - Coveralls

@TheKhanj TheKhanj changed the title draft: refactor(common): Add type safety to loadPackage refactor(common): Add type safety to loadPackage Oct 31, 2023
@TheKhanj
Copy link
Contributor Author

TheKhanj commented Oct 31, 2023

I believe it is ready to be merged. About that skipLibCheck issue I added
ts-ignore (next-line) and also had to add eslint ignore (next-line)
afterwards, for pipelines to be passed, then checked it in another project with
skipLibCheck set to false, it was fine....

I agree the whole mr is like a hack but apparently generic import type is not
going to be implemented in
typescript... So your
call if it's worth being merged or not :)

Update:
Apparently we should add something in build process to add @ts-ignore comments
after typescript compiles.
flex-development/mlly@81b55ca

@TheKhanj TheKhanj changed the title refactor(common): Add type safety to loadPackage Draft: refactor(common): Add type safety to loadPackage Nov 11, 2023
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.

4 participants