@react-native-windows/cli 0.68.6 → 0.68.8

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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ * @format
5
+ */
6
+ export {};
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ * @format
6
+ */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ const child_process_1 = require("child_process");
12
+ const path_1 = __importDefault(require("path"));
13
+ const commandWithProgress_1 = require("../runWindows/utils/commandWithProgress");
14
+ const healthCheckList_1 = require("../healthCheckList");
15
+ test('Verify list of health checks aligns with rnw-dependencies', async () => {
16
+ const rnwDepScriptPath = path_1.default.join(path_1.default.dirname(require.resolve('react-native-windows/package.json', {
17
+ paths: [process.cwd()],
18
+ })), 'Scripts/rnw-dependencies.ps1');
19
+ const rnwDeps = (0, child_process_1.execSync)(`${commandWithProgress_1.powershell} -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -ListChecks`, { stdio: 'pipe' });
20
+ const deps = rnwDeps.toString().trim().split('\n');
21
+ const rnwHelathChecks = deps.map((dep) => {
22
+ const match = /([^:]+): ([^:]+): (.*)/.exec(dep);
23
+ if (!match) {
24
+ throw new Error(`Unexpected output from ${rnwDepScriptPath}`);
25
+ }
26
+ const [, optional, id, name] = match;
27
+ return [optional.trim() === 'Required', id, name];
28
+ });
29
+ expect(healthCheckList_1.HealthCheckList).toEqual(rnwHelathChecks);
30
+ });
31
+ //# sourceMappingURL=healthChecks.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"healthChecks.test.js","sourceRoot":"","sources":["../../src/e2etest/healthChecks.test.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAEH,iDAAuC;AACvC,gDAAwB;AACxB,iFAAmE;AACnE,wDAAmD;AAEnD,IAAI,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;IAC3E,MAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAChC,cAAI,CAAC,OAAO,CACV,OAAO,CAAC,OAAO,CAAC,mCAAmC,EAAE;QACnD,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;KACvB,CAAC,CACH,EACD,8BAA8B,CAC/B,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,wBAAQ,EACtB,GAAG,gCAAU,8CAA8C,gBAAgB,yBAAyB,EACpG,EAAC,KAAK,EAAE,MAAM,EAAC,CAChB,CAAC;IACF,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACvC,MAAM,KAAK,GAAG,wBAAwB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,0BAA0B,gBAAgB,EAAE,CAAC,CAAC;SAC/D;QACD,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC;QACrC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,UAAU,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,iCAAe,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n * @format\n */\n\nimport {execSync} from 'child_process';\nimport path from 'path';\nimport {powershell} from '../runWindows/utils/commandWithProgress';\nimport {HealthCheckList} from '../healthCheckList';\n\ntest('Verify list of health checks aligns with rnw-dependencies', async () => {\n const rnwDepScriptPath = path.join(\n path.dirname(\n require.resolve('react-native-windows/package.json', {\n paths: [process.cwd()],\n }),\n ),\n 'Scripts/rnw-dependencies.ps1',\n );\n\n const rnwDeps = execSync(\n `${powershell} -ExecutionPolicy Unrestricted -NoProfile \"${rnwDepScriptPath}\" -NoPrompt -ListChecks`,\n {stdio: 'pipe'},\n );\n const deps = rnwDeps.toString().trim().split('\\n');\n const rnwHelathChecks = 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 [optional.trim() === 'Required', id, name];\n });\n\n expect(HealthCheckList).toEqual(rnwHelathChecks);\n});\n"]}
@@ -0,0 +1 @@
1
+ export declare const HealthCheckList: (string | boolean)[][];
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HealthCheckList = void 0;
4
+ // Store list of health checks here to avoid having to launch PowerShell on every react-native config call
5
+ exports.HealthCheckList = [
6
+ [false, "FreeSpace", "Free space on current drive > 15 GB"],
7
+ [false, "InstalledMemory", "Installed memory >= 16 GB"],
8
+ [true, "WindowsVersion", "Windows version > 10.0.16299.0"],
9
+ [true, "DeveloperMode", "Developer mode is on"],
10
+ [true, "LongPath", "Long path support is enabled"],
11
+ [true, "Choco", "Choco"],
12
+ [true, "git", "git"],
13
+ [true, "VSUWP", "Compilers, build tools, SDKs and Visual Studio"],
14
+ [true, "Node", "NodeJS LTS"],
15
+ [false, "Chrome", "Chrome"],
16
+ [true, "Yarn", "Yarn"],
17
+ [true, "DotNetCore", ".net core 3.1"]
18
+ ];
19
+ //# sourceMappingURL=healthCheckList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"healthCheckList.js","sourceRoot":"","sources":["../src/healthCheckList.ts"],"names":[],"mappings":";;;AAAA,0GAA0G;AAC7F,QAAA,eAAe,GAAG;IAC7B,CAAC,KAAK,EAAE,WAAW,EAAE,qCAAqC,CAAC;IAC3D,CAAC,KAAK,EAAE,iBAAiB,EAAE,2BAA2B,CAAC;IACvD,CAAC,IAAI,EAAE,gBAAgB,EAAE,gCAAgC,CAAC;IAC1D,CAAC,IAAI,EAAE,eAAe,EAAE,sBAAsB,CAAC;IAC/C,CAAC,IAAI,EAAE,UAAU,EAAE,8BAA8B,CAAC;IAClD,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC;IACxB,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC;IACpB,CAAC,IAAI,EAAE,OAAO,EAAE,gDAAgD,CAAC;IACjE,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC;IAC5B,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC;IAC3B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC;IACtB,CAAC,IAAI,EAAE,YAAY,EAAE,eAAe,CAAC;CACtC,CAAA","sourcesContent":["// Store list of health checks here to avoid having to launch PowerShell on every react-native config call\nexport const HealthCheckList = [\n [false, \"FreeSpace\", \"Free space on current drive > 15 GB\"],\n [false, \"InstalledMemory\", \"Installed memory >= 16 GB\"],\n [true, \"WindowsVersion\", \"Windows version > 10.0.16299.0\"],\n [true, \"DeveloperMode\", \"Developer mode is on\"],\n [true, \"LongPath\", \"Long path support is enabled\"],\n [true, \"Choco\", \"Choco\"],\n [true, \"git\", \"git\"],\n [true, \"VSUWP\", \"Compilers, build tools, SDKs and Visual Studio\"],\n [true, \"Node\", \"NodeJS LTS\"],\n [false, \"Chrome\", \"Chrome\"],\n [true, \"Yarn\", \"Yarn\"],\n [true, \"DotNetCore\", \".net core 3.1\"]\n]\n"]}
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getHealthChecks = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const child_process_1 = require("child_process");
9
8
  const rnDir = path_1.default.dirname(require.resolve('react-native/package.json', { paths: [process.cwd()] }));
10
9
  const cliDir = path_1.default.dirname(require.resolve('@react-native-community/cli/package.json', { paths: [rnDir] }));
11
10
  const execaPath = require.resolve('execa', { paths: [cliDir] });
12
11
  const execa = require(execaPath);
13
12
  const commandWithProgress_1 = require("./runWindows/utils/commandWithProgress");
13
+ const healthCheckList_1 = require("./healthCheckList");
14
14
  function getHealthChecks() {
15
15
  // #8471: There are known cases where the dependencies script will error out.
16
16
  // Fail gracefully if that happens in the meantime.
@@ -35,26 +35,20 @@ function getHealthChecksUnsafe() {
35
35
  return undefined;
36
36
  }
37
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');
38
- const rnwDeps = (0, child_process_1.execSync)(`${commandWithProgress_1.powershell} -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -ListChecks`, { stdio: 'pipe' });
39
- const deps = rnwDeps.toString().trim().split('\n');
40
38
  return [
41
39
  {
42
40
  label: 'Windows',
43
- healthchecks: deps.map(dep => {
44
- const match = /([^:]+): ([^:]+): (.*)/.exec(dep);
45
- if (!match) {
46
- throw new Error(`Unexpected output from ${rnwDepScriptPath}`);
47
- }
48
- const [, /*optional*/ , id, name] = match;
41
+ healthchecks: healthCheckList_1.HealthCheckList.map((dep) => {
42
+ const [optional, id, name] = dep;
49
43
  return {
50
44
  label: name,
51
45
  // The schema check of react-native doctor requires this to be a string, although it should be a boolean
52
46
  // Enable this once we pick up a new version of the CLI that includes https://github.com/react-native-community/cli/pull/1367
53
- // isRequired: (optional.trim() === 'Required') ? true : false,
47
+ isRequired: optional,
54
48
  getDiagnostics: async () => {
55
49
  let needsToBeFixed = true;
56
50
  try {
57
- await execa(`${commandWithProgress_1.powershell} -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -Check ${id}`);
51
+ await execa(`"${commandWithProgress_1.powershell}" -ExecutionPolicy Unrestricted -NoProfile "${rnwDepScriptPath}" -NoPrompt -Check ${id}`);
58
52
  needsToBeFixed = false;
59
53
  }
60
54
  catch (_a) {
@@ -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,KAAK,CAAC,EAAC,CAAC,CAAC,CAAC;AAC3G,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAChE,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAGjC,gFAAoE;AAEpE,SAAgB,eAAe;IAC7B,6EAA6E;IAC7E,mDAAmD;IACnD,IAAI;QACF,OAAO,qBAAqB,EAAE,CAAC;KAChC;IAAC,WAAM;QACN,OAAO,CAAC;gBACN,KAAK,EAAE,SAAS;gBAChB,YAAY,EAAE,CAAC;wBACb,KAAK,EAAE,mCAAmC;wBAC1C,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAC,cAAc,EAAE,IAAI,EAAC,CAAC;wBACpD,eAAe,EAAE,KAAK,EAAE,EAAC,MAAM,EAAC,EAAE,EAAE,GAAE,MAAM,CAAC,IAAI,EAAE,CAAA,CA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EAAE,EAAE,CAAC,CAAC;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 }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C,WAAM;4BACN,qBAAqB,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,oCAAoC,EAAE,GAAG,EAAE,CAAC,CAAC;4BAC3F,MAAM,CAAC,IAAI,EAAE,CAAC;yBACf;oBACH,CAAC;iBACsB,CAAA;YAC3B,CAAC,CAAC;SACL;KAAC,CAAC;AACP,CAAC","sourcesContent":["import path from 'path';\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, HealthCheckInterface} from '@react-native-community/cli-types';\nimport { powershell } from './runWindows/utils/commandWithProgress';\nimport { HealthCheckList } from './healthCheckList';\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 return [\n {\n label: 'Windows',\n healthchecks:\n HealthCheckList.map((dep: [boolean, string, string]) => {\n const [optional, id, name] = dep;\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, \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 } as HealthCheckInterface\n })\n }];\n }"]}
@@ -17,7 +17,7 @@ interface VisualStudioInstallation {
17
17
  */
18
18
  export declare function enumerateVsInstalls(opts: {
19
19
  requires?: string[];
20
- version?: string;
20
+ minVersion?: string;
21
21
  verbose?: boolean;
22
22
  latest?: boolean;
23
23
  prerelease?: boolean;
@@ -13,6 +13,7 @@ const telemetry_1 = require("@react-native-windows/telemetry");
13
13
  const child_process_1 = require("child_process");
14
14
  const fs_1 = __importDefault(require("@react-native-windows/fs"));
15
15
  const path_1 = __importDefault(require("path"));
16
+ const semver_1 = __importDefault(require("semver"));
16
17
  /**
17
18
  * Helper to run vswhere in JSON mode
18
19
  *
@@ -40,8 +41,32 @@ function vsWhere(args, verbose) {
40
41
  */
41
42
  function enumerateVsInstalls(opts) {
42
43
  const args = [];
43
- if (opts.version) {
44
- args.push(`-version [${opts.version},${Number(opts.version) + 1})`);
44
+ if (opts.minVersion) {
45
+ // VS 2019 ex: minVersion == 16.7 => [16.7,17.0)
46
+ // VS 2022 ex: minVersion == 17.0 => [17.0,18.0)
47
+ // Try to parse minVersion as both a Number and SemVer
48
+ const minVersionNum = Number(opts.minVersion);
49
+ const minVersionSemVer = semver_1.default.parse(opts.minVersion);
50
+ let minVersion;
51
+ let maxVersion;
52
+ if (minVersionSemVer) {
53
+ minVersion = minVersionSemVer.toString();
54
+ maxVersion = (minVersionSemVer.major + 1).toFixed(1);
55
+ }
56
+ else if (!Number.isNaN(minVersionNum)) {
57
+ minVersion = minVersionNum.toFixed(1);
58
+ maxVersion = (Math.floor(minVersionNum) + 1).toFixed(1);
59
+ }
60
+ else {
61
+ // Unable to parse minVersion and determine maxVersion,
62
+ // caller will throw error that version couldn't be found.
63
+ return [];
64
+ }
65
+ const versionRange = `[${minVersion},${maxVersion}` + (opts.prerelease ? ']' : ')');
66
+ if (opts.verbose) {
67
+ console.log(`Looking for VS installs with version range: ${versionRange}`);
68
+ }
69
+ args.push(`-version ${versionRange}`);
45
70
  }
46
71
  if (opts.requires) {
47
72
  args.push(`-requires ${opts.requires.join(' ')}`);
@@ -1 +1 @@
1
- {"version":3,"file":"vsInstalls.js","sourceRoot":"","sources":["../../../src/runWindows/utils/vsInstalls.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,+DAA2D;AAC3D,iDAAuC;AACvC,kEAA0C;AAC1C,gDAAwB;AAYxB;;;;;GAKG;AACH,SAAS,OAAO,CAAC,IAAc,EAAE,OAAiB;IAChD,gEAAgE;IAChE,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAC3B,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAa,EAC7D,gDAAgD,CACjD,CAAC;IAEF,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,WAAW,CAAC,CAAC;KACvD;IAED,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;QAC/B,MAAM,IAAI,sBAAU,CAClB,WAAW,EACX,6BAA6B,WAAW,EAAE,CAC3C,CAAC;KACH;IAED,MAAM,OAAO,GAAG,IAAI,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC;IACxE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,wBAAQ,EAAC,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AQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvB,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;KACpB;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAjBD,kDAiBC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport {CodedError} from '@react-native-windows/telemetry';\nimport {execSync} from 'child_process';\nimport fs from '@react-native-windows/fs';\nimport path from 'path';\n\n/**\n * A subset of the per-instance properties returned by vswhere\n */\ninterface VisualStudioInstallation {\n instanceId: string;\n installationPath: string;\n installationVersion: string;\n prerelease: string;\n}\n\n/**\n * Helper to run vswhere in JSON mode\n *\n * @param args Arguments to pass to vsWhere\n * @param verbose enable verbose logging\n */\nfunction vsWhere(args: string[], verbose?: boolean): any[] {\n // This path is maintained and VS has promised to keep it valid.\n const vsWherePath = path.join(\n process.env['ProgramFiles(x86)'] || process.env.ProgramFiles!,\n '/Microsoft Visual Studio/Installer/vswhere.exe',\n );\n\n if (verbose) {\n console.log('Looking for vswhere at: ' + vsWherePath);\n }\n\n if (!fs.existsSync(vsWherePath)) {\n throw new CodedError(\n 'NoVSWhere',\n `Unable to find vswhere at ${vsWherePath}`,\n );\n }\n\n const cmdline = `\"${vsWherePath}\" ${args.join(' ')} -format json -utf8`;\n const json = JSON.parse(execSync(cmdline).toString('utf8'));\n\n for (const entry of json) {\n entry.prerelease = entry.catalog.productMilestoneIsPreRelease;\n }\n\n return json;\n}\n\n/**\n * Enumerate the installed versions of Visual Studio\n */\nexport function enumerateVsInstalls(opts: {\n requires?: string[];\n version?: string;\n verbose?: boolean;\n latest?: boolean;\n prerelease?: boolean;\n}): VisualStudioInstallation[] {\n const args: string[] = [];\n\n if (opts.version) {\n args.push(`-version [${opts.version},${Number(opts.version) + 1})`);\n }\n\n if (opts.requires) {\n args.push(`-requires ${opts.requires.join(' ')}`);\n }\n\n if (opts.latest) {\n args.push('-latest');\n }\n\n if (opts.prerelease) {\n args.push('-prerelease');\n }\n\n return vsWhere(args, opts.verbose);\n}\n\n/**\n * Find the latest available VS installation that matches the given constraints\n */\nexport function findLatestVsInstall(opts: {\n requires?: string[];\n minVersion?: string;\n verbose?: boolean;\n prerelease?: boolean;\n}): VisualStudioInstallation | null {\n let installs = enumerateVsInstalls({...opts, latest: true});\n\n if (opts.prerelease && installs.length > 0) {\n installs = installs.filter((x) => x.prerelease === 'True');\n }\n\n if (installs.length > 0) {\n return installs[0];\n } else {\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"vsInstalls.js","sourceRoot":"","sources":["../../../src/runWindows/utils/vsInstalls.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,+DAA2D;AAC3D,iDAAuC;AACvC,kEAA0C;AAC1C,gDAAwB;AACxB,oDAA4B;AAY5B;;;;;GAKG;AACH,SAAS,OAAO,CAAC,IAAc,EAAE,OAAiB;IAChD,gEAAgE;IAChE,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAC3B,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAa,EAC7D,gDAAgD,CACjD,CAAC;IAEF,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,WAAW,CAAC,CAAC;KACvD;IAED,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;QAC/B,MAAM,IAAI,sBAAU,CAClB,WAAW,EACX,6BAA6B,WAAW,EAAE,CAC3C,CAAC;KACH;IAED,MAAM,OAAO,GAAG,IAAI,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC;IACxE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,wBAAQ,EAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAE5D,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE;QACxB,KAAK,C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AAY,EAAE,CAAC,CAAC;KACvC;IAED,IAAI,IAAI,CAAC,QAAQ,EAAE;QACjB,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;KACnD;IAED,IAAI,IAAI,CAAC,MAAM,EAAE;QACf,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACtB;IAED,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KAC1B;IAED,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAzDD,kDAyDC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CAAC,IAKnC;IACC,IAAI,QAAQ,GAAG,mBAAmB,CAAC,EAAC,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;IAE5D,IAAI,IAAI,CAAC,UAAU,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QAC1C,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC;KAC5D;IAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvB,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;KACpB;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAjBD,kDAiBC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport {CodedError} from '@react-native-windows/telemetry';\nimport {execSync} from 'child_process';\nimport fs from '@react-native-windows/fs';\nimport path from 'path';\nimport semver from 'semver';\n\n/**\n * A subset of the per-instance properties returned by vswhere\n */\ninterface VisualStudioInstallation {\n instanceId: string;\n installationPath: string;\n installationVersion: string;\n prerelease: string;\n}\n\n/**\n * Helper to run vswhere in JSON mode\n *\n * @param args Arguments to pass to vsWhere\n * @param verbose enable verbose logging\n */\nfunction vsWhere(args: string[], verbose?: boolean): any[] {\n // This path is maintained and VS has promised to keep it valid.\n const vsWherePath = path.join(\n process.env['ProgramFiles(x86)'] || process.env.ProgramFiles!,\n '/Microsoft Visual Studio/Installer/vswhere.exe',\n );\n\n if (verbose) {\n console.log('Looking for vswhere at: ' + vsWherePath);\n }\n\n if (!fs.existsSync(vsWherePath)) {\n throw new CodedError(\n 'NoVSWhere',\n `Unable to find vswhere at ${vsWherePath}`,\n );\n }\n\n const cmdline = `\"${vsWherePath}\" ${args.join(' ')} -format json -utf8`;\n const json = JSON.parse(execSync(cmdline).toString('utf8'));\n\n for (const entry of json) {\n entry.prerelease = entry.catalog.productMilestoneIsPreRelease;\n }\n\n return json;\n}\n\n/**\n * Enumerate the installed versions of Visual Studio\n */\nexport function enumerateVsInstalls(opts: {\n requires?: string[];\n minVersion?: string;\n verbose?: boolean;\n latest?: boolean;\n prerelease?: boolean;\n}): VisualStudioInstallation[] {\n const args: string[] = [];\n\n if (opts.minVersion) {\n // VS 2019 ex: minVersion == 16.7 => [16.7,17.0)\n // VS 2022 ex: minVersion == 17.0 => [17.0,18.0)\n\n // Try to parse minVersion as both a Number and SemVer\n const minVersionNum = Number(opts.minVersion);\n const minVersionSemVer = semver.parse(opts.minVersion);\n\n let minVersion: string;\n let maxVersion: string;\n\n if (minVersionSemVer) {\n minVersion = minVersionSemVer.toString();\n maxVersion = (minVersionSemVer.major + 1).toFixed(1);\n } else if (!Number.isNaN(minVersionNum)) {\n minVersion = minVersionNum.toFixed(1);\n maxVersion = (Math.floor(minVersionNum) + 1).toFixed(1);\n } else {\n // Unable to parse minVersion and determine maxVersion,\n // caller will throw error that version couldn't be found.\n return [];\n }\n\n const versionRange =\n `[${minVersion},${maxVersion}` + (opts.prerelease ? ']' : ')');\n\n if (opts.verbose) {\n console.log(\n `Looking for VS installs with version range: ${versionRange}`,\n );\n }\n\n args.push(`-version ${versionRange}`);\n }\n\n if (opts.requires) {\n args.push(`-requires ${opts.requires.join(' ')}`);\n }\n\n if (opts.latest) {\n args.push('-latest');\n }\n\n if (opts.prerelease) {\n args.push('-prerelease');\n }\n\n return vsWhere(args, opts.verbose);\n}\n\n/**\n * Find the latest available VS installation that matches the given constraints\n */\nexport function findLatestVsInstall(opts: {\n requires?: string[];\n minVersion?: string;\n verbose?: boolean;\n prerelease?: boolean;\n}): VisualStudioInstallation | null {\n let installs = enumerateVsInstalls({...opts, latest: true});\n\n if (opts.prerelease && installs.length > 0) {\n installs = installs.filter((x) => x.prerelease === 'True');\n }\n\n if (installs.length > 0) {\n return installs[0];\n } else {\n return null;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-windows/cli",
3
- "version": "0.68.6",
3
+ "version": "0.68.8",
4
4
  "license": "MIT",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "repository": {