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

improve Node.js package manager detection #12001

Open
2 tasks
josefaidt opened this issue Feb 14, 2023 · 0 comments
Open
2 tasks

improve Node.js package manager detection #12001

josefaidt opened this issue Feb 14, 2023 · 0 comments
Labels
feature-request Request a new feature p3 platform Issues tied to the general CLI platform

Comments

@josefaidt
Copy link
Contributor

Is this feature request related to a new or existing Amplify category?

No response

Is this related to another service?

No response

Describe the feature you'd like to request

Improve detection of the developer's chosen Node.js package manager, which applies to the following workflows:

  • auto-installing Node.js Function dependencies on build/push
  • auto-installing dependencies in the Sandbox workflow

examples:

Describe the solution you'd like

Amplify CLI automatically detects the package manager of choice for JavaScript projects

// https://github.com/vercel/next.js/blob/canary/packages/create-next-app/helpers/get-pkg-manager.ts
export type PackageManager = 'npm' | 'pnpm' | 'yarn'

export function getPkgManager(): PackageManager {
  const userAgent = process.env.npm_config_user_agent

  if (userAgent) {
    if (userAgent.startsWith('yarn')) {
      return 'yarn'
    } else if (userAgent.startsWith('pnpm')) {
      return 'pnpm'
    } else {
      return 'npm'
    }
  } else {
    return 'npm'
  }
}

Describe alternatives you've considered

n/a

Additional context

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change
@josefaidt josefaidt added pending-triage Issue is pending triage feature-request Request a new feature platform Issues tied to the general CLI platform p3 and removed pending-triage Issue is pending triage labels Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature p3 platform Issues tied to the general CLI platform
Projects
None yet
Development

No branches or pull requests

1 participant