@astrojs/mdx 0.10.1 → 0.10.2-next.0
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.
package/.turbo/turbo-build.log
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
[35m@astrojs/mdx:build: [0mcache hit, replaying output [2m9bf2042a57eb9fcc[0m
|
|
2
|
+
[35m@astrojs/mdx:build: [0m
|
|
3
|
+
[35m@astrojs/mdx:build: [0m> @astrojs/mdx@0.10.2-next.0 build /home/runner/work/astro/astro/packages/integrations/mdx
|
|
4
|
+
[35m@astrojs/mdx:build: [0m> astro-scripts build "src/**/*.ts" && tsc
|
|
5
|
+
[35m@astrojs/mdx:build: [0m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @astrojs/mdx
|
|
2
2
|
|
|
3
|
+
## 0.10.2-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4423](https://github.com/withastro/astro/pull/4423) [`d4cd7a59f`](https://github.com/withastro/astro/commit/d4cd7a59fd38d411c442a818cfaab40f74106628) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Update Markdown type signature to match new markdown plugin,and update top-level layout props for better alignment
|
|
8
|
+
|
|
3
9
|
## 0.10.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/astro-data-utils.js
CHANGED
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.10.
|
|
4
|
+
"version": "0.10.2-next.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@types/chai": "^4.3.1",
|
|
43
43
|
"@types/mocha": "^9.1.1",
|
|
44
44
|
"@types/yargs-parser": "^21.0.0",
|
|
45
|
-
"astro": "1.0.
|
|
45
|
+
"astro": "1.1.0-next.0",
|
|
46
46
|
"astro-scripts": "0.0.7",
|
|
47
47
|
"chai": "^4.3.6",
|
|
48
48
|
"linkedom": "^0.14.12",
|
package/src/astro-data-utils.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
const {
|
|
3
3
|
content = { title: "content didn't work" },
|
|
4
|
+
file = "file didn't work",
|
|
5
|
+
url = "url didn't work",
|
|
4
6
|
frontmatter = {
|
|
5
7
|
title: "frontmatter didn't work",
|
|
6
8
|
file: "file didn't work",
|
|
@@ -24,6 +26,8 @@ const {
|
|
|
24
26
|
<p data-frontmatter-title>{frontmatter.title}</p>
|
|
25
27
|
<p data-frontmatter-file>{frontmatter.file}</p>
|
|
26
28
|
<p data-frontmatter-url>{frontmatter.url}</p>
|
|
29
|
+
<p data-file>{frontmatter.file}</p>
|
|
30
|
+
<p data-url>{frontmatter.url}</p>
|
|
27
31
|
<p data-layout-rendered>Layout rendered!</p>
|
|
28
32
|
<ul data-headings>
|
|
29
33
|
{headings.map(heading => <li>{heading.slug}</li>)}
|
|
@@ -57,17 +57,21 @@ describe('MDX frontmatter', () => {
|
|
|
57
57
|
expect(headingSlugs).to.contain('section-2');
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
it('passes "file" and "url" to layout
|
|
60
|
+
it('passes "file" and "url" to layout', async () => {
|
|
61
61
|
const html = await fixture.readFile('/with-headings/index.html');
|
|
62
62
|
const { document } = parseHTML(html);
|
|
63
63
|
|
|
64
64
|
const frontmatterFile = document.querySelector('[data-frontmatter-file]')?.textContent;
|
|
65
65
|
const frontmatterUrl = document.querySelector('[data-frontmatter-url]')?.textContent;
|
|
66
|
+
const file = document.querySelector('[data-file]')?.textContent;
|
|
67
|
+
const url = document.querySelector('[data-url]')?.textContent;
|
|
66
68
|
|
|
67
69
|
expect(frontmatterFile?.endsWith('with-headings.mdx')).to.equal(
|
|
68
70
|
true,
|
|
69
71
|
'"file" prop does not end with correct path or is undefined'
|
|
70
72
|
);
|
|
71
73
|
expect(frontmatterUrl).to.equal('/with-headings');
|
|
74
|
+
expect(file).to.equal(frontmatterFile);
|
|
75
|
+
expect(url).to.equal(frontmatterUrl);
|
|
72
76
|
});
|
|
73
77
|
});
|