@brightsideoy/kama 0.1.0-alpha.118 → 0.1.0-alpha.119

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/bin/cli.js CHANGED
@@ -223,7 +223,7 @@ kama-worker/workspace-schemas.js
223
223
  '@brightsideoy/kama': currentKamaVersion,
224
224
  },
225
225
  devDependencies: {
226
- 'wrangler': '^4.130.0' // 🎯 UPDATED TO V4
226
+ 'wrangler': '^4.130.0'
227
227
  }
228
228
  };
229
229
 
@@ -233,7 +233,6 @@ kama-worker/workspace-schemas.js
233
233
  rootPkg.devDependencies['concurrently'] = '^9.0.0';
234
234
  rootPkg.scripts['dev:site'] = `npm run dev -w sites/${siteFolderName}`;
235
235
 
236
- // 🎯 Inject schema bundling hook with fallback execution path
237
236
  rootPkg.scripts['predev'] = bundleScript;
238
237
  rootPkg.scripts['dev'] = 'npx concurrently "npm run dev:cms" "npm run dev:site"';
239
238
  rootPkg.scripts['deploy:site'] = `npm run deploy -w sites/${siteFolderName}`;
@@ -251,17 +250,22 @@ kama-worker/workspace-schemas.js
251
250
  const cmsDir = join(rootDir, 'kama-worker');
252
251
  mkdirSync(cmsDir, { recursive: true });
253
252
 
254
- // 🎯 Worker entry point now attempts to load the workspace schemas
253
+ // 🎯 FIX: Clones frozen Cloudflare env and safely injects BUNDLED_DEFINITIONS
255
254
  const cmsWorkerIndexContent = `import kamaWorker from '@brightsideoy/kama';
256
255
  import customSchemas from './workspace-schemas.js';
257
256
 
258
257
  export default {
259
258
  async fetch(request, env, ctx) {
259
+ const engineEnv = {
260
+ ...env,
261
+ BUNDLED_DEFINITIONS: customSchemas
262
+ };
263
+
260
264
  if (typeof kamaWorker === 'function') {
261
- return kamaWorker(request, env, ctx, customSchemas);
265
+ return kamaWorker(request, engineEnv, ctx);
262
266
  }
263
267
  if (kamaWorker && typeof kamaWorker.fetch === 'function') {
264
- return kamaWorker.fetch(request, env, ctx, customSchemas);
268
+ return kamaWorker.fetch(request, engineEnv, ctx);
265
269
  }
266
270
  return new Response('Kama Engine Worker Ready', { status: 200 });
267
271
  }
@@ -277,7 +281,6 @@ export default {
277
281
  type: 'module',
278
282
  version: '1.0.0',
279
283
  scripts: {
280
- // 🎯 SILENCED SQL ARRAYS ON LOCAL DEV
281
284
  "schema:local": `wrangler d1 execute ${dbName} --local --file=../node_modules/@brightsideoy/kama/schema.sql > /dev/null 2>&1`,
282
285
  "schema:remote": `wrangler d1 execute ${dbName} --remote --file=../node_modules/@brightsideoy/kama/schema.sql`,
283
286
  "dev": "npm run schema:local && wrangler dev",
@@ -287,7 +290,7 @@ export default {
287
290
  '@brightsideoy/kama': currentKamaVersion,
288
291
  },
289
292
  devDependencies: {
290
- "wrangler": "^4.130.0", // 🎯 UPDATED TO V4
293
+ "wrangler": "^4.130.0",
291
294
  "tsx": "^4.19.2",
292
295
  },
293
296
  }, null, 2)
@@ -333,7 +336,6 @@ export default {
333
336
  `# Cloudflare Edge Cache Purging Secrets\nCLOUDFLARE_API_TOKEN=${isCloudflare ? 'cfut_YOUR_CUSTOM_PURGE_TOKEN' : 'local_token'}\n`
334
337
  );
335
338
 
336
- // Attempt an initial bundle right away so it exists before the user runs anything
337
339
  await bundleWorkspaceSchemas(rootDir);
338
340
 
339
341
  if (shouldCreateSite) {
@@ -558,10 +560,8 @@ async function generateAstroSite(rootDir, siteFolder, siteDomain, cmsFullUrl, wo
558
560
  return;
559
561
  }
560
562
 
561
- // 1. Copy the full, complete starter template directory directly
562
563
  cpSync(templateDir, siteDir, { recursive: true });
563
564
 
564
- // 2. Hydrate package.json from template
565
565
  const templatePkgPath = join(siteDir, 'package.json.template');
566
566
  if (existsSync(templatePkgPath)) {
567
567
  const pkgContent = readFileSync(templatePkgPath, 'utf-8')
@@ -572,7 +572,6 @@ async function generateAstroSite(rootDir, siteFolder, siteDomain, cmsFullUrl, wo
572
572
  unlinkSync(templatePkgPath);
573
573
  }
574
574
 
575
- // 3. Hydrate wrangler.json tokens
576
575
  const wranglerPath = join(siteDir, 'wrangler.json');
577
576
  if (existsSync(wranglerPath)) {
578
577
  let wranglerStr = readFileSync(wranglerPath, 'utf-8')
@@ -589,7 +588,6 @@ async function generateAstroSite(rootDir, siteFolder, siteDomain, cmsFullUrl, wo
589
588
  writeFileSync(wranglerPath, wranglerStr);
590
589
  }
591
590
 
592
- // 4. Create dynamic .env file
593
591
  const envContent = [
594
592
  `PUBLIC_CMS_URL="${cmsFullUrl}"`,
595
593
  `PUBLIC_API_URL="${cmsFullUrl}"`,
@@ -0,0 +1,12 @@
1
+ id: content
2
+ label: Content
3
+
4
+ layout:
5
+ columns: "1fr"
6
+ areas:
7
+ - ["content"]
8
+
9
+ regions:
10
+ content:
11
+ label: Content
12
+ allowedBlocks: "*"
@@ -0,0 +1,48 @@
1
+ id: page-skeleton
2
+ label: Page Skeleton
3
+ description: Clean slate for pages with custom CSS and HTML
4
+ inTree: true
5
+ inVault: true
6
+ hasCanvas: true
7
+ directLinking: true
8
+
9
+ defaultLayout: "content"
10
+
11
+ allowedBlocks: "html"
12
+
13
+ tabs:
14
+ settings:
15
+ label: "Page"
16
+ fields:
17
+ # 🎯 1. Include FieldSet Bundle
18
+ - fieldSet: page-base
19
+
20
+ - menuTitle:
21
+ label: Menu Title
22
+ type: text
23
+ dbType: text
24
+ public: true
25
+ css:
26
+ label: "CSS"
27
+ fields:
28
+ - css:
29
+ label: "CSS"
30
+ type: textarea
31
+ public: true
32
+ jsHeader:
33
+ label: "JavaScript"
34
+ fields:
35
+ - jsHeader:
36
+ label: "JS in Header"
37
+ type: textarea
38
+ public: true
39
+
40
+ - jsFooter:
41
+ label: "JS in Footer"
42
+ type: textarea
43
+ public: true
44
+
45
+ # Dedicated Tab Inclusions
46
+ meta: !include ../field-sets/page-seo.yaml
47
+ social: !include ../field-sets/page-social.yaml
48
+ access: !include ../field-sets/access.yaml