@nuasite/nua 0.44.2 → 0.45.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuasite/nua",
3
- "version": "0.44.2",
3
+ "version": "0.45.0",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "module": "src/index.ts",
@@ -38,12 +38,12 @@
38
38
  "@astrojs/check": "0.9.8",
39
39
  "@astrojs/mdx": "5.0.3",
40
40
  "@astrojs/sitemap": "3.7.2",
41
- "@nuasite/checks": "0.44.2",
42
- "@nuasite/llm-enhancements": "0.44.2",
43
- "@nuasite/cli": "0.44.2",
44
- "@nuasite/cms": "0.44.2",
45
- "@nuasite/components": "0.44.2",
46
- "@nuasite/core": "0.44.2",
41
+ "@nuasite/checks": "0.45.0",
42
+ "@nuasite/llm-enhancements": "0.45.0",
43
+ "@nuasite/cli": "0.45.0",
44
+ "@nuasite/cms": "0.45.0",
45
+ "@nuasite/components": "0.45.0",
46
+ "@nuasite/core": "0.45.0",
47
47
  "@tailwindcss/vite": "^4.2.2",
48
48
  "@tailwindcss/typography": "^0.5.19",
49
49
  "astro": "6.1.4",
@@ -1,7 +1,7 @@
1
1
  import mdx from '@astrojs/mdx'
2
2
  import sitemap from '@astrojs/sitemap'
3
3
  import checks from '@nuasite/checks'
4
- import cms from '@nuasite/cms'
4
+ import cms, { cmsRemarkPlugins } from '@nuasite/cms'
5
5
  import tailwindcss from '@tailwindcss/vite'
6
6
  import type { AstroIntegration } from 'astro'
7
7
  import { writeFile } from 'node:fs/promises'
@@ -87,9 +87,17 @@ export default function nua(options: NuaIntegrationOptions = {}): AstroIntegrati
87
87
  return { from: normalizedFrom, to: normalizedTo, code }
88
88
  })
89
89
 
90
- // Inject Vite plugins and integrations
90
+ // Inject Vite plugins and integrations.
91
+ // CMS list-style directives (`:::list{.class}`) need `remark-directive`
92
+ // in the markdown pipeline — both to render `<ul class="class">` and to
93
+ // stop MDX from parsing the `{.class}` attributes as a JS expression
94
+ // (which crashes acorn). `@astrojs/mdx` inherits these via
95
+ // `extendMarkdownConfig` (default true).
91
96
  updateConfig({
92
97
  redirects: {},
98
+ markdown: {
99
+ remarkPlugins: cmsRemarkPlugins,
100
+ },
93
101
  vite: {
94
102
  plugins: vitePlugins,
95
103
  },
package/src/types.ts CHANGED
@@ -40,9 +40,29 @@ function resolveOption<T extends object>(value: boolean | T | undefined, default
40
40
  return value
41
41
  }
42
42
 
43
+ /**
44
+ * Applies Nua's CMS defaults that differ from @nuasite/cms' own defaults.
45
+ * Currently: the in-preview collection management UI is hidden by default,
46
+ * since collection editing is owned elsewhere. Sites can opt back in by setting
47
+ * `cms.cmsConfig.features.collectionManagement` explicitly.
48
+ */
49
+ function applyCmsDefaults(cms: NuaCmsOptions | false): NuaCmsOptions | false {
50
+ if (cms === false) return false
51
+ return {
52
+ ...cms,
53
+ cmsConfig: {
54
+ ...cms.cmsConfig,
55
+ features: {
56
+ collectionManagement: false,
57
+ ...cms.cmsConfig?.features,
58
+ },
59
+ },
60
+ }
61
+ }
62
+
43
63
  export function resolveOptions(options: NuaIntegrationOptions = {}): ResolvedIntegrationOptions {
44
64
  return {
45
- cms: resolveOption(options.cms),
65
+ cms: applyCmsDefaults(resolveOption(options.cms)),
46
66
  pageMarkdown: resolveOption(options.pageMarkdown),
47
67
  mdx: resolveOption(options.mdx),
48
68
  sitemap: resolveOption(options.sitemap),