From 046bf7281f720b20b703529bc5d157891e07624c Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Fri, 25 Mar 2022 17:13:28 -0400 Subject: [PATCH] refactor: move Prism comp to default exp (#2887) --- packages/astro-prism/{component => }/Prism.astro | 2 +- packages/astro-prism/index.js | 1 + packages/astro-prism/{index.d.ts => internal.d.ts} | 0 packages/astro-prism/{index.mjs => internal.mjs} | 0 packages/astro-prism/package.json | 11 ++++------- packages/markdown/remark/src/remark-prism.ts | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) rename packages/astro-prism/{component => }/Prism.astro (96%) create mode 100644 packages/astro-prism/index.js rename packages/astro-prism/{index.d.ts => internal.d.ts} (100%) rename packages/astro-prism/{index.mjs => internal.mjs} (100%) diff --git a/packages/astro-prism/component/Prism.astro b/packages/astro-prism/Prism.astro similarity index 96% rename from packages/astro-prism/component/Prism.astro rename to packages/astro-prism/Prism.astro index 66794e2d5..2af5f64ab 100644 --- a/packages/astro-prism/component/Prism.astro +++ b/packages/astro-prism/Prism.astro @@ -1,6 +1,6 @@ --- import Prism from 'prismjs'; -import { addAstro } from '../index.mjs'; +import { addAstro } from './internal.mjs'; import loadLanguages from 'prismjs/components/index.js'; export interface Props { diff --git a/packages/astro-prism/index.js b/packages/astro-prism/index.js new file mode 100644 index 000000000..41974a9d7 --- /dev/null +++ b/packages/astro-prism/index.js @@ -0,0 +1 @@ +export { default as Prism } from './Prism.astro'; \ No newline at end of file diff --git a/packages/astro-prism/index.d.ts b/packages/astro-prism/internal.d.ts similarity index 100% rename from packages/astro-prism/index.d.ts rename to packages/astro-prism/internal.d.ts diff --git a/packages/astro-prism/index.mjs b/packages/astro-prism/internal.mjs similarity index 100% rename from packages/astro-prism/index.mjs rename to packages/astro-prism/internal.mjs diff --git a/packages/astro-prism/package.json b/packages/astro-prism/package.json index edf02b4fa..8a4278250 100644 --- a/packages/astro-prism/package.json +++ b/packages/astro-prism/package.json @@ -11,16 +11,13 @@ "directory": "packages/astro-prism" }, "homepage": "https://astro.build", - "main": "index.mjs", + "main": "index.js", "scripts": {}, - "files": [ - "component" - ], "exports": { - ".": "./index.mjs", - "./component": "./component/Prism.astro" + ".": "./index.js", + "./internal": "./internal.mjs" }, - "types": "./index.d.ts", + "types": "./internal.d.ts", "keywords": [], "devDependencies": { "prismjs": "^1.27.0" diff --git a/packages/markdown/remark/src/remark-prism.ts b/packages/markdown/remark/src/remark-prism.ts index 549e09783..6d3e4e664 100644 --- a/packages/markdown/remark/src/remark-prism.ts +++ b/packages/markdown/remark/src/remark-prism.ts @@ -1,6 +1,6 @@ import { visit } from 'unist-util-visit'; import Prism from 'prismjs'; -import { addAstro } from '@astrojs/prism'; +import { addAstro } from '@astrojs/prism/internal'; import loadLanguages from 'prismjs/components/index.js'; const noVisit = new Set(['root', 'html', 'text']);