@tamyla/clodo-framework 3.1.23 → 3.1.25
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 +15 -0
- package/dist/cli/clodo-simple.js +111 -0
- package/dist/cli/commands/assess.js +29 -20
- package/dist/cli/commands/create.js +22 -31
- package/dist/cli/commands/deploy.js +20 -333
- package/dist/cli/commands/diagnose.js +26 -26
- package/dist/cli/commands/helpers/deployment-verification.js +2 -2
- package/dist/cli/commands/helpers/error-recovery.js +1 -1
- package/dist/cli/commands/helpers/resource-detection.js +1 -1
- package/dist/cli/commands/init-config.js +1 -1
- package/dist/cli/commands/update.js +46 -19
- package/dist/cli/commands/validate.js +24 -34
- package/dist/cli/security-cli.js +1 -1
- package/dist/deployment/wrangler-deployer.js +1 -1
- package/dist/index.js +5 -2
- package/dist/lib/deployment/modules/DeploymentOrchestrator.js +2 -2
- package/dist/lib/deployment/modules/EnvironmentManager.js +2 -2
- package/dist/lib/shared/cloudflare/domain-manager.js +1 -1
- package/dist/lib/shared/cloudflare/ops.js +4 -4
- package/dist/lib/shared/config/command-config-manager.js +1 -1
- package/dist/lib/shared/config/index.js +1 -1
- package/dist/lib/shared/config/manifest-loader.js +3 -3
- package/dist/lib/shared/deployment/credential-collector.js +1 -1
- package/dist/lib/shared/deployment/index.js +2 -2
- package/dist/lib/shared/deployment/rollback-manager.js +1 -1
- package/dist/lib/shared/deployment/utilities/d1-error-recovery.js +1 -1
- package/dist/lib/shared/deployment/validator.js +1 -1
- package/dist/lib/shared/deployment/workflows/interactive-database-workflow.js +1 -1
- package/dist/lib/shared/monitoring/health-checker.js +2 -2
- package/dist/lib/shared/routing/domain-router.js +1 -1
- package/dist/lib/shared/utils/config-loader.js +47 -11
- package/dist/lib/shared/utils/service-config-manager.js +227 -0
- package/dist/lib/shared/validation/ValidationRegistry.js +1 -1
- package/dist/orchestration/cross-domain-coordinator.js +5 -5
- package/dist/orchestration/multi-domain-orchestrator.js +51 -0
- package/dist/security/index.js +2 -2
- package/dist/service-management/ConfirmationEngine.js +1 -1
- package/dist/service-management/ErrorTracker.js +1 -1
- package/dist/service-management/InputCollector.js +1 -1
- package/dist/service-management/ServiceOrchestrator.js +120 -2
- package/dist/service-management/generators/testing/UnitTestsGenerator.js +4 -4
- package/dist/service-management/handlers/ValidationHandler.js +22 -9
- package/dist/simple-api.js +94 -0
- package/dist/utils/cloudflare/ops.js +1 -1
- package/dist/utils/file-manager.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/worker/integration.js +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [3.1.25](https://github.com/tamylaa/clodo-framework/compare/v3.1.24...v3.1.25) (2025-12-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* correct all import paths and add prevention documentation ([dbd3ce6](https://github.com/tamylaa/clodo-framework/commit/dbd3ce6d6b3ceceb9aa839358923c6096c762ceb))
|
|
7
|
+
|
|
8
|
+
## [3.1.24](https://github.com/tamylaa/clodo-framework/compare/v3.1.23...v3.1.24) (2025-11-08)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* Add comprehensive framework assessment and strategic evolution plan ([bed4108](https://github.com/tamylaa/clodo-framework/commit/bed41085c253e025bd065e507296efe261616652))
|
|
14
|
+
* resolve linting error and enhance CI pipeline ([ece5b5a](https://github.com/tamylaa/clodo-framework/commit/ece5b5aa7232bc990b1d85d3e53ccf7e2d215c98))
|
|
15
|
+
|
|
1
16
|
## [3.1.23](https://github.com/tamylaa/clodo-framework/compare/v3.1.22...v3.1.23) (2025-11-07)
|
|
2
17
|
|
|
3
18
|
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Simple CLI - Simplified interface for Clodo Framework
|
|
5
|
+
*
|
|
6
|
+
* A streamlined CLI that provides easy access to core framework functionality
|
|
7
|
+
* using the unified simple API with sensible defaults.
|
|
8
|
+
*/
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
import chalk from 'chalk';
|
|
11
|
+
import { Clodo } from '../src/simple-api.js';
|
|
12
|
+
|
|
13
|
+
// Create program instance
|
|
14
|
+
const program = new Command();
|
|
15
|
+
program.name('clodo').description('Simple CLI for Clodo Framework - streamlined service management').version('1.0.0');
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Create command - Simple service creation
|
|
19
|
+
*/
|
|
20
|
+
program.command('create <name>').description('Create a new service with minimal configuration').option('-t, --type <type>', 'Service type', 'generic').option('-d, --domain <domain>', 'Domain name', 'example.com').option('-e, --env <env>', 'Environment', 'development').option('-o, --output <path>', 'Output directory', '.').option('--token <token>', 'Cloudflare API token').option('--account-id <id>', 'Cloudflare account ID').option('--zone-id <id>', 'Cloudflare zone ID').action(async (name, options) => {
|
|
21
|
+
try {
|
|
22
|
+
console.log(chalk.cyan(`🚀 Creating service: ${name}`));
|
|
23
|
+
const result = await Clodo.createService({
|
|
24
|
+
name,
|
|
25
|
+
type: options.type,
|
|
26
|
+
domain: options.domain,
|
|
27
|
+
environment: options.env,
|
|
28
|
+
outputPath: options.output,
|
|
29
|
+
credentials: {
|
|
30
|
+
token: options.token,
|
|
31
|
+
accountId: options.accountId,
|
|
32
|
+
zoneId: options.zoneId
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
console.log(chalk.green(`✅ ${result.message}`));
|
|
36
|
+
console.log(chalk.white(`📁 Created in: ${result.outputPath}`));
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.error(chalk.red(`❌ ${error.message}`));
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Deploy command - Simple service deployment
|
|
45
|
+
*/
|
|
46
|
+
program.command('deploy').description('Deploy a service with smart configuration detection').option('-p, --path <path>', 'Service directory path', '.').option('-e, --env <env>', 'Target environment', 'production').option('-d, --domain <domain>', 'Specific domain to deploy to').option('--dry-run', 'Simulate deployment without changes').option('--token <token>', 'Cloudflare API token').option('--account-id <id>', 'Cloudflare account ID').option('--zone-id <id>', 'Cloudflare zone ID').action(async options => {
|
|
47
|
+
try {
|
|
48
|
+
console.log(chalk.cyan(`🚀 Deploying service...`));
|
|
49
|
+
const result = await Clodo.deploy({
|
|
50
|
+
servicePath: options.path,
|
|
51
|
+
environment: options.env,
|
|
52
|
+
domain: options.domain,
|
|
53
|
+
dryRun: options.dryRun,
|
|
54
|
+
credentials: {
|
|
55
|
+
token: options.token,
|
|
56
|
+
accountId: options.accountId,
|
|
57
|
+
zoneId: options.zoneId
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
console.log(chalk.green(`✅ ${result.message}`));
|
|
61
|
+
if (result.deployedDomains) {
|
|
62
|
+
console.log(chalk.white(`🌐 Deployed to: ${result.deployedDomains.join(', ')}`));
|
|
63
|
+
}
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error(chalk.red(`❌ ${error.message}`));
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Validate command - Simple service validation
|
|
72
|
+
*/
|
|
73
|
+
program.command('validate').description('Validate a service configuration').option('-p, --path <path>', 'Service directory path', '.').option('-r, --report', 'Export validation report').action(async options => {
|
|
74
|
+
try {
|
|
75
|
+
console.log(chalk.cyan(`🔍 Validating service...`));
|
|
76
|
+
const result = await Clodo.validate({
|
|
77
|
+
servicePath: options.path,
|
|
78
|
+
exportReport: options.report
|
|
79
|
+
});
|
|
80
|
+
if (result.success) {
|
|
81
|
+
console.log(chalk.green(`✅ ${result.message}`));
|
|
82
|
+
} else {
|
|
83
|
+
console.log(chalk.yellow(`⚠️ ${result.message}`));
|
|
84
|
+
if (result.issues && result.issues.length > 0) {
|
|
85
|
+
console.log(chalk.white('Issues found:'));
|
|
86
|
+
result.issues.forEach((issue, index) => {
|
|
87
|
+
console.log(chalk.white(` ${index + 1}. ${issue}`));
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.error(chalk.red(`❌ ${error.message}`));
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Info command - Show framework information
|
|
99
|
+
*/
|
|
100
|
+
program.command('info').description('Show framework information').action(() => {
|
|
101
|
+
const info = Clodo.getInfo();
|
|
102
|
+
console.log(chalk.cyan(`${info.name} v${info.version}`));
|
|
103
|
+
console.log(chalk.white(info.description));
|
|
104
|
+
console.log(chalk.white('\nFeatures:'));
|
|
105
|
+
info.features.forEach(feature => {
|
|
106
|
+
console.log(chalk.white(` • ${feature}`));
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// Parse command line arguments
|
|
111
|
+
program.parse();
|
|
@@ -4,35 +4,46 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import chalk from 'chalk';
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import { ServiceOrchestrator } from '../../src/service-management/ServiceOrchestrator.js';
|
|
9
|
+
import { StandardOptions } from '../../lib/shared/utils/cli-options.js';
|
|
10
|
+
import { ServiceConfigManager } from '../../lib/shared/utils/service-config-manager.js';
|
|
9
11
|
export function registerAssessCommand(program) {
|
|
10
|
-
const command = program.command('assess [service-path]').description('Run intelligent capability assessment (requires @tamyla/clodo-orchestration)').option('--export <file>', 'Export assessment results to JSON file').option('--domain <domain>', 'Domain name for assessment').option('--service-type <type>', 'Service type for assessment').option('--token <token>', 'Cloudflare API token');
|
|
12
|
+
const command = program.command('assess [service-path]').description('Run intelligent capability assessment (requires @tamyla/clodo-orchestration)').option('--export <file>', 'Export assessment results to JSON file').option('--domain <domain>', 'Domain name for assessment').option('--service-type <type>', 'Service type for assessment').option('--token <token>', 'Cloudflare API token').option('--show-config-sources', 'Display all configuration sources and merged result');
|
|
11
13
|
|
|
12
14
|
// Add standard options (--verbose, --quiet, --json, --no-color, --config-file)
|
|
13
15
|
StandardOptions.define(command).action(async (servicePath, options) => {
|
|
14
16
|
try {
|
|
15
|
-
const output = new (await import('
|
|
16
|
-
const
|
|
17
|
+
const output = new (await import('../../lib/shared/utils/output-formatter.js')).OutputFormatter(options);
|
|
18
|
+
const configManager = new ServiceConfigManager({
|
|
17
19
|
verbose: options.verbose,
|
|
18
20
|
quiet: options.quiet,
|
|
19
|
-
json: options.json
|
|
21
|
+
json: options.json,
|
|
22
|
+
showSources: options.showConfigSources
|
|
20
23
|
});
|
|
24
|
+
const orchestrator = new ServiceOrchestrator();
|
|
25
|
+
const targetPath = servicePath || process.cwd();
|
|
21
26
|
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
// Validate service path with better error handling
|
|
28
|
+
try {
|
|
29
|
+
servicePath = await configManager.validateServicePath(targetPath, orchestrator);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
output.error(error.message);
|
|
32
|
+
if (error.suggestions) {
|
|
33
|
+
output.info('Suggestions:');
|
|
34
|
+
output.list(error.suggestions);
|
|
28
35
|
}
|
|
36
|
+
process.exit(1);
|
|
29
37
|
}
|
|
30
38
|
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
// Load and merge all configurations
|
|
40
|
+
const mergedOptions = await configManager.loadServiceConfig(servicePath, options, {
|
|
41
|
+
export: null,
|
|
42
|
+
domain: null,
|
|
43
|
+
serviceType: null,
|
|
44
|
+
token: null
|
|
45
|
+
});
|
|
46
|
+
let assessment; // Declare here so it's available in the entire scope
|
|
36
47
|
|
|
37
48
|
// Try to load professional orchestration package
|
|
38
49
|
let orchestrationModule;
|
|
@@ -45,8 +56,6 @@ export function registerAssessCommand(program) {
|
|
|
45
56
|
output.info('💡 Using basic assessment capabilities');
|
|
46
57
|
output.info('💡 For advanced assessment: npm install @tamyla/clodo-orchestration');
|
|
47
58
|
}
|
|
48
|
-
let assessment;
|
|
49
|
-
const targetPath = servicePath || process.cwd();
|
|
50
59
|
if (hasEnterprisePackage) {
|
|
51
60
|
output.section('Professional Capability Assessment');
|
|
52
61
|
output.list([`Service Path: ${targetPath}`, mergedOptions.domain ? `Domain: ${mergedOptions.domain}` : null, mergedOptions.serviceType ? `Service Type: ${mergedOptions.serviceType}` : null, 'Enterprise Package: ✅ Available'].filter(Boolean));
|
|
@@ -102,7 +111,7 @@ export function registerAssessCommand(program) {
|
|
|
102
111
|
output.success(`📄 Results exported to: ${mergedOptions.export}`);
|
|
103
112
|
}
|
|
104
113
|
} catch (error) {
|
|
105
|
-
const output = new (await import('
|
|
114
|
+
const output = new (await import('../../lib/shared/utils/output-formatter.js')).OutputFormatter(options || {});
|
|
106
115
|
output.error(`Assessment failed: ${error.message}`);
|
|
107
116
|
if (process.env.DEBUG) {
|
|
108
117
|
output.debug(error.stack);
|
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import chalk from 'chalk';
|
|
9
|
-
import {
|
|
10
|
-
import { StandardOptions } from '
|
|
11
|
-
import { ConfigLoader } from '
|
|
9
|
+
import { Clodo } from '../../src/simple-api.js';
|
|
10
|
+
import { StandardOptions } from '../../lib/shared/utils/cli-options.js';
|
|
11
|
+
import { ConfigLoader } from '../../lib/shared/utils/config-loader.js';
|
|
12
12
|
export function registerCreateCommand(program) {
|
|
13
13
|
const command = program.command('create').description('Create a new Clodo service with conversational setup').option('-n, --non-interactive', 'Run in non-interactive mode with all required parameters').option('--service-name <name>', 'Service name (required in non-interactive mode)').option('--service-type <type>', 'Service type: data-service, auth-service, content-service, api-gateway, generic', 'generic').option('--domain-name <domain>', 'Domain name (required in non-interactive mode)').option('--cloudflare-token <token>', 'Cloudflare API token (required in non-interactive mode)').option('--cloudflare-account-id <id>', 'Cloudflare account ID (required in non-interactive mode)').option('--cloudflare-zone-id <id>', 'Cloudflare zone ID (required in non-interactive mode)').option('--environment <env>', 'Target environment: development, staging, production', 'development').option('--output-path <path>', 'Output directory for generated service', '.').option('--template-path <path>', 'Path to service templates', './templates').option('--force', 'Skip confirmation prompts').option('--validate', 'Validate service after creation');
|
|
14
14
|
|
|
15
15
|
// Add standard options (--verbose, --quiet, --json, --no-color, --config-file)
|
|
16
16
|
StandardOptions.define(command).action(async options => {
|
|
17
17
|
try {
|
|
18
|
-
const output = new (await import('
|
|
18
|
+
const output = new (await import('../../lib/shared/utils/output-formatter.js')).OutputFormatter(options);
|
|
19
19
|
const configLoader = new ConfigLoader({
|
|
20
20
|
verbose: options.verbose,
|
|
21
21
|
quiet: options.quiet,
|
|
@@ -33,40 +33,31 @@ export function registerCreateCommand(program) {
|
|
|
33
33
|
|
|
34
34
|
// Merge config file defaults with CLI options (CLI takes precedence)
|
|
35
35
|
const mergedOptions = configLoader.merge(configFileData, options);
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
|
|
37
|
+
// Use simple API for service creation
|
|
38
|
+
const result = await Clodo.createService({
|
|
39
|
+
name: mergedOptions.serviceName,
|
|
40
|
+
type: mergedOptions.serviceType,
|
|
41
|
+
domain: mergedOptions.domainName,
|
|
42
|
+
environment: mergedOptions.environment,
|
|
38
43
|
outputPath: mergedOptions.outputPath,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const missing = required.filter(key => !mergedOptions[key]);
|
|
45
|
-
if (missing.length > 0) {
|
|
46
|
-
output.error(`Missing required parameters: ${missing.join(', ')}`);
|
|
47
|
-
output.info('Use --help for parameter details');
|
|
48
|
-
process.exit(1);
|
|
44
|
+
interactive: !mergedOptions.nonInteractive,
|
|
45
|
+
credentials: {
|
|
46
|
+
token: mergedOptions.cloudflareToken,
|
|
47
|
+
accountId: mergedOptions.cloudflareAccountId,
|
|
48
|
+
zoneId: mergedOptions.cloudflareZoneId
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
serviceName: mergedOptions.serviceName,
|
|
54
|
-
serviceType: mergedOptions.serviceType,
|
|
55
|
-
domainName: mergedOptions.domainName,
|
|
56
|
-
cloudflareToken: mergedOptions.cloudflareToken,
|
|
57
|
-
cloudflareAccountId: mergedOptions.cloudflareAccountId,
|
|
58
|
-
cloudflareZoneId: mergedOptions.cloudflareZoneId,
|
|
59
|
-
environment: mergedOptions.environment
|
|
60
|
-
};
|
|
61
|
-
await orchestrator.runNonInteractive(coreInputs);
|
|
50
|
+
});
|
|
51
|
+
if (result.success) {
|
|
52
|
+
output.success(result.message);
|
|
62
53
|
} else {
|
|
63
|
-
|
|
54
|
+
output.error('Service creation failed');
|
|
55
|
+
process.exit(1);
|
|
64
56
|
}
|
|
65
|
-
output.success('Service creation completed successfully!');
|
|
66
57
|
output.section('Next steps');
|
|
67
58
|
output.list(['cd into your new service directory', 'Run npm install', 'Configure additional settings in src/config/domains.js', 'Run npm run deploy to deploy to Cloudflare']);
|
|
68
59
|
} catch (error) {
|
|
69
|
-
const output = new (await import('
|
|
60
|
+
const output = new (await import('../../lib/shared/utils/output-formatter.js')).OutputFormatter(options || {});
|
|
70
61
|
output.error(`Service creation failed: ${error.message}`);
|
|
71
62
|
if (error.details) {
|
|
72
63
|
output.warning(`Details: ${error.details}`);
|