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

feat: moduleinfo-in-eventplugins #373

Merged
merged 2 commits into from
Jan 6, 2025
Merged

feat: moduleinfo-in-eventplugins #373

merged 2 commits into from
Jan 6, 2025

Conversation

jacoobes
Copy link
Member

@jacoobes jacoobes commented Jan 4, 2025

  • docs
  • pluigins have access to the module its being run in
import { CommandControlPlugin, CommandType, controller } from "@sern/handler";


export default CommandControlPlugin((s, sdt)=> { 
    console.log(sdt.module.meta); 
    return controller.next() 
})

yields:

{
  module: {
   name: 'ping',
   description: 'A ping command',
   locals: {},
   meta: {
     id: 'ping_B',
     absPath: 'file:///~'
   }
 }
}
{
 id: 'ping_B',
 absPath: 'file:///~'
}

@jacoobes jacoobes marked this pull request as draft January 4, 2025 06:21
@jacoobes jacoobes requested a review from DuroCodes January 4, 2025 17:12
@jacoobes jacoobes marked this pull request as ready for review January 4, 2025 17:12
Copy link
Contributor

@DuroCodes DuroCodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me; more jsdoc on things is good—maybe could include an example of module info in the plugin examples?

i'll probably write some more documentation on sern.dev soon™

@jacoobes jacoobes merged commit 220a60e into main Jan 6, 2025
4 checks passed
@jacoobes jacoobes deleted the moduleinfo branch January 12, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants