nebula-cms 0.1.5 → 0.1.7
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 +2 -0
- package/dist/astro/index.d.ts.map +1 -1
- package/dist/astro/index.js +27 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
A streamlined, Git-based Content Management System built specifically for [Astro](https://astro.build/). Nebula CMS provides a beautiful, unified editing interface for your Markdown, MDX, JSON, YAML, TOML, and Markdoc files, driven directly by your existing Astro [Content Collections](https://docs.astro.build/en/guides/content-collections/).
|
|
6
6
|
|
|
7
|
+

|
|
8
|
+
|
|
7
9
|
## Features
|
|
8
10
|
|
|
9
11
|
- **Painless Integration**: Plugs perfectly into Astro as a standard integration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/astro/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAmDnD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,MAAM,GAAE,eAAoB,GAC3B,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/astro/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAmDnD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,MAAM,GAAE,eAAoB,GAC3B,gBAAgB,CA8ElB;AA6BD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,sBAAsB,EAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC;;IAK/B;;;;;OAKG;4BACqB;QAAE,WAAW,EAAE;YAAE,GAAG,EAAE,QAAQ,CAAA;SAAE,CAAA;KAAE;IA0E1D;;;;OAIG;kBACW,MAAM;IAKpB;;;;OAIG;aACM,MAAM;EA6BlB"}
|
package/dist/astro/index.js
CHANGED
|
@@ -76,6 +76,7 @@ export default function NebulaCMS(config = {}) {
|
|
|
76
76
|
vite: {
|
|
77
77
|
plugins: [
|
|
78
78
|
nebulaVitePlugin(logger, process.cwd(), normalizedConfig),
|
|
79
|
+
nebulaCSSFixPlugin(),
|
|
79
80
|
],
|
|
80
81
|
/*
|
|
81
82
|
* Workers use dynamic imports (e.g. storage worker lazy-loads
|
|
@@ -114,6 +115,32 @@ export default function NebulaCMS(config = {}) {
|
|
|
114
115
|
},
|
|
115
116
|
};
|
|
116
117
|
}
|
|
118
|
+
/*
|
|
119
|
+
* Regex matching Svelte CSS virtual module IDs from nebula-cms.
|
|
120
|
+
* These IDs look like: .../nebula-cms/dist/client/Foo.svelte?svelte&type=style&lang.css
|
|
121
|
+
*/
|
|
122
|
+
const NEBULA_CSS_RE = /nebula-cms\/dist\/client\/.*\.svelte\?svelte&type=style/;
|
|
123
|
+
/**
|
|
124
|
+
* Vite plugin that strips cssScopeTo metadata from nebula-cms CSS
|
|
125
|
+
* virtual modules. Without this, Astro's production build pipeline
|
|
126
|
+
* tree-shakes CSS for conditionally-rendered Svelte components
|
|
127
|
+
* (those behind {#if} blocks that don't execute during SSR),
|
|
128
|
+
* resulting in missing scoped styles in the production output.
|
|
129
|
+
* Removing cssScopeTo ensures the SSR build retains all component
|
|
130
|
+
* CSS regardless of which branches execute during prerendering.
|
|
131
|
+
* @return {object} Vite plugin
|
|
132
|
+
*/
|
|
133
|
+
function nebulaCSSFixPlugin() {
|
|
134
|
+
return {
|
|
135
|
+
name: 'vite-plugin-nebula-css-fix',
|
|
136
|
+
transform(code, id) {
|
|
137
|
+
if (!NEBULA_CSS_RE.test(id))
|
|
138
|
+
return null;
|
|
139
|
+
// Return the CSS unchanged but replace vite meta to strip cssScopeTo
|
|
140
|
+
return { code, meta: { vite: {} } };
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
117
144
|
/**
|
|
118
145
|
* Vite plugin that serves collection schemas and CMS config via virtual modules.
|
|
119
146
|
* @internal Not part of the public API — exported for testing only
|