@astrojs/mdx 0.15.0-beta.1 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- @astrojs/mdx:build: cache hit, replaying output 60f6ddcdbc2ddb72
1
+ @astrojs/mdx:build: cache hit, replaying output e3662492a73790a4
2
2
  @astrojs/mdx:build: 
3
- @astrojs/mdx:build: > @astrojs/mdx@0.15.0-beta.1 build /home/runner/work/astro/astro/packages/integrations/mdx
3
+ @astrojs/mdx:build: > @astrojs/mdx@1.0.0-beta.2 build /home/runner/work/astro/astro/packages/integrations/mdx
4
4
  @astrojs/mdx:build: > astro-scripts build "src/**/*.ts" && tsc
5
5
  @astrojs/mdx:build: 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @astrojs/mdx
2
2
 
3
+ ## 1.0.0-beta.2
4
+
5
+ ### Major Changes
6
+
7
+ - [#5825](https://github.com/withastro/astro/pull/5825) [`52209ca2a`](https://github.com/withastro/astro/commit/52209ca2ad72a30854947dcb3a90ab4db0ac0a6f) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Baseline the experimental `contentCollections` flag. You're free to remove this from your astro config!
8
+
9
+ ```diff
10
+ import { defineConfig } from 'astro/config';
11
+
12
+ export default defineConfig({
13
+ - experimental: { contentCollections: true }
14
+ })
15
+ ```
16
+
17
+ ### Minor Changes
18
+
19
+ - [#5782](https://github.com/withastro/astro/pull/5782) [`1f92d64ea`](https://github.com/withastro/astro/commit/1f92d64ea35c03fec43aff64eaf704dc5a9eb30a) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Remove support for Node 14. Minimum supported Node version is now >=16.12.0
20
+
21
+ ### Patch Changes
22
+
23
+ - [#5837](https://github.com/withastro/astro/pull/5837) [`12f65a4d5`](https://github.com/withastro/astro/commit/12f65a4d55e3fd2993c2f67b18794dd536280c69) Thanks [@giuseppelt](https://github.com/giuseppelt)! - fix shiki css class replace logic
24
+
25
+ - Updated dependencies [[`1f92d64ea`](https://github.com/withastro/astro/commit/1f92d64ea35c03fec43aff64eaf704dc5a9eb30a), [`12f65a4d5`](https://github.com/withastro/astro/commit/12f65a4d55e3fd2993c2f67b18794dd536280c69), [`16107b6a1`](https://github.com/withastro/astro/commit/16107b6a10514ef1b563e585ec9add4b14f42b94), [`52209ca2a`](https://github.com/withastro/astro/commit/52209ca2ad72a30854947dcb3a90ab4db0ac0a6f), [`7572f7402`](https://github.com/withastro/astro/commit/7572f7402238da37de748be58d678fedaf863b53)]:
26
+ - @astrojs/prism@2.0.0-beta.0
27
+ - @astrojs/markdown-remark@2.0.0-beta.2
28
+
3
29
  ## 0.15.0-beta.1
4
30
 
5
31
  ### Minor Changes
package/dist/plugins.js CHANGED
@@ -127,9 +127,7 @@ async function getRemarkPlugins(mdxOptions, config) {
127
127
  remarkPlugins.push(remarkSmartypants);
128
128
  }
129
129
  remarkPlugins = [...remarkPlugins, ...ignoreStringPlugins(mdxOptions.remarkPlugins)];
130
- if (config.experimental.contentCollections) {
131
- remarkPlugins.push(toRemarkContentRelImageError(config));
132
- }
130
+ remarkPlugins.push(toRemarkContentRelImageError(config));
133
131
  return remarkPlugins;
134
132
  }
135
133
  function getRehypePlugins(mdxOptions) {
@@ -42,7 +42,7 @@ const remarkShiki = async ({ langs = [], theme = "github-dark", wrap = false })
42
42
  lang = "plaintext";
43
43
  }
44
44
  let html = highlighter.codeToHtml(node.value, { lang });
45
- html = html.replace('<pre class="shiki"', `<pre class="astro-code"`);
45
+ html = html.replace(/<pre class="(.*?)shiki(.*?)"/, `<pre class="$1astro-code$2"`);
46
46
  if (node.lang === "diff") {
47
47
  html = html.replace(
48
48
  /<span class="line"><span style="(.*?)">([\+|\-])/g,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/mdx",
3
3
  "description": "Use MDX within Astro",
4
- "version": "0.15.0-beta.1",
4
+ "version": "1.0.0-beta.2",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -23,8 +23,8 @@
23
23
  "./package.json": "./package.json"
24
24
  },
25
25
  "dependencies": {
26
- "@astrojs/markdown-remark": "^2.0.0-beta.1",
27
- "@astrojs/prism": "^1.0.2",
26
+ "@astrojs/markdown-remark": "^2.0.0-beta.2",
27
+ "@astrojs/prism": "^2.0.0-beta.0",
28
28
  "@mdx-js/mdx": "^2.1.2",
29
29
  "@mdx-js/rollup": "^2.1.1",
30
30
  "acorn": "^8.8.0",
@@ -48,8 +48,8 @@
48
48
  "@types/mdast": "^3.0.10",
49
49
  "@types/mocha": "^9.1.1",
50
50
  "@types/yargs-parser": "^21.0.0",
51
- "astro": "2.0.0-beta.1",
52
- "astro-scripts": "0.0.9",
51
+ "astro": "2.0.0-beta.2",
52
+ "astro-scripts": "0.0.10-beta.0",
53
53
  "chai": "^4.3.6",
54
54
  "cheerio": "^1.0.0-rc.11",
55
55
  "linkedom": "^0.14.12",
@@ -64,7 +64,7 @@
64
64
  "vite": "^4.0.3"
65
65
  },
66
66
  "engines": {
67
- "node": "^14.18.0 || >=16.12.0"
67
+ "node": ">=16.12.0"
68
68
  },
69
69
  "scripts": {
70
70
  "build": "astro-scripts build \"src/**/*.ts\" && tsc",
package/src/plugins.ts CHANGED
@@ -161,9 +161,8 @@ export async function getRemarkPlugins(
161
161
  remarkPlugins = [...remarkPlugins, ...ignoreStringPlugins(mdxOptions.remarkPlugins)];
162
162
 
163
163
  // Apply last in case user plugins resolve relative image paths
164
- if (config.experimental.contentCollections) {
165
- remarkPlugins.push(toRemarkContentRelImageError(config));
166
- }
164
+ remarkPlugins.push(toRemarkContentRelImageError(config));
165
+
167
166
  return remarkPlugins;
168
167
  }
169
168
 
@@ -66,7 +66,7 @@ const remarkShiki = async ({ langs = [], theme = 'github-dark', wrap = false }:
66
66
  // &lt;span class=&quot;line&quot;
67
67
 
68
68
  // Replace "shiki" class naming with "astro".
69
- html = html.replace('<pre class="shiki"', `<pre class="astro-code"`);
69
+ html = html.replace(/<pre class="(.*?)shiki(.*?)"/, `<pre class="$1astro-code$2"`);
70
70
  // Add "user-select: none;" for "+"/"-" diff symbols
71
71
  if (node.lang === 'diff') {
72
72
  html = html.replace(