-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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-lib): experimental support for programatic CLI api #22790
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
d6db740
to
4e04c25
Compare
337c86b
to
3b2284a
Compare
@@ -0,0 +1,226 @@ | |||
import * as core from '@aws-cdk/core'; | |||
import { exec as runCli } from 'aws-cdk/lib'; |
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 trust that this works in the working copy... I don't fully trust that this works after publishing to NPM, based on trickery and #$%*ery we do to the CLI build before we publish.
Does it?
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.
Yes it does work. This minimal example can be run in a shell:
npm install aws-cdk
node -e "const { cli } = require('aws-cdk/lib'); cli()"
cli
is the existing export. I have no reason to believe exec
would behave any different. However it's tricky to proof with the current build system.
Maybe doing the code swap first would be better?
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.
Should we change the package name to something more along the lines of cdk-cli-lib
?
(not strictly that, but something in that vein?)
Ultimately, I'd think the goal would be for all code to live here and the dependency arrow to be reversed, right?
Yes, I wanted to ask for feedback here. Do we have rules for when we use the
That's 100% right. |
1cec93f
to
96c3029
Compare
The pull request linter fails with the following errors:
PRs must pass status checks before we can provide a meaningful review. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Closed in favor of #22836 |
All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license