Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Docusaurus v3 and update docs #36

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fc4d2f4
feat: update channels, Modal and Tooltip
FedeIlLeone Sep 15, 2023
743f80b
feat: doc slash commands
FedeIlLeone Sep 15, 2023
fcc5de7
feat(injecting): more info for interaction
FedeIlLeone Sep 15, 2023
3472ae7
feat(injecting): clarify ephemeral, note for ts support
FedeIlLeone Sep 15, 2023
d4ee941
feat: update messages and constants
FedeIlLeone Sep 22, 2023
9818e76
Merge branch 'main' into v4.7.0
FedeIlLeone Sep 22, 2023
8caaa51
feat: new functions/props
FedeIlLeone Oct 12, 2023
527888f
fix: channel name
FedeIlLeone Oct 12, 2023
9a49397
feat(manifest): add splash key
FedeIlLeone Oct 12, 2023
09dbab1
feat(components): ErrorBoundary type update
FedeIlLeone Oct 12, 2023
e0f298a
feat(components): new loader enum
FedeIlLeone Oct 13, 2023
d4207ef
fix(manifest): main key no longer required for themes
FedeIlLeone Oct 19, 2023
e464a86
feat: upgrade to docusaurus v3
FedeIlLeone Nov 14, 2023
d2326dd
Merge branch 'main' of https://github.com/replugged-org/guide into do…
FedeIlLeone Nov 15, 2023
4fb84f0
fix: failing build
FedeIlLeone Dec 9, 2023
1243e66
feat: update constants and messages
FedeIlLeone Dec 9, 2023
df90f11
Merge branch 'main' of https://github.com/replugged-org/guide into do…
FedeIlLeone Feb 2, 2024
a7d6d09
chore: update deps
FedeIlLeone Feb 2, 2024
7364f26
feat: add missing mac keybinds
FedeIlLeone Feb 2, 2024
2a0a8d7
chore: add nvmrc
FedeIlLeone Feb 3, 2024
9a66773
chore: bump node version and update deps
FedeIlLeone May 26, 2024
0a09753
feat(docs): update modules
FedeIlLeone May 26, 2024
ea86788
chore: clear cspell config
FedeIlLeone May 26, 2024
dc28403
chore: bump pnpm
FedeIlLeone May 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20

- uses: pnpm/action-setup@v2
with:
version: latest

- name: Get pnpm store directory
id: pnpm-cache
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20

- uses: pnpm/action-setup@v2
with:
version: latest

- name: Get pnpm store directory
id: pnpm-cache
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20

- uses: pnpm/action-setup@v2
with:
version: latest

- name: Get pnpm store directory
id: pnpm-cache
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20

- uses: pnpm/action-setup@v2
with:
version: latest

- name: Get pnpm store directory
id: pnpm-cache
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.20.3
9 changes: 1 addition & 8 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@
"dictionaries": [],
"words": [
"asar",
"autosize",
"backoff",
"clsx",
"crosspost",
"discordapp",
"Flexbox",
"fullscreen",
"hljs",
"Imgur",
"Infima",
Expand All @@ -22,13 +17,11 @@
"replug",
"replugged",
"resizeable",
"scroller",
"Skema",
"Subcomponents",
"typeof",
"uninject",
"uninjected",
"updatertype",
"XLARGE",
"Vencord"
],
"ignoreWords": [],
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ to check for spelling errors. If you use VSCode, this is also set up in the reco
along with Prettier and ESLint and should show you spelling errors as you type. These will also be
checked when you run `pnpm run lint:fix`. If there is a word that cSpell says is an error but is
not, you can add it to [cspell.json](https://github.com/replugged-org/guide/tree/main/cspell.json).
In VSCode, you can do this from the Quick Actions menu (Ctrl+.) or in the right-click menu (under
"Spelling").
In VSCode, you can do this from the Quick Actions menu (<kbd>Ctrl</kbd> + <kbd>.</kbd> or
<kbd>Cmd</kbd> + <kbd>.</kbd>) or in the right-click menu (under "Spelling").

When creating a PR, these should be checked automatically by GitHub Actions and will fail if there
are formatting errors. If you are a first-time contributor, these might not run until we get to it,
Expand Down
8 changes: 4 additions & 4 deletions docs/contributing/replugged.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Please make sure you have the following installed and are using the correct vers

When you make changes, you can run `pnpm run build` to build the changes, or use `pnpm run watch` to
automatically rebuild when you edit a file. If you edited a file in the `renderer` folder, you can
reload Discord with <kbd>Ctrl</kbd> + <kbd>R</kbd> to apply your changes. However, editing files in
`main` requires you to fully quit and restart Discord.
reload Discord with <kbd>Ctrl</kbd> + <kbd>R</kbd> or <kbd>Cmd</kbd> + <kbd>R</kbd> to apply your
changes. However, editing files in `main` requires you to fully quit and restart Discord.

### Formatting

Expand All @@ -80,8 +80,8 @@ to check for spelling errors. If you use VSCode, this is also set up in the reco
along with Prettier and ESLint and should show you spelling errors as you type. These will also be
checked when you run `pnpm run lint:fix`. If there is a word that cSpell says is an error but is
not, you can add it to [cspell.json](https://github.com/replugged-org/guide/tree/main/cspell.json).
In VSCode, you can do this from the Quick Actions menu (Ctrl+.) or in the right-click menu (under
"Spelling").
In VSCode, you can do this from the Quick Actions menu (<kbd>Ctrl</kbd> + <kbd>.</kbd> or
<kbd>Cmd</kbd> + <kbd>.</kbd>) or in the right-click menu (under "Spelling").

When creating a PR, these should be checked automatically by GitHub Actions and will fail if there
are formatting errors. If you are a first-time contributor, these might not run until we get to it,
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/devtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ diagnostics about the result.
For plaintext patches to work, your patch MUST have a `find`! The extension was not made to parse
patches without them.

```js
```ts
export default [
{
find: "SOMETHING",
Expand Down
9 changes: 5 additions & 4 deletions docs/plugins/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ be changed to the username and repository of your plugin. For example, the plugi
at https://github.com/replugged-org/plugin-template, so the `updater.id` is
`replugged-org/plugin-template`.

:::caution
:::warning

Make sure you update the `updater.id` key to your plugin's repository. If you don't, Replugged will
try to update your plugin to the plugin template. Your users will have to uninstall and reinstall
Expand All @@ -94,8 +94,9 @@ After it's initially installed, the watch/build scripts will automatically reloa
Discord when you make changes. If you don't want it to do this, you can use the `--no-reload` flag
with your command to disable it.

Some plugins will require you to fully reload Discord (<kbd>Ctrl</kbd> + <kbd>R</kbd>) to apply
changes, for example if you are using plaintext patches (we will go over that later).
Some plugins will require you to fully reload Discord (<kbd>Ctrl</kbd> + <kbd>R</kbd> or
<kbd>Cmd</kbd> + <kbd>R</kbd>) to apply changes, for example if you are using plaintext patches (we
will go over that later).

## Building, updating, and releasing

Expand Down Expand Up @@ -147,7 +148,7 @@ and how to request approval, please see [this page](/docs/store).

You can create a link to install your plugin which will automatically open Replugged and prompt the
user to confirm the installation. For example:
<https://replugged.dev/install?identifier=replugged-org/plugin-template&source=github>.
https://replugged.dev/install?identifier=replugged-org/plugin-template&source=github.

- `identifier` - same as `updater.id` in the manifest
- `source` - same as `updater.source` in the manifest. Currently, `github` and `store` are
Expand Down
6 changes: 3 additions & 3 deletions docs/plugins/injecting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ The props of this component extend the attributes of the `div` element.
| `channel` | <APIReferences.Channel /> | | Channel of the message with the button popover; automatically added with the injection |
| `dangerous` | boolean | `false` | Whether the icon color is red |
| `disabled` | boolean | `false` | Whether the button is disabled |
| `icon` | <Required /> ComponentType<unknown\> | | Icon component |
| `iconProps` | Record<string,&nbsp;unknown> | | Props for the icon component |
| `icon` | <Required /> ComponentType\<unknown> | | Icon component |
| `iconProps` | Record\<string,&nbsp;unknown> | | Props for the icon component |
| `key` | string | | Button popover key; automatically added with the injection |
| `label` | <Required /> string | | Tooltip text |
| `message` | <APIReferences.Message /> | | Message with the button popover; automatically added with the injection |
| `onClick` | <Required /> (channel: <APIReferences.Channel />, message: <APIReferences.Message />, event: MouseEvent<HTMLDivElement\>) => void | | Function ran on button click |
| `onClick` | <Required /> (channel: <APIReferences.Channel />, message: <APIReferences.Message />, event: MouseEvent\<HTMLDivElement>) => void | | Function ran on button click |
| `selected` | boolean | `false` | Whether the button is selected |
| `separator` | boolean | `false` | Whether the button shows a divider among others |
| `sparkle` | boolean | `false` | Whether the button shows a sparkle effect |
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/modules/common/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Replugged comes with a bunch of modules that are commonly used. You can access t
import { common } from "replugged";
```

:::caution
:::warning

Your editor may suggest importing a module directly from within `replugged/dist/whatever`, but this
will not work. You should always import from `replugged` itself and destructure the module you want.
Expand Down
24 changes: 17 additions & 7 deletions docs/plugins/modules/common/stores/channels.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,36 @@ import RequiredNotice from "@site/src/components/RequiredNotice.mdx";
| `getChannelId` | `guildId`: string <br /> `fallbackToDefault`: boolean | string \| undefined | Gets the current selected channel id |
| `getChannelIds` | `guildId`: string | string[] | Gets all channel ids |
| `getCurrentlySelectedChannelId` | `guildId`: string | string \| undefined | Gets the current selected channel id |
| `getDebugInfo` | | [`DebugInfo`](#DebugInfo) | Gets some information useful for debugging the store |
| `getDMFromUserId` | <Required /> `userId`: string | string \| undefined | Gets the DM channel id by its user id |
| `getDMUserIds` | | string[] | Gets all DM channel ids |
| `getGuildChannelsVersion` | <Required /> `guildId`: string | number | Gets the channel version by guild id |
| `getInitialOverlayState` | | Record<string,&nbsp;<APIReferences.Channel />> | Gets all guild and DM channels |
| `getInitialOverlayState` | | Record\<string,&nbsp;<APIReferences.Channel />> | Gets all guild and DM channels |
| `getLastChannelFollowingDestination` | | [`LastChannelFollowingDestination`](#LastChannelFollowingDestination) | Gets information on the last channel follow |
| `getLastSelectedChannelId` | `guildId`: string | string \| undefined | Gets the last selected channel id |
| `getLastSelectedChannels` | <Required /> `guildId`: string | string \| undefined | Gets the last selected channel id by its guild id |
| `getMostRecentSelectedTextChannelId` | `guildId`: string | string \| null | Gets the last selected text channel id by its guild id |
| `getMutableBasicGuildChannelsForGuild` | <Required /> `guildId`: string | Record<string,&nbsp;<APIReferences.Channel />> | Gets all basic channels by its guild id |
| `getMutableGuildChannelsForGuild` | <Required /> `guildId`: string | Record<string,&nbsp;<APIReferences.Channel />> | Gets all channels by its guild id |
| `getMutablePrivateChannels` | | Record<string,&nbsp;<APIReferences.Channel />> | Gets all DM channels |
| `getMutableBasicGuildChannelsForGuild` | <Required /> `guildId`: string | Record\<string,&nbsp;<APIReferences.Channel />> | Gets all basic channels by its guild id |
| `getMutableDMsByUserIds` | | Record\<string,&nbsp;string> | Gets all DM channel ids mapped by its user id |
| `getMutableGuildChannelsForGuild` | <Required /> `guildId`: string | Record\<string,&nbsp;<APIReferences.Channel />> | Gets all channels by its guild id |
| `getMutablePrivateChannels` | | Record\<string,&nbsp;<APIReferences.Channel />> | Gets all DM channels |
| `getPrivateChannelsVersion` | | number | Gets the DM channel version |
| `getSortedPrivateChannels` | | <APIReferences.Channel />[] | Gets all DM channels sorted by the last message |
| `getVoiceChannelId` | | string \| null | Gets the current voice channel id |
| `hasChannel` | <Required /> `channelId`: string | boolean | Checks if the channel id is registered in the channel store |
| `loadAllGuildAndPrivateChannelsFromDisk` | | Record<string,&nbsp;<APIReferences.Channel />> | Gets all guild and DM channels |
| `loadAllGuildAndPrivateChannelsFromDisk` | | Record\<string,&nbsp;<APIReferences.Channel />> | Gets all guild and DM channels |

### Types {#channels-types}
### Types \{#channels-types}

#### `LastChannelFollowingDestination` {#LastChannelFollowingDestination}
#### `DebugInfo` \{#DebugInfo}

| Name | Type | Description |
| ------------------- | ---------------------------- | ----------------------------------------------------------------------------- |
| `guildSizes` | Record\<number,&nbsp;string> | Array of strings representing a guild id and how many channels that guild has |
| `loadedGuildIds` | string[] | Array of guild ids that have been loaded |
| `pendingGuildLoads` | string[] | Array of guild ids that are scheduled to be loaded |

#### `LastChannelFollowingDestination` \{#LastChannelFollowingDestination}

| Name | Type | Description |
| ----------- | ------ | --------------------------------------- |
Expand Down
Loading
Loading