@tamyla/clodo-framework 3.0.5 → 3.0.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [3.0.7](https://github.com/tamylaa/clodo-framework/compare/v3.0.6...v3.0.7) (2025-10-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * use --remote flag for D1 migrations since databases are created in Cloudflare ([1a94538](https://github.com/tamylaa/clodo-framework/commit/1a945389f9c4ae54a7ebc7c1ea4badc3b0ccaed2))
7
+
8
+ ## [3.0.6](https://github.com/tamylaa/clodo-framework/compare/v3.0.5...v3.0.6) (2025-10-14)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * use database name instead of binding name for D1 migrations ([6b22b25](https://github.com/tamylaa/clodo-framework/commit/6b22b25e95bebb4f9728835bd881d71dd90cdba6))
14
+
1
15
  ## [3.0.5](https://github.com/tamylaa/clodo-framework/compare/v3.0.4...v3.0.5) (2025-10-14)
2
16
 
3
17
 
@@ -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`);
@@ -315,9 +318,10 @@ export class MultiDomainOrchestrator {
315
318
  try {
316
319
  // Use the real applyDatabaseMigrations method
317
320
  // Note: bindingName defaults to 'DB' if not provided
321
+ // Since databases are created remotely via Cloudflare API, always use remote flag
318
322
  await this.databaseOrchestrator.applyDatabaseMigrations(databaseName, 'DB',
319
323
  // bindingName - wrangler.toml binding name
320
- this.environment, this.environment !== 'development' // isRemote for staging/production
324
+ this.environment, true // Always remote since databases are created in Cloudflare
321
325
  );
322
326
  console.log(` ✅ Migrations applied successfully`);
323
327
  } catch (migrationError) {
@@ -331,7 +335,8 @@ export class MultiDomainOrchestrator {
331
335
  databaseId,
332
336
  environment: this.environment,
333
337
  migrationsApplied: true,
334
- isRemote: this.environment !== 'development',
338
+ isRemote: true,
339
+ // Always remote since databases are created in Cloudflare
335
340
  created
336
341
  });
337
342
  return {
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.7",
4
4
  "description": "Reusable framework for Clodo-style software architecture on Cloudflare Workers + D1",
5
5
  "type": "module",
6
6
  "sideEffects": [