@react-native-windows/cli 0.67.0-preview.1 → 0.68.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/README.md +1 -1
- package/lib-commonjs/config/configUtils.js +1 -1
- package/lib-commonjs/config/configUtils.js.map +1 -1
- package/lib-commonjs/config/dependencyConfig.js +4 -2
- package/lib-commonjs/config/dependencyConfig.js.map +1 -1
- package/lib-commonjs/e2etest/autolink.test.js +20 -4
- package/lib-commonjs/e2etest/autolink.test.js.map +1 -1
- package/lib-commonjs/e2etest/dependencyConfig.test.js +2 -2
- package/lib-commonjs/e2etest/dependencyConfig.test.js.map +1 -1
- package/lib-commonjs/e2etest/projectConfig.test.js +2 -4
- package/lib-commonjs/e2etest/projectConfig.test.js.map +1 -1
- package/lib-commonjs/e2etest/projectConfig.utils.js +3 -10
- package/lib-commonjs/e2etest/projectConfig.utils.js.map +1 -1
- package/lib-commonjs/e2etest/runWindows.test.js +35 -14
- package/lib-commonjs/e2etest/runWindows.test.js.map +1 -1
- package/lib-commonjs/generator-common/index.js +7 -7
- package/lib-commonjs/generator-common/index.js.map +1 -1
- package/lib-commonjs/generator-windows/index.js +11 -26
- package/lib-commonjs/generator-windows/index.js.map +1 -1
- package/lib-commonjs/index.js +9 -60
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/runWindows/runWindows.d.ts +0 -1
- package/lib-commonjs/runWindows/runWindows.js +107 -131
- package/lib-commonjs/runWindows/runWindows.js.map +1 -1
- package/lib-commonjs/runWindows/runWindowsOptions.js +6 -2
- package/lib-commonjs/runWindows/runWindowsOptions.js.map +1 -1
- package/lib-commonjs/runWindows/utils/autolink.d.ts +9 -1
- package/lib-commonjs/runWindows/utils/autolink.js +81 -28
- package/lib-commonjs/runWindows/utils/autolink.js.map +1 -1
- package/lib-commonjs/runWindows/utils/build.js +1 -1
- 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 +6 -0
- package/lib-commonjs/runWindows/utils/commandWithProgress.js +26 -5
- package/lib-commonjs/runWindows/utils/commandWithProgress.js.map +1 -1
- package/lib-commonjs/runWindows/utils/deploy.js +9 -9
- package/lib-commonjs/runWindows/utils/deploy.js.map +1 -1
- package/lib-commonjs/runWindows/utils/msbuildtools.d.ts +1 -0
- package/lib-commonjs/runWindows/utils/msbuildtools.js +19 -12
- package/lib-commonjs/runWindows/utils/msbuildtools.js.map +1 -1
- package/lib-commonjs/runWindows/utils/telemetryHelpers.d.ts +29 -0
- package/lib-commonjs/runWindows/utils/telemetryHelpers.js +109 -0
- package/lib-commonjs/runWindows/utils/telemetryHelpers.js.map +1 -0
- package/lib-commonjs/runWindows/utils/version.js +1 -1
- package/lib-commonjs/runWindows/utils/version.js.map +1 -1
- package/lib-commonjs/runWindows/utils/vsInstalls.js +2 -2
- package/lib-commonjs/runWindows/utils/vsInstalls.js.map +1 -1
- package/lib-commonjs/runWindows/utils/vstools.js +4 -4
- package/lib-commonjs/runWindows/utils/vstools.js.map +1 -1
- package/lib-commonjs/runWindows/utils/winappdeploytool.js +3 -3
- package/lib-commonjs/runWindows/utils/winappdeploytool.js.map +1 -1
- package/package.json +10 -9
- package/CHANGELOG.json +0 -1761
- package/CHANGELOG.md +0 -781
|
@@ -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,oDAA4B;AAC5B,oDAAuB;AACvB,sDAA6B;AAC7B,uDAAyE;AAEzE,0DAI6B;AAE7B,+DAA2D;AAC3D,uEAG6C;AAE7C,MAAM,UAAU,GAAG,SAAS,CA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\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"]}
|
|
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,kEAA0C;AAC1C,oDAA4B;AAC5B,oDAAuB;AACvB,sDAA6B;AAC7B,uDAAyE;AAEzE,0DAI6B;AAE7B,+DAGyC;AACzC,uEAG6C;AAE7C,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,SAAS,GAAG,QAAQ,CAAC;AAU3B,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,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,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 '@react-native-windows/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 {\n CodedError,\n getVersionOfNpmPackage,\n} 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\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.split(/[.:]+/).map(pascalCase).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 const appJson = await fs.readJsonFile<{name: string}>(appJsonPath);\n mainComponentName = appJson.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: NugetPackage[] = [\n {\n id: 'Microsoft.Windows.CppWinRT',\n version: '2.0.211028.7',\n },\n {\n id: 'ReactNative.Hermes.Windows',\n version: hermesVersion,\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 });\n\n cppNugetPackages.push({\n id: 'Microsoft.ReactNative.Cxx',\n version: nugetVersion,\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 },\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 rnwVersion: await getVersionOfNpmPackage('react-native-windows'),\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 nuGetADOFeed: nugetVersion.startsWith('0.0.0-'),\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 csMappings.push({\n from: path.join(srcPath, projDir, 'Directory.Build.props'),\n to: path.join(windowsDir, 'Directory.Build.props'),\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 : [\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\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"]}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -19,27 +19,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.projectConfig = exports.dependencyConfig = exports.commands = exports.generateWindows = void 0;
|
|
22
|
-
const fs_1 = __importDefault(require("fs"));
|
|
22
|
+
const fs_1 = __importDefault(require("@react-native-windows/fs"));
|
|
23
23
|
const path_1 = __importDefault(require("path"));
|
|
24
|
-
const telemetry_1 = require("@react-native-windows/telemetry");
|
|
25
24
|
const generator_windows_1 = require("./generator-windows");
|
|
26
25
|
const autolink_1 = require("./runWindows/utils/autolink");
|
|
27
26
|
const runWindows_1 = require("./runWindows/runWindows");
|
|
28
27
|
const dependencyConfig_1 = require("./config/dependencyConfig");
|
|
29
28
|
const projectConfig_1 = require("./config/projectConfig");
|
|
30
|
-
function scrubOptions(opt) {
|
|
31
|
-
return {
|
|
32
|
-
overwrite: opt.overwrite,
|
|
33
|
-
language: opt.language,
|
|
34
|
-
projectType: opt.projectType,
|
|
35
|
-
experimentalNuGetDependency: opt.experimentalNuGetDependency,
|
|
36
|
-
nuGetTestFeed: opt.nuGetTestFeed !== undefined ? true : false,
|
|
37
|
-
nuGetTestVersion: opt.nuGetTestVersion !== undefined ? true : false,
|
|
38
|
-
useWinUI3: opt.useWinUI3,
|
|
39
|
-
useHermes: opt.useHermes,
|
|
40
|
-
verbose: opt.verbose,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
29
|
/**
|
|
44
30
|
* Simple utility for running the Windows generator.
|
|
45
31
|
*
|
|
@@ -49,52 +35,15 @@ function scrubOptions(opt) {
|
|
|
49
35
|
* @param options command line options container
|
|
50
36
|
*/
|
|
51
37
|
async function generateWindows(projectDir, name, ns, options) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (!fs_1.default.existsSync(projectDir)) {
|
|
55
|
-
fs_1.default.mkdirSync(projectDir);
|
|
56
|
-
}
|
|
57
|
-
await (0, generator_windows_1.installScriptsAndDependencies)(options);
|
|
58
|
-
const rnwPackage = path_1.default.dirname(require.resolve('react-native-windows/package.json', {
|
|
59
|
-
paths: [projectDir],
|
|
60
|
-
}));
|
|
61
|
-
const templateRoot = path_1.default.join(rnwPackage, 'template');
|
|
62
|
-
await (0, generator_windows_1.copyProjectTemplateAndReplace)(templateRoot, projectDir, name, ns, options);
|
|
63
|
-
}
|
|
64
|
-
catch (e) {
|
|
65
|
-
error = e;
|
|
66
|
-
telemetry_1.Telemetry.trackException(error);
|
|
67
|
-
throw e;
|
|
68
|
-
}
|
|
69
|
-
finally {
|
|
70
|
-
if (telemetry_1.Telemetry.client) {
|
|
71
|
-
let rnVersion = '';
|
|
72
|
-
let cliVersion = '';
|
|
73
|
-
try {
|
|
74
|
-
const cwd = process.cwd();
|
|
75
|
-
const rnwPkg = JSON.parse(fs_1.default
|
|
76
|
-
.readFileSync(require.resolve('react-native-windows/package.json', {
|
|
77
|
-
paths: [cwd],
|
|
78
|
-
}))
|
|
79
|
-
.toString());
|
|
80
|
-
rnVersion = rnwPkg.peerDependencies['react-native'] || '';
|
|
81
|
-
const rnwCliPkgJson = require('../package.json');
|
|
82
|
-
cliVersion = rnwCliPkgJson.version;
|
|
83
|
-
}
|
|
84
|
-
catch (_a) { }
|
|
85
|
-
const optScrubbed = scrubOptions(options);
|
|
86
|
-
telemetry_1.Telemetry.client.trackEvent({
|
|
87
|
-
name: 'generate-windows',
|
|
88
|
-
properties: {
|
|
89
|
-
error: error,
|
|
90
|
-
...optScrubbed,
|
|
91
|
-
'react-native': rnVersion,
|
|
92
|
-
'cli-version': cliVersion,
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
telemetry_1.Telemetry.client.flush();
|
|
96
|
-
}
|
|
38
|
+
if (!fs_1.default.existsSync(projectDir)) {
|
|
39
|
+
fs_1.default.mkdirSync(projectDir);
|
|
97
40
|
}
|
|
41
|
+
await (0, generator_windows_1.installScriptsAndDependencies)(options);
|
|
42
|
+
const rnwPackage = path_1.default.dirname(require.resolve('react-native-windows/package.json', {
|
|
43
|
+
paths: [projectDir],
|
|
44
|
+
}));
|
|
45
|
+
const templateRoot = path_1.default.join(rnwPackage, 'template');
|
|
46
|
+
await (0, generator_windows_1.copyProjectTemplateAndReplace)(templateRoot, projectDir, name, ns, options);
|
|
98
47
|
}
|
|
99
48
|
exports.generateWindows = generateWindows;
|
|
100
49
|
// Assert the interface here doesn't change for the reasons above
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,kEAA0C;AAC1C,gDAAwB;AAExB,2DAG6B;AAE7B,0DAA4D;AAC5D,wDAA0D;AAC1D,gEAAkE;AAClE,0DAA4D;AAiC5D;;;;;;;GAOG;AACI,KAAK,UAAU,eAAe,CACnC,UAAkB,EAClB,IAAY,EACZ,EAAU,EACV,OAAwB;IAExB,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;QAC9B,YAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;KAC1B;IAED,MAAM,IAAA,iDAA6B,EAAC,OAAO,CAAC,CAAC;IAE7C,MAAM,UAAU,GAAG,cAAI,CAAC,OAAO,CAC7B,OAAO,CAAC,OAAO,CAAC,mCAAmC,EAAE;QACnD,KAAK,EAAE,CAAC,UAAU,CAAC;KACpB,CAAC,CACH,CAAC;IACF,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACvD,MAAM,IAAA,iDAA6B,EACjC,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,EAAE,EACF,OAAO,CACR,CAAC;AACJ,CAAC;AAzBD,0CAyBC;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 '@react-native-windows/fs';\nimport path from 'path';\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\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 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}\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"]}
|
|
@@ -27,66 +27,80 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.runWindowsCommand =
|
|
31
|
-
const
|
|
32
|
-
const fs_1 = __importDefault(require("fs"));
|
|
30
|
+
exports.runWindowsCommand = void 0;
|
|
31
|
+
const fs_1 = __importDefault(require("@react-native-windows/fs"));
|
|
33
32
|
const path_1 = __importDefault(require("path"));
|
|
34
33
|
const telemetry_1 = require("@react-native-windows/telemetry");
|
|
35
34
|
const build = __importStar(require("./utils/build"));
|
|
36
35
|
const chalk_1 = __importDefault(require("chalk"));
|
|
37
36
|
const deploy = __importStar(require("./utils/deploy"));
|
|
38
37
|
const commandWithProgress_1 = require("./utils/commandWithProgress");
|
|
38
|
+
const telemetryHelpers_1 = require("./utils/telemetryHelpers");
|
|
39
39
|
const info = __importStar(require("./utils/info"));
|
|
40
40
|
const msbuildtools_1 = __importDefault(require("./utils/msbuildtools"));
|
|
41
41
|
const runWindowsOptions_1 = require("./runWindowsOptions");
|
|
42
42
|
const autolink_1 = require("./utils/autolink");
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Sanitizes the given option for telemetery.
|
|
45
|
+
* @param key The key of the option.
|
|
46
|
+
* @param value The unsanitized value of the option.
|
|
47
|
+
* @returns The sanitized value of the option.
|
|
48
|
+
*/
|
|
49
|
+
// eslint-disable-next-line complexity
|
|
50
|
+
function optionSanitizer(key, value) {
|
|
51
|
+
// Do not add a default case here.
|
|
52
|
+
// Strings risking PII should just return true if present, false otherwise.
|
|
53
|
+
// All others should return the value (or false if undefined).
|
|
54
|
+
switch (key) {
|
|
55
|
+
case 'root':
|
|
56
|
+
case 'target':
|
|
57
|
+
case 'sln':
|
|
58
|
+
case 'proj':
|
|
59
|
+
case 'buildLogDirectory':
|
|
60
|
+
return value === undefined ? false : true; // Strip PII
|
|
61
|
+
case 'msbuildprops':
|
|
62
|
+
return value === undefined ? 0 : value.split(',').length; // Convert to count
|
|
63
|
+
case 'release':
|
|
64
|
+
case 'arch':
|
|
65
|
+
case 'singleproc':
|
|
66
|
+
case 'emulator':
|
|
67
|
+
case 'device':
|
|
68
|
+
case 'remoteDebugging':
|
|
69
|
+
case 'logging':
|
|
70
|
+
case 'packager':
|
|
71
|
+
case 'bundle':
|
|
72
|
+
case 'launch':
|
|
73
|
+
case 'autolink':
|
|
74
|
+
case 'build':
|
|
75
|
+
case 'deploy':
|
|
76
|
+
case 'deployFromLayout':
|
|
77
|
+
case 'info':
|
|
78
|
+
case 'directDebugging':
|
|
79
|
+
case 'telemetry':
|
|
80
|
+
return value === undefined ? false : value; // Return value
|
|
56
81
|
}
|
|
57
82
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
catch (_a) { }
|
|
69
|
-
(0, commandWithProgress_1.newWarn)(`Could not determine ${pkgName} version`);
|
|
70
|
-
return '';
|
|
83
|
+
/**
|
|
84
|
+
* Get the extra props to add to the `run-windows` telemetry event.
|
|
85
|
+
* @returns The extra props.
|
|
86
|
+
*/
|
|
87
|
+
async function getExtraProps() {
|
|
88
|
+
const extraProps = {
|
|
89
|
+
phase: runWindowsPhase,
|
|
90
|
+
hasRunRnwDependencies,
|
|
91
|
+
};
|
|
92
|
+
return extraProps;
|
|
71
93
|
}
|
|
72
94
|
let runWindowsPhase = 'None';
|
|
95
|
+
let hasRunRnwDependencies = false;
|
|
73
96
|
/**
|
|
74
|
-
*
|
|
97
|
+
* The function run when calling `react-native run-windows`.
|
|
75
98
|
* @param args Unprocessed args passed from react-native CLI.
|
|
76
99
|
* @param config Config passed from react-native CLI.
|
|
77
100
|
* @param options Options passed from react-native CLI.
|
|
78
101
|
*/
|
|
79
102
|
async function runWindows(args, config, options) {
|
|
80
|
-
|
|
81
|
-
if (!options.telemetry) {
|
|
82
|
-
if (options.logging) {
|
|
83
|
-
console.log('Disabling telemetry');
|
|
84
|
-
}
|
|
85
|
-
telemetry_1.Telemetry.disable();
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
telemetry_1.Telemetry.setup();
|
|
89
|
-
}
|
|
103
|
+
await (0, telemetryHelpers_1.startTelemetrySession)('run-windows', config, options, (0, telemetryHelpers_1.getDefaultOptions)(config, runWindowsOptions_1.runWindowsOptions), optionSanitizer);
|
|
90
104
|
// https://github.com/yarnpkg/yarn/issues/8334 - Yarn on Windows breaks apps that read from the environment variables
|
|
91
105
|
// Yarn will run node via CreateProcess and pass npm_config_* variables in lowercase without unifying their value
|
|
92
106
|
// with their possibly existing uppercase counterparts. This breaks programs that read from the environment block
|
|
@@ -95,31 +109,35 @@ async function runWindows(args, config, options) {
|
|
|
95
109
|
// uppercase variable values one if there are no overrides.
|
|
96
110
|
delete process.env.NPM_CONFIG_CACHE;
|
|
97
111
|
delete process.env.NPM_CONFIG_PREFIX;
|
|
98
|
-
|
|
99
|
-
fs_1.default.existsSync(path_1.default.join(process.env.LocalAppData, 'rnw-dependencies.txt')); // CODESYNC \vnext\scripts\rnw-dependencies.ps1
|
|
112
|
+
if (process.env.LocalAppData) {
|
|
113
|
+
hasRunRnwDependencies = fs_1.default.existsSync(path_1.default.join(process.env.LocalAppData, 'rnw-dependencies.txt')); // CODESYNC \vnext\scripts\rnw-dependencies.ps1
|
|
114
|
+
}
|
|
115
|
+
let runWindowsError;
|
|
100
116
|
if (options.info) {
|
|
101
117
|
try {
|
|
102
118
|
const output = await info.getEnvironmentInfo();
|
|
103
119
|
console.log(output.trimEnd());
|
|
104
120
|
console.log(' Installed UWP SDKs:');
|
|
105
121
|
const sdks = msbuildtools_1.default.getAllAvailableUAPVersions();
|
|
106
|
-
sdks.forEach(version => console.log(' ' + version));
|
|
107
|
-
return;
|
|
122
|
+
sdks.forEach((version) => console.log(' ' + version));
|
|
108
123
|
}
|
|
109
|
-
catch (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
124
|
+
catch (ex) {
|
|
125
|
+
runWindowsError =
|
|
126
|
+
ex instanceof Error ? ex : new Error(String(ex));
|
|
127
|
+
telemetry_1.Telemetry.trackException(runWindowsError);
|
|
128
|
+
(0, commandWithProgress_1.newError)('Unable to print environment info.\n' + runWindowsError.toString());
|
|
114
129
|
}
|
|
130
|
+
await (0, telemetryHelpers_1.endTelemetrySession)(runWindowsError, getExtraProps);
|
|
131
|
+
(0, commandWithProgress_1.setExitProcessWithError)(options.logging, runWindowsError);
|
|
132
|
+
return;
|
|
115
133
|
}
|
|
116
|
-
let runWindowsError;
|
|
117
134
|
try {
|
|
118
135
|
await runWindowsInternal(args, config, options);
|
|
119
136
|
}
|
|
120
|
-
catch (
|
|
121
|
-
|
|
122
|
-
|
|
137
|
+
catch (ex) {
|
|
138
|
+
runWindowsError =
|
|
139
|
+
ex instanceof Error ? ex : new Error(String(ex));
|
|
140
|
+
telemetry_1.Telemetry.trackException(runWindowsError);
|
|
123
141
|
if (!hasRunRnwDependencies) {
|
|
124
142
|
const rnwPkgJsonPath = require.resolve('react-native-windows/package.json', {
|
|
125
143
|
paths: [process.cwd(), __dirname],
|
|
@@ -127,68 +145,16 @@ async function runWindows(args, config, options) {
|
|
|
127
145
|
const rnwDependenciesPath = path_1.default.join(path_1.default.dirname(rnwPkgJsonPath), 'scripts/rnw-dependencies.ps1');
|
|
128
146
|
(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`);
|
|
129
147
|
}
|
|
130
|
-
return setExitProcessWithError(e, options.logging);
|
|
131
|
-
}
|
|
132
|
-
finally {
|
|
133
|
-
(_a = telemetry_1.Telemetry.client) === null || _a === void 0 ? void 0 : _a.trackEvent({
|
|
134
|
-
name: 'run-windows',
|
|
135
|
-
properties: {
|
|
136
|
-
release: options.release,
|
|
137
|
-
arch: options.arch,
|
|
138
|
-
singleproc: options.singleproc,
|
|
139
|
-
emulator: options.emulator,
|
|
140
|
-
device: options.device,
|
|
141
|
-
target: options.target,
|
|
142
|
-
remoteDebugging: options.remoteDebugging,
|
|
143
|
-
logging: options.logging,
|
|
144
|
-
packager: options.packager,
|
|
145
|
-
bundle: options.bundle,
|
|
146
|
-
launch: options.launch,
|
|
147
|
-
autolink: options.autolink,
|
|
148
|
-
build: options.bundle,
|
|
149
|
-
deploy: options.deploy,
|
|
150
|
-
sln: options.sln !== undefined,
|
|
151
|
-
proj: options.proj !== undefined,
|
|
152
|
-
msBuildProps: options.msbuildprops !== undefined
|
|
153
|
-
? options.msbuildprops.split(',').length
|
|
154
|
-
: 0,
|
|
155
|
-
info: options.info,
|
|
156
|
-
directDebugging: options.directDebugging,
|
|
157
|
-
'react-native-windows': getPkgVersion('react-native-windows'),
|
|
158
|
-
'react-native': getPkgVersion('react-native'),
|
|
159
|
-
'cli-version': getPkgVersion('@react-native-windows/cli'),
|
|
160
|
-
msftInternal: (0, telemetry_1.isMSFTInternal)(),
|
|
161
|
-
durationInSecs: process.uptime(),
|
|
162
|
-
success: runWindowsError === undefined,
|
|
163
|
-
phase: runWindowsPhase,
|
|
164
|
-
totalMem: (0, os_1.totalmem)(),
|
|
165
|
-
diskFree: (0, telemetry_1.getDiskFreeSpace)(__dirname),
|
|
166
|
-
cpus: (0, os_1.cpus)().length,
|
|
167
|
-
project: await getAnonymizedProjectName(config.root),
|
|
168
|
-
hasRunRnwDependencies: hasRunRnwDependencies,
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
(_b = telemetry_1.Telemetry.client) === null || _b === void 0 ? void 0 : _b.flush();
|
|
172
148
|
}
|
|
149
|
+
await (0, telemetryHelpers_1.endTelemetrySession)(runWindowsError, getExtraProps);
|
|
150
|
+
(0, commandWithProgress_1.setExitProcessWithError)(options.logging, runWindowsError);
|
|
173
151
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const projectName = projectJson.name;
|
|
181
|
-
if (typeof projectName !== 'string') {
|
|
182
|
-
return null;
|
|
183
|
-
}
|
|
184
|
-
// Ensure the project name cannot be reverse engineered to avoid leaking PII
|
|
185
|
-
return crypto_1.default
|
|
186
|
-
.createHash('sha256')
|
|
187
|
-
.update(projectName)
|
|
188
|
-
.digest('hex')
|
|
189
|
-
.toString();
|
|
190
|
-
}
|
|
191
|
-
exports.getAnonymizedProjectName = getAnonymizedProjectName;
|
|
152
|
+
/**
|
|
153
|
+
* Performs build deploy and launch of RNW apps.
|
|
154
|
+
* @param args Unprocessed args passed from react-native CLI.
|
|
155
|
+
* @param config Config passed from react-native CLI.
|
|
156
|
+
* @param options Options passed from react-native CLI.
|
|
157
|
+
*/
|
|
192
158
|
async function runWindowsInternal(args, config, options) {
|
|
193
159
|
const verbose = options.logging === true;
|
|
194
160
|
if (verbose) {
|
|
@@ -203,17 +169,44 @@ async function runWindowsInternal(args, config, options) {
|
|
|
203
169
|
(0, commandWithProgress_1.newError)(`Couldn't get app solution information. ${e.message}`);
|
|
204
170
|
throw e;
|
|
205
171
|
}
|
|
172
|
+
let buildTools;
|
|
173
|
+
runWindowsPhase = 'FindBuildTools';
|
|
174
|
+
try {
|
|
175
|
+
buildTools = msbuildtools_1.default.findAvailableVersion(options.arch, verbose);
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
(0, commandWithProgress_1.newWarn)('No public VS release found');
|
|
179
|
+
// Try prerelease
|
|
180
|
+
try {
|
|
181
|
+
(0, commandWithProgress_1.newInfo)('Trying pre-release VS');
|
|
182
|
+
buildTools = msbuildtools_1.default.findAvailableVersion(options.arch, verbose, true);
|
|
183
|
+
}
|
|
184
|
+
catch (e) {
|
|
185
|
+
(0, commandWithProgress_1.newError)(e.message);
|
|
186
|
+
throw error;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Restore packages.config files for dependencies that don't support PackageReference.
|
|
190
|
+
try {
|
|
191
|
+
await buildTools.restorePackageConfigs(slnFile);
|
|
192
|
+
}
|
|
193
|
+
catch (e) {
|
|
194
|
+
(0, commandWithProgress_1.newError)(`Couldn't restore found packages.config instances. ${e.message}`);
|
|
195
|
+
throw e;
|
|
196
|
+
}
|
|
206
197
|
try {
|
|
207
198
|
if (options.autolink) {
|
|
208
199
|
const autolinkArgs = [];
|
|
209
200
|
const autolinkConfig = config;
|
|
210
201
|
const autoLinkOptions = {
|
|
211
202
|
logging: options.logging,
|
|
203
|
+
check: false,
|
|
212
204
|
proj: options.proj,
|
|
213
205
|
sln: options.sln,
|
|
206
|
+
telemetry: options.telemetry,
|
|
214
207
|
};
|
|
215
208
|
runWindowsPhase = 'AutoLink';
|
|
216
|
-
await autolink_1.
|
|
209
|
+
await (0, autolink_1.autolinkWindowsInternal)(autolinkArgs, autolinkConfig, autoLinkOptions);
|
|
217
210
|
}
|
|
218
211
|
else {
|
|
219
212
|
(0, commandWithProgress_1.newInfo)('Autolink step is skipped');
|
|
@@ -223,23 +216,6 @@ async function runWindowsInternal(args, config, options) {
|
|
|
223
216
|
(0, commandWithProgress_1.newError)(`Autolinking failed. ${e.message}`);
|
|
224
217
|
throw e;
|
|
225
218
|
}
|
|
226
|
-
let buildTools;
|
|
227
|
-
runWindowsPhase = 'FindBuildTools';
|
|
228
|
-
try {
|
|
229
|
-
buildTools = msbuildtools_1.default.findAvailableVersion(options.arch, verbose);
|
|
230
|
-
}
|
|
231
|
-
catch (error) {
|
|
232
|
-
(0, commandWithProgress_1.newWarn)('No public VS release found');
|
|
233
|
-
// Try prerelease
|
|
234
|
-
try {
|
|
235
|
-
(0, commandWithProgress_1.newInfo)('Trying pre-release VS');
|
|
236
|
-
buildTools = msbuildtools_1.default.findAvailableVersion(options.arch, verbose, true);
|
|
237
|
-
}
|
|
238
|
-
catch (e) {
|
|
239
|
-
(0, commandWithProgress_1.newError)(e.message);
|
|
240
|
-
throw error;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
219
|
if (options.build) {
|
|
244
220
|
runWindowsPhase = 'FindSolution';
|
|
245
221
|
if (!slnFile) {
|