Commit Graph

101 Commits

Author SHA1 Message Date
Jacob Nguyen
f993e3fd66 feat: adding ModuleConfiguration helper fn and default module manager 2022-08-28 22:11:08 -05:00
Jacob Nguyen
b0e5512686 feat: update location of module typings 2022-08-28 22:11:05 -05:00
Jacob Nguyen
74378f0f12 feat: shrink package size, improve dev deps, esm and cjs support (#98)
* chore: fix tsc predicate type checking

* build: add tsup as bundler

* chore: revert text

* chore: fix predicates.ts, update dependencies, bump version

* docs: update example

* build: update dependencies

* fix: crash on collectors (#89)

* fix: crash on collectors

* feat: bump version for bug fix

* fix: crash on collectors pt

* docs: adding some documentation for docasaurus

* docs: add errors.ts comments

* docs: refactor comments

* docs: adding examples

* feat: refresh package-lock.json

* refactor: destructure and clean namespaces

* feat: add regen package.json script

* feat: add tsup, remove tsc, add scripts

* feat: update ts-results import style

* feat: readd typescript because idk if i should

* feat: breakup tsconfigs and add tsup config

* feat: add esm json tsconfig to git

* build: update dependencies and move to ts-result-es

* feat: remove unused function

* feat: update ts-results for esm/cjs interop!

* revert: remove version.txt

* build: goodbye tsc, hello tsup

* build: moving discord.js as dev dependency

* style: requested changes

* feat: add tsc back ( i missed you )

* build: bump version -> 1.0.0

* feat: syncing to main

* style: pretty

* feat: fix tsconfig issues with tsup

* revert: remove ExternallyUsed

* feat: update scripts

* build: update tsup and pkg-lock.json

* feat: refresh package-lock.json

* feat: test
2022-08-06 15:51:19 -05:00
Jacob Nguyen
17eb816ec9 refactor(events): use of classes for scalability & maintainability (#83)
Co-authored-by: EvolutionX-10 <evolutionx9777@gmail.com>
2022-07-16 23:38:11 +05:30
Jacob Nguyen
e71b63d261 feat(*)!: improve quality of code, refactorings, QOL intellisense (#64)
* feat: remove unit testing

* feat: make command modules return Awaitable void | unknown

* feat: more clear error for access message or interaction

* feat: make TextCommand and SlashCommand return more specific arg type

* feat: make TextCommand and SlashCommand return more specific arg type

* fix: Remove type reduction to never in onReady.ts

* feat: narrow typings for args Text and SlashCommand x3

* feat: make description optional, default is '...'

* feat: add sern events natively register in sern.init

* feat: remove jest.config.ts

* fix: forget to add SernEvent to Wrapper declaration

* feat: Make name and description defined when making plugins!

* Update README.md

* docs: Highly encourage to use cli

* chore: Improved package.json

* feat: Add .edit method and let .reply accept string

* fix: intellij warnings

* build: update discord.js to latest

* chore(deps): Removed typedoc

Removed typedoc dependency due we won't use it anymore

* fix: Fixed typo at SECURITY.md file

* feat: remove edit context method for future

* feat: remove docs folder

* feat: loading strategy slightly changed, does not throw error on finding no module in file

* feat: change typings of sern emitter

* feat: add generic to readFile.ts buildData, adding different event loading strategies

* feat: add events.ts for more customizable event handling

* refactor: type changes to adjust to event commands

* feat: revamp module types to support event plugins

* feat: rolling out more event loading support

* style: Improved plugin.ts comments

* style: Improved plugin.ts comments

* style: Improved readyEvent.ts comments

* feat: more support for event loading!!

* fix: re add import after rebase

* feat: more event handling progress

* feat: Cleaning up types

* refactor: Cleaning up and adding docs

* feat: Changing types of wrapper for external and sern emitter

* refactor: Adding some type aliases

* feat:  switch to match expression, add docs

* feat: more progress on event handling

* fix: complying to djs v14 build

* feat: Add basic event handling, no plugins checked yet!

* fix: Crash on interactionCreate event

* build(package.json): bump version

* build: bump to 1.0.4-beta

* feat: move new things to top level import

* feat: Separating events from command modules, leads separation of responsibility

* feat: add enum for event modules

* feat: Add more typings for event modules

* feat: Add more plugin definitions

* refactor: add asyncResolveArray.ts to resolve Awaitables easier

* feat: throw error on plugin usage for event listeners

* feat: throw error on plugin usage for event listeners

* feat: change from client -> wrapper

* style: eslint

* style: add comment

* feat: add absPath into commandPlugins!

* build: remove 'tests' exclude

* build: delete test.yml, change .prettierignore

* build: bump version to 1.1.0-beta

* docs(sern.ts): add comments for addExternal

* fix: forgot to add required type property in comment

* fix: load external event emitters correctly

* chore: rebased api update branch (#65)

Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
Co-authored-by: xxDeveloper <77380166+Murtatrxx@users.noreply.github.com>

Co-authored-by: xxDeveloper <77380166+Murtatrxx@users.noreply.github.com>
Co-authored-by: Evo <85353424+EvolutionX-10@users.noreply.github.com>
2022-06-28 12:38:01 -05:00
Jacob Nguyen
0ae541daba feat: Adding docs to some data structures, moving to default from export files 2022-05-25 17:17:55 -05:00
Jacob Nguyen
6c144defca fix: didn't run prettier, now i am 2022-05-19 23:03:39 -05:00
Jacob Nguyen
2d28800953 style: Run prettier 2022-05-19 22:54:46 -05:00
Jacob Nguyen
b8cda351e1 feat: should be able to register other nodejs event emitters 2022-05-19 12:57:14 -05:00
Jacob Nguyen
82f1bad8ff refactor: Bring CommandType and PluginType to top level 2022-05-17 17:10:01 -05:00
jacoobes
88dcdee818 feat: broadening EventPlugin default generic type, reformat with prettier 2022-05-13 14:33:17 -05:00
Jacob Nguyen
46b3b9574a chore: eslint formattting 2022-05-09 15:01:10 -05:00
Jacob Nguyen
8782cad9cd fix: accidentally imported wildcard from wrong place & namespace
resolution
2022-05-08 20:52:48 -05:00
Jacob Nguyen
d3e8943ca9 refactor: change from switch -> match 2022-05-07 22:35:24 -05:00
Jacob Nguyen
eeabecb4e2 feat(handler) : More work toward event plugins, added typings for it 2022-04-19 00:48:24 -05:00
Jacob Nguyen
4e1a8066d2 feat(handler) : refactored ready event and finished loading command
plugins
2022-04-15 22:45:01 -05:00
Jacob Nguyen
8866bff576 feat : plugin development and ensuring all module objs have name
property
2022-04-09 13:12:49 -05:00
Jacob Nguyen
490d6403d7 refactor : change naming conventions to PascalCase 2022-04-08 13:10:46 -05:00
Jacob Nguyen
e21508ca4f feat(handler) moving and organizing files, refactor context api 2022-04-04 17:40:51 -05:00
Jacob Nguyen
ef8e3961d1 feat(handler) run formatter and made message prefixes case insensitive 2022-04-03 17:13:13 -05:00
Jacob Nguyen
4ef0b87de7 feat(handler) Add button and select menu support! 2022-04-03 12:01:50 -05:00
Jacob Nguyen
b326a91d10 feat(interactionCreate) add basic context menu handling 2022-03-29 00:39:38 -05:00
Jacob Nguyen
b0d4f96900 feat : add typings for ctx menus 2022-03-26 02:34:36 -05:00
Jacob Nguyen
44e6e58fee feat(handler) improving context api 2022-03-22 22:35:31 -05:00
Jacob Nguyen
a227f1a8f2 feat(interactionCreate.ts) finish basic interaction handling for chat input commands 2022-03-22 00:47:06 -05:00
Jacob Nguyen
99aae7d780 feat(handler) added module type checking and started interactions handler 2022-03-20 14:49:14 -05:00
Jacob Nguyen
5b968ce442 feat(handler) create command-options interface, remove module 2022-03-13 01:37:24 -06:00
Jacob Nguyen
ecf7ecc92c feat(handler) finish loading command functionality, adjust properties
per cmd type
2022-03-11 17:31:44 -06:00
Jacob Nguyen
cdd8fced24 refactor(sern.ts) Slowly change handler class to init function 2022-03-11 11:25:34 -06:00
Jacob Nguyen
6d2af4728c feat(handler) Filters only executable messages now 2022-03-11 10:39:30 -06:00
Jacob Nguyen
10aee77315 feat(handler) begin message event and wrapper.prefix =
wrapper.defaultPrefix
2022-03-11 00:43:55 -06:00
Jacob Nguyen
df626e0864 feat(events) Moving default events to its own folder for organization 2022-03-09 14:25:20 -06:00
Jacob Nguyen
08f593792e feat(handler) new ready event handling
Also added new enum errors,
removed useless promise fn sign,
and more
2022-03-09 00:44:29 -06:00
Jacob Nguyen
0dd95be59a feat(sern.ts) Add basic event manager 2022-03-08 16:36:51 -06:00
Jacob Nguyen
cfb7df8451 feat(sern.ts) attempting to remove the bloated class in favor of smaller
functions, install rxjs
2022-03-08 11:43:38 -06:00
Jacob Nguyen
ff2427f876 perf(sern.ts) remove return await 2022-03-08 00:48:07 -06:00
Jacob Nguyen
9e4adf8bcf refactor(structures) create structures dir 2022-03-08 00:30:18 -06:00
Jacob Nguyen
36831def0f chore(module.ts) Move Command Modules to different file, change context objs to class counterparts 2022-03-07 23:49:38 -06:00
Jacob Nguyen
15d8a6a794 refactor(utilities): made markup.ts eslint compliant and added formatting to logger 2022-03-01 23:05:25 -06:00
jacoobes
00a5fa43ad feat(sern.ts): adding logging instead of large complaining messages from bot 2022-02-21 17:07:08 -06:00
jacoobes
40fb723143 feat(sern.ts): changed how module is passed around, now has name property at runtime 2022-02-21 02:00:12 -06:00
jacoobes
ef9d53e6b1 feat(sern.ts): beginning to add new basic logger system 2022-02-21 01:58:25 -06:00
jacoobes
d17f999d69 style(sern.ts): minimized code, refactor style 2022-02-21 00:51:00 -06:00
Jacob Nguyen
1397974fb6 feat(sern.ts): changing default value of args in text based cmd to string[], from string 2022-02-19 13:34:30 -06:00
Jacob Nguyen
b11f999674 feat(sern.ts): changing text-based command parser fn value to string[]
Keeping the type of args for fn parse as a string[] should allow users more flexibility
2022-02-19 13:21:44 -06:00
Jacob Nguyen
b19a41ddf0 style(src): ran eslint through project 2022-02-19 13:16:29 -06:00
xxDeveloper
0e795e63dd Merge branch 'main' of https://github.com/jacoobes/Sern 2022-02-16 22:57:53 +03:00
xxDeveloper
dad3042a64 feat: Improved TypeScript experince 2022-02-16 22:57:40 +03:00
jacoobes
7166947d28 fix(sern.ts): checking ctx instanceof Message always returned false 2022-02-15 20:23:35 -06:00
jacoobes
a2e43f518b refactor(sern.ts): interaction is guaranteed non null, i used null assertion 2022-02-15 18:23:52 -06:00