Skip to content
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(core): cdk init --generate-only #4826

Merged
merged 13 commits into from
Nov 8, 2019
Merged

feat(core): cdk init --generate-only #4826

merged 13 commits into from
Nov 8, 2019

Conversation

nmussy
Copy link
Contributor

@nmussy nmussy commented Nov 2, 2019

Starting with a draft to get the ball rolling.

I'm not pleased with the yarn detection, maybe we should just stick with --package-manager?

Fixes #4795


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@mergify
Copy link
Contributor

mergify bot commented Nov 2, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

eladb
eladb previously requested changes Nov 3, 2019
Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it’s taking things a bit too far. We are very careful to add complexity around init templates because the abuse potential is high. My understanding is that given package.json yarn can very easily create a lock file. Do we really need this to be part of the template?

Maybe we can just add to the template a readme instruction on how to use yarn?

@nmussy
Copy link
Contributor Author

nmussy commented Nov 3, 2019

@eladb The issue isn't with using the package.json, or converting the package-lock.json into a yarn.lock.
Using the wrong package manager during the initial installation can cause significant network and disk overhead. They each have their own cache, and both pnpm and yarn (in the future) generate a different, more efficient node_modules.

Another solution might be a --skip-install flag, like ng new has.

@eladb
Copy link
Contributor

eladb commented Nov 4, 2019

--skip-install sounds better. Maybe it should be more general like --generate-only and we can apply this to all other templates (for example, for java we shouldn't run mvn package).

@mergify mergify bot dismissed eladb’s stale review November 5, 2019 08:20

Pull request has been modified.

@nmussy nmussy changed the title feat(core): init --package-manager option, yarn global detection feat(core): add init --generate-only CLI option Nov 5, 2019
eladb
eladb previously requested changes Nov 5, 2019
packages/aws-cdk/bin/cdk.ts Outdated Show resolved Hide resolved
packages/aws-cdk/bin/cdk.ts Outdated Show resolved Hide resolved
packages/aws-cdk/lib/init.ts Outdated Show resolved Hide resolved
packages/aws-cdk/lib/init.ts Outdated Show resolved Hide resolved
packages/aws-cdk/lib/init.ts Outdated Show resolved Hide resolved
@mergify mergify bot dismissed eladb’s stale review November 5, 2019 08:38

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@nmussy
Copy link
Contributor Author

nmussy commented Nov 6, 2019

I realized when testing --project-name that I missed adding generateOnly to the settings:

generateOnly: argv.generateOnly,

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

eladb
eladb previously approved these changes Nov 8, 2019
@eladb eladb marked this pull request as ready for review November 8, 2019 06:18
@eladb eladb requested a review from RomainMuller as a code owner November 8, 2019 06:18
@mergify
Copy link
Contributor

mergify bot commented Nov 8, 2019

Thank you for contributing! Your pull request is now being automatically merged.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot dismissed eladb’s stale review November 8, 2019 08:16

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@eladb eladb changed the title feat(core): add init --generate-only CLI option feat(core): cdk init --generate-only Nov 8, 2019
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 9cc1e52 into aws:master Nov 8, 2019
@nmussy nmussy deleted the 4795 branch February 2, 2024 12:20
@nmussy nmussy restored the 4795 branch February 2, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate yarn.lock if cdk --init is used with yarn
3 participants