Skip to content

feat: add load-chalk hook to initialize chalk for CLI commands#135

Open
harshitha-cstk wants to merge 1 commit into
feat/taxonomy-publishingfrom
fix/dx-7341-fix-chalk-load-error
Open

feat: add load-chalk hook to initialize chalk for CLI commands#135
harshitha-cstk wants to merge 1 commit into
feat/taxonomy-publishingfrom
fix/dx-7341-fix-chalk-load-error

Conversation

@harshitha-cstk
Copy link
Copy Markdown
Contributor

@harshitha-cstk harshitha-cstk commented May 12, 2026

Summary
Resolves Chalk not loaded. Ensure loadChalk() is called during init when running stack export / import (and similar flows) under pnpm, where the core CLI and a registry plugin can each resolve a different physical copy of @contentstack/cli-utilities at the same version. loadChalk() ran on one copy (core utils-init); getChalk() ran on the other (plugin), so the plugin’s module never had chalk initialized.

Changes
@contentstack/cli-utilities (chalk.ts)
Keep loadChalk() / getChalk() as the public API (no changes required in other packages).
Store the loaded chalk module on globalThis using Symbol.for('@contentstack/cli-utilities/chalk') so every copy of this package in the process shares one cache after loadChalk() runs once (e.g. from core utils-init).
Use local variable name chalkInstance throughout for clarity and consistency with the previous module-scoped pattern.

@harshitha-cstk harshitha-cstk requested a review from a team as a code owner May 12, 2026 08:03
@github-actions
Copy link
Copy Markdown

🔒 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 261 10 ✅ Passed
🟠 High Severity 2 210 25 ✅ Passed
🟡 Medium Severity 0 696 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: 261
  • High without fixes: 210
  • Medium without fixes: 696
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

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.

3 participants