How to use the @pnpm/core-loggers.lifecycleLogger.debug function in @pnpm/core-loggers

To help you get started, we’ve selected a few @pnpm/core-loggers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnpm / pnpm / packages / lifecycle / src / runLifecycleHook.ts View on Github external
case 'stderr':
        lifecycleLogger.debug({
          depPath: opts.depPath,
          line: line.toString(),
          stage,
          stdio: stdtype,
          wd: opts.pkgRoot,
        })
        return
      case 'Returned: code:':
        if (opts.stdio === 'inherit') {
          // Preventing the pnpm reporter from overriding the project's script output
          return
        }
        const code = arguments[3]
        lifecycleLogger.debug({
          depPath: opts.depPath,
          exitCode: code,
          optional,
          stage,
          wd: opts.pkgRoot,
        })
        return
    }
  }
}
github pnpm / pnpm / packages / lifecycle / src / runLifecycleHook.ts View on Github external
manifest: ImporterManifest | DependencyManifest,
  opts: {
    args?: string[],
    depPath: string,
    extraBinPaths?: string[],
    optional?: boolean,
    pkgRoot: string,
    rawConfig: object,
    rootNodeModulesDir: string,
    stdio?: string,
    unsafePerm: boolean,
  },
) {
  const optional = opts.optional === true
  if (opts.stdio !== 'inherit') {
    lifecycleLogger.debug({
      depPath: opts.depPath,
      optional,
      script: manifest.scripts![stage],
      stage,
      wd: opts.pkgRoot,
    })
  }

  const m = { _id: getId(manifest), ...manifest }
  m.scripts = { ...m.scripts }

  if (stage === 'start' && !m.scripts.start) {
    m.scripts.start = 'node server.js'
  }
  if (opts.args?.length && m.scripts?.[stage]) {
    m.scripts[stage] = `${m.scripts[stage]} ${opts.args.map((arg) => `"${arg}"`).join(' ')}`