-
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
chore(docs): ensure code snippets in aws-lambda README compile #14753
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.
Not super familiar with the options available for rosetta. Is there a way to fail build if a fixture and/or snippet fails to compile?
If not, this is going to be broken (again) as soon you look the other way.
Yes, there is the |
Awesome diving deep into some previously made decisions to figure this out! I would suggest that we do the suggestion from this comment you referred above:
Add an npm script, say executed via The third missing piece would be to use a Doing these first (as a separate PR) before fixing up the actual code snippets will guarantee that your work here continues to be used, and doesn't regress in the next change to these files. cc @rix0rrr Adding an npm script to all of our 200+ packages in not as hard as it sounds. If you didn't know already, we have pkglint for that very use. Modify the rule once and run Happy to chat about how I would approach other things I've mentioned above. |
This sounds like a good plan! Most of this is already in place and can leverage the "strict" metadata entry in the package.json, as described above. However, there seem to be some bugs in rosetta that cause this entry to be ignored. Opened aws/jsii#2861 which, upon fix, should unblock this work. |
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). |
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). |
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). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…4753) Update README in aws-lambda package to pass strict Rosetta compilation, ie., all the Typescript snippets in the README compile successfully. Also follows convention for unscoped usage of all local names (anything from the aws-lambda package) and scoped usage of all other names. In particular: - removes many `lambda.` qualifiers - creates a "default" fixture with a stack already created (accessible as `this`) and lots of names from the package already supported - creates a "function" fixture that includes an already-built function (accessible as `fn`) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Update README in aws-lambda package to pass strict Rosetta compilation, ie., all the Typescript snippets in the README compile successfully. Also follows convention for unscoped usage of all local names (anything from the aws-lambda package) and scoped usage of all other names.
In particular:
lambda.
qualifiersthis
) and lots of names from the package already supportedfn
)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license