<commit_before>import BluebirdPromise from "bluebird-lst"
import { debug, Lazy } from "electron-builder-util"
import { CONCURRENCY } from "electron-builder-util/out/fs"
import { orNullIfFileNotExist } from "electron-builder-util/out/promise"
import { lstat, readdir, readFile, realpath, Stats } from "fs-extra-p"
import * as path from "path"

/** @internal */
export interface Dependency {
  name: string
  path: string
  extraneous: boolean
  optional: boolean

  dependencies: Map<string, Dependency> | null
  directDependencyNames: { [key: string]: any } | null
  optionalDependencies: { [key: string]: any } | null

  realName: string
  link?: string

  parent?: Dependency

  // only if link
  stat?: Stats
}

const knownAlwaysIgnoredDevDeps = new Set([
  "electron-builder", "electron-builder-tslint-config", "electron-builder-util", "electron-publish", "electron-download-tf", "electron-download",
  "electron-forge", "electron-packager", "electron-compilers",
  "jest", "jest-cli", "prebuild-install", "nan", "node-pre-gyp",
  "asar-integrity", "asar",
  "electron-webpack", "electron-webpack-ts", "electron-webpack-vue",
  "react-scripts",
])

export function createLazyProductionDeps(projectDir: string) {
  return new Lazy(() => getProductionDependencies(projectDir))
}

/** @internal */
export async function getProductionDependencies(folder: string): Promise<Array<Dependency>> {
  const sorted: Array<Dependency> = []<commit_msg>fix: node-pre-gyp stripped in packed dir<commit_after>import BluebirdPromise from "bluebird-lst"
import { debug, Lazy } from "electron-builder-util"
import { CONCURRENCY } from "electron-builder-util/out/fs"
import { orNullIfFileNotExist } from "electron-builder-util/out/promise"
import { lstat, readdir, readFile, realpath, Stats } from "fs-extra-p"
import * as path from "path"

/** @internal */
export interface Dependency {
  name: string
  path: string
  extraneous: boolean
  optional: boolean

  dependencies: Map<string, Dependency> | null
  directDependencyNames: { [key: string]: any } | null
  optionalDependencies: { [key: string]: any } | null

  realName: string
  link?: string

  parent?: Dependency

  // only if link
  stat?: Stats
}

const knownAlwaysIgnoredDevDeps = new Set([
  "electron-builder", "electron-builder-tslint-config", "electron-builder-util", "electron-publish", "electron-download-tf", "electron-download",
  "electron-forge", "electron-packager", "electron-compilers",
  "jest", "jest-cli", "prebuild-install", "nan",
  "asar-integrity", "asar",
  "electron-webpack", "electron-webpack-ts", "electron-webpack-vue",
  "react-scripts",
])

export function createLazyProductionDeps(projectDir: string) {
  return new Lazy(() => getProductionDependencies(projectDir))
}

/** @internal */
export async function getProductionDependencies(folder: string): Promise<Array<Dependency>> {
  const sorted: Array<Dependency> = []
{'fraction_non_alphanumeric': 0.1422160856057991, 'fraction_numerical': 0.0, 'mean_word_length': 5.232258064516129, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3868945', 'n_tokens_mistral': 944, 'n_tokens_neox': 875, 'n_words': 222}