You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(editor): replace gh-search-api consumtion with graphql in jargons editor (#161)
### Description
<!-- Please add PR description (don't leave blank) - example: This PR
[adds/removes/fixes/replaces] the [feature/bug/etc] -->
This pull request improves the way contribution stats are queried by
switching to a single GraphQL request from github search-api which is
getting removed after getting deprecated and narrowing results to the
main branch. These changes enhance maintainability, accuracy, and future
extensibility.
introduces a standardized set of label constants for
contribution-related pull requests and refactors the codebase to use
these constants consistently.
**Label standardization and usage:**
* Added a `LABELS` constant to `constants.js` to centralize label
definitions for new words, edited words, and editor-originated
contributions.
* Refactored label usage in `submitWord` to use the new constants
instead of hardcoded strings.
[[1]](diffhunk://#diff-da5c3e61f828ff6207118ba3e3196d6263237671b3897650d8642fa5576a00c6R1)
[[2]](diffhunk://#diff-da5c3e61f828ff6207118ba3e3196d6263237671b3897650d8642fa5576a00c6L47-R49)
**Contribution stats improvements:**
* Refactored `doContributionStats` to use a single GraphQL query for all
stats, improving performance and maintainability.
* Updated contribution stats queries to use the main branch and the
standardized labels, ensuring more accurate results.
**Code consistency:**
* Updated imports in relevant files (`do-contribution-stats.js`,
`submit-word.js`, `index.astro`) to use the new `LABELS` constant.
[[1]](diffhunk://#diff-66fb997961c22f18ff765f0e831b43870a845fe98eadf9d176e26288f677a4ddL4-R4)
[[2]](diffhunk://#diff-da5c3e61f828ff6207118ba3e3196d6263237671b3897650d8642fa5576a00c6R1)
[[3]](diffhunk://#diff-19c5ae8617d4b91be3692fd77b705dd7e871e0b6750543a0d3a78293582cee4bL8-R8)
* Updated the total words stats query in `index.astro` to use the
standardized labels and improved query syntax.
### Related Issue
<!-- Please prefix the issue number with Fixes/Resolves - example: Fixes#123 or Resolves#123 -->
Nil
### Screenshots/Screencasts
<!-- Please provide screenshots or video recording that demos your
changes (especially if it's a visual change) -->
<img width="960" height="540" alt="image"
src="https://github.com/user-attachments/assets/27902060-d20e-4054-8314-7cb3756687e2"
/>
### Notes to Reviewer
<!-- Please state here if you added a new npm packages, or any extra
information that can help reviewer better review you changes -->
Nil
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
exportconstSITE_META_DESCRIPTION="A community-driven dictionary that simplifies software, engineering and tech terms for all levels. Curated by contributors, jargons.dev offers clear, easy-to-understand definitions."
0 commit comments