MCPcopy Create free account
hub / github.com/vercel/vercel / usingCorepack

Function usingCorepack

packages/build-utils/src/fs/run-user-scripts.ts:701–719  ·  view source on GitHub ↗
(
  env: { [x: string]: string | undefined },
  packageJsonPackageManager: string | undefined,
  turboSupportsCorepackHome: boolean | undefined
)

Source from the content-addressed store, hash-verified

699}
700
701export function usingCorepack(
702 env: { [x: string]: string | undefined },
703 packageJsonPackageManager: string | undefined,
704 turboSupportsCorepackHome: boolean | undefined
705) {
706 if (
707 env.ENABLE_EXPERIMENTAL_COREPACK !== '1' ||
708 packageJsonPackageManager === undefined
709 ) {
710 return false;
711 }
712 if (turboSupportsCorepackHome === false) {
713 console.warn(
714 'Warning: Disabling corepack because it may break your project. To use corepack, either upgrade to `turbo@2.1.3+` or include `COREPACK_HOME` in `turbo.json#globalPassThroughEnv`.'
715 );
716 return false;
717 }
718 return true;
719}
720
721export async function walkParentDirs({
722 base,

Calls

no outgoing calls

Tested by

no test coverage detected