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

add git hooks for prettier, prepack #294

Closed
josefaidt opened this issue Sep 29, 2020 · 3 comments · Fixed by #295
Closed

add git hooks for prettier, prepack #294

josefaidt opened this issue Sep 29, 2020 · 3 comments · Fixed by #295
Assignees

Comments

@josefaidt
Copy link
Contributor

No description provided.

@josefaidt josefaidt self-assigned this Sep 29, 2020
@josefaidt
Copy link
Contributor Author

@metonym per our discussion offline I will be adding husky and lint-staged to the project to ensure all files are ran through prettier before committing.

As I am looking to see where we can fit prepack should the CSS build script happen after install? For contributors I believe this is a required step (generate CSS) before starting the storybook. On the same note, should the type definition creation be executed on a pre-commit git hook or a prepublish npm script?

My concern with the pre-commit git hook for type definition creation is that the developer will need to commit those files as well whereas prepublish will have them available for publishing, but not intended to be committed.

@metonym
Copy link
Collaborator

metonym commented Sep 29, 2020

@josefaidt Thanks for leading this.

Let's keep the prepack command as is. We can mention in the development workflow to first build the styles.

The type definition generation should occur before publishing, so in the pre-commit hook. Currently, it serves as a "public API" for the library, so having the file be checked in is intended. For example, when new props are added to a component, I want to also verify that the types are correct as well.

@josefaidt
Copy link
Contributor Author

For example, when new props are added to a component, I want to also verify that the types are correct as well.

This makes a lot of sense. I'll make the necessary adjustments

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 a pull request may close this issue.

2 participants