-
Notifications
You must be signed in to change notification settings - Fork 4k
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(lambda-nodejs): pnpm exec command #14954
Conversation
@@ -60,6 +60,7 @@ export class PackageManager { | |||
os.platform() === 'win32' ? `${runCommand}.cmd` : runCommand, | |||
...runArgs, | |||
bin, | |||
...(this.lockFile === PackageManager.PNPM.lockFile ? ['--'] : []), |
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.
Required to pass parameters to bin command
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.
Let's introduce argsSeparator?: string
in PackageManager
.
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.
Good catch @relm923! Thanks.
See my comments.
@@ -26,7 +26,7 @@ export class PackageManager { | |||
public static PNPM = new PackageManager({ | |||
lockFile: 'pnpm-lock.yaml', | |||
installCommand: ['pnpm', 'install'], | |||
runCommand: ['pnpm', 'run'], | |||
runCommand: ['pnpm', 'exec'], |
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.
Getting The "pnpm exec" command currently only works with the "-r" option
with only exec
.
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.
Can you try:
pnpm --version
cd aws-cdk/packages/@aws-cdk/aws-lambda-nodejs
pnpm exec esbuild -- --bundle test/integ-handlers/ts-handler.ts
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.
OK it's working. For some reason not in the Docker image...
@@ -60,6 +60,7 @@ export class PackageManager { | |||
os.platform() === 'win32' ? `${runCommand}.cmd` : runCommand, | |||
...runArgs, | |||
bin, | |||
...(this.lockFile === PackageManager.PNPM.lockFile ? ['--'] : []), |
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.
Let's introduce argsSeparator?: string
in PackageManager
.
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.
@eladb LGTM
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Fix aws#14757 Expands on aws#14772 Currently get the following error when bundling with `pnpm-lock.yaml` ``` ERROR ERROR Unknown options: 'bundle', 'target', 'platform', 'outfile', 'external:aws-sdk' ``` ---- Switch from `pnpm run esbuild` to `pnpm exec esbuild --` to properly enable esbuild with `pnpm` `pnpm run` only supports running commands defined in the package's manifest file - [docs](https://pnpm.io/cli/run) `pnpm exec` supports executing a shell command in scope of a project - [docs](https://pnpm.io/cli/exec) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Fix #14757
Expands on #14772
Currently get the following error when bundling with
pnpm-lock.yaml
Switch from
pnpm run esbuild
topnpm exec esbuild --
to properly enable esbuild withpnpm
pnpm run
only supports running commands defined in the package's manifest file - docspnpm exec
supports executing a shell command in scope of a project - docsBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license