Skip to content

Commit ccfbf94

Browse files
Refactor markdown-remark integration to update import paths and optimize config
1 parent 7125e52 commit ccfbf94

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

packages/markdown-remark/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"types": "./dist/processor/index.d.ts",
2222
"default": "./dist/processor/index.js"
2323
},
24-
"./assets/*": "./assets/*"
24+
"./styles/*": "./dist/integration/styles/*"
2525
},
2626
"imports": {
2727
"#import-plugin": {
@@ -30,14 +30,13 @@
3030
}
3131
},
3232
"files": [
33-
"dist",
34-
"assets"
33+
"dist"
3534
],
3635
"scripts": {
3736
"prepublish": "pnpm build",
38-
"build": "run-scripts build \"src/**/*.ts\" && tsc -p tsconfig.json",
39-
"build:ci": "run-scripts build \"src/**/*.ts\"",
40-
"dev": "run-scripts dev \"src/**/*.ts\"",
37+
"build": "run-scripts build \"src/**/*.{ts,css}\" && tsc -p tsconfig.json",
38+
"build:ci": "run-scripts build \"src/**/*.{ts,css}\"",
39+
"dev": "run-scripts dev \"src/**/*.{ts,css}\"",
4140
"test": "pnpm build && vitest run"
4241
},
4342
"peerDependencies": {

packages/markdown-remark/src/integration/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function markdownRemark(opts?: StudioCMSMarkdownRemarkOptions): AstroInte
2424

2525
// Resolve the callout theme based on the user's configuration
2626
const resolvedCalloutTheme = resolve(
27-
`../../assets/callout-themes/${markdownExtended.callouts.theme}.css`
27+
`./styles/callout-themes/${markdownExtended.callouts.theme}.css`
2828
);
2929

3030
return {
@@ -42,7 +42,7 @@ export function markdownRemark(opts?: StudioCMSMarkdownRemarkOptions): AstroInte
4242
'studiocms:markdown-remark': `export * from '${resolve('./markdown.js')}';`,
4343
// Styles for the Markdown Remark processor
4444
'studiocms:markdown-remark/css': `
45-
import '${resolve('../../assets/headings.css')}';
45+
import '${resolve('./styles/headings.css')}';
4646
${markdownExtended.callouts.enabled ? `import '${resolvedCalloutTheme}';` : ''}
4747
`,
4848
// User defined components for the Markdown processor

packages/markdown-remark/assets/callout-themes/github.css renamed to packages/markdown-remark/src/integration/styles/callout-themes/github.css

File renamed without changes.

packages/markdown-remark/assets/callout-themes/obsidian.css renamed to packages/markdown-remark/src/integration/styles/callout-themes/obsidian.css

File renamed without changes.

packages/markdown-remark/assets/callout-themes/vitepress.css renamed to packages/markdown-remark/src/integration/styles/callout-themes/vitepress.css

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)