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: move prism to @astrojs/prism/components #2878

Merged
merged 6 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Prism from 'prismjs';
import { addAstro } from '@astrojs/prism';
import { addAstro } from '../';
bholmesdev marked this conversation as resolved.
Show resolved Hide resolved
import loadLanguages from 'prismjs/components/index.js';

export interface Props {
Expand Down
1 change: 1 addition & 0 deletions packages/astro-prism/components/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Prism } from './Prism.astro';
7 changes: 6 additions & 1 deletion packages/astro-prism/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@
"homepage": "https://astro.build",
"main": "index.mjs",
"scripts": {},
"files": [
"components"
],
"exports": {
".": "./index.mjs"
".": "./index.mjs",
"./components": "./components/index.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, but just @astrojs/prism/component with no (s)? There's not going to be multiple of these are there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess not! I really wanted to export from index.mjs but I can't figure out putting .astro files and ESM exports in the same file... Let me know if this is possible (without building the .astro file to JS of course)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update: changed to a default export:

import Prism from '@astrojs/prism/component';

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah i was thinking that from the main would be nice but can't really do that, too bad. This works fine though, thanks!

"./components/*": "./components/*"
},
"types": "./index.d.ts",
"keywords": [],
Expand Down
1 change: 0 additions & 1 deletion packages/astro/components/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export { default as Code } from './Code.astro';
export { default as Debug } from './Debug.astro';
export { default as Markdown } from './Markdown.astro';
export { default as Prism } from './Prism.astro';