-
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
feat: lambda support for yarn2/3 and pnpm package managers #12750
feat: lambda support for yarn2/3 and pnpm package managers #12750
Conversation
packages/amplify-cli/src/extensions/amplify-helpers/service-select-prompt.ts
Fixed
Show fixed
Hide fixed
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 #12750 +/- ##
===========================================
+ Coverage 0.00% 48.58% +48.58%
===========================================
Files 1296 842 -454
Lines 149743 38126 -111617
Branches 1296 7752 +6456
===========================================
+ Hits 0 18524 +18524
+ Misses 148447 18015 -130432
- Partials 1296 1587 +291
... and 1250 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -26,7 +26,7 @@ export class LockFileParserFactory { | |||
} | |||
default: | |||
throw new AmplifyError('UnsupportedLockFileTypeError', { | |||
message: 'Unsupported lockfile type ' + `${packageManager.lockFile} provided. Only 'npm' or 'yarn' is currently ` + 'supported.', | |||
message: `Unsupported lockfile type ${packageManager.lockFile} provided. Only 'npm', 'yarn', and 'pnpm' are currently supported.`, |
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.
In this file above we have LockFileType
which current has Yarn or NPM, do we not need PNPM here as well? and Yarn 3?
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.
this parser-factory logic ends up being used only here, for a migration message: https://github.com/lazpavel/amplify-cli/blob/lambda-package-manager/packages/amplify-provider-awscloudformation/src/print-cdk-migration-warning.ts#L106-L133
since PNPM is newly added we don't currently need it being added here
packages/amplify-category-custom/src/utils/build-custom-resources.ts
Outdated
Show resolved
Hide resolved
…ces.ts Co-authored-by: John Hockett <[email protected]>
packages/amplify-nodejs-function-runtime-provider/src/utils/legacyBuild.ts
Outdated
Show resolved
Hide resolved
packages/amplify-nodejs-function-runtime-provider/src/utils/legacyBuild.ts
Outdated
Show resolved
Hide resolved
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.
One small update, then I think this is g2g
readonly packageManager = 'npm'; | ||
readonly displayValue = 'NPM'; | ||
lockFile; | ||
executable; | ||
version?: SemVer; | ||
|
||
constructor() { | ||
this.lockFile = 'package-lock.json'; | ||
this.executable = isWindows ? 'npm.cmd' : 'npm'; | ||
} | ||
readonly executable = isWindows ? 'npm.cmd' : 'npm'; | ||
readonly lockFile = 'package-lock.json'; |
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.
these props need to be readonly in the interface as well so TS will enforce it in other places
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.
updated
); | ||
|
||
const packageManager = getPackageManagerByType('yarn'); | ||
packageManager.lockFile = 'mock.lock'; |
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.
Once you make lockFile
readonly on the interface you won't be able to do this, but I think that's okay
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.
that is the only reason I didn't make it readonly on the interface, if we are good to introduce as $TSAny, for me to keep the tests running then I can update
@@ -26,7 +27,7 @@ const npmPackageManager = getPackageManagerByType('npm'); | |||
|
|||
describe('parsing yarn lock files', () => { | |||
it('throws error when lock file not found', async () => { | |||
yarnPackageManager.lockFile = 'yarn-test-not-found.lock'; | |||
(yarnPackageManager as $TSAny).lockFile = 'yarn-test-not-found.lock'; |
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.
Seems like there's probably a way to updates these tests to check the same behavior without overriding this value, but I'm okay if that is out of scope for now
Description of changes
Issue #12402 #6382 #12306
Description of how you validated changes
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.