-
Notifications
You must be signed in to change notification settings - Fork 246
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(jsii-config): jsii-config #981
Conversation
I have been experimenting with integration level tests using nodes child_process tools. I haven't found a great way of doing this without a bunch of custom helper code and even with that it feels very brittle. If anyone has suggestions regarding that let me know. Found a couple small issues for next revision.
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
This is awesome. Mostly stylistic comments.
I think that the next (immediate) iteration of this should be to also take care of other package.json
fields that jsii cares about (and/or are best practices):
- Add
build
script that callsjsii
- Add
watch
script that callsjsii -w
- Ensure that
main
andtypes
exist - Ensure that
repository
exists - Define
stability
- Ensure that
license
is defined
Basically, it would be nice to be able to take a typescript project and run:
$ npx jsii-config
And it will convert it to a jsii project.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
9ca79e7
to
9713500
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
9713500
to
e93882f
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Defines jsii-config CLI application for configuring a jsii package's `jsii` options inside package.json. These options dictate what target languages and language specific packaging options jsii uses when building. The application uses [inquirer](https://www.npmjs.com/package/inquirer) for interactive prompts and [yargs](https://www.npmjs.com/package/yargs) for argument parsing. jsii-config will help configure packages with or without an existing jsii configuration in package.json. If the object does exist, the default values of fields that are prompted will be the existing values. This allows users to just hit 'enter' until they get to the options they wish to change and modify only those. After the user inputs all of the values for the relevant prompts, they are asked to confirm the config. If the user selects 'yes', the config is written to package.json, if they select 'no', they will be prompted to fill out the fields again, however, the default values will now be what they previously entered. This is done so the user will only need to change the specific fields that need it. Fixes aws#904
e93882f
to
cdffd77
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
cdffd77
to
e763abe
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Adds the jsii configuration interfaces to jsii-spec module. This serves as single global spec for jsii-configuration in package.json. Move argument parsing and file/cli output to bin/jsii-config. This makes it so the lib modules are less focused on the actual CLI interface. This does however decrease unit test coverage which now only asserts that the new configuration is correct and not that it was also written to the package.json.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Makes the information shown to users when prompting for a value more clear. Adds details regarding the versionFormat field and its options.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Removes existing snapshot tests since the logic is covered explicitly in other test cases and they were flaky across platforms. This was due to the object being asserted against contained non-serializable values.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Defines jsii-config CLI application for configuring a jsii package's
jsii
options inside package.json. These options dictate what target languages and language specific packaging options jsii uses when building.The application uses inquirer for interactive prompts and yargs for argument parsing.
jsii-config will help configure packages with or without an existing jsii configuration in package.json. If the object does exist, the default values of fields that are prompted will be the existing values. This allows users to just hit 'enter' until they get to the options they wish to change and modify only those.
After the user inputs all of the values for the relevant prompts, they are asked to confirm the config. If the user selects 'yes', the config is written to package.json, if they select 'no', they will be prompted to fill out the fields again, however, the default values will now be what they previously entered. This is done so the user will only need to change the specific fields that need it.
Fixes #904
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.