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

Allow TS examples to build without requiring a full package build #218

Open
1 of 2 tasks
horsmand opened this issue Nov 5, 2020 · 0 comments
Open
1 of 2 tasks

Allow TS examples to build without requiring a full package build #218

horsmand opened this issue Nov 5, 2020 · 0 comments
Labels
feature-request A feature should be added or improved.

Comments

@horsmand
Copy link
Contributor

horsmand commented Nov 5, 2020

Currently to build our TS examples like All-In-AWS-Infrastructure-Basic you need to first run the build.sh script in the base directory of the repo. This is cumbersome and time consuming, so if we can set out repo up to avoid this, it would be easier to use the examples.

Use Case

When someone wants to use a TS example, they need to follow these steps:

  1. Run build.sh from the base directory, waiting for the full install, build, and tests to run for all the packages in the repo.
  2. Navigate to the example directory and run yarn run build to execute the build.

This can be error prone and the error messaging for trying to run the example build before the full build doesn't make the solution obvious.

It would be ideal if we could simplify this to just being able to run yarn and yarn build from the examples directory and not have to worry about the base directory's build.

Proposed Solution

We need to do these things to get this to work:

  1. Make packages/aws-rfdk/tsconfig.json a static file rather than being generated by build.sh.
  2. Change the build script target for the examples to use tsc -b instead of just tsc.
  3. We've updated some example to contain the extra steps to get the build to work using the build.sh script, so those need to be updated to use the simplified method.

tsconfig.js

We currently have this line in build.sh to generate the tsconfig.json for the aws-rfdk package:

/bin/bash scripts/generate-aggregate-tsconfig.sh > tsconfig.json

We originally had this because it's what CDK does to avoid having to add and update tsconfig.json files in all of their packages. Since we made the decision to switch away from multiple packages in a repo (we had core and deadline as their own packages rather than in a shared package), we don't really need this feature anymore. The tsconfig.json file content shouldn't need to change often, so it can be made into a static file and delete this script.

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@horsmand horsmand added needs-triage This issue or PR still needs to be triaged. feature-request A feature should be added or improved. and removed needs-triage This issue or PR still needs to be triaged. labels Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

1 participant