-
Notifications
You must be signed in to change notification settings - Fork 4
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: Make cdk-serverless projects self-bootstrapping #277
feat: Make cdk-serverless projects self-bootstrapping #277
Conversation
…e a working project from an empty dir.
…ate a working project from an empty dir.
… can generate a working project from an empty dir.
src/projen/datastore.ts
Outdated
@@ -10,9 +10,15 @@ export interface DatastoreOptions { | |||
|
|||
export class Datastore extends pj.Component { | |||
|
|||
protected readonly definitionFile: string; |
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.
Why is this needed? You could use this.options.definitionFile
couldn't you?
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.
After a night's sleep I don't know why I did that in the first place. Gonna change it.
…t one present so we can generate a working project from an empty dir.
If there is no source schema/definition provided for any of the projen component types introduced by cdk-serverless, the framework should be able to bootstrap placeholders, so a working project can be generated and amended with proper definitions later.
cdk-serverless needs to be applied to an already-synthesized projen project and if any of the generator components are used, the schema or definition files (e.g. an openapi.yaml) must already exist at the correct locations, or projen will crash and fail to synthesize a project.
If the given definition file name can not be found, it will now be populated with a tiny placeholder so projen can synthesize a project and the user can place the correct file later.
This PR will make cdk-serverless succeed in several cases which would cause a projen synth failure before. This PR also revises code generation for cdk-serverless to take place during the projen synthesize step rather than on component construction. This PR also refactors several paths to be relative to the project directory rather than the cwd of the node process running projen.
Status: