@brightsideoy/kama 0.1.0-alpha.31 → 0.1.0-alpha.33

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
@@ -37,7 +37,6 @@ async function createFullWorkspace() {
37
37
 
38
38
  const rootDir = join(process.cwd(), projName);
39
39
 
40
- // Changed to 'let' so we can rename it if it already exists
41
40
  let dbName = `${projName}-db`.replace(/[^a-zA-Z0-9_-]/g, '_');
42
41
 
43
42
  console.log(`\nšŸ“ Creating workspace folder at ./${projName}...`);
@@ -69,7 +68,6 @@ async function createFullWorkspace() {
69
68
  console.log(`\nšŸ—„ļø Checking existing Cloudflare D1 databases...`);
70
69
  const listOutput = execSync(`npx wrangler d1 list --json`, { encoding: 'utf-8', stdio: 'pipe' });
71
70
 
72
- // Safely parse JSON in case Wrangler prints update warnings before the JSON array
73
71
  const jsonStart = listOutput.indexOf('[');
74
72
  const jsonEnd = listOutput.lastIndexOf(']') + 1;
75
73
  let databases = [];
@@ -134,6 +132,12 @@ async function createFullWorkspace() {
134
132
  const cmsDir = join(rootDir, 'cms-worker');
135
133
  mkdirSync(cmsDir, { recursive: true });
136
134
 
135
+ // šŸ›‘ The critical local entry point file!
136
+ writeFileSync(
137
+ join(cmsDir, 'index.js'),
138
+ `export { default } from '@brightsideoy/kama';\n`
139
+ );
140
+
137
141
  writeFileSync(
138
142
  join(cmsDir, 'package.json'),
139
143
  JSON.stringify({
@@ -147,7 +151,7 @@ async function createFullWorkspace() {
147
151
  "deploy": "npm run schema:remote && wrangler deploy"
148
152
  },
149
153
  dependencies: {
150
- '@brightsideoy/kama': 'latest',
154
+ '@brightsideoy/kama': 'alpha',
151
155
  },
152
156
  devDependencies: {
153
157
  wrangler: '^4.127.1',
@@ -159,12 +163,15 @@ async function createFullWorkspace() {
159
163
  writeFileSync(
160
164
  join(cmsDir, 'wrangler.json'),
161
165
  JSON.stringify({
162
- $schema: 'node_modules/wrangler/config-schema.json',
166
+ $schema: '../node_modules/wrangler/config-schema.json',
163
167
  name: 'kama-worker',
164
- main: 'node_modules/@brightsideoy/kama/dist/index.js',
168
+ main: 'index.js', // šŸ›‘ Pointing to our generated local entry point
165
169
  compatibility_date: '2026-08-01',
166
170
  compatibility_flags: ['nodejs_compat'],
167
- assets: { directory: './dist', binding: 'ASSETS' },
171
+ assets: {
172
+ directory: '../node_modules/@brightsideoy/kama/dist',
173
+ binding: 'ASSETS'
174
+ },
168
175
  routes: [{ pattern: cmsDomain, custom_domain: true }],
169
176
  vars: { CDN_DOMAIN: cmsDomain },
170
177
  d1_databases: [{
@@ -240,7 +247,7 @@ async function generateAstroSite(rootDir, siteFolder, siteDomain, cmsDomain) {
240
247
  },
241
248
  dependencies: {
242
249
  '@astrojs/cloudflare': '^14.2.5',
243
- '@brightsideoy/kama': 'latest',
250
+ '@brightsideoy/kama': 'alpha',
244
251
  astro: '^7.2.2',
245
252
  wrangler: '^4.127.1',
246
253
  },