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: yarn watch updates (specified) tests when source files change #465

Merged
merged 3 commits into from
Jan 7, 2022

Conversation

boukeversteegh
Copy link
Collaborator

@boukeversteegh boukeversteegh commented Jan 6, 2022

Attempting to further improve developer workflow. Hoping - but not sure - that I didn't go too far, I would like feedback on these additions separately.

  • Let yarn watch monitor source directories as well
    • Tell the user what to do when the sources change
    • Press Enter to recompile ALL proto files
    • Run yarn watch TEST1 TEST2 to automatically recompile TEST1 and TEST2 when sources change
$ yarn watch -h

Watches the integration directory for changes and regenerates .bin and .ts files.
Watches the src directory and regenerates given TEST files.

Usage:
    $ yarn watch [options] [TEST, TEST2, ...]
    $ ts-node watch.ts [options] [TEST, TEST2, ...]

Options:
    -h, --help    Show this help message.
    --polling     Use polling instead of native watchers.
    TEST          Regenerate the specified TEST(s) when implementation files change.
                  Equivalent to running 'yarn bin2ts TEST' manually each time.

Examples:
    $ yarn watch
    $ yarn watch --polling
    $ yarn watch simple struct

Example run

$ yarn watch
yarn run v1.22.10
$ ts-node integration/watch.ts

Watching for changes:
- integration/  Regenerating integration/*/*.proto to .bin and .ts

Press enter to regenerate code for all .proto files.
Press ctrl+c or q to exit

src/main.ts [watch] Plugin modified! Press [enter] to regenerate all integration tests or run 'yarn watch [TEST, ...]'. See 'yarn watch --help'.

@boukeversteegh boukeversteegh changed the title feat: yarn watch update (specified) tests when source files change feat: yarn watch updates (specified) tests when source files change Jan 6, 2022
Copy link
Owner

@stephenh stephenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even more amazing! Thank you!

integration/watch.ts Outdated Show resolved Hide resolved
integration/watch.ts Outdated Show resolved Hide resolved
integration/watch.ts Outdated Show resolved Hide resolved
integration/watch.ts Outdated Show resolved Hide resolved
integration/watch.ts Outdated Show resolved Hide resolved
integration/watch.ts Outdated Show resolved Hide resolved
Copy link
Owner

@stephenh stephenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty excited to use this; hacking on ts-proto is going to be so easy now :-)

@boukeversteegh boukeversteegh merged commit 275d0e7 into main Jan 7, 2022
@boukeversteegh boukeversteegh deleted the feature/watch2 branch January 7, 2022 17:50
@boukeversteegh
Copy link
Collaborator Author

I'm pretty excited to use this; hacking on ts-proto is going to be so easy now :-)

Cool 👍 Hope it will prove useful!

The developer experience of ts-proto is quite nice once you have a PR open. I like how everything gets released automatically, so you can immediately enjoy the improvements without waiting for manual actions. The only thing that was hard was getting started and figuring out the commands. Hopefully this is now a lot better. It would be great if more devs will start playing with the source now and create pull requests. Cheers!

stephenh pushed a commit that referenced this pull request Jan 7, 2022
# [1.99.0](v1.98.0...v1.99.0) (2022-01-07)

### Features

* yarn watch updates (specified) tests when source files change ([#465](#465)) ([275d0e7](275d0e7))
@stephenh
Copy link
Owner

stephenh commented Jan 7, 2022

🎉 This PR is included in version 1.99.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants