@brightsideoy/kama 0.1.0-alpha.110 → 0.1.0-alpha.111
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 +1 -1
- package/bin/cli.js +14 -13
- package/dist/assets/{index-42YPjwst.js → index-DDVVGU8N.js} +1 -1
- package/dist/index.html +1 -1
- package/kama-worker/bundled-definitions.js +2394 -0
- package/kama-worker/bundled-definitions.ts +2395 -0
- package/package.json +1 -1
- package/scripts/bundle-definitions.js +10 -2
package/README.md
CHANGED
|
@@ -134,7 +134,7 @@ my-kama-workspace/
|
|
|
134
134
|
│ ├── nodes/ # e.g., page.yaml, product.yaml
|
|
135
135
|
│ ├── blocks/ # e.g., hero.yaml, image_card.yaml
|
|
136
136
|
│ └── node-layouts/ # e.g., two-column.yaml
|
|
137
|
-
├──
|
|
137
|
+
├── kama-worker/ # 👉 BACKEND PIPELINE
|
|
138
138
|
│ ├── index.js # Worker entrypoint (ES Module)
|
|
139
139
|
│ ├── wrangler.json # Bindings (D1, R2, Vars)
|
|
140
140
|
│ └── package.json
|
package/bin/cli.js
CHANGED
|
@@ -89,9 +89,10 @@ async function createFullWorkspace() {
|
|
|
89
89
|
`node_modules/
|
|
90
90
|
.env
|
|
91
91
|
.DS_Store
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
kama-worker/.dev.vars
|
|
93
|
+
kama-worker/bundled-definitions.js
|
|
94
|
+
kama-worker/bundled-definitions.ts
|
|
95
|
+
kama-worker/.wrangler/
|
|
95
96
|
sites/*/.env
|
|
96
97
|
sites/*/.astro/
|
|
97
98
|
sites/*/dist/
|
|
@@ -197,11 +198,11 @@ sites/*/dist/
|
|
|
197
198
|
name: projName,
|
|
198
199
|
private: true,
|
|
199
200
|
type: 'module',
|
|
200
|
-
workspaces: ['
|
|
201
|
+
workspaces: ['kama-worker', 'sites/*'],
|
|
201
202
|
scripts: {
|
|
202
203
|
'bundle:schemas': 'node node_modules/@brightsideoy/kama/scripts/bundle-definitions.js',
|
|
203
|
-
'dev:cms': 'npm run bundle:schemas && npm run dev -w
|
|
204
|
-
'deploy:cms': 'npm run bundle:schemas && npm run deploy -w
|
|
204
|
+
'dev:cms': 'npm run bundle:schemas && npm run dev -w kama-worker',
|
|
205
|
+
'deploy:cms': 'npm run bundle:schemas && npm run deploy -w kama-worker',
|
|
205
206
|
},
|
|
206
207
|
dependencies: {
|
|
207
208
|
'@brightsideoy/kama': currentKamaVersion,
|
|
@@ -211,7 +212,7 @@ sites/*/dist/
|
|
|
211
212
|
|
|
212
213
|
// 🎯 2. Setup CMS Worker with Dynamic Names
|
|
213
214
|
console.log(`\n☁️ Configuring CMS Worker '${workerName}' (${cmsDomain})...`);
|
|
214
|
-
const cmsDir = join(rootDir, '
|
|
215
|
+
const cmsDir = join(rootDir, 'kama-worker');
|
|
215
216
|
mkdirSync(cmsDir, { recursive: true });
|
|
216
217
|
|
|
217
218
|
// 🎯 Properly wrap and inject BUNDLED_DEFINITIONS from LOCAL workspace, not node_modules
|
|
@@ -259,7 +260,7 @@ export default {
|
|
|
259
260
|
'@brightsideoy/kama': currentKamaVersion,
|
|
260
261
|
},
|
|
261
262
|
devDependencies: {
|
|
262
|
-
wrangler: '^
|
|
263
|
+
wrangler: '^4.0.0', // 👈 Updated to ^4.0.0 to support ES import attributes in dependencies
|
|
263
264
|
tsx: '^4.19.2',
|
|
264
265
|
},
|
|
265
266
|
}, null, 2)
|
|
@@ -326,12 +327,12 @@ export default {
|
|
|
326
327
|
if (d1DatabaseId === '00000000-0000-0000-0000-000000000000' || d1DatabaseId === 'REPLACE_WITH_YOUR_D1_ID') {
|
|
327
328
|
console.log(` 3. Run 'npx wrangler login' and create a D1 database manually.`);
|
|
328
329
|
}
|
|
329
|
-
console.log(` 4. Update CLOUDFLARE_ZONE_ID in
|
|
330
|
-
console.log(` 5. Securely store your purge token: cd
|
|
330
|
+
console.log(` 4. Update CLOUDFLARE_ZONE_ID in kama-worker/wrangler.json with your actual Zone ID`);
|
|
331
|
+
console.log(` 5. Securely store your purge token: cd kama-worker && npx wrangler secret put CLOUDFLARE_API_TOKEN`);
|
|
331
332
|
console.log(` 6. Run 'npm run dev:cms' from the workspace root to start the backend.`);
|
|
332
333
|
} else {
|
|
333
334
|
console.log(` 3. Run 'npm run dev:cms' from the workspace root to start the local SQLite backend.`);
|
|
334
|
-
console.log(`\n💡 Note: You can deploy to Cloudflare later by updating '
|
|
335
|
+
console.log(`\n💡 Note: You can deploy to Cloudflare later by updating 'kama-worker/wrangler.json' with real IDs.`);
|
|
335
336
|
}
|
|
336
337
|
}
|
|
337
338
|
|
|
@@ -347,7 +348,7 @@ async function createNewSiteOnly() {
|
|
|
347
348
|
}
|
|
348
349
|
|
|
349
350
|
let targetWorkerName = 'kama-worker';
|
|
350
|
-
const cmsWranglerPath = join(rootDir, '
|
|
351
|
+
const cmsWranglerPath = join(rootDir, 'kama-worker', 'wrangler.json');
|
|
351
352
|
if (existsSync(cmsWranglerPath)) {
|
|
352
353
|
try {
|
|
353
354
|
const cmsWrangler = JSON.parse(readFileSync(cmsWranglerPath, 'utf-8'));
|
|
@@ -520,7 +521,7 @@ async function generateAstroSite(rootDir, siteFolder, siteDomain, cmsFullUrl, wo
|
|
|
520
521
|
'@astrojs/cloudflare': '^14.2.5',
|
|
521
522
|
'@brightsideoy/kama': currentKamaVersion,
|
|
522
523
|
astro: '^7.2.0',
|
|
523
|
-
wrangler: '^
|
|
524
|
+
wrangler: '^4.0.0', // 👈 Updated to ^4.0.0
|
|
524
525
|
},
|
|
525
526
|
}, null, 2)
|
|
526
527
|
);
|