-
Notifications
You must be signed in to change notification settings - Fork 2
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
split task/plugin options #569
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall! I'll be interested to see the outcomes of the PRs to add the task options to be able to judge if the change justifies the increase in code complexity but on first glance I agree that it will make configuration less mysterious to the user.
there's a few places where we're missing behaviour parity between plugin options and task options that we'll need to copy over
@@ -194,6 +196,8 @@ const isPartialOptional = (partial: ZodPartial): partial is z.ZodOptional<z.ZodT | |||
typeof (partial as z.ZodOptional<z.ZodTypeAny>).unwrap === 'function' | |||
|
|||
export default async ({ logger, config, toolKitConfig, configPath }: OptionsParams): Promise<boolean> => { | |||
toolKitConfig.options.plugins = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: we should be prompting for task options at the same time as plugin options (using the same optionsPromptForPlugin
function preferably)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll do this after we have task options in place (#570). this doesn't feel essential for this PR
761ec5f
to
83c4594
Compare
25ff6e9
to
f3336e0
Compare
f3336e0
to
4513ac6
Compare
30d913f
to
73ed836
Compare
c6edc15
to
c365a95
Compare
4f162c8
to
5f20426
Compare
and make schemas package exports more consistent
(and make the zod inference helper type generic)
…ema when initialising
Co-authored-by: Ivo Murrell <ivo.murrell@ft.com>
Co-authored-by: Ivo Murrell <ivo.murrell@ft.com>
b8590ce
to
2b0ccad
Compare
…compatible Slightly more backwards compatible
…options split task/plugin options
this PR adds support for loading task options from
.toolkitrc.yml
s, validating them against (task-option-specific) schemas, and passing those into the task constructors as an argument (separate from plugin options, which has been renamed tothis.pluginOptions
, and avoiding merging them with plugin options to make it clearer for task authors)this PR does not yet implement any actual task options. that's a much bigger task; i've made a start in #570.