3 Commits

Author SHA1 Message Date
jacob
6fb9c98a47 more info 2023-09-25 11:00:45 -05:00
jacob
c7a06a0779 more info 2023-09-25 11:00:06 -05:00
jacob
a48f96841a fix: add missing documentation 2023-09-24 18:36:48 -05:00
6 changed files with 22513 additions and 7902 deletions

View File

@@ -183,17 +183,6 @@ const config = {
entryPoints: ['../sernHandlerV2/src/index.ts'],
tsconfig: '../sernHandlerV2/tsconfig.json',
},
"@dipakparmar/docusaurus-plugin-umami",
/** @type {import('@dipakparmar/docusaurus-plugin-umami').Options} */
({
websiteID: "e82ff65c-b08f-47b5-8e74-5c31cbcec0ad",
analyticsDomain: "analytics.srizan.dev",
scriptName: 'ua.js',
dataAutoTrack: true,
dataDoNotTrack: true,
dataCache: true,
dataDomains: "sern.dev",
}),
]
]
};

View File

@@ -33,22 +33,32 @@ If you do not know how to obtain either of these credentials, [click here](https
- Automatically syncs api with your command base
- generates JSON file of output (**.sern/command-data-remote.json**)
- supports publishing direct esm typescript files
- commonjs users need to compile first and then run sern publish on the dist/ output
- commonjs + javascript users need to compile first and then run sern publish on the dist/ output
- prerequire scripts.
- supports a configuration that is the same as the original publish plugin.
Each command file can have an extra config that follows this typescript interface:
PermissionResolvable is a discord.js type, but it will accept anything that the discord API accepts
Each command file can have an extra config that follows `ValidPublishOptions`:
## Config
```ts
interface ValidPublishOptions {
guildIds: string[];
dmPermission: boolean;
defaultMemberPermissions: PermissionResolvable;
}
type ValidMemberPermissions =
| PermissionFlagBits //discord.js enum
| PermissionFlagBits[] //array of discord.js enum
| string //must be a stringified number
| bigint
interface PublishConfig {
guildIds?: string[];
dmPermission?: boolean;
defaultMemberPermissions: ValidMemberPermissions;
}
type ValidPublishOptions =
| PublishConfig
| (absPath: string, module: CommandModule) => PublishConfig
```
In other words, you can export a function or object.
## Prerequiring
Is there a [service](../guide/walkthrough/services) that is required at the top level of a command?
- Create an ES6 script anywhere:
@@ -58,9 +68,8 @@ import { makeDependencies, single, Service } from '@sern/handler'
import { Client } from 'discord.js'
await makeDependencies({
build: (root) =>
root.add({ "@sern/client": single(() => new Client(...options)) }),
});
root => root.add({ '@sern/client': single(() => new Client(...options) }))
})
await Service('@sern/client').login()
```

View File

@@ -177,27 +177,16 @@ const config = {
darkTheme: darkCodeTheme,
},
}),
plugins : [
[
// 'docusaurus-plugin-typedoc',
// {
// //if you're editing website, please change this to your local branch of sern to generate documentation
// entryPoints: ['../sernHandlerV2/src/index.ts'],
// tsconfig: '../sernHandlerV2/tsconfig.json',
// },
"@dipakparmar/docusaurus-plugin-umami",
/** @type {import('@dipakparmar/docusaurus-plugin-umami').Options} */
({
websiteID: "e82ff65c-b08f-47b5-8e74-5c31cbcec0ad",
analyticsDomain: "analytics.srizan.dev",
scriptName: 'ua.js',
dataAutoTrack: true,
dataDoNotTrack: true,
dataCache: true,
dataDomains: "sern.dev",
}),
]
]
// plugins : [
// [
// 'docusaurus-plugin-typedoc',
// {
// //if you're editing website, please change this to your local branch of sern to generate documentation
// entryPoints: ['../sernHandlerV2/src/index.ts'],
// tsconfig: '../sernHandlerV2/tsconfig.json',
// },
// ]
// ]
};
module.exports = config;

22482
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -17,7 +17,6 @@
"typedoc-json": "typedoc --json ../sern-community/docs.json --pretty --entryPoints ../sernHandlerV2/src/index.ts --tsconfig ../sernHandlerV2/tsconfig.json --excludeExternals"
},
"dependencies": {
"@dipakparmar/docusaurus-plugin-umami": "^2.1.1",
"@docusaurus/core": "^2.4.0",
"@docusaurus/plugin-content-pages": "^2.4.0",
"@docusaurus/preset-classic": "^2.4.0",

7857
yarn.lock

File diff suppressed because it is too large Load Diff