<commit_before>/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */
'use strict';

const ReactPackager = require('metro-bundler');

const denodeify = require('denodeify');
const fs = require('fs');
const path = require('path');

const {ASSET_REGISTRY_PATH} = require('../core/Constants');

function dependencies(argv, config, args, packagerInstance) {
  const rootModuleAbsolutePath = args.entryFile;
  if (!fs.existsSync(rootModuleAbsolutePath)) {
    return Promise.reject(new Error(`File ${rootModuleAbsolutePath} does not exist`));
  }

  const transformModulePath =
      args.transformer ? path.resolve(args.transformer) :
      typeof config.getTransformModulePath === 'function' ? config.getTransformModulePath() :
      undefined;

  const packageOpts = {
    assetRegistryPath: ASSET_REGISTRY_PATH,
    projectRoots: config.getProjectRoots(),
    blacklistRE: config.getBlacklistRE(),
    getPolyfills: config.getPolyfills,
    getTransformOptions: config.getTransformOptions,
    hasteImpl: config.hasteImpl,
    transformModulePath: transformModulePath,
    extraNodeModules: config.extraNodeModules,
    verbose: config.verbose,
    workerPath: config.getWorkerPath(),
  };

  const relativePath = packageOpts.projectRoots.map(root =>
    path.relative(
      root,
      rootModuleAbsolutePath
    )<commit_msg>Fix dependencies script when its running with dev=false<commit_after>/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */
'use strict';

const ReactPackager = require('metro-bundler');

const denodeify = require('denodeify');
const fs = require('fs');
const path = require('path');

const {ASSET_REGISTRY_PATH} = require('../core/Constants');

function dependencies(argv, config, args, packagerInstance) {
  const rootModuleAbsolutePath = args.entryFile;
  if (!fs.existsSync(rootModuleAbsolutePath)) {
    return Promise.reject(new Error(`File ${rootModuleAbsolutePath} does not exist`));
  }

  const transformModulePath =
      args.transformer ? path.resolve(args.transformer) :
      typeof config.getTransformModulePath === 'function' ? config.getTransformModulePath() :
      undefined;

  const packageOpts = {
    assetRegistryPath: ASSET_REGISTRY_PATH,
    projectRoots: config.getProjectRoots(),
    blacklistRE: config.getBlacklistRE(),
    getPolyfills: config.getPolyfills,
    getTransformOptions: config.getTransformOptions,
    hasteImpl: config.hasteImpl,
    postMinifyProcess: config.postMinifyProcess,
    transformModulePath: transformModulePath,
    extraNodeModules: config.extraNodeModules,
    verbose: config.verbose,
    workerPath: config.getWorkerPath(),
  };

  const relativePath = packageOpts.projectRoots.map(root =>
    path.relative(
      root,
      rootModuleAbsolutePath
    )
{'fraction_non_alphanumeric': 0.09960036889025516, 'fraction_numerical': 0.002459268367660621, 'mean_word_length': 4.505922165820643, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1198533', 'n_tokens_mistral': 924, 'n_tokens_neox': 902, 'n_words': 247}