@beechcms/cms 0.4.0-preview.5 → 0.4.0-preview.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/bin/cli.mjs CHANGED
@@ -49,6 +49,12 @@ async function tryLoadLocalRegistry() {
49
49
  if (mod.SEED_REGISTRY && typeof mod.SEED_REGISTRY === 'object') {
50
50
  return mod.SEED_REGISTRY
51
51
  }
52
+ if (Array.isArray(mod.seeds)) {
53
+ return Object.fromEntries(mod.seeds.map(s => [s.slug, s]))
54
+ }
55
+ if (Array.isArray(mod.default)) {
56
+ return Object.fromEntries(mod.default.map(s => [s.slug, s]))
57
+ }
52
58
  } catch {}
53
59
  }
54
60
  }
@@ -60,10 +66,26 @@ async function tryLoadLocalRegistry() {
60
66
  '--experimental-strip-types',
61
67
  '--input-type=module',
62
68
  '--eval',
63
- `import { SEED_REGISTRY } from ${JSON.stringify(pathToFileURL(tsPath).href)}; process.stdout.write(JSON.stringify(SEED_REGISTRY))`,
69
+ `
70
+ import * as mod from ${JSON.stringify(pathToFileURL(tsPath).href)};
71
+ let out = null;
72
+ if (mod.SEED_REGISTRY && typeof mod.SEED_REGISTRY === 'object') out = mod.SEED_REGISTRY;
73
+ else if (Array.isArray(mod.seeds)) out = Object.fromEntries(mod.seeds.map(s => [s.slug, s]));
74
+ else if (Array.isArray(mod.default)) out = Object.fromEntries(mod.default.map(s => [s.slug, s]));
75
+ if (out) process.stdout.write(JSON.stringify(out));
76
+ `.trim(),
64
77
  ], { encoding: 'utf-8' })
78
+
65
79
  if (result.status === 0 && result.stdout) {
66
- try { return JSON.parse(result.stdout) } catch {}
80
+ try { return JSON.parse(result.stdout) } catch (err) {
81
+ console.error(' Failed to parse seeds.ts output:', err)
82
+ }
83
+ } else if (result.status !== 0) {
84
+ console.error(' Error loading seeds.ts:')
85
+ console.error(result.stderr || result.stdout || 'Unknown error')
86
+ if (process.version.slice(1).split('.')[0] < 22) {
87
+ console.warn(' Note: Node.js 22.6+ is required to load .ts files directly. Current version:', process.version)
88
+ }
67
89
  }
68
90
  }
69
91
 
package/bin/create.mjs CHANGED
@@ -104,12 +104,14 @@ function buildPackageJson(name) {
104
104
  scripts: {
105
105
  dev: 'wrangler dev --port 8789',
106
106
  deploy: 'wrangler deploy --minify',
107
+ 'seed:load': 'npx beech seed:load',
108
+ 'seed:load:local': 'npx beech seed:load --local',
107
109
  'db:migrate:local': 'wrangler d1 migrations apply ' + name + '-db --local',
108
110
  'db:reset:local': 'node -e "require(\'fs\').rmSync(\'.wrangler/state\',{recursive:true,force:true})" && npm run db:migrate:local',
109
111
  },
110
112
  dependencies: {
111
- '@beechcms/api': '^0.4.0-preview.5',
112
- '@beechcms/core': '^0.4.0-preview.5',
113
+ '@beechcms/api': '^0.4.0-preview.6',
114
+ '@beechcms/core': '^0.4.0-preview.6',
113
115
  },
114
116
  devDependencies: {
115
117
  '@cloudflare/workers-types': '^4.0.0',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beechcms/cms",
3
- "version": "0.4.0-preview.5",
3
+ "version": "0.4.0-preview.7",
4
4
  "packageManager": "npm@11.9.0",
5
5
  "description": "Edge-Native, Schema-Driven Headless CMS built on Cloudflare Workers, D1, and R2. Features the Botanical Engine for alias-stable field management, a modular widget layer, and a React + Vite admin dashboard.",
6
6
  "keywords": [
@@ -56,7 +56,7 @@
56
56
  "typescript": "^5.9.3"
57
57
  },
58
58
  "dependencies": {
59
- "@beechcms/cli": "^0.4.0-preview.5",
59
+ "@beechcms/cli": "^0.4.0-preview.7",
60
60
  "@clack/prompts": "^0.9.1",
61
61
  "picocolors": "^1.1.1"
62
62
  }