-
Notifications
You must be signed in to change notification settings - Fork 820
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
Use build script to build custom resources in build-custom-resources.ts #11854
base: dev
Are you sure you want to change the base?
Conversation
5aacc61
to
14a4d8e
Compare
…rather than invoking tsc directly from the node_modules/.bin directory
14a4d8e
to
af8b5fa
Compare
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## dev #11854 +/- ##
===========================================
+ Coverage 0.00% 47.59% +47.59%
===========================================
Files 1296 842 -454
Lines 149743 38320 -111423
Branches 1296 7834 +6538
===========================================
+ Hits 0 18239 +18239
+ Misses 148447 18458 -129989
- Partials 1296 1623 +327
... and 1271 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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. aws-amplify#11889
Description of changes
instead of invoking
node_modules/.bin/tsc
directly to build custom resources (viapath.join(targetDir, 'node_modules', '.bin', 'tsc')
), we should instead use the definedbuild
script in the resource’s package.json. this script is automatically created when a custom resource is added withamplify add custom
.using
${packageManager.executable} run build
invokes the build script using the current package manager and works no matter what kind of package manager configuration is currently set up (e.g. with PnP). resolves #11889.Issue #, if available
#11889
Description of how you validated changes
i verified that
npm run build
andyarn run build
both work to build the cdk-stack.ts file intobuild/cdk-stack.js
in the same way as executing thenode_modules/.bin/tsc
path works. i then usedamplify-dev build
andamplify-dev push
locally in my repo where i first ran into #11851 and my custom resource built successfully and deployed with no errors.Checklist
yarn test
passesnote about the tests that not all of the tests actually passed, but i believe all the failures are 100% unrelated to my changes. there were a few tests that failed with
Exceeded timeout
errors (e.g.should attempt setting up local instance of opensearch with custom configuration
, which timed our at 90224 ms!), and theamplify-dynamodb-simulator:test
command, which i believe failed because i don’t have the correct java setup (max retries hit for starting dynamodb emulator
) and to be honest, i’d rather not deal with that. as a general note, runningyarn test
made my M1 MacBook pro unusable while they were running, causing the macOS “Your system has run out of application memory” dialog box to show up, despite me only having my terminal and safari open, so i’m not surprised that there were some timeouts. here was the final log result:the test that failed the
@aws-amplify/cli-internal:test
command issrc/__tests__/test-aborting.test.ts
:By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.