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

feat: moving node imports over to using the node: prefix #729

Merged
merged 3 commits into from
Sep 15, 2023

Conversation

erunion
Copy link
Member

@erunion erunion commented Sep 14, 2023

🧰 Changes

This is mostly prework for the coming ESM support but this updates our Node module imports and requires to use the node: protocol.

I've also fixed few any typings in a number of spots that we missed.

@erunion erunion added the enhancement New feature or request label Sep 14, 2023
@erunion erunion marked this pull request as ready for review September 14, 2023 23:54
@@ -1,7 +1,7 @@
import type { TSGeneratorOptions } from '../../../src/codegen/languages/typescript';

import { promises as fs } from 'fs';
Copy link
Member Author

Choose a reason for hiding this comment

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

no idea why i loaded fs/promises like this. the things you find in small refactors...

@@ -121,7 +122,7 @@ export default class APICore {
init.signal = controller.signal;
}

return fetchHar(har as any, {
return fetchHar(har as Har, {
Copy link
Member Author

Choose a reason for hiding this comment

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

The HAR coming out of @readme/oas-to-har is a HAR but not a full one so we need to cast this.

@@ -8,6 +8,7 @@ export default async function parseResponse<HTTPStatus extends number = number>(

const responseBody = await response.text();

// eslint-disable-next-line @typescript-eslint/no-explicit-any
let data: any = responseBody;
Copy link
Member

Choose a reason for hiding this comment

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

i'm guessing unknown won't fly here?

Copy link
Member Author

Choose a reason for hiding this comment

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

unfort not

@erunion erunion merged commit 8810603 into main Sep 15, 2023
5 checks passed
@erunion erunion deleted the feat/node-protocol branch September 15, 2023 17:06
@erunion erunion added this to the v7 milestone Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants