From 2db97f10dc50f9498413181b78c477fe8833895b Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Thu, 24 Mar 2022 17:48:07 -0400 Subject: [PATCH] Refactor: move prism to `@astrojs/prism/components` (#2878) * feat: add `` to @astrojs/prism/components * feat: remove `` from astro/components * refactor: point to index.mjs in import * refactor: change exp to @astrojs/prism/component * refactor: remove unecessary index.js * chore: changeset --- .changeset/perfect-ravens-count.md | 6 ++++++ .../{astro/components => astro-prism/component}/Prism.astro | 2 +- packages/astro-prism/package.json | 6 +++++- packages/astro/components/index.js | 1 - 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changeset/perfect-ravens-count.md rename packages/{astro/components => astro-prism/component}/Prism.astro (96%) diff --git a/.changeset/perfect-ravens-count.md b/.changeset/perfect-ravens-count.md new file mode 100644 index 000000000..dfadbd49a --- /dev/null +++ b/.changeset/perfect-ravens-count.md @@ -0,0 +1,6 @@ +--- +'astro': patch +'@astrojs/prism': patch +--- + +Move the built-in `Prism` component from `astro/components` to `@astrojs/prism/component`. diff --git a/packages/astro/components/Prism.astro b/packages/astro-prism/component/Prism.astro similarity index 96% rename from packages/astro/components/Prism.astro rename to packages/astro-prism/component/Prism.astro index 5f92b1f66..66794e2d5 100644 --- a/packages/astro/components/Prism.astro +++ b/packages/astro-prism/component/Prism.astro @@ -1,6 +1,6 @@ --- import Prism from 'prismjs'; -import { addAstro } from '@astrojs/prism'; +import { addAstro } from '../index.mjs'; import loadLanguages from 'prismjs/components/index.js'; export interface Props { diff --git a/packages/astro-prism/package.json b/packages/astro-prism/package.json index ff58a88ba..3a37d82ec 100644 --- a/packages/astro-prism/package.json +++ b/packages/astro-prism/package.json @@ -13,8 +13,12 @@ "homepage": "https://astro.build", "main": "index.mjs", "scripts": {}, + "files": [ + "component" + ], "exports": { - ".": "./index.mjs" + ".": "./index.mjs", + "./component": "./component/Prism.astro" }, "types": "./index.d.ts", "keywords": [], diff --git a/packages/astro/components/index.js b/packages/astro/components/index.js index 8b19c7d1f..b16d8983a 100644 --- a/packages/astro/components/index.js +++ b/packages/astro/components/index.js @@ -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';