react-native-windows-init 1.4.4 → 1.4.6

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.
@@ -1,9 +1,9 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * @format
6
- */
7
- import type { generateWindows, GenerateOptions } from '@react-native-windows/cli';
8
- export type GenerateWindows = typeof generateWindows;
9
- export type GenerateWindows62 = (projectDir: string, name: string, ns: string, options: GenerateOptions) => void;
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @format
6
+ */
7
+ import type { generateWindows, GenerateOptions } from '@react-native-windows/cli';
8
+ export type GenerateWindows = typeof generateWindows;
9
+ export type GenerateWindows62 = (projectDir: string, name: string, ns: string, options: GenerateOptions) => void;
@@ -1,9 +1,9 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation.
4
- * Licensed under the MIT License.
5
- *
6
- * @format
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ *
6
+ * @format
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  //# sourceMappingURL=GenerateWindowsType.js.map
@@ -1,7 +1,7 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * @format
6
- */
7
- export {};
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @format
6
+ */
7
+ export {};
@@ -1,69 +1,69 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation.
4
- * Licensed under the MIT License.
5
- *
6
- * @format
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const Cli_1 = require("../Cli");
10
- function validateOptionName(name, optionName) {
11
- // Do not add a default case here. Every item must explicitly return true
12
- switch (optionName) {
13
- case 'version':
14
- case 'namespace':
15
- case 'verbose':
16
- case 'telemetry':
17
- case 'language':
18
- case 'overwrite':
19
- case 'projectType':
20
- case 'experimentalNuGetDependency':
21
- case 'useHermes':
22
- case 'useWinUI3':
23
- case 'nuGetTestVersion':
24
- case 'nuGetTestFeed':
25
- case 'useDevMode':
26
- return true;
27
- }
28
- throw new Error(`Unable to find ${optionName} to match '${name}' in WindowsInitOptions.`);
29
- }
30
- test('windowsInitOptions - validate options', () => {
31
- const options = Cli_1.windowsInitOptions;
32
- for (const optionName of Object.keys(options)) {
33
- const option = options[optionName];
34
- // Validate type
35
- expect(option.type).toBeDefined();
36
- // Validate defaults
37
- if (option.type === 'string') {
38
- if (option.choices !== undefined) {
39
- // If there are choices (enum value) make sure
40
- // the default is present and of that type
41
- expect(Array.isArray(option.choices)).toBe(true);
42
- expect(option).toHaveProperty('default');
43
- expect(option.default).toBeDefined();
44
- expect(option.choices.includes(option.default)).toBe(true);
45
- }
46
- else {
47
- // Regular strings should not have defined default
48
- expect(option.default).not.toBeDefined();
49
- }
50
- }
51
- else if (option.conflicts !== undefined) {
52
- // Options with conflicts defined should have default = undefined
53
- expect(option).toHaveProperty('default');
54
- expect(option.default).toBeUndefined();
55
- }
56
- else {
57
- // Regular options should have defined defaults
58
- expect(option).toHaveProperty('default');
59
- expect(option.default).toBeDefined();
60
- }
61
- // Validate description
62
- expect(option.describe).toBeDefined();
63
- expect(option.describe).not.toBeNull();
64
- expect(option.describe).toBe(option.describe.trim());
65
- // Validate all command options are present in WindowsInitOptions
66
- expect(validateOptionName(optionName, optionName)).toBe(true);
67
- }
68
- });
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ *
6
+ * @format
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const Cli_1 = require("../Cli");
10
+ function validateOptionName(name, optionName) {
11
+ // Do not add a default case here. Every item must explicitly return true
12
+ switch (optionName) {
13
+ case 'version':
14
+ case 'namespace':
15
+ case 'verbose':
16
+ case 'telemetry':
17
+ case 'language':
18
+ case 'overwrite':
19
+ case 'projectType':
20
+ case 'experimentalNuGetDependency':
21
+ case 'useHermes':
22
+ case 'useWinUI3':
23
+ case 'nuGetTestVersion':
24
+ case 'nuGetTestFeed':
25
+ case 'useDevMode':
26
+ return true;
27
+ }
28
+ throw new Error(`Unable to find ${optionName} to match '${name}' in WindowsInitOptions.`);
29
+ }
30
+ test('windowsInitOptions - validate options', () => {
31
+ const options = Cli_1.windowsInitOptions;
32
+ for (const optionName of Object.keys(options)) {
33
+ const option = options[optionName];
34
+ // Validate type
35
+ expect(option.type).toBeDefined();
36
+ // Validate defaults
37
+ if (option.type === 'string') {
38
+ if (option.choices !== undefined) {
39
+ // If there are choices (enum value) make sure
40
+ // the default is present and of that type
41
+ expect(Array.isArray(option.choices)).toBe(true);
42
+ expect(option).toHaveProperty('default');
43
+ expect(option.default).toBeDefined();
44
+ expect(option.choices.includes(option.default)).toBe(true);
45
+ }
46
+ else {
47
+ // Regular strings should not have defined default
48
+ expect(option.default).not.toBeDefined();
49
+ }
50
+ }
51
+ else if (option.conflicts !== undefined) {
52
+ // Options with conflicts defined should have default = undefined
53
+ expect(option).toHaveProperty('default');
54
+ expect(option.default).toBeUndefined();
55
+ }
56
+ else {
57
+ // Regular options should have defined defaults
58
+ expect(option).toHaveProperty('default');
59
+ expect(option.default).toBeDefined();
60
+ }
61
+ // Validate description
62
+ expect(option.describe).toBeDefined();
63
+ expect(option.describe).not.toBeNull();
64
+ expect(option.describe).toBe(option.describe.trim());
65
+ // Validate all command options are present in WindowsInitOptions
66
+ expect(validateOptionName(optionName, optionName)).toBe(true);
67
+ }
68
+ });
69
69
  //# sourceMappingURL=cli.test.js.map
@@ -1,12 +1,12 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * @format
6
- */
7
- import { GenerateWindows } from './GenerateWindowsType';
8
- /**
9
- * Returns the Windows template generator function, normalizing the function
10
- * to any differences across RN versions.
11
- */
12
- export default function requireGenerateWindows(): GenerateWindows;
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @format
6
+ */
7
+ import { GenerateWindows } from './GenerateWindowsType';
8
+ /**
9
+ * Returns the Windows template generator function, normalizing the function
10
+ * to any differences across RN versions.
11
+ */
12
+ export default function requireGenerateWindows(): GenerateWindows;
@@ -1,29 +1,29 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Microsoft Corporation.
4
- * Licensed under the MIT License.
5
- *
6
- * @format
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- /**
10
- * Returns the Windows template generator function, normalizing the function
11
- * to any differences across RN versions.
12
- */
13
- function requireGenerateWindows() {
14
- try {
15
- // Try the path for 0.63+
16
- const requirePath = require.resolve('react-native-windows/generate', {
17
- paths: [process.cwd()],
18
- });
19
- return require(requirePath);
20
- }
21
- catch (_a) {
22
- // Fall back to trying the older path
23
- const requirePath = require.resolve('react-native-windows/local-cli/generate-windows', { paths: [process.cwd()] });
24
- const generate62 = require(requirePath);
25
- return async (...args) => generate62(...args);
26
- }
27
- }
28
- exports.default = requireGenerateWindows;
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ *
6
+ * @format
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ /**
10
+ * Returns the Windows template generator function, normalizing the function
11
+ * to any differences across RN versions.
12
+ */
13
+ function requireGenerateWindows() {
14
+ try {
15
+ // Try the path for 0.63+
16
+ const requirePath = require.resolve('react-native-windows/generate', {
17
+ paths: [process.cwd()],
18
+ });
19
+ return require(requirePath);
20
+ }
21
+ catch (_a) {
22
+ // Fall back to trying the older path
23
+ const requirePath = require.resolve('react-native-windows/local-cli/generate-windows', { paths: [process.cwd()] });
24
+ const generate62 = require(requirePath);
25
+ return async (...args) => generate62(...args);
26
+ }
27
+ }
28
+ exports.default = requireGenerateWindows;
29
29
  //# sourceMappingURL=requireGenerateWindows.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows-init",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "CLI to add react-native-windows to an existing react-native project",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -22,8 +22,8 @@
22
22
  "react-native-windows-init": "./bin.js"
23
23
  },
24
24
  "dependencies": {
25
- "@react-native-windows/fs": "0.0.0-canary.34",
26
- "@react-native-windows/telemetry": "0.0.0-canary.85",
25
+ "@react-native-windows/fs": "0.0.0-canary.36",
26
+ "@react-native-windows/telemetry": "0.0.0-canary.87",
27
27
  "@typescript-eslint/eslint-plugin": "^5.30.5",
28
28
  "@typescript-eslint/parser": "^5.57.1",
29
29
  "chalk": "^4.1.0",
@@ -37,10 +37,10 @@
37
37
  "yargs": "^16.2.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@react-native-windows/cli": "0.0.0-canary.201",
41
- "@rnw-scripts/eslint-config": "1.2.5",
42
- "@rnw-scripts/jest-unittest-config": "1.5.7",
43
- "@rnw-scripts/just-task": "2.3.21",
40
+ "@react-native-windows/cli": "0.0.0-canary.203",
41
+ "@rnw-scripts/eslint-config": "1.2.7",
42
+ "@rnw-scripts/jest-unittest-config": "1.5.8",
43
+ "@rnw-scripts/just-task": "2.3.23",
44
44
  "@rnw-scripts/ts-config": "2.0.5",
45
45
  "@types/chalk": "^2.2.0",
46
46
  "@types/jest": "^29.2.2",
@@ -50,11 +50,11 @@
50
50
  "@types/semver": "7.3.3",
51
51
  "@types/valid-url": "^1.0.3",
52
52
  "@types/yargs": "16.0.0",
53
- "babel-jest": "^29.3.0",
53
+ "babel-jest": "^29.6.3",
54
54
  "eslint": "^8.19.0",
55
- "jest": "^29.2.1",
56
- "prettier": "^2.4.1",
57
- "typescript": "^4.9.5"
55
+ "jest": "^29.6.3",
56
+ "prettier": "2.8.8",
57
+ "typescript": "5.0.4"
58
58
  },
59
59
  "files": [
60
60
  "bin.js",