How to use the @pnpm/core-loggers.rootLogger.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 / modules-cleaner / src / removeDirectDependency.ts View on Github external
opts: {
    binsDir: string,
    dryRun?: boolean,
    modulesDir: string,
    muteLogs?: boolean,
    rootDir: string,
  },
) {
  const results = await Promise.all([
    removeBins(dependency.name, opts),
    !opts.dryRun && remove(path.join(opts.modulesDir, dependency.name)) as any, // tslint:disable-line:no-any
  ])

  const uninstalledPkg = results[0]
  if (!opts.muteLogs) {
    rootLogger.debug({
      prefix: opts.rootDir,
      removed: {
        dependencyType: dependency.dependenciesField === 'devDependencies' && 'dev' ||
          dependency.dependenciesField === 'optionalDependencies' && 'optional' ||
          dependency.dependenciesField === 'dependencies' && 'prod' ||
          undefined,
        name: dependency.name,
        version: uninstalledPkg?.version,
      },
    })
  }
}
github pnpm / pnpm / packages / symlink-dependency / src / symlinkDirectRootDependency.ts View on Github external
destModulesDirReal = await fs.realpath(destModulesDir)
  } catch (err) {
    if (err.code === 'ENOENT') {
      await makeDir(destModulesDir)
      destModulesDirReal = await fs.realpath(destModulesDir)
    } else {
      throw err
    }
  }

  const dependencyRealocation = await fs.realpath(dependencyLocation)

  const dest = path.join(destModulesDirReal, importAs)
  const { reused } = await symlinkDir(dependencyRealocation, dest)
  if (reused) return // if the link was already present, don't log
  rootLogger.debug({
    added: {
      dependencyType: opts.fromDependenciesField && DEP_TYPE_BY_DEPS_FIELD_NAME[opts.fromDependenciesField] as DependencyType,
      linkedFrom: dependencyRealocation,
      name: importAs,
      realName: opts.linkedPackage.name,
      version: opts.linkedPackage.version,
    },
    prefix: opts.prefix,
  })
}
github pnpm / pnpm / packages / supi / src / install / link.ts View on Github external
.map(async ({ rootAlias, depGraphNode }) => {
          if (
            !opts.dryRun &&
            (await symlinkDependency(depGraphNode.peripheralLocation, modulesDir, rootAlias)).reused
          ) return

          const isDev = manifest.devDependencies?.[depGraphNode.name]
          const isOptional = manifest.optionalDependencies?.[depGraphNode.name]
          rootLogger.debug({
            added: {
              dependencyType: isDev && 'dev' || isOptional && 'optional' || 'prod',
              id: depGraphNode.packageId,
              latest: opts.outdatedDependencies[depGraphNode.packageId],
              name: rootAlias,
              realName: depGraphNode.name,
              version: depGraphNode.version,
            },
            prefix: rootDir,
          })
        }),
    )