Skip to content

sample api for plugins#119

Closed
anithri wants to merge 9 commits into
jondot:masterfrom
anithri:pluginsV2
Closed

sample api for plugins#119
anithri wants to merge 9 commits into
jondot:masterfrom
anithri:pluginsV2

Conversation

@anithri

@anithri anithri commented May 30, 2019

Copy link
Copy Markdown
Contributor

A Follow on from #100

The main assumptions are that the plugins are meant to be run, and their results stored in the args to be used when the template is processed.

plugins are defined in .hygen.js and consist of a function that takes (action, args, config)

pros: simple api, easy to add

cons: crude mechanism to insert result of plugin into args, not needed?

@anithri anithri mentioned this pull request May 30, 2019
@anithri

anithri commented Jun 1, 2019

Copy link
Copy Markdown
Contributor Author

Incomplete, but I wanted to get some buy in for my approach before I continued

@jondot

jondot commented Jun 3, 2019

Copy link
Copy Markdown
Owner

very very interesting. this looks like something I want to merge!
@anithri I'm guessing you're still working on the PR?

@anithri

anithri commented Jun 4, 2019

Copy link
Copy Markdown
Contributor Author

I will. I just wanted to make sure the approach was what you wanted first. Especially to be sure you're ok with changing args in place as a side effect in the plugin wrapper.

I'll start prepping it.

@anithri

anithri commented Jun 4, 2019

Copy link
Copy Markdown
Contributor Author

The other changes were in files not currently being tested.

This is most of the way there. I want to review and do some full stack tests. Anything else you want to see?

@jondot

jondot commented Jun 4, 2019

Copy link
Copy Markdown
Owner

I feel that it looks great, I'd be happy to help out with tests, I'll try to find a good block of time to do that this week -- but yea feels like this can bring a good chunk of genericness into Hygen!

@anithri

anithri commented Jun 15, 2019

Copy link
Copy Markdown
Contributor Author

Running the plugins in the ops steps did not allow saving results to the params. I've moved the plugin resolution into the render promise chain.

All the formal tests work, and informal tests using templates did as well.

@anithri

anithri commented Jun 15, 2019

Copy link
Copy Markdown
Contributor Author

resolving the plugins during the ops phase did not allow results of the plugin to be used inside the template it's self. I moved it into the render promise change.

This is complete from my point of view, but I'm happy to cleanup or add whatever you suggest.

@anithri

anithri commented Aug 15, 2019

Copy link
Copy Markdown
Contributor Author

Is there something else you wanted from this?

@anithri anithri mentioned this pull request Sep 20, 2019
@anithri

anithri commented Sep 20, 2019

Copy link
Copy Markdown
Contributor Author

closing in favor of #149

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