@yysng/astro-boilerplate 1.1.23 → 1.1.26

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": "@yysng/astro-boilerplate",
3
- "version": "1.1.23",
3
+ "version": "1.1.26",
4
4
  "description": "Astro + Sanity Boilerplate with AEO Layers 1–5",
5
5
  "type": "module",
6
6
  "exports": {
@@ -5,19 +5,11 @@ export async function loadContent(key, env = {}) {
5
5
  const entry = CONTENT_REGISTRY[key];
6
6
  if (!entry) throw new Error(`Unknown content key: ${key}`);
7
7
 
8
- // Cloudflare production: KV only
9
8
  if (env?.CONTENT_KV) {
10
9
  const stored = await env.CONTENT_KV.get(entry.file, "json");
11
- if (!stored) {
12
- throw new Error(`KV missing content: ${entry.file}`);
13
- }
14
- return stored;
10
+ if (stored) return stored;
11
+ throw new Error(`KV missing content for ${entry.file}`);
15
12
  }
16
13
 
17
- // Node.js local dev only
18
- if (typeof process !== "undefined" && process.versions?.node) {
19
- return await readLocal(entry.file);
20
- }
21
-
22
- throw new Error("Content system misconfigured: no KV and no local FS allowed");
14
+ return await readLocal(entry.file);
23
15
  }