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

Republish v9 series to include type updates #147

Closed
4 tasks done
ChristianMurphy opened this issue Aug 9, 2023 · 6 comments
Closed
4 tasks done

Republish v9 series to include type updates #147

ChristianMurphy opened this issue Aug 9, 2023 · 6 comments
Labels
☂️ area/types This affects typings 💪 phase/solved Post is done

Comments

@ChristianMurphy
Copy link
Member

Initial checklist

Affected packages and versions

9.0.3

Link to runnable example

No response

Steps to reproduce

Build with TypeScript 5 with Node16 module resolution.
Along side hast-util-to-html version 8.0.4.

The published typings point to internals of hast-util-to-html which are no longer accessible.
https://www.npmjs.com/package/rehype-stringify/v/9.0.3?activeTab=code

/** @type {import('unified').Plugin<[Options?]|Array<void>, Node, string>} */
export default function rehypeStringify(
  config: void | import('hast-util-to-html/lib/types').Options | undefined
): void
export type Root = import('hast').Root
export type Node = Root | Root['children'][number]
export type Options = import('hast-util-to-html').Options

Expected behavior

No error and published package should point to the exported option

Actual behavior

node_modules/rehype-stringify/lib/index.d.ts:3:25 - error TS2307: Cannot find module 'hast-util-to-html/lib/types' or its corresponding type declarations.

3   config: void | import('hast-util-to-html/lib/types').Options | undefined

Runtime

Node v16

Package manager

npm 8

OS

Linux

Build and bundle tools

Vite

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Aug 9, 2023
@ChristianMurphy ChristianMurphy added the ☂️ area/types This affects typings label Aug 9, 2023
@wooorm
Copy link
Member

wooorm commented Aug 9, 2023

Yup, everything will be updated!

rk-terence added a commit to rk-terence/gz-remark-callout that referenced this issue Aug 10, 2023
@ChristianMurphy
Copy link
Member Author

Great!
To confirm, it will update on the current release line, v9?
Or will the fix only be published in the next major, V10?

@wooorm
Copy link
Member

wooorm commented Aug 15, 2023

Ah, you mean just regenerating the types, missed that.
Yeah, I can do that too!
So I guess it’s totally broken now?

@ChristianMurphy
Copy link
Member Author

So I guess it’s totally broken now?

Unfortunately yes,
currently the types can only be used with skipLibCheck and don't do much (if any) checking without the import it relies on.

Yeah, I can do that too!

Thanks!
I think running npm install, then the build script again, then publishing, should automatically resolve it 🤞

@wooorm
Copy link
Member

wooorm commented Aug 15, 2023

ok will look at it tomorrow!

@wooorm
Copy link
Member

wooorm commented Aug 16, 2023

I released rehype-parse/rehype-stringify, I think that should do the trick!

@wooorm wooorm closed this as completed Aug 16, 2023
@wooorm wooorm added the 💪 phase/solved Post is done label Aug 16, 2023
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☂️ area/types This affects typings 💪 phase/solved Post is done
Development

No branches or pull requests

2 participants