-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat: no-de-no-de, now with extra buns #9683
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
31b77ae
chore: no-de-no-de, now with extra buns
vladfrangu 4134baf
chore: shh, nothing to be seen here
vladfrangu 8e0be7c
refactor(rest): add web compatibility (#9682)
suneettipirneni 1cb29b7
chore: keep using npm module for now
vladfrangu cd29f6f
chore: small cleanup and bug fixes
vladfrangu 95636dd
chore: requested changes
vladfrangu 5332bfe
chore: bring back your strategies
vladfrangu 969e2d8
fix: use explicit path for vitest config
suneettipirneni c25f32e
chore: requested changes
vladfrangu be02852
chore: the commit explaining it all
vladfrangu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,11 @@ | ||
| { | ||
| "extends": "../../.eslintrc.json" | ||
| "extends": "../../.eslintrc.json", | ||
| "rules": { | ||
| "n/prefer-global/url": 0, | ||
| "n/prefer-global/url-search-params": 0, | ||
| "n/prefer-global/buffer": 0, | ||
| "n/prefer-global/process": 0, | ||
| "no-restricted-globals": 0, | ||
| "unicorn/prefer-node-protocol": 0 | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| module.exports = require('../../.lintstagedrc.json'); | ||
| module.exports = { | ||
| ...require('../../.lintstagedrc.json'), | ||
| 'src/**.ts': 'vitest related --run --config ./vitest.config.ts', | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import { setDefaultStrategy } from '../src/environment.js'; | ||
| import { makeRequest } from '../src/strategies/undiciRequest.js'; | ||
|
|
||
| setDefaultStrategy(makeRequest); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import type { RESTOptions } from './shared.js'; | ||
|
|
||
| let defaultStrategy: RESTOptions['makeRequest']; | ||
|
|
||
| export function setDefaultStrategy(newStrategy: RESTOptions['makeRequest']) { | ||
| defaultStrategy = newStrategy; | ||
| } | ||
|
|
||
| export function getDefaultStrategy() { | ||
| return defaultStrategy; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,7 @@ | ||
| export * from './lib/CDN.js'; | ||
| export * from './lib/errors/DiscordAPIError.js'; | ||
| export * from './lib/errors/HTTPError.js'; | ||
| export * from './lib/errors/RateLimitError.js'; | ||
| export * from './lib/RequestManager.js'; | ||
| export * from './lib/REST.js'; | ||
| export * from './lib/utils/constants.js'; | ||
| export { calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse } from './lib/utils/utils.js'; | ||
| import { shouldUseGlobalFetchAndWebSocket } from '@discordjs/util'; | ||
| import { setDefaultStrategy } from './environment.js'; | ||
| import { makeRequest } from './strategies/undiciRequest.js'; | ||
|
|
||
| /** | ||
| * The {@link https://github.com/discordjs/discord.js/blob/main/packages/rest/#readme | @discordjs/rest} version | ||
| * that you are currently using. | ||
| */ | ||
| // This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild | ||
| export const version = '[VI]{{inject}}[/VI]' as string; | ||
| setDefaultStrategy(shouldUseGlobalFetchAndWebSocket() ? fetch : makeRequest); | ||
|
|
||
| export * from './shared.js'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.