Skip to content

chore: replace chalk and log-symbols with Node.js built-in styleText#4245

Merged
MarshallOfSound merged 2 commits into
nextfrom
claude/remove-chalk-dependency-lXqaE
May 6, 2026
Merged

chore: replace chalk and log-symbols with Node.js built-in styleText#4245
MarshallOfSound merged 2 commits into
nextfrom
claude/remove-chalk-dependency-lXqaE

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Member

@MarshallOfSound MarshallOfSound commented May 6, 2026

Summary

This PR replaces the chalk and log-symbols dependencies with Node.js's built-in styleText utility from the node:util module. This reduces external dependencies while maintaining the same terminal styling functionality.

Changes

  • Removed dependencies: chalk and log-symbols from all package.json files
  • Updated imports: Replaced import chalk from 'chalk' with import { styleText } from 'node:util'
  • Updated API calls:
    • chalk.color(text)styleText('color', text)
    • chalk.color.modifier(text)styleText(['color', 'modifier'], text) (for combined styles)
    • logSymbols.warningstyleText('yellow', '⚠')
    • logSymbols.errorstyleText('red', '✖')

Files Modified

  • packages/plugin/vite/src/VitePlugin.ts
  • packages/plugin/vite/src/subprocess-worker.ts
  • packages/plugin/webpack/src/WebpackPlugin.ts
  • packages/api/core/src/api/make.ts
  • packages/api/core/src/api/package.ts
  • packages/api/core/src/api/publish.ts
  • packages/api/core/src/api/start.ts
  • packages/api/core/src/util/plugin-interface.ts
  • packages/api/core/src/util/hook.ts
  • packages/api/core/src/util/electron-executable.ts
  • packages/api/cli/src/electron-forge.ts
  • packages/api/cli/src/electron-forge-make.ts
  • packages/api/cli/src/electron-forge-publish.ts
  • packages/api/cli/src/util/terminate.ts
  • packages/external/create-electron-app/src/create-electron-app.ts
  • packages/external/create-electron-app/src/index.ts
  • packages/external/create-electron-app/src/init.ts
  • packages/external/create-electron-app/src/import.ts
  • packages/external/create-electron-app/src/init-scripts/init-directory.ts
  • packages/maker/wix/src/MakerWix.ts
  • packages/publisher/github/src/PublisherGitHub.ts
  • tools/test-dist.ts
  • tools/test-clear.ts
  • All relevant package.json files

Benefits

  • Reduces external dependencies (2 fewer packages to maintain)
  • Uses Node.js built-in utilities (available since Node.js 21.7.0)
  • Maintains full compatibility with existing styling behavior
  • Simplifies dependency management

Testing

Existing tests pass. The changes are straightforward refactoring of styling calls with no functional behavior changes.

https://claude.ai/code/session_01Nz9h7uooUdybS8pNjABMsE

Drops two direct dependencies in favor of the built-in `styleText`
(available since Node 20.12) and inline unicode symbols, reducing
the install footprint with no behavior change.

https://claude.ai/code/session_01Nz9h7uooUdybS8pNjABMsE
@MarshallOfSound MarshallOfSound requested a review from a team as a code owner May 6, 2026 23:12
@github-actions github-actions Bot added the next label May 6, 2026
@MarshallOfSound MarshallOfSound changed the title Replace chalk and log-symbols with Node.js built-in styleText chore: replace chalk and log-symbols with Node.js built-in styleText May 6, 2026
Copy link
Copy Markdown
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i fw it

@MarshallOfSound MarshallOfSound enabled auto-merge (squash) May 6, 2026 23:30
@MarshallOfSound MarshallOfSound merged commit 5fd17cc into next May 6, 2026
12 checks passed
@MarshallOfSound MarshallOfSound deleted the claude/remove-chalk-dependency-lXqaE branch May 6, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants