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

🧹 Upgrade unified/unist stack #1603

Draft
wants to merge 51 commits into
base: main
Choose a base branch
from

Conversation

agoose77
Copy link
Contributor

@agoose77 agoose77 commented Oct 25, 2024

This PR starts the process of upgrading our internals to use unified@^11, @types/mdast@^4, and @types/unist@^3. We will need to make this change at some point, and given the nature of unifiedjs, this is a broad-reaching change.

It massages our existing code to stop complaining about the GenericParent <-> Node differences that arise in @types/mdast@^4, and pulls in the latest version of the various unist utilities. This is mostly done by additions of type asserts (as XXX) that will need to be removed in future.

Related to this work is jupyter-book/myst-spec#67, whereby the myst-spec types have been modified to use the extension mechanism supported by @types/mdast@>=4. After this PR in #1603 is merged, the integration of jupyter-book/myst-spec#67 should remove the need for GenericParent altogether.

To be clear, this PR is independent of jupyter-book/myst-spec#67

Note

We can't completely upgrade the stack: the unified-latex ecosystem is stuck on an older spec.
However, this is an internal tool, so we just need to ensure that it generates valid mdast@^4, and ignore any type errors. I think that it does from glancing at it.

Copy link

changeset-bot bot commented Oct 25, 2024

⚠️ No Changeset found

Latest commit: 42c0123

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@agoose77 agoose77 force-pushed the agoose77/chore-upgrade-unist-deps branch from c119acb to fbc1df8 Compare October 25, 2024 15:14
@rowanc1
Copy link
Member

rowanc1 commented Oct 25, 2024

🚀

@agoose77 agoose77 changed the title chore: bump unist- utilities 🧹 Upgrade unified/unist stack Oct 29, 2024
@agoose77 agoose77 force-pushed the agoose77/chore-upgrade-unist-deps branch from 88515c0 to 28ceda5 Compare November 5, 2024 16:59
@agoose77 agoose77 force-pushed the agoose77/chore-upgrade-unist-deps branch from 28ceda5 to 2dafdd2 Compare November 5, 2024 17:17
@agoose77 agoose77 marked this pull request as ready for review November 6, 2024 13:40
@@ -140,6 +140,7 @@ export async function transformMystXRefs(
} else {
const data = await fetchMystXRefData(session, node as CrossReference, vfile);
if (!data) return;
console.debug({ identifier: node.identifier });
Copy link
Member

Choose a reason for hiding this comment

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

remove!

@@ -163,6 +162,7 @@ describe('Testing mdast --> html conversions', () => {
test.each(htmlCases)('%s', (name, { html, mdast }) => {
const modified = replaceCommentNodes(mdast);
if (html) {
console.log({ name, skip: SKIP_TESTS.some((p) => p.test(name.trim())) });
Copy link
Member

Choose a reason for hiding this comment

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

Probably remove this?

@agoose77 agoose77 marked this pull request as draft November 11, 2024 16:21
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.

2 participants