-
Notifications
You must be signed in to change notification settings - Fork 822
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
fix(amplify-cli-core): use build script for overrides #13858
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Updated the TypeScript compilation of overrides so that it doesn't require `node_modules/.bin/tsc`. Instead, it simply relies on the `build` script to execute `tsc`. This is more flexible and can support alternative setups w/ hoisting (e.g. via Yarn workspaces). This is an override corollary fix to #11854, which is for custom resources. #11889
2 tasks
@josefaidt sorry to pester, but any chance this can get some attention? Would love to be able to stop using custom builds of the CLI! Thanks! 🙏 |
@sobolk any chance this can get visibility? I believe it's a straight-forward and sensible change, but I'm happy to update if there's an alternative approach that would be preferred by the team. Thank you 🙏 |
Open
2 tasks
sobolk
approved these changes
Jan 31, 2025
rtpascual
approved these changes
Jan 31, 2025
sobolk
added a commit
to sobolk/amplify-cli
that referenced
this pull request
Jan 31, 2025
…plify#13858)" This reverts commit 30c9f0c.
6 tasks
sobolk
added a commit
that referenced
this pull request
Jan 31, 2025
brianlenz
added a commit
to brianlenz/amplify-cli
that referenced
this pull request
Feb 1, 2025
Updated the TypeScript compilation of overrides so that it doesn't require `node_modules/.bin/tsc`. Instead, it simply relies on the `build` script to execute `tsc`. This is more flexible and can support alternative setups w/ hoisting (e.g. via Yarn workspaces). This is an override corollary fix to aws-amplify#11854, which is for custom resources. This is an improvement over my previous PR in aws-amplify#13858 in that it works with any package manager by ensuring the `--project` and `tsconfig.json` files are passed through to the `tsc` script. The previous implementation didn't work with `npm` because it doesn't pass through additional args like `yarn` does. The fix was easy: simply separate the build run with `--` so that the remaining args are treated as positional for the `tsc` script. I've confirmed the fix works with both `yarn` and `npm` 💪 aws-amplify#11889
2 tasks
sobolk
added a commit
that referenced
this pull request
Feb 3, 2025
* fix(amplify-cli-core): use build script properly for overrides Updated the TypeScript compilation of overrides so that it doesn't require `node_modules/.bin/tsc`. Instead, it simply relies on the `build` script to execute `tsc`. This is more flexible and can support alternative setups w/ hoisting (e.g. via Yarn workspaces). This is an override corollary fix to #11854, which is for custom resources. This is an improvement over my previous PR in #13858 in that it works with any package manager by ensuring the `--project` and `tsconfig.json` files are passed through to the `tsc` script. The previous implementation didn't work with `npm` because it doesn't pass through additional args like `yarn` does. The fix was easy: simply separate the build run with `--` so that the remaining args are treated as positional for the `tsc` script. I've confirmed the fix works with both `yarn` and `npm` 💪 #11889 * fix(amplify-cli-core): only include -- for npm Tweaked the implementation slightly so that the `--` arg is only passed for `npm` since it doesn't actually work with `yarn`. #11889 * fix(amplify-cli-core): new packageManner runner Added a new `runner` field to the PackageManager interface. The key difference here is npm's runner is actually `npx`, whereas yarn and pnpm just use the same executable as the runner. Updated both the override and custom-resources to use the runner to run tsc now instead of only looking in `node_modules`. #11889 * fix: update api --------- Co-authored-by: Kamil Sobol <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated the TypeScript compilation of overrides so that it doesn't require
node_modules/.bin/tsc
. Instead, it simply relies on thebuild
script to executetsc
. This is more flexible and can support alternative setups w/ hoisting (e.g. via Yarn workspaces).This is an override corollary fix to #11854, which is for custom resources.
Description of changes
Remove hard-coded dependency on
node_modules/.bin/tsc
for overrides to instead use thebuild
script frompackage.json
, which is more flexible.Issue #11889
Description of how you validated changes
Ran
yarn test
and all pre-commit hooks without issue.Tested
amplify build --debug
andamplify push
locally. The commands were failing on Amplify CLI12.12.4
, and it succeeds with these changes in place (viaamplify-dev
).Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.