@astrojs/markdoc 0.4.0 → 0.4.1

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/README.md CHANGED
@@ -42,9 +42,8 @@ npm install @astrojs/markdoc
42
42
 
43
43
  Then, apply this integration to your `astro.config.*` file using the `integrations` property:
44
44
 
45
- **`astro.config.mjs`**
46
-
47
- ```js ins={2} "markdoc()"
45
+ ```js ins={3} "markdoc()"
46
+ // astro.config.mjs
48
47
  import { defineConfig } from 'astro/config';
49
48
  import markdoc from '@astrojs/markdoc';
50
49
 
@@ -89,7 +89,10 @@ export const ComponentNode = createComponent({
89
89
  );
90
90
 
91
91
  // Let the runtime know that this component is being used.
92
- result.propagators.set(
92
+ // `result.propagators` has been moved to `result._metadata.propagators`
93
+ // TODO: remove this fallback in the next markdoc integration major
94
+ const propagators = result._metadata.propagators || result.propagators;
95
+ propagators.set(
93
96
  {},
94
97
  {
95
98
  init() {
package/dist/index.js CHANGED
@@ -1,6 +1,4 @@
1
1
  import { bold, red } from "kleur/colors";
2
- import { fileURLToPath } from "node:url";
3
- import { normalizePath } from "vite";
4
2
  import { getContentEntryType } from "./content-entry-type.js";
5
3
  import {
6
4
  loadMarkdocConfig,
@@ -16,7 +14,6 @@ function markdocIntegration(legacyConfig) {
16
14
  process.exit(0);
17
15
  }
18
16
  let markdocConfigResult;
19
- let markdocConfigResultId = "";
20
17
  let astroConfig;
21
18
  return {
22
19
  name: "@astrojs/markdoc",
@@ -25,9 +22,6 @@ function markdocIntegration(legacyConfig) {
25
22
  const { updateConfig, addContentEntryType } = params;
26
23
  astroConfig = params.config;
27
24
  markdocConfigResult = await loadMarkdocConfig(astroConfig);
28
- if (markdocConfigResult) {
29
- markdocConfigResultId = normalizePath(fileURLToPath(markdocConfigResult.fileUrl));
30
- }
31
25
  addContentEntryType(await getContentEntryType({ markdocConfigResult, astroConfig }));
32
26
  updateConfig({
33
27
  vite: {
@@ -19,7 +19,7 @@ async function loadMarkdocConfig(astroConfig) {
19
19
  }
20
20
  if (!markdocConfigUrl)
21
21
  return;
22
- const { code, dependencies } = await bundleConfigFile({
22
+ const { code } = await bundleConfigFile({
23
23
  markdocConfigUrl,
24
24
  astroConfig
25
25
  });
package/dist/utils.js CHANGED
@@ -2,7 +2,7 @@ class MarkdocError extends Error {
2
2
  constructor(props, ...params) {
3
3
  super(...params);
4
4
  this.type = "MarkdocError";
5
- const { name, title = "MarkdocError", message, stack, location, hint, frame } = props;
5
+ const { title = "MarkdocError", message, stack, location, hint, frame } = props;
6
6
  this.title = title;
7
7
  if (message)
8
8
  this.message = message;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/markdoc",
3
3
  "description": "Add support for Markdoc in your Astro site",
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -67,7 +67,7 @@
67
67
  "zod": "^3.17.3"
68
68
  },
69
69
  "peerDependencies": {
70
- "astro": "^2.7.2"
70
+ "astro": "^2.8.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@astrojs/markdown-remark": "^2.2.1",
@@ -80,7 +80,7 @@
80
80
  "mocha": "^9.2.2",
81
81
  "rollup": "^3.25.1",
82
82
  "vite": "^4.3.9",
83
- "astro": "2.7.2",
83
+ "astro": "2.8.0",
84
84
  "astro-scripts": "0.0.14"
85
85
  },
86
86
  "engines": {