@tamyla/clodo-framework 3.0.5 → 3.0.6

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.0.6](https://github.com/tamylaa/clodo-framework/compare/v3.0.5...v3.0.6) (2025-10-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * use database name instead of binding name for D1 migrations ([6b22b25](https://github.com/tamylaa/clodo-framework/commit/6b22b25e95bebb4f9728835bd881d71dd90cdba6))
7
+
1
8
  ## [3.0.5](https://github.com/tamylaa/clodo-framework/compare/v3.0.4...v3.0.5) (2025-10-14)
2
9
 
3
10
 
@@ -395,9 +395,11 @@ export class DatabaseOrchestrator {
395
395
  }
396
396
  console.log(` ✅ Database ${databaseName} validated`);
397
397
 
398
- // Use BINDING name (not database name) for wrangler command
399
- const command = this.buildMigrationCommand(bindingName, environment, isRemote);
398
+ // Use DATABASE name for wrangler command
399
+ const command = this.buildMigrationCommand(databaseName, environment, isRemote);
400
400
  console.log(` 📋 Migration command: ${command}`);
401
+ console.log(` 📁 Command will run from: ${this.projectRoot}`);
402
+ console.log(` 📁 Current working directory: ${process.cwd()}`);
401
403
  const output = await this.executeWithRetry(command, 120000, this.projectRoot); // 2 minute timeout
402
404
 
403
405
  // Parse migration output
@@ -646,11 +648,11 @@ export class DatabaseOrchestrator {
646
648
 
647
649
  // Command builders and utility methods
648
650
 
649
- buildMigrationCommand(bindingName = 'DB', environment, isRemote) {
650
- // Use BINDING name (from wrangler.toml), NOT database name
651
- // Wrangler expects: "npx wrangler d1 migrations apply DB --local"
652
- // NOT: "npx wrangler d1 migrations apply database-name --local"
653
- let command = `npx wrangler d1 migrations apply ${bindingName}`;
651
+ buildMigrationCommand(databaseName, environment, isRemote) {
652
+ // Use DATABASE name, NOT binding name
653
+ // Wrangler expects: "npx wrangler d1 migrations apply database-name --local"
654
+ // NOT: "npx wrangler d1 migrations apply binding-name --local"
655
+ let command = `npx wrangler d1 migrations apply ${databaseName}`;
654
656
 
655
657
  // For remote environments, add --remote flag
656
658
  // For local development, use --local
@@ -294,6 +294,8 @@ export class MultiDomainOrchestrator {
294
294
 
295
295
  // CRITICAL: Update wrangler.toml BEFORE attempting migrations
296
296
  console.log(` 📝 Configuring wrangler.toml for database...`);
297
+ console.log(` 📁 Service path: ${this.servicePath}`);
298
+ console.log(` 📁 Current working directory: ${process.cwd()}`);
297
299
  try {
298
300
  // Ensure environment section exists
299
301
  await this.wranglerConfigManager.ensureEnvironment(this.environment);
@@ -305,6 +307,7 @@ export class MultiDomainOrchestrator {
305
307
  database_id: databaseId
306
308
  });
307
309
  console.log(` ✅ wrangler.toml updated with database configuration`);
310
+ console.log(` 📄 wrangler.toml location: ${this.wranglerConfigManager.configPath}`);
308
311
  } catch (configError) {
309
312
  console.warn(` ⚠️ Failed to update wrangler.toml: ${configError.message}`);
310
313
  console.warn(` 💡 You may need to manually add database configuration`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamyla/clodo-framework",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "Reusable framework for Clodo-style software architecture on Cloudflare Workers + D1",
5
5
  "type": "module",
6
6
  "sideEffects": [