Fix/dx 4465 upgrade chalk to v5#2451
Conversation
…ESM loading. Update imports to use dynamic loading of chalk for improved performance and compatibility.
️✅ 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. 🦉 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. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
✅ BUILD PASSED - All security checks passed |
…upgrade-chalk-to-v5
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
Consider reviewing these vulnerabilities when fixes become available. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
Consider reviewing these vulnerabilities when fixes become available. |
1c5ae06
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
Consider reviewing these vulnerabilities when fixes become available. |
… readContentTypeSchemas to return an empty array for missing directories and added error handling. Introduced mocha-root-hooks.js for preloading Chalk in tests.
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
Consider reviewing these vulnerabilities when fixes become available. |
…k-auth and contentstack-config. Updated .mocharc.json files to include the new hooks.
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
Consider reviewing these vulnerabilities when fixes become available. |
Summary
Upgrades chalk from
^4.1.2to^5.6.2across the CLI monorepo. Chalk 5 is ESM-only while our build is CommonJS, so a small helper in@contentstack/cli-utilitiesloads chalk via dynamicimport()and caches it; the main CLI preloads it in the init hook, and all packages usegetChalk()from utilities instead of importing chalk directly.Changes
chalkto^5.6.2in 9 packages (contentstack, contentstack-utilities, contentstack-audit, contentstack-branches, contentstack-clone, contentstack-export, contentstack-import, contentstack-import-setup, contentstack-migration).src/chalk.tswithloadChalk(),getChalk(), andChalkInstance; exported from index.utils-init.ts) now async and callsawait loadChalk()at startup.import chalk from 'chalk'andchalk.usage withgetChalk()from@contentstack/cli-utilitiesin cli and cli-plugins. Template literalschalk`...`→(getChalk())`...`in migration error-helper.ForegroundColorwithForegroundColorNamefrom chalk.docs/chalk-upgrade-team-brief.mdanddocs/chalk-5-migration-guide.mdfor team alignment and migration of Launch/external plugins.Notes
import('chalk')so CommonJS build works.getChalk()from utilities and followdocs/chalk-5-migration-guide.md; no helper or init in plugin repos.