@jterrats/smart-deployment 1.2.6 → 1.4.0
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/README.md +69 -1
- package/lib/analysis/metadata-capability-definitions.d.ts +2 -0
- package/lib/analysis/metadata-capability-definitions.js +260 -0
- package/lib/analysis/metadata-capability-definitions.js.map +1 -0
- package/lib/analysis/metadata-capability-registry.d.ts +11 -0
- package/lib/analysis/metadata-capability-registry.js +142 -0
- package/lib/analysis/metadata-capability-registry.js.map +1 -0
- package/lib/analysis/metadata-gap-analysis-service.d.ts +51 -0
- package/lib/analysis/metadata-gap-analysis-service.js +277 -0
- package/lib/analysis/metadata-gap-analysis-service.js.map +1 -0
- package/lib/analysis/project-analysis-service.d.ts +5 -0
- package/lib/analysis/project-analysis-service.js +18 -0
- package/lib/analysis/project-analysis-service.js.map +1 -1
- package/lib/commands/ci/preset.d.ts +25 -0
- package/lib/commands/ci/preset.js +125 -0
- package/lib/commands/ci/preset.js.map +1 -0
- package/lib/commands/ci-publish.d.ts +6 -2
- package/lib/commands/ci-publish.js +23 -8
- package/lib/commands/ci-publish.js.map +1 -1
- package/lib/commands/graph/export.d.ts +20 -0
- package/lib/commands/graph/export.js +107 -0
- package/lib/commands/graph/export.js.map +1 -0
- package/lib/commands/impact.d.ts +18 -0
- package/lib/commands/impact.js +105 -0
- package/lib/commands/impact.js.map +1 -0
- package/lib/commands/init.d.ts +19 -0
- package/lib/commands/init.js +83 -0
- package/lib/commands/init.js.map +1 -0
- package/lib/commands/metadata/gaps.d.ts +15 -0
- package/lib/commands/metadata/gaps.js +84 -0
- package/lib/commands/metadata/gaps.js.map +1 -0
- package/lib/commands/plan/explain.d.ts +14 -0
- package/lib/commands/plan/explain.js +134 -0
- package/lib/commands/plan/explain.js.map +1 -0
- package/lib/commands/resume.d.ts +1 -0
- package/lib/commands/resume.js +19 -4
- package/lib/commands/resume.js.map +1 -1
- package/lib/commands/retrieve.d.ts +20 -0
- package/lib/commands/retrieve.js +111 -0
- package/lib/commands/retrieve.js.map +1 -0
- package/lib/commands/start.d.ts +27 -0
- package/lib/commands/start.js +159 -20
- package/lib/commands/start.js.map +1 -1
- package/lib/commands/status.d.ts +1 -0
- package/lib/commands/status.js +19 -4
- package/lib/commands/status.js.map +1 -1
- package/lib/commands/validate.d.ts +15 -0
- package/lib/commands/validate.js +37 -1
- package/lib/commands/validate.js.map +1 -1
- package/lib/config/init-config-generation-service.d.ts +27 -0
- package/lib/config/init-config-generation-service.js +88 -0
- package/lib/config/init-config-generation-service.js.map +1 -0
- package/lib/config/repo-config.d.ts +25 -0
- package/lib/config/repo-config.js.map +1 -1
- package/lib/constants/deployment-order.js +1 -0
- package/lib/constants/deployment-order.js.map +1 -1
- package/lib/dependencies/impact-analysis-service.d.ts +77 -0
- package/lib/dependencies/impact-analysis-service.js +234 -0
- package/lib/dependencies/impact-analysis-service.js.map +1 -0
- package/lib/deployment/ci-preset-service.d.ts +44 -0
- package/lib/deployment/ci-preset-service.js +65 -0
- package/lib/deployment/ci-preset-service.js.map +1 -0
- package/lib/deployment/commit-scope-service.d.ts +50 -0
- package/lib/deployment/commit-scope-service.js +292 -0
- package/lib/deployment/commit-scope-service.js.map +1 -0
- package/lib/deployment/deployment-context-service.d.ts +3 -0
- package/lib/deployment/deployment-context-service.js +1 -0
- package/lib/deployment/deployment-context-service.js.map +1 -1
- package/lib/deployment/deployment-error-diagnostics.d.ts +11 -0
- package/lib/deployment/deployment-error-diagnostics.js +187 -0
- package/lib/deployment/deployment-error-diagnostics.js.map +1 -0
- package/lib/deployment/deployment-runner.d.ts +1 -0
- package/lib/deployment/deployment-runner.js +37 -16
- package/lib/deployment/deployment-runner.js.map +1 -1
- package/lib/deployment/deployment-status-service.d.ts +10 -2
- package/lib/deployment/deployment-status-service.js +74 -3
- package/lib/deployment/deployment-status-service.js.map +1 -1
- package/lib/deployment/deployment-validation-service.d.ts +5 -0
- package/lib/deployment/deployment-validation-service.js +34 -4
- package/lib/deployment/deployment-validation-service.js.map +1 -1
- package/lib/deployment/plan-explain-service.d.ts +88 -0
- package/lib/deployment/plan-explain-service.js +171 -0
- package/lib/deployment/plan-explain-service.js.map +1 -0
- package/lib/deployment/resume-deployment-service.d.ts +7 -2
- package/lib/deployment/resume-deployment-service.js +24 -3
- package/lib/deployment/resume-deployment-service.js.map +1 -1
- package/lib/deployment/retrieve-forceignore-service.d.ts +51 -0
- package/lib/deployment/retrieve-forceignore-service.js +139 -0
- package/lib/deployment/retrieve-forceignore-service.js.map +1 -0
- package/lib/deployment/rollback-planning-service.d.ts +49 -0
- package/lib/deployment/rollback-planning-service.js +178 -0
- package/lib/deployment/rollback-planning-service.js.map +1 -0
- package/lib/deployment/sf-cli-integration.d.ts +7 -0
- package/lib/deployment/sf-cli-integration.js +35 -3
- package/lib/deployment/sf-cli-integration.js.map +1 -1
- package/lib/deployment/special-deployment-plan.js +36 -49
- package/lib/deployment/special-deployment-plan.js.map +1 -1
- package/lib/deployment/start-execution-service.d.ts +1 -0
- package/lib/deployment/start-execution-service.js +14 -8
- package/lib/deployment/start-execution-service.js.map +1 -1
- package/lib/deployment/wave-manifest-service.d.ts +8 -0
- package/lib/deployment/wave-manifest-service.js +39 -20
- package/lib/deployment/wave-manifest-service.js.map +1 -1
- package/lib/presentation/plan-explain-presenter.d.ts +9 -0
- package/lib/presentation/plan-explain-presenter.js +40 -0
- package/lib/presentation/plan-explain-presenter.js.map +1 -0
- package/lib/presentation/release-report-presenter.d.ts +10 -0
- package/lib/presentation/release-report-presenter.js +35 -0
- package/lib/presentation/release-report-presenter.js.map +1 -0
- package/lib/presentation/start-command-presenter.d.ts +4 -0
- package/lib/presentation/start-command-presenter.js +4 -0
- package/lib/presentation/start-command-presenter.js.map +1 -1
- package/lib/presentation/validate-command-presenter.js +13 -0
- package/lib/presentation/validate-command-presenter.js.map +1 -1
- package/lib/reports/deployment-plan-report-service.d.ts +76 -0
- package/lib/reports/deployment-plan-report-service.js +234 -0
- package/lib/reports/deployment-plan-report-service.js.map +1 -0
- package/lib/reports/graph-export-service.d.ts +85 -0
- package/lib/reports/graph-export-service.js +296 -0
- package/lib/reports/graph-export-service.js.map +1 -0
- package/lib/reports/release-report-builder.d.ts +6 -0
- package/lib/reports/release-report-builder.js +115 -0
- package/lib/reports/release-report-builder.js.map +1 -0
- package/lib/reports/release-report-command-adapter.d.ts +14 -0
- package/lib/reports/release-report-command-adapter.js +28 -0
- package/lib/reports/release-report-command-adapter.js.map +1 -0
- package/lib/reports/release-report-facts-factory.d.ts +14 -0
- package/lib/reports/release-report-facts-factory.js +140 -0
- package/lib/reports/release-report-facts-factory.js.map +1 -0
- package/lib/reports/release-report-sanitizer.d.ts +5 -0
- package/lib/reports/release-report-sanitizer.js +120 -0
- package/lib/reports/release-report-sanitizer.js.map +1 -0
- package/lib/reports/release-report-service.d.ts +43 -0
- package/lib/reports/release-report-service.js +80 -0
- package/lib/reports/release-report-service.js.map +1 -0
- package/lib/reports/release-report-store.d.ts +30 -0
- package/lib/reports/release-report-store.js +57 -0
- package/lib/reports/release-report-store.js.map +1 -0
- package/lib/reports/start-release-report-coordinator.d.ts +15 -0
- package/lib/reports/start-release-report-coordinator.js +23 -0
- package/lib/reports/start-release-report-coordinator.js.map +1 -0
- package/lib/services/metadata-scanner-service.js +14 -2
- package/lib/services/metadata-scanner-service.js.map +1 -1
- package/lib/services/scanners/automation-ai-metadata-scanner.d.ts +3 -1
- package/lib/services/scanners/automation-ai-metadata-scanner.js +87 -0
- package/lib/services/scanners/automation-ai-metadata-scanner.js.map +1 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -1
- package/lib/types/metadata-capability.d.ts +39 -0
- package/lib/types/metadata-capability.js +2 -0
- package/lib/types/metadata-capability.js.map +1 -0
- package/lib/types/metadata.d.ts +7 -1
- package/lib/types/release-report.d.ts +89 -0
- package/lib/types/release-report.js +42 -0
- package/lib/types/release-report.js.map +1 -0
- package/messages/ci.preset.json +22 -0
- package/messages/graph.export.json +20 -0
- package/messages/impact.json +18 -0
- package/messages/init.json +16 -0
- package/messages/metadata.gaps.json +12 -0
- package/messages/plan.explain.json +20 -0
- package/messages/resume.json +1 -0
- package/messages/retrieve.json +26 -0
- package/messages/start.json +18 -2
- package/messages/status.json +1 -0
- package/messages/validate.json +5 -1
- package/npm-shrinkwrap.json +436 -945
- package/oclif.lock +446 -746
- package/oclif.manifest.json +975 -116
- package/package.json +26 -21
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { SpecialDeploymentPlanExecutor } from '../deployment/special-deployment-executor.js';
|
|
2
|
+
import { SpecialDeploymentPlanExecutor, } from '../deployment/special-deployment-executor.js';
|
|
3
3
|
import { SpecialDeploymentPlanService } from '../deployment/special-deployment-plan.js';
|
|
4
|
+
import { ReleaseReportCommandAdapter, } from '../reports/release-report-command-adapter.js';
|
|
5
|
+
import { buildCiPublishReportFacts } from '../reports/release-report-facts-factory.js';
|
|
4
6
|
import { getLogger } from '../utils/logger.js';
|
|
5
7
|
const logger = getLogger('CiPublishCommand');
|
|
8
|
+
const releaseReportAdapter = new ReleaseReportCommandAdapter();
|
|
6
9
|
export default class CiPublish extends SfCommand {
|
|
7
10
|
static aliases = ['smart-deployment ci-publish'];
|
|
8
11
|
static summary = 'Build a coordinated metadata, Agentforce, LWR, and OmniStudio publish plan for CI.';
|
|
@@ -47,22 +50,34 @@ export default class CiPublish extends SfCommand {
|
|
|
47
50
|
autoActivate,
|
|
48
51
|
});
|
|
49
52
|
this.reportPlan(plan);
|
|
53
|
+
let execution;
|
|
54
|
+
let resultPlan = plan;
|
|
55
|
+
let executionFailure;
|
|
50
56
|
if (!dryRun) {
|
|
51
|
-
|
|
57
|
+
execution = await new SpecialDeploymentPlanExecutor().execute(plan);
|
|
52
58
|
if (!execution.success) {
|
|
53
59
|
const message = execution.errors[0] ?? 'Coordinated publish failed.';
|
|
54
|
-
|
|
60
|
+
executionFailure = message;
|
|
61
|
+
resultPlan = {
|
|
55
62
|
...plan,
|
|
56
63
|
success: false,
|
|
57
64
|
errors: [...plan.errors, message],
|
|
58
65
|
};
|
|
59
66
|
this.reportExecutionFailure(execution.failedPhase, execution.exitCode, message);
|
|
60
|
-
return failedPlan;
|
|
61
67
|
}
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
else {
|
|
69
|
+
this.log('');
|
|
70
|
+
this.log('Coordinated publish execution completed successfully.');
|
|
71
|
+
}
|
|
64
72
|
}
|
|
65
|
-
|
|
73
|
+
const result = await this.finalizeReleaseReport(resultPlan, execution);
|
|
74
|
+
if (executionFailure)
|
|
75
|
+
this.error(executionFailure);
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
async finalizeReleaseReport(plan, execution) {
|
|
79
|
+
const releaseReport = await releaseReportAdapter.finalize(this, { kind: 'succeeded', value: plan }, buildCiPublishReportFacts(plan, execution), { projectRoot: plan.projectRoot });
|
|
80
|
+
return { ...plan, ...releaseReport };
|
|
66
81
|
}
|
|
67
82
|
reportPlan(plan) {
|
|
68
83
|
this.log('Coordinated publish plan');
|
|
@@ -93,7 +108,7 @@ export default class CiPublish extends SfCommand {
|
|
|
93
108
|
}
|
|
94
109
|
reportExecutionFailure(failedPhase, exitCode, message) {
|
|
95
110
|
this.log('');
|
|
96
|
-
this.
|
|
111
|
+
this.warn(`Coordinated publish failed in phase ${failedPhase ?? 'unknown'} with exit code ${exitCode ?? 'unknown'}: ${message}`);
|
|
97
112
|
}
|
|
98
113
|
}
|
|
99
114
|
//# sourceMappingURL=ci-publish.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-publish.js","sourceRoot":"","sources":["../../src/commands/ci-publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"ci-publish.js","sourceRoot":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AE,OAAe;QAC3G,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACb,IAAI,CAAC,IAAI,CACP,uCAAuC,WAAW,IAAI,SAAS,mBAC7D,QAAQ,IAAI,SACd,KAAK,OAAO,EAAE,CACf,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type GraphExportResult } from '../../reports/graph-export-service.js';
|
|
3
|
+
export default class GraphExport extends SfCommand<GraphExportResult> {
|
|
4
|
+
static readonly aliases: string[];
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
'source-path': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'report-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'use-ai': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'org-type': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
industry: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<GraphExportResult>;
|
|
18
|
+
private reportResult;
|
|
19
|
+
private withJsonConsoleSuppressed;
|
|
20
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Messages } from '@salesforce/core';
|
|
2
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { DeploymentContextService } from '../../deployment/deployment-context-service.js';
|
|
4
|
+
import { GraphExportService, } from '../../reports/graph-export-service.js';
|
|
5
|
+
import { getLogger } from '../../utils/logger.js';
|
|
6
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
7
|
+
const messages = Messages.loadMessages('@jterrats/smart-deployment', 'graph.export');
|
|
8
|
+
const logger = getLogger('GraphExportCommand');
|
|
9
|
+
const contextService = new DeploymentContextService();
|
|
10
|
+
const exportService = new GraphExportService();
|
|
11
|
+
export default class GraphExport extends SfCommand {
|
|
12
|
+
static aliases = ['smart-deployment graph export'];
|
|
13
|
+
static summary = messages.getMessage('summary');
|
|
14
|
+
static description = messages.getMessage('description');
|
|
15
|
+
static examples = messages.getMessages('examples');
|
|
16
|
+
static flags = {
|
|
17
|
+
'source-path': Flags.string({
|
|
18
|
+
summary: messages.getMessage('flags.source-path.summary'),
|
|
19
|
+
description: messages.getMessage('flags.source-path.description'),
|
|
20
|
+
}),
|
|
21
|
+
'report-dir': Flags.string({
|
|
22
|
+
summary: messages.getMessage('flags.report-dir.summary'),
|
|
23
|
+
description: messages.getMessage('flags.report-dir.description'),
|
|
24
|
+
}),
|
|
25
|
+
output: Flags.string({
|
|
26
|
+
summary: messages.getMessage('flags.output.summary'),
|
|
27
|
+
description: messages.getMessage('flags.output.description'),
|
|
28
|
+
}),
|
|
29
|
+
format: Flags.string({
|
|
30
|
+
summary: messages.getMessage('flags.format.summary'),
|
|
31
|
+
description: messages.getMessage('flags.format.description'),
|
|
32
|
+
options: ['mermaid', 'dot', 'json', 'html'],
|
|
33
|
+
default: 'json',
|
|
34
|
+
char: 'f',
|
|
35
|
+
}),
|
|
36
|
+
'use-ai': Flags.boolean({
|
|
37
|
+
summary: messages.getMessage('flags.use-ai.summary'),
|
|
38
|
+
default: false,
|
|
39
|
+
}),
|
|
40
|
+
'org-type': Flags.string({
|
|
41
|
+
summary: messages.getMessage('flags.org-type.summary'),
|
|
42
|
+
options: ['Production', 'Sandbox', 'Developer'],
|
|
43
|
+
}),
|
|
44
|
+
industry: Flags.string({
|
|
45
|
+
summary: messages.getMessage('flags.industry.summary'),
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
async run() {
|
|
49
|
+
const { flags } = await this.parse(GraphExport);
|
|
50
|
+
const sourcePath = typeof flags['source-path'] === 'string' ? flags['source-path'] : undefined;
|
|
51
|
+
const format = flags.format;
|
|
52
|
+
try {
|
|
53
|
+
const result = await this.withJsonConsoleSuppressed(async () => {
|
|
54
|
+
logger.info('Exporting dependency graph', { sourcePath, format });
|
|
55
|
+
const context = await contextService.buildContext({
|
|
56
|
+
sourcePath,
|
|
57
|
+
useAI: flags['use-ai'] === true,
|
|
58
|
+
orgType: typeof flags['org-type'] === 'string' ? flags['org-type'] : undefined,
|
|
59
|
+
industry: typeof flags.industry === 'string' ? flags.industry : undefined,
|
|
60
|
+
});
|
|
61
|
+
return exportService.generate(context, {
|
|
62
|
+
format,
|
|
63
|
+
outputPath: typeof flags.output === 'string' ? flags.output : undefined,
|
|
64
|
+
reportDir: typeof flags['report-dir'] === 'string' ? flags['report-dir'] : undefined,
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
if (!this.jsonEnabled())
|
|
68
|
+
this.reportResult(result);
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
logger.error('Graph export failed', { error });
|
|
73
|
+
this.error(`Graph export failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
reportResult(result) {
|
|
77
|
+
this.log('Graph export complete');
|
|
78
|
+
this.log(`Format: ${result.format}`);
|
|
79
|
+
this.log(`Output: ${result.path}`);
|
|
80
|
+
this.log(`Components: ${result.report.summary.components}`);
|
|
81
|
+
this.log(`Dependency edges: ${result.report.summary.dependencyEdges}`);
|
|
82
|
+
this.log(`Waves: ${result.report.summary.waves}`);
|
|
83
|
+
this.log(`Cycles: ${result.report.summary.cycles}`);
|
|
84
|
+
}
|
|
85
|
+
async withJsonConsoleSuppressed(operation) {
|
|
86
|
+
if (!this.jsonEnabled())
|
|
87
|
+
return operation();
|
|
88
|
+
// eslint-disable-next-line no-console
|
|
89
|
+
const originalLog = console.log;
|
|
90
|
+
// eslint-disable-next-line no-console
|
|
91
|
+
const originalWarn = console.warn;
|
|
92
|
+
try {
|
|
93
|
+
// eslint-disable-next-line no-console
|
|
94
|
+
console.log = () => { };
|
|
95
|
+
// eslint-disable-next-line no-console
|
|
96
|
+
console.warn = () => { };
|
|
97
|
+
return await operation();
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
// eslint-disable-next-line no-console
|
|
101
|
+
console.log = originalLog;
|
|
102
|
+
// eslint-disable-next-line no-console
|
|
103
|
+
console.warn = originalWarn;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../src/commands/graph/export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EACL,kBAAkB,GAGnB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAC;AACrF,MAAM,MAAM,GAAG,SAAS,CAAC,oBAAoB,CAAC,CAAC;AAC/C,MAAM,cAAc,GAAG,IAAI,wBAAwB,EAAE,CAAC;AACtD,MAAM,aAAa,GAAG,IAAI,kBA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AM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACtD,CAAC;IAEO,KAAK,CAAC,yBAAyB,CAAI,SAA2B;QACpE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YAAE,OAAO,SAAS,EAAE,CAAC;QAC5C,sCAAsC;QACtC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC;QAChC,sCAAsC;QACtC,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC;YACH,sCAAsC;YACtC,OAAO,CAAC,GAAG,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC;YAC7B,sCAAsC;YACtC,OAAO,CAAC,IAAI,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC;YAC9B,OAAO,MAAM,SAAS,EAAE,CAAC;QAC3B,CAAC;gBAAS,CAAC;YACT,sCAAsC;YACtC,OAAO,CAAC,GAAG,GAAG,WAAW,CAAC;YAC1B,sCAAsC;YACtC,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC;QAC9B,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type ImpactCommandResult } from '../dependencies/impact-analysis-service.js';
|
|
3
|
+
export default class Impact extends SfCommand<ImpactCommandResult> {
|
|
4
|
+
static readonly aliases: string[];
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
'source-path': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
base: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
head: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'working-tree': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'max-depth': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<ImpactCommandResult>;
|
|
16
|
+
private withJsonConsoleSuppressed;
|
|
17
|
+
private reportResult;
|
|
18
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Messages } from '@salesforce/core';
|
|
2
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { ImpactAnalysisService } from '../dependencies/impact-analysis-service.js';
|
|
4
|
+
import { getLogger } from '../utils/logger.js';
|
|
5
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
6
|
+
const messages = Messages.loadMessages('@jterrats/smart-deployment', 'impact');
|
|
7
|
+
const logger = getLogger('ImpactCommand');
|
|
8
|
+
const impactAnalysisService = new ImpactAnalysisService();
|
|
9
|
+
export default class Impact extends SfCommand {
|
|
10
|
+
static aliases = ['smart-deployment impact'];
|
|
11
|
+
static summary = messages.getMessage('summary');
|
|
12
|
+
static description = messages.getMessage('description');
|
|
13
|
+
static examples = messages.getMessages('examples');
|
|
14
|
+
static flags = {
|
|
15
|
+
'source-path': Flags.string({
|
|
16
|
+
summary: messages.getMessage('flags.source-path.summary'),
|
|
17
|
+
description: messages.getMessage('flags.source-path.description'),
|
|
18
|
+
}),
|
|
19
|
+
base: Flags.string({
|
|
20
|
+
summary: messages.getMessage('flags.base.summary'),
|
|
21
|
+
description: messages.getMessage('flags.base.description'),
|
|
22
|
+
}),
|
|
23
|
+
head: Flags.string({
|
|
24
|
+
summary: messages.getMessage('flags.head.summary'),
|
|
25
|
+
description: messages.getMessage('flags.head.description'),
|
|
26
|
+
}),
|
|
27
|
+
'working-tree': Flags.boolean({
|
|
28
|
+
summary: messages.getMessage('flags.working-tree.summary'),
|
|
29
|
+
description: messages.getMessage('flags.working-tree.description'),
|
|
30
|
+
default: false,
|
|
31
|
+
}),
|
|
32
|
+
'max-depth': Flags.integer({
|
|
33
|
+
summary: messages.getMessage('flags.max-depth.summary'),
|
|
34
|
+
description: messages.getMessage('flags.max-depth.description'),
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
async run() {
|
|
38
|
+
const { flags } = await this.parse(Impact);
|
|
39
|
+
try {
|
|
40
|
+
const result = await this.withJsonConsoleSuppressed(async () => impactAnalysisService.analyze({
|
|
41
|
+
sourcePath: typeof flags['source-path'] === 'string' ? flags['source-path'] : undefined,
|
|
42
|
+
base: typeof flags.base === 'string' ? flags.base : undefined,
|
|
43
|
+
head: typeof flags.head === 'string' ? flags.head : undefined,
|
|
44
|
+
workingTree: flags['working-tree'] === true,
|
|
45
|
+
maxDepth: typeof flags['max-depth'] === 'number' ? flags['max-depth'] : undefined,
|
|
46
|
+
}));
|
|
47
|
+
if (!this.jsonEnabled()) {
|
|
48
|
+
this.reportResult(result);
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
logger.error('Impact analysis failed', { error });
|
|
54
|
+
this.error(`Impact analysis failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async withJsonConsoleSuppressed(operation) {
|
|
58
|
+
if (!this.jsonEnabled()) {
|
|
59
|
+
return operation();
|
|
60
|
+
}
|
|
61
|
+
// eslint-disable-next-line no-console
|
|
62
|
+
const originalLog = console.log;
|
|
63
|
+
// eslint-disable-next-line no-console
|
|
64
|
+
const originalWarn = console.warn;
|
|
65
|
+
try {
|
|
66
|
+
// eslint-disable-next-line no-console
|
|
67
|
+
console.log = () => { };
|
|
68
|
+
// eslint-disable-next-line no-console
|
|
69
|
+
console.warn = () => { };
|
|
70
|
+
return await operation();
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
// eslint-disable-next-line no-console
|
|
74
|
+
console.log = originalLog;
|
|
75
|
+
// eslint-disable-next-line no-console
|
|
76
|
+
console.warn = originalWarn;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
reportResult(result) {
|
|
80
|
+
this.log('Smart deployment impact');
|
|
81
|
+
this.log(`Mode: ${result.mode}`);
|
|
82
|
+
if (result.base && result.head) {
|
|
83
|
+
this.log(`Range: ${result.base}..${result.head}`);
|
|
84
|
+
}
|
|
85
|
+
this.log(`Changed components: ${result.summary.changedComponentCount}`);
|
|
86
|
+
this.log(`Transitive dependents: ${result.summary.transitiveDependentCount}`);
|
|
87
|
+
this.log(`Affected components: ${result.summary.affectedComponentCount}`);
|
|
88
|
+
this.log(`Planned waves: ${result.summary.plannedWaveCount}`);
|
|
89
|
+
this.log(`Suggested Apex tests: ${result.summary.suggestedApexTestCount}`);
|
|
90
|
+
this.log(`Impact level: ${result.summary.overallImpactLevel}`);
|
|
91
|
+
if (result.plannedWaves.length > 0) {
|
|
92
|
+
this.log('');
|
|
93
|
+
this.log('Planned waves');
|
|
94
|
+
for (const wave of result.plannedWaves) {
|
|
95
|
+
this.log(`Wave ${wave.number}: ${wave.components.join(', ')}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const tests = [...result.suggestedApexTests.requiredTests, ...result.suggestedApexTests.recommendedTests];
|
|
99
|
+
if (tests.length > 0) {
|
|
100
|
+
this.log('');
|
|
101
|
+
this.log(`Suggested tests: ${tests.join(', ')}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=impact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impact.js","sourceRoot":"","sources":["../../src/commands/impact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,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rB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,oBAAoB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnD,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type InitConfigGenerationResult } from '../config/init-config-generation-service.js';
|
|
3
|
+
export default class Init extends SfCommand<InitConfigGenerationResult> {
|
|
4
|
+
static readonly aliases: string[];
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
'source-path': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'cache-enabled': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
'validation-mode': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'report-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'skip-tests': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
'non-interactive': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<InitConfigGenerationResult>;
|
|
18
|
+
private reportResult;
|
|
19
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Messages } from '@salesforce/core';
|
|
2
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { InitConfigGenerationService, } from '../config/init-config-generation-service.js';
|
|
4
|
+
import { getLogger } from '../utils/logger.js';
|
|
5
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
6
|
+
const messages = Messages.loadMessages('@jterrats/smart-deployment', 'init');
|
|
7
|
+
const logger = getLogger('InitCommand');
|
|
8
|
+
const initConfigGenerationService = new InitConfigGenerationService();
|
|
9
|
+
export default class Init extends SfCommand {
|
|
10
|
+
static aliases = ['smart-deployment init'];
|
|
11
|
+
static summary = messages.getMessage('summary');
|
|
12
|
+
static description = messages.getMessage('description');
|
|
13
|
+
static examples = messages.getMessages('examples');
|
|
14
|
+
static flags = {
|
|
15
|
+
'source-path': Flags.directory({
|
|
16
|
+
summary: messages.getMessage('flags.source-path.summary'),
|
|
17
|
+
exists: true,
|
|
18
|
+
}),
|
|
19
|
+
force: Flags.boolean({
|
|
20
|
+
summary: messages.getMessage('flags.force.summary'),
|
|
21
|
+
char: 'f',
|
|
22
|
+
default: false,
|
|
23
|
+
}),
|
|
24
|
+
'cache-enabled': Flags.boolean({
|
|
25
|
+
summary: messages.getMessage('flags.cache-enabled.summary'),
|
|
26
|
+
default: true,
|
|
27
|
+
allowNo: true,
|
|
28
|
+
}),
|
|
29
|
+
'validation-mode': Flags.string({
|
|
30
|
+
summary: messages.getMessage('flags.validation-mode.summary'),
|
|
31
|
+
options: ['strict', 'warn-only', 'local-only'],
|
|
32
|
+
default: 'strict',
|
|
33
|
+
}),
|
|
34
|
+
'report-dir': Flags.string({
|
|
35
|
+
summary: messages.getMessage('flags.report-dir.summary'),
|
|
36
|
+
}),
|
|
37
|
+
'skip-tests': Flags.boolean({
|
|
38
|
+
summary: messages.getMessage('flags.skip-tests.summary'),
|
|
39
|
+
default: false,
|
|
40
|
+
}),
|
|
41
|
+
'non-interactive': Flags.boolean({
|
|
42
|
+
summary: messages.getMessage('flags.non-interactive.summary'),
|
|
43
|
+
default: false,
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
async run() {
|
|
47
|
+
const { flags } = await this.parse(Init);
|
|
48
|
+
try {
|
|
49
|
+
const result = await initConfigGenerationService.generate({
|
|
50
|
+
startPath: flags['source-path'],
|
|
51
|
+
force: flags.force,
|
|
52
|
+
cacheEnabled: flags['cache-enabled'],
|
|
53
|
+
validationMode: flags['validation-mode'],
|
|
54
|
+
reportDir: flags['report-dir'],
|
|
55
|
+
skipTests: flags['skip-tests'],
|
|
56
|
+
});
|
|
57
|
+
this.reportResult(result);
|
|
58
|
+
logger.info('Smart Deployment config initialized', {
|
|
59
|
+
configPath: result.configPath,
|
|
60
|
+
projectRoot: result.projectRoot,
|
|
61
|
+
sourcePath: result.sourcePath,
|
|
62
|
+
overwritten: result.overwritten,
|
|
63
|
+
nonInteractive: flags['non-interactive'],
|
|
64
|
+
});
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
logger.error('Smart Deployment init failed', { error });
|
|
69
|
+
this.error('Init failed: ' + (error instanceof Error ? error.message : String(error)));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
reportResult(result) {
|
|
73
|
+
this.log(result.overwritten ? 'Smart Deployment config overwritten' : 'Smart Deployment config created');
|
|
74
|
+
this.log('Config: ' + result.configPath);
|
|
75
|
+
this.log('Project root: ' + result.projectRoot);
|
|
76
|
+
this.log('Source path: ' + result.sourcePath);
|
|
77
|
+
this.log('Packages: ' + result.packageDirectories.length);
|
|
78
|
+
for (const warning of result.warnings) {
|
|
79
|
+
this.warn(warning);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,2BAA2B,GAG5B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,QAAQ,CAA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ChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YACxD,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;IAEO,YAAY,CAAC,MAAkC;QACrD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,qCAAqC,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC;QACzG,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;QAChD,IAAI,CAAC,GAAG,CAAC,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;QAC9C,IAAI,CAAC,GAAG,CAAC,YAAY,GAAG,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAE1D,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACtC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type MetadataGapAnalysisResult } from '../../analysis/metadata-gap-analysis-service.js';
|
|
3
|
+
export default class MetadataGaps extends SfCommand<MetadataGapAnalysisResult> {
|
|
4
|
+
static readonly aliases: string[];
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
'source-path': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'ai-explain': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<MetadataGapAnalysisResult>;
|
|
13
|
+
private withJsonConsoleSuppressed;
|
|
14
|
+
private reportResult;
|
|
15
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Messages } from '@salesforce/core';
|
|
2
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { MetadataGapAnalysisService, } from '../../analysis/metadata-gap-analysis-service.js';
|
|
4
|
+
import { getLogger } from '../../utils/logger.js';
|
|
5
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
6
|
+
const messages = Messages.loadMessages('@jterrats/smart-deployment', 'metadata.gaps');
|
|
7
|
+
const logger = getLogger('MetadataGapsCommand');
|
|
8
|
+
const metadataGapAnalysisService = new MetadataGapAnalysisService();
|
|
9
|
+
export default class MetadataGaps extends SfCommand {
|
|
10
|
+
static aliases = ['smart-deployment metadata gaps'];
|
|
11
|
+
static summary = messages.getMessage('summary');
|
|
12
|
+
static description = messages.getMessage('description');
|
|
13
|
+
static examples = messages.getMessages('examples');
|
|
14
|
+
static flags = {
|
|
15
|
+
'source-path': Flags.string({
|
|
16
|
+
summary: messages.getMessage('flags.source-path.summary'),
|
|
17
|
+
description: messages.getMessage('flags.source-path.description'),
|
|
18
|
+
}),
|
|
19
|
+
'ai-explain': Flags.boolean({
|
|
20
|
+
summary: messages.getMessage('flags.ai-explain.summary'),
|
|
21
|
+
description: messages.getMessage('flags.ai-explain.description'),
|
|
22
|
+
default: false,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
const { flags } = await this.parse(MetadataGaps);
|
|
27
|
+
try {
|
|
28
|
+
const result = await this.withJsonConsoleSuppressed(async () => metadataGapAnalysisService.analyze({
|
|
29
|
+
sourcePath: typeof flags['source-path'] === 'string' ? flags['source-path'] : undefined,
|
|
30
|
+
aiExplain: flags['ai-explain'] === true,
|
|
31
|
+
}));
|
|
32
|
+
if (!this.jsonEnabled()) {
|
|
33
|
+
this.reportResult(result);
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
logger.error('Metadata gap analysis failed', { error });
|
|
39
|
+
this.error(`Metadata gap analysis failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async withJsonConsoleSuppressed(operation) {
|
|
43
|
+
if (!this.jsonEnabled()) {
|
|
44
|
+
return operation();
|
|
45
|
+
}
|
|
46
|
+
// eslint-disable-next-line no-console
|
|
47
|
+
const originalLog = console.log;
|
|
48
|
+
// eslint-disable-next-line no-console
|
|
49
|
+
const originalWarn = console.warn;
|
|
50
|
+
try {
|
|
51
|
+
// eslint-disable-next-line no-console
|
|
52
|
+
console.log = () => { };
|
|
53
|
+
// eslint-disable-next-line no-console
|
|
54
|
+
console.warn = () => { };
|
|
55
|
+
return await operation();
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
// eslint-disable-next-line no-console
|
|
59
|
+
console.log = originalLog;
|
|
60
|
+
// eslint-disable-next-line no-console
|
|
61
|
+
console.warn = originalWarn;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
reportResult(result) {
|
|
65
|
+
this.log('Smart deployment metadata gaps');
|
|
66
|
+
this.log(`Analysis mode: ${result.analysisMode}`);
|
|
67
|
+
this.log(`Detected metadata types: ${result.summary.detectedTypeCount}`);
|
|
68
|
+
this.log(`Supported metadata types: ${result.summary.supportedTypeCount}`);
|
|
69
|
+
this.log(`Gaps: ${result.summary.gapCount}`);
|
|
70
|
+
this.log(`Human review required: ${result.summary.humanReviewCount}`);
|
|
71
|
+
if (result.gaps.length > 0) {
|
|
72
|
+
this.log('');
|
|
73
|
+
this.log('Unsupported or incomplete metadata support');
|
|
74
|
+
for (const gap of result.gaps) {
|
|
75
|
+
this.log(`- ${gap.metadataType}: ${gap.classification} (${gap.supportStatus})`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (result.aiContext) {
|
|
79
|
+
this.log('');
|
|
80
|
+
this.log(`AI workflow context: ${result.aiContext.recommendedCommand}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=gaps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaps.js","sourceRoot":"","sources":["../../../src/commands/metadata/gaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,0BAA0B,GAE3B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC;AACtF,MAAM,MAAM,GAAG,SAAS,CAAC,qBAAqB,CAAC,CAAC;AAChD,MAAM,0BAA0B,GAAG,IAAI,0BAA0B,EAAE,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,SAAoC;IACrE,MAAM,CAAU,OAAO,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC7D,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,KAAK,G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I,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;YACvD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC,cAAc,KAAK,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC;YAClF,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,wBAAwB,MAAM,CAAC,SAAS,CAAC,kBAAkB,EAAE,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Interfaces } from '@oclif/core';
|
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { type PlanExplainResult } from '../../deployment/plan-explain-service.js';
|
|
4
|
+
export default class PlanExplain extends SfCommand<PlanExplainResult> {
|
|
5
|
+
static readonly aliases: string[];
|
|
6
|
+
static readonly summary: string;
|
|
7
|
+
static readonly description: string;
|
|
8
|
+
static readonly examples: string[];
|
|
9
|
+
static readonly flags: Interfaces.FlagInput;
|
|
10
|
+
run(): Promise<PlanExplainResult>;
|
|
11
|
+
private getCommitScopeOptions;
|
|
12
|
+
private getTargetOrgIdentifier;
|
|
13
|
+
private withJsonConsoleSuppressed;
|
|
14
|
+
}
|