@react-native-windows/cli 0.66.0-preview.1 → 0.67.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +283 -5
- package/CHANGELOG.md +122 -4
- package/lib-commonjs/config/configUtils.js +1 -1
- package/lib-commonjs/config/configUtils.js.map +1 -1
- package/lib-commonjs/config/dependencyConfig.js +2 -2
- package/lib-commonjs/config/dependencyConfig.js.map +1 -1
- package/lib-commonjs/config/projectConfig.js +2 -2
- package/lib-commonjs/config/projectConfig.js.map +1 -1
- package/lib-commonjs/e2etest/autolink.test.d.ts +5 -0
- package/lib-commonjs/e2etest/autolink.test.js +94 -13
- package/lib-commonjs/e2etest/autolink.test.js.map +1 -1
- package/lib-commonjs/e2etest/dependencyConfig.test.js +15 -15
- package/lib-commonjs/e2etest/dependencyConfig.test.js.map +1 -1
- package/lib-commonjs/e2etest/projectConfig.test.js +16 -16
- package/lib-commonjs/e2etest/projectConfig.test.js.map +1 -1
- package/lib-commonjs/e2etest/projectConfig.utils.js +4 -4
- package/lib-commonjs/e2etest/projectConfig.utils.js.map +1 -1
- package/lib-commonjs/e2etest/runWindows.test.js +21 -3
- package/lib-commonjs/e2etest/runWindows.test.js.map +1 -1
- package/lib-commonjs/generator-common/index.js +1 -1
- package/lib-commonjs/generator-common/index.js.map +1 -1
- package/lib-commonjs/generator-windows/index.js +23 -51
- package/lib-commonjs/generator-windows/index.js.map +1 -1
- package/lib-commonjs/healthChecks.js +22 -4
- package/lib-commonjs/healthChecks.js.map +1 -1
- package/lib-commonjs/index.js +3 -3
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/runWindows/runWindows.js +29 -26
- package/lib-commonjs/runWindows/runWindows.js.map +1 -1
- package/lib-commonjs/runWindows/runWindowsOptions.d.ts +8 -8
- package/lib-commonjs/runWindows/runWindowsOptions.js +1 -10
- package/lib-commonjs/runWindows/runWindowsOptions.js.map +1 -1
- package/lib-commonjs/runWindows/utils/autolink.d.ts +8 -5
- package/lib-commonjs/runWindows/utils/autolink.js +39 -31
- package/lib-commonjs/runWindows/utils/autolink.js.map +1 -1
- package/lib-commonjs/runWindows/utils/build.js +3 -3
- package/lib-commonjs/runWindows/utils/build.js.map +1 -1
- package/lib-commonjs/runWindows/utils/checkRequirements.js +1 -1
- package/lib-commonjs/runWindows/utils/checkRequirements.js.map +1 -1
- package/lib-commonjs/runWindows/utils/commandWithProgress.d.ts +2 -1
- package/lib-commonjs/runWindows/utils/commandWithProgress.js +5 -4
- package/lib-commonjs/runWindows/utils/commandWithProgress.js.map +1 -1
- package/lib-commonjs/runWindows/utils/deploy.d.ts +1 -1
- package/lib-commonjs/runWindows/utils/deploy.js +80 -29
- package/lib-commonjs/runWindows/utils/deploy.js.map +1 -1
- package/lib-commonjs/runWindows/utils/msbuildtools.js +11 -11
- package/lib-commonjs/runWindows/utils/msbuildtools.js.map +1 -1
- package/lib-commonjs/runWindows/utils/vsInstalls.js +1 -1
- package/lib-commonjs/runWindows/utils/vsInstalls.js.map +1 -1
- package/lib-commonjs/runWindows/utils/vstools.js +4 -5
- package/lib-commonjs/runWindows/utils/vstools.js.map +1 -1
- package/lib-commonjs/runWindows/utils/winappdeploytool.js +4 -4
- package/lib-commonjs/runWindows/utils/winappdeploytool.js.map +1 -1
- package/package.json +13 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generator-windows/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,kDAA0B;AAC1B,gDAAwB;AACxB,wDAAgC;AAChC,gDAAwB;AACxB,kEAAyC;AACzC,4CAAoB;AACpB,4CAAoB;AACpB,oDAA4B;AAC5B,oDAAuB;AACvB,sDAA6B;AAC7B,uDAAyE;AAEzE,0DAI6B;AAE7B,+DAA2D;AAC3D,uEAG6C;AAE7C,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,SAAS,GAAG,QAAQ,CA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under the MIT License.\n * @format\n */\n\nimport chalk from 'chalk';\nimport path from 'path';\nimport username from 'username';\nimport uuid from 'uuid';\nimport childProcess from 'child_process';\nimport fs from 'fs';\nimport os from 'os';\nimport semver from 'semver';\nimport _ from 'lodash';\nimport findUp from 'find-up';\nimport {readProjectFile, findPropertyValue} from '../config/configUtils';\n\nimport {\n createDir,\n copyAndReplaceAll,\n copyAndReplaceWithChangedCallback,\n} from '../generator-common';\nimport {GenerateOptions} from '..';\nimport {CodedError} from '@react-native-windows/telemetry';\nimport {\n findPackage,\n WritableNpmPackage,\n} from '@react-native-windows/package-utils';\n\nconst windowsDir = 'windows';\nconst bundleDir = 'Bundle';\n\nasync function generateCertificate(\n srcPath: string,\n destPath: string,\n newProjectName: string,\n currentUser: string,\n): Promise<string | null> {\n console.log('Generating self-signed certificate...');\n if (os.platform() === 'win32') {\n try {\n const thumbprint = childProcess\n .execSync(\n `powershell -NoProfile -Command \"Write-Output (New-SelfSignedCertificate -KeyUsage DigitalSignature -KeyExportPolicy Exportable -Subject 'CN=${currentUser}' -TextExtension @('2.5.29.37={text}1.3.6.1.5.5.7.3.3', '2.5.29.19={text}Subject Type:End Entity') -CertStoreLocation 'Cert:\\\\CurrentUser\\\\My').Thumbprint\"`,\n )\n .toString()\n .trim();\n if (!fs.existsSync(path.join(windowsDir, newProjectName))) {\n fs.mkdirSync(path.join(windowsDir, newProjectName));\n }\n childProcess.execSync(\n `powershell -NoProfile -Command \"$pwd = (ConvertTo-SecureString -String password -Force -AsPlainText); Export-PfxCertificate -Cert 'cert:\\\\CurrentUser\\\\My\\\\${thumbprint}' -FilePath ${path.join(\n windowsDir,\n newProjectName,\n newProjectName,\n )}_TemporaryKey.pfx -Password $pwd\"`,\n );\n console.log(\n chalk.green('Self-signed certificate generated successfully.'),\n );\n return thumbprint;\n } catch (err) {\n console.log(\n chalk.yellow('Unable to generate the self-signed certificate:'),\n );\n console.log(chalk.red(err));\n }\n }\n\n console.log(\n chalk.yellow('Using Default Certificate. Use Visual Studio to renew it.'),\n );\n await copyAndReplaceWithChangedCallback(\n path.join(srcPath, 'keys', 'MyApp_TemporaryKey.pfx'),\n destPath,\n path.join(windowsDir, newProjectName, newProjectName + '_TemporaryKey.pfx'),\n );\n\n return null;\n}\n\n/**\n * This represents the data to insert nuget packages\n */\ninterface NugetPackage {\n id: string;\n version: string;\n}\n\n/**\n * This represents the data to insert nuget packages with Cpp specific information\n */\ninterface CppNugetPackage extends NugetPackage {\n propsTopOfFile?: boolean;\n propsMiddleOfFile?: boolean;\n hasProps: boolean;\n hasTargets: boolean;\n}\n\nfunction pascalCase(str: string) {\n const camelCase = _.camelCase(str);\n return camelCase[0].toUpperCase() + camelCase.substr(1);\n}\n\nfunction resolveRnwPath(subpath: string): string {\n return require.resolve(path.join('react-native-windows', subpath), {\n paths: [process.cwd()],\n });\n}\n\n// Existing high cyclomatic complexity\n// eslint-disable-next-line complexity\nexport async function copyProjectTemplateAndReplace(\n srcRootPath: string,\n destPath: string,\n newProjectName: string,\n namespace: string,\n options: GenerateOptions,\n) {\n if (!srcRootPath) {\n throw new CodedError(\n 'CopyProjectTemplateNoSourcePath',\n 'Need a path to copy from',\n );\n }\n\n if (!destPath) {\n throw new CodedError(\n 'CopyProjectTemplateNoDestPath',\n 'Need a path to copy to',\n );\n }\n\n if (!newProjectName) {\n throw new CodedError(\n 'CopyProjectTemplateNoProjectName',\n 'Need a project name',\n );\n }\n\n const projectType = options.projectType;\n\n // React-native init only allows alphanumerics in project names, but other\n // new project tools (like create-react-native-module) are less strict.\n if (projectType === 'lib') {\n newProjectName = pascalCase(newProjectName);\n }\n\n // Similar to the above, but we want to retain namespace separators\n if (projectType === 'lib') {\n namespace = namespace\n .split(/[.:]+/)\n .map(pascalCase)\n .join('.');\n }\n\n createDir(path.join(destPath, windowsDir));\n createDir(path.join(destPath, windowsDir, newProjectName));\n\n if (projectType === 'app') {\n createDir(path.join(destPath, windowsDir, newProjectName, bundleDir));\n createDir(path.join(destPath, windowsDir, newProjectName, 'BundleBuilder'));\n }\n\n const language = options.language;\n const namespaceCpp = toCppNamespace(namespace);\n if (options.experimentalNuGetDependency) {\n console.log('Using experimental NuGet dependency.');\n }\n if (options.useWinUI3) {\n console.log('Using experimental WinUI3 dependency.');\n }\n const projDir = 'proj';\n const srcPath = path.join(srcRootPath, `${language}-${projectType}`);\n const sharedPath = path.join(srcRootPath, `shared-${projectType}`);\n const projectGuid = uuid.v4();\n const rnwVersion = require(resolveRnwPath('package.json')).version;\n const nugetVersion = options.nuGetTestVersion || rnwVersion;\n const packageGuid = uuid.v4();\n const currentUser = username.sync()!; // Gets the current username depending on the platform.\n\n let mainComponentName = newProjectName;\n const appJsonPath = await findUp('app.json', {cwd: destPath});\n if (appJsonPath) {\n mainComponentName = JSON.parse(fs.readFileSync(appJsonPath, 'utf8')).name;\n }\n\n const certificateThumbprint =\n projectType === 'app'\n ? await generateCertificate(\n srcPath,\n destPath,\n newProjectName,\n currentUser,\n )\n : null;\n\n const xamlNamespace = options.useWinUI3\n ? 'Microsoft.UI.Xaml'\n : 'Windows.UI.Xaml';\n const xamlNamespaceCpp = toCppNamespace(xamlNamespace);\n\n const winuiPropsPath = resolveRnwPath('PropertySheets/WinUI.props');\n const winuiProps = readProjectFile(winuiPropsPath);\n const winui3Version = findPropertyValue(\n winuiProps,\n 'WinUI3Version',\n winuiPropsPath,\n );\n const winui2xVersion = findPropertyValue(\n winuiProps,\n 'WinUI2xVersion',\n winuiPropsPath,\n );\n\n const jsEnginePropsPath = resolveRnwPath('PropertySheets/JSengine.props');\n const hermesVersion = findPropertyValue(\n readProjectFile(jsEnginePropsPath),\n 'HermesVersion',\n jsEnginePropsPath,\n );\n\n const csNugetPackages: NugetPackage[] = [\n {\n id: 'Microsoft.NETCore.UniversalWindowsPlatform',\n version: '6.2.9',\n },\n {\n id: 'ReactNative.Hermes.Windows',\n version: hermesVersion,\n },\n ];\n\n const cppNugetPackages: CppNugetPackage[] = [\n {\n id: 'Microsoft.Windows.CppWinRT',\n version: '2.0.210312.4',\n propsTopOfFile: true,\n hasProps: true,\n hasTargets: true,\n },\n {\n id: 'ReactNative.Hermes.Windows',\n version: hermesVersion,\n hasProps: false,\n hasTargets: true,\n },\n ];\n\n if (options.experimentalNuGetDependency) {\n csNugetPackages.push({\n id: 'Microsoft.ReactNative.Managed',\n version: nugetVersion,\n });\n\n cppNugetPackages.push({\n id: 'Microsoft.ReactNative',\n version: nugetVersion,\n hasProps: false,\n hasTargets: true,\n });\n\n cppNugetPackages.push({\n id: 'Microsoft.ReactNative.Cxx',\n version: nugetVersion,\n hasProps: false,\n hasTargets: true,\n });\n }\n\n const packagesConfigCppNugetPackages = [\n ...cppNugetPackages,\n {\n id: options.useWinUI3 ? 'Microsoft.WinUI' : 'Microsoft.UI.Xaml',\n version: options.useWinUI3 ? winui3Version : winui2xVersion,\n hasProps: false, // WinUI/MUX props and targets get handled by RNW's WinUI.props.\n hasTargets: false,\n },\n ];\n\n const templateVars: Record<string, any> = {\n useMustache: true,\n regExpPatternsToRemove: [],\n\n name: newProjectName,\n namespace: namespace,\n namespaceCpp: namespaceCpp,\n languageIsCpp: language === 'cpp',\n\n mainComponentName: mainComponentName,\n\n // Visual Studio is very picky about the casing of the guids for projects, project references and the solution\n // https://www.bing.com/search?q=visual+studio+project+guid+casing&cvid=311a5ad7f9fc41089507b24600d23ee7&FORM=ANAB01&PC=U531\n // we therefore have to precariously use the right casing in the right place or risk building in VS breaking.\n projectGuidLower: `{${projectGuid.toLowerCase()}}`,\n projectGuidUpper: `{${projectGuid.toUpperCase()}}`,\n\n // packaging and signing variables:\n packageGuid: packageGuid,\n currentUser: currentUser,\n certificateThumbprint: certificateThumbprint,\n\n useExperimentalNuget: options.experimentalNuGetDependency,\n nuGetTestFeed: options.nuGetTestFeed,\n\n // cpp template variables\n useWinUI3: options.useWinUI3,\n useHermes: options.useHermes,\n xamlNamespace: xamlNamespace,\n xamlNamespaceCpp: xamlNamespaceCpp,\n cppNugetPackages: cppNugetPackages,\n packagesConfigCppNugetPackages: packagesConfigCppNugetPackages,\n\n // cs template variables\n csNugetPackages: csNugetPackages,\n\n // autolinking template variables\n autolinkPropertiesForProps: '',\n autolinkProjectReferencesForTargets: '',\n autolinkCsUsingNamespaces: '',\n autolinkCsReactPackageProviders: '',\n autolinkCppIncludes: '',\n autolinkCppPackageProviders:\n '\\n UNREFERENCED_PARAMETER(packageProviders);', // CODESYNC: vnext\\local-cli\\runWindows\\utils\\autolink.js\n };\n\n const commonMappings =\n projectType === 'app'\n ? [\n // app common mappings\n {\n from: path.join(\n srcRootPath,\n options.useDevMode\n ? 'metro.devMode.config.js'\n : 'metro.config.js',\n ),\n to: 'metro.config.js',\n },\n {\n from: path.join(srcRootPath, '_gitignore'),\n to: path.join(windowsDir, '.gitignore'),\n },\n {\n from: path.join(srcRootPath, 'b_gitignore'),\n to: path.join(windowsDir, newProjectName, '.gitignore'),\n },\n {\n from: path.join(srcRootPath, 'index.windows.bundle'),\n to: path.join(\n windowsDir,\n newProjectName,\n bundleDir,\n 'index.windows.bundle',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'MyApp.sln'),\n to: path.join(windowsDir, newProjectName + '.sln'),\n },\n ]\n : [\n // lib common mappings\n {\n from: path.join(srcRootPath, '_gitignore'),\n to: path.join(windowsDir, '.gitignore'),\n },\n {\n from: path.join(srcPath, projDir, 'MyLib.sln'),\n to: path.join(windowsDir, newProjectName + '.sln'),\n },\n ];\n\n for (const mapping of commonMappings) {\n await copyAndReplaceWithChangedCallback(\n mapping.from,\n destPath,\n mapping.to,\n templateVars,\n options.overwrite,\n );\n }\n\n if (language === 'cs') {\n const csMappings =\n projectType === 'app'\n ? [\n // cs app mappings\n {\n from: path.join(srcPath, projDir, 'MyApp.csproj'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.csproj',\n ),\n },\n ]\n : [\n // cs lib mappings\n {\n from: path.join(srcPath, projDir, 'MyLib.csproj'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.csproj',\n ),\n },\n ];\n\n for (const mapping of csMappings) {\n await copyAndReplaceWithChangedCallback(\n mapping.from,\n destPath,\n mapping.to,\n templateVars,\n options.overwrite,\n );\n }\n } else {\n const cppMappings =\n projectType === 'app'\n ? [\n // cpp app mappings\n {\n from: path.join(srcPath, projDir, 'MyApp.vcxproj'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.vcxproj',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'MyApp.vcxproj.filters'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.vcxproj.filters',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'packages.config'),\n to: path.join(windowsDir, newProjectName, 'packages.config'),\n },\n ]\n : [\n // cpp lib mappings\n {\n from: path.join(srcPath, projDir, 'MyLib.vcxproj'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.vcxproj',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'MyLib.vcxproj.filters'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.vcxproj.filters',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'MyLib.def'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.def',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'packages.config'),\n to: path.join(windowsDir, newProjectName, 'packages.config'),\n },\n ];\n\n for (const mapping of cppMappings) {\n await copyAndReplaceWithChangedCallback(\n mapping.from,\n destPath,\n mapping.to,\n templateVars,\n options.overwrite,\n );\n }\n }\n\n // shared proj\n if (fs.existsSync(path.join(sharedPath, projDir))) {\n const sharedProjMappings = [];\n\n sharedProjMappings.push({\n from: path.join(sharedPath, projDir, 'NuGet.Config'),\n to: path.join(windowsDir, 'NuGet.Config'),\n });\n\n if (\n fs.existsSync(\n path.join(sharedPath, projDir, 'ExperimentalFeatures.props'),\n )\n ) {\n sharedProjMappings.push({\n from: path.join(sharedPath, projDir, 'ExperimentalFeatures.props'),\n to: path.join(windowsDir, 'ExperimentalFeatures.props'),\n });\n }\n\n for (const mapping of sharedProjMappings) {\n await copyAndReplaceWithChangedCallback(\n mapping.from,\n destPath,\n mapping.to,\n templateVars,\n options.overwrite,\n );\n }\n }\n\n // shared assets\n if (fs.existsSync(path.join(sharedPath, 'assets'))) {\n await copyAndReplaceAll(\n path.join(sharedPath, 'assets'),\n destPath,\n path.join(windowsDir, newProjectName, 'Assets'),\n templateVars,\n options.overwrite,\n );\n }\n\n // shared src\n if (fs.existsSync(path.join(sharedPath, 'src'))) {\n await copyAndReplaceAll(\n path.join(sharedPath, 'src'),\n destPath,\n path.join(windowsDir, newProjectName),\n templateVars,\n options.overwrite,\n );\n }\n\n // src\n if (fs.existsSync(path.join(srcPath, 'src'))) {\n await copyAndReplaceAll(\n path.join(srcPath, 'src'),\n destPath,\n path.join(windowsDir, newProjectName),\n templateVars,\n options.overwrite,\n );\n }\n\n if (projectType === 'app') {\n console.log(chalk.white.bold('To run your app on UWP:'));\n console.log(chalk.white(' npx react-native run-windows'));\n }\n}\n\nfunction toCppNamespace(namespace: string) {\n return namespace.replace(/\\./g, '::');\n}\n\nexport async function installScriptsAndDependencies(options: {\n verbose: boolean;\n}) {\n const projectPackage = await WritableNpmPackage.fromPath(process.cwd());\n if (!projectPackage) {\n throw new Error(\n `The current directory '${process.cwd()}' is not the root of an npm package`,\n );\n }\n\n await projectPackage.mergeProps({\n scripts: {windows: 'react-native run-windows'},\n });\n\n const rnwPackage = await findPackage('react-native-windows');\n if (!rnwPackage) {\n throw new Error('Could not locate the package for react-native-windows');\n }\n\n const rnPackage = await findPackage('react-native');\n if (!rnPackage) {\n throw new Error('Could not locate the package for react-native');\n }\n\n // We add an exclusionList from metro config. This will be hoisted, but add\n // an explict dep because we require it directly.\n const cliPackage = await findPackage('@react-native-community/cli', {\n searchPath: rnPackage.path,\n });\n const metroConfigPackage = await findPackage('metro-config', {\n searchPath: cliPackage?.path || rnPackage.path,\n });\n\n if (metroConfigPackage) {\n await projectPackage.mergeProps({\n devDependencies: {\n 'metro-config': `^${metroConfigPackage.json.version}`,\n },\n });\n }\n\n const rnPeerDependency = rnwPackage.json.peerDependencies['react-native'];\n\n if (\n !semver.satisfies(rnPackage.json.version, rnPeerDependency) &&\n projectPackage.json.dependencies?.['react-native']\n ) {\n console.log(\n chalk.green('Installing a compatible version of react-native:'),\n );\n console.log(chalk.white(` ${rnPeerDependency}`));\n\n // Patch package.json to have proper react-native version and install\n await projectPackage.mergeProps({\n dependencies: {'react-native': rnPeerDependency},\n });\n\n // Install dependencies using correct package manager\n const isYarn = fs.existsSync(path.join(process.cwd(), 'yarn.lock'));\n childProcess.execSync(\n isYarn ? 'yarn' : 'npm i',\n options.verbose ? {stdio: 'inherit'} : {},\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generator-windows/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,kDAA0B;AAC1B,gDAAwB;AACxB,wDAAgC;AAChC,gDAAwB;AACxB,kEAAyC;AACzC,4CAAoB;AACpB,oDAA4B;AAC5B,oDAAuB;AACvB,sDAA6B;AAC7B,uDAAyE;AAEzE,0DAI6B;AAE7B,+DAA2D;AAC3D,uEAG6C;AAE7C,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,SAAS,GAAG,QAAQ,CAAC;AAoB3B,SAAS,UAAU,CAAC,GAAW;IAC7B,MAAM,SAAS,GAAG,gBAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACnC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,cAAc,CAAC,OAAe;IACrC,OAAO,OAAO,CAAC,OAAO,CAAC,cAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAC,EAAE;QACjE,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;KACvB,CAAC,CAAC;A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CAAC,IAAI,CAAC,YAAY,0CAAG,cAAc,CAAC,CAAA,EAClD;QACA,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAChE,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,OAAO,gBAAgB,EAAE,CAAC,CAAC,CAAC;QAEpD,qEAAqE;QACrE,MAAM,cAAc,CAAC,UAAU,CAAC;YAC9B,YAAY,EAAE,EAAC,cAAc,EAAE,gBAAgB,EAAC;SACjD,CAAC,CAAC;QAEH,qDAAqD;QACrD,MAAM,MAAM,GAAG,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;QACpE,uBAAY,CAAC,QAAQ,CACnB,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EACzB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAC,KAAK,EAAE,SAAS,EAAC,CAAC,CAAC,CAAC,EAAE,CAC1C,CAAC;KACH;AACH,CAAC;AAhED,sEAgEC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport chalk from 'chalk';\nimport path from 'path';\nimport username from 'username';\nimport uuid from 'uuid';\nimport childProcess from 'child_process';\nimport fs from 'fs';\nimport semver from 'semver';\nimport _ from 'lodash';\nimport findUp from 'find-up';\nimport {readProjectFile, findPropertyValue} from '../config/configUtils';\n\nimport {\n createDir,\n copyAndReplaceAll,\n copyAndReplaceWithChangedCallback,\n} from '../generator-common';\nimport {GenerateOptions} from '..';\nimport {CodedError} from '@react-native-windows/telemetry';\nimport {\n findPackage,\n WritableNpmPackage,\n} from '@react-native-windows/package-utils';\n\nconst windowsDir = 'windows';\nconst bundleDir = 'Bundle';\n\n/**\n * This represents the data to insert nuget packages\n */\ninterface NugetPackage {\n id: string;\n version: string;\n}\n\n/**\n * This represents the data to insert nuget packages with Cpp specific information\n */\ninterface CppNugetPackage extends NugetPackage {\n propsTopOfFile?: boolean;\n propsMiddleOfFile?: boolean;\n hasProps: boolean;\n hasTargets: boolean;\n}\n\nfunction pascalCase(str: string) {\n const camelCase = _.camelCase(str);\n return camelCase[0].toUpperCase() + camelCase.substr(1);\n}\n\nfunction resolveRnwPath(subpath: string): string {\n return require.resolve(path.join('react-native-windows', subpath), {\n paths: [process.cwd()],\n });\n}\n\n// Existing high cyclomatic complexity\n// eslint-disable-next-line complexity\nexport async function copyProjectTemplateAndReplace(\n srcRootPath: string,\n destPath: string,\n newProjectName: string,\n namespace: string,\n options: GenerateOptions,\n) {\n if (!srcRootPath) {\n throw new CodedError(\n 'CopyProjectTemplateNoSourcePath',\n 'Need a path to copy from',\n );\n }\n\n if (!destPath) {\n throw new CodedError(\n 'CopyProjectTemplateNoDestPath',\n 'Need a path to copy to',\n );\n }\n\n if (!newProjectName) {\n throw new CodedError(\n 'CopyProjectTemplateNoProjectName',\n 'Need a project name',\n );\n }\n\n const projectType = options.projectType;\n\n // React-native init only allows alphanumerics in project names, but other\n // new project tools (like create-react-native-module) are less strict.\n if (projectType === 'lib') {\n newProjectName = pascalCase(newProjectName);\n }\n\n // Similar to the above, but we want to retain namespace separators\n if (projectType === 'lib') {\n namespace = namespace\n .split(/[.:]+/)\n .map(pascalCase)\n .join('.');\n }\n\n createDir(path.join(destPath, windowsDir));\n createDir(path.join(destPath, windowsDir, newProjectName));\n\n if (projectType === 'app') {\n createDir(path.join(destPath, windowsDir, newProjectName, bundleDir));\n createDir(path.join(destPath, windowsDir, newProjectName, 'BundleBuilder'));\n }\n\n const language = options.language;\n const namespaceCpp = toCppNamespace(namespace);\n if (options.experimentalNuGetDependency) {\n console.log('Using experimental NuGet dependency.');\n }\n if (options.useWinUI3) {\n console.log('Using experimental WinUI3 dependency.');\n }\n const projDir = 'proj';\n const srcPath = path.join(srcRootPath, `${language}-${projectType}`);\n const sharedPath = path.join(srcRootPath, `shared-${projectType}`);\n const projectGuid = uuid.v4();\n const rnwVersion = require(resolveRnwPath('package.json')).version;\n const nugetVersion = options.nuGetTestVersion || rnwVersion;\n const packageGuid = uuid.v4();\n const currentUser = username.sync()!; // Gets the current username depending on the platform.\n\n let mainComponentName = newProjectName;\n const appJsonPath = await findUp('app.json', {cwd: destPath});\n if (appJsonPath) {\n mainComponentName = JSON.parse(fs.readFileSync(appJsonPath, 'utf8')).name;\n }\n\n const xamlNamespace = options.useWinUI3\n ? 'Microsoft.UI.Xaml'\n : 'Windows.UI.Xaml';\n const xamlNamespaceCpp = toCppNamespace(xamlNamespace);\n\n const winuiPropsPath = resolveRnwPath('PropertySheets/WinUI.props');\n const winuiProps = readProjectFile(winuiPropsPath);\n const winui3Version = findPropertyValue(\n winuiProps,\n 'WinUI3Version',\n winuiPropsPath,\n );\n const winui2xVersion = findPropertyValue(\n winuiProps,\n 'WinUI2xVersion',\n winuiPropsPath,\n );\n\n const jsEnginePropsPath = resolveRnwPath('PropertySheets/JSengine.props');\n const hermesVersion = findPropertyValue(\n readProjectFile(jsEnginePropsPath),\n 'HermesVersion',\n jsEnginePropsPath,\n );\n\n const csNugetPackages: NugetPackage[] = [\n {\n id: 'Microsoft.NETCore.UniversalWindowsPlatform',\n version: '6.2.9',\n },\n {\n id: 'ReactNative.Hermes.Windows',\n version: hermesVersion,\n },\n ];\n\n const cppNugetPackages: CppNugetPackage[] = [\n {\n id: 'Microsoft.Windows.CppWinRT',\n version: '2.0.210312.4',\n propsTopOfFile: true,\n hasProps: true,\n hasTargets: true,\n },\n {\n id: 'ReactNative.Hermes.Windows',\n version: hermesVersion,\n hasProps: false,\n hasTargets: true,\n },\n ];\n\n if (options.experimentalNuGetDependency) {\n csNugetPackages.push({\n id: 'Microsoft.ReactNative.Managed',\n version: nugetVersion,\n });\n\n cppNugetPackages.push({\n id: 'Microsoft.ReactNative',\n version: nugetVersion,\n hasProps: false,\n hasTargets: true,\n });\n\n cppNugetPackages.push({\n id: 'Microsoft.ReactNative.Cxx',\n version: nugetVersion,\n hasProps: false,\n hasTargets: true,\n });\n }\n\n const packagesConfigCppNugetPackages = [\n ...cppNugetPackages,\n {\n id: options.useWinUI3 ? 'Microsoft.WinUI' : 'Microsoft.UI.Xaml',\n version: options.useWinUI3 ? winui3Version : winui2xVersion,\n hasProps: false, // WinUI/MUX props and targets get handled by RNW's WinUI.props.\n hasTargets: false,\n },\n ];\n\n const templateVars: Record<string, any> = {\n useMustache: true,\n regExpPatternsToRemove: [],\n\n name: newProjectName,\n namespace: namespace,\n namespaceCpp: namespaceCpp,\n languageIsCpp: language === 'cpp',\n\n mainComponentName: mainComponentName,\n\n // Visual Studio is very picky about the casing of the guids for projects, project references and the solution\n // https://www.bing.com/search?q=visual+studio+project+guid+casing&cvid=311a5ad7f9fc41089507b24600d23ee7&FORM=ANAB01&PC=U531\n // we therefore have to precariously use the right casing in the right place or risk building in VS breaking.\n projectGuidLower: `{${projectGuid.toLowerCase()}}`,\n projectGuidUpper: `{${projectGuid.toUpperCase()}}`,\n\n // packaging and signing variables:\n packageGuid: packageGuid,\n currentUser: currentUser,\n\n useExperimentalNuget: options.experimentalNuGetDependency,\n nuGetTestFeed: options.nuGetTestFeed,\n\n // cpp template variables\n useWinUI3: options.useWinUI3,\n useHermes: options.useHermes,\n xamlNamespace: xamlNamespace,\n xamlNamespaceCpp: xamlNamespaceCpp,\n cppNugetPackages: cppNugetPackages,\n packagesConfigCppNugetPackages: packagesConfigCppNugetPackages,\n\n // cs template variables\n csNugetPackages: csNugetPackages,\n\n // autolinking template variables\n autolinkPropertiesForProps: '',\n autolinkProjectReferencesForTargets: '',\n autolinkCsUsingNamespaces: '',\n autolinkCsReactPackageProviders: '',\n autolinkCppIncludes: '',\n autolinkCppPackageProviders:\n '\\n UNREFERENCED_PARAMETER(packageProviders);', // CODESYNC: vnext\\local-cli\\runWindows\\utils\\autolink.js\n };\n\n const commonMappings =\n projectType === 'app'\n ? [\n // app common mappings\n {\n from: path.join(\n srcRootPath,\n options.useDevMode\n ? 'metro.devMode.config.js'\n : 'metro.config.js',\n ),\n to: 'metro.config.js',\n },\n {\n from: path.join(srcRootPath, '_gitignore'),\n to: path.join(windowsDir, '.gitignore'),\n },\n {\n from: path.join(srcRootPath, 'b_gitignore'),\n to: path.join(windowsDir, newProjectName, '.gitignore'),\n },\n {\n from: path.join(srcRootPath, 'index.windows.bundle'),\n to: path.join(\n windowsDir,\n newProjectName,\n bundleDir,\n 'index.windows.bundle',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'MyApp.sln'),\n to: path.join(windowsDir, newProjectName + '.sln'),\n },\n ]\n : [\n // lib common mappings\n {\n from: path.join(srcRootPath, '_gitignore'),\n to: path.join(windowsDir, '.gitignore'),\n },\n {\n from: path.join(srcPath, projDir, 'MyLib.sln'),\n to: path.join(windowsDir, newProjectName + '.sln'),\n },\n ];\n\n for (const mapping of commonMappings) {\n await copyAndReplaceWithChangedCallback(\n mapping.from,\n destPath,\n mapping.to,\n templateVars,\n options.overwrite,\n );\n }\n\n if (language === 'cs') {\n const csMappings =\n projectType === 'app'\n ? [\n // cs app mappings\n {\n from: path.join(srcPath, projDir, 'MyApp.csproj'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.csproj',\n ),\n },\n ]\n : [\n // cs lib mappings\n {\n from: path.join(srcPath, projDir, 'MyLib.csproj'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.csproj',\n ),\n },\n ];\n\n for (const mapping of csMappings) {\n await copyAndReplaceWithChangedCallback(\n mapping.from,\n destPath,\n mapping.to,\n templateVars,\n options.overwrite,\n );\n }\n } else {\n const cppMappings =\n projectType === 'app'\n ? [\n // cpp app mappings\n {\n from: path.join(srcPath, projDir, 'MyApp.vcxproj'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.vcxproj',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'MyApp.vcxproj.filters'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.vcxproj.filters',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'packages.config'),\n to: path.join(windowsDir, newProjectName, 'packages.config'),\n },\n ]\n : [\n // cpp lib mappings\n {\n from: path.join(srcPath, projDir, 'MyLib.vcxproj'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.vcxproj',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'MyLib.vcxproj.filters'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.vcxproj.filters',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'MyLib.def'),\n to: path.join(\n windowsDir,\n newProjectName,\n newProjectName + '.def',\n ),\n },\n {\n from: path.join(srcPath, projDir, 'packages.config'),\n to: path.join(windowsDir, newProjectName, 'packages.config'),\n },\n ];\n\n for (const mapping of cppMappings) {\n await copyAndReplaceWithChangedCallback(\n mapping.from,\n destPath,\n mapping.to,\n templateVars,\n options.overwrite,\n );\n }\n }\n\n // shared proj\n if (fs.existsSync(path.join(sharedPath, projDir))) {\n const sharedProjMappings = [];\n\n sharedProjMappings.push({\n from: path.join(sharedPath, projDir, 'NuGet.Config'),\n to: path.join(windowsDir, 'NuGet.Config'),\n });\n\n if (\n fs.existsSync(\n path.join(sharedPath, projDir, 'ExperimentalFeatures.props'),\n )\n ) {\n sharedProjMappings.push({\n from: path.join(sharedPath, projDir, 'ExperimentalFeatures.props'),\n to: path.join(windowsDir, 'ExperimentalFeatures.props'),\n });\n }\n\n for (const mapping of sharedProjMappings) {\n await copyAndReplaceWithChangedCallback(\n mapping.from,\n destPath,\n mapping.to,\n templateVars,\n options.overwrite,\n );\n }\n }\n\n // shared assets\n if (fs.existsSync(path.join(sharedPath, 'assets'))) {\n await copyAndReplaceAll(\n path.join(sharedPath, 'assets'),\n destPath,\n path.join(windowsDir, newProjectName, 'Assets'),\n templateVars,\n options.overwrite,\n );\n }\n\n // shared src\n if (fs.existsSync(path.join(sharedPath, 'src'))) {\n await copyAndReplaceAll(\n path.join(sharedPath, 'src'),\n destPath,\n path.join(windowsDir, newProjectName),\n templateVars,\n options.overwrite,\n );\n }\n\n // src\n if (fs.existsSync(path.join(srcPath, 'src'))) {\n await copyAndReplaceAll(\n path.join(srcPath, 'src'),\n destPath,\n path.join(windowsDir, newProjectName),\n templateVars,\n options.overwrite,\n );\n }\n\n if (projectType === 'app') {\n console.log(chalk.white.bold('To run your app on UWP:'));\n console.log(chalk.white(' npx react-native run-windows'));\n }\n}\n\nfunction toCppNamespace(namespace: string) {\n return namespace.replace(/\\./g, '::');\n}\n\nexport async function installScriptsAndDependencies(options: {\n verbose: boolean;\n}) {\n const projectPackage = await WritableNpmPackage.fromPath(process.cwd());\n if (!projectPackage) {\n throw new Error(\n `The current directory '${process.cwd()}' is not the root of an npm package`,\n );\n }\n\n await projectPackage.mergeProps({\n scripts: {windows: 'react-native run-windows'},\n });\n\n const rnwPackage = await findPackage('react-native-windows');\n if (!rnwPackage) {\n throw new Error('Could not locate the package for react-native-windows');\n }\n\n const rnPackage = await findPackage('react-native');\n if (!rnPackage) {\n throw new Error('Could not locate the package for react-native');\n }\n\n // We add an exclusionList from metro config. This will be hoisted, but add\n // an explict dep because we require it directly.\n const cliPackage = await findPackage('@react-native-community/cli', {\n searchPath: rnPackage.path,\n });\n const metroConfigPackage = await findPackage('metro-config', {\n searchPath: cliPackage?.path || rnPackage.path,\n });\n\n if (metroConfigPackage) {\n await projectPackage.mergeProps({\n devDependencies: {\n 'metro-config': `^${metroConfigPackage.json.version}`,\n },\n });\n }\n\n const rnPeerDependency = rnwPackage.json.peerDependencies['react-native'];\n\n if (\n !semver.satisfies(rnPackage.json.version, rnPeerDependency) &&\n projectPackage.json.dependencies?.['react-native']\n ) {\n console.log(\n chalk.green('Installing a compatible version of react-native:'),\n );\n console.log(chalk.white(` ${rnPeerDependency}`));\n\n // Patch package.json to have proper react-native version and install\n await projectPackage.mergeProps({\n dependencies: {'react-native': rnPeerDependency},\n });\n\n // Install dependencies using correct package manager\n const isYarn = fs.existsSync(path.join(process.cwd(), 'yarn.lock'));\n childProcess.execSync(\n isYarn ? 'yarn' : 'npm i',\n options.verbose ? {stdio: 'inherit'} : {},\n );\n }\n}\n"]}
|
|
@@ -10,13 +10,32 @@ const rnDir = path_1.default.dirname(require.resolve('react-native/package.json'
|
|
|
10
10
|
const cliDir = path_1.default.dirname(require.resolve('@react-native-community/cli/package.json', { paths: [rnDir] }));
|
|
11
11
|
const execaPath = require.resolve('execa', { paths: [cliDir] });
|
|
12
12
|
const execa = require(execaPath);
|
|
13
|
+
const commandWithProgress_1 = require("./runWindows/utils/commandWithProgress");
|
|
13
14
|
function getHealthChecks() {
|
|
15
|
+
// #8471: There are known cases where the dependencies script will error out.
|
|
16
|
+
// Fail gracefully if that happens in the meantime.
|
|
17
|
+
try {
|
|
18
|
+
return getHealthChecksUnsafe();
|
|
19
|
+
}
|
|
20
|
+
catch (_a) {
|
|
21
|
+
return [{
|
|
22
|
+
label: 'Windows',
|
|
23
|
+
healthchecks: [{
|
|
24
|
+
label: 'Failed to enumerate health checks',
|
|
25
|
+
getDiagnostics: async () => ({ needsToBeFixed: true }),
|
|
26
|
+
runAutomaticFix: async ({ loader }) => { loader.fail(); },
|
|
27
|
+
}]
|
|
28
|
+
}];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.getHealthChecks = getHealthChecks;
|
|
32
|
+
function getHealthChecksUnsafe() {
|
|
14
33
|
// All our health checks are windows only...
|
|
15
34
|
if (process.platform !== 'win32') {
|
|
16
35
|
return undefined;
|
|
17
36
|
}
|
|
18
37
|
const rnwDepScriptPath = path_1.default.join(path_1.default.dirname(require.resolve('react-native-windows/package.json', { paths: [process.cwd()] })), 'Scripts/rnw-dependencies.ps1');
|
|
19
|
-
const rnwDeps = child_process_1.execSync(
|
|
38
|
+
const rnwDeps = (0, child_process_1.execSync)(`${commandWithProgress_1.powershell} -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -ListChecks`, { stdio: 'pipe' });
|
|
20
39
|
const deps = rnwDeps.toString().trim().split('\n');
|
|
21
40
|
return [
|
|
22
41
|
{
|
|
@@ -35,7 +54,7 @@ function getHealthChecks() {
|
|
|
35
54
|
getDiagnostics: async () => {
|
|
36
55
|
let needsToBeFixed = true;
|
|
37
56
|
try {
|
|
38
|
-
await execa(
|
|
57
|
+
await execa(`${commandWithProgress_1.powershell} -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -Check ${id}`);
|
|
39
58
|
needsToBeFixed = false;
|
|
40
59
|
}
|
|
41
60
|
catch (_a) {
|
|
@@ -45,7 +64,7 @@ function getHealthChecks() {
|
|
|
45
64
|
};
|
|
46
65
|
},
|
|
47
66
|
runAutomaticFix: async ({ loader, logManualInstallation }) => {
|
|
48
|
-
const command =
|
|
67
|
+
const command = `${commandWithProgress_1.powershell} -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -Check ${id}`;
|
|
49
68
|
try {
|
|
50
69
|
const { exitCode } = await execa(command, { stdio: 'inherit' });
|
|
51
70
|
if (exitCode) {
|
|
@@ -66,5 +85,4 @@ function getHealthChecks() {
|
|
|
66
85
|
}
|
|
67
86
|
];
|
|
68
87
|
}
|
|
69
|
-
exports.getHealthChecks = getHealthChecks;
|
|
70
88
|
//# sourceMappingURL=healthChecks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"healthChecks.js","sourceRoot":"","sources":["../src/healthChecks.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,iDAAwC;AAExC,MAAM,KAAK,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,2BAA2B,EAAE,EAAC,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC;AACnG,MAAM,MAAM,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,0CAA0C,EAAE,EAAC,KAAK,EAAE,CAAC,K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4BACnH,cAAc,GAAG,KAAK,CAAC;yBACxB;wBAAC,WAAM;yBACP;wBACD,OAAO;4BACL,cAAc;yBACf,CAAA;oBACH,CAAC;oBACD,eAAe,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,qBAAqB,EAAE,EAAE,EAAE;wBAC3D,MAAM,OAAO,GAAG,GAAG,gCAAU,8CAA8C,gBAAgB,YAAY,EAAE,EAAE,CAAC;wBAC5G,IAAI;4BACF,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;4BAChE,IAAI,QAAQ,EAAE;gCACZ,qBAAqB,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,oCAAoC,EAAE,GAAG,EAAE,CAAC,CAAC;gCAC3F,MAAM,CAAC,IAAI,EAAE,CAAC;6BACf;iCAAM;gCACL,MAAM,CAAC,OAAO,EAAE,CAAC;6BAClB;yBACF;wBAAC,WAAM;4BACN,qBAAqB,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,oCAAoC,EAAE,GAAG,EAAE,CAAC,CAAC;4BAC3F,MAAM,CAAC,IAAI,EAAE,CAAC;yBACf;oBACH,CAAC;iBACF,CAAA;YACH,CAAC,CAAC;SACL;KAAC,CAAC;AACP,CAAC","sourcesContent":["import path from 'path';\n\nimport { execSync} from 'child_process';\n\nconst rnDir = path.dirname(require.resolve('react-native/package.json', {paths: [process.cwd()]}));\nconst cliDir = path.dirname(require.resolve('@react-native-community/cli/package.json', {paths: [rnDir]}));\nconst execaPath = require.resolve('execa', { paths: [cliDir] });\nconst execa = require(execaPath);\n\nimport type {HealthCheckCategory} from '@react-native-community/cli-types';\nimport { powershell } from './runWindows/utils/commandWithProgress';\n\nexport function getHealthChecks(): HealthCheckCategory[] | undefined {\n // #8471: There are known cases where the dependencies script will error out.\n // Fail gracefully if that happens in the meantime.\n try {\n return getHealthChecksUnsafe();\n } catch {\n return [{\n label: 'Windows',\n healthchecks: [{\n label: 'Failed to enumerate health checks',\n getDiagnostics: async () => ({needsToBeFixed: true}),\n runAutomaticFix: async ({loader}) => {loader.fail()},\n }]\n }];\n }\n}\n\nfunction getHealthChecksUnsafe(): HealthCheckCategory[] | undefined {\n// All our health checks are windows only...\n if (process.platform !== 'win32') {\n return undefined;\n }\n\n const rnwDepScriptPath = path.join(path.dirname(require.resolve(\n 'react-native-windows/package.json',\n {paths: [process.cwd()]})), 'Scripts/rnw-dependencies.ps1');\n \n const rnwDeps = execSync(`${powershell} -ExecutionPolicy Unrestricted -NoProfile \"${rnwDepScriptPath}\" -NoPrompt -ListChecks`, {stdio: 'pipe'});\n const deps = rnwDeps.toString().trim().split('\\n');\n return [\n {\n label: 'Windows',\n healthchecks:\n deps.map(dep => {\n const match = /([^:]+): ([^:]+): (.*)/.exec(dep);\n if (!match) {\n throw new Error(`Unexpected output from ${rnwDepScriptPath}`);\n }\n const [, /*optional*/, id, name] = match;\n return {\n label: name,\n // The schema check of react-native doctor requires this to be a string, although it should be a boolean\n // Enable this once we pick up a new version of the CLI that includes https://github.com/react-native-community/cli/pull/1367\n // isRequired: (optional.trim() === 'Required') ? true : false, \n getDiagnostics: async () => {\n let needsToBeFixed = true;\n try {\n await execa(`${powershell} -ExecutionPolicy Unrestricted -NoProfile \"${rnwDepScriptPath}\" -NoPrompt -Check ${id}`);\n needsToBeFixed = false;\n } catch {\n }\n return {\n needsToBeFixed,\n }\n },\n runAutomaticFix: async ({ loader, logManualInstallation }) => {\n const command = `${powershell} -ExecutionPolicy Unrestricted -NoProfile \"${rnwDepScriptPath}\" -Check ${id}`;\n try {\n const { exitCode } = await execa(command, { stdio: 'inherit' });\n if (exitCode) {\n logManualInstallation({ command, healthcheck: `react-native-windows dependency \"${id}\"` });\n loader.fail();\n } else {\n loader.succeed();\n }\n } catch {\n logManualInstallation({ command, healthcheck: `react-native-windows dependency \"${id}\"` });\n loader.fail();\n }\n }\n }\n })\n }];\n }"]}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
12
12
|
o[k2] = m[k];
|
|
13
13
|
}));
|
|
14
14
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
16
|
};
|
|
17
17
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -54,12 +54,12 @@ async function generateWindows(projectDir, name, ns, options) {
|
|
|
54
54
|
if (!fs_1.default.existsSync(projectDir)) {
|
|
55
55
|
fs_1.default.mkdirSync(projectDir);
|
|
56
56
|
}
|
|
57
|
-
await generator_windows_1.installScriptsAndDependencies(options);
|
|
57
|
+
await (0, generator_windows_1.installScriptsAndDependencies)(options);
|
|
58
58
|
const rnwPackage = path_1.default.dirname(require.resolve('react-native-windows/package.json', {
|
|
59
59
|
paths: [projectDir],
|
|
60
60
|
}));
|
|
61
61
|
const templateRoot = path_1.default.join(rnwPackage, 'template');
|
|
62
|
-
await generator_windows_1.copyProjectTemplateAndReplace(templateRoot, projectDir, name, ns, options);
|
|
62
|
+
await (0, generator_windows_1.copyProjectTemplateAndReplace)(templateRoot, projectDir, name, ns, options);
|
|
63
63
|
}
|
|
64
64
|
catch (e) {
|
|
65
65
|
error = e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,4CAAoB;AACpB,gDAAwB;AACxB,+DAA0D;AAE1D,2DAG6B;AAE7B,0DAA4D;AAC5D,wDAA0D;AAC1D,gEAAkE;AAClE,0DAA4D;AAiC5D,SAAS,YAAY,CAAC,GAAoB;IACxC,OAAO;QACL,SAAS,EAA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qBACC,YAAY,CACX,OAAO,CAAC,OAAO,CAAC,mCAAmC,EAAE;oBACnD,KAAK,EAAE,CAAC,GAAG,CAAC;iBACb,CAAC,CACH;qBACA,QAAQ,EAAE,CACd,CAAC;gBACF,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;gBAC1D,MAAM,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;gBACjD,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC;aACpC;YAAC,WAAM,GAAE;YACV,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;YAC1C,qBAAS,CAAC,MAAM,CAAC,UAAU,CAAC;gBAC1B,IAAI,EAAE,kBAAkB;gBACxB,UAAU,EAAE;oBACV,KAAK,EAAE,KAAK;oBACZ,GAAG,WAAW;oBACd,cAAc,EAAE,SAAS;oBACzB,aAAa,EAAE,UAAU;iBAC1B;aACF,CAAC,CAAC;YAEH,qBAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;SAC1B;KACF;AACH,CAAC;AAhED,0CAgEC;AAED,iEAAiE;AACjE,MAAM,qBAAqB,GAOf,IAAI,CAAC;AACjB,qBAAqB,CAAC;AAET,QAAA,QAAQ,GAAG,CAAC,0BAAe,EAAE,8BAAiB,CAAC,CAAC;AAChD,QAAA,gBAAgB,GAAG,0CAAuB,CAAC;AAC3C,QAAA,aAAa,GAAG,oCAAoB,CAAC;AAClD,iDAA+B","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport {Telemetry} from '@react-native-windows/telemetry';\n\nimport {\n copyProjectTemplateAndReplace,\n installScriptsAndDependencies,\n} from './generator-windows';\n\nimport {autoLinkCommand} from './runWindows/utils/autolink';\nimport {runWindowsCommand} from './runWindows/runWindows';\nimport {dependencyConfigWindows} from './config/dependencyConfig';\nimport {projectConfigWindows} from './config/projectConfig';\n\n/**\n * Project generation options\n *\n * _\n * | |\n * __| | __ _ _ __ __ _ ___ _ __\n * / _` |/ _` | '_ \\ / _` |/ _ \\ '__|\n * | (_| | (_| | | | | (_| | __/ |\n * \\__,_|\\__,_|_| |_|\\__, |\\___|_|\n * __/ |\n * |___/\n *\n *\n * Properties on this interface must remain stable, as new versions of\n * react-native-windows-init may be used with local-cli dating back to 0.61.\n * All existing arguments must work correctly when changing this interface.\n */\nexport interface GenerateOptions {\n overwrite: boolean;\n language: 'cpp' | 'cs';\n projectType: 'app' | 'lib';\n experimentalNuGetDependency: boolean;\n nuGetTestVersion?: string;\n nuGetTestFeed?: string;\n useWinUI3: boolean;\n useHermes: boolean;\n useDevMode: boolean;\n verbose: boolean;\n telemetry: boolean;\n}\n\nfunction scrubOptions(opt: GenerateOptions) {\n return {\n overwrite: opt.overwrite,\n language: opt.language,\n projectType: opt.projectType,\n experimentalNuGetDependency: opt.experimentalNuGetDependency,\n nuGetTestFeed: opt.nuGetTestFeed !== undefined ? true : false,\n nuGetTestVersion: opt.nuGetTestVersion !== undefined ? true : false,\n useWinUI3: opt.useWinUI3,\n useHermes: opt.useHermes,\n verbose: opt.verbose,\n };\n}\n\n/**\n * Simple utility for running the Windows generator.\n *\n * @param projectDir root project directory (i.e. contains index.js)\n * @param name name of the root JS module for this app\n * @param ns namespace for the project\n * @param options command line options container\n */\nexport async function generateWindows(\n projectDir: string,\n name: string,\n ns: string,\n options: GenerateOptions,\n) {\n let error;\n try {\n if (!fs.existsSync(projectDir)) {\n fs.mkdirSync(projectDir);\n }\n\n await installScriptsAndDependencies(options);\n\n const rnwPackage = path.dirname(\n require.resolve('react-native-windows/package.json', {\n paths: [projectDir],\n }),\n );\n const templateRoot = path.join(rnwPackage, 'template');\n await copyProjectTemplateAndReplace(\n templateRoot,\n projectDir,\n name,\n ns,\n options,\n );\n } catch (e) {\n error = e;\n Telemetry.trackException(error as Error);\n throw e;\n } finally {\n if (Telemetry.client) {\n let rnVersion = '';\n let cliVersion = '';\n try {\n const cwd = process.cwd();\n const rnwPkg = JSON.parse(\n fs\n .readFileSync(\n require.resolve('react-native-windows/package.json', {\n paths: [cwd],\n }),\n )\n .toString(),\n );\n rnVersion = rnwPkg.peerDependencies['react-native'] || '';\n const rnwCliPkgJson = require('../package.json');\n cliVersion = rnwCliPkgJson.version;\n } catch {}\n const optScrubbed = scrubOptions(options);\n Telemetry.client.trackEvent({\n name: 'generate-windows',\n properties: {\n error: error,\n ...optScrubbed,\n 'react-native': rnVersion,\n 'cli-version': cliVersion,\n },\n });\n\n Telemetry.client.flush();\n }\n }\n}\n\n// Assert the interface here doesn't change for the reasons above\nconst assertStableInterface: typeof generateWindows extends (\n projectDir: string,\n name: string,\n ns: string,\n options: GenerateOptions,\n) => Promise<void>\n ? true\n : never = true;\nassertStableInterface;\n\nexport const commands = [autoLinkCommand, runWindowsCommand];\nexport const dependencyConfig = dependencyConfigWindows;\nexport const projectConfig = projectConfigWindows;\nexport * from './healthChecks';\n"]}
|
|
@@ -19,7 +19,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
19
19
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
20
|
if (mod && mod.__esModule) return mod;
|
|
21
21
|
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
23
|
__setModuleDefault(result, mod);
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
@@ -42,7 +42,7 @@ const runWindowsOptions_1 = require("./runWindowsOptions");
|
|
|
42
42
|
const autolink_1 = require("./utils/autolink");
|
|
43
43
|
const os_1 = require("os");
|
|
44
44
|
function setExitProcessWithError(error, loggingWasEnabled) {
|
|
45
|
-
if (
|
|
45
|
+
if (loggingWasEnabled !== true) {
|
|
46
46
|
console.log(`Re-run the command with ${chalk_1.default.bold('--logging')} for more information`);
|
|
47
47
|
if (telemetry_1.Telemetry.client) {
|
|
48
48
|
console.log(`Your session id was ${telemetry_1.Telemetry.client.commonProperties.sessionId}`);
|
|
@@ -66,7 +66,7 @@ function getPkgVersion(pkgName) {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
catch (_a) { }
|
|
69
|
-
commandWithProgress_1.newWarn(`Could not determine ${pkgName} version`);
|
|
69
|
+
(0, commandWithProgress_1.newWarn)(`Could not determine ${pkgName} version`);
|
|
70
70
|
return '';
|
|
71
71
|
}
|
|
72
72
|
let runWindowsPhase = 'None';
|
|
@@ -106,9 +106,10 @@ async function runWindows(args, config, options) {
|
|
|
106
106
|
sdks.forEach(version => console.log(' ' + version));
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
catch (
|
|
109
|
+
catch (err) {
|
|
110
|
+
const e = err;
|
|
110
111
|
telemetry_1.Telemetry.trackException(e);
|
|
111
|
-
commandWithProgress_1.newError('Unable to print environment info.\n' + e.toString());
|
|
112
|
+
(0, commandWithProgress_1.newError)('Unable to print environment info.\n' + e.toString());
|
|
112
113
|
return setExitProcessWithError(e, options.logging);
|
|
113
114
|
}
|
|
114
115
|
}
|
|
@@ -124,7 +125,7 @@ async function runWindows(args, config, options) {
|
|
|
124
125
|
paths: [process.cwd(), __dirname],
|
|
125
126
|
});
|
|
126
127
|
const rnwDependenciesPath = path_1.default.join(path_1.default.dirname(rnwPkgJsonPath), 'scripts/rnw-dependencies.ps1');
|
|
127
|
-
commandWithProgress_1.newError(`It is possible your installation is missing required software dependencies. Dependencies can be automatically installed by running ${rnwDependenciesPath} from an elevated PowerShell prompt.\nFor more information, go to http://aka.ms/rnw-deps`);
|
|
128
|
+
(0, commandWithProgress_1.newError)(`It is possible your installation is missing required software dependencies. Dependencies can be automatically installed by running ${rnwDependenciesPath} from an elevated PowerShell prompt.\nFor more information, go to http://aka.ms/rnw-deps`);
|
|
128
129
|
}
|
|
129
130
|
return setExitProcessWithError(e, options.logging);
|
|
130
131
|
}
|
|
@@ -156,13 +157,13 @@ async function runWindows(args, config, options) {
|
|
|
156
157
|
'react-native-windows': getPkgVersion('react-native-windows'),
|
|
157
158
|
'react-native': getPkgVersion('react-native'),
|
|
158
159
|
'cli-version': getPkgVersion('@react-native-windows/cli'),
|
|
159
|
-
msftInternal: telemetry_1.isMSFTInternal(),
|
|
160
|
+
msftInternal: (0, telemetry_1.isMSFTInternal)(),
|
|
160
161
|
durationInSecs: process.uptime(),
|
|
161
162
|
success: runWindowsError === undefined,
|
|
162
163
|
phase: runWindowsPhase,
|
|
163
|
-
totalMem: os_1.totalmem(),
|
|
164
|
-
diskFree: telemetry_1.getDiskFreeSpace(__dirname),
|
|
165
|
-
cpus: os_1.cpus().length,
|
|
164
|
+
totalMem: (0, os_1.totalmem)(),
|
|
165
|
+
diskFree: (0, telemetry_1.getDiskFreeSpace)(__dirname),
|
|
166
|
+
cpus: (0, os_1.cpus)().length,
|
|
166
167
|
project: await getAnonymizedProjectName(config.root),
|
|
167
168
|
hasRunRnwDependencies: hasRunRnwDependencies,
|
|
168
169
|
},
|
|
@@ -189,9 +190,9 @@ async function getAnonymizedProjectName(projectRoot) {
|
|
|
189
190
|
}
|
|
190
191
|
exports.getAnonymizedProjectName = getAnonymizedProjectName;
|
|
191
192
|
async function runWindowsInternal(args, config, options) {
|
|
192
|
-
const verbose = options.logging;
|
|
193
|
+
const verbose = options.logging === true;
|
|
193
194
|
if (verbose) {
|
|
194
|
-
commandWithProgress_1.newInfo('Verbose: ON');
|
|
195
|
+
(0, commandWithProgress_1.newInfo)('Verbose: ON');
|
|
195
196
|
}
|
|
196
197
|
// Get the solution file
|
|
197
198
|
let slnFile;
|
|
@@ -199,7 +200,7 @@ async function runWindowsInternal(args, config, options) {
|
|
|
199
200
|
slnFile = build.getAppSolutionFile(options, config);
|
|
200
201
|
}
|
|
201
202
|
catch (e) {
|
|
202
|
-
commandWithProgress_1.newError(`Couldn't get app solution information. ${e.message}`);
|
|
203
|
+
(0, commandWithProgress_1.newError)(`Couldn't get app solution information. ${e.message}`);
|
|
203
204
|
throw e;
|
|
204
205
|
}
|
|
205
206
|
try {
|
|
@@ -215,11 +216,11 @@ async function runWindowsInternal(args, config, options) {
|
|
|
215
216
|
await autolink_1.autoLinkCommand.func(autolinkArgs, autolinkConfig, autoLinkOptions);
|
|
216
217
|
}
|
|
217
218
|
else {
|
|
218
|
-
commandWithProgress_1.newInfo('Autolink step is skipped');
|
|
219
|
+
(0, commandWithProgress_1.newInfo)('Autolink step is skipped');
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
222
|
catch (e) {
|
|
222
|
-
commandWithProgress_1.newError(`Autolinking failed. ${e.message}`);
|
|
223
|
+
(0, commandWithProgress_1.newError)(`Autolinking failed. ${e.message}`);
|
|
223
224
|
throw e;
|
|
224
225
|
}
|
|
225
226
|
let buildTools;
|
|
@@ -228,21 +229,21 @@ async function runWindowsInternal(args, config, options) {
|
|
|
228
229
|
buildTools = msbuildtools_1.default.findAvailableVersion(options.arch, verbose);
|
|
229
230
|
}
|
|
230
231
|
catch (error) {
|
|
231
|
-
commandWithProgress_1.newWarn('No public VS release found');
|
|
232
|
+
(0, commandWithProgress_1.newWarn)('No public VS release found');
|
|
232
233
|
// Try prerelease
|
|
233
234
|
try {
|
|
234
|
-
commandWithProgress_1.newInfo('Trying pre-release VS');
|
|
235
|
+
(0, commandWithProgress_1.newInfo)('Trying pre-release VS');
|
|
235
236
|
buildTools = msbuildtools_1.default.findAvailableVersion(options.arch, verbose, true);
|
|
236
237
|
}
|
|
237
238
|
catch (e) {
|
|
238
|
-
commandWithProgress_1.newError(e.message);
|
|
239
|
+
(0, commandWithProgress_1.newError)(e.message);
|
|
239
240
|
throw error;
|
|
240
241
|
}
|
|
241
242
|
}
|
|
242
243
|
if (options.build) {
|
|
243
244
|
runWindowsPhase = 'FindSolution';
|
|
244
245
|
if (!slnFile) {
|
|
245
|
-
commandWithProgress_1.newError('Visual Studio Solution file not found. Maybe run "npx react-native-windows-init" first?');
|
|
246
|
+
(0, commandWithProgress_1.newError)('Visual Studio Solution file not found. Maybe run "npx react-native-windows-init" first?');
|
|
246
247
|
throw new telemetry_1.CodedError('NoSolution', 'Cannot find solution file');
|
|
247
248
|
}
|
|
248
249
|
// Get build/deploy options
|
|
@@ -255,7 +256,7 @@ async function runWindowsInternal(args, config, options) {
|
|
|
255
256
|
await build.buildSolution(buildTools, slnFile, buildType, options.arch, msBuildProps, verbose, 'build', options.buildLogDirectory, options.singleproc);
|
|
256
257
|
}
|
|
257
258
|
catch (e) {
|
|
258
|
-
commandWithProgress_1.newError(`Build failed with message ${e.message}. Check your build configuration.`);
|
|
259
|
+
(0, commandWithProgress_1.newError)(`Build failed with message ${e.message}. Check your build configuration.`);
|
|
259
260
|
if (e.logfile) {
|
|
260
261
|
console.log('See', chalk_1.default.bold(e.logfile));
|
|
261
262
|
}
|
|
@@ -263,7 +264,7 @@ async function runWindowsInternal(args, config, options) {
|
|
|
263
264
|
}
|
|
264
265
|
}
|
|
265
266
|
else {
|
|
266
|
-
commandWithProgress_1.newInfo('Build step is skipped');
|
|
267
|
+
(0, commandWithProgress_1.newInfo)('Build step is skipped');
|
|
267
268
|
}
|
|
268
269
|
if (shouldLaunchPackager(options)) {
|
|
269
270
|
await deploy.startServerInNewWindow(options, verbose);
|
|
@@ -271,29 +272,31 @@ async function runWindowsInternal(args, config, options) {
|
|
|
271
272
|
if (options.deploy) {
|
|
272
273
|
runWindowsPhase = 'FindSolution';
|
|
273
274
|
if (!slnFile) {
|
|
274
|
-
commandWithProgress_1.newError('Visual Studio Solution file not found. Maybe run "npx react-native-windows-init" first?');
|
|
275
|
+
(0, commandWithProgress_1.newError)('Visual Studio Solution file not found. Maybe run "npx react-native-windows-init" first?');
|
|
275
276
|
throw new telemetry_1.CodedError('NoSolution', 'Cannot find solution file');
|
|
276
277
|
}
|
|
277
278
|
try {
|
|
278
279
|
runWindowsPhase = 'Deploy';
|
|
279
280
|
if (options.device || options.emulator || options.target) {
|
|
280
|
-
await deploy.deployToDevice(options, verbose);
|
|
281
|
+
await deploy.deployToDevice(options, verbose, config);
|
|
281
282
|
}
|
|
282
283
|
else {
|
|
283
284
|
await deploy.deployToDesktop(options, verbose, config, buildTools);
|
|
284
285
|
}
|
|
285
286
|
}
|
|
286
287
|
catch (e) {
|
|
287
|
-
commandWithProgress_1.newError(`Failed to deploy${e ? `: ${e.message}` : ''}`);
|
|
288
|
+
(0, commandWithProgress_1.newError)(`Failed to deploy${e ? `: ${e.message}` : ''}`);
|
|
288
289
|
throw e;
|
|
289
290
|
}
|
|
290
291
|
}
|
|
291
292
|
else {
|
|
292
|
-
commandWithProgress_1.newInfo('Deploy step is skipped');
|
|
293
|
+
(0, commandWithProgress_1.newInfo)('Deploy step is skipped');
|
|
293
294
|
}
|
|
294
295
|
}
|
|
295
296
|
function shouldLaunchPackager(options) {
|
|
296
|
-
return options.packager
|
|
297
|
+
return (options.packager === true &&
|
|
298
|
+
options.launch === true &&
|
|
299
|
+
options.release !== true);
|
|
297
300
|
}
|
|
298
301
|
/*
|
|
299
302
|
// Example of running the Windows Command
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runWindows.js","sourceRoot":"","sources":["../../src/runWindows/runWindows.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oDAA4B;AAC5B,4CAAoB;AACpB,gDAAwB;AACxB,+DAOyC;AAEzC,qDAAuC;AACvC,kDAA0B;AAC1B,uDAAyC;AACzC,qEAAuE;AACvE,mDAAqC;AACrC,wEAAgD;AAGhD,2DAAyE;AAEzE,+CAAiD;AACjD,2BAAkC;AAElC,SAAS,uBAAuB,CAC9B,KAAY,EACZ,iBAA0B;IAE1B,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,CAAC,GAAG,CACT,2BAA2B,eAAK,CAAC,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAC1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,aAAa;IACnB,WAAW,EACT,kFAAkF;IACpF,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,qCAAiB;CAC3B,CAAC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport crypto from 'crypto';\nimport fs from 'fs';\nimport path from 'path';\nimport {\n Telemetry,\n isMSFTInternal,\n getDiskFreeSpace,\n CodedError,\n CodedErrorType,\n CodedErrors,\n} from '@react-native-windows/telemetry';\n\nimport * as build from './utils/build';\nimport chalk from 'chalk';\nimport * as deploy from './utils/deploy';\nimport {newError, newInfo, newWarn} from './utils/commandWithProgress';\nimport * as info from './utils/info';\nimport MSBuildTools from './utils/msbuildtools';\n\nimport {Command, Config} from '@react-native-community/cli-types';\nimport {runWindowsOptions, RunWindowsOptions} from './runWindowsOptions';\n\nimport {autoLinkCommand} from './utils/autolink';\nimport {totalmem, cpus} from 'os';\n\nfunction setExitProcessWithError(\n error: Error,\n loggingWasEnabled: boolean,\n): void {\n if (!loggingWasEnabled) {\n console.log(\n `Re-run the command with ${chalk.bold('--logging')} for more information`,\n );\n if (Telemetry.client) {\n console.log(\n `Your session id was ${Telemetry.client.commonProperties.sessionId}`,\n );\n }\n }\n if (error instanceof CodedError) {\n process.exitCode = CodedErrors[error.name as CodedErrorType];\n } else {\n process.exitCode = 1;\n }\n}\n\nfunction getPkgVersion(pkgName: string): string {\n try {\n const pkgJsonPath = require.resolve(`${pkgName}/package.json`, {\n paths: [process.cwd(), __dirname],\n });\n const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath).toString());\n if (pkgJson.name === pkgName && pkgJson.version !== undefined) {\n return pkgJson.version;\n }\n } catch {}\n newWarn(`Could not determine ${pkgName} version`);\n return '';\n}\n\n/**\n * Labels used by telemtry to represent current operation\n */\ntype RunWindowsPhase =\n | 'None'\n | 'AutoLink'\n | 'FindBuildTools'\n | 'FindSolution'\n | 'Deploy';\n\nlet runWindowsPhase: RunWindowsPhase = 'None';\n/**\n * Performs build deploy and launch of RNW apps.\n * @param args Unprocessed args passed from react-native CLI.\n * @param config Config passed from react-native CLI.\n * @param options Options passed from react-native CLI.\n */\nasync function runWindows(\n args: string[],\n config: Config,\n options: RunWindowsOptions,\n) {\n if (!options.telemetry) {\n if (options.logging) {\n console.log('Disabling telemetry');\n }\n Telemetry.disable();\n } else {\n Telemetry.setup();\n }\n\n // https://github.com/yarnpkg/yarn/issues/8334 - Yarn on Windows breaks apps that read from the environment variables\n // Yarn will run node via CreateProcess and pass npm_config_* variables in lowercase without unifying their value\n // with their possibly existing uppercase counterparts. This breaks programs that read from the environment block\n // and write to a case-insensitive dictionary since they expect to encounter each variable only once.\n // The values of the lowercase variables are the one npm actually wants to use, plus they are seeded from the\n // uppercase variable values one if there are no overrides.\n delete process.env.NPM_CONFIG_CACHE;\n delete process.env.NPM_CONFIG_PREFIX;\n\n const hasRunRnwDependencies =\n process.env.LocalAppData &&\n fs.existsSync(path.join(process.env.LocalAppData, 'rnw-dependencies.txt')); // CODESYNC \\vnext\\scripts\\rnw-dependencies.ps1\n\n if (options.info) {\n try {\n const output = await info.getEnvironmentInfo();\n console.log(output.trimEnd());\n console.log(' Installed UWP SDKs:');\n const sdks = MSBuildTools.getAllAvailableUAPVersions();\n sdks.forEach(version => console.log(' ' + version));\n return;\n } catch (e) {\n Telemetry.trackException(e);\n newError('Unable to print environment info.\\n' + e.toString());\n return setExitProcessWithError(e, options.logging);\n }\n }\n\n let runWindowsError;\n try {\n await runWindowsInternal(args, config, options);\n } catch (e) {\n Telemetry.trackException(e);\n runWindowsError = e;\n if (!hasRunRnwDependencies) {\n const rnwPkgJsonPath = require.resolve(\n 'react-native-windows/package.json',\n {\n paths: [process.cwd(), __dirname],\n },\n );\n const rnwDependenciesPath = path.join(\n path.dirname(rnwPkgJsonPath),\n 'scripts/rnw-dependencies.ps1',\n );\n\n newError(\n `It is possible your installation is missing required software dependencies. Dependencies can be automatically installed by running ${rnwDependenciesPath} from an elevated PowerShell prompt.\\nFor more information, go to http://aka.ms/rnw-deps`,\n );\n }\n return setExitProcessWithError(e, options.logging);\n } finally {\n Telemetry.client?.trackEvent({\n name: 'run-windows',\n properties: {\n release: options.release,\n arch: options.arch,\n singleproc: options.singleproc,\n emulator: options.emulator,\n device: options.device,\n target: options.target,\n remoteDebugging: options.remoteDebugging,\n logging: options.logging,\n packager: options.packager,\n bundle: options.bundle,\n launch: options.launch,\n autolink: options.autolink,\n build: options.bundle,\n deploy: options.deploy,\n sln: options.sln !== undefined,\n proj: options.proj !== undefined,\n msBuildProps:\n options.msbuildprops !== undefined\n ? options.msbuildprops!.split(',').length\n : 0,\n info: options.info,\n directDebugging: options.directDebugging,\n 'react-native-windows': getPkgVersion('react-native-windows'),\n 'react-native': getPkgVersion('react-native'),\n 'cli-version': getPkgVersion('@react-native-windows/cli'),\n msftInternal: isMSFTInternal(),\n durationInSecs: process.uptime(),\n success: runWindowsError === undefined,\n phase: runWindowsPhase,\n totalMem: totalmem(),\n diskFree: getDiskFreeSpace(__dirname),\n cpus: cpus().length,\n project: await getAnonymizedProjectName(config.root),\n hasRunRnwDependencies: hasRunRnwDependencies,\n },\n });\n Telemetry.client?.flush();\n }\n}\n\nexport async function getAnonymizedProjectName(\n projectRoot: string,\n): Promise<string | null> {\n const projectJsonPath = path.join(projectRoot, 'package.json');\n if (!fs.existsSync(projectJsonPath)) {\n return null;\n }\n\n const projectJson = JSON.parse(\n (await fs.promises.readFile(projectJsonPath)).toString(),\n );\n\n const projectName = projectJson.name;\n if (typeof projectName !== 'string') {\n return null;\n }\n\n // Ensure the project name cannot be reverse engineered to avoid leaking PII\n return crypto\n .createHash('sha256')\n .update(projectName)\n .digest('hex')\n .toString();\n}\n\nasync function runWindowsInternal(\n args: string[],\n config: Config,\n options: RunWindowsOptions,\n) {\n const verbose = options.logging;\n\n if (verbose) {\n newInfo('Verbose: ON');\n }\n\n // Get the solution file\n let slnFile;\n try {\n slnFile = build.getAppSolutionFile(options, config);\n } catch (e) {\n newError(`Couldn't get app solution information. ${e.message}`);\n throw e;\n }\n\n try {\n if (options.autolink) {\n const autolinkArgs: string[] = [];\n const autolinkConfig = config;\n const autoLinkOptions = {\n logging: options.logging,\n proj: options.proj,\n sln: options.sln,\n };\n runWindowsPhase = 'AutoLink';\n await autoLinkCommand.func(autolinkArgs, autolinkConfig, autoLinkOptions);\n } else {\n newInfo('Autolink step is skipped');\n }\n } catch (e) {\n newError(`Autolinking failed. ${e.message}`);\n throw e;\n }\n\n let buildTools: MSBuildTools;\n runWindowsPhase = 'FindBuildTools';\n try {\n buildTools = MSBuildTools.findAvailableVersion(options.arch, verbose);\n } catch (error) {\n newWarn('No public VS release found');\n // Try prerelease\n try {\n newInfo('Trying pre-release VS');\n buildTools = MSBuildTools.findAvailableVersion(\n options.arch,\n verbose,\n true, // preRelease\n );\n } catch (e) {\n newError(e.message);\n throw error;\n }\n }\n\n if (options.build) {\n runWindowsPhase = 'FindSolution';\n if (!slnFile) {\n newError(\n 'Visual Studio Solution file not found. Maybe run \"npx react-native-windows-init\" first?',\n );\n throw new CodedError('NoSolution', 'Cannot find solution file');\n }\n\n // Get build/deploy options\n const buildType = deploy.getBuildConfiguration(options);\n const msBuildProps = build.parseMsBuildProps(options);\n\n // Disable the autolink check since we just ran it\n msBuildProps.RunAutolinkCheck = 'false';\n\n try {\n runWindowsPhase = 'FindSolution';\n await build.buildSolution(\n buildTools,\n slnFile!,\n buildType,\n options.arch,\n msBuildProps,\n verbose,\n 'build',\n options.buildLogDirectory,\n options.singleproc,\n );\n } catch (e) {\n newError(\n `Build failed with message ${e.message}. Check your build configuration.`,\n );\n if (e.logfile) {\n console.log('See', chalk.bold(e.logfile));\n }\n throw e;\n }\n } else {\n newInfo('Build step is skipped');\n }\n\n if (shouldLaunchPackager(options)) {\n await deploy.startServerInNewWindow(options, verbose);\n }\n\n if (options.deploy) {\n runWindowsPhase = 'FindSolution';\n if (!slnFile) {\n newError(\n 'Visual Studio Solution file not found. Maybe run \"npx react-native-windows-init\" first?',\n );\n throw new CodedError('NoSolution', 'Cannot find solution file');\n }\n\n try {\n runWindowsPhase = 'Deploy';\n if (options.device || options.emulator || options.target) {\n await deploy.deployToDevice(options, verbose);\n } else {\n await deploy.deployToDesktop(options, verbose, config, buildTools);\n }\n } catch (e) {\n newError(`Failed to deploy${e ? `: ${e.message}` : ''}`);\n throw e;\n }\n } else {\n newInfo('Deploy step is skipped');\n }\n}\n\nfunction shouldLaunchPackager(options: RunWindowsOptions): boolean {\n return options.packager && options.launch && options.release !== true;\n}\n\n/*\n// Example of running the Windows Command\nrunWindows({\n root: 'C:\\\\github\\\\hack\\\\myapp',\n debug: true,\n arch: 'x86',\n nugetPath: 'C:\\\\github\\\\react\\\\react-native-windows\\\\local-cli\\\\runWindows\\\\.nuget\\\\nuget.exe'\n});\n*/\n\n/**\n * Starts the app on a connected Windows emulator or mobile device.\n */\nexport const runWindowsCommand: Command = {\n name: 'run-windows',\n description:\n 'builds your app and starts it on a connected Windows desktop, emulator or device',\n func: runWindows,\n options: runWindowsOptions,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"runWindows.js","sourceRoot":"","sources":["../../src/runWindows/runWindows.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oDAA4B;AAC5B,4CAAoB;AACpB,gDAAwB;AACxB,+DAOyC;AAEzC,qDAAuC;AACvC,kDAA0B;AAC1B,uDAAyC;AACzC,qEAAuE;AACvE,mDAAqC;AACrC,wEAAgD;AAGhD,2DAAyE;AAEzE,+CAAiD;AACjD,2BAAkC;AAElC,SAAS,uBAAuB,CAC9B,KAAY,EACZ,iBAA2B;IAE3B,IAAI,iBAAiB,KAAK,IAAI,EAAE;QAC9B,OAAO,CAAC,GAAG,CACT,2BAA2B,eAAK,CAAC,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAC1E,CAAC;QACF,IAAI,qBAAS,CAAC,MAAM,EAAE;YACpB,OAAO,CAAC,GAAG,CACT,uBAAuB,qB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AAI;QACvB,OAAO,CAAC,OAAO,KAAK,IAAI,CACzB,CAAC;AACJ,CAAC;AAED;;;;;;;;EAQE;AAEF;;GAEG;AACU,QAAA,iBAAiB,GAAY;IACxC,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,kFAAkF;IACpF,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,qCAAiB;CAC3B,CAAC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport crypto from 'crypto';\nimport fs from 'fs';\nimport path from 'path';\nimport {\n Telemetry,\n isMSFTInternal,\n getDiskFreeSpace,\n CodedError,\n CodedErrorType,\n CodedErrors,\n} from '@react-native-windows/telemetry';\n\nimport * as build from './utils/build';\nimport chalk from 'chalk';\nimport * as deploy from './utils/deploy';\nimport {newError, newInfo, newWarn} from './utils/commandWithProgress';\nimport * as info from './utils/info';\nimport MSBuildTools from './utils/msbuildtools';\n\nimport {Command, Config} from '@react-native-community/cli-types';\nimport {runWindowsOptions, RunWindowsOptions} from './runWindowsOptions';\n\nimport {autoLinkCommand} from './utils/autolink';\nimport {totalmem, cpus} from 'os';\n\nfunction setExitProcessWithError(\n error: Error,\n loggingWasEnabled?: boolean,\n): void {\n if (loggingWasEnabled !== true) {\n console.log(\n `Re-run the command with ${chalk.bold('--logging')} for more information`,\n );\n if (Telemetry.client) {\n console.log(\n `Your session id was ${Telemetry.client.commonProperties.sessionId}`,\n );\n }\n }\n if (error instanceof CodedError) {\n process.exitCode = CodedErrors[error.name as CodedErrorType];\n } else {\n process.exitCode = 1;\n }\n}\n\nfunction getPkgVersion(pkgName: string): string {\n try {\n const pkgJsonPath = require.resolve(`${pkgName}/package.json`, {\n paths: [process.cwd(), __dirname],\n });\n const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath).toString());\n if (pkgJson.name === pkgName && pkgJson.version !== undefined) {\n return pkgJson.version;\n }\n } catch {}\n newWarn(`Could not determine ${pkgName} version`);\n return '';\n}\n\n/**\n * Labels used by telemtry to represent current operation\n */\ntype RunWindowsPhase =\n | 'None'\n | 'AutoLink'\n | 'FindBuildTools'\n | 'FindSolution'\n | 'Deploy';\n\nlet runWindowsPhase: RunWindowsPhase = 'None';\n/**\n * Performs build deploy and launch of RNW apps.\n * @param args Unprocessed args passed from react-native CLI.\n * @param config Config passed from react-native CLI.\n * @param options Options passed from react-native CLI.\n */\nasync function runWindows(\n args: string[],\n config: Config,\n options: RunWindowsOptions,\n) {\n if (!options.telemetry) {\n if (options.logging) {\n console.log('Disabling telemetry');\n }\n Telemetry.disable();\n } else {\n Telemetry.setup();\n }\n\n // https://github.com/yarnpkg/yarn/issues/8334 - Yarn on Windows breaks apps that read from the environment variables\n // Yarn will run node via CreateProcess and pass npm_config_* variables in lowercase without unifying their value\n // with their possibly existing uppercase counterparts. This breaks programs that read from the environment block\n // and write to a case-insensitive dictionary since they expect to encounter each variable only once.\n // The values of the lowercase variables are the one npm actually wants to use, plus they are seeded from the\n // uppercase variable values one if there are no overrides.\n delete process.env.NPM_CONFIG_CACHE;\n delete process.env.NPM_CONFIG_PREFIX;\n\n const hasRunRnwDependencies =\n process.env.LocalAppData &&\n fs.existsSync(path.join(process.env.LocalAppData, 'rnw-dependencies.txt')); // CODESYNC \\vnext\\scripts\\rnw-dependencies.ps1\n\n if (options.info) {\n try {\n const output = await info.getEnvironmentInfo();\n console.log(output.trimEnd());\n console.log(' Installed UWP SDKs:');\n const sdks = MSBuildTools.getAllAvailableUAPVersions();\n sdks.forEach(version => console.log(' ' + version));\n return;\n } catch (err) {\n const e = err as Error;\n Telemetry.trackException(e);\n newError('Unable to print environment info.\\n' + e.toString());\n return setExitProcessWithError(e, options.logging);\n }\n }\n\n let runWindowsError;\n try {\n await runWindowsInternal(args, config, options);\n } catch (e) {\n Telemetry.trackException(e as Error);\n runWindowsError = e;\n if (!hasRunRnwDependencies) {\n const rnwPkgJsonPath = require.resolve(\n 'react-native-windows/package.json',\n {\n paths: [process.cwd(), __dirname],\n },\n );\n const rnwDependenciesPath = path.join(\n path.dirname(rnwPkgJsonPath),\n 'scripts/rnw-dependencies.ps1',\n );\n\n newError(\n `It is possible your installation is missing required software dependencies. Dependencies can be automatically installed by running ${rnwDependenciesPath} from an elevated PowerShell prompt.\\nFor more information, go to http://aka.ms/rnw-deps`,\n );\n }\n return setExitProcessWithError(e as Error, options.logging);\n } finally {\n Telemetry.client?.trackEvent({\n name: 'run-windows',\n properties: {\n release: options.release,\n arch: options.arch,\n singleproc: options.singleproc,\n emulator: options.emulator,\n device: options.device,\n target: options.target,\n remoteDebugging: options.remoteDebugging,\n logging: options.logging,\n packager: options.packager,\n bundle: options.bundle,\n launch: options.launch,\n autolink: options.autolink,\n build: options.bundle,\n deploy: options.deploy,\n sln: options.sln !== undefined,\n proj: options.proj !== undefined,\n msBuildProps:\n options.msbuildprops !== undefined\n ? options.msbuildprops!.split(',').length\n : 0,\n info: options.info,\n directDebugging: options.directDebugging,\n 'react-native-windows': getPkgVersion('react-native-windows'),\n 'react-native': getPkgVersion('react-native'),\n 'cli-version': getPkgVersion('@react-native-windows/cli'),\n msftInternal: isMSFTInternal(),\n durationInSecs: process.uptime(),\n success: runWindowsError === undefined,\n phase: runWindowsPhase,\n totalMem: totalmem(),\n diskFree: getDiskFreeSpace(__dirname),\n cpus: cpus().length,\n project: await getAnonymizedProjectName(config.root),\n hasRunRnwDependencies: hasRunRnwDependencies,\n },\n });\n Telemetry.client?.flush();\n }\n}\n\nexport async function getAnonymizedProjectName(\n projectRoot: string,\n): Promise<string | null> {\n const projectJsonPath = path.join(projectRoot, 'package.json');\n if (!fs.existsSync(projectJsonPath)) {\n return null;\n }\n\n const projectJson = JSON.parse(\n (await fs.promises.readFile(projectJsonPath)).toString(),\n );\n\n const projectName = projectJson.name;\n if (typeof projectName !== 'string') {\n return null;\n }\n\n // Ensure the project name cannot be reverse engineered to avoid leaking PII\n return crypto\n .createHash('sha256')\n .update(projectName)\n .digest('hex')\n .toString();\n}\n\nasync function runWindowsInternal(\n args: string[],\n config: Config,\n options: RunWindowsOptions,\n) {\n const verbose = options.logging === true;\n\n if (verbose) {\n newInfo('Verbose: ON');\n }\n\n // Get the solution file\n let slnFile;\n try {\n slnFile = build.getAppSolutionFile(options, config);\n } catch (e) {\n newError(`Couldn't get app solution information. ${(e as Error).message}`);\n throw e;\n }\n\n try {\n if (options.autolink) {\n const autolinkArgs: string[] = [];\n const autolinkConfig = config;\n const autoLinkOptions = {\n logging: options.logging,\n proj: options.proj,\n sln: options.sln,\n };\n runWindowsPhase = 'AutoLink';\n await autoLinkCommand.func(autolinkArgs, autolinkConfig, autoLinkOptions);\n } else {\n newInfo('Autolink step is skipped');\n }\n } catch (e) {\n newError(`Autolinking failed. ${(e as Error).message}`);\n throw e;\n }\n\n let buildTools: MSBuildTools;\n runWindowsPhase = 'FindBuildTools';\n try {\n buildTools = MSBuildTools.findAvailableVersion(options.arch, verbose);\n } catch (error) {\n newWarn('No public VS release found');\n // Try prerelease\n try {\n newInfo('Trying pre-release VS');\n buildTools = MSBuildTools.findAvailableVersion(\n options.arch,\n verbose,\n true, // preRelease\n );\n } catch (e) {\n newError((e as Error).message);\n throw error;\n }\n }\n\n if (options.build) {\n runWindowsPhase = 'FindSolution';\n if (!slnFile) {\n newError(\n 'Visual Studio Solution file not found. Maybe run \"npx react-native-windows-init\" first?',\n );\n throw new CodedError('NoSolution', 'Cannot find solution file');\n }\n\n // Get build/deploy options\n const buildType = deploy.getBuildConfiguration(options);\n const msBuildProps = build.parseMsBuildProps(options);\n\n // Disable the autolink check since we just ran it\n msBuildProps.RunAutolinkCheck = 'false';\n\n try {\n runWindowsPhase = 'FindSolution';\n await build.buildSolution(\n buildTools,\n slnFile!,\n buildType,\n options.arch,\n msBuildProps,\n verbose,\n 'build',\n options.buildLogDirectory,\n options.singleproc,\n );\n } catch (e) {\n newError(\n `Build failed with message ${\n (e as Error).message\n }. Check your build configuration.`,\n );\n if ((e as any).logfile) {\n console.log('See', chalk.bold((e as any).logfile));\n }\n throw e;\n }\n } else {\n newInfo('Build step is skipped');\n }\n\n if (shouldLaunchPackager(options)) {\n await deploy.startServerInNewWindow(options, verbose);\n }\n\n if (options.deploy) {\n runWindowsPhase = 'FindSolution';\n if (!slnFile) {\n newError(\n 'Visual Studio Solution file not found. Maybe run \"npx react-native-windows-init\" first?',\n );\n throw new CodedError('NoSolution', 'Cannot find solution file');\n }\n\n try {\n runWindowsPhase = 'Deploy';\n if (options.device || options.emulator || options.target) {\n await deploy.deployToDevice(options, verbose, config);\n } else {\n await deploy.deployToDesktop(options, verbose, config, buildTools);\n }\n } catch (e) {\n newError(`Failed to deploy${e ? `: ${(e as Error).message}` : ''}`);\n throw e;\n }\n } else {\n newInfo('Deploy step is skipped');\n }\n}\n\nfunction shouldLaunchPackager(options: RunWindowsOptions): boolean {\n return (\n options.packager === true &&\n options.launch === true &&\n options.release !== true\n );\n}\n\n/*\n// Example of running the Windows Command\nrunWindows({\n root: 'C:\\\\github\\\\hack\\\\myapp',\n debug: true,\n arch: 'x86',\n nugetPath: 'C:\\\\github\\\\react\\\\react-native-windows\\\\local-cli\\\\runWindows\\\\.nuget\\\\nuget.exe'\n});\n*/\n\n/**\n * Starts the app on a connected Windows emulator or mobile device.\n */\nexport const runWindowsCommand: Command = {\n name: 'run-windows',\n description:\n 'builds your app and starts it on a connected Windows desktop, emulator or device',\n func: runWindows,\n options: runWindowsOptions,\n};\n"]}
|
|
@@ -37,19 +37,19 @@ export interface RunWindowsOptions {
|
|
|
37
37
|
device?: boolean;
|
|
38
38
|
target?: string;
|
|
39
39
|
remoteDebugging?: string;
|
|
40
|
-
logging
|
|
41
|
-
packager
|
|
42
|
-
bundle
|
|
43
|
-
launch
|
|
44
|
-
autolink
|
|
45
|
-
build
|
|
46
|
-
deploy
|
|
40
|
+
logging?: boolean;
|
|
41
|
+
packager?: boolean;
|
|
42
|
+
bundle?: boolean;
|
|
43
|
+
launch?: boolean;
|
|
44
|
+
autolink?: boolean;
|
|
45
|
+
build?: boolean;
|
|
46
|
+
deploy?: boolean;
|
|
47
47
|
deployFromLayout?: boolean;
|
|
48
48
|
sln?: string;
|
|
49
49
|
proj?: string;
|
|
50
50
|
msbuildprops?: string;
|
|
51
51
|
buildLogDirectory?: string;
|
|
52
|
-
info
|
|
52
|
+
info?: boolean;
|
|
53
53
|
directDebugging?: number;
|
|
54
54
|
telemetry?: boolean;
|
|
55
55
|
}
|