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(config): add hooks #459

Merged
merged 2 commits into from Jul 3, 2022
Merged

feat(config): add hooks #459

merged 2 commits into from Jul 3, 2022

Conversation

c0m1t
Copy link
Contributor

@c0m1t c0m1t commented Jun 29, 2022

Status

READY

Description

Introducing hooks so users can run their scripts on some events(postWrite for now).

Related PRs

List related PRs against other branches:

branch PR
other_pr_production link
other_pr_master link

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

You can define a hook in the config:

Add hooks to hooks property of options in orval.config.js. Value of each hook can be a string, array of strings or a function.

string:

hooks: {
  postWrite: 'touch file1.txt'
}

Array of strings:

hooks: {
  postWrite: ['touch file1.txt', 'touch file1.txt']
}

Function:

hooks: {
  postWrite: () => {
    console.log('postWrite hook');
  }
}

@vercel
Copy link

vercel bot commented Jun 29, 2022

Someone is attempting to deploy a commit to a Personal Account owned by @anymaniax on Vercel.

@anymaniax first needs to authorize it.

@anymaniax
Copy link
Owner

Hello @c0m1t, really nice idea. Could you also update the doc about that?

@c0m1t
Copy link
Contributor Author

c0m1t commented Jun 30, 2022

I think it might be a good idea to mark --prettier as deprecated and add a CLI option for hooks.

@anymaniax anymaniax merged commit c594bac into anymaniax:master Jul 3, 2022
@hvasc hvasc mentioned this pull request Jul 18, 2022
3 tasks
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.

None yet

2 participants