@react-native-windows/cli 0.66.1 → 0.67.0

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.
Files changed (51) hide show
  1. package/CHANGELOG.json +303 -22
  2. package/CHANGELOG.md +127 -14
  3. package/lib-commonjs/config/configUtils.js.map +1 -1
  4. package/lib-commonjs/config/dependencyConfig.js +2 -2
  5. package/lib-commonjs/config/dependencyConfig.js.map +1 -1
  6. package/lib-commonjs/config/projectConfig.js +2 -2
  7. package/lib-commonjs/config/projectConfig.js.map +1 -1
  8. package/lib-commonjs/e2etest/autolink.test.d.ts +5 -0
  9. package/lib-commonjs/e2etest/autolink.test.js +93 -12
  10. package/lib-commonjs/e2etest/autolink.test.js.map +1 -1
  11. package/lib-commonjs/e2etest/dependencyConfig.test.js +15 -15
  12. package/lib-commonjs/e2etest/dependencyConfig.test.js.map +1 -1
  13. package/lib-commonjs/e2etest/projectConfig.test.js +16 -16
  14. package/lib-commonjs/e2etest/projectConfig.test.js.map +1 -1
  15. package/lib-commonjs/e2etest/projectConfig.utils.js +4 -4
  16. package/lib-commonjs/e2etest/projectConfig.utils.js.map +1 -1
  17. package/lib-commonjs/e2etest/runWindows.test.js +21 -3
  18. package/lib-commonjs/e2etest/runWindows.test.js.map +1 -1
  19. package/lib-commonjs/generator-common/index.js +1 -1
  20. package/lib-commonjs/generator-common/index.js.map +1 -1
  21. package/lib-commonjs/generator-windows/index.js +24 -51
  22. package/lib-commonjs/generator-windows/index.js.map +1 -1
  23. package/lib-commonjs/healthChecks.js +22 -4
  24. package/lib-commonjs/healthChecks.js.map +1 -1
  25. package/lib-commonjs/index.js +3 -3
  26. package/lib-commonjs/index.js.map +1 -1
  27. package/lib-commonjs/runWindows/runWindows.js +29 -26
  28. package/lib-commonjs/runWindows/runWindows.js.map +1 -1
  29. package/lib-commonjs/runWindows/runWindowsOptions.d.ts +8 -8
  30. package/lib-commonjs/runWindows/runWindowsOptions.js +1 -10
  31. package/lib-commonjs/runWindows/runWindowsOptions.js.map +1 -1
  32. package/lib-commonjs/runWindows/utils/autolink.d.ts +8 -5
  33. package/lib-commonjs/runWindows/utils/autolink.js +38 -30
  34. package/lib-commonjs/runWindows/utils/autolink.js.map +1 -1
  35. package/lib-commonjs/runWindows/utils/build.js +3 -3
  36. package/lib-commonjs/runWindows/utils/build.js.map +1 -1
  37. package/lib-commonjs/runWindows/utils/checkRequirements.js +1 -1
  38. package/lib-commonjs/runWindows/utils/checkRequirements.js.map +1 -1
  39. package/lib-commonjs/runWindows/utils/commandWithProgress.d.ts +2 -1
  40. package/lib-commonjs/runWindows/utils/commandWithProgress.js +5 -4
  41. package/lib-commonjs/runWindows/utils/commandWithProgress.js.map +1 -1
  42. package/lib-commonjs/runWindows/utils/deploy.d.ts +1 -1
  43. package/lib-commonjs/runWindows/utils/deploy.js +80 -29
  44. package/lib-commonjs/runWindows/utils/deploy.js.map +1 -1
  45. package/lib-commonjs/runWindows/utils/msbuildtools.js +11 -11
  46. package/lib-commonjs/runWindows/utils/msbuildtools.js.map +1 -1
  47. package/lib-commonjs/runWindows/utils/vsInstalls.js +1 -1
  48. package/lib-commonjs/runWindows/utils/vsInstalls.js.map +1 -1
  49. package/lib-commonjs/runWindows/utils/winappdeploytool.js +4 -4
  50. package/lib-commonjs/runWindows/utils/winappdeploytool.js.map +1 -1
  51. package/package.json +12 -9
package/CHANGELOG.json CHANGED
@@ -2,60 +2,341 @@
2
2
  "name": "@react-native-windows/cli",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 15 Nov 2021 16:09:26 GMT",
6
- "tag": "@react-native-windows/cli_v0.66.1",
7
- "version": "0.66.1",
5
+ "date": "Mon, 24 Jan 2022 16:12:31 GMT",
6
+ "tag": "@react-native-windows/cli_v0.67.0",
7
+ "version": "0.67.0",
8
8
  "comments": {
9
9
  "patch": [
10
10
  {
11
- "comment": "[0.66] Fix autolinking to support solution files using LF instead of CRLF",
12
11
  "author": "jthysell@microsoft.com",
13
- "commit": "b05dda932a79521caca4d581eaf66526ab5d6051",
14
- "package": "@react-native-windows/cli"
12
+ "package": "@react-native-windows/cli",
13
+ "commit": "a1a4439e47c2a98356d7b9b1af765d3907567e16",
14
+ "comment": "[0.67] Remove ADO NuGet feed from config for new projects"
15
+ },
16
+ {
17
+ "author": "ngerlem@microsoft.com",
18
+ "package": "@react-native-windows/cli",
19
+ "commit": "56818ebc599aa084aa9ffc949691f1be71da169a",
20
+ "comment": "Promote 0.67 to latest"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@react-native-windows/cli",
25
+ "comment": "Bump @react-native-windows/package-utils to v0.67.0",
26
+ "commit": "56818ebc599aa084aa9ffc949691f1be71da169a"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@react-native-windows/cli",
31
+ "comment": "Bump @react-native-windows/telemetry to v0.67.0",
32
+ "commit": "56818ebc599aa084aa9ffc949691f1be71da169a"
15
33
  }
16
34
  ]
17
35
  }
18
36
  },
19
37
  {
20
- "date": "Mon, 11 Oct 2021 15:07:19 GMT",
21
- "tag": "@react-native-windows/cli_v0.66.0",
22
- "version": "0.66.0",
38
+ "date": "Tue, 09 Nov 2021 01:12:34 GMT",
39
+ "tag": "@react-native-windows/cli_v0.67.0-preview.2",
40
+ "version": "0.67.0-preview.2",
23
41
  "comments": {
24
- "patch": [
42
+ "prerelease": [
43
+ {
44
+ "author": "jthysell@microsoft.com",
45
+ "package": "@react-native-windows/cli",
46
+ "commit": "not available",
47
+ "comment": "Upgrade WinUI/MUX to 2.7"
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ "date": "Tue, 09 Nov 2021 01:12:18 GMT",
54
+ "tag": "@react-native-windows/cli_v0.67.0-preview.2",
55
+ "version": "0.67.0-preview.2",
56
+ "comments": {
57
+ "prerelease": [
58
+ {
59
+ "author": "jthysell@microsoft.com",
60
+ "package": "@react-native-windows/cli",
61
+ "commit": "3436887f967daf3664d0b40dc273f5a873a1cc4d",
62
+ "comment": "Upgrade WinUI/MUX to 2.7"
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ {
68
+ "date": "Mon, 25 Oct 2021 15:07:48 GMT",
69
+ "tag": "@react-native-windows/cli_v0.67.0-preview.1",
70
+ "version": "0.67.0-preview.1",
71
+ "comments": {
72
+ "prerelease": [
73
+ {
74
+ "author": "ngerlem@microsoft.com",
75
+ "package": "@react-native-windows/cli",
76
+ "commit": "not available",
77
+ "comment": "Promote 0.67 to preview"
78
+ },
79
+ {
80
+ "author": "beachball",
81
+ "package": "@react-native-windows/cli",
82
+ "comment": "Bump @react-native-windows/package-utils to v0.67.0-preview.1",
83
+ "commit": "666510e980ced292bffd23a44982e8a800f91444"
84
+ },
85
+ {
86
+ "author": "beachball",
87
+ "package": "@react-native-windows/cli",
88
+ "comment": "Bump @react-native-windows/telemetry to v0.67.0-preview.1",
89
+ "commit": "666510e980ced292bffd23a44982e8a800f91444"
90
+ }
91
+ ]
92
+ }
93
+ },
94
+ {
95
+ "date": "Mon, 25 Oct 2021 15:07:19 GMT",
96
+ "tag": "@react-native-windows/cli_v0.67.0-preview.1",
97
+ "version": "0.67.0-preview.1",
98
+ "comments": {
99
+ "prerelease": [
100
+ {
101
+ "author": "ngerlem@microsoft.com",
102
+ "package": "@react-native-windows/cli",
103
+ "commit": "5ca0feb9bccbf395aa8297f97a1a8832971d4f2e",
104
+ "comment": "Promote 0.67 to preview"
105
+ },
106
+ {
107
+ "author": "beachball",
108
+ "package": "@react-native-windows/cli",
109
+ "comment": "Bump @react-native-windows/package-utils to v0.67.0-preview.1",
110
+ "commit": "be5b1c696dc4bb50281f444713575830d3bf72e3"
111
+ },
112
+ {
113
+ "author": "beachball",
114
+ "package": "@react-native-windows/cli",
115
+ "comment": "Bump @react-native-windows/telemetry to v0.67.0-preview.1",
116
+ "commit": "be5b1c696dc4bb50281f444713575830d3bf72e3"
117
+ }
118
+ ]
119
+ }
120
+ },
121
+ {
122
+ "date": "Thu, 21 Oct 2021 05:08:01 GMT",
123
+ "tag": "@react-native-windows/cli_v0.0.0-canary.95",
124
+ "version": "0.0.0-canary.95",
125
+ "comments": {
126
+ "prerelease": [
127
+ {
128
+ "author": "30809111+acoates-ms@users.noreply.github.com",
129
+ "package": "@react-native-windows/cli",
130
+ "comment": "Update to typescript 4",
131
+ "commit": "8a0ffecdcf5e68d950f20380fdf62295edb352b6"
132
+ },
133
+ {
134
+ "author": "beachball",
135
+ "package": "@react-native-windows/cli",
136
+ "comment": "Bump @react-native-windows/package-utils to v0.0.0-canary.22",
137
+ "commit": "8a0ffecdcf5e68d950f20380fdf62295edb352b6"
138
+ },
139
+ {
140
+ "author": "beachball",
141
+ "package": "@react-native-windows/cli",
142
+ "comment": "Bump @react-native-windows/telemetry to v0.0.0-canary.24",
143
+ "commit": "8a0ffecdcf5e68d950f20380fdf62295edb352b6"
144
+ }
145
+ ]
146
+ }
147
+ },
148
+ {
149
+ "date": "Sat, 09 Oct 2021 05:06:48 GMT",
150
+ "tag": "@react-native-windows/cli_v0.0.0-canary.94",
151
+ "version": "0.0.0-canary.94",
152
+ "comments": {
153
+ "prerelease": [
25
154
  {
26
- "comment": "Promote 0.66 to latest",
27
155
  "author": "ngerlem@microsoft.com",
28
- "commit": "5d1e5ae98139204e02f0ac5d8c06ae7ee1157395",
156
+ "package": "@react-native-windows/cli",
157
+ "comment": "Integrate 10-8-21 Nightly Build",
158
+ "commit": "db9fd0f1192d6340c5e766ac2630fc182c99de4f"
159
+ }
160
+ ]
161
+ }
162
+ },
163
+ {
164
+ "date": "Wed, 06 Oct 2021 05:07:05 GMT",
165
+ "tag": "@react-native-windows/cli_v0.0.0-canary.93",
166
+ "version": "0.0.0-canary.93",
167
+ "comments": {
168
+ "prerelease": [
169
+ {
170
+ "comment": "Use full path to powershell.exe",
171
+ "author": "asklar@microsoft.com",
172
+ "commit": "f881f033a0d286a9c1df596c8ea3644c41ea9e8f",
29
173
  "package": "@react-native-windows/cli"
30
174
  }
31
175
  ]
32
176
  }
33
177
  },
34
178
  {
35
- "date": "Mon, 04 Oct 2021 15:07:37 GMT",
36
- "tag": "@react-native-windows/cli_v0.66.0-preview.2",
37
- "version": "0.66.0-preview.2",
179
+ "date": "Tue, 05 Oct 2021 05:07:00 GMT",
180
+ "tag": "@react-native-windows/cli_v0.0.0-canary.92",
181
+ "version": "0.0.0-canary.92",
38
182
  "comments": {
39
183
  "prerelease": [
40
184
  {
41
- "comment": "Bump the version of xmldom used by @react-native-windows/cli to 0.7.0.",
185
+ "comment": "CLI: Default to deploy by layout",
186
+ "author": "jthysell@microsoft.com",
187
+ "commit": "afb7054ff284e62884bcf987d8a494326aadb8c5",
188
+ "package": "@react-native-windows/cli"
189
+ }
190
+ ]
191
+ }
192
+ },
193
+ {
194
+ "date": "Thu, 30 Sep 2021 05:06:48 GMT",
195
+ "tag": "@react-native-windows/cli_v0.0.0-canary.91",
196
+ "version": "0.0.0-canary.91",
197
+ "comments": {
198
+ "prerelease": [
199
+ {
200
+ "comment": "Bump xmldom to 0.7.0 in @react-native-windows/cli.",
42
201
  "author": "yicyao@microsoft.com",
43
- "commit": "01a6593618fced097e73847c519f7f9585fac76a",
202
+ "commit": "58c1fb59eaebbf496915921062540b963aff3685",
203
+ "package": "@react-native-windows/cli"
204
+ }
205
+ ]
206
+ }
207
+ },
208
+ {
209
+ "date": "Wed, 29 Sep 2021 05:06:54 GMT",
210
+ "tag": "@react-native-windows/cli_v0.0.0-canary.90",
211
+ "version": "0.0.0-canary.90",
212
+ "comments": {
213
+ "prerelease": [
214
+ {
215
+ "comment": "Make CLI Fail Gracefully on Dep Script Errors",
216
+ "author": "ngerlem@microsoft.com",
217
+ "commit": "3bac02eb67a31b7060cfa8541a013055f87eb7b4",
218
+ "package": "@react-native-windows/cli"
219
+ }
220
+ ]
221
+ }
222
+ },
223
+ {
224
+ "date": "Thu, 23 Sep 2021 05:06:48 GMT",
225
+ "tag": "@react-native-windows/cli_v0.0.0-canary.89",
226
+ "version": "0.0.0-canary.89",
227
+ "comments": {
228
+ "prerelease": [
229
+ {
230
+ "comment": "Remove Certificate From Template",
231
+ "author": "34109996+chiaramooney@users.noreply.github.com",
232
+ "commit": "3813907b2eaa6198f0a8b9dc570075f0c7117301",
44
233
  "package": "@react-native-windows/cli"
45
234
  }
46
235
  ]
47
236
  }
48
237
  },
49
238
  {
50
- "date": "Fri, 03 Sep 2021 18:48:19 GMT",
51
- "tag": "@react-native-windows/cli_v0.66.0-preview.1",
52
- "version": "0.66.0-preview.1",
239
+ "date": "Wed, 22 Sep 2021 05:06:43 GMT",
240
+ "tag": "@react-native-windows/cli_v0.0.0-canary.88",
241
+ "version": "0.0.0-canary.88",
242
+ "comments": {
243
+ "none": [
244
+ {
245
+ "comment": "fix(deploy): broken projectName override for deployToDevice",
246
+ "author": "ali-hk@users.noreply.github.com",
247
+ "commit": "0bc36a30ab3cd5bb4cfd767e503b29c185cfcddd",
248
+ "package": "@react-native-windows/cli"
249
+ }
250
+ ]
251
+ }
252
+ },
253
+ {
254
+ "date": "Fri, 17 Sep 2021 05:06:53 GMT",
255
+ "tag": "@react-native-windows/cli_v0.0.0-canary.88",
256
+ "version": "0.0.0-canary.88",
53
257
  "comments": {
54
258
  "prerelease": [
55
259
  {
56
- "comment": "Promote 0.66 to preview",
260
+ "comment": "Fixed CLI options defaults",
261
+ "author": "jthysell@microsoft.com",
262
+ "commit": "5bdad2322e65162a67b8ffd85a514da733a07033",
263
+ "package": "@react-native-windows/cli"
264
+ }
265
+ ]
266
+ }
267
+ },
268
+ {
269
+ "date": "Wed, 15 Sep 2021 05:07:04 GMT",
270
+ "tag": "@react-native-windows/cli_v0.0.0-canary.87",
271
+ "version": "0.0.0-canary.87",
272
+ "comments": {
273
+ "prerelease": [
274
+ {
275
+ "comment": "Better handle spaces in project path",
276
+ "author": "30809111+acoates-ms@users.noreply.github.com",
277
+ "commit": "0ebefa655f7adbcc65f8f3136870094762acd3a9",
278
+ "package": "@react-native-windows/cli"
279
+ }
280
+ ]
281
+ }
282
+ },
283
+ {
284
+ "date": "Tue, 14 Sep 2021 05:07:02 GMT",
285
+ "tag": "@react-native-windows/cli_v0.0.0-canary.86",
286
+ "version": "0.0.0-canary.86",
287
+ "comments": {
288
+ "prerelease": [
289
+ {
290
+ "comment": "Fix autolinking to respect WinUI2xVersion or WinUI3Version set in ExperimentalFeatures.props",
291
+ "author": "jthysell@microsoft.com",
292
+ "commit": "d3de4a2b04415ff9004b7ba08ee21787b924d0d4",
293
+ "package": "@react-native-windows/cli"
294
+ }
295
+ ]
296
+ }
297
+ },
298
+ {
299
+ "date": "Wed, 08 Sep 2021 05:08:53 GMT",
300
+ "tag": "@react-native-windows/cli_v0.0.0-canary.85",
301
+ "version": "0.0.0-canary.85",
302
+ "comments": {
303
+ "prerelease": [
304
+ {
305
+ "comment": "Set consistent node requirements on our packages",
306
+ "author": "ngerlem@microsoft.com",
307
+ "commit": "2974ea0ab58b546264b8d9a4a7c12ceeb0a02851",
308
+ "package": "@react-native-windows/cli"
309
+ },
310
+ {
311
+ "comment": "Fix autolinking to support solution files using LF instead of CRLF",
312
+ "author": "jthysell@microsoft.com",
313
+ "commit": "5cfeb6d32ff49f3462a8ee3ce5bc17abfa062752",
314
+ "package": "@react-native-windows/cli"
315
+ }
316
+ ],
317
+ "patch": [
318
+ {
319
+ "comment": "Bump @rnw-scripts/jest-unittest-config to v1.2.4",
320
+ "author": "ngerlem@microsoft.com",
321
+ "commit": "2974ea0ab58b546264b8d9a4a7c12ceeb0a02851",
322
+ "package": "@react-native-windows/cli"
323
+ },
324
+ {
325
+ "comment": "Bump @rnw-scripts/just-task to v2.2.1",
326
+ "author": "ngerlem@microsoft.com",
327
+ "commit": "2974ea0ab58b546264b8d9a4a7c12ceeb0a02851",
328
+ "package": "@react-native-windows/cli"
329
+ },
330
+ {
331
+ "comment": "Bump @rnw-scripts/ts-config to v2.0.1",
332
+ "author": "ngerlem@microsoft.com",
333
+ "commit": "2974ea0ab58b546264b8d9a4a7c12ceeb0a02851",
334
+ "package": "@react-native-windows/cli"
335
+ },
336
+ {
337
+ "comment": "Bump @rnw-scripts/eslint-config to v1.1.8",
57
338
  "author": "ngerlem@microsoft.com",
58
- "commit": "cf1dcfbe108028869e326bb2bdab370949f7dac8",
339
+ "commit": "2974ea0ab58b546264b8d9a4a7c12ceeb0a02851",
59
340
  "package": "@react-native-windows/cli"
60
341
  }
61
342
  ]
package/CHANGELOG.md CHANGED
@@ -1,40 +1,153 @@
1
1
  # Change Log - @react-native-windows/cli
2
2
 
3
- This log was last generated on Mon, 15 Nov 2021 16:09:26 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 24 Jan 2022 16:12:31 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.66.1
7
+ ## 0.67.0
8
8
 
9
- Mon, 15 Nov 2021 16:09:26 GMT
9
+ Mon, 24 Jan 2022 16:12:31 GMT
10
10
 
11
11
  ### Patches
12
12
 
13
- - [0.66] Fix autolinking to support solution files using LF instead of CRLF (jthysell@microsoft.com)
13
+ - [0.67] Remove ADO NuGet feed from config for new projects (jthysell@microsoft.com)
14
+ - Promote 0.67 to latest (ngerlem@microsoft.com)
15
+ - Bump @react-native-windows/package-utils to v0.67.0
16
+ - Bump @react-native-windows/telemetry to v0.67.0
14
17
 
15
- ## 0.66.0
18
+ ## 0.67.0-preview.2
16
19
 
17
- Mon, 11 Oct 2021 15:07:19 GMT
20
+ Tue, 09 Nov 2021 01:12:34 GMT
18
21
 
19
- ### Patches
22
+ ### Changes
23
+
24
+ - Upgrade WinUI/MUX to 2.7 (jthysell@microsoft.com)
25
+
26
+ ## 0.67.0-preview.2
27
+
28
+ Tue, 09 Nov 2021 01:12:18 GMT
29
+
30
+ ### Changes
31
+
32
+ - Upgrade WinUI/MUX to 2.7 (jthysell@microsoft.com)
33
+
34
+ ## 0.67.0-preview.1
35
+
36
+ Mon, 25 Oct 2021 15:07:48 GMT
37
+
38
+ ### Changes
39
+
40
+ - Promote 0.67 to preview (ngerlem@microsoft.com)
41
+ - Bump @react-native-windows/package-utils to v0.67.0-preview.1
42
+ - Bump @react-native-windows/telemetry to v0.67.0-preview.1
43
+
44
+ ## 0.67.0-preview.1
45
+
46
+ Mon, 25 Oct 2021 15:07:19 GMT
47
+
48
+ ### Changes
20
49
 
21
- - Promote 0.66 to latest (ngerlem@microsoft.com)
50
+ - Promote 0.67 to preview (ngerlem@microsoft.com)
51
+ - Bump @react-native-windows/package-utils to v0.67.0-preview.1
52
+ - Bump @react-native-windows/telemetry to v0.67.0-preview.1
22
53
 
23
- ## 0.66.0-preview.2
54
+ ## 0.0.0-canary.95
24
55
 
25
- Mon, 04 Oct 2021 15:07:37 GMT
56
+ Thu, 21 Oct 2021 05:08:01 GMT
26
57
 
27
58
  ### Changes
28
59
 
29
- - Bump the version of xmldom used by @react-native-windows/cli to 0.7.0. (yicyao@microsoft.com)
60
+ - Update to typescript 4 (30809111+acoates-ms@users.noreply.github.com)
61
+ - Bump @react-native-windows/package-utils to v0.0.0-canary.22
62
+ - Bump @react-native-windows/telemetry to v0.0.0-canary.24
63
+
64
+ ## 0.0.0-canary.94
65
+
66
+ Sat, 09 Oct 2021 05:06:48 GMT
67
+
68
+ ### Changes
69
+
70
+ - Integrate 10-8-21 Nightly Build (ngerlem@microsoft.com)
71
+
72
+ ## 0.0.0-canary.93
73
+
74
+ Wed, 06 Oct 2021 05:07:05 GMT
75
+
76
+ ### Changes
77
+
78
+ - Use full path to powershell.exe (asklar@microsoft.com)
79
+
80
+ ## 0.0.0-canary.92
81
+
82
+ Tue, 05 Oct 2021 05:07:00 GMT
83
+
84
+ ### Changes
85
+
86
+ - CLI: Default to deploy by layout (jthysell@microsoft.com)
87
+
88
+ ## 0.0.0-canary.91
30
89
 
31
- ## 0.66.0-preview.1
90
+ Thu, 30 Sep 2021 05:06:48 GMT
91
+
92
+ ### Changes
93
+
94
+ - Bump xmldom to 0.7.0 in @react-native-windows/cli. (yicyao@microsoft.com)
95
+
96
+ ## 0.0.0-canary.90
97
+
98
+ Wed, 29 Sep 2021 05:06:54 GMT
99
+
100
+ ### Changes
101
+
102
+ - Make CLI Fail Gracefully on Dep Script Errors (ngerlem@microsoft.com)
103
+
104
+ ## 0.0.0-canary.89
105
+
106
+ Thu, 23 Sep 2021 05:06:48 GMT
107
+
108
+ ### Changes
109
+
110
+ - Remove Certificate From Template (34109996+chiaramooney@users.noreply.github.com)
111
+
112
+ ## 0.0.0-canary.88
113
+
114
+ Fri, 17 Sep 2021 05:06:53 GMT
115
+
116
+ ### Changes
117
+
118
+ - Fixed CLI options defaults (jthysell@microsoft.com)
119
+
120
+ ## 0.0.0-canary.87
121
+
122
+ Wed, 15 Sep 2021 05:07:04 GMT
123
+
124
+ ### Changes
125
+
126
+ - Better handle spaces in project path (30809111+acoates-ms@users.noreply.github.com)
127
+
128
+ ## 0.0.0-canary.86
129
+
130
+ Tue, 14 Sep 2021 05:07:02 GMT
131
+
132
+ ### Changes
133
+
134
+ - Fix autolinking to respect WinUI2xVersion or WinUI3Version set in ExperimentalFeatures.props (jthysell@microsoft.com)
135
+
136
+ ## 0.0.0-canary.85
137
+
138
+ Wed, 08 Sep 2021 05:08:53 GMT
139
+
140
+ ### Patches
32
141
 
33
- Fri, 03 Sep 2021 18:48:19 GMT
142
+ - Bump @rnw-scripts/jest-unittest-config to v1.2.4 (ngerlem@microsoft.com)
143
+ - Bump @rnw-scripts/just-task to v2.2.1 (ngerlem@microsoft.com)
144
+ - Bump @rnw-scripts/ts-config to v2.0.1 (ngerlem@microsoft.com)
145
+ - Bump @rnw-scripts/eslint-config to v1.1.8 (ngerlem@microsoft.com)
34
146
 
35
147
  ### Changes
36
148
 
37
- - Promote 0.66 to preview (ngerlem@microsoft.com)
149
+ - Set consistent node requirements on our packages (ngerlem@microsoft.com)
150
+ - Fix autolinking to support solution files using LF instead of CRLF (jthysell@microsoft.com)
38
151
 
39
152
  ## 0.0.0-canary.84
40
153
 
@@ -1 +1 @@
1
- {"version":3,"file":"configUtils.js","sourceRoot":"","sources":["../../src/config/configUtils.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CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,WAAW,CAAC;KAC1D;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AApBD,0DAoBC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport glob from 'glob';\n\nimport {DOMParser} from '@xmldom/xmldom';\nimport xpath from 'xpath';\nimport {CodedError} from '@react-native-windows/telemetry';\n\nconst msbuildSelect = xpath.useNamespaces({\n msbuild: 'http://schemas.microsoft.com/developer/msbuild/2003',\n});\n\n/**\n * Search for files matching the pattern under the target folder.\n * @param folder The absolute path to target folder.\n * @param filenamePattern The pattern to search for.\n * @return Return the array of relative file paths.\n */\nexport function findFiles(folder: string, filenamePattern: string): string[] {\n const files = glob.sync(path.join('**', filenamePattern), {\n cwd: folder,\n ignore: [\n 'node_modules/**',\n '**/Debug/**',\n '**/Release/**',\n '**/Generated Files/**',\n '**/packages/**',\n ],\n });\n\n return files;\n}\n\n/**\n * Search for the windows sub-folder under the target folder.\n * @param folder The absolute path to the target folder.\n * @return The absolute path to the windows folder, if it exists.\n */\nexport function findWindowsFolder(folder: string): string | null {\n const winDir = 'windows';\n const joinedDir = path.join(folder, winDir);\n if (fs.existsSync(joinedDir)) {\n return joinedDir;\n }\n\n return null;\n}\n\n/**\n * Checks if the target file path is a RNW solution file by checking if it contains the string \"ReactNative\".\n * @param filePath The absolute file path to check.\n * @return Whether the path is to a RNW solution file.\n */\nexport function isRnwSolution(filePath: string): boolean {\n return (\n fs\n .readFileSync(filePath)\n .toString()\n .search(/ReactNative/) > 0\n );\n}\n\n/**\n * Search for the RNW solution files under the target folder.\n * @param winFolder The absolute path to target folder.\n * @return Return the array of relative file paths.\n */\nexport function findSolutionFiles(winFolder: string): string[] {\n // First search for all potential solution files\n const allSolutions = findFiles(winFolder, '*.sln');\n\n if (allSolutions.length === 0) {\n // If there're no solution files, return 0\n return [];\n } else if (allSolutions.length === 1) {\n // If there is exactly one solution file, assume it's it\n return [allSolutions[0]];\n }\n\n const solutionFiles = [];\n\n // Try to find any solution file that appears to be a React Native solution\n for (const solutionFile of allSolutions) {\n if (isRnwSolution(path.join(winFolder, solutionFile))) {\n solutionFiles.push(path.normalize(solutionFile));\n }\n }\n\n return solutionFiles;\n}\n\n/**\n * Checks if the target file path is a RNW lib project file.\n * @param filePath The absolute file path to check.\n * @return Whether the path is to a RNW lib project file.\n */\nexport function isRnwDependencyProject(filePath: string): boolean {\n const projectContents = readProjectFile(filePath);\n\n const projectLang = getProjectLanguage(filePath);\n if (projectLang === 'cs') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CSharpLib.targets',\n );\n } else if (projectLang === 'cpp') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CppLib.targets',\n );\n }\n\n return false;\n}\n\n/**\n * Search for the RNW lib project files under the target folder.\n * @param winFolder The absolute path to target folder.\n * @return Return the array of relative file paths.\n */\nexport function findDependencyProjectFiles(winFolder: string): string[] {\n // First, search for all potential project files\n const allCppProj = findFiles(winFolder, '*.vcxproj');\n const allCsProj = findFiles(winFolder, '*.csproj');\n\n const allProjects = allCppProj.concat(allCsProj);\n\n if (allProjects.length === 0) {\n // If there're no project files, return 0\n return [];\n }\n\n const dependencyProjectFiles = [];\n\n // Try to find any project file that appears to be a dependency project\n for (const projectFile of allProjects) {\n // A project is marked as a RNW dependency iff either:\n // - If the project has the standard native module imports, or\n // - If we only have a single project (and it doesn't have the standard native module imports),\n // pick it and hope for the best. This enables autolinking for modules that were written\n // before the standard native module template existed.\n if (\n allProjects.length === 1 ||\n isRnwDependencyProject(path.join(winFolder, projectFile))\n ) {\n dependencyProjectFiles.push(path.normalize(projectFile));\n }\n }\n\n return dependencyProjectFiles;\n}\n\n/**\n * Checks if the target file path is a RNW app project file.\n * @param filePath The absolute file path to check.\n * @return Whether the path is to a RNW app project file.\n */\nfunction isRnwAppProject(filePath: string): boolean {\n const projectContents = readProjectFile(filePath);\n\n const projectLang = getProjectLanguage(filePath);\n if (projectLang === 'cs') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CSharpApp.targets',\n );\n } else if (projectLang === 'cpp') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CppApp.targets',\n );\n }\n\n return false;\n}\n\n/**\n * Search for the RNW app project files under the target folder.\n * @param winFolder The absolute path to target folder.\n * @return Return the array of relative file paths.\n */\nexport function findAppProjectFiles(winFolder: string): string[] {\n // First, search for all potential project files\n const allCppProj = findFiles(winFolder, '*.vcxproj');\n const allCsProj = findFiles(winFolder, '*.csproj');\n\n const allProjects = allCppProj.concat(allCsProj);\n\n if (allProjects.length === 0) {\n // If there're no project files, return 0\n return [];\n }\n\n const appProjectFiles = [];\n\n // Try to find any project file that appears to be an app project\n for (const projectFile of allProjects) {\n if (isRnwAppProject(path.join(winFolder, projectFile))) {\n appProjectFiles.push(path.normalize(projectFile));\n }\n }\n\n return appProjectFiles;\n}\n\n/**\n * Returns the programming language of the project file.\n * @param projectPath The project file path to check.\n * @return The language string: cpp, cs, or null if unknown.\n */\nexport function getProjectLanguage(projectPath: string): 'cpp' | 'cs' | null {\n if (projectPath.endsWith('.vcxproj')) {\n return 'cpp';\n } else if (projectPath.endsWith('.csproj')) {\n return 'cs';\n }\n\n return null;\n}\n\n/**\n * Reads in the contents of the target project file.\n * @param projectPath The target project file path.\n * @return The project file contents.\n */\nexport function readProjectFile(projectPath: string) {\n const projectContents = fs.readFileSync(projectPath, 'utf8').toString();\n return new DOMParser().parseFromString(projectContents, 'application/xml');\n}\n\n/**\n * Search for the given property in the project contents and return its value.\n * @param projectContents The XML project contents.\n * @param propertyName The property to look for.\n * @return The value of the tag if it exists.\n */\nexport function tryFindPropertyValue(\n projectContents: Node,\n propertyName: string,\n): string | null {\n const nodes = msbuildSelect(\n `//msbuild:PropertyGroup/msbuild:${propertyName}`,\n projectContents,\n );\n\n if (nodes.length > 0) {\n // Take the last one\n return (nodes[nodes.length - 1] as Node).textContent;\n }\n\n return null;\n}\n\nexport function findPropertyValue(\n projectContents: Node,\n propertyName: string,\n filePath: string,\n): string {\n const res = tryFindPropertyValue(projectContents, propertyName);\n if (!res) {\n throw new CodedError(\n 'NoPropertyInProject',\n `Couldn't find property ${propertyName} from ${filePath}`,\n {propertyName: propertyName},\n );\n }\n return res;\n}\n\n/**\n * Search for the given import project in the project contents and return if it exists.\n * @param projectContents The XML project contents.\n * @param projectName The project to look for.\n * @return If the target exists.\n */\nexport function importProjectExists(\n projectContents: Node,\n projectName: string,\n): boolean {\n const nodes = msbuildSelect(\n `//msbuild:Import[contains(@Project,'${projectName}')]`,\n projectContents,\n );\n\n return nodes.length > 0;\n}\n\nexport type ConfigurationType =\n | 'application'\n | 'dynamiclibrary'\n | 'generic'\n | 'staticlibrary'\n | 'unknown';\n\n/**\n * Gets the configuration type of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project configuration type.\n */\nexport function getConfigurationType(projectContents: Node): ConfigurationType {\n const configurationType = tryFindPropertyValue(\n projectContents,\n 'ConfigurationType',\n )?.toLowerCase();\n\n switch (configurationType) {\n case 'application':\n case 'dynamiclibrary':\n case 'generic':\n case 'staticlibrary':\n return configurationType;\n\n default:\n return 'unknown';\n }\n}\n\nexport type OutputType =\n | 'appcontainerexe'\n | 'exe'\n | 'library'\n | 'module'\n | 'unknown'\n | 'winexe'\n | 'winmdobj';\n\n/**\n * Gets the output type of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project output type.\n */\nexport function getOutputType(projectContents: Node): OutputType {\n const outputType = tryFindPropertyValue(\n projectContents,\n 'OutputType',\n )?.toLowerCase();\n\n switch (outputType) {\n case 'appcontainerexe':\n case 'exe':\n case 'library':\n case 'module':\n case 'winexe':\n case 'winmdobj':\n return outputType;\n\n default:\n return 'unknown';\n }\n}\n\n/**\n * Gets the type of the project from the project contents.\n * @param projectPath The project file path to check.\n * @param projectContents The XML project contents.\n * @return The project type.\n */\nexport function getProjectType(\n projectPath: string,\n projectContents: Node,\n): ConfigurationType | OutputType {\n switch (getProjectLanguage(projectPath)) {\n case 'cpp':\n return getConfigurationType(projectContents);\n\n case 'cs':\n return getOutputType(projectContents);\n\n default:\n return 'unknown';\n }\n}\n\n/**\n * Gets the name of the project from the project contents.\n * @param projectPath The project file path to check.\n * @param projectContents The XML project contents.\n * @return The project name.\n */\nexport function getProjectName(\n projectPath: string,\n projectContents: Node,\n): string {\n const name =\n tryFindPropertyValue(projectContents, 'ProjectName') ||\n path.parse(projectPath).name ||\n '';\n\n return name;\n}\n\n/**\n * Gets the namespace of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project namespace.\n */\nexport function getProjectNamespace(projectContents: Node): string | null {\n return tryFindPropertyValue(projectContents, 'RootNamespace');\n}\n\n/**\n * Gets the guid of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project guid.\n */\nexport function getProjectGuid(projectContents: Node): string | null {\n return tryFindPropertyValue(projectContents, 'ProjectGuid');\n}\n\nexport function getExperimentalFeatures(\n solutionDir: string,\n): Record<string, string> | undefined {\n const propsFile = path.join(solutionDir, 'ExperimentalFeatures.props');\n\n if (!fs.existsSync(propsFile)) {\n return undefined;\n }\n\n const result: Record<string, any> = {};\n const propsContents = readProjectFile(propsFile);\n const nodes = msbuildSelect(\n `//msbuild:PropertyGroup/msbuild:*`,\n propsContents,\n );\n for (const node of nodes) {\n const propertyNode = node as Node;\n result[propertyNode.nodeName] = propertyNode.textContent;\n }\n return result;\n}\n"]}
1
+ {"version":3,"file":"configUtils.js","sourceRoot":"","sources":["../../src/config/configUtils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AAExB,2CAAyC;AACzC,kDAA0B;AAC1B,+DAA2D;AAE3D,MAAM,aAAa,GAAG,eAAK,CAAC,aAAa,CAAC;IACxC,OAAO,EAAE,qDAAqD;CAC/D,CAAC,CAAC;AAEH;;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O,SAAS,CAAC;KACpB;AACH,CAAC;AAdD,wCAcC;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAC5B,WAAmB,EACnB,eAAqB;IAErB,MAAM,IAAI,GACR,oBAAoB,CAAC,eAAe,EAAE,aAAa,CAAC;QACpD,cAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI;QAC5B,EAAE,CAAC;IAEL,OAAO,IAAI,CAAC;AACd,CAAC;AAVD,wCAUC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,eAAqB;IACvD,OAAO,oBAAoB,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;AAChE,CAAC;AAFD,kDAEC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAAC,eAAqB;IAClD,OAAO,oBAAoB,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;AAC9D,CAAC;AAFD,wCAEC;AAED,SAAgB,uBAAuB,CACrC,WAAmB;IAEnB,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,4BAA4B,CAAC,CAAC;IAEvE,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QAC7B,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,MAAM,aAAa,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,aAAa,CACzB,mCAAmC,EACnC,aAAa,CACd,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,YAAY,GAAG,IAAY,CAAC;QAClC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,WAAW,CAAC;KAC1D;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AApBD,0DAoBC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport glob from 'glob';\n\nimport {DOMParser} from '@xmldom/xmldom';\nimport xpath from 'xpath';\nimport {CodedError} from '@react-native-windows/telemetry';\n\nconst msbuildSelect = xpath.useNamespaces({\n msbuild: 'http://schemas.microsoft.com/developer/msbuild/2003',\n});\n\n/**\n * Search for files matching the pattern under the target folder.\n * @param folder The absolute path to target folder.\n * @param filenamePattern The pattern to search for.\n * @return Return the array of relative file paths.\n */\nexport function findFiles(folder: string, filenamePattern: string): string[] {\n const files = glob.sync(path.join('**', filenamePattern), {\n cwd: folder,\n ignore: [\n 'node_modules/**',\n '**/Debug/**',\n '**/Release/**',\n '**/Generated Files/**',\n '**/packages/**',\n ],\n });\n\n return files;\n}\n\n/**\n * Search for the windows sub-folder under the target folder.\n * @param folder The absolute path to the target folder.\n * @return The absolute path to the windows folder, if it exists.\n */\nexport function findWindowsFolder(folder: string): string | null {\n const winDir = 'windows';\n const joinedDir = path.join(folder, winDir);\n if (fs.existsSync(joinedDir)) {\n return joinedDir;\n }\n\n return null;\n}\n\n/**\n * Checks if the target file path is a RNW solution file by checking if it contains the string \"ReactNative\".\n * @param filePath The absolute file path to check.\n * @return Whether the path is to a RNW solution file.\n */\nexport function isRnwSolution(filePath: string): boolean {\n return (\n fs\n .readFileSync(filePath)\n .toString()\n .search(/ReactNative/) > 0\n );\n}\n\n/**\n * Search for the RNW solution files under the target folder.\n * @param winFolder The absolute path to target folder.\n * @return Return the array of relative file paths.\n */\nexport function findSolutionFiles(winFolder: string): string[] {\n // First search for all potential solution files\n const allSolutions = findFiles(winFolder, '*.sln');\n\n if (allSolutions.length === 0) {\n // If there're no solution files, return 0\n return [];\n } else if (allSolutions.length === 1) {\n // If there is exactly one solution file, assume it's it\n return [allSolutions[0]];\n }\n\n const solutionFiles = [];\n\n // Try to find any solution file that appears to be a React Native solution\n for (const solutionFile of allSolutions) {\n if (isRnwSolution(path.join(winFolder, solutionFile))) {\n solutionFiles.push(path.normalize(solutionFile));\n }\n }\n\n return solutionFiles;\n}\n\n/**\n * Checks if the target file path is a RNW lib project file.\n * @param filePath The absolute file path to check.\n * @return Whether the path is to a RNW lib project file.\n */\nexport function isRnwDependencyProject(filePath: string): boolean {\n const projectContents = readProjectFile(filePath);\n\n const projectLang = getProjectLanguage(filePath);\n if (projectLang === 'cs') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CSharpLib.targets',\n );\n } else if (projectLang === 'cpp') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CppLib.targets',\n );\n }\n\n return false;\n}\n\n/**\n * Search for the RNW lib project files under the target folder.\n * @param winFolder The absolute path to target folder.\n * @return Return the array of relative file paths.\n */\nexport function findDependencyProjectFiles(winFolder: string): string[] {\n // First, search for all potential project files\n const allCppProj = findFiles(winFolder, '*.vcxproj');\n const allCsProj = findFiles(winFolder, '*.csproj');\n\n const allProjects = allCppProj.concat(allCsProj);\n\n if (allProjects.length === 0) {\n // If there're no project files, return 0\n return [];\n }\n\n const dependencyProjectFiles = [];\n\n // Try to find any project file that appears to be a dependency project\n for (const projectFile of allProjects) {\n // A project is marked as a RNW dependency iff either:\n // - If the project has the standard native module imports, or\n // - If we only have a single project (and it doesn't have the standard native module imports),\n // pick it and hope for the best. This enables autolinking for modules that were written\n // before the standard native module template existed.\n if (\n allProjects.length === 1 ||\n isRnwDependencyProject(path.join(winFolder, projectFile))\n ) {\n dependencyProjectFiles.push(path.normalize(projectFile));\n }\n }\n\n return dependencyProjectFiles;\n}\n\n/**\n * Checks if the target file path is a RNW app project file.\n * @param filePath The absolute file path to check.\n * @return Whether the path is to a RNW app project file.\n */\nfunction isRnwAppProject(filePath: string): boolean {\n const projectContents = readProjectFile(filePath);\n\n const projectLang = getProjectLanguage(filePath);\n if (projectLang === 'cs') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CSharpApp.targets',\n );\n } else if (projectLang === 'cpp') {\n return importProjectExists(\n projectContents,\n 'Microsoft.ReactNative.Uwp.CppApp.targets',\n );\n }\n\n return false;\n}\n\n/**\n * Search for the RNW app project files under the target folder.\n * @param winFolder The absolute path to target folder.\n * @return Return the array of relative file paths.\n */\nexport function findAppProjectFiles(winFolder: string): string[] {\n // First, search for all potential project files\n const allCppProj = findFiles(winFolder, '*.vcxproj');\n const allCsProj = findFiles(winFolder, '*.csproj');\n\n const allProjects = allCppProj.concat(allCsProj);\n\n if (allProjects.length === 0) {\n // If there're no project files, return 0\n return [];\n }\n\n const appProjectFiles = [];\n\n // Try to find any project file that appears to be an app project\n for (const projectFile of allProjects) {\n if (isRnwAppProject(path.join(winFolder, projectFile))) {\n appProjectFiles.push(path.normalize(projectFile));\n }\n }\n\n return appProjectFiles;\n}\n\n/**\n * Returns the programming language of the project file.\n * @param projectPath The project file path to check.\n * @return The language string: cpp, cs, or null if unknown.\n */\nexport function getProjectLanguage(projectPath: string): 'cpp' | 'cs' | null {\n if (projectPath.endsWith('.vcxproj')) {\n return 'cpp';\n } else if (projectPath.endsWith('.csproj')) {\n return 'cs';\n }\n\n return null;\n}\n\n/**\n * Reads in the contents of the target project file.\n * @param projectPath The target project file path.\n * @return The project file contents.\n */\nexport function readProjectFile(projectPath: string) {\n const projectContents = fs.readFileSync(projectPath, 'utf8').toString();\n return new DOMParser().parseFromString(projectContents, 'application/xml');\n}\n\n/**\n * Search for the given property in the project contents and return its value.\n * @param projectContents The XML project contents.\n * @param propertyName The property to look for.\n * @return The value of the tag if it exists.\n */\nexport function tryFindPropertyValue(\n projectContents: Node,\n propertyName: string,\n): string | null {\n const nodes = msbuildSelect(\n `//msbuild:PropertyGroup/msbuild:${propertyName}`,\n projectContents,\n );\n\n if (nodes.length > 0) {\n // Take the last one\n return (nodes[nodes.length - 1] as Node).textContent;\n }\n\n return null;\n}\n\nexport function findPropertyValue(\n projectContents: Node,\n propertyName: string,\n filePath: string,\n): string {\n const res = tryFindPropertyValue(projectContents, propertyName);\n if (!res) {\n throw new CodedError(\n 'NoPropertyInProject',\n `Couldn't find property ${propertyName} from ${filePath}`,\n {propertyName: propertyName},\n );\n }\n return res;\n}\n\n/**\n * Search for the given import project in the project contents and return if it exists.\n * @param projectContents The XML project contents.\n * @param projectName The project to look for.\n * @return If the target exists.\n */\nexport function importProjectExists(\n projectContents: Node,\n projectName: string,\n): boolean {\n const nodes = msbuildSelect(\n `//msbuild:Import[contains(@Project,'${projectName}')]`,\n projectContents,\n );\n\n return nodes.length > 0;\n}\n\nexport type ConfigurationType =\n | 'application'\n | 'dynamiclibrary'\n | 'generic'\n | 'staticlibrary'\n | 'unknown';\n\n/**\n * Gets the configuration type of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project configuration type.\n */\nexport function getConfigurationType(projectContents: Node): ConfigurationType {\n const configurationType = tryFindPropertyValue(\n projectContents,\n 'ConfigurationType',\n )?.toLowerCase();\n\n switch (configurationType) {\n case 'application':\n case 'dynamiclibrary':\n case 'generic':\n case 'staticlibrary':\n return configurationType;\n\n default:\n return 'unknown';\n }\n}\n\nexport type OutputType =\n | 'appcontainerexe'\n | 'exe'\n | 'library'\n | 'module'\n | 'unknown'\n | 'winexe'\n | 'winmdobj';\n\n/**\n * Gets the output type of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project output type.\n */\nexport function getOutputType(projectContents: Node): OutputType {\n const outputType = tryFindPropertyValue(\n projectContents,\n 'OutputType',\n )?.toLowerCase();\n\n switch (outputType) {\n case 'appcontainerexe':\n case 'exe':\n case 'library':\n case 'module':\n case 'winexe':\n case 'winmdobj':\n return outputType;\n\n default:\n return 'unknown';\n }\n}\n\n/**\n * Gets the type of the project from the project contents.\n * @param projectPath The project file path to check.\n * @param projectContents The XML project contents.\n * @return The project type.\n */\nexport function getProjectType(\n projectPath: string,\n projectContents: Node,\n): ConfigurationType | OutputType {\n switch (getProjectLanguage(projectPath)) {\n case 'cpp':\n return getConfigurationType(projectContents);\n\n case 'cs':\n return getOutputType(projectContents);\n\n default:\n return 'unknown';\n }\n}\n\n/**\n * Gets the name of the project from the project contents.\n * @param projectPath The project file path to check.\n * @param projectContents The XML project contents.\n * @return The project name.\n */\nexport function getProjectName(\n projectPath: string,\n projectContents: Node,\n): string {\n const name =\n tryFindPropertyValue(projectContents, 'ProjectName') ||\n path.parse(projectPath).name ||\n '';\n\n return name;\n}\n\n/**\n * Gets the namespace of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project namespace.\n */\nexport function getProjectNamespace(projectContents: Node): string | null {\n return tryFindPropertyValue(projectContents, 'RootNamespace');\n}\n\n/**\n * Gets the guid of the project from the project contents.\n * @param projectContents The XML project contents.\n * @return The project guid.\n */\nexport function getProjectGuid(projectContents: Node): string | null {\n return tryFindPropertyValue(projectContents, 'ProjectGuid');\n}\n\nexport function getExperimentalFeatures(\n solutionDir: string,\n): Record<string, string> | undefined {\n const propsFile = path.join(solutionDir, 'ExperimentalFeatures.props');\n\n if (!fs.existsSync(propsFile)) {\n return undefined;\n }\n\n const result: Record<string, any> = {};\n const propsContents = readProjectFile(propsFile);\n const nodes = msbuildSelect(\n `//msbuild:PropertyGroup/msbuild:*`,\n propsContents,\n );\n for (const node of nodes) {\n const propertyNode = node as Node;\n result[propertyNode.nodeName] = propertyNode.textContent;\n }\n return result;\n}\n"]}
@@ -19,7 +19,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
19
19
  var __importStar = (this && this.__importStar) || function (mod) {
20
20
  if (mod && mod.__esModule) return mod;
21
21
  var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
23
  __setModuleDefault(result, mod);
24
24
  return result;
25
25
  };
@@ -43,7 +43,7 @@ const configUtils = __importStar(require("./configUtils"));
43
43
  // Disabled due to existing high cyclomatic complexity
44
44
  // eslint-disable-next-line complexity
45
45
  function dependencyConfigWindows(folder, userConfig = {}) {
46
- if (os_1.platform() !== 'win32') {
46
+ if ((0, os_1.platform)() !== 'win32') {
47
47
  return null;
48
48
  }
49
49
  if (userConfig === null) {