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

[hast] Add content maps #55187

Merged
merged 1 commit into from
Aug 22, 2021
Merged

[hast] Add content maps #55187

merged 1 commit into from
Aug 22, 2021

Conversation

wooorm
Copy link
Contributor

@wooorm wooorm commented Aug 17, 2021

Similar to #54421, and #52375, this implements a map for the parents defined by hast. One specific example use case is to add raw nodes to the AST. Raw nodes are added by mdast-util-to-hast and either handled by hast-util-raw or serialized untouched by hast-util-to-html.

Note for the reviewers: xast uses ChildMaps. mdast uses a ContentMaps. Preference?

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

Similar to <#54421>,
and <#52375>,
this implements a map for the parents defined by hast.
One specific example use case is to add raw nodes to the AST.
Raw nodes are added by `mdast-util-to-hast` and either handled
by `hast-util-raw` or serialized untouched by `hast-util-to-html`.
@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 17, 2021

@wooorm Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by a DT maintainer

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 55187,
  "author": "wooorm",
  "headCommitOid": "b93cf3902def233e35cc704c070bfdefa473eb48",
  "lastPushDate": "2021-08-17T09:04:17.000Z",
  "lastActivityDate": "2021-08-22T06:18:00.000Z",
  "mergeOfferDate": "2021-08-21T21:25:49.000Z",
  "mergeRequestDate": "2021-08-22T06:18:00.000Z",
  "mergeRequestUser": "wooorm",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "hast",
      "kind": "edit",
      "files": [
        {
          "path": "types/hast/hast-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/hast/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "lukeggchapman",
        "rokt33r",
        "ChristianMurphy"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "rbuckton",
      "date": "2021-08-21T21:25:08.000Z",
      "isMaintainer": true
    },
    {
      "type": "approved",
      "reviewer": "ChristianMurphy",
      "date": "2021-08-17T14:07:55.000Z",
      "isMaintainer": false
    },
    {
      "type": "approved",
      "reviewer": "remcohaszing",
      "date": "2021-08-17T09:13:24.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 900125964,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Contributor

🔔 @lukeggchapman @Rokt33r @ChristianMurphy — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Aug 17, 2021
@wooorm
Copy link
Contributor Author

wooorm commented Aug 17, 2021

/cc @remcohaszing

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board Aug 17, 2021
@typescript-bot typescript-bot added the Other Approved This PR was reviewed and signed-off by a community member. label Aug 17, 2021
@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Aug 17, 2021
@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Aug 21, 2021
@typescript-bot
Copy link
Contributor

@wooorm: Everything looks good here. I am ready to merge this PR (at b93cf39) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@lukeggchapman, @Rokt33r, @ChristianMurphy: you can do this too.)

@typescript-bot typescript-bot moved this from Needs Maintainer Review to Waiting for Author to Merge in New Pull Request Status Board Aug 21, 2021
@wooorm
Copy link
Contributor Author

wooorm commented Aug 22, 2021

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Aug 22, 2021
@typescript-bot typescript-bot merged commit 044803f into DefinitelyTyped:master Aug 22, 2021
@wooorm wooorm deleted the hast-content-maps branch August 22, 2021 06:21
@typescript-bot
Copy link
Contributor

I just published @types/hast@2.3.4 to npm.

@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Aug 22, 2021
wooorm added a commit to syntax-tree/hast-util-raw that referenced this pull request Aug 22, 2021
When using this utility, the raw type will automatically be added to
hast in the correct places.

See DefinitelyTyped/DefinitelyTyped#55187 for more information.

This also improves the types by allowing an overload of omitted vfile.
wooorm added a commit to rehypejs/rehype-raw that referenced this pull request Aug 26, 2021
When using this plugin, the raw type will automatically be added to
hast in the correct places.

See DefinitelyTyped/DefinitelyTyped#55187 for more information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical package Maintainer Approved Other Approved This PR was reviewed and signed-off by a community member. Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants