@tamyla/clodo-framework 4.0.4 → 4.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,20 @@
1
+ ## [4.0.6](https://github.com/tamylaa/clodo-framework/compare/v4.0.5...v4.0.6) (2025-12-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add null checks for enterprise deployment methods ([97c3237](https://github.com/tamylaa/clodo-framework/commit/97c32371e97f259f62a82e9f7cc393dab0def7ed))
7
+ * correct URL construction and export missing testing workflow ([19691e1](https://github.com/tamylaa/clodo-framework/commit/19691e1651b3f37762e0564ccbb939c7c22965ad))
8
+ * correct worker URL construction and prevent undefined errors ([5d94f4f](https://github.com/tamylaa/clodo-framework/commit/5d94f4f064d5264f18929a6d2bd0564b0bb5494a))
9
+ * remove duplicate export in InteractiveTestingWorkflow ([db710c2](https://github.com/tamylaa/clodo-framework/commit/db710c2342ac3fd41b73ffd01fdd83ce0e0256f1))
10
+
11
+ ## [4.0.5](https://github.com/tamylaa/clodo-framework/compare/v4.0.4...v4.0.5) (2025-12-09)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * ensure deployments use correct Cloudflare account and zone ([22d42a9](https://github.com/tamylaa/clodo-framework/commit/22d42a9d4cf800e78953a0bcd897d6cb94dfefc5))
17
+
1
18
  ## [4.0.4](https://github.com/tamylaa/clodo-framework/compare/v4.0.3...v4.0.4) (2025-12-08)
2
19
 
3
20
 
@@ -77,6 +77,7 @@ export class DeploymentCredentialCollector {
77
77
  console.log(chalk.cyan('\nšŸ” Validating Cloudflare API token...\n'));
78
78
  }
79
79
  let accountId = startCredentials.accountId;
80
+ let accountName = startCredentials.accountName;
80
81
  let zoneId = startCredentials.zoneId;
81
82
  let zoneName = startCredentials.zoneName;
82
83
  try {
@@ -95,7 +96,9 @@ export class DeploymentCredentialCollector {
95
96
 
96
97
  // If account ID not provided, fetch from Cloudflare
97
98
  if (!accountId) {
98
- accountId = await this.fetchAccountId(cloudflareAPI);
99
+ const accountInfo = await this.fetchAccountId(cloudflareAPI);
100
+ accountId = accountInfo.id;
101
+ accountName = accountInfo.name;
99
102
  }
100
103
 
101
104
  // If zone ID not provided, fetch from Cloudflare
@@ -118,12 +121,14 @@ export class DeploymentCredentialCollector {
118
121
  return {
119
122
  token,
120
123
  accountId,
124
+ accountName,
121
125
  zoneId,
122
126
  zoneName,
123
127
  // Convenience: cloudflareSettings object for passing to orchestrators
124
128
  cloudflareSettings: {
125
129
  token,
126
130
  accountId,
131
+ accountName,
127
132
  zoneId,
128
133
  zoneName
129
134
  }
@@ -184,7 +189,10 @@ export class DeploymentCredentialCollector {
184
189
  if (!this.quiet) {
185
190
  console.log(chalk.green(`āœ… Found account: ${accounts[0].name}\n`));
186
191
  }
187
- return accounts[0].id;
192
+ return {
193
+ id: accounts[0].id,
194
+ name: accounts[0].name
195
+ };
188
196
  }
189
197
 
190
198
  // Multiple accounts - let user choose
@@ -197,7 +205,10 @@ export class DeploymentCredentialCollector {
197
205
  if (!this.quiet) {
198
206
  console.log(chalk.green(`āœ… Selected: ${selectedAccount.name}\n`));
199
207
  }
200
- return selectedAccount.id;
208
+ return {
209
+ id: selectedAccount.id,
210
+ name: selectedAccount.name
211
+ };
201
212
  } catch (error) {
202
213
  console.error(chalk.red('āŒ Failed to fetch account ID:'));
203
214
  console.error(chalk.yellow(error.message));
@@ -45,10 +45,25 @@ export class InteractiveConfirmation {
45
45
  console.log('=====================');
46
46
  console.log(`🌐 Domain: ${config.domain}`);
47
47
  console.log(`šŸŒ Environment: ${config.environment}`);
48
- console.log(`⚔ Worker: ${config.worker.name}`);
49
- console.log(`šŸ”— URL: ${config.worker.url}`);
50
- console.log(`šŸ—„ļø Database: ${config.database.name} (${config.database.id})`);
51
- console.log(`šŸ”‘ Secrets: ${Object.keys(config.secrets.keys).length} configured`);
48
+ console.log(`⚔ Worker: ${config.worker?.name || 'Not configured'}`);
49
+ console.log(`šŸ”— URL: ${config.worker?.url || 'Not configured'}`);
50
+
51
+ // Database info from resources
52
+ const database = deploymentState.resources?.database;
53
+ if (database) {
54
+ console.log(`šŸ—„ļø Database: ${database.name} (${database.id})`);
55
+ } else {
56
+ console.log(`šŸ—„ļø Database: Not configured`);
57
+ }
58
+
59
+ // Secrets info from resources
60
+ const secrets = deploymentState.resources?.secrets;
61
+ if (secrets) {
62
+ const secretCount = Object.keys(secrets).length;
63
+ console.log(`šŸ”‘ Secrets: ${secretCount} configured`);
64
+ } else {
65
+ console.log(`šŸ”‘ Secrets: Not configured`);
66
+ }
52
67
  console.log(`šŸ†” Deployment ID: ${deploymentState.deploymentId}`);
53
68
  }
54
69
 
@@ -63,7 +78,7 @@ export class InteractiveConfirmation {
63
78
  console.log('2. Run database migrations');
64
79
  console.log('3. Deploy Cloudflare Worker');
65
80
  console.log('4. Verify deployment health');
66
- if (config.deployment.runTests) {
81
+ if (config.deployment?.runTests) {
67
82
  console.log('5. Run integration tests');
68
83
  }
69
84
  }
@@ -132,11 +147,11 @@ export class InteractiveConfirmation {
132
147
  console.log(`šŸ“± Mode: ${config.deploymentMode}`);
133
148
  console.log(`⚔ Worker: ${config.worker.name}`);
134
149
  console.log(`šŸ”— URL: ${config.worker.url}`);
135
- console.log(`šŸ—„ļø Database: ${config.database.name} (${config.database.id})`);
136
- console.log(`šŸ”‘ Secrets: ${Object.keys(config.secrets.keys).length} configured`);
150
+ console.log(`šŸ—„ļø Database: ${config.database?.name || 'None'} (${config.database?.id || 'No ID'})`);
151
+ console.log(`šŸ”‘ Secrets: ${config.secrets?.keys ? Object.keys(config.secrets.keys).length : 0} configured`);
137
152
  console.log(`šŸ†” Deployment ID: ${deploymentState.deploymentId}`);
138
- console.log(`šŸ” Validation: ${config.deployment.validationLevel}`);
139
- console.log(`šŸ“‹ Audit: ${config.deployment.auditLevel}`);
153
+ console.log(`šŸ” Validation: ${config.deployment?.validationLevel || 'standard'}`);
154
+ console.log(`šŸ“‹ Audit: ${config.deployment?.auditLevel || 'basic'}`);
140
155
  }
141
156
 
142
157
  /**
@@ -153,7 +168,7 @@ export class InteractiveConfirmation {
153
168
  console.log('4. Configuration management');
154
169
  console.log('5. Cloudflare Worker deployment with D1 recovery');
155
170
  console.log('6. Deployment verification');
156
- if (config.deployment.runTests) {
171
+ if (config.deployment?.runTests) {
157
172
  console.log('7. Comprehensive integration tests');
158
173
  }
159
174
  console.log(`8. Audit logging and reporting`);
@@ -212,7 +212,7 @@ export class InteractiveDeploymentCoordinator {
212
212
  const result = await Clodo.deploy({
213
213
  servicePath: this.deploymentState.config.servicePath,
214
214
  environment: this.deploymentState.config.environment,
215
- domain: this.deploymentState.config.domain,
215
+ domain: this.deploymentState.config.credentials.zoneName,
216
216
  serviceName: this.options.serviceName,
217
217
  dryRun: this.deploymentState.config.dryRun,
218
218
  credentials: this.deploymentState.config.credentials
@@ -93,8 +93,8 @@ export class InteractiveDomainInfoGatherer {
93
93
  config.worker = config.worker || {};
94
94
  config.worker.name = `${config.domain}-data-service`;
95
95
 
96
- // Use actual zone name from credentials if available, otherwise fallback
97
- const zoneName = config.credentials?.zoneName || 'tamylatrading.workers.dev';
96
+ // Use zone name from credentials for workers.dev subdomain
97
+ const zoneName = config.credentials?.zoneName || `${config.domain}.workers.dev`;
98
98
  config.worker.url = `https://${config.worker.name}.${zoneName}`;
99
99
  console.log(`\nšŸ”§ Generated Configuration:`);
100
100
  console.log(` Worker Name: ${config.worker.name}`);
@@ -114,7 +114,7 @@ export class InteractiveDomainInfoGatherer {
114
114
  console.log(` šŸ”§ Using extracted name: ${customWorkerName}`);
115
115
  }
116
116
  config.worker.name = customWorkerName;
117
- const zoneName = config.credentials?.zoneName || 'tamylatrading.workers.dev';
117
+ const zoneName = config.credentials?.zoneName || `${config.domain}.workers.dev`;
118
118
  config.worker.url = `https://${config.worker.name}.${zoneName}`;
119
119
  console.log(`\nāœ… Updated worker configuration`);
120
120
  }
@@ -140,7 +140,7 @@ export class InteractiveValidationWorkflow {
140
140
  // Rename
141
141
  const newName = await this.promptForNewWorkerName(config.worker.name);
142
142
  config.worker.name = newName;
143
- config.worker.url = `https://${newName}.${config.credentials?.zoneName || 'tamylatrading.workers.dev'}`;
143
+ config.worker.url = `https://${newName}.${config.credentials?.zoneName || `${config.domain || 'clododev'}.workers.dev`}`;
144
144
  console.log(` āœ… Will deploy as new worker: ${newName}`);
145
145
  return true;
146
146
  case 2:
@@ -207,7 +207,7 @@ export class InteractiveValidationWorkflow {
207
207
  // This is a simplified comparison - in a real implementation,
208
208
  // you might fetch the existing worker's configuration
209
209
  console.log(` šŸ“‹ Existing Worker: ${config.worker.name}`);
210
- console.log(` 🌐 URL: https://${config.worker.name}.${config.credentials?.zoneName || 'tamylatrading.workers.dev'}`);
210
+ console.log(` 🌐 URL: https://${config.worker.name}.${config.credentials?.zoneName || `${config.domain || 'clododev'}.workers.dev`}`);
211
211
  console.log(` šŸ“… Last deployed: Unknown (would need API call to check)`);
212
212
  console.log(` šŸ”§ Environment: ${config.environment || 'production'}`);
213
213
  console.log('\n šŸ“‹ New Deployment:');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamyla/clodo-framework",
3
- "version": "4.0.4",
3
+ "version": "4.0.6",
4
4
  "description": "Reusable framework for Clodo-style software architecture on Cloudflare Workers + D1",
5
5
  "type": "module",
6
6
  "sideEffects": [