Skip to content

feat: mdx-v2-migrate package#8

Open
brkalow wants to merge 11 commits intomainfrom
brk.feat/mdx-v2-migrate
Open

feat: mdx-v2-migrate package#8
brkalow wants to merge 11 commits intomainfrom
brk.feat/mdx-v2-migrate

Conversation

@brkalow
Copy link
Copy Markdown
Contributor

@brkalow brkalow commented Nov 18, 2021

🎟️ Asana Task


Description

Adding a new package containing the custom configured remark compiler which migrates our MDX v1 source to be MDX v2 compat.

PR Checklist 🚀

  • Conduct thorough self-review.
  • Add or update tests as appropriate.
  • Write a useful description (above) to give reviewers appropriate context.
  • Identify (in the description above) and document (add Asana tasks on this board) any technical debt that you're aware of, but are not addressing as part of this PR.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 18, 2021

🦋 Changeset detected

Latest commit: d378b49

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hashicorp/mdx-v2-migrate Minor

Not sure what this means? Click here to learn what changesets are.

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

@brkalow brkalow requested a review from a team November 18, 2021 18:43
@brkalow brkalow marked this pull request as ready for review November 18, 2021 19:27
Comment thread packages/mdx-v2-migrate/src/migrate.js Outdated
}

// allow usage of <= sign
safe = safe.replace('<=', '\\<=')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

unescaping some of these seems quite dangerous. If it works it works, but especially _, *, and [ will interfere at some point

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Potentially, yeah. It seems safe as they are in text nodes at this point, so we know they aren't part of a pair elsewhere in the tree, but I agree it might not hold up for everything. Testing out the script on our docs sites now, we'll see if we run into any issues 🤞


console.log(entry.fullPath)

const fileContents = await fs.promises.readFile(entry.fullPath, 'utf-8')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I’d recommend remark-frontmatter / mdast-util-frontmatter.
Also: use remark-gfm if you use GFM features!
Having those nodes in the tree for proper warning locations and proper serialization might help!

@brkalow brkalow added the release:canary Publish a canary release label Nov 22, 2021
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 23, 2021

📦 Canary Packages Published

Latest commit: d378b49

Published 1 packages

@hashicorp/mdx-v2-migrate@0.1.0-canary-20211030174638

npm install @hashicorp/mdx-v2-migrate@canary

Copy link
Copy Markdown
Contributor

@jescalan jescalan 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, thanks so much for reviewing @wooorm!

@hashicorp-cla
Copy link
Copy Markdown

hashicorp-cla commented Mar 12, 2022

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


Bryce Kalow seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:canary Publish a canary release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants