Skip to content

refactor: move operations into separate module - #4582

Merged
qwerty541 merged 1 commit into
anuraghazra:masterfrom
qwerty541:refactor_move_operations_into_separate_module
Oct 15, 2025
Merged

refactor: move operations into separate module#4582
qwerty541 merged 1 commit into
anuraghazra:masterfrom
qwerty541:refactor_move_operations_into_separate_module

Conversation

@alexandr-garbuzov

Copy link
Copy Markdown
Contributor

No description provided.

@vercel

vercel Bot commented Oct 15, 2025

Copy link
Copy Markdown

@qwerty541 is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added stats-card Feature, Enhancement, Fixes related to stats the stats card. repo-card Issues related to the pin/repo card. lang-card Issues related to the language card. wakatime-card Issues related to the wakatime card. gist-card labels Oct 15, 2025

@alexandr-garbuzov alexandr-garbuzov left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✔️

@qwerty541 qwerty541 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

✔️

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Refactor to extract general-purpose operations from utils into a new ops module to improve separation of concerns and update consumers accordingly.

  • Moved helpers (parseBoolean, parseArray, clampValue, lowercaseTrim, chunkArray, parseEmojis, dateDiff) from utils.js to ops.js
  • Updated imports across API and card modules and adjusted tests
  • Stopped re-exporting these helpers from common/index.js

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/utils.test.js Adjusted imports: parseBoolean now sourced from ops.js
src/common/utils.js Removed ops-style helpers and their exports; kept UI/layout-related utils
src/common/ops.js New module containing parsing, clamping, chunking, emoji parsing, and date diff helpers
src/common/index.js Removed re-exports of moved helpers from utils barrel
src/common/createProgressNode.js Now imports clampValue from ops.js
src/common/cache.js Now imports clampValue from ops.js
src/cards/wakatime.js Split imports: ops for clampValue/lowercaseTrim, utils for flexLayout
src/cards/top-languages.js Split imports: ops for chunkArray/clampValue/lowercaseTrim, utils for flexLayout/measureText
src/cards/stats.js Split imports: ops for clampValue, utils for flexLayout/measureText
src/cards/repo.js Now imports clampValue/parseEmojis from ops.js; utils for the rest
src/cards/gist.js Now imports parseEmojis from ops.js
api/wakatime.js Now imports parseArray/parseBoolean from ops.js; utils for renderError
api/top-langs.js Now imports parseArray/parseBoolean from ops.js; utils for renderError
api/status/pat-info.js Now imports dateDiff from ops.js
api/pin.js Now imports parseBoolean from ops.js; utils for renderError
api/index.js Now imports parseArray/parseBoolean from ops.js; utils for renderError
api/gist.js Now imports parseBoolean from ops.js; utils for renderError

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/common/index.js
@qwerty541
qwerty541 merged commit e158f0d into anuraghazra:master Oct 15, 2025
7 of 8 checks passed
@qwerty541
qwerty541 deleted the refactor_move_operations_into_separate_module branch October 15, 2025 20:29
harryzcy pushed a commit to harryzcy/github-readme-stats that referenced this pull request Oct 16, 2025
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
martin-mfg pushed a commit to stats-organization/github-stats-extended that referenced this pull request Nov 2, 2025
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
ghosind pushed a commit to ghosind/github-readme-stats that referenced this pull request Dec 30, 2025
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
zimya pushed a commit to zimya/github-readme-stats-cf that referenced this pull request Jan 13, 2026
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
piscis pushed a commit to piscis/github-readme-stats that referenced this pull request Feb 7, 2026
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
zntb added a commit to zntb/github-readme-stats that referenced this pull request Jul 27, 2026
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
zntb added a commit to zntb/github-readme-stats that referenced this pull request Jul 27, 2026
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gist-card lang-card Issues related to the language card. repo-card Issues related to the pin/repo card. stats-card Feature, Enhancement, Fixes related to stats the stats card. wakatime-card Issues related to the wakatime card.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants