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

Refactor @astrojs/prism, fix Prism component import not working #4114

Merged
merged 8 commits into from
Aug 2, 2022

Conversation

Princesseuh
Copy link
Member

Changes

  • Refactor @astrojs/prism, rewriting in TS, adding a README, moved runHighlight to it
  • Remove duplicate function definitions in the component, markdown-remark and @astrojs/mdx
  • Fixed component import not working for Prism

This makes the dependency of @astrojs/prism much clearer, previously a lot of packages independently depended on either prismjs or @astrojs/prism. Now all the packages who needs it depend on @astrojs/prism (who itself, obviously depends on prismjs)

Testing

Tests still pass

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Aug 1, 2022

🦋 Changeset detected

Latest commit: ac6d609

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

This PR includes changesets to release 15 packages
Name Type
astro Patch
@astrojs/prism Minor
@astrojs/mdx Minor
@astrojs/markdown-remark Minor
@e2e/astro-component Patch
@e2e/error-react-spectrum Patch
@e2e/error-sass Patch
@e2e/errors Patch
@e2e/lit-component Patch
@e2e/preact-component Patch
@e2e/react-component Patch
@e2e/solid-component Patch
@e2e/svelte-component Patch
@e2e/e2e-tailwindcss Patch
@e2e/ts-resolution Patch

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

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope) feat: markdown Related to Markdown (scope) labels Aug 1, 2022
@matthewp
Copy link
Contributor

matthewp commented Aug 1, 2022

Missing a changeset.

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Clean refactor! Had a few comments but LGTM overall.

.changeset/slow-spiders-fly.md Outdated Show resolved Hide resolved
import Prism from 'prismjs';
import { addAstro } from './internal.mjs';
import loadLanguages from 'prismjs/components/index.js';
import { runHighlighterWithAstro } from './dist/highlighter';
Copy link
Member

Choose a reason for hiding this comment

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

While we're at it, is there a place that makes more sense than packages/astro-prism? I think that's leftover from when the package was literally named astro-prism. Maybe just packages/prism?

@Princesseuh Princesseuh merged commit 64432bc into main Aug 2, 2022
@Princesseuh Princesseuh deleted the fix-prism-package branch August 2, 2022 19:53
@astrobot-houston astrobot-houston mentioned this pull request Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: markdown Related to Markdown (scope) pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants