Compare commits

..

25 Commits

Author SHA1 Message Date
iCrawl
b45b99f92b chore(ws): release @discordjs/ws@0.2.0 2022-07-30 20:42:46 +02:00
DD
5137bfc17d fix(WebSocketShard): account code 1000 with no prior indication (#8399) 2022-07-30 20:37:46 +02:00
Jiralite
fca3dada2a docs(Embed): Ensure height and width are numbers (#8396) 2022-07-30 11:39:15 +02:00
Parbez
d070de6da7 chore: fix file path (#8391)
* chore: fix file path

* chore: emit only mjs
2022-07-29 18:43:57 +02:00
iCrawl
a3183cfad4 chore(discord.js): release discord.js@14.1.1 2022-07-29 13:47:21 +02:00
iCrawl
aba307341d chore(builders): release @discordjs/builders@1.1.0 2022-07-29 13:42:55 +02:00
Parbez
c479d39a6b chore: build only actions (#8383) 2022-07-29 11:19:54 +02:00
Parbez
52c2818b25 feat(website): add implements for class (#8388)
Co-authored-by: Noel <buechler.noel@outlook.com>
2022-07-29 11:19:32 +02:00
iCrawl
d03cf6176c chore(discord.js): release discord.js@14.1.0 2022-07-29 11:04:08 +02:00
iCrawl
11e77f7f86 chore: deps 2022-07-29 11:00:45 +02:00
iCrawl
2b1e88b5fa chore: update changelog 2022-07-29 10:59:35 +02:00
Synbulat Biishev
e5bfe2c7c2 chore: reexport rest (#8372) 2022-07-29 10:47:30 +02:00
Jiralite
a7deb8f898 feat: Add channel & message URL formatters (#8371) 2022-07-29 10:47:23 +02:00
Almeida
b4e2c0c4d5 fix(MessageMentions): ignoreRepliedUser option in has() (#8202) 2022-07-29 10:47:05 +02:00
Suneet Tipirneni
33113614e0 feat(website): parse tsdoc comments (#8386) 2022-07-29 10:46:17 +02:00
Suneet Tipirneni
26556390a3 fix: use proper format for @link text (#8384)
fix(collection): use proper format for link text
2022-07-28 20:24:07 +02:00
Parbez
5494791313 docs: use link tags (#8382) 2022-07-28 19:18:42 +02:00
Parbez
c258bdf083 chore: cleanup tsup configs (#8381) 2022-07-28 18:57:57 +02:00
Parbez
ff5dd1fcb4 docs: hide sections with no members (#8380) 2022-07-28 17:55:46 +02:00
iCrawl
a38c58dbd0 feat: tertiary sidebar 2022-07-28 17:46:41 +02:00
Suneet Tipirneni
ec43c184fe feat(website): add icons for sections (#8377)
* feat(website): add icons for sections

* chore: make requested changes

* fix: add icon for function parameters
2022-07-28 16:26:06 +02:00
iCrawl
c25e8ad78b chore: use date order instead of topological for changelog 2022-07-27 14:36:09 +02:00
iCrawl
3f17ff23bf chore: fix changelog 2022-07-27 14:22:13 +02:00
iCrawl
a7dc588d9f chore(proxy): release @discordjs/proxy@1.0.1 2022-07-27 14:16:56 +02:00
iCrawl
2291429d30 chore(ws): release @discordjs/ws@0.1.0 2022-07-27 14:15:59 +02:00
87 changed files with 793 additions and 678 deletions

View File

@@ -90,7 +90,7 @@ jobs:
run: yarn --immutable
- name: Build actions
run: yarn build
run: yarn workspace @discordjs/actions build
- name: Download docgen artifacts
uses: actions/download-artifact@v3

View File

@@ -46,19 +46,18 @@ pnpm add discord.js
## Example usage
Install all required dependencies:
Install discord.js:
```sh-session
npm install discord.js @discordjs/rest
yarn add discord.js @discordjs/rest
pnpm add discord.js @discordjs/rest
npm install discord.js
yarn add discord.js
pnpm add discord.js
```
Register a slash command against the Discord API:
```js
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord.js');
const { REST, Routes } = require('discord.js');
const commands = [
{

View File

@@ -5,5 +5,4 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
tsup.config.*.mjs
coverage/

View File

@@ -1,3 +1,3 @@
import { createUnbuildConfig } from '../../build.config';
export default createUnbuildConfig({ minify: true });
export default createUnbuildConfig({ minify: true, emitCJS: false });

View File

@@ -10,14 +10,8 @@
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
"fmt": "yarn format"
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"main": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
},
"directories": {
"lib": "src",
"test": "__tests__"
@@ -49,12 +43,11 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"c8": "^7.12.0",
"eslint": "^8.20.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"tsup": "^6.2.0",
"typescript": "^4.7.4",
"unbuild": "^0.7.6",
"vitest": "^0.19.1"

View File

@@ -11,4 +11,4 @@ outputs:
description: 'The semver string that was extracted from this tag'
runs:
using: node16
main: ../../dist/formatTag/index.js
main: ../../dist/formatTag/index.mjs

View File

@@ -1,9 +0,0 @@
import { createTsupConfig } from '../../tsup.config';
export default createTsupConfig({
entry: ['src/index.ts', 'src/formatTag/index.ts'],
format: ['cjs'],
skipNodeModulesBundle: false,
noExternal: ['@actions/core'],
minify: true,
});

View File

@@ -5,5 +5,4 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
tsup.config.*.mjs
coverage/

View File

@@ -2,6 +2,22 @@
All notable changes to this project will be documented in this file.
# [@discordjs/builders@1.1.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@1.0.0...@discordjs/builders@1.1.0) - (2022-07-29)
## Bug Fixes
- Use proper format for `@link` text (#8384) ([2655639](https://github.com/discordjs/discord.js/commit/26556390a3800e954974a00c1328ff47d3e67e9a))
- **Formatters:** Add newline in `codeBlock` (#8369) ([5d8bd03](https://github.com/discordjs/discord.js/commit/5d8bd030d60ef364de3ef5f9963da8bda5c4efd4))
- **selectMenu:** Allow json to be used for select menu options (#8322) ([6a2d0d8](https://github.com/discordjs/discord.js/commit/6a2d0d8e96d157d5b85cee7f17bffdfff4240074))
## Documentation
- Use link tags (#8382) ([5494791](https://github.com/discordjs/discord.js/commit/549479131318c659f86f0eb18578d597e22522d3))
## Features
- Add channel & message URL formatters (#8371) ([a7deb8f](https://github.com/discordjs/discord.js/commit/a7deb8f89830ead6185c5fb46a49688b6d209ed1))
# [@discordjs/builders@1.0.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@0.16.0...@discordjs/builders@1.0.0) - (2022-07-17)
## Info

View File

@@ -3,6 +3,7 @@ import { describe, test, expect, vitest } from 'vitest';
import {
blockQuote,
bold,
channelLink,
channelMention,
codeBlock,
Faces,
@@ -11,6 +12,7 @@ import {
hyperlink,
inlineCode,
italic,
messageLink,
quote,
roleMention,
spoiler,
@@ -150,6 +152,34 @@ describe('Message formatters', () => {
});
});
describe('channelLink', () => {
test('GIVEN channelId THEN returns "https://discord.com/channels/@me/${channelId}"', () => {
expect<'https://discord.com/channels/@me/123456789012345678'>(channelLink('123456789012345678')).toEqual(
'https://discord.com/channels/@me/123456789012345678',
);
});
test('GIVEN channelId WITH guildId THEN returns "https://discord.com/channels/${guildId}/${channelId}"', () => {
expect<'https://discord.com/channels/987654321987654/123456789012345678'>(
channelLink('123456789012345678', '987654321987654'),
).toEqual('https://discord.com/channels/987654321987654/123456789012345678');
});
});
describe('messageLink', () => {
test('GIVEN channelId AND messageId THEN returns "https://discord.com/channels/@me/${channelId}/${messageId}"', () => {
expect<'https://discord.com/channels/@me/123456789012345678/102938475657483'>(
messageLink('123456789012345678', '102938475657483'),
).toEqual('https://discord.com/channels/@me/123456789012345678/102938475657483');
});
test('GIVEN channelId AND messageId WITH guildId THEN returns "https://discord.com/channels/${guildId}/${channelId}/${messageId}"', () => {
expect<'https://discord.com/channels/987654321987654/123456789012345678/102938475657483'>(
messageLink('123456789012345678', '102938475657483', '987654321987654'),
).toEqual('https://discord.com/channels/987654321987654/123456789012345678/102938475657483');
});
});
describe('time', () => {
test('GIVEN no arguments THEN returns "<t:${bigint}>"', () => {
vitest.useFakeTimers();

View File

@@ -59,5 +59,5 @@ commit_parsers = [
filter_commits = true
tag_pattern = "@discordjs/builders@[0-9]*"
ignore_tags = ""
topo_order = false
date_order = true
sort_commits = "newest"

View File

@@ -1,6 +1,6 @@
{
"name": "@discordjs/builders",
"version": "1.0.0",
"version": "1.1.0",
"description": "A set of builders that you can use when creating your bot",
"scripts": {
"test": "vitest run",
@@ -64,13 +64,12 @@
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^1.8.5",
"@microsoft/api-extractor": "^7.28.6",
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"c8": "^7.12.0",
"downlevel-dts": "^0.10.0",
"eslint": "^8.20.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"tsup": "^6.2.0",
"typescript": "^4.7.4",
"unbuild": "^0.7.6",
"vitest": "^0.19.1"

View File

@@ -207,6 +207,63 @@ export function formatEmoji<C extends Snowflake>(emojiId: C, animated = false):
return `<${animated ? 'a' : ''}:_:${emojiId}>`;
}
/**
* Formats a channel link for a direct message channel.
*
* @param channelId - The channel's id
*/
export function channelLink<C extends Snowflake>(channelId: C): `https://discord.com/channels/@me/${C}`;
/**
* Formats a channel link for a guild channel.
*
* @param channelId - The channel's id
* @param guildId - The guild's id
*/
export function channelLink<C extends Snowflake, G extends Snowflake>(
channelId: C,
guildId: G,
): `https://discord.com/channels/${G}/${C}`;
export function channelLink<C extends Snowflake, G extends Snowflake>(
channelId: C,
guildId?: G,
): `https://discord.com/channels/@me/${C}` | `https://discord.com/channels/${G}/${C}` {
return `https://discord.com/channels/${guildId ?? '@me'}/${channelId}`;
}
/**
* Formats a message link for a direct message channel.
*
* @param channelId - The channel's id
* @param messageId - The message's id
*/
export function messageLink<C extends Snowflake, M extends Snowflake>(
channelId: C,
messageId: M,
): `https://discord.com/channels/@me/${C}/${M}`;
/**
* Formats a message link for a guild channel.
*
* @param channelId - The channel's id
* @param messageId - The message's id
* @param guildId - The guild's id
*/
export function messageLink<C extends Snowflake, M extends Snowflake, G extends Snowflake>(
channelId: C,
messageId: M,
guildId: G,
): `https://discord.com/channels/${G}/${C}/${M}`;
export function messageLink<C extends Snowflake, M extends Snowflake, G extends Snowflake>(
channelId: C,
messageId: M,
guildId?: G,
): `https://discord.com/channels/@me/${C}/${M}` | `https://discord.com/channels/${G}/${C}/${M}` {
return `${typeof guildId === 'undefined' ? channelLink(channelId) : channelLink(channelId, guildId)}/${messageId}`;
}
/**
* Formats a date into a short date-time string
*
@@ -245,7 +302,7 @@ export function time(timeOrSeconds?: number | Date, style?: TimestampStylesStrin
}
/**
* The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord
* The {@link https://discord.com/developers/docs/reference#message-formatting-timestamp-styles | message formatting timestamp styles} supported by Discord
*/
export const TimestampStyles = {
/**

View File

@@ -1,3 +0,0 @@
import { createTsupConfig } from '../../tsup.config';
export default createTsupConfig();

View File

@@ -5,5 +5,4 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
tsup.config.*.mjs
coverage/

View File

@@ -33,43 +33,6 @@ All notable changes to this project will be documented in this file.
- **collection:** Improve coverage (#8222) ([a51f721](https://github.com/discordjs/discord.js/commit/a51f7215eca67a0f46fba8b2d706f7ec6f6dc228))
# [@discordjs/collection@1.0.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@0.8.0...@discordjs/collection@1.0.0) - (2022-07-17)
## Info
- 1.0.0 release bump, no new features.
# [@discordjs/collection@0.8.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@0.7.0...@discordjs/collection@0.8.0) - (2022-07-17)
## Bug Fixes
- **Collection:** Make error messages consistent (#8224) ([5bd6b28](https://github.com/discordjs/discord.js/commit/5bd6b28b3ebfced1cb9d23e83bd7c0def7a12404))
- Check for function type (#8064) ([3bb9c0e](https://github.com/discordjs/discord.js/commit/3bb9c0e5c37311044ff41761b572ac4f91cda57c))
## Documentation
- Add codecov coverage badge to readmes (#8226) ([f6db285](https://github.com/discordjs/discord.js/commit/f6db285c073898a749fe4591cbd4463d1896daf5))
## Features
- Codecov (#8219) ([f10f4cd](https://github.com/discordjs/discord.js/commit/f10f4cdcd88ca6be7ec735ed3a415ba13da83db0))
- **docgen:** Update typedoc ([b3346f4](https://github.com/discordjs/discord.js/commit/b3346f4b9b3d4f96443506643d4631dc1c6d7b21))
- Website (#8043) ([127931d](https://github.com/discordjs/discord.js/commit/127931d1df7a2a5c27923c2f2151dbf3824e50cc))
- **docgen:** Typescript support ([3279b40](https://github.com/discordjs/discord.js/commit/3279b40912e6aa61507bedb7db15a2b8668de44b))
- Docgen package (#8029) ([8b979c0](https://github.com/discordjs/discord.js/commit/8b979c0245c42fd824d8e98745ee869f5360fc86))
- Use vitest instead of jest for more speed ([8d8e6c0](https://github.com/discordjs/discord.js/commit/8d8e6c03decd7352a2aa180f6e5bc1a13602539b))
- Add scripts package for locally used scripts ([f2ae1f9](https://github.com/discordjs/discord.js/commit/f2ae1f9348bfd893332a9060f71a8a5f272a1b8b))
## Refactor
- **collection:** Remove `default` property (#8055) ([c8f1690](https://github.com/discordjs/discord.js/commit/c8f1690896f55f06e05a83704262783cfc2bb91d))
- **collection:** Remove default export (#8053) ([16810f3](https://github.com/discordjs/discord.js/commit/16810f3e410bf35ed7e6e7412d517ea74c792c5d))
- Move all the config files to root (#8033) ([769ea0b](https://github.com/discordjs/discord.js/commit/769ea0bfe78c4f1d413c6b397c604ffe91e39c6a))
## Testing
- **collection:** Improve coverage (#8222) ([a51f721](https://github.com/discordjs/discord.js/commit/a51f7215eca67a0f46fba8b2d706f7ec6f6dc228))
# [@discordjs/collection@0.7.0](https://github.com/discordjs/discord.js/compare/@discordjs/collection@0.6.0...@discordjs/collection@0.7.0) - (2022-06-04)
## Styling

View File

@@ -59,5 +59,5 @@ commit_parsers = [
filter_commits = true
tag_pattern = "@discordjs/collection@[0-9]*"
ignore_tags = ""
topo_order = false
date_order = true
sort_commits = "newest"

View File

@@ -53,13 +53,12 @@
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^1.8.5",
"@microsoft/api-extractor": "^7.28.6",
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"c8": "^7.12.0",
"downlevel-dts": "^0.10.0",
"eslint": "^8.20.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"tsup": "^6.2.0",
"typescript": "^4.7.4",
"unbuild": "^0.7.6",
"vitest": "^0.19.1"

View File

@@ -145,7 +145,7 @@ export class Collection<K, V> extends Map<K, V> {
}
/**
* Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at()}.
* Returns the item at a given index, allowing for positive and negative integers.
* Negative integers count back from the last item in the collection.
*
@@ -158,7 +158,7 @@ export class Collection<K, V> extends Map<K, V> {
}
/**
* Identical to [Array.at()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at).
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at()}.
* Returns the key at a given index, allowing for positive and negative integers.
* Negative integers count back from the last item in the collection.
*
@@ -209,7 +209,7 @@ export class Collection<K, V> extends Map<K, V> {
}
/**
* Identical to [Array.reverse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)
* Identical to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse | Array.reverse()}
* but returns a Collection instead of an Array.
*/
public reverse() {
@@ -221,10 +221,10 @@ export class Collection<K, V> extends Map<K, V> {
/**
* Searches for a single item where the given function returns a truthy value. This behaves like
* [Array.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find | Array.find()}.
* <warn>All collections used in Discord.js are mapped using their `id` property, and if you want to find by id you
* should use the `get` method. See
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details.</warn>
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get | MDN} for details.</warn>
*
* @param fn - The function to test with (should return boolean)
* @param thisArg - Value to use as `this` when executing function
@@ -250,7 +250,7 @@ export class Collection<K, V> extends Map<K, V> {
/**
* Searches for the key of a single item where the given function returns a truthy value. This behaves like
* [Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex),
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex | Array.findIndex()},
* but returns the key rather than the positional index.
*
* @param fn - The function to test with (should return boolean)
@@ -297,7 +297,7 @@ export class Collection<K, V> extends Map<K, V> {
/**
* Identical to
* [Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter | Array.filter()},
* but returns a Collection instead of an Array.
*
* @param fn - The function to test with (should return boolean)
@@ -379,7 +379,7 @@ export class Collection<K, V> extends Map<K, V> {
/**
* Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to
* [Array.flatMap()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap).
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap | Array.flatMap()}.
*
* @param fn - Function that produces a new Collection
* @param thisArg - Value to use as `this` when executing function
@@ -399,7 +399,7 @@ export class Collection<K, V> extends Map<K, V> {
/**
* Maps each item to another value into an array. Identical in behavior to
* [Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map | Array.map()}.
*
* @param fn - Function that produces an element of the new array, taking three arguments
* @param thisArg - Value to use as `this` when executing function
@@ -423,7 +423,7 @@ export class Collection<K, V> extends Map<K, V> {
/**
* Maps each item to another value into a collection. Identical in behavior to
* [Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map | Array.map()}.
*
* @param fn - Function that produces an element of the new collection, taking three arguments
* @param thisArg - Value to use as `this` when executing function
@@ -443,7 +443,7 @@ export class Collection<K, V> extends Map<K, V> {
/**
* Checks if there exists an item that passes a test. Identical in behavior to
* [Array.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some).
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some | Array.some()}.
*
* @param fn - Function used to test (should return a boolean)
* @param thisArg - Value to use as `this` when executing function
@@ -464,7 +464,7 @@ export class Collection<K, V> extends Map<K, V> {
/**
* Checks if all items passes a test. Identical in behavior to
* [Array.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every | Array.every()}.
*
* @param fn - Function used to test (should return a boolean)
* @param thisArg - Value to use as `this` when executing function
@@ -495,7 +495,7 @@ export class Collection<K, V> extends Map<K, V> {
/**
* Applies a function to produce a single value. Identical in behavior to
* [Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce | Array.reduce()}.
*
* @param fn - Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,
* and `collection`
@@ -533,7 +533,7 @@ export class Collection<K, V> extends Map<K, V> {
/**
* Identical to
* [Map.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach),
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach | Map.forEach()},
* but returns the collection instead of undefined.
*
* @param fn - Function to execute for each element

View File

@@ -1,3 +0,0 @@
import { createTsupConfig } from '../../tsup.config';
export default createTsupConfig();

View File

@@ -5,5 +5,4 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
tsup.config.*.mjs
coverage/

View File

@@ -2,6 +2,43 @@
All notable changes to this project will be documented in this file.
# [14.1.0](https://github.com/discordjs/discord.js/compare/14.0.3...14.1.0) - (2022-07-29)
## Bug Fixes
- **MessageMentions:** `ignoreRepliedUser` option in `has()` (#8202) ([b4e2c0c](https://github.com/discordjs/discord.js/commit/b4e2c0c4d5538b945f9d597c6410a6f84b315084))
- **GuildChannelManager:** Allow unsetting rtcRegion (#8359) ([a7d49e5](https://github.com/discordjs/discord.js/commit/a7d49e56fc7c34d2e4548d9e5bf0aec45273506e))
- **ThreadChannel:** Omit webhook fetching (#8351) ([3839958](https://github.com/discordjs/discord.js/commit/3839958e3f682c715f1017da05436d2fe34900fd))
- **GuildAuditLogsEntry:** Replace OverwriteType with AuditLogOptionsType (#8345) ([58c1b51](https://github.com/discordjs/discord.js/commit/58c1b51c5ceab137ad9851919b338419eeeab69e))
- **ShardClientUtil#\_respond:** Construct global error (#8348) ([8e520f9](https://github.com/discordjs/discord.js/commit/8e520f946a5b9f93a939290facf4ccca2c05ff21))
- **Presence:** Do not return NaN for activity timestamp (#8340) ([df42fdf](https://github.com/discordjs/discord.js/commit/df42fdfc421f1190f0a2267a66efd3c921ec2348))
- **Client:** Omit private properties from toJSON (#8337) ([830c670](https://github.com/discordjs/discord.js/commit/830c670c61dcb17d8ab2a894a3203c68917d27e0))
- **ApplicationCommandManager:** Allow passing 0n to defaultMemberPermissions (#8311) ([1fb7b30](https://github.com/discordjs/discord.js/commit/1fb7b30963cfe7ea4c05b1f3b42171c879c46a1d))
## Documentation
- **InteractionResponses:** Add `showModal()` return type (#8376) ([0b61dbf](https://github.com/discordjs/discord.js/commit/0b61dbf720e844322b066e30080c3537ab3d8174))
- **WebhookClient:** Document working options (#8375) ([ba6797e](https://github.com/discordjs/discord.js/commit/ba6797e74209161b64c412de1b6f307cb28736b8))
- **Message:** Document gateway intent for content (#8364) ([2130aae](https://github.com/discordjs/discord.js/commit/2130aae3210a8eaf91c5ccae5463940d49052c7d))
- Use info blocks for requirements (#8361) ([80b9738](https://github.com/discordjs/discord.js/commit/80b9738957ebf5b6eb7c9858cec0fb1c897d0a1f))
- **WebhookClient:** Make constructor a union (#8370) ([e9920a9](https://github.com/discordjs/discord.js/commit/e9920a9c98ffb78bd7d0ae00d486476367296646))
- Update docs and examples to PascalCase links (#8305) ([34ba9d1](https://github.com/discordjs/discord.js/commit/34ba9d1c4c80eff7e6ac199a40232d07491432cc))
## Features
- Add channel & message URL formatters (#8371) ([a7deb8f](https://github.com/discordjs/discord.js/commit/a7deb8f89830ead6185c5fb46a49688b6d209ed1))
- Restore missing typeguards (#8328) ([77ed407](https://github.com/discordjs/discord.js/commit/77ed407f6aadb68e729470c5269e9b526cb1b3f0))
- **GuildMember:** Add dmChannel getter (#8281) ([4fc2c60](https://github.com/discordjs/discord.js/commit/4fc2c60a3bb43671b4b0202ae75eab42aba163ff))
## Refactor
- Deprecate `Formatter` class (#8373) ([7fd9ed8](https://github.com/discordjs/discord.js/commit/7fd9ed8f13d17ce7e98e34f7454d9047054d8467))
- **PermissionOverwriteManager:** Use `OverwriteType` (#8374) ([6d24805](https://github.com/discordjs/discord.js/commit/6d248051cfd431e9cb1c65cb98f56aa0a6556407))
## Typings
- **GuildAuditLogsEntryExtraField:** Use `AuditLogOptionsType` (#8349) ([200ab91](https://github.com/discordjs/discord.js/commit/200ab91f527d8a5706d277b89a975096f75d141a))
# [14.0.3](https://github.com/discordjs/discord.js/compare/14.0.2...14.0.3) - (2022-07-18)
## Bug Fixes
@@ -20,7 +57,7 @@ All notable changes to this project will be documented in this file.
- 14.0.1 release bump, no new features.
# [14.0.0](https://github.com/discordjs/discord.js/compare/13.9.0...14.0.0) - (2022-07-17)
# [14.0.0](https://github.com/discordjs/discord.js/compare/13.9.2...14.0.0) - (2022-07-17)
## Bug Fixes
@@ -426,6 +463,25 @@ All notable changes to this project will be documented in this file.
- AssertType -> expectType ([3f36746](https://github.com/discordjs/discord.js/commit/3f36746561a40cd61a7cd2e054b7ef80d58fc707))
- Fix cache types resolving to `never` (#7164) ([c978dbb](https://github.com/discordjs/discord.js/commit/c978dbb6233bcd85408caf0bca7619c9c5d508f0))
# [13.9.2](https://github.com/discordjs/discord.js/compare/13.9.1...13.9.2) - (2022-07-29)
## Bug Fixes
- **MessageMentions:** `ignoreRepliedUser` option in `has()` (v13) (#8365) ([d0a4199](https://github.com/discordjs/discord.js/commit/d0a4199760b4c7fe64f558d8d4d2302873f78b0e))
- **GuildChannelManager:** Allow unsetting rtcRegion (v13) (#8362) ([9612507](https://github.com/discordjs/discord.js/commit/96125079a23c87fe0fb3ee01a0de5a9889fc1057))
- **ThreadChannel:** Omit webhook fetching (v13) (#8352) ([4f7c1e3](https://github.com/discordjs/discord.js/commit/4f7c1e35c38bb9f1d524406c008ffceb2cfde3db))
# [13.9.1](https://github.com/discordjs/discord.js/compare/13.9.0...13.9.1) - (2022-07-23)
## Bug Fixes
- **ApplicationCommandManager:** Allow passing 0n to defaultMemberPermissions (v13) (#8312) ([4cf0555](https://github.com/discordjs/discord.js/commit/4cf05559a2cc6c4dfc409f8aab60256e5b030bca))
## Refactor
- **embed:** Deprecate addField (#8318) ([be35db2](https://github.com/discordjs/discord.js/commit/be35db2410c24fcca8b28ddfb3c1c580e7e2a22f))
- **Presence:** Remove redundant date parsing (v13) (#8341) ([e95caa7](https://github.com/discordjs/discord.js/commit/e95caa7e4515beab627b5394d011a6b6a8ae6a18))
# [13.9.0](https://github.com/discordjs/discord.js/compare/13.8.1...13.9.0) - (2022-07-17)
## Bug Fixes

View File

@@ -45,19 +45,18 @@ pnpm add discord.js
## Example usage
Install all required dependencies:
Install discord.js:
```sh-session
npm install discord.js @discordjs/rest
yarn add discord.js @discordjs/rest
pnpm add discord.js @discordjs/rest
npm install discord.js
yarn add discord.js
pnpm add discord.js
```
Register a slash command against the Discord API:
```js
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord.js');
const { REST, Routes } = require('discord.js');
const commands = [
{

View File

@@ -60,5 +60,5 @@ filter_commits = true
tag_pattern = "[0-9]*"
skip_tags = "v[0-9]*|9*|11*|12*|@discordjs*"
ignore_tags = ""
topo_order = false
date_order = true
sort_commits = "newest"

View File

@@ -1,6 +1,6 @@
{
"name": "discord.js",
"version": "14.0.3",
"version": "14.1.1",
"description": "A powerful library for interacting with the Discord API",
"scripts": {
"test": "yarn docs:test && yarn test:typescript",
@@ -64,7 +64,7 @@
"devDependencies": {
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^1.8.5",
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"dtslint": "^4.2.1",
"eslint": "^8.20.0",
"jest": "^28.1.3",

View File

@@ -180,9 +180,6 @@ exports.WelcomeScreen = require('./structures/WelcomeScreen');
exports.WebSocket = require('./WebSocket');
// External
exports.DiscordAPIError = require('@discordjs/rest').DiscordAPIError;
exports.HTTPError = require('@discordjs/rest').HTTPError;
exports.RateLimitError = require('@discordjs/rest').RateLimitError;
__exportStar(require('discord-api-types/v10'), exports);
__exportStar(require('@discordjs/builders'), exports);
__exportStar(require('@discordjs/rest'), exports);

View File

@@ -1,5 +1,6 @@
'use strict';
const { channelLink } = require('@discordjs/builders');
const { DiscordSnowflake } = require('@sapphire/snowflake');
const { ChannelType, Routes } = require('discord-api-types/v10');
const Base = require('./Base');
@@ -55,7 +56,7 @@ class BaseChannel extends Base {
* @readonly
*/
get url() {
return `https://discord.com/channels/${this.isDMBased() ? '@me' : this.guildId}/${this.id}`;
return this.isDMBased() ? channelLink(this.id) : channelLink(this.id, this.guildId);
}
/**

View File

@@ -73,8 +73,8 @@ class Embed {
* @typedef {Object} EmbedAssetData
* @property {?string} url The URL of the image
* @property {?string} proxyURL The proxy URL of the image
* @property {?string} height The height of the image
* @property {?string} width The width of the image
* @property {?number} height The height of the image
* @property {?number} width The width of the image
*/
/**

View File

@@ -1,5 +1,6 @@
'use strict';
const { messageLink } = require('@discordjs/builders');
const { Collection } = require('@discordjs/collection');
const { DiscordSnowflake } = require('@sapphire/snowflake');
const {
@@ -439,7 +440,7 @@ class Message extends Base {
* @readonly
*/
get url() {
return `https://discord.com/channels/${this.guildId ?? '@me'}/${this.channelId}/${this.id}`;
return this.inGuild() ? messageLink(this.channelId, this.id, this.guildId) : messageLink(this.channelId, this.id);
}
/**

View File

@@ -133,6 +133,13 @@ class MessageMentions {
*/
this._channels = null;
/**
* Cached users for {@link MessageMentions#parsedUsers}
* @type {?Collection<Snowflake, User>}
* @private
*/
this._parsedUsers = null;
/**
* Crossposted channel data.
* @typedef {Object} CrosspostedChannel
@@ -208,6 +215,23 @@ class MessageMentions {
return this._channels;
}
/**
* Any user mentions that were included in the message content
* <info>Order as they appear first in the message content</info>
* @type {Collection<Snowflake, User>}
* @readonly
*/
get parsedUsers() {
if (this._parsedUsers) return this._parsedUsers;
this._parsedUsers = new Collection();
let matches;
while ((matches = this.constructor.UsersPattern.exec(this._content)) !== null) {
const user = this.client.users.cache.get(matches[1]);
if (user) this._parsedUsers.set(user.id, user);
}
return this._parsedUsers;
}
/**
* Options used to check for a mention.
* @typedef {Object} MessageMentionsHasOptions
@@ -227,16 +251,23 @@ class MessageMentions {
*/
has(data, { ignoreDirect = false, ignoreRoles = false, ignoreRepliedUser = false, ignoreEveryone = false } = {}) {
const user = this.client.users.resolve(data);
const role = this.guild?.roles.resolve(data);
const channel = this.client.channels.resolve(data);
if (!ignoreRepliedUser && this.users.has(this.repliedUser?.id) && this.repliedUser?.id === user?.id) return true;
if (!ignoreEveryone && user && this.everyone) return true;
const userWasRepliedTo = user && this.repliedUser?.id === user.id;
if (!ignoreRepliedUser && userWasRepliedTo && this.users.has(user.id)) return true;
if (!ignoreDirect) {
if (this.users.has(user?.id)) return true;
if (this.roles.has(role?.id)) return true;
if (this.channels.has(channel?.id)) return true;
if (user && (!ignoreRepliedUser || this.parsedUsers.has(user.id)) && this.users.has(user.id)) return true;
const role = this.guild?.roles.resolve(data);
if (role && this.roles.has(role.id)) return true;
const channel = this.client.channels.resolve(data);
if (channel && this.channels.has(channel.id)) return true;
}
if (user && !ignoreEveryone && this.everyone) return true;
if (!ignoreRoles) {
const member = this.guild?.members.resolve(data);
if (member) {

View File

@@ -132,6 +132,23 @@ const {
* @returns {string}
*/
/**
* Formats a channel link for a channel.
* @method channelLink
* @param {Snowflake} channelId The id of the channel
* @param {Snowflake} [guildId] The id of the guild
* @returns {string}
*/
/**
* Formats a message link for a channel.
* @method messageLink
* @param {Snowflake} channelId The id of the channel
* @param {Snowflake} messageId The id of the message
* @param {Snowflake} [guildId] The id of the guild
* @returns {string}
*/
/**
* A message formatting timestamp style, as defined in
* [here](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles).

View File

@@ -1865,6 +1865,7 @@ export class MessageMentions {
private _channels: Collection<Snowflake, Channel> | null;
private readonly _content: string;
private _members: Collection<Snowflake, GuildMember> | null;
private _parsedUsers: Collection<Snowflake, User> | null;
public get channels(): Collection<Snowflake, Channel>;
public readonly client: Client;
@@ -1872,6 +1873,7 @@ export class MessageMentions {
public readonly guild: Guild;
public has(data: UserResolvable | RoleResolvable | ChannelResolvable, options?: MessageMentionsHasOptions): boolean;
public get members(): Collection<Snowflake, GuildMember> | null;
public get parsedUsers(): Collection<Snowflake, User>;
public repliedUser: User | null;
public roles: Collection<Snowflake, Role>;
public users: Collection<Snowflake, User>;
@@ -5620,4 +5622,4 @@ export type InternalDiscordGatewayAdapterCreator = (
// External
export * from 'discord-api-types/v10';
export * from '@discordjs/builders';
export { DiscordAPIError, HTTPError, RateLimitError } from '@discordjs/rest';
export * from '@discordjs/rest';

View File

@@ -5,5 +5,4 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
tsup.config.*.mjs
coverage/

View File

@@ -51,11 +51,10 @@
"devDependencies": {
"@favware/cliff-jumper": "^1.8.5",
"@types/jsdoc-to-markdown": "^7.0.3",
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"eslint": "^8.20.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"tsup": "^6.2.0",
"typescript": "^4.7.4",
"unbuild": "^0.7.6"
},

View File

@@ -1,5 +0,0 @@
import { createTsupConfig } from '../../tsup.config';
export default createTsupConfig({
minify: true,
});

View File

@@ -3,7 +3,7 @@ FROM node:16-alpine
WORKDIR /usr/proxy
# First copy over dependencies separate from src for better caching
COPY package.json yarn.lock tsconfig.json .yarnrc.yml tsup.config.ts ./
COPY package.json yarn.lock tsconfig.json .yarnrc.yml build.config.ts ./
COPY .yarn ./.yarn
COPY ./packages/proxy-container/package.json ./packages/proxy-container/

View File

@@ -60,5 +60,5 @@ filter_commits = true
tag_pattern = "@discordjs\\/proxy-container@.*"
skip_tags = "v[0-9]*|11|12"
ignore_tags = ""
topo_order = false
date_order = true
sort_commits = "newest"

View File

@@ -49,11 +49,10 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"eslint": "^8.20.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"tsup": "^6.2.0",
"typescript": "^4.7.4",
"unbuild": "^0.7.6"
},

View File

@@ -1,4 +0,0 @@
import { createTsupConfig } from '../../tsup.config';
// TODO: Set options to bundle node_modules - making the Docker image smaller
export default createTsupConfig({ minify: true, dts: false });

View File

@@ -5,5 +5,4 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
tsup.config.*.mjs
coverage/

View File

@@ -2,7 +2,7 @@
All notable changes to this project will be documented in this file.
# [@discordjs/proxy@1.1.0](https://github.com/discordjs/discord.js/tree/@discordjs/proxy@1.1.0) - (2022-07-17)
# [@discordjs/proxy@1.0.0](https://github.com/discordjs/discord.js/tree/@discordjs/proxy@1.1.0) - (2022-07-17)
## Bug Fixes

View File

@@ -60,5 +60,5 @@ filter_commits = true
tag_pattern = "@discordjs\\/proxy@.*"
skip_tags = "v[0-9]*|11|12"
ignore_tags = ""
topo_order = false
date_order = true
sort_commits = "newest"

View File

@@ -1,6 +1,6 @@
{
"name": "@discordjs/proxy",
"version": "1.0.0",
"version": "1.0.1",
"description": "Tools for running an HTTP proxy for Discord's API",
"scripts": {
"test": "vitest run",
@@ -62,7 +62,7 @@
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^1.8.5",
"@microsoft/api-extractor": "^7.28.6",
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"@types/supertest": "^2.0.12",
"c8": "^7.12.0",
"downlevel-dts": "^0.10.0",
@@ -70,7 +70,6 @@
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"supertest": "^6.2.4",
"tsup": "^6.2.0",
"typescript": "^4.7.4",
"unbuild": "^0.7.6",
"vitest": "^0.19.1"

View File

@@ -1,3 +0,0 @@
import { createTsupConfig } from '../../tsup.config';
export default createTsupConfig();

View File

@@ -5,5 +5,4 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
tsup.config.*.mjs
coverage/

View File

@@ -25,35 +25,6 @@ All notable changes to this project will be documented in this file.
- **collection:** Remove default export (#8053) ([16810f3](https://github.com/discordjs/discord.js/commit/16810f3e410bf35ed7e6e7412d517ea74c792c5d))
- Move all the config files to root (#8033) ([769ea0b](https://github.com/discordjs/discord.js/commit/769ea0bfe78c4f1d413c6b397c604ffe91e39c6a))
# [@discordjs/rest@1.0.0](https://github.com/discordjs/discord.js/compare/@discordjs/rest@0.6.0...@discordjs/rest@1.0.0) - (2022-07-17)
## Info
- 1.0.0 release bump, no new features.
# [@discordjs/rest@0.6.0](https://github.com/discordjs/discord.js/compare/@discordjs/rest@0.5.0...@discordjs/rest@0.6.0) - (2022-07-17)
## Documentation
- Add codecov coverage badge to readmes (#8226) ([f6db285](https://github.com/discordjs/discord.js/commit/f6db285c073898a749fe4591cbd4463d1896daf5))
## Features
- **builder:** Add max min length in string option (#8214) ([96c8d21](https://github.com/discordjs/discord.js/commit/96c8d21f95eb366c46ae23505ba9054f44821b25))
- Codecov (#8219) ([f10f4cd](https://github.com/discordjs/discord.js/commit/f10f4cdcd88ca6be7ec735ed3a415ba13da83db0))
- **docgen:** Update typedoc ([b3346f4](https://github.com/discordjs/discord.js/commit/b3346f4b9b3d4f96443506643d4631dc1c6d7b21))
- Website (#8043) ([127931d](https://github.com/discordjs/discord.js/commit/127931d1df7a2a5c27923c2f2151dbf3824e50cc))
- **docgen:** Typescript support ([3279b40](https://github.com/discordjs/discord.js/commit/3279b40912e6aa61507bedb7db15a2b8668de44b))
- Docgen package (#8029) ([8b979c0](https://github.com/discordjs/discord.js/commit/8b979c0245c42fd824d8e98745ee869f5360fc86))
- Use vitest instead of jest for more speed ([8d8e6c0](https://github.com/discordjs/discord.js/commit/8d8e6c03decd7352a2aa180f6e5bc1a13602539b))
- Add scripts package for locally used scripts ([f2ae1f9](https://github.com/discordjs/discord.js/commit/f2ae1f9348bfd893332a9060f71a8a5f272a1b8b))
## Refactor
- **rest:** Add content-type(s) to uploads (#8290) ([103a358](https://github.com/discordjs/discord.js/commit/103a3584c95a7b7f57fa62d47b86520d5ec32303))
- **collection:** Remove default export (#8053) ([16810f3](https://github.com/discordjs/discord.js/commit/16810f3e410bf35ed7e6e7412d517ea74c792c5d))
- Move all the config files to root (#8033) ([769ea0b](https://github.com/discordjs/discord.js/commit/769ea0bfe78c4f1d413c6b397c604ffe91e39c6a))
# [@discordjs/rest@0.5.0](https://github.com/discordjs/discord.js/compare/@discordjs/rest@0.4.0...@discordjs/rest@0.5.0) - (2022-06-04)
## Bug Fixes

View File

@@ -59,5 +59,5 @@ commit_parsers = [
filter_commits = true
tag_pattern = "@discordjs/rest@[0-9]*"
ignore_tags = ""
topo_order = false
date_order = true
sort_commits = "newest"

View File

@@ -64,13 +64,12 @@
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^1.8.5",
"@microsoft/api-extractor": "^7.28.6",
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"c8": "^7.12.0",
"downlevel-dts": "^0.10.0",
"eslint": "^8.20.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"tsup": "^6.2.0",
"typescript": "^4.7.4",
"unbuild": "^0.7.6",
"vitest": "^0.19.1"

View File

@@ -1,3 +0,0 @@
import { createTsupConfig } from '../../tsup.config';
export default createTsupConfig();

View File

@@ -5,5 +5,4 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
tsup.config.*.mjs
coverage/

View File

@@ -48,12 +48,11 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"c8": "^7.12.0",
"eslint": "^8.20.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"tsup": "^6.2.0",
"typescript": "^4.7.4",
"unbuild": "^0.7.6",
"vitest": "^0.19.1"

View File

@@ -1,5 +0,0 @@
import { createTsupConfig } from '../../tsup.config';
export default createTsupConfig({
minify: true,
});

View File

@@ -5,5 +5,4 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
tsup.config.*.mjs
coverage/

View File

@@ -59,5 +59,5 @@ commit_parsers = [
filter_commits = true
tag_pattern = "@discordjs/voice@[0-9]*"
ignore_tags = ""
topo_order = false
date_order = true
sort_commits = "newest"

View File

@@ -67,7 +67,7 @@
"@favware/cliff-jumper": "^1.8.5",
"@microsoft/api-extractor": "^7.28.6",
"@types/jest": "^28.1.6",
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"downlevel-dts": "^0.10.0",
"eslint": "^8.20.0",
"jest": "^28.1.3",
@@ -75,7 +75,6 @@
"mock-socket": "^9.1.5",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"tsup": "^6.2.0",
"tweetnacl": "^1.0.3",
"typescript": "^4.7.4",
"unbuild": "^0.7.6"

View File

@@ -1,3 +0,0 @@
import { createTsupConfig } from '../../tsup.config';
export default createTsupConfig();

View File

@@ -6,7 +6,6 @@ docs/**/*
!docs/index.yml
!docs/README.md
coverage/
tsup.config.*.mjs
.cache
build/
src/styles/unocss.css

View File

@@ -65,7 +65,7 @@
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^14.3.0",
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"@types/react-dom": "^18.0.6",
"@types/react-syntax-highlighter": "^15.5.4",
"@typescript-eslint/eslint-plugin": "^5.31.0",
@@ -89,7 +89,7 @@
"prettier": "^2.7.1",
"typescript": "^4.7.4",
"unocss": "^0.44.7",
"vercel": "^27.2.0",
"vercel": "^27.3.1",
"vitest": "^0.19.1"
},
"engines": {

View File

@@ -1,11 +1,12 @@
import type { ApiEnum, ApiModel } from '@microsoft/api-extractor-model';
import { DocItem } from './DocItem';
import { genToken, resolveDocComment, TokenDocumentation } from '~/util/parse.server';
import { CommentNodeContainer } from './comment/CommentNodeContainer';
import { genToken, TokenDocumentation } from '~/util/parse.server';
export interface EnumMemberData {
name: string;
initializerTokens: TokenDocumentation[];
summary: string | null;
summary: ReturnType<DocItem['toJSON']>['summary'];
}
export class DocEnum extends DocItem<ApiEnum> {
@@ -17,7 +18,9 @@ export class DocEnum extends DocItem<ApiEnum> {
this.members = item.members.map((member) => ({
name: member.name,
initializerTokens: member.initializerExcerpt?.spannedTokens.map((token) => genToken(this.model, token)) ?? [],
summary: resolveDocComment(member),
summary: member.tsdocComment
? new CommentNodeContainer(member.tsdocComment.summarySection, model, member).toJSON()
: null,
}));
}

View File

@@ -1,6 +1,7 @@
import type { ApiModel, ApiDeclaredItem } from '@microsoft/api-extractor-model';
import { CommentNodeContainer } from './comment/CommentNodeContainer';
import type { ReferenceData } from '~/util/model.server';
import { resolveName, genReference, resolveDocComment, TokenDocumentation, genToken } from '~/util/parse.server';
import { resolveName, genReference, TokenDocumentation, genToken } from '~/util/parse.server';
export type DocItemConstructor<T = DocItem> = new (...args: any[]) => T;
@@ -8,11 +9,12 @@ export class DocItem<T extends ApiDeclaredItem = ApiDeclaredItem> {
public readonly item: T;
public readonly name: string;
public readonly referenceData: ReferenceData;
public readonly summary: string | null;
public readonly model: ApiModel;
public readonly excerpt: string;
public readonly excerptTokens: TokenDocumentation[] = [];
public readonly kind: string;
public readonly remarks: CommentNodeContainer | null;
public readonly summary: CommentNodeContainer | null;
public constructor(model: ApiModel, item: T) {
this.item = item;
@@ -20,19 +22,25 @@ export class DocItem<T extends ApiDeclaredItem = ApiDeclaredItem> {
this.model = model;
this.name = resolveName(item);
this.referenceData = genReference(item);
this.summary = resolveDocComment(item);
this.excerpt = item.excerpt.text;
this.excerptTokens = item.excerpt.spannedTokens.map((token) => genToken(model, token));
this.remarks = item.tsdocComment?.remarksBlock
? new CommentNodeContainer(item.tsdocComment.remarksBlock.content, model, item.parent)
: null;
this.summary = item.tsdocComment?.summarySection
? new CommentNodeContainer(item.tsdocComment.summarySection, model, item.parent)
: null;
}
public toJSON() {
return {
name: this.name,
referenceData: this.referenceData,
summary: this.summary,
summary: this.summary?.toJSON() ?? null,
excerpt: this.excerpt,
excerptTokens: this.excerptTokens,
kind: this.kind,
remarks: this.remarks?.toJSON() ?? null,
};
}
}

View File

@@ -0,0 +1,22 @@
import type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';
import type { DocNode } from '@microsoft/tsdoc';
export class CommentNode<T extends DocNode = DocNode> {
public readonly node: T;
public readonly kind: string;
public readonly model: ApiModel;
public readonly parentItem: ApiItem | null;
public constructor(node: T, model: ApiModel, parentItem?: ApiItem) {
this.node = node;
this.kind = node.kind;
this.model = model;
this.parentItem = parentItem ?? null;
}
public toJSON() {
return {
kind: this.kind,
};
}
}

View File

@@ -0,0 +1,20 @@
import type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';
import type { DocNodeContainer } from '@microsoft/tsdoc';
import { createCommentNode } from '.';
import { CommentNode } from './CommentNode';
export class CommentNodeContainer<T extends DocNodeContainer = DocNodeContainer> extends CommentNode<DocNodeContainer> {
public readonly nodes: CommentNode[];
public constructor(container: T, model: ApiModel, parentItem?: ApiItem) {
super(container, model, parentItem);
this.nodes = container.nodes.map((node) => createCommentNode(node, model, parentItem));
}
public override toJSON() {
return {
...super.toJSON(),
nodes: this.nodes.map((node) => node.toJSON()),
};
}
}

View File

@@ -0,0 +1,22 @@
import type { ApiModel, ApiItem } from '@microsoft/api-extractor-model';
import type { DocFencedCode } from '@microsoft/tsdoc';
import { CommentNode } from './CommentNode';
export class FencedCodeCommentNode extends CommentNode<DocFencedCode> {
public readonly code: string;
public readonly language: string;
public constructor(node: DocFencedCode, model: ApiModel, parentItem?: ApiItem) {
super(node, model, parentItem);
this.code = node.code;
this.language = node.language;
}
public override toJSON() {
return {
...super.toJSON(),
code: this.code,
language: this.language,
};
}
}

View File

@@ -0,0 +1,54 @@
import type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';
import type { DocDeclarationReference, DocLinkTag } from '@microsoft/tsdoc';
import { CommentNode } from './CommentNode';
import { generatePath, resolveName } from '~/util/parse.server';
export function genToken(
model: ApiModel,
ref: DocDeclarationReference,
context: ApiItem | null,
): LinkTagCodeLink | null {
if (!context) {
return null;
}
const item = model.resolveDeclarationReference(ref, context).resolvedApiItem ?? null;
if (!item) {
return null;
}
return {
name: resolveName(item),
kind: item.kind,
path: generatePath(item.getHierarchy()),
};
}
export interface LinkTagCodeLink {
name: string;
kind: string;
path: string;
}
export class LinkTagCommentNode extends CommentNode<DocLinkTag> {
public readonly codeDestination: LinkTagCodeLink | null;
public readonly text: string | null;
public readonly urlDestination: string | null;
public constructor(node: DocLinkTag, model: ApiModel, parentItem?: ApiItem) {
super(node, model, parentItem);
this.codeDestination = node.codeDestination ? genToken(model, node.codeDestination, this.parentItem) : null;
this.text = node.linkText ?? null;
this.urlDestination = node.urlDestination ?? null;
}
public override toJSON() {
return {
...super.toJSON(),
text: this.text,
codeDestination: this.codeDestination,
urlDestination: this.urlDestination,
};
}
}

View File

@@ -0,0 +1,19 @@
import type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';
import type { DocPlainText } from '@microsoft/tsdoc';
import { CommentNode } from './CommentNode';
export class PlainTextCommentNode extends CommentNode<DocPlainText> {
public readonly text: string;
public constructor(node: DocPlainText, model: ApiModel, parentItem?: ApiItem) {
super(node, model, parentItem);
this.text = node.text;
}
public override toJSON() {
return {
...super.toJSON(),
text: this.text,
};
}
}

View File

@@ -0,0 +1,22 @@
import type { ApiModel, ApiItem } from '@microsoft/api-extractor-model';
import type { DocNode, DocPlainText, DocLinkTag, DocParagraph, DocFencedCode } from '@microsoft/tsdoc';
import { CommentNode } from './CommentNode';
import { CommentNodeContainer } from './CommentNodeContainer';
import { FencedCodeCommentNode } from './FencedCodeCommentNode';
import { LinkTagCommentNode } from './LinkTagCommentNode';
import { PlainTextCommentNode } from './PlainTextCommentNode';
export function createCommentNode(node: DocNode, model: ApiModel, parentItem?: ApiItem): CommentNode {
switch (node.kind) {
case 'PlainText':
return new PlainTextCommentNode(node as DocPlainText, model, parentItem);
case 'LinkTag':
return new LinkTagCommentNode(node as DocLinkTag, model, parentItem);
case 'Paragraph':
return new CommentNodeContainer(node as DocParagraph, model, parentItem);
case 'FencedCode':
return new FencedCodeCommentNode(node as DocFencedCode, model, parentItem);
default:
return new CommentNode(node, model, parentItem);
}
}

View File

@@ -1,5 +1,7 @@
import type { ReactNode } from 'react';
import { CommentSection } from './Comment';
import { HyperlinkedText } from './HyperlinkedText';
import type { DocItem } from '~/DocModel/DocItem';
import type { TokenDocumentation } from '~/util/parse.server';
export enum CodeListingSeparatorType {
@@ -9,7 +11,7 @@ export enum CodeListingSeparatorType {
export interface CodeListingProps {
name: string;
summary?: string | null;
summary?: ReturnType<DocItem['toJSON']>['summary'];
typeTokens: TokenDocumentation[];
separator?: CodeListingSeparatorType;
children?: ReactNode;
@@ -34,7 +36,7 @@ export function CodeListing({
<HyperlinkedText tokens={typeTokens} />
</h4>
</div>
{summary && <p className="text-dark-100 dark:text-gray-300">{summary}</p>}
{summary && <CommentSection textClassName="text-dark-100 dark:text-gray-300" node={summary} />}
{children}
</div>
</div>

View File

@@ -0,0 +1,61 @@
import Link from 'next/link';
import type { ReactNode } from 'react';
import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter';
import type { CommentNode } from '~/DocModel/comment/CommentNode';
import type { CommentNodeContainer } from '~/DocModel/comment/CommentNodeContainer';
import type { FencedCodeCommentNode } from '~/DocModel/comment/FencedCodeCommentNode';
import type { LinkTagCommentNode } from '~/DocModel/comment/LinkTagCommentNode';
import type { PlainTextCommentNode } from '~/DocModel/comment/PlainTextCommentNode';
export interface RemarksBlockProps {
node: ReturnType<CommentNode['toJSON']>;
textClassName?: string | undefined;
}
export function CommentSection({ node, textClassName }: RemarksBlockProps): JSX.Element {
const createNode = (node: ReturnType<CommentNode['toJSON']>): ReactNode => {
switch (node.kind) {
case 'PlainText':
return <span>{(node as ReturnType<PlainTextCommentNode['toJSON']>).text}</span>;
case 'Paragraph':
return (
<p className={textClassName}>
{(node as ReturnType<CommentNodeContainer['toJSON']>).nodes.map((node) => createNode(node))}
</p>
);
case 'SoftBreak':
return <br />;
case 'LinkTag': {
const { codeDestination, urlDestination, text } = node as ReturnType<LinkTagCommentNode['toJSON']>;
if (codeDestination) {
return <Link href={codeDestination.path}>{text ?? codeDestination.name}</Link>;
}
if (urlDestination) {
return <Link href={urlDestination}>{text ?? urlDestination}</Link>;
}
return null;
}
case 'FencedCodeBlock': {
const { language, code } = node as ReturnType<FencedCodeCommentNode['toJSON']>;
return <SyntaxHighlighter language={language}>{code}</SyntaxHighlighter>;
}
default:
break;
}
return null;
};
return (
<div>
{node.kind === 'Paragraph' || node.kind === 'Section' ? (
<>{(node as CommentNodeContainer).nodes.map(createNode)}</>
) : (
<>{createNode(node)}</>
)}
</div>
);
}

View File

@@ -1,10 +1,13 @@
import type { ReactNode } from 'react';
import { VscListSelection, VscSymbolParameter } from 'react-icons/vsc';
import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter';
import { vscDarkPlus } from 'react-syntax-highlighter/dist/cjs/styles/prism';
import { CodeListingSeparatorType } from './CodeListing';
import { CommentSection } from './Comment';
import { HyperlinkedText } from './HyperlinkedText';
import { Section } from './Section';
import { TypeParamTable } from './TypeParamTable';
import type { DocItem } from '~/DocModel/DocItem';
import { generateIcon } from '~/util/icon';
import type { TokenDocumentation, TypeParameterData } from '~/util/parse.server';
@@ -12,23 +15,33 @@ export interface DocContainerProps {
name: string;
kind: string;
excerpt: string;
summary?: string | null;
summary?: ReturnType<DocItem['toJSON']>['summary'];
children?: ReactNode;
extendsTokens?: TokenDocumentation[] | null;
implementsTokens?: TokenDocumentation[][];
typeParams?: TypeParameterData[];
}
export function DocContainer({ name, kind, excerpt, summary, typeParams, children, extendsTokens }: DocContainerProps) {
export function DocContainer({
name,
kind,
excerpt,
summary,
typeParams,
children,
extendsTokens,
implementsTokens,
}: DocContainerProps) {
return (
<>
<div className="bg-white dark:bg-dark border-b-solid border-gray border-0.5 border-width-0.5 sticky top-0 px-10 py-2">
<div className="flex flex-col min-h-full max-h-full grow">
<div className="border-0.5 border-gray px-10 py-2">
<h2 className="flex gap-2 items-center break-all m-0 dark:text-white">
{generateIcon(kind)}
{name}
</h2>
</div>
<div className="px-10 pt-5 pb-10">
<div className="min-h-full overflow-y-auto overflow-x-clip px-10 pt-5 pb-10">
<SyntaxHighlighter
wrapLines
wrapLongLines
@@ -40,25 +53,48 @@ export function DocContainer({ name, kind, excerpt, summary, typeParams, childre
</SyntaxHighlighter>
{extendsTokens?.length ? (
<div className="flex flex-row items-center dark:text-white gap-3">
<h3 className="m-0">Extends:</h3>
<h3 className="m-0">Extends</h3>
<h3 className="m-0">{CodeListingSeparatorType.Type}</h3>
<p className="font-mono break-all">
<HyperlinkedText tokens={extendsTokens} />
</p>
</div>
) : null}
{implementsTokens?.length ? (
<div className="flex flex-row items-center dark:text-white gap-3">
<h3 className="m-0">Implements</h3>
<h3 className="m-0">{CodeListingSeparatorType.Type}</h3>
<p className="font-mono break-all">
{implementsTokens.map((token, i) => (
<>
<HyperlinkedText key={i} tokens={token} />
{i < implementsTokens.length - 1 ? ', ' : ''}
</>
))}
</p>
</div>
) : null}
<div className="space-y-10">
<Section title="Summary" className="dark:text-white">
<p className="text-dark-100 dark:text-gray-300 m-0">{summary ?? 'No summary provided.'}</p>
<Section iconElement={<VscListSelection />} title="Summary" className="dark:text-white">
{summary ? (
<CommentSection textClassName="text-dark-100 dark:text-gray-300" node={summary} />
) : (
<p className="text-dark-100 dark:text-gray-300">No summary provided.</p>
)}
</Section>
{typeParams?.length ? (
<Section title="Type Parameters" className="dark:text-white" defaultClosed>
<Section
iconElement={<VscSymbolParameter />}
title="Type Parameters"
className="dark:text-white"
defaultClosed
>
<TypeParamTable data={typeParams} />
</Section>
) : null}
<div className="space-y-10">{children}</div>
</div>
</div>
</>
</div>
);
}

View File

@@ -19,7 +19,7 @@ export function HyperlinkedText({ tokens }: HyperlinkedTextProps) {
if (token.path) {
return (
<Link key={token.text} href={token.path}>
<a className="text-blue-500 dark:text-blue-300">{token.text}</a>
<a className="text-blue-500 dark:text-blue-300 no-underline">{token.text}</a>
</Link>
);
}

View File

@@ -29,7 +29,7 @@ export function ItemSidebar({ packageName, data, selectedMember }: ItemListProps
<FiMenu size={32} />
</button>
</div>
<div className="hidden lg:block lg:min-h-full overflow-y-auto overflow-x-clip py-7 px-4">
<div className="hidden lg:block lg:min-h-full overflow-y-auto overflow-x-clip py-3 px-4">
<ListSidebar members={data.members} title="test" selectedMember={selectedMember} />
</div>
</div>

View File

@@ -1,8 +1,14 @@
import { AnimatePresence, motion } from 'framer-motion';
import Link from 'next/link';
import { useState } from 'react';
import { VscChevronDown, VscChevronRight } from 'react-icons/vsc';
import {
VscSymbolClass,
VscSymbolEnum,
VscSymbolField,
VscSymbolInterface,
VscSymbolMethod,
VscSymbolVariable,
} from 'react-icons/vsc';
import type { ItemListProps } from './ItemSidebar';
import { Section } from './Section';
export type Members = ItemListProps['data']['members'];
@@ -57,61 +63,21 @@ function groupMembers(members: Members): GroupedMembers {
return { Classes, Functions, Enums, Interfaces, Types, Variables };
}
export function ListSidebarSection({ members, selectedMember, title }: ListSidebarSectionProps) {
const [showList, setShowList] = useState(true);
return (
<div>
<h3
className="flex items-center dark:text-white m-0 py-3 font-semibold gap-2 cursor-pointer"
onClick={() => setShowList(!showList)}
>
{showList ? <VscChevronDown size={20} /> : <VscChevronRight size={20} />}
{title}
</h3>
<AnimatePresence exitBeforeEnter initial={false}>
{showList ? (
<motion.div
className="ml-7 space-y-3"
transition={{ duration: 0.5, ease: [0.04, 0.62, 0.23, 0.98] }}
key="content"
initial="collapsed"
animate="open"
exit="collapsed"
variants={{
open: {
opacity: 1,
height: 'auto',
},
collapsed: {
opacity: 0,
height: 0,
},
}}
>
{members.map((member, i) => (
<div
key={i}
className="flex gap-2 whitespace-pre-wrap no-underline break-all text-blue-500 dark:text-blue-300"
>
<Link href={member.path}>
<a
className={`no-underline m-0 text-sm font-semibold ${
selectedMember === member.name
? 'text-blue-500 dark:text-blue-300'
: 'text-gray-500 dark:text-gray-300 hover:text-dark-100 dark:hover:text-white'
}`}
>
{member.name}
</a>
</Link>
</div>
))}
</motion.div>
) : null}
</AnimatePresence>
</div>
);
function resolveIcon(item: keyof GroupedMembers) {
switch (item) {
case 'Classes':
return <VscSymbolClass />;
case 'Enums':
return <VscSymbolEnum />;
case 'Interfaces':
return <VscSymbolInterface />;
case 'Types':
return <VscSymbolField />;
case 'Variables':
return <VscSymbolVariable />;
case 'Functions':
return <VscSymbolMethod />;
}
}
export function ListSidebar({ members, selectedMember }: ListSidebarSectionProps) {
@@ -119,14 +85,32 @@ export function ListSidebar({ members, selectedMember }: ListSidebarSectionProps
return (
<>
{Object.keys(groupItems).map((group, i) => (
<ListSidebarSection
key={i}
members={groupItems[group as keyof GroupedMembers]}
selectedMember={selectedMember}
title={group}
/>
))}
{(Object.keys(groupItems) as (keyof GroupedMembers)[])
.filter((group) => groupItems[group].length)
.map((group, i) => (
<Section iconElement={resolveIcon(group)} key={i} title={group} showSeparator={false}>
<div className="space-y-2">
{groupItems[group].map((member, i) => (
<div
key={i}
className="flex gap-2 whitespace-pre-wrap no-underline break-all text-blue-500 dark:text-blue-300"
>
<Link href={member.path}>
<a
className={`no-underline m-0 text-sm font-semibold ${
selectedMember === member.name
? 'text-blue-500 dark:text-blue-300'
: 'text-gray-500 dark:text-gray-300 hover:text-dark-100 dark:hover:text-white'
}`}
>
{member.name}
</a>
</Link>
</div>
))}
</div>
</Section>
))}
</>
);
}

View File

@@ -1,4 +1,5 @@
import { FiLink } from 'react-icons/fi';
import { CommentSection } from './Comment';
import { HyperlinkedText } from './HyperlinkedText';
import { ParameterTable } from './ParameterTable';
import type { DocMethod } from '~/DocModel/DocMethod';
@@ -43,7 +44,7 @@ export function MethodItem({ data }: MethodItemProps) {
</div>
</div>
<div className="mx-7 mb-5">
{data.summary && <p className="text-dark-100 dark:text-gray-300">{data.summary}</p>}
{data.summary && <CommentSection textClassName="text-dark-100 dark:text-gray-300" node={data.summary} />}
{data.parameters.length ? <ParameterTable data={data.parameters} /> : null}
</div>
</div>

View File

@@ -8,21 +8,31 @@ export interface SectionProps {
title: string;
className?: string | undefined;
defaultClosed?: boolean;
iconElement?: JSX.Element;
showSeparator?: boolean;
}
export function Section({ title, children, className, defaultClosed }: SectionProps) {
export function Section({
title,
children,
className,
defaultClosed,
iconElement,
showSeparator = true,
}: SectionProps) {
const [collapsed, setCollapsed] = useState(defaultClosed ?? false);
return (
<div className={className}>
<AnimatePresence initial={false}>
<h3
className="flex gap-2 whitespace-pre-wrap font-semibold dark:text-white cursor-pointer"
onClick={() => setCollapsed(!collapsed)}
>
{collapsed ? <VscChevronRight size={20} /> : <VscChevronDown size={20} />}
{title}
</h3>
<h3
className="flex gap-2 whitespace-pre-wrap font-semibold dark:text-white cursor-pointer"
onClick={() => setCollapsed(!collapsed)}
>
{collapsed ? <VscChevronRight size={20} /> : <VscChevronDown size={20} />}
{iconElement ?? null}
{title}
</h3>
<AnimatePresence initial={false} exitBeforeEnter>
{collapsed ? null : (
<>
<motion.div
@@ -37,14 +47,13 @@ export function Section({ title, children, className, defaultClosed }: SectionPr
height: 'auto',
paddingLeft: '1.75rem',
paddingRight: '1.75rem',
paddingBottom: '2.5rem',
},
collapsed: { opacity: 0, height: 0, paddingLeft: '1.75rem', paddingRight: '1.75rem', paddingBottom: 0 },
}}
>
{children}
</motion.div>
<Separator />
{showSeparator && <Separator />}
</>
)}
</AnimatePresence>

View File

@@ -1,3 +1,4 @@
import { VscSymbolConstant, VscSymbolMethod, VscSymbolProperty } from 'react-icons/vsc';
import { MethodList } from './MethodList';
import { ParameterTable } from './ParameterTable';
import { PropertyList } from './PropertyList';
@@ -11,7 +12,7 @@ export interface PropertiesSectionProps {
export function PropertiesSection({ data }: PropertiesSectionProps) {
return data.length ? (
<Section title="Properties" className="dark:text-white">
<Section iconElement={<VscSymbolProperty />} title="Properties" className="dark:text-white">
<PropertyList data={data} />
</Section>
) : null;
@@ -23,7 +24,7 @@ export interface MethodsSectionProps {
export function MethodsSection({ data }: MethodsSectionProps) {
return data.length ? (
<Section title="Methods" className="dark:text-white">
<Section iconElement={<VscSymbolMethod />} title="Methods" className="dark:text-white">
<MethodList data={data} />
</Section>
) : null;
@@ -35,7 +36,7 @@ export interface ParametersSectionProps {
export function ParametersSection({ data }: ParametersSectionProps) {
return data.length ? (
<Section title="Parameters" className="dark:text-white">
<Section iconElement={<VscSymbolConstant />} title="Parameters" className="dark:text-white">
<ParameterTable data={data} />
</Section>
) : null;

View File

@@ -9,12 +9,17 @@ export function SidebarLayout({
}: PropsWithChildren<Partial<ItemListProps & { data: { member: ReturnType<typeof findMember> } }>>) {
return (
<div className="flex flex-col lg:flex-row overflow-hidden max-w-full h-full max-h-full bg-white dark:bg-dark">
<div className="h-full w-full lg:max-w-[370px] lg:min-w-[370px]">
<div className="h-full w-full lg:max-w-[310px] lg:min-w-[310px]">
{packageName && data ? (
<ItemSidebar packageName={packageName} data={data} selectedMember={data.member?.name} />
) : null}
</div>
<div className="max-h-full grow overflow-x-hidden overflow-y-auto">{children}</div>
<div className="h-full grow">{children}</div>
<div className="h-full w-full lg:max-w-[310px] lg:min-w-[310px]">
{packageName && data?.member ? (
<ItemSidebar packageName={packageName} data={data} selectedMember={data.member.name} />
) : null}
</div>
</div>
);
}

View File

@@ -15,6 +15,7 @@ export function Class({ data }: ClassProps) {
summary={data.summary}
typeParams={data.typeParameterData}
extendsTokens={data.extendsTokens}
implementsTokens={data.implementsTokens}
>
<PropertiesSection data={data.properties} />
<MethodsSection data={data.methods} />

View File

@@ -1,3 +1,4 @@
import { VscSymbolEnumMember } from 'react-icons/vsc';
import { CodeListing, CodeListingSeparatorType } from '../CodeListing';
import { DocContainer } from '../DocContainer';
import { Section } from '../Section';
@@ -10,7 +11,7 @@ export interface EnumProps {
export function Enum({ data }: EnumProps) {
return (
<DocContainer name={data.name} kind={data.kind} excerpt={data.excerpt} summary={data.summary}>
<Section title="Members" className="dark:text-white">
<Section iconElement={<VscSymbolEnumMember />} title="Members" className="dark:text-white">
<div className="flex flex-col gap-5">
{data.members.map((member) => (
<CodeListing

View File

@@ -21,7 +21,7 @@ export function findPackage(model: ApiModel, name: string): ApiPackage | undefin
| undefined;
}
function generatePath(items: readonly ApiItem[]) {
export function generatePath(items: readonly ApiItem[]) {
let path = '/docs/main/packages/';
for (const item of items) {
switch (item.kind) {

View File

@@ -6,4 +6,3 @@ docs/**/*
!docs/index.yml
!docs/README.md
coverage/
tsup.config.*.mjs

19
packages/ws/CHANGELOG.md Normal file
View File

@@ -0,0 +1,19 @@
# Changelog
All notable changes to this project will be documented in this file.
# [@discordjs/ws@0.2.0](https://github.com/discordjs/discord.js/compare/@discordjs/ws@0.1.0...@discordjs/ws@0.2.0) - (2022-07-30)
## Bug Fixes
- **WebSocketShard:** Account code 1000 with no prior indication (#8399) ([5137bfc](https://github.com/discordjs/discord.js/commit/5137bfc17d763488083b76ee9008611df333272a))
# [@discordjs/ws@0.1.0](https://github.com/discordjs/discord.js/tree/@discordjs/ws@0.1.0) - (2022-07-27)
## Bug Fixes
- **WebSocketShard:** Use correct import (#8357) ([78d4295](https://github.com/discordjs/discord.js/commit/78d4295a40b83ea4f7cc830ff81927cba2d1d3f0))
## Features
- @discordjs/ws (#8260) ([748d727](https://github.com/discordjs/discord.js/commit/748d7271c45796479a29d8ed3101421de09ef867))

View File

@@ -59,5 +59,5 @@ commit_parsers = [
filter_commits = true
tag_pattern = "@discordjs/ws@[0-9]*"
ignore_tags = ""
topo_order = false
date_order = true
sort_commits = "newest"

View File

@@ -1,6 +1,6 @@
{
"name": "@discordjs/ws",
"version": "0.1.0-dev",
"version": "0.2.0",
"description": "Wrapper around Discord's gateway",
"scripts": {
"test": "vitest run",
@@ -65,13 +65,12 @@
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^1.8.5",
"@microsoft/api-extractor": "^7.28.6",
"@types/node": "^16.11.45",
"@types/node": "^16.11.46",
"c8": "^7.12.0",
"eslint": "^8.20.0",
"mock-socket": "^9.1.5",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"tsup": "^6.2.0",
"typescript": "^4.7.4",
"unbuild": "^0.7.6",
"undici": "^5.8.0",

View File

@@ -460,8 +460,20 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
private async onClose(code: number) {
switch (code) {
case 1000:
case 4200: {
case CloseCodes.Normal: {
this.debug([`Disconnected normally from code ${code}`]);
if (this.status === WebSocketShardStatus.Ready) {
return this.destroy({
code,
reason: 'Got disconnected by Discord',
recover: WebSocketShardDestroyRecovery.Reconnect,
});
}
break;
}
case CloseCodes.Resuming: {
this.debug([`Disconnected normally from code ${code}`]);
break;
}

View File

@@ -1,3 +0,0 @@
import { createTsupConfig } from '../../tsup.config';
export default createTsupConfig({ entry: ['./src/**/*.ts'], bundle: false });

View File

@@ -1,54 +0,0 @@
import { relative, resolve } from 'node:path';
import { defineConfig, type Options } from 'tsup';
type ConfigOptions = Pick<
Options,
| 'globalName'
| 'minify'
| 'entry'
| 'format'
| 'target'
| 'sourcemap'
| 'skipNodeModulesBundle'
| 'noExternal'
| 'esbuildOptions'
| 'dts'
| 'bundle'
>;
export const createTsupConfig = ({
globalName,
format = ['esm', 'cjs'],
dts = true,
target = 'es2021',
sourcemap = true,
minify = false,
entry = ['src/index.ts'],
skipNodeModulesBundle = true,
noExternal,
esbuildOptions = (options, context) => {
if (context.format === 'cjs') {
options.banner = {
js: '"use strict";',
};
}
},
bundle,
}: ConfigOptions = {}) =>
defineConfig({
clean: true,
dts,
entry,
format,
minify,
skipNodeModulesBundle,
sourcemap,
target,
tsconfig: relative(__dirname, resolve(process.cwd(), 'tsconfig.json')),
keepNames: true,
globalName,
noExternal,
esbuildOptions,
bundle,
shims: true,
});

391
yarn.lock
View File

@@ -1701,13 +1701,12 @@ __metadata:
resolution: "@discordjs/actions@workspace:packages/actions"
dependencies:
"@actions/core": ^1.9.0
"@types/node": ^16.11.45
"@types/node": ^16.11.46
c8: ^7.12.0
eslint: ^8.20.0
prettier: ^2.7.1
rollup-plugin-typescript2: 0.32.1
tslib: ^2.4.0
tsup: ^6.2.0
typescript: ^4.7.4
unbuild: ^0.7.6
vitest: ^0.19.1
@@ -1722,7 +1721,7 @@ __metadata:
"@favware/cliff-jumper": ^1.8.5
"@microsoft/api-extractor": ^7.28.6
"@sapphire/shapeshift": ^3.5.1
"@types/node": ^16.11.45
"@types/node": ^16.11.46
c8: ^7.12.0
discord-api-types: ^0.36.3
downlevel-dts: ^0.10.0
@@ -1732,7 +1731,6 @@ __metadata:
rollup-plugin-typescript2: 0.32.1
ts-mixer: ^6.0.1
tslib: ^2.4.0
tsup: ^6.2.0
typescript: ^4.7.4
unbuild: ^0.7.6
vitest: ^0.19.1
@@ -1746,13 +1744,12 @@ __metadata:
"@discordjs/docgen": "workspace:^"
"@favware/cliff-jumper": ^1.8.5
"@microsoft/api-extractor": ^7.28.6
"@types/node": ^16.11.45
"@types/node": ^16.11.46
c8: ^7.12.0
downlevel-dts: ^0.10.0
eslint: ^8.20.0
prettier: ^2.7.1
rollup-plugin-typescript2: 0.32.1
tsup: ^6.2.0
typescript: ^4.7.4
unbuild: ^0.7.6
vitest: ^0.19.1
@@ -1791,14 +1788,13 @@ __metadata:
"@discordjs/collection": "workspace:^"
"@favware/cliff-jumper": ^1.8.5
"@types/jsdoc-to-markdown": ^7.0.3
"@types/node": ^16.11.45
"@types/node": ^16.11.46
commander: ^9.4.0
eslint: ^8.20.0
jsdoc-to-markdown: ^7.1.1
prettier: ^2.7.1
rollup-plugin-typescript2: 0.32.1
tslib: ^2.4.0
tsup: ^6.2.0
typedoc: ^0.23.9
typescript: ^4.7.4
unbuild: ^0.7.6
@@ -1813,12 +1809,11 @@ __metadata:
dependencies:
"@discordjs/proxy": ^1.0.0
"@discordjs/rest": ^1.0.0
"@types/node": ^16.11.45
"@types/node": ^16.11.46
eslint: ^8.20.0
prettier: ^2.7.1
rollup-plugin-typescript2: 0.32.1
tslib: ^2.4.0
tsup: ^6.2.0
typescript: ^4.7.4
unbuild: ^0.7.6
languageName: unknown
@@ -1832,7 +1827,7 @@ __metadata:
"@discordjs/rest": ^1.0.0
"@favware/cliff-jumper": ^1.8.5
"@microsoft/api-extractor": ^7.28.6
"@types/node": ^16.11.45
"@types/node": ^16.11.46
"@types/supertest": ^2.0.12
c8: ^7.12.0
downlevel-dts: ^0.10.0
@@ -1841,7 +1836,6 @@ __metadata:
rollup-plugin-typescript2: 0.32.1
supertest: ^6.2.4
tslib: ^2.4.0
tsup: ^6.2.0
typescript: ^4.7.4
unbuild: ^0.7.6
undici: ^5.8.0
@@ -1859,7 +1853,7 @@ __metadata:
"@microsoft/api-extractor": ^7.28.6
"@sapphire/async-queue": ^1.3.2
"@sapphire/snowflake": ^3.2.2
"@types/node": ^16.11.45
"@types/node": ^16.11.46
c8: ^7.12.0
discord-api-types: ^0.36.3
downlevel-dts: ^0.10.0
@@ -1868,7 +1862,6 @@ __metadata:
prettier: ^2.7.1
rollup-plugin-typescript2: 0.32.1
tslib: ^2.4.0
tsup: ^6.2.0
typescript: ^4.7.4
unbuild: ^0.7.6
undici: ^5.8.0
@@ -1880,14 +1873,13 @@ __metadata:
version: 0.0.0-use.local
resolution: "@discordjs/scripts@workspace:packages/scripts"
dependencies:
"@types/node": ^16.11.45
"@types/node": ^16.11.46
c8: ^7.12.0
commander: ^9.4.0
eslint: ^8.20.0
prettier: ^2.7.1
rollup-plugin-typescript2: 0.32.1
tslib: ^2.4.0
tsup: ^6.2.0
typescript: ^4.7.4
unbuild: ^0.7.6
vitest: ^0.19.1
@@ -1906,7 +1898,7 @@ __metadata:
"@favware/cliff-jumper": ^1.8.5
"@microsoft/api-extractor": ^7.28.6
"@types/jest": ^28.1.6
"@types/node": ^16.11.45
"@types/node": ^16.11.46
"@types/ws": ^8.5.3
discord-api-types: ^0.36.3
downlevel-dts: ^0.10.0
@@ -1918,7 +1910,6 @@ __metadata:
prism-media: ^1.3.4
rollup-plugin-typescript2: 0.32.1
tslib: ^2.4.0
tsup: ^6.2.0
tweetnacl: ^1.0.3
typescript: ^4.7.4
unbuild: ^0.7.6
@@ -1938,7 +1929,7 @@ __metadata:
"@testing-library/jest-dom": ^5.16.4
"@testing-library/react": ^13.3.0
"@testing-library/user-event": ^14.3.0
"@types/node": ^16.11.45
"@types/node": ^16.11.46
"@types/react-dom": ^18.0.6
"@types/react-syntax-highlighter": ^15.5.4
"@typescript-eslint/eslint-plugin": ^5.31.0
@@ -1970,7 +1961,7 @@ __metadata:
sharp: ^0.30.7
typescript: ^4.7.4
unocss: ^0.44.7
vercel: ^27.2.0
vercel: ^27.3.1
vitest: ^0.19.1
languageName: unknown
linkType: soft
@@ -1985,7 +1976,7 @@ __metadata:
"@favware/cliff-jumper": ^1.8.5
"@microsoft/api-extractor": ^7.28.6
"@sapphire/async-queue": ^1.3.2
"@types/node": ^16.11.45
"@types/node": ^16.11.46
"@types/ws": ^8.5.3
"@vladfrangu/async_event_emitter": ^2.0.1
c8: ^7.12.0
@@ -1995,7 +1986,6 @@ __metadata:
prettier: ^2.7.1
rollup-plugin-typescript2: 0.32.1
tslib: ^2.4.0
tsup: ^6.2.0
typescript: ^4.7.4
unbuild: ^0.7.6
undici: ^5.8.0
@@ -3513,10 +3503,10 @@ __metadata:
languageName: node
linkType: hard
"@types/node@npm:^16.11.45":
version: 16.11.45
resolution: "@types/node@npm:16.11.45"
checksum: 57d61c951024f66d796e71e4a972faef266007398cd4e93a195822fea2d5deb41d0615f394a99ece89772b145ff057321d138c7e3442455dc7d785ff67cebde3
"@types/node@npm:^16.11.46":
version: 16.11.46
resolution: "@types/node@npm:16.11.46"
checksum: 9fff6b70fc8a47019c28f080ead5484bd4620fad1d25bfa3c55ebe444a1adbb7e339db5fcc33227d8a272232039221a31bf0b026c1b77410c49760976fa4cce1
languageName: node
linkType: hard
@@ -4024,40 +4014,41 @@ __metadata:
languageName: node
linkType: hard
"@vercel/build-utils@npm:5.0.4":
version: 5.0.4
resolution: "@vercel/build-utils@npm:5.0.4"
checksum: 0628daf26b6c190d5ca796a89b114d93992ff52f6ab674c608385510dc300e2cf838b76a1b5b7906ec1590ab434e10ab9186f49c984fa5fa8b59094e6fe667fc
"@vercel/build-utils@npm:5.0.6":
version: 5.0.6
resolution: "@vercel/build-utils@npm:5.0.6"
checksum: 031dd87f680bb47b392b697a8ea2c3d5db4ce060a9759274e58101b827ceead5af0fc6d391df674416f975b488a1ccebfd7826d35ccd21d4cb1ac783a28e838b
languageName: node
linkType: hard
"@vercel/go@npm:2.0.8":
version: 2.0.8
resolution: "@vercel/go@npm:2.0.8"
checksum: 8fe60f7019560d397d031884c0004ffee21cbc74d654c4ecc2e3aec156f348021fbfea57f23ae510a78666927d4d0f4bbe9924ea5e5be88c1e2ad57c44657115
"@vercel/go@npm:2.0.10":
version: 2.0.10
resolution: "@vercel/go@npm:2.0.10"
checksum: 514ed7004aa7b537d1408f28e8758091431dd5cdbc50e5f1314211513691b0c91cbf2a9d86f399e1295f8166dd6ca42a8b71efc06dafc809a1c241b94b025a8f
languageName: node
linkType: hard
"@vercel/hydrogen@npm:0.0.5":
version: 0.0.5
resolution: "@vercel/hydrogen@npm:0.0.5"
checksum: d4d6c380cfc089a83965cb0a13a1f0693a66e306a7caf7ab3c80938154570b429ada3a42b55cb7dd3ab7303625f921e42d7126356da788c4e9898fb355f78ed9
"@vercel/hydrogen@npm:0.0.7":
version: 0.0.7
resolution: "@vercel/hydrogen@npm:0.0.7"
checksum: e686370fb4c3fe23b1e49fe8881ed2ded8117fe1a597e27ed9612f1e319bf30532282338a8ff403eabdfe57d0821aaad77c283cf6559f49275ee053bd041ad2a
languageName: node
linkType: hard
"@vercel/next@npm:3.1.8":
version: 3.1.8
resolution: "@vercel/next@npm:3.1.8"
checksum: 8169da7f2b3c095170f68df43db9ad46f1fb073f09713f597cbae6d9c254572bf377b3dc2227ea9e7a4224e2960193f151812df5f5fba357f6d21569b1509f53
"@vercel/next@npm:3.1.10":
version: 3.1.10
resolution: "@vercel/next@npm:3.1.10"
checksum: 3988e20c274ea7ff64d4f453dd00dbb457954876d88c03f1c2635986aeb710602f52ce0e390cbfeeab1146c550130a5921d2cb36ee03e41b7986e61ace108c8a
languageName: node
linkType: hard
"@vercel/nft@npm:0.20.1":
version: 0.20.1
resolution: "@vercel/nft@npm:0.20.1"
"@vercel/nft@npm:0.21.0":
version: 0.21.0
resolution: "@vercel/nft@npm:0.21.0"
dependencies:
"@mapbox/node-pre-gyp": ^1.0.5
acorn: ^8.6.0
async-sema: ^3.1.1
bindings: ^1.4.0
estree-walker: 2.0.2
glob: ^7.1.3
@@ -4068,7 +4059,7 @@ __metadata:
rollup-pluginutils: ^2.8.2
bin:
nft: out/cli.js
checksum: 4c1c01ee1d9273b793fd2a580a82e91bf1afae8adc63105475c3c3df40c7599a074c44e79427ead77e6ece64c2c5d4841a9cfb0091f422fedb49cfdb5caa130c
checksum: 832e71f0770ce0f1a01da432ebceedc3a20bca1f6b99db1451134b889a96e69c23e9774f2eebeb507798f448de13770997bd851eecd80fff6b15fd1cfc5b1dda
languageName: node
linkType: hard
@@ -4079,12 +4070,12 @@ __metadata:
languageName: node
linkType: hard
"@vercel/node@npm:2.4.5":
version: 2.4.5
resolution: "@vercel/node@npm:2.4.5"
"@vercel/node@npm:2.5.1":
version: 2.5.1
resolution: "@vercel/node@npm:2.5.1"
dependencies:
"@types/node": "*"
"@vercel/build-utils": 5.0.4
"@vercel/build-utils": 5.0.6
"@vercel/node-bridge": 3.0.0
"@vercel/static-config": 2.0.1
edge-runtime: 1.0.1
@@ -4093,34 +4084,34 @@ __metadata:
node-fetch: 2.6.7
ts-node: 8.9.1
typescript: 4.3.4
checksum: 65b91d288979ce1e154c59b492aa27f37b6eb883a755ed47f2d88037018fb6f859039cd32bba84b827429be54fb3c12bd3e901d5f6175b9e3b9bab70210ae579
checksum: 401a8a3e856a775fc7adaebb1f019faf170506135c68b11c4a6724a413434393b524e988c028c7381a4bbc11657bad7efccdbc899b730c2e8990d602ac696668
languageName: node
linkType: hard
"@vercel/python@npm:3.1.0":
version: 3.1.0
resolution: "@vercel/python@npm:3.1.0"
checksum: deb472b7b0e958cba9e7cd7284c0b2b180cad73a81e103b7c7dd77d36629513030e0651b211570d7f0659179eb22a897ad5c862cdecb126357fefd37f26bf5f4
"@vercel/python@npm:3.1.2":
version: 3.1.2
resolution: "@vercel/python@npm:3.1.2"
checksum: bc985c0299d5202eb5512c69d7c655b6415c345b7263f012fbf7c362e127594f346f679a86de8fef30a7e49c97e480389975a8d3679043cdd27b0b1ba0107fe2
languageName: node
linkType: hard
"@vercel/redwood@npm:1.0.9":
version: 1.0.9
resolution: "@vercel/redwood@npm:1.0.9"
"@vercel/redwood@npm:1.0.11":
version: 1.0.11
resolution: "@vercel/redwood@npm:1.0.11"
dependencies:
"@vercel/nft": 0.20.1
"@vercel/nft": 0.21.0
"@vercel/routing-utils": 2.0.0
semver: 6.1.1
checksum: 63e5d1ad5a5b9d329e65cc88f6e1544374fe164fa4a43c1c2cbb7b26cf9933d12cde3126b042f98723bc9bcab6fa17b9a355a2ef0203715d7065021f7ddc594e
checksum: 4b045e02bc5c9469ac59f585a021728c8b4aaa865790366ae3b202a1386aef00c6fa7689a316ffc6c37d0131b0ea01cbba89eb9b0b1d3a4333e0d00668a59a6f
languageName: node
linkType: hard
"@vercel/remix@npm:1.0.10":
version: 1.0.10
resolution: "@vercel/remix@npm:1.0.10"
"@vercel/remix@npm:1.0.12":
version: 1.0.12
resolution: "@vercel/remix@npm:1.0.12"
dependencies:
"@vercel/nft": 0.20.1
checksum: 33d95c62b6970b01e07a7bb532a6f662a6cdcd4ad51b1c2a2c731caf4e8f2a3adcfc4fc774e02ecfde74d2ddf6676c097e4a5b7b80d220d3cf940de64436d667
"@vercel/nft": 0.21.0
checksum: 5ecce6aef8a02c30acd0e1dab0691934f38ca7a6bca3350f1bc07547bf2be7182b3ccab8878a58fdf1f75900bc5c07b6d7aa573b95e3943aa01edd40bf3f5c18
languageName: node
linkType: hard
@@ -4137,17 +4128,17 @@ __metadata:
languageName: node
linkType: hard
"@vercel/ruby@npm:1.3.16":
version: 1.3.16
resolution: "@vercel/ruby@npm:1.3.16"
checksum: 958d905c872990b006ead5d46fc0f48f84d8445a990351fcf75ca7340d8ad0a2d53cd82b216cc8a2de742edea574b1a3fe4bb3109cabc1ddd0a845882f981c04
"@vercel/ruby@npm:1.3.18":
version: 1.3.18
resolution: "@vercel/ruby@npm:1.3.18"
checksum: 24c8d7a3166b6874a641055b4612ad0646cff045c5a9827103a0f5a9bf941ebdbeb2fa1a3c8a28bf7f036b039776b5cd1130dcbf237a5546062b5d0d863f75a6
languageName: node
linkType: hard
"@vercel/static-build@npm:1.0.9":
version: 1.0.9
resolution: "@vercel/static-build@npm:1.0.9"
checksum: 93cc00416a73642c2e74b8d9b9adf1a0cf3efce514588119df08ee04eac55c9e71f39c9c9238fb09fa4740aa69e464e86aaee56d384a6dee4f75ee1e1b0ca691
"@vercel/static-build@npm:1.0.11":
version: 1.0.11
resolution: "@vercel/static-build@npm:1.0.11"
checksum: fac2e7fae85c6fef668968ac80fbe5d86efc0c84ab1c557a3f93ca82da35fcbcfbbb57466ad1621aabde355b8d1533d07ba12af94b43e8d2237020acaa817933
languageName: node
linkType: hard
@@ -4418,13 +4409,6 @@ __metadata:
languageName: node
linkType: hard
"any-promise@npm:^1.0.0":
version: 1.3.0
resolution: "any-promise@npm:1.3.0"
checksum: 0ee8a9bdbe882c90464d75d1f55cf027f5458650c4bd1f0467e65aec38ccccda07ca5844969ee77ed46d04e7dded3eaceb027e8d32f385688523fe305fa7e1de
languageName: node
linkType: hard
"anymatch@npm:^3.0.3, anymatch@npm:~3.1.2":
version: 3.1.2
resolution: "anymatch@npm:3.1.2"
@@ -4657,6 +4641,13 @@ __metadata:
languageName: node
linkType: hard
"async-sema@npm:^3.1.1":
version: 3.1.1
resolution: "async-sema@npm:3.1.1"
checksum: 07b8c51f6cab107417ecdd8126b7a9fe5a75151b7f69fdd420dcc8ee08f9e37c473a217247e894b56e999b088b32e902dbe41637e4e9b594d3f8dfcdddfadc5e
languageName: node
linkType: hard
"async@npm:^3.2.0":
version: 3.2.4
resolution: "async@npm:3.2.4"
@@ -5016,17 +5007,6 @@ __metadata:
languageName: node
linkType: hard
"bundle-require@npm:^3.0.2":
version: 3.0.4
resolution: "bundle-require@npm:3.0.4"
dependencies:
load-tsconfig: ^0.2.0
peerDependencies:
esbuild: ">=0.13"
checksum: 572ade4e799fa74a56fecc02b8d997f7cf652c9b87bf1cbe7aa98a72d536792a84f262d209d9552c8feabf57376fd2b7ff82e765ed024a15d6c1c086b553bd89
languageName: node
linkType: hard
"c8@npm:^7.12.0":
version: 7.12.0
resolution: "c8@npm:7.12.0"
@@ -5340,7 +5320,7 @@ __metadata:
languageName: node
linkType: hard
"chokidar@npm:^3.4.2, chokidar@npm:^3.5.1, chokidar@npm:^3.5.3":
"chokidar@npm:^3.4.2, chokidar@npm:^3.5.3":
version: 3.5.3
resolution: "chokidar@npm:3.5.3"
dependencies:
@@ -5682,13 +5662,6 @@ __metadata:
languageName: node
linkType: hard
"commander@npm:^4.0.0":
version: 4.1.1
resolution: "commander@npm:4.1.1"
checksum: d7b9913ff92cae20cb577a4ac6fcc121bd6223319e54a40f51a14740a681ad5c574fd29a57da478a5f234a6fa6c52cbf0b7c641353e03c648b1ae85ba670b977
languageName: node
linkType: hard
"commander@npm:^5.1.0":
version: 5.1.0
resolution: "commander@npm:5.1.0"
@@ -6285,7 +6258,7 @@ __metadata:
languageName: node
linkType: hard
"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4":
"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4":
version: 4.3.4
resolution: "debug@npm:4.3.4"
dependencies:
@@ -6540,7 +6513,7 @@ __metadata:
"@discordjs/rest": "workspace:^"
"@favware/cliff-jumper": ^1.8.5
"@sapphire/snowflake": ^3.2.2
"@types/node": ^16.11.45
"@types/node": ^16.11.46
"@types/ws": ^8.5.3
discord-api-types: ^0.36.3
dtslint: ^4.2.1
@@ -7217,7 +7190,7 @@ __metadata:
languageName: node
linkType: hard
"esbuild@npm:^0.14.25, esbuild@npm:^0.14.47, esbuild@npm:^0.14.49":
"esbuild@npm:^0.14.47, esbuild@npm:^0.14.49":
version: 0.14.49
resolution: "esbuild@npm:0.14.49"
dependencies:
@@ -8491,20 +8464,6 @@ __metadata:
languageName: node
linkType: hard
"glob@npm:7.1.6":
version: 7.1.6
resolution: "glob@npm:7.1.6"
dependencies:
fs.realpath: ^1.0.0
inflight: ^1.0.4
inherits: 2
minimatch: ^3.0.4
once: ^1.3.0
path-is-absolute: ^1.0.0
checksum: 351d549dd90553b87c2d3f90ce11aed9e1093c74130440e7ae0592e11bbcd2ce7f0ebb8ba6bfe63aaf9b62166a7f4c80cb84490ae5d78408bb2572bf7d4ee0a6
languageName: node
linkType: hard
"glob@npm:^7.0.0, glob@npm:^7.1.1, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6":
version: 7.2.3
resolution: "glob@npm:7.2.3"
@@ -10556,13 +10515,6 @@ __metadata:
languageName: node
linkType: hard
"lilconfig@npm:^2.0.5":
version: 2.0.6
resolution: "lilconfig@npm:2.0.6"
checksum: 40a3cd72f103b1be5975f2ac1850810b61d4053e20ab09be8d3aeddfe042187e1ba70b4651a7e70f95efa1642e7dc8b2ae395b317b7d7753b241b43cef7c0f7d
languageName: node
linkType: hard
"lines-and-columns@npm:^1.1.6":
version: 1.2.4
resolution: "lines-and-columns@npm:1.2.4"
@@ -10656,13 +10608,6 @@ __metadata:
languageName: node
linkType: hard
"load-tsconfig@npm:^0.2.0":
version: 0.2.3
resolution: "load-tsconfig@npm:0.2.3"
checksum: e28d1b2725fda76ee69fa4ee21b1257fd5b77b12e1be09cdc0b67f953e62ffbc3e7ac1a6267ec21309f95310cd10635e28a3cb38d04be3f7d683c4fe7914d7a9
languageName: node
linkType: hard
"local-pkg@npm:^0.4.1, local-pkg@npm:^0.4.2":
version: 0.4.2
resolution: "local-pkg@npm:0.4.2"
@@ -10775,13 +10720,6 @@ __metadata:
languageName: node
linkType: hard
"lodash.sortby@npm:^4.7.0":
version: 4.7.0
resolution: "lodash.sortby@npm:4.7.0"
checksum: db170c9396d29d11fe9a9f25668c4993e0c1331bcb941ddbd48fb76f492e732add7f2a47cfdf8e9d740fa59ac41bbfaf931d268bc72aab3ab49e9f89354d718c
languageName: node
linkType: hard
"lodash.uniqwith@npm:^4.5.0":
version: 4.5.0
resolution: "lodash.uniqwith@npm:4.5.0"
@@ -11465,17 +11403,6 @@ __metadata:
languageName: node
linkType: hard
"mz@npm:^2.7.0":
version: 2.7.0
resolution: "mz@npm:2.7.0"
dependencies:
any-promise: ^1.0.0
object-assign: ^4.0.1
thenify-all: ^1.0.0
checksum: 8427de0ece99a07e9faed3c0c6778820d7543e3776f9a84d22cf0ec0a8eb65f6e9aee9c9d353ff9a105ff62d33a9463c6ca638974cc652ee8140cd1e35951c87
languageName: node
linkType: hard
"nan@npm:^2.14.0":
version: 2.16.0
resolution: "nan@npm:2.16.0"
@@ -11817,7 +11744,7 @@ __metadata:
languageName: node
linkType: hard
"object-assign@npm:^4.0.1, object-assign@npm:^4.1.0, object-assign@npm:^4.1.1":
"object-assign@npm:^4.1.0, object-assign@npm:^4.1.1":
version: 4.1.1
resolution: "object-assign@npm:4.1.1"
checksum: fcc6e4ea8c7fe48abfbb552578b1c53e0d194086e2e6bbbf59e0a536381a292f39943c6e9628af05b5528aa5e3318bb30d6b2e53cadaf5b8fe9e12c4b69af23f
@@ -12336,7 +12263,7 @@ __metadata:
languageName: node
linkType: hard
"pirates@npm:^4.0.1, pirates@npm:^4.0.4":
"pirates@npm:^4.0.4":
version: 4.0.5
resolution: "pirates@npm:4.0.5"
checksum: c9994e61b85260bec6c4fc0307016340d9b0c4f4b6550a957afaaff0c9b1ad58fbbea5cfcf083860a25cb27a375442e2b0edf52e2e1e40e69934e08dcc52d227
@@ -12384,24 +12311,6 @@ __metadata:
languageName: node
linkType: hard
"postcss-load-config@npm:^3.0.1":
version: 3.1.4
resolution: "postcss-load-config@npm:3.1.4"
dependencies:
lilconfig: ^2.0.5
yaml: ^1.10.2
peerDependencies:
postcss: ">=8.0.9"
ts-node: ">=9.0.0"
peerDependenciesMeta:
postcss:
optional: true
ts-node:
optional: true
checksum: 1c589504c2d90b1568aecae8238ab993c17dba2c44f848a8f13619ba556d26a1c09644d5e6361b5784e721e94af37b604992f9f3dc0483e687a0cc1cc5029a34
languageName: node
linkType: hard
"postcss@npm:8.4.14, postcss@npm:^8.4.14":
version: 8.4.14
resolution: "postcss@npm:8.4.14"
@@ -13361,7 +13270,7 @@ __metadata:
languageName: node
linkType: hard
"rollup@npm:^2.74.1, rollup@npm:^2.75.6, rollup@npm:^2.77.0":
"rollup@npm:^2.75.6, rollup@npm:^2.77.0":
version: 2.77.0
resolution: "rollup@npm:2.77.0"
dependencies:
@@ -13773,15 +13682,6 @@ __metadata:
languageName: node
linkType: hard
"source-map@npm:0.8.0-beta.0":
version: 0.8.0-beta.0
resolution: "source-map@npm:0.8.0-beta.0"
dependencies:
whatwg-url: ^7.0.0
checksum: e94169be6461ab0ac0913313ad1719a14c60d402bd22b0ad96f4a6cffd79130d91ab5df0a5336a326b04d2df131c1409f563c9dc0d21a6ca6239a44b6c8dbd92
languageName: node
linkType: hard
"source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.1":
version: 0.6.1
resolution: "source-map@npm:0.6.1"
@@ -14167,23 +14067,6 @@ __metadata:
languageName: node
linkType: hard
"sucrase@npm:^3.20.3":
version: 3.24.0
resolution: "sucrase@npm:3.24.0"
dependencies:
commander: ^4.0.0
glob: 7.1.6
lines-and-columns: ^1.1.6
mz: ^2.7.0
pirates: ^4.0.1
ts-interface-checker: ^0.1.9
bin:
sucrase: bin/sucrase
sucrase-node: bin/sucrase-node
checksum: 143c8bee97f5645973a512fdec535e1759014a8599bbf5e4c1915dd2a5fdef517684a9495369a6fb5fbd04357bb2fef65cbe4266a1a30f3e58fc37ef75722215
languageName: node
linkType: hard
"superagent@npm:^8.0.0":
version: 8.0.0
resolution: "superagent@npm:8.0.0"
@@ -14468,24 +14351,6 @@ __metadata:
languageName: node
linkType: hard
"thenify-all@npm:^1.0.0":
version: 1.6.0
resolution: "thenify-all@npm:1.6.0"
dependencies:
thenify: ">= 3.1.0 < 4"
checksum: dba7cc8a23a154cdcb6acb7f51d61511c37a6b077ec5ab5da6e8b874272015937788402fd271fdfc5f187f8cb0948e38d0a42dcc89d554d731652ab458f5343e
languageName: node
linkType: hard
"thenify@npm:>= 3.1.0 < 4":
version: 3.3.1
resolution: "thenify@npm:3.3.1"
dependencies:
any-promise: ^1.0.0
checksum: 84e1b804bfec49f3531215f17b4a6e50fd4397b5f7c1bccc427b9c656e1ecfb13ea79d899930184f78bc2f57285c54d9a50a590c8868f4f0cef5c1d9f898b05e
languageName: node
linkType: hard
"throttleit@npm:^1.0.0":
version: 1.0.0
resolution: "throttleit@npm:1.0.0"
@@ -14634,15 +14499,6 @@ __metadata:
languageName: node
linkType: hard
"tr46@npm:^1.0.1":
version: 1.0.1
resolution: "tr46@npm:1.0.1"
dependencies:
punycode: ^2.1.0
checksum: 96d4ed46bc161db75dbf9247a236ea0bfcaf5758baae6749e92afab0bc5a09cb59af21788ede7e55080f2bf02dce3e4a8f2a484cc45164e29f4b5e68f7cbcc1a
languageName: node
linkType: hard
"tr46@npm:~0.0.3":
version: 0.0.3
resolution: "tr46@npm:0.0.3"
@@ -14666,13 +14522,6 @@ __metadata:
languageName: node
linkType: hard
"ts-interface-checker@npm:^0.1.9":
version: 0.1.13
resolution: "ts-interface-checker@npm:0.1.13"
checksum: 20c29189c2dd6067a8775e07823ddf8d59a33e2ffc47a1bd59a5cb28bb0121a2969a816d5e77eda2ed85b18171aa5d1c4005a6b88ae8499ec7cc49f78571cb5e
languageName: node
linkType: hard
"ts-mixer@npm:^6.0.1":
version: 6.0.1
resolution: "ts-mixer@npm:6.0.1"
@@ -14847,42 +14696,6 @@ __metadata:
languageName: node
linkType: hard
"tsup@npm:^6.2.0":
version: 6.2.0
resolution: "tsup@npm:6.2.0"
dependencies:
bundle-require: ^3.0.2
cac: ^6.7.12
chokidar: ^3.5.1
debug: ^4.3.1
esbuild: ^0.14.25
execa: ^5.0.0
globby: ^11.0.3
joycon: ^3.0.1
postcss-load-config: ^3.0.1
resolve-from: ^5.0.0
rollup: ^2.74.1
source-map: 0.8.0-beta.0
sucrase: ^3.20.3
tree-kill: ^1.2.2
peerDependencies:
"@swc/core": ^1
postcss: ^8.4.12
typescript: ^4.1.0
peerDependenciesMeta:
"@swc/core":
optional: true
postcss:
optional: true
typescript:
optional: true
bin:
tsup: dist/cli-default.js
tsup-node: dist/cli-node.js
checksum: 2733bb2f568f7e8cb450bdfcf55a90cb1344639663dd559bb27eb1b5e0cc8ba0e1cad7b5fc5503029fa75e8ccd255a8da1265be145d5472e2c03bf6a906255ef
languageName: node
linkType: hard
"tsutils@npm:^2.29.0":
version: 2.29.0
resolution: "tsutils@npm:2.29.0"
@@ -15495,25 +15308,25 @@ __metadata:
languageName: node
linkType: hard
"vercel@npm:^27.2.0":
version: 27.2.0
resolution: "vercel@npm:27.2.0"
"vercel@npm:^27.3.1":
version: 27.3.1
resolution: "vercel@npm:27.3.1"
dependencies:
"@vercel/build-utils": 5.0.4
"@vercel/go": 2.0.8
"@vercel/hydrogen": 0.0.5
"@vercel/next": 3.1.8
"@vercel/node": 2.4.5
"@vercel/python": 3.1.0
"@vercel/redwood": 1.0.9
"@vercel/remix": 1.0.10
"@vercel/ruby": 1.3.16
"@vercel/static-build": 1.0.9
"@vercel/build-utils": 5.0.6
"@vercel/go": 2.0.10
"@vercel/hydrogen": 0.0.7
"@vercel/next": 3.1.10
"@vercel/node": 2.5.1
"@vercel/python": 3.1.2
"@vercel/redwood": 1.0.11
"@vercel/remix": 1.0.12
"@vercel/ruby": 1.3.18
"@vercel/static-build": 1.0.11
update-notifier: 5.1.0
bin:
vc: dist/index.js
vercel: dist/index.js
checksum: 07436a5f5b84abccea1bd6e69939d0b09741859d807daa12fdf5b8b09610c9c7edde9a225125fcd3a6dd14c12c9d3d59a927208d89324b6f5c4fda241a8a46e6
checksum: e2cca364039c191219a7161ed2fc96977e3fa9e3e8d82222d6387f051b2a046e22eda3bb8e0cf64815474511db081ee42abfdd67feaee4bd0d9a7b0d2039053e
languageName: node
linkType: hard
@@ -15665,13 +15478,6 @@ __metadata:
languageName: node
linkType: hard
"webidl-conversions@npm:^4.0.2":
version: 4.0.2
resolution: "webidl-conversions@npm:4.0.2"
checksum: c93d8dfe908a0140a4ae9c0ebc87a33805b416a33ee638a605b551523eec94a9632165e54632f6d57a39c5f948c4bab10e0e066525e9a4b87a79f0d04fbca374
languageName: node
linkType: hard
"webidl-conversions@npm:^7.0.0":
version: 7.0.0
resolution: "webidl-conversions@npm:7.0.0"
@@ -15705,17 +15511,6 @@ __metadata:
languageName: node
linkType: hard
"whatwg-url@npm:^7.0.0":
version: 7.1.0
resolution: "whatwg-url@npm:7.1.0"
dependencies:
lodash.sortby: ^4.7.0
tr46: ^1.0.1
webidl-conversions: ^4.0.2
checksum: fecb07c87290b47d2ec2fb6d6ca26daad3c9e211e0e531dd7566e7ff95b5b3525a57d4f32640ad4adf057717e0c215731db842ad761e61d947e81010e05cf5fd
languageName: node
linkType: hard
"which-boxed-primitive@npm:^1.0.2":
version: 1.0.2
resolution: "which-boxed-primitive@npm:1.0.2"
@@ -15911,7 +15706,7 @@ __metadata:
languageName: node
linkType: hard
"yaml@npm:^1.10.0, yaml@npm:^1.10.2":
"yaml@npm:^1.10.0":
version: 1.10.2
resolution: "yaml@npm:1.10.2"
checksum: ce4ada136e8a78a0b08dc10b4b900936912d15de59905b2bf415b4d33c63df1d555d23acb2a41b23cf9fb5da41c256441afca3d6509de7247daa062fd2c5ea5f