Skip to content

Commit 02a049a

Browse files
committed
feat: update satteri
1 parent ae20903 commit 02a049a

6 files changed

Lines changed: 43 additions & 34 deletions

File tree

packages/astro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
"devDependencies": {
182182
"@astrojs/check": "workspace:*",
183183
"@astrojs/compiler-rs": "^0.1.6",
184-
"satteri": "0.2.5",
184+
"satteri": "^0.2.7",
185185
"@playwright/test": "1.58.2",
186186
"@types/aria-query": "^5.0.4",
187187
"@types/hast": "^3.0.4",

packages/integrations/mdx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"rehype-raw": "^7.0.0",
4646
"remark-gfm": "^4.0.1",
4747
"remark-smartypants": "^3.0.2",
48-
"satteri": "0.2.5",
48+
"satteri": "^0.2.7",
4949
"source-map": "^0.7.6",
5050
"unist-util-visit": "^5.1.0",
5151
"vfile": "^6.0.3"

packages/integrations/mdx/src/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export type MdxOptions = Omit<typeof markdownConfigDefaults, 'remarkPlugins' | '
2626
optimize: boolean | { ignoreElementNames?: string[] };
2727
mdastPlugins: MdastPluginDefinition[];
2828
hastPlugins: HastPluginDefinition[];
29+
features?: import('satteri').Features;
2930
};
3031

3132
type SetupHookParams = HookParameters<'astro:config:setup'> & {
@@ -101,7 +102,7 @@ export default function mdx(partialMdxOptions: Partial<MdxOptions> = {}): AstroI
101102

102103
const nativeMd = config.experimental.nativeMarkdown;
103104

104-
// When nativeMarkdown is enabled, merge mdastPlugins/hastPlugins from the experimental config
105+
// When nativeMarkdown is enabled, merge mdastPlugins/hastPlugins/features from the experimental config
105106
if (nativeMd && extendMarkdownConfig) {
106107
const nativeOpts = typeof nativeMd === 'object' ? nativeMd : undefined;
107108
resolvedMdxOptions.mdastPlugins = [
@@ -112,6 +113,12 @@ export default function mdx(partialMdxOptions: Partial<MdxOptions> = {}): AstroI
112113
...(nativeOpts?.hastPlugins ?? []),
113114
...resolvedMdxOptions.hastPlugins,
114115
];
116+
if (nativeOpts?.features || resolvedMdxOptions.features) {
117+
resolvedMdxOptions.features = {
118+
...nativeOpts?.features,
119+
...resolvedMdxOptions.features,
120+
};
121+
}
115122
}
116123

117124
// Mutate `mdxOptions` so that `vitePluginMdx` can reference the actual options
@@ -169,5 +176,6 @@ function applyDefaultOptions({
169176
optimize: options.optimize ?? defaults.optimize,
170177
mdastPlugins: options.mdastPlugins ?? defaults.mdastPlugins,
171178
hastPlugins: options.hastPlugins ?? defaults.hastPlugins,
179+
features: options.features ?? defaults.features,
172180
};
173181
}

packages/integrations/mdx/src/satteri-plugins.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ export function createMdxProcessor(mdxOptions: MdxOptions) {
625625
mdastPlugins: allMdastPlugins,
626626
hastPlugins,
627627
optimizeStatic,
628+
features: mdxOptions.features,
628629
filename: filePath,
629630
jsxImportSource: 'astro',
630631
});

packages/markdown/remark/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"vfile": "^6.0.3"
6161
},
6262
"peerDependencies": {
63-
"satteri": ">=0.2.5"
63+
"satteri": ">=0.2.7"
6464
},
6565
"peerDependenciesMeta": {
6666
"satteri": {
@@ -75,7 +75,7 @@
7575
"@types/mdast": "^4.0.4",
7676
"@types/unist": "^3.0.3",
7777
"astro-scripts": "workspace:*",
78-
"satteri": "0.2.5",
78+
"satteri": "^0.2.7",
7979
"esbuild": "^0.27.3",
8080
"mdast-util-mdx-expression": "^2.0.1"
8181
},

pnpm-lock.yaml

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)