@brightsideoy/kama 0.1.0-alpha.36 → 0.1.0-alpha.39

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
@@ -42,6 +42,10 @@ async function createFullWorkspace() {
42
42
  console.log(`\nšŸ“ Creating workspace folder at ./${projName}...`);
43
43
  mkdirSync(rootDir, { recursive: true });
44
44
 
45
+ // šŸŽÆ Scaffold schemas directory for custom project YAML definitions
46
+ mkdirSync(join(rootDir, 'schemas', 'nodes'), { recursive: true });
47
+ mkdirSync(join(rootDir, 'schemas', 'blocks'), { recursive: true });
48
+
45
49
  // --- AUTO D1 CREATION MAGIC ---
46
50
  let d1DatabaseId = 'REPLACE_WITH_YOUR_D1_ID';
47
51
  let isAuthenticated = false;
@@ -112,7 +116,7 @@ async function createFullWorkspace() {
112
116
  }
113
117
  // ------------------------------
114
118
 
115
- // 1. Root package.json
119
+ // šŸŽÆ 1. Root package.json with bundle:schemas hooked
116
120
  writeFileSync(
117
121
  join(rootDir, 'package.json'),
118
122
  JSON.stringify({
@@ -121,18 +125,21 @@ async function createFullWorkspace() {
121
125
  type: 'module',
122
126
  workspaces: ['cms-worker', 'sites/*'],
123
127
  scripts: {
124
- 'dev:cms': 'npm run dev -w cms-worker',
125
- 'deploy:cms': 'npm run deploy -w cms-worker',
128
+ 'bundle:schemas': 'node node_modules/@brightsideoy/kama/scripts/bundle-definitions.js',
129
+ 'dev:cms': 'npm run bundle:schemas && npm run dev -w cms-worker',
130
+ 'deploy:cms': 'npm run bundle:schemas && npm run deploy -w cms-worker',
126
131
  },
132
+ dependencies: {
133
+ '@brightsideoy/kama': 'alpha',
134
+ }
127
135
  }, null, 2)
128
136
  );
129
137
 
130
- // 2. Setup CMS Worker
138
+ // šŸŽÆ 2. Setup CMS Worker
131
139
  console.log(`\nā˜ļø Configuring CMS Worker (${cmsDomain})...`);
132
140
  const cmsDir = join(rootDir, 'cms-worker');
133
141
  mkdirSync(cmsDir, { recursive: true });
134
142
 
135
- // šŸ›‘ The critical local entry point file!
136
143
  writeFileSync(
137
144
  join(cmsDir, 'index.js'),
138
145
  `export { default } from '@brightsideoy/kama';\n`
@@ -145,8 +152,9 @@ async function createFullWorkspace() {
145
152
  type: 'module',
146
153
  version: '1.0.0',
147
154
  scripts: {
148
- "schema:local": `wrangler d1 execute ${dbName} --local --file=../node_modules/@brightsideoy/kama/schema.sql`,
149
- "schema:remote": `wrangler d1 execute ${dbName} --remote --file=../node_modules/@brightsideoy/kama/schema.sql`,
155
+ "bundle:schemas": "node ../node_modules/@brightsideoy/kama/scripts/bundle-definitions.js",
156
+ "schema:local": `npm run bundle:schemas && wrangler d1 execute ${dbName} --local --file=../node_modules/@brightsideoy/kama/schema.sql`,
157
+ "schema:remote": `npm run bundle:schemas && wrangler d1 execute ${dbName} --remote --file=../node_modules/@brightsideoy/kama/schema.sql`,
150
158
  "dev": "npm run schema:local && wrangler dev",
151
159
  "deploy": "npm run schema:remote && wrangler deploy"
152
160
  },
@@ -165,7 +173,7 @@ async function createFullWorkspace() {
165
173
  JSON.stringify({
166
174
  $schema: '../node_modules/wrangler/config-schema.json',
167
175
  name: 'kama-worker',
168
- main: 'index.js', // šŸ›‘ Pointing to our generated local entry point
176
+ main: 'index.js',
169
177
  compatibility_date: '2026-08-01',
170
178
  compatibility_flags: ['nodejs_compat'],
171
179
  assets: {