-
Notifications
You must be signed in to change notification settings - Fork 41
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
Plugin Factory #989
Milestone
Comments
please post your thoughts on the solution to improve plugin developer experience as discussed in the planning call |
const utils = require('@grnsft/if-core/utils/validations');
const {validate} = utils;
// This one should be in if-core, which will make if-core more reasonable
const PluginInterface = params => input => {
const {metadata, callback, validateInput, validateConfig, evaluateInput} =
params;
return {
metadata,
execute: () => {
const safeInput = validateInput(input);
const result = callback(safeInput);
return result;
},
};
};
const metadata = {
inputs: {},
outputs: {},
};
const callback = inputs => {
const result = inputs.map(input => (input['carbon-embodied'] = 1));
return result;
};
module.exports = PluginInterface({metadata, callback}); |
8 tasks
will integrate the inline arithmetic into this as well after merging #970 |
zanete
changed the title
Incapsulate map config, input and output functions in if-core validator
Plugin Factory
Sep 24, 2024
expecting the PR early next week |
If-core part is here: Green-Software-Foundation/if-core#25 |
Merged
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What
As a developer, I want simple user experience while developing plugins. For that I need to less care about utility functions like mapConfigIfNeeded, mapOutputIfNeeded and so on.
As a proposal for solution is to incapsulate mapConfigIfNeeded function in
validateConfig
(which is abstraction over out old validate function from if-core). mapInputIfNeeded can be incapsulated intovalidate
function.Why
Context
Prerequisites/resources
SoW (scope of work)
Acceptance criteria
Given (Setup): Describes the initial state of the system or the preconditions for a change.
When (Action): Describes the specific action or behavior that is being tested/changed.
Then (Assertion): Defines the expected outcome or behavior of the system after the action in the "When" step is performed.
The text was updated successfully, but these errors were encountered: