astro-d2 0.9.0 → 0.10.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/CHANGELOG.md +10 -0
- package/config.ts +3 -4
- package/index.ts +5 -1
- package/libs/attributes.ts +1 -1
- package/package.json +7 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# astro-d2
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#51](https://github.com/HiDeoo/astro-d2/pull/51) [`b64ed5e`](https://github.com/HiDeoo/astro-d2/commit/b64ed5e1331598e6fb00df8972bb2bacf3e742fa) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds support for Astro v6, drops support for Astro v5.
|
|
8
|
+
|
|
9
|
+
⚠️ **BREAKING CHANGE:** The minimum supported version of Astro is now `6.0.0`.
|
|
10
|
+
|
|
11
|
+
Please follow the [upgrade guide](https://docs.astro.build/en/guides/upgrade-to/v6/) to update your project.
|
|
12
|
+
|
|
3
13
|
## 0.9.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/config.ts
CHANGED
|
@@ -27,7 +27,7 @@ export const AstroD2ConfigSchema = z
|
|
|
27
27
|
*/
|
|
28
28
|
useD2js: z.boolean().default(false),
|
|
29
29
|
})
|
|
30
|
-
.
|
|
30
|
+
.prefault({}),
|
|
31
31
|
/**
|
|
32
32
|
* Defines the fonts to use for the generated diagrams.
|
|
33
33
|
*
|
|
@@ -117,13 +117,12 @@ export const AstroD2ConfigSchema = z
|
|
|
117
117
|
*/
|
|
118
118
|
default: z.string().default('0'),
|
|
119
119
|
})
|
|
120
|
-
.
|
|
120
|
+
.prefault({}),
|
|
121
121
|
})
|
|
122
122
|
.refine((config) => config.layout !== 'tala' || !config.experimental.useD2js, {
|
|
123
|
-
// TODO(HiDeoo) test
|
|
124
123
|
message: 'The `tala` layout engine is not supported when using the `experimental.useD2js` option.',
|
|
125
124
|
})
|
|
126
|
-
.
|
|
125
|
+
.prefault({})
|
|
127
126
|
|
|
128
127
|
export type AstroD2UserConfig = z.input<typeof AstroD2ConfigSchema>
|
|
129
128
|
export type AstroD2Config = z.output<typeof AstroD2ConfigSchema>
|
package/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import fs from 'node:fs/promises'
|
|
|
2
2
|
import path from 'node:path'
|
|
3
3
|
|
|
4
4
|
import type { AstroIntegration } from 'astro'
|
|
5
|
+
import { z } from 'astro/zod'
|
|
5
6
|
|
|
6
7
|
import { AstroD2ConfigSchema, type AstroD2UserConfig } from './config'
|
|
7
8
|
import { clearContentLayerCache } from './libs/astro'
|
|
@@ -16,7 +17,10 @@ export default function astroD2Integration(userConfig?: AstroD2UserConfig): Astr
|
|
|
16
17
|
|
|
17
18
|
if (!parsedConfig.success) {
|
|
18
19
|
throwErrorWithHint(
|
|
19
|
-
`
|
|
20
|
+
`Invalid astro-d2 configuration:
|
|
21
|
+
|
|
22
|
+
${z.prettifyError(parsedConfig.error)}
|
|
23
|
+
`,
|
|
20
24
|
)
|
|
21
25
|
}
|
|
22
26
|
|
package/libs/attributes.ts
CHANGED
|
@@ -74,7 +74,7 @@ export const AttributesSchema = z
|
|
|
74
74
|
*/
|
|
75
75
|
width: z.coerce.number().optional(),
|
|
76
76
|
})
|
|
77
|
-
.
|
|
77
|
+
.prefault({})
|
|
78
78
|
|
|
79
79
|
const attributeRegex =
|
|
80
80
|
/(?<key>[^\s"'=]+)=(?:(?<noQuoteValue>\w+)|'(?<singleQuoteValue>[^']+)'|"(?<doubleQuoteValue>[^"]+))|(?<truthyKey>\w+)/g
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-d2",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Astro integration and remark plugin to transform D2 Markdown code blocks into diagrams.",
|
|
6
6
|
"author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",
|
|
@@ -12,24 +12,23 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@terrastruct/d2": "^0.1.33",
|
|
14
14
|
"hast-util-from-html": "^2.0.3",
|
|
15
|
-
"hast-util-to-html": "^9.0.
|
|
16
|
-
"unist-util-visit": "^5.
|
|
15
|
+
"hast-util-to-html": "^9.0.5",
|
|
16
|
+
"unist-util-visit": "^5.1.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/hast": "^3.0.4",
|
|
20
20
|
"@types/mdast": "^4.0.4",
|
|
21
|
-
"@types/node": "^
|
|
21
|
+
"@types/node": "^22.19.15",
|
|
22
22
|
"remark": "^15.0.1",
|
|
23
23
|
"vfile": "^6.0.3",
|
|
24
|
-
"vitest": "
|
|
24
|
+
"vitest": "4.1.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"astro": ">=
|
|
27
|
+
"astro": ">=6.0.0"
|
|
28
28
|
},
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": ">=
|
|
30
|
+
"node": ">=22.12.0"
|
|
31
31
|
},
|
|
32
|
-
"packageManager": "pnpm@8.15.1",
|
|
33
32
|
"publishConfig": {
|
|
34
33
|
"access": "public"
|
|
35
34
|
},
|