# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.10.0] - 2026-07-30

### Changed
- Changed `rccml deploy` to use a richer live progress tracker in interactive terminals, showing current CML, phase, completion counts, and retry state without scrolling every phase update.
- Changed CI and non-interactive deploy output to concise stable event lines: one `START` line per CML, retry warnings when needed, and a final `PASS` or `FAIL` line per CML.
- Changed deploy internals so low-level helper operations no longer print standalone step chatter, keeping the in-flight output cleaner while preserving the existing final summary tables.

## [1.9.0] - 2026-07-30

### Fixed
- Fixed package installation overhead by removing the accidental self-package dependency and install hook.
- Fixed published package size by removing unnecessary runtime dependencies and excluding compiled test files from the npm tarball.

## [1.8.0] - 2026-07-30

### Added
- Added a concise deploy summary with per-CML success and failure reporting, including failed phase, retry count, and actionable failure guidance.
- Added `.rccml/last-deploy-failures.txt` output so failed CML API names can be rerun directly with the existing `--manifest` option.
- Added `rccml update` as a first-class command to install the latest published CLI version.

### Changed
- Changed deploy progress output to show phase-based status updates during long manifest deployments while keeping CI and non-interactive output deterministic.
- Changed newer-version warnings to recommend `rccml update` instead of printing the full global npm install command.
- Changed telemetry consent to run on first interactive CLI use instead of during package installation.

### Fixed
- Fixed noisy deploy failure reporting by normalizing repeated Salesforce CLI transport errors into concise retryable reasons instead of printing large raw nested error payloads.
- Fixed transient Salesforce connectivity failures such as `UND_ERR_CONNECT_TIMEOUT` to retry with exponential backoff before a CML is marked failed.
- Fixed package installation overhead by removing the accidental self-package dependency and install hook.
- Fixed published package size by removing unnecessary runtime dependencies and excluding compiled test files from the npm tarball.

## [1.6.0] - 2026-07-10

### Fixed
- Added deploy preflight validation for required local CML package files and conditional dependency files so missing sources are reported before deployment starts.
- Improved deploy failure diagnostics to call out specific reasons such as missing local files, unmapped target dependencies by external ID, and unmatched `ProductRelatedComponent` mappings.
- Fixed deploy result reporting to fail the command when any requested CML fails, ensuring a non-zero exit code for CI/CD pipelines.

### Added
- Added `--manifest <path>` support for `deploy` and `retrieve` using `.txt` manifest files with one CML API name per line.
- Added deploy fail-fast validation for `--name`/`--manifest` inputs to ensure each requested API name exists locally under `cml/<ApiName>/`, returning a non-zero exit code when missing.

## [1.5.4] - 2026-07-09

### Fixed
- Fixed Windows bulk delete failures by explicitly passing `--line-ending LF` to Salesforce CLI delete jobs.

## [1.5.3]
- Skipped due to a pipeline issue.

## [1.5.2] - 2026-07-09

### Fixed
- Fixed Windows deployment failures for large CMLs where generated Salesforce CLI `IN (...)` queries could exceed command-line length limits.
- Updated deploy dependency resolution to split large `IN`-clause lookups into smaller batched queries for `Product2`, `ProductClassification`, `ProductComponentGroup`, and `ProductRelatedComponent`.

## [1.5.1] - 2026-07-09

### Fixed
- Fixed Windows retrieval failures for large CMLs where Salesforce CLI commands exceeded the Windows command-line length limit (`The command line is too long`).
- Updated dependency retrieval to split large `Id IN (...)` SOQL queries into smaller chunks for `Product2`, `ProductClassification`, `ProductRelatedComponent`, and `ProductComponentGroup`, while preserving output file structure.

## [1.5.0] - 2026-07-07

### Changed
- Changed newer version checks for major, minor, and patch releases to warn instead of blocking execution, improving CI/CD integration by avoiding forced interactive updates.
- Changed analytics consent wording to a generic usage analytics message and made `Do Not Allow` persist telemetry-disabled mode without blocking installation or CLI usage.
- Hardened Aptabase telemetry delivery to always fail open (timeouts, transport failures, and non-2xx/overage responses are ignored) so command execution is never blocked.
- Reworked command telemetry flow to run consistently for `list`, `retrieve`, and `deploy`, using `process.exitCode` instead of early `process.exit(1)` so best-effort telemetry can complete.
- Updated analytics identity fields to group by `org_id` with deterministic `user_hash` (SHA-256 of `orgId:username`) and removed raw user/company identifiers from telemetry payloads.
- Added sanitized error analytics events for user-visible failures, including command/error metadata and per-CML failure context when available.

### Fixed
- Updated Salesforce token handling to use `sf org auth show-access-token --target-org <alias> --json` when `sf org display` returns a redacted token, preventing blob download 401 failures on newer Salesforce CLI versions.
- Added validation and test coverage for missing/redacted access tokens during org info retrieval.

## [1.4.0] - 2026-07-06

### Updated
Updated the documentation for better language and simplified the content

## [1.3.2] - 2026-07-03

### Added
- Documented prerequisites in the README: Salesforce CLI (`sf`) must be installed and orgs must be authenticated before running `retrieve` or `deploy`.

## [1.3.1] - 2026-07-03

### Fixed
- Fixed the npm `bin` entry so global installs correctly create the `rccml` command.

## [1.3.0] - 2026-07-03

### Added
- Added usage telemetry for `retrieve` and `deploy` runs (one event per run) with metrics for succeeded/failed CMLs and processed `ExpressionSetConstraintObj` records.
- Added startup version enforcement against npm latest with upgrade guidance when out of date.

## [1.2.0] - 2026-07-01

### Added
- Added support for Group constraint references in CML migration.

## [1.1.0] - 2026-07-01

### Added
- Added `rccml list --target-org <alias>` to list available CML Expression Sets.
- Added interactive selection flow with `rccml retrieve --target-org <alias> --select`.
- Added bulk retrieval flow with `rccml retrieve --target-org <alias> --all`.
- Added table-style output for list/select with columns `S.No`, `ApiName`, and `Name`.

## [1.0.0] - 2025-06-30

### Initial Version
- Released v1.0.0 of the RCCML npm package for CML deployment