-
Notifications
You must be signed in to change notification settings - Fork 4k
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(cli): introduce the 'watch' command #17240
Conversation
0480620
to
d417ab4
Compare
@eladb thanks so much for the thorough review! I've incorporated most of your comments, and asked a few clarifying questions for the rest of them. If you could make another pass through the comments, and the code, I would appreciate it - let's get this feature merged! 😊 |
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.
Still a few comments
4c1f2e5
to
563666d
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
This PR introduces the "watch" command, in two variants: as a separate new `cdk watch` command, and as an argument to the existing `cdk deploy` command. The "watch" process will observe the project files, defined by the new `"include"` and `"exclude"` settings in `cdk.json` (see aws/aws-cdk-rfcs#383 for details), and will trigger a `cdk deploy` when it detects any changes. The deployment will by default use the new "hotswap" deployments for maximum speed. Since `cdk deploy` is a relatively slow process for a "watch" command, there is some logic to perform intelligent queuing of any file events that happen while `cdk deploy` is running. We will batch all of those events, and trigger a single `cdk deploy` after the current one finishes. This ensures only a single `cdk deploy` command ever executes at a time. The observing of the files, and reacting to their changes, is accomplished using the [`chokidar` library](https://www.npmjs.com/package/chokidar). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR introduces the "watch" command, in two variants: as a separate new `cdk watch` command, and as an argument to the existing `cdk deploy` command. The "watch" process will observe the project files, defined by the new `"include"` and `"exclude"` settings in `cdk.json` (see aws/aws-cdk-rfcs#383 for details), and will trigger a `cdk deploy` when it detects any changes. The deployment will by default use the new "hotswap" deployments for maximum speed. Since `cdk deploy` is a relatively slow process for a "watch" command, there is some logic to perform intelligent queuing of any file events that happen while `cdk deploy` is running. We will batch all of those events, and trigger a single `cdk deploy` after the current one finishes. This ensures only a single `cdk deploy` command ever executes at a time. The observing of the files, and reacting to their changes, is accomplished using the [`chokidar` library](https://www.npmjs.com/package/chokidar). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR introduces the "watch" command, in two variants: as a separate new
cdk watch
command,and as an argument to the existing
cdk deploy
command.The "watch" process will observe the project files, defined by the new
"include"
and"exclude"
settings incdk.json
(see aws/aws-cdk-rfcs#383 for details),
and will trigger a
cdk deploy
when it detects any changes.The deployment will by default use the new "hotswap" deployments for maximum speed.
Since
cdk deploy
is a relatively slow process for a "watch" command,there is some logic to perform intelligent queuing of any file events that happen while
cdk deploy
is running.We will batch all of those events, and trigger a single
cdk deploy
after the current one finishes.This ensures only a single
cdk deploy
command ever executes at a time.The observing of the files, and reacting to their changes, is accomplished using the
chokidar
library.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license