Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add @discordjs/util #8591

Merged
merged 14 commits into from Oct 2, 2022
Merged

Conversation

suneettipirneni
Copy link
Member

Please describe the changes this PR makes and why it should be merged:

Adds an internal package for utilities and types that are shared among @discordjs packages.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@vercel
Copy link

vercel bot commented Sep 4, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
discord-js ⬜️ Ignored (Inspect) Oct 2, 2022 at 5:51PM (UTC)

@codecov
Copy link

codecov bot commented Sep 4, 2022

Codecov Report

Merging #8591 (f4b6b3b) into main (3f86561) will decrease coverage by 5.24%.
The diff coverage is 100.00%.

❗ Current head f4b6b3b differs from pull request most recent head bab0130. Consider uploading reports for the commit bab0130 to get more accurate results

@@            Coverage Diff             @@
##             main    #8591      +/-   ##
==========================================
- Coverage   92.09%   86.84%   -5.25%     
==========================================
  Files          10       87      +77     
  Lines        2099     8811    +6712     
  Branches      239     1103     +864     
==========================================
+ Hits         1933     7652    +5719     
- Misses        163     1117     +954     
- Partials        3       42      +39     
Flag Coverage Δ
builders 100.00% <100.00%> (?)
collection 100.00% <ø> (?)
proxy 80.46% <ø> (?)
rest 92.07% <100.00%> (-0.02%) ⬇️
util 100.00% <100.00%> (?)
utilities 100.00% <ø> (?)
voice 63.83% <ø> (?)
ws 59.86% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/util/src/Equatable.ts 100.00% <ø> (ø)
packages/util/src/JSONEncodable.ts 100.00% <ø> (ø)
packages/builders/src/components/Component.ts 100.00% <100.00%> (ø)
...ders/src/components/selectMenu/SelectMenuOption.ts 100.00% <100.00%> (ø)
...ges/builders/src/components/textInput/TextInput.ts 100.00% <100.00%> (ø)
packages/builders/src/interactions/modals/Modal.ts 100.00% <100.00%> (ø)
packages/rest/src/lib/RequestManager.ts 90.26% <100.00%> (-0.08%) ⬇️
packages/util/src/functions/lazy.ts 100.00% <100.00%> (ø)
packages/util/src/functions/range.ts 100.00% <100.00%> (ø)
packages/util/src/types.ts 100.00% <100.00%> (ø)
... and 80 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

packages/util/.gitignore Outdated Show resolved Hide resolved
packages/util/.prettierignore Outdated Show resolved Hide resolved
packages/util/tsconfig.json Outdated Show resolved Hide resolved
@suneettipirneni suneettipirneni requested review from iCrawl and removed request for vladfrangu, kyranet and SpaceEEC September 4, 2022 02:52
Copy link
Contributor

@imranbarbhuiya imranbarbhuiya left a comment

Choose a reason for hiding this comment

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

add in labels file and workflow matrix

packages/builders/src/index.ts Show resolved Hide resolved
packages/util/package.json Outdated Show resolved Hide resolved
kyranet
kyranet previously requested changes Sep 4, 2022
Copy link
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

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

This new package should have tests, some are available in @sapphire/utilities such as lazy, which has their tests here.

Type-only utilities can be tested with Vitest's type assertions, doing expect<T>(assertedValue); or using tsd like discord.js does.

packages/util/package.json Outdated Show resolved Hide resolved
packages/util/package.json Show resolved Hide resolved
Copy link
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

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

Also, is .test-d.ts an accepted (and recognised) format? Or is it run only by TSD and not by Vitest?

packages/discord.js/src/index.js Outdated Show resolved Hide resolved
packages/util/__tests__/Equatable.test.ts Outdated Show resolved Hide resolved
packages/util/__tests__/JSONEncodable.test.ts Outdated Show resolved Hide resolved
packages/util/package.json Outdated Show resolved Hide resolved
@suneettipirneni suneettipirneni requested review from kyranet and removed request for iCrawl and SpaceEEC September 26, 2022 15:17
@kodiakhq kodiakhq bot merged commit b2ec865 into discordjs:main Oct 2, 2022
@muchnameless muchnameless mentioned this pull request Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

8 participants