Skip to content

Fix/dx 4465 upgrade chalk to v5#2451

Open
harshithad0703 wants to merge 17 commits intov2-dev-bugfixfrom
fix/dx-4465-upgrade-chalk-to-v5
Open

Fix/dx 4465 upgrade chalk to v5#2451
harshithad0703 wants to merge 17 commits intov2-dev-bugfixfrom
fix/dx-4465-upgrade-chalk-to-v5

Conversation

@harshithad0703
Copy link
Contributor

Summary

Upgrades chalk from ^4.1.2 to ^5.6.2 across the CLI monorepo. Chalk 5 is ESM-only while our build is CommonJS, so a small helper in @contentstack/cli-utilities loads chalk via dynamic import() and caches it; the main CLI preloads it in the init hook, and all packages use getChalk() from utilities instead of importing chalk directly.

Changes

  • Dependencies: Bumped chalk to ^5.6.2 in 9 packages (contentstack, contentstack-utilities, contentstack-audit, contentstack-branches, contentstack-clone, contentstack-export, contentstack-import, contentstack-import-setup, contentstack-migration).
  • contentstack-utilities: Added src/chalk.ts with loadChalk(), getChalk(), and ChalkInstance; exported from index.
  • contentstack: Init hook (utils-init.ts) now async and calls await loadChalk() at startup.
  • Source: Replaced all import chalk from 'chalk' and chalk. usage with getChalk() from @contentstack/cli-utilities in cli and cli-plugins. Template literals chalk`...`(getChalk())`...` in migration error-helper.
  • Types: In contentstack-audit, replaced deprecated ForegroundColor with ForegroundColorName from chalk.
  • Docs: Added docs/chalk-upgrade-team-brief.md and docs/chalk-5-migration-guide.md for team alignment and migration of Launch/external plugins.

Notes

  • Chalk 5 is ESM-only; the helper uses dynamic import('chalk') so CommonJS build works.
  • Launch and external plugins should use getChalk() from utilities and follow docs/chalk-5-migration-guide.md; no helper or init in plugin repos.

@harshithad0703 harshithad0703 requested review from a team as code owners March 10, 2026 09:50
@gitguardian
Copy link

gitguardian bot commented Mar 10, 2026

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@github-actions
Copy link

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@harshithad0703 harshithad0703 changed the base branch from v2-beta to v2-dev-bugfix March 10, 2026 10:21
@github-actions
Copy link

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 1 0 25 ✅ Passed
🟡 Medium Severity 0 34 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

⚠️ Warning: The following vulnerabilities have exceeded their SLA thresholds (days since publication).

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 1 90 / 365 days ⚠️ Warning
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 34
  • Low without fixes: 0

⚠️ BUILD PASSED WITH WARNINGS - SLA breaches detected for issues without available fixes

Consider reviewing these vulnerabilities when fixes become available.

@github-actions
Copy link

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 34 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

⚠️ Warning: The following vulnerabilities have exceeded their SLA thresholds (days since publication).

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 1 90 / 365 days ⚠️ Warning
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 34
  • Low without fixes: 0

⚠️ BUILD PASSED WITH WARNINGS - SLA breaches detected for issues without available fixes

Consider reviewing these vulnerabilities when fixes become available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants