Commit Graph

14 Commits

Author SHA1 Message Date
Jacob Nguyen
9a8904f5ae feat: v4 (#361)
* step 1

* Refactorings

* command modules do not depend on anything but itself

* tearing it up

* Remove module store, manager, and Intializable type

* consolidate interfaces in single file

* consolidate default services in single file

* TEAR IT UP

* fix text compile

* the end of sern init??

* Presence namespaced types removed

* internal namespace

* clean up dependencies

* fix test

* fix circular dependency

* still broken but progress

* remove barrel for core/structs

* reffactor

* refactor allat

* more refactoring

* prototyping linking static handler

* cleanup tests, codegen, and importing handler

* some refactor

* generify partition

* for now copy paste new ioc system

* removeiti

* fdsfD

* ensure container is init'd

* fix absPath gen

* working on bun compat

* refactor and clean up and reenter v3 module loading

* dsfsd

* refactor, add cron types, reinstante module loader

* ready handler revamped so much cleaner

* fdssdf

* refactor deps list

* add more tests, polish up ioc

* up to speed with event modules

* i think cron works

* cron works now, poc

* ksdjkldsfld

* updating ioc api, experimenting with cron

* save b4 thunder and lightning

* plugin data reduction & args changes

* freeze module after plugins, updateModule, and more

* simplify plugin args and prepare for reduction among plugins

* add deps to plugin calls and execute

* plugin system loking better, tbd type

* porg

* initplugins inject deps, inconspicuos

* fix faiklling test

* fix initPlugins not reassigning

* parsingParams kinda

* proper mapping

* dynamic customIds

* handling customId params working

* testing n shi

* inlineinignsd

* consolidate fmt

* once on eventModules

* refact,simplf

* readd vitest and Asset fn

* fix typings

* assets fn complete

* more intuitive context.options and Asset typings

* add init hooks not firing

* -file,-updateModule,publish?

* fix: ioc deps not created correctly

* documentation, add json for Asset

* remove asset

* ss

* finish ioc transition

* nvm, now i did

* s

* update locals api, docs, tests

* fix tests

* fix up tests and cleanup

* fix

* Update src/core/functions.ts

Co-authored-by: Evo <85353424+EvolutionX-10@users.noreply.github.com>

* better documentation

* temp fix

* namespace presence types again

* revising cron modules and better error messages

* scheduler ids

* more descriptive errors

* refactor to not type leak and job cancellation

* refactor n better signatures for task scheduler

* documentation

* fix swap not accepting functions

* change task signature

---------

Co-authored-by: Evo <85353424+EvolutionX-10@users.noreply.github.com>
2024-07-18 16:54:55 -05:00
Jacob Nguyen
48f9f6ec16 fix: rm deprecated class modules, clean up, rm indirection (#355)
* refactor: rm deprecations, clean up, rm indirection

* fix: singleton init not being fired when inserting function

* refactor and generic internal add

* deprecate a few things that i impusively added lol
2024-02-17 11:35:53 -06:00
45cbda7b42 refactor: cleanup (#348)
* some wip code

Co-authored-by: Jacob Nguyen <jacoobes@users.noreply.github.com>

* general idea

* style

* making shrimple truly optional

* got optional localizer working

* proposing api notation?

* prepare for localization map

* add localsFor

* merge some internals

* boss call

* add test for init functionality

* add documentation

* inline and cleanup

* feat: logging for experimental json loading

* loosen typings

* dev workflow and cleaning up comments

* cleaning up a bit more

* rename Localizer -> Localization

* more documentation, change dir for default localizer

* some tests

* "

* move stuff, refactor, deprecate

* yarnb

* Update index.ts

---------

Co-authored-by: Jacob Nguyen <jacoobes@users.noreply.github.com>
Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
Co-authored-by: jacob <jacoobes@sern.dev>
2024-02-09 17:46:16 -06:00
Jacob Nguyen
a359f73fa2 fix: crashing when slash command is used as text command (#349)
* progress on fix

* fix: ids
2024-01-07 15:26:08 -06:00
Jacob Nguyen
7458befe8a feat: presence (#345)
* presence

* from event presence and refactoring

* refine presence api

* add tests and more comments

* sss

---------

Co-authored-by: SrIzan10 <66965250+SrIzan10@users.noreply.github.com>
2023-12-27 11:11:32 -06:00
Jacob Nguyen
77fb00d386 feat/abstractiti (#340)
* progress on better error handling

* wiring onError callback through module loader and resolver

* fix error callbacks not being stored

* update onError to be record

* type alias

* wiring

* seems to work

* update error handling contract and wire more

* add command error builder

* fix merge

* progress on error handling

* naive onError handling, not tested

* progres

* proress

* progress on abstracting away iti

* seems to work

* fix tests

* better typings

* add doc

* abstracting iti

* remove onerror for this pr

* feat: better way to add dependencies

* fix tests
2023-12-15 16:09:13 -06:00
Jacob Nguyen
e59e0b9d40 test: add tests for context (#324) 2023-08-18 10:46:46 -05:00
Jacob Nguyen
26ccd118ff feat: dispose hooks (deprecate useContainerRaw) (#323)
* feat: dispose hooks

* build: unminify, add source map, deprecate useContainerRaw

* fix regression of context and fix tsup build
2023-08-17 12:51:24 -05:00
Jacob Nguyen
4b97d86908 chore: upgrade ts-results-es (#322) 2023-08-13 10:55:39 -05:00
Jacob Nguyen
a7f5ea269f fix: invalid id for cts, mts, cjs, mjs files, node paths (#318)
* better error messages

* fix: invalid id for cts, mts, cjs, mjs files
2023-08-06 10:43:34 -05:00
Jacob Nguyen
7798e36458 feat!: v3 (#294)
* refactor: move things to core, imports not fixed yet

* work on strategy and lifted Context

* remove id from lifted Context

* refactor: remove dependence on discord.js for module stoore

* moving and fixing imports

* chore: move operators into core

* chore: fix paths

* add wrapper platform field

* add deprecation warning

* chore:update paths

* chore:remove const function

* chore: remove deprecated symbols

* docs: add documentation to internal function

* chore: remove deprecated support for plugins

* chore: remove dependence on discord.js Awaitable type

* chore: update typings

* lift requiredDependencyKeys out of makeFetcher

* move strategy to index.ts and add adapters

* chore: fix typings

* chore: move command args matrix as binding

* feat: make Context platform specific, CoreContext as Core

* chore: remove extra file

* chore: move prettier into package.json

* chore(core): update imports and operators

* chore(core): add DefaultWrapper as sern classic

* move eslint and prettier configs to json

* chore: remove utils folder in favor of single file

* chore: remove redundant directories for single files

* chore: remove redundant directories for single files

* refactor: move and update things

* chore: move commands into seperate file

* chore: serverless work

* chore: remove redundant directories for single files

* chore: rename, wip refactoring

* chore: redundant directory

* refactor: internalize operators

* feat!: new module resolution algorithm

* chore: refactor and move things

* chore: refactor and add multiplatform typings

* chore: remove leaky import

* chore: add agnostic predicates

* chore: add old context here until i figure out what to do

* chore: update Proccessed typing to ./core

* chore: add tweetnacl

* revert: multiplatform

* revert: multiplatform

* chore: modularize and split typings

* chore: revert multiplatform

* chore: revert multi and mov sernEmitter

* chore: revert multi and clean up code

* refactor: add createGenericHandler

* refactor: remove unneeded signatures and fix imports

* feat: add getPublishableCommands to ModuleManager

* chore: remove bad imports

* style: pretty

* revert: remove AnyDependencies type

* refactor: fold switch case

* docs: specifics

* chore: change all file names to camel case

* refactor: change all files to camelcase and refactor

* revert: remove cloudflare typings

* feat: SernEmitter now captures promise rejections

* chore: fix InitArgs missing

* chore: move typings

* chore: move and clean

* chore: delete plugins dir

* chore: cleanup dispatchers subdirectory for single file

* chore: move context into structures directory

* refactor: cleaning up code and renaming variables

* chore: update name of function to reflect use

* revert: multiple entry points

* revert: readd discordEvent

* refactor: rename, format, move things

* feat: types organization and cleaning up code base

* fix: unaliased modules would throw error

* build: speed up build

* revert: readd module store and add contract

* add separate id for id processing

* chore: progress of globalizing dependencies type

* chore: update container and init hook progress

* style: format & lint

* feat: dev and prod mode

* fix: directories ignoring incorrectly

* refactor: move metadata outside of module declarations

* revert: re export command executable and event executable

* refactor: a lot

* fix: plugins for class modules and module loader

* style: pretty

* fix class based module loading

* feat: globalize dependencies type

* revert: internal name

* feat: add new sern emitter event

* refactor: remove cast

* refactor: add better typings for sern event modules

* test: add tests

* test: add more tests

* feat: change error handling contract

* chore: make changes in codebase after error contract change

* docs: add purpose of d.ts file

* revert removal of crash method and mark deprecated

* fix: typings for options- have access to all properties now

* refactor: npx knip

* 3.0.0-rc1

* chore: fix for version 3 and reexport old types

* fix: reexport payload and button modules

* fix: component commands incorrectly aligned and ordered

* chore: bump version

* test: add id generation testing

* refactor: algorithm for module resolution

* chore: bump vers

* test: add eventDispatcher test

* *.test.ts

* fix: autocomplete nested option

* chore: bump vers

* add npmignore .yarn

* feat: experimental loading sern.config.json

* refactor: simplify build

* chore: bump vers

* chore: add documentation for service api

* add since

* feat: add possible mode option in file loading mode

* refactor: remove two unneeded functions and refactor to throw early

* refactor: clean up handler code

* fix: undefined this binding

* refactor: clean up signatures and types

* refactor: make evident the internal api and move around stuff

* refactor: remove circular dependencies

* fix circulars and imports

* oops, moving around mroe stuff

* refresh lock

* chore: import type and prettier

* style: prettier

* feat: solidify init logic

* fix module-loading.ts

---------

Co-authored-by: jacoobes <jacobnguyend@gmail.com>
2023-07-29 17:10:19 -05:00
Jacob Nguyen
33f14467ec feat!: simpler plugins (#193)
* feat: experimental plugin changes

* more refactors and name changes

* feat: update name usage and update dispatchers.ts

* fix:naming

* feat: slightly safer typings than any[]

* fix: forgot to destructure arguments

* feat: add special function

* fix: typings

* feat: SUPER SIMPLIFY!!!

* refactor: move promisifiedPlugins closer to call site

* refactor: typings

* refactor: typings

* refactor: consolidate resolving initplugins into one function

* refactor: better types

* revert: remove unneeded function

* revert: remove unneeded function

* feat: dispatch work, simplify

* feat: move some observableHandling function to operators for clarity

* feat: simplify and document

* feat: simplifying sern and docs

* fix: typings

* docs: clarity of function name

* docs: add documentation for executeModule

* feat: contextArgs overloads

* docs: found out why

* fix: typings

* feat: shorten operators signature

* refactor: switch to correct convention

* refactor: take(1) -> first()

* refactor: revert

* refactor: safer typings (less any) and more accurate typings

* style: prettier and short type aliases

* fix: typings

* fix: typings

* docs: add deprecations

* refactor: organization and moving stuff

* pretty: prettey

* docs: describe file

* chore: update dependencies and version

* docs: fix link for docasaurus

* refactor: using a more appropriate operator function for closing an observable on crash

* fix!: changing single and many

* refactor: typings and simplifying composeRoot

* fix: re-add logger into handleError

* docs: comment

* docs: new section

* feat: help mitigate breaking changes

* feat: help mitigate breaking changes

* feat: help mitigate breaking changes and function overloads

* feat: deprecate instead of remove

* feat: partial remove and deprecate old symbols

* revert: trying to accommodate old plugins is too difficult

* docs: add many as deprecated

* docs: update

* feat: partial backwards compatability

* refactor: renaming, docs, and exports more clean

* refactor: context got a lot simpler

* refactor: imports

* docs: explain methods
2023-01-26 12:06:04 -06:00
github-actions[bot]
8d18c4b182 style: pretty please (#162)
* style: pretty please

* feat: no package.lock.json anymore

Co-authored-by: jacoobes <jacoobes@users.noreply.github.com>
Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
2022-12-28 14:40:19 -06:00
Jacob Nguyen
14556223fd feat!:(2.0 global services) (#156)
* style: prettier line feed changes

* style: prettier line feed changes

* feat: prototyping module manager

* feat: removing unused types

* feat: update location of module typings

* revert: port back to original interaction type checkers

* revert: port back to original interaction type checkers

* revert: remove unneeded type predicates

* feat: moving modules to its own contained class

* feat: getting global plugins some typings and adding contracts

* chore: fixing up and cleaning code

* feat: adding ModuleConfiguration helper fn and default module manager

* feat: solidifying contract

* revert: delete files

* chore: saving for later

* feat: prototyping module manager

* feat: removing unused types

* feat: update location of module typings

* revert: port back to original interaction type checkers

* revert: port back to original interaction type checkers

* revert: remove unneeded type predicates

* feat: moving modules to its own contained class

* feat: getting global plugins some typings and adding contracts

* chore: fixing up and cleaning code

* feat: adding ModuleConfiguration helper fn and default module manager

* feat: solidifying contract

* revert: delete files

* chore: saving for later

* feat: more merge conflicts

* feat: starting from scratch, add new typings

* feat: refactor ScopedPlugin typing

* feat: strengthening contracts

* chore: edit eslint

* feat: add addDependencies

* feat: add iti di

* feat: constfn util

* revert: delete old files

* remove: ModuleConfiguration

* feat: add sanity checker

* feat: add new error and update dependency

* feat: add sanity check for iti

* feat: add function helpers for di

* feat: add POC for sern di IOC

* feat: refactor DependenciesMap

* revert: remove old code

* feat: refactor makeDependencies fn

* chore(deps): update dependency @typescript-eslint/parser to v5.36.1 (#127)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @typescript-eslint/eslint-plugin to v5.36.1 (#126)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* docs: Fix the code example (#128)

* chore(deps): update dependency @typescript-eslint/eslint-plugin to v5.36.2 (#130)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: xxDeveloper <77380166+Murtatrxx@users.noreply.github.com>

* chore(deps): update dependency @typescript-eslint/parser to v5.36.2 (#131)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: xxDeveloper <77380166+Murtatrxx@users.noreply.github.com>

* feat: allow constructable modules (#133)

* Update readFile.ts

* Update userDefinedEventsHandling.ts

* Update readyHandler.ts

* fix: ts error

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

* revert: feat of allow constructable modules (#138)

Revert "feat: allow constructable modules (#133)"

This reverts commit 03936eb2ea.

* feat: update CODEOWNERS

* feat: classmodules@arcs (#143)

* feat: add class based commands

* docs: add deprecation warnings

* feat: add deprecation warnings

* feat: add more deprecation warnings

* feat: add prototype ClassModule abstract class

* feat: add EventModuleClass prototype, change names

* feat: more flexible contract

* feat: EventExecutable

* fix: typo

* feat: made abstract classes because of defaults

* fix: typings

* feat: update Context typings, update to djs v15

* chore: update typescript dependency

* chore: bump version

* chore: update ignore

* chore: prettier

* docs: change readme to be docusaurus compliant

* chore(main): release 1.2.0 (#145)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(autocomplete): now support multiple autocomplete options (#147)

* chore(main): release 1.2.1 (#148)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat: update location of module typings

* feat: getting global plugins some typings and adding contracts

* feat: adding ModuleConfiguration helper fn and default module manager

* feat: solidifying contract

* feat: removing unused types

* feat: update location of module typings

* feat: moving modules to its own contained class

* feat: getting global plugins some typings and adding contracts

* feat: solidifying contract

* revert: delete files

* chore: saving for later

* feat: more merge conflicts

* feat: starting from scratch, add new typings

* feat: strengthening contracts

* feat: add sanity check for iti

* feat: refactor DependenciesMap

* feat: adding POC back

* docs: add some deprecation warnings

* feat: remove client and sernEmitter

* feat: rebase global_services

* chore: oops rebase pkgjson fix

* fix: typings

* feat: iti update and getting di working

* feat: adding contracts and default provider

* feat: update typings and change logger

* fix: MapDeps typings and useContainer typings

* feat: moving handlers to 2.0

* feat: injecting crash handler

* feat: alpha logging injection?

* feat: injecting modulemanager in interactionhandler

* fix: typos and fixups

* fix: typos and fixups

* feat: moduleManager injection

* fix: crash on no module

* feat: i think optional dependencies work

* feat: add more optional support

* feat: make exclusion optional

* perf: simplify typings and reduce compile time

* fix: some typings adjustment, deprecating a field

* perf: simplifying plugin typings

* feat: remove addExternal

* feat: more simplifying typings

* perf: allow any and interfacify some types

* revert: remove horrendous Override type

* revert: delete interaction type predicates

* fix: unchecked cast to EventEmitter

* perf: remove unneeded creation of instance members

* feat: init test dir

* refactor: rename fn and short circuit name fn

* refactor: insert function

* feat: starting event module onEvent plugins and log payload

* feat: basic eventmodule event plugins?

* refactor: DRY

* feat: unify warning typing

* fix: typings

* feat: more progress on new eventModules

* feat: event modules with plugins!!?!?

* feat: making sernEmitter create default!!, readjust typings

* feat: inject sernEmitter emits and catch possible errors

* feat: add optionality to Logger dep type

* feat: context upgrade, fix circular emissions, crap ton of shit

* feat!: Module -> AnyModule, Added new SelectMenuInteractions, Changed some CommandType names

* feat: rudimentary onClick handler

* feat!: rename select menu command types, no distinguishing between text and alias

* docs: adding docs

* fix: forgot to change

* fix: logging undefined

* revert: remove spreadparams

* feat: export useContainerRaw function and fix smol bug

* feat: add iti DI disposeAll on crash

* fix: deferred execute

* feat!: rename BasePlugin -> Plugin

* feat: commandplugins for event modules, ill test later

* refactor: rename

* refactor: remove import

* feat: add deprecation warnings

* feat: update documentation comments

* perf: static'ify command plugin and event plugin typings

* refactor: remove redundant assignment

* feat: switch to pnpm

* chore: update pnpm lock

* fix: errors crashing and completing subscription

* feat: update example

* fix: overriding dependencies no matter what

* fix: bad rxjs docs

* refactor: destructuring

* feat: update typings for addDisposer

* feat: update packageManager field in package.json

* feat: grammar

Co-authored-by: jacoobes <jacobnguyend@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: xxDeveloper <77380166+Murtatrxx@users.noreply.github.com>
Co-authored-by: Arcs <73959934+HighArcs@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Evo <85353424+EvolutionX-10@users.noreply.github.com>
2022-12-28 14:18:36 -06:00