@brightsideoy/kama 1.0.0-alpha.10 → 1.0.0-alpha.11

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
@@ -152,11 +152,12 @@ function showHelp() {
152
152
  console.log(' promote Promote the current Local workspace to Cloudflare Edge');
153
153
  console.log(' help, -h Show this help message\n');
154
154
  console.log(pc.cyan('Workspace Scripts (Run from project root):'));
155
- console.log(' npm update Update to latest KAMA version');
156
- console.log(' npm run setup Initialize database schema (Run Once)');
157
- console.log(' npm run dev Boot up the CMS backend and Astro frontend concurrently');
158
- console.log(' npm run deploy:cms Deploy the backend worker and database to Cloudflare');
159
- console.log(' npm run deploy:site Deploy the Astro frontend site to Cloudflare\n');
155
+ console.log(' npm update Update to latest KAMA version');
156
+ console.log(' npm run setup Initialize database schema (Run Once)');
157
+ console.log(' npm run seed -w kama-worker Seed the database with mock test data'); // 🎯 NEW LINE
158
+ console.log(' npm run dev Boot up the CMS backend and Astro frontend concurrently');
159
+ console.log(' npm run deploy:cms Deploy the backend worker and database to Cloudflare');
160
+ console.log(' npm run deploy:site Deploy the Astro frontend site to Cloudflare\n');
160
161
  }
161
162
 
162
163
  async function main() {
@@ -406,13 +407,15 @@ async function createFullWorkspace() {
406
407
  type: 'module',
407
408
  version: '1.0.0',
408
409
  scripts: {
410
+ // 🎯 Uses native node with the compiled dist/build-seed.js
411
+ "seed": "node ../node_modules/@brightsideoy/kama/dist/build-seed.js && wrangler d1 execute " + dbName + " --local --file=seed.sql",
409
412
  "setup:local": `wrangler d1 execute ${dbName} --local --file=../node_modules/@brightsideoy/kama/schema.sql > /dev/null 2>&1`,
410
413
  "setup:remote": `wrangler d1 execute ${dbName} --remote --file=../node_modules/@brightsideoy/kama/schema.sql`,
411
414
  "dev": "wrangler dev --port 8787 --inspector-port 9239",
412
415
  "deploy": "npm run setup:remote && wrangler deploy"
413
416
  },
414
417
  dependencies: { '@brightsideoy/kama': currentKamaVersion, '@libsql/client': '^0.14.0' },
415
- devDependencies: { "wrangler": WRANGLER_LATEST },
418
+ devDependencies: { "wrangler": WRANGLER_LATEST }, // 🎯 Removed TSX requirement
416
419
  }, null, 2)
417
420
  );
418
421
 
@@ -453,12 +456,14 @@ async function createFullWorkspace() {
453
456
  type: 'module',
454
457
  version: '1.0.0',
455
458
  scripts: {
459
+ // 🎯 Uses native node with the compiled dist/build-seed.js
460
+ "seed": "node ../node_modules/@brightsideoy/kama/dist/build-seed.js && sqlite3 kama.db < seed.sql",
456
461
  "setup:local": "sqlite3 kama.db < ../node_modules/@brightsideoy/kama/schema.sql",
457
462
  "dev": "tsx server.js",
458
463
  "start": "node server.js"
459
464
  },
460
465
  dependencies: { '@brightsideoy/kama': currentKamaVersion, '@hono/node-server': '^1.13.0', '@libsql/client': '^0.14.0', 'sharp': '^0.33.5', 'dotenv': '^16.4.5' },
461
- devDependencies: { "tsx": "^4.19.0" },
466
+ devDependencies: { "tsx": "^4.19.0" }, // 🎯 Kept because "dev" uses it
462
467
  }, null, 2)
463
468
  );
464
469
 
@@ -681,8 +686,15 @@ async function promoteLocalToCloudflare() {
681
686
  workerPkg.scripts.deploy = "npm run setup:remote && wrangler deploy";
682
687
  workerPkg.scripts["setup:local"] = `wrangler d1 execute ${dbName} --local --file=../node_modules/@brightsideoy/kama/schema.sql`;
683
688
  workerPkg.scripts["setup:remote"] = `wrangler d1 execute ${dbName} --remote --file=../node_modules/@brightsideoy/kama/schema.sql`;
689
+
690
+ // 🎯 Uses native node with the compiled dist/build-seed.js
691
+ workerPkg.scripts["seed"] = `node ../node_modules/@brightsideoy/kama/dist/build-seed.js && wrangler d1 execute ${dbName} --local --file=seed.sql`;
692
+
684
693
  workerPkg.devDependencies = workerPkg.devDependencies || {};
685
694
  workerPkg.devDependencies.wrangler = WRANGLER_LATEST;
695
+ // 🎯 explicit deletion of TSX addition on promotion
696
+ if (workerPkg.devDependencies.tsx) delete workerPkg.devDependencies.tsx;
697
+
686
698
  writeFileSync(workerPkgPath, JSON.stringify(workerPkg, null, 2));
687
699
  }
688
700