({
name,
packageName,
objectClassName,
nativePackageId = DEFAULT_NATIVE_PACKAGE_ID,
// namespace - library API member removed since Windows platform
// is now removed (may be added back someday in the future)
// namespace,
platforms = DEFAULT_PLATFORMS,
tvosEnabled = false,
githubAccount = DEFAULT_GITHUB_ACCOUNT,
authorName = DEFAULT_AUTHOR_NAME,
authorEmail = DEFAULT_AUTHOR_EMAIL,
license = DEFAULT_LICENSE,
isView = false,
useAppleNetworking = false,
generateExample = DEFAULT_GENERATE_EXAMPLE,
exampleFileLinkage = false,
exampleName = DEFAULT_EXAMPLE_NAME,
exampleReactNativeTemplate = DEFAULT_EXAMPLE_REACT_NATIVE_TEMPLATE,
writeExamplePodfile = false,
}, {
fs = fsExtra, // (this can be mocked out for testing purposes)
execa = execaDefault, // (this can be mocked out for testing purposes)
reactNativeInit = reactNativeInitDefault // (can be overridden or mocked out for testing purposes)
})
| 66 | }; |
| 67 | |
| 68 | const generateWithNormalizedOptions = ({ |
| 69 | name, |
| 70 | packageName, |
| 71 | objectClassName, |
| 72 | nativePackageId = DEFAULT_NATIVE_PACKAGE_ID, |
| 73 | // namespace - library API member removed since Windows platform |
| 74 | // is now removed (may be added back someday in the future) |
| 75 | // namespace, |
| 76 | platforms = DEFAULT_PLATFORMS, |
| 77 | tvosEnabled = false, |
| 78 | githubAccount = DEFAULT_GITHUB_ACCOUNT, |
| 79 | authorName = DEFAULT_AUTHOR_NAME, |
| 80 | authorEmail = DEFAULT_AUTHOR_EMAIL, |
| 81 | license = DEFAULT_LICENSE, |
| 82 | isView = false, |
| 83 | useAppleNetworking = false, |
| 84 | generateExample = DEFAULT_GENERATE_EXAMPLE, |
| 85 | exampleFileLinkage = false, |
| 86 | exampleName = DEFAULT_EXAMPLE_NAME, |
| 87 | exampleReactNativeTemplate = DEFAULT_EXAMPLE_REACT_NATIVE_TEMPLATE, |
| 88 | writeExamplePodfile = false, |
| 89 | }, { |
| 90 | fs = fsExtra, // (this can be mocked out for testing purposes) |
| 91 | execa = execaDefault, // (this can be mocked out for testing purposes) |
| 92 | reactNativeInit = reactNativeInitDefault // (can be overridden or mocked out for testing purposes) |
| 93 | }) => { |
| 94 | if (nativePackageId === DEFAULT_NATIVE_PACKAGE_ID) { |
| 95 | warn(`While \`{DEFAULT_NATIVE_PACKAGE_ID}\` is the default package |
| 96 | identifier, it is recommended to customize the package identifier.`); |
| 97 | } |
| 98 | |
| 99 | // Note that the some of these console log messages are logged as |
| 100 | // info instead of verbose since they are needed to help |
| 101 | // make sense of the console output from the third-party tools. |
| 102 | |
| 103 | info( |
| 104 | `CREATE new React Native module with the following options: |
| 105 | |
| 106 | name: ${name} |
| 107 | full package name: ${packageName} |
| 108 | is view: ${isView} |
| 109 | object class name: ${objectClassName} |
| 110 | Android nativePackageId: ${nativePackageId} |
| 111 | platforms: ${platforms} |
| 112 | Apple tvosEnabled: ${tvosEnabled} |
| 113 | authorName: ${authorName} |
| 114 | authorEmail: ${authorEmail} |
| 115 | author githubAccount: ${githubAccount} |
| 116 | license: ${license} |
| 117 | useAppleNetworking: ${useAppleNetworking} |
| 118 | ` + (generateExample |
| 119 | ? ` |
| 120 | generateExample: ${generateExample} |
| 121 | exampleFileLinkage: ${exampleFileLinkage} |
| 122 | exampleName: ${exampleName} |
| 123 | exampleReactNativeTemplate: ${exampleReactNativeTemplate} |
| 124 | writeExamplePodfile: ${writeExamplePodfile} |
| 125 | ` : ``)); |
no test coverage detected