@beechcms/cms 0.4.0-preview.10 → 0.4.0-preview.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.mjs +31 -18
- package/bin/create.mjs +0 -0
- package/package.json +2 -2
package/bin/cli.mjs
CHANGED
|
@@ -40,28 +40,41 @@ function cmdBuild() {
|
|
|
40
40
|
async function tryLoadLocalRegistry() {
|
|
41
41
|
const cwd = process.cwd()
|
|
42
42
|
|
|
43
|
-
// Try compiled JS first
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
// Try compiled JS first (root or apps/api)
|
|
44
|
+
const searchDirs = [cwd, resolve(cwd, 'apps', 'api')]
|
|
45
|
+
for (const dir of searchDirs) {
|
|
46
|
+
for (const name of ['seeds.js', 'seeds.mjs', 'seed.js', 'seed.mjs']) {
|
|
47
|
+
const p = resolve(dir, name)
|
|
48
|
+
if (existsSync(p)) {
|
|
49
|
+
try {
|
|
50
|
+
const mod = await import(pathToFileURL(p).href)
|
|
51
|
+
if (mod.SEED_REGISTRY && typeof mod.SEED_REGISTRY === 'object') {
|
|
52
|
+
return mod.SEED_REGISTRY
|
|
53
|
+
}
|
|
54
|
+
if (Array.isArray(mod.seeds)) {
|
|
55
|
+
return Object.fromEntries(mod.seeds.map(s => [s.slug, s]))
|
|
56
|
+
}
|
|
57
|
+
if (Array.isArray(mod.default)) {
|
|
58
|
+
return Object.fromEntries(mod.default.map(s => [s.slug, s]))
|
|
59
|
+
}
|
|
60
|
+
} catch {}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Try seeds.ts / seed.ts (root or apps/api)
|
|
66
|
+
let tsPath = null
|
|
67
|
+
for (const dir of searchDirs) {
|
|
68
|
+
const p = existsSync(resolve(dir, 'seeds.ts'))
|
|
69
|
+
? resolve(dir, 'seeds.ts')
|
|
70
|
+
: resolve(dir, 'seed.ts')
|
|
46
71
|
if (existsSync(p)) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (mod.SEED_REGISTRY && typeof mod.SEED_REGISTRY === 'object') {
|
|
50
|
-
return mod.SEED_REGISTRY
|
|
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
|
-
}
|
|
58
|
-
} catch {}
|
|
72
|
+
tsPath = p
|
|
73
|
+
break
|
|
59
74
|
}
|
|
60
75
|
}
|
|
61
76
|
|
|
62
|
-
|
|
63
|
-
const tsPath = resolve(cwd, 'seeds.ts')
|
|
64
|
-
if (existsSync(tsPath)) {
|
|
77
|
+
if (tsPath) {
|
|
65
78
|
const result = spawnSync(process.execPath, [
|
|
66
79
|
'--experimental-strip-types',
|
|
67
80
|
'--input-type=module',
|
package/bin/create.mjs
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beechcms/cms",
|
|
3
|
-
"version": "0.4.0-preview.
|
|
3
|
+
"version": "0.4.0-preview.11",
|
|
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.
|
|
59
|
+
"@beechcms/cli": "^0.4.0-preview.11",
|
|
60
60
|
"@clack/prompts": "^0.9.1",
|
|
61
61
|
"picocolors": "^1.1.1"
|
|
62
62
|
}
|