@pnp/cli-microsoft365-spfx-toolkit 1.10.0 → 1.11.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.
- package/.eslintcache +1 -1
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +646 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.23.0.js +21 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +8 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/DependencyRule.js +11 -5
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002021_DEVDEP_rushstack_eslint_config.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002032_DEVDEP_typescript_eslint_parser.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002035_DEVDEP_types_heft_jest.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002036_DEVDEP_types_jest.js +14 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015008_FILE_eslintrc_js.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015016_FILE_eslint_config_js.js +14 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027001_OVERRIDES_rushstack_heft.js +38 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.22.0.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.23.0.js +94 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +25 -7
- package/dist/m365/spfx/commands/spfx-doctor.js +53 -676
- package/dist/utils/packageManager.js +38 -7
- package/npm-shrinkwrap.json +12 -13
- package/package.json +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021009_PKG_overrides_rushstack_heft.js +0 -49
|
@@ -20,6 +20,7 @@ const semver_1 = require("semver");
|
|
|
20
20
|
const formatting_1 = require("../../../utils/formatting");
|
|
21
21
|
const commands_1 = require("../commands");
|
|
22
22
|
const base_project_command_1 = require("./project/base-project-command");
|
|
23
|
+
const SpfxCompatibilityMatrix_1 = require("./SpfxCompatibilityMatrix");
|
|
23
24
|
/**
|
|
24
25
|
* Where to search for the particular npm package: only in the current project,
|
|
25
26
|
* in global packages or both
|
|
@@ -38,16 +39,6 @@ var HandlePromise;
|
|
|
38
39
|
HandlePromise[HandlePromise["Fail"] = 0] = "Fail";
|
|
39
40
|
HandlePromise[HandlePromise["Continue"] = 1] = "Continue";
|
|
40
41
|
})(HandlePromise || (HandlePromise = {}));
|
|
41
|
-
/**
|
|
42
|
-
* Versions of SharePoint that support SharePoint Framework
|
|
43
|
-
*/
|
|
44
|
-
var SharePointVersion;
|
|
45
|
-
(function (SharePointVersion) {
|
|
46
|
-
SharePointVersion[SharePointVersion["SP2016"] = 1] = "SP2016";
|
|
47
|
-
SharePointVersion[SharePointVersion["SP2019"] = 2] = "SP2019";
|
|
48
|
-
SharePointVersion[SharePointVersion["SPO"] = 4] = "SPO";
|
|
49
|
-
SharePointVersion[SharePointVersion["All"] = 7] = "All";
|
|
50
|
-
})(SharePointVersion || (SharePointVersion = {}));
|
|
51
42
|
class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
52
43
|
get allowedOutputs() {
|
|
53
44
|
return ['text', 'json'];
|
|
@@ -61,623 +52,6 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
61
52
|
constructor() {
|
|
62
53
|
super();
|
|
63
54
|
_SpfxDoctorCommand_instances.add(this);
|
|
64
|
-
this.versions = {
|
|
65
|
-
'1.0.0': {
|
|
66
|
-
gulpCli: {
|
|
67
|
-
range: '^1 || ^2',
|
|
68
|
-
fix: 'npm i -g gulp-cli@2'
|
|
69
|
-
},
|
|
70
|
-
node: {
|
|
71
|
-
range: '^6',
|
|
72
|
-
fix: 'Install Node.js v6'
|
|
73
|
-
},
|
|
74
|
-
sp: SharePointVersion.All,
|
|
75
|
-
yo: {
|
|
76
|
-
range: '^3',
|
|
77
|
-
fix: 'npm i -g yo@3'
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
'1.1.0': {
|
|
81
|
-
gulpCli: {
|
|
82
|
-
range: '^1 || ^2',
|
|
83
|
-
fix: 'npm i -g gulp-cli@2'
|
|
84
|
-
},
|
|
85
|
-
node: {
|
|
86
|
-
range: '^6',
|
|
87
|
-
fix: 'Install Node.js v6'
|
|
88
|
-
},
|
|
89
|
-
sp: SharePointVersion.All,
|
|
90
|
-
yo: {
|
|
91
|
-
range: '^3',
|
|
92
|
-
fix: 'npm i -g yo@3'
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
'1.2.0': {
|
|
96
|
-
gulpCli: {
|
|
97
|
-
range: '^1 || ^2',
|
|
98
|
-
fix: 'npm i -g gulp-cli@2'
|
|
99
|
-
},
|
|
100
|
-
node: {
|
|
101
|
-
range: '^6',
|
|
102
|
-
fix: 'Install Node.js v6'
|
|
103
|
-
},
|
|
104
|
-
sp: SharePointVersion.SP2019 | SharePointVersion.SPO,
|
|
105
|
-
yo: {
|
|
106
|
-
range: '^3',
|
|
107
|
-
fix: 'npm i -g yo@3'
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
'1.4.0': {
|
|
111
|
-
gulpCli: {
|
|
112
|
-
range: '^1 || ^2',
|
|
113
|
-
fix: 'npm i -g gulp-cli@2'
|
|
114
|
-
},
|
|
115
|
-
node: {
|
|
116
|
-
range: '^6',
|
|
117
|
-
fix: 'Install Node.js v6'
|
|
118
|
-
},
|
|
119
|
-
sp: SharePointVersion.SP2019 | SharePointVersion.SPO,
|
|
120
|
-
yo: {
|
|
121
|
-
range: '^3',
|
|
122
|
-
fix: 'npm i -g yo@3'
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
'1.4.1': {
|
|
126
|
-
gulpCli: {
|
|
127
|
-
range: '^1 || ^2',
|
|
128
|
-
fix: 'npm i -g gulp-cli@2'
|
|
129
|
-
},
|
|
130
|
-
node: {
|
|
131
|
-
range: '^6 || ^8',
|
|
132
|
-
fix: 'Install Node.js v8'
|
|
133
|
-
},
|
|
134
|
-
sp: SharePointVersion.SP2019 | SharePointVersion.SPO,
|
|
135
|
-
yo: {
|
|
136
|
-
range: '^3',
|
|
137
|
-
fix: 'npm i -g yo@3'
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
'1.5.0': {
|
|
141
|
-
gulpCli: {
|
|
142
|
-
range: '^1 || ^2',
|
|
143
|
-
fix: 'npm i -g gulp-cli@2'
|
|
144
|
-
},
|
|
145
|
-
node: {
|
|
146
|
-
range: '^6 || ^8',
|
|
147
|
-
fix: 'Install Node.js v8'
|
|
148
|
-
},
|
|
149
|
-
sp: SharePointVersion.SPO,
|
|
150
|
-
yo: {
|
|
151
|
-
range: '^3',
|
|
152
|
-
fix: 'npm i -g yo@3'
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
'1.5.1': {
|
|
156
|
-
gulpCli: {
|
|
157
|
-
range: '^1 || ^2',
|
|
158
|
-
fix: 'npm i -g gulp-cli@2'
|
|
159
|
-
},
|
|
160
|
-
node: {
|
|
161
|
-
range: '^6 || ^8',
|
|
162
|
-
fix: 'Install Node.js v8'
|
|
163
|
-
},
|
|
164
|
-
sp: SharePointVersion.SPO,
|
|
165
|
-
yo: {
|
|
166
|
-
range: '^3',
|
|
167
|
-
fix: 'npm i -g yo@3'
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
'1.6.0': {
|
|
171
|
-
gulpCli: {
|
|
172
|
-
range: '^1 || ^2',
|
|
173
|
-
fix: 'npm i -g gulp-cli@2'
|
|
174
|
-
},
|
|
175
|
-
node: {
|
|
176
|
-
range: '^6 || ^8',
|
|
177
|
-
fix: 'Install Node.js v8'
|
|
178
|
-
},
|
|
179
|
-
sp: SharePointVersion.SPO,
|
|
180
|
-
yo: {
|
|
181
|
-
range: '^3',
|
|
182
|
-
fix: 'npm i -g yo@3'
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
'1.7.0': {
|
|
186
|
-
gulpCli: {
|
|
187
|
-
range: '^1 || ^2',
|
|
188
|
-
fix: 'npm i -g gulp-cli@2'
|
|
189
|
-
},
|
|
190
|
-
node: {
|
|
191
|
-
range: '^8',
|
|
192
|
-
fix: 'Install Node.js v8'
|
|
193
|
-
},
|
|
194
|
-
sp: SharePointVersion.SPO,
|
|
195
|
-
yo: {
|
|
196
|
-
range: '^3',
|
|
197
|
-
fix: 'npm i -g yo@3'
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
'1.7.1': {
|
|
201
|
-
gulpCli: {
|
|
202
|
-
range: '^1 || ^2',
|
|
203
|
-
fix: 'npm i -g gulp-cli@2'
|
|
204
|
-
},
|
|
205
|
-
node: {
|
|
206
|
-
range: '^8',
|
|
207
|
-
fix: 'Install Node.js v8'
|
|
208
|
-
},
|
|
209
|
-
sp: SharePointVersion.SPO,
|
|
210
|
-
yo: {
|
|
211
|
-
range: '^3',
|
|
212
|
-
fix: 'npm i -g yo@3'
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
'1.8.0': {
|
|
216
|
-
gulpCli: {
|
|
217
|
-
range: '^1 || ^2',
|
|
218
|
-
fix: 'npm i -g gulp-cli@2'
|
|
219
|
-
},
|
|
220
|
-
node: {
|
|
221
|
-
range: '^8',
|
|
222
|
-
fix: 'Install Node.js v8'
|
|
223
|
-
},
|
|
224
|
-
sp: SharePointVersion.SPO,
|
|
225
|
-
yo: {
|
|
226
|
-
range: '^3',
|
|
227
|
-
fix: 'npm i -g yo@3'
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
'1.8.1': {
|
|
231
|
-
gulpCli: {
|
|
232
|
-
range: '^1 || ^2',
|
|
233
|
-
fix: 'npm i -g gulp-cli@2'
|
|
234
|
-
},
|
|
235
|
-
node: {
|
|
236
|
-
range: '^8',
|
|
237
|
-
fix: 'Install Node.js v8'
|
|
238
|
-
},
|
|
239
|
-
sp: SharePointVersion.SPO,
|
|
240
|
-
yo: {
|
|
241
|
-
range: '^3',
|
|
242
|
-
fix: 'npm i -g yo@3'
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
'1.8.2': {
|
|
246
|
-
gulpCli: {
|
|
247
|
-
range: '^1 || ^2',
|
|
248
|
-
fix: 'npm i -g gulp-cli@2'
|
|
249
|
-
},
|
|
250
|
-
node: {
|
|
251
|
-
range: '^8 || ^10',
|
|
252
|
-
fix: 'Install Node.js v10'
|
|
253
|
-
},
|
|
254
|
-
sp: SharePointVersion.SPO,
|
|
255
|
-
yo: {
|
|
256
|
-
range: '^3',
|
|
257
|
-
fix: 'npm i -g yo@3'
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
'1.9.0': {
|
|
261
|
-
gulpCli: {
|
|
262
|
-
range: '^1 || ^2',
|
|
263
|
-
fix: 'npm i -g gulp-cli@2'
|
|
264
|
-
},
|
|
265
|
-
node: {
|
|
266
|
-
range: '^8 || ^10',
|
|
267
|
-
fix: 'Install Node.js v10'
|
|
268
|
-
},
|
|
269
|
-
sp: SharePointVersion.SPO,
|
|
270
|
-
yo: {
|
|
271
|
-
range: '^3',
|
|
272
|
-
fix: 'npm i -g yo@3'
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
'1.9.1': {
|
|
276
|
-
gulpCli: {
|
|
277
|
-
range: '^1 || ^2',
|
|
278
|
-
fix: 'npm i -g gulp-cli@2'
|
|
279
|
-
},
|
|
280
|
-
node: {
|
|
281
|
-
range: '^10',
|
|
282
|
-
fix: 'Install Node.js v10'
|
|
283
|
-
},
|
|
284
|
-
sp: SharePointVersion.SPO,
|
|
285
|
-
yo: {
|
|
286
|
-
range: '^3',
|
|
287
|
-
fix: 'npm i -g yo@3'
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
'1.10.0': {
|
|
291
|
-
gulpCli: {
|
|
292
|
-
range: '^1 || ^2',
|
|
293
|
-
fix: 'npm i -g gulp-cli@2'
|
|
294
|
-
},
|
|
295
|
-
node: {
|
|
296
|
-
range: '^10',
|
|
297
|
-
fix: 'Install Node.js v10'
|
|
298
|
-
},
|
|
299
|
-
sp: SharePointVersion.SPO,
|
|
300
|
-
yo: {
|
|
301
|
-
range: '^3',
|
|
302
|
-
fix: 'npm i -g yo@3'
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
'1.11.0': {
|
|
306
|
-
gulpCli: {
|
|
307
|
-
range: '^1 || ^2',
|
|
308
|
-
fix: 'npm i -g gulp-cli@2'
|
|
309
|
-
},
|
|
310
|
-
node: {
|
|
311
|
-
range: '^10',
|
|
312
|
-
fix: 'Install Node.js v10'
|
|
313
|
-
},
|
|
314
|
-
sp: SharePointVersion.SPO,
|
|
315
|
-
yo: {
|
|
316
|
-
range: '^3',
|
|
317
|
-
fix: 'npm i -g yo@3'
|
|
318
|
-
}
|
|
319
|
-
},
|
|
320
|
-
'1.12.0': {
|
|
321
|
-
gulpCli: {
|
|
322
|
-
range: '^1 || ^2',
|
|
323
|
-
fix: 'npm i -g gulp-cli@2'
|
|
324
|
-
},
|
|
325
|
-
node: {
|
|
326
|
-
range: '^12',
|
|
327
|
-
fix: 'Install Node.js v12'
|
|
328
|
-
},
|
|
329
|
-
sp: SharePointVersion.SPO,
|
|
330
|
-
yo: {
|
|
331
|
-
range: '^3',
|
|
332
|
-
fix: 'npm i -g yo@3'
|
|
333
|
-
}
|
|
334
|
-
},
|
|
335
|
-
'1.12.1': {
|
|
336
|
-
gulpCli: {
|
|
337
|
-
range: '^1 || ^2',
|
|
338
|
-
fix: 'npm i -g gulp-cli@2'
|
|
339
|
-
},
|
|
340
|
-
node: {
|
|
341
|
-
range: '^12 || ^14',
|
|
342
|
-
fix: 'Install Node.js v12 or v14'
|
|
343
|
-
},
|
|
344
|
-
sp: SharePointVersion.SPO,
|
|
345
|
-
yo: {
|
|
346
|
-
range: '^3',
|
|
347
|
-
fix: 'npm i -g yo@3'
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
'1.13.0': {
|
|
351
|
-
gulpCli: {
|
|
352
|
-
range: '^1 || ^2',
|
|
353
|
-
fix: 'npm i -g gulp-cli@2'
|
|
354
|
-
},
|
|
355
|
-
node: {
|
|
356
|
-
range: '^12 || ^14',
|
|
357
|
-
fix: 'Install Node.js v12 or v14'
|
|
358
|
-
},
|
|
359
|
-
sp: SharePointVersion.SPO,
|
|
360
|
-
yo: {
|
|
361
|
-
range: '^4',
|
|
362
|
-
fix: 'npm i -g yo@4'
|
|
363
|
-
}
|
|
364
|
-
},
|
|
365
|
-
'1.13.1': {
|
|
366
|
-
gulpCli: {
|
|
367
|
-
range: '^1 || ^2',
|
|
368
|
-
fix: 'npm i -g gulp-cli@2'
|
|
369
|
-
},
|
|
370
|
-
node: {
|
|
371
|
-
range: '^12 || ^14',
|
|
372
|
-
fix: 'Install Node.js v12 or v14'
|
|
373
|
-
},
|
|
374
|
-
sp: SharePointVersion.SPO,
|
|
375
|
-
yo: {
|
|
376
|
-
range: '^4',
|
|
377
|
-
fix: 'npm i -g yo@4'
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
'1.14.0': {
|
|
381
|
-
gulpCli: {
|
|
382
|
-
range: '^1 || ^2',
|
|
383
|
-
fix: 'npm i -g gulp-cli@2'
|
|
384
|
-
},
|
|
385
|
-
node: {
|
|
386
|
-
range: '^12 || ^14',
|
|
387
|
-
fix: 'Install Node.js v12 or v14'
|
|
388
|
-
},
|
|
389
|
-
sp: SharePointVersion.SPO,
|
|
390
|
-
yo: {
|
|
391
|
-
range: '^4',
|
|
392
|
-
fix: 'npm i -g yo@4'
|
|
393
|
-
}
|
|
394
|
-
},
|
|
395
|
-
'1.15.0': {
|
|
396
|
-
gulpCli: {
|
|
397
|
-
range: '^1 || ^2',
|
|
398
|
-
fix: 'npm i -g gulp-cli@2'
|
|
399
|
-
},
|
|
400
|
-
node: {
|
|
401
|
-
range: '^12.13 || ^14.15 || ^16.13',
|
|
402
|
-
fix: 'Install Node.js v12.13, v14.15, v16.13 or higher'
|
|
403
|
-
},
|
|
404
|
-
sp: SharePointVersion.SPO,
|
|
405
|
-
yo: {
|
|
406
|
-
range: '^4',
|
|
407
|
-
fix: 'npm i -g yo@4'
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
'1.15.2': {
|
|
411
|
-
gulpCli: {
|
|
412
|
-
range: '^1 || ^2',
|
|
413
|
-
fix: 'npm i -g gulp-cli@2'
|
|
414
|
-
},
|
|
415
|
-
node: {
|
|
416
|
-
range: '^12.13 || ^14.15 || ^16.13',
|
|
417
|
-
fix: 'Install Node.js v12.13, v14.15, v16.13 or higher'
|
|
418
|
-
},
|
|
419
|
-
sp: SharePointVersion.SPO,
|
|
420
|
-
yo: {
|
|
421
|
-
range: '^4',
|
|
422
|
-
fix: 'npm i -g yo@4'
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
'1.16.0': {
|
|
426
|
-
gulpCli: {
|
|
427
|
-
range: '^1 || ^2',
|
|
428
|
-
fix: 'npm i -g gulp-cli@2'
|
|
429
|
-
},
|
|
430
|
-
node: {
|
|
431
|
-
range: '>=16.13.0 <17.0.0',
|
|
432
|
-
fix: 'Install Node.js >=16.13.0 <17.0.0'
|
|
433
|
-
},
|
|
434
|
-
sp: SharePointVersion.SPO,
|
|
435
|
-
yo: {
|
|
436
|
-
range: '^4',
|
|
437
|
-
fix: 'npm i -g yo@4'
|
|
438
|
-
}
|
|
439
|
-
},
|
|
440
|
-
'1.16.1': {
|
|
441
|
-
gulpCli: {
|
|
442
|
-
range: '^1 || ^2',
|
|
443
|
-
fix: 'npm i -g gulp-cli@2'
|
|
444
|
-
},
|
|
445
|
-
node: {
|
|
446
|
-
range: '>=16.13.0 <17.0.0',
|
|
447
|
-
fix: 'Install Node.js >=16.13.0 <17.0.0'
|
|
448
|
-
},
|
|
449
|
-
sp: SharePointVersion.SPO,
|
|
450
|
-
yo: {
|
|
451
|
-
range: '^4',
|
|
452
|
-
fix: 'npm i -g yo@4'
|
|
453
|
-
}
|
|
454
|
-
},
|
|
455
|
-
'1.17.0': {
|
|
456
|
-
gulpCli: {
|
|
457
|
-
range: '^1 || ^2',
|
|
458
|
-
fix: 'npm i -g gulp-cli@2'
|
|
459
|
-
},
|
|
460
|
-
node: {
|
|
461
|
-
range: '>=16.13.0 <17.0.0',
|
|
462
|
-
fix: 'Install Node.js >=16.13.0 <17.0.0'
|
|
463
|
-
},
|
|
464
|
-
sp: SharePointVersion.SPO,
|
|
465
|
-
yo: {
|
|
466
|
-
range: '^4',
|
|
467
|
-
fix: 'npm i -g yo@4'
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
'1.17.1': {
|
|
471
|
-
gulpCli: {
|
|
472
|
-
range: '^1 || ^2',
|
|
473
|
-
fix: 'npm i -g gulp-cli@2'
|
|
474
|
-
},
|
|
475
|
-
node: {
|
|
476
|
-
range: '>=16.13.0 <17.0.0',
|
|
477
|
-
fix: 'Install Node.js >=16.13.0 <17.0.0'
|
|
478
|
-
},
|
|
479
|
-
sp: SharePointVersion.SPO,
|
|
480
|
-
yo: {
|
|
481
|
-
range: '^4',
|
|
482
|
-
fix: 'npm i -g yo@4'
|
|
483
|
-
}
|
|
484
|
-
},
|
|
485
|
-
'1.17.2': {
|
|
486
|
-
gulpCli: {
|
|
487
|
-
range: '^1 || ^2',
|
|
488
|
-
fix: 'npm i -g gulp-cli@2'
|
|
489
|
-
},
|
|
490
|
-
node: {
|
|
491
|
-
range: '>=16.13.0 <17.0.0',
|
|
492
|
-
fix: 'Install Node.js >=16.13.0 <17.0.0'
|
|
493
|
-
},
|
|
494
|
-
sp: SharePointVersion.SPO,
|
|
495
|
-
yo: {
|
|
496
|
-
range: '^4',
|
|
497
|
-
fix: 'npm i -g yo@4'
|
|
498
|
-
}
|
|
499
|
-
},
|
|
500
|
-
'1.17.3': {
|
|
501
|
-
gulpCli: {
|
|
502
|
-
range: '^1 || ^2',
|
|
503
|
-
fix: 'npm i -g gulp-cli@2'
|
|
504
|
-
},
|
|
505
|
-
node: {
|
|
506
|
-
range: '>=16.13.0 <17.0.0',
|
|
507
|
-
fix: 'Install Node.js >=16.13.0 <17.0.0'
|
|
508
|
-
},
|
|
509
|
-
sp: SharePointVersion.SPO,
|
|
510
|
-
yo: {
|
|
511
|
-
range: '^4',
|
|
512
|
-
fix: 'npm i -g yo@4'
|
|
513
|
-
}
|
|
514
|
-
},
|
|
515
|
-
'1.17.4': {
|
|
516
|
-
gulpCli: {
|
|
517
|
-
range: '^1 || ^2',
|
|
518
|
-
fix: 'npm i -g gulp-cli@2'
|
|
519
|
-
},
|
|
520
|
-
node: {
|
|
521
|
-
range: '>=16.13.0 <17.0.0',
|
|
522
|
-
fix: 'Install Node.js >=16.13.0 <17.0.0'
|
|
523
|
-
},
|
|
524
|
-
sp: SharePointVersion.SPO,
|
|
525
|
-
yo: {
|
|
526
|
-
range: '^4',
|
|
527
|
-
fix: 'npm i -g yo@4'
|
|
528
|
-
}
|
|
529
|
-
},
|
|
530
|
-
'1.18.0': {
|
|
531
|
-
gulpCli: {
|
|
532
|
-
range: '^1 || ^2',
|
|
533
|
-
fix: 'npm i -g gulp-cli@2'
|
|
534
|
-
},
|
|
535
|
-
node: {
|
|
536
|
-
range: '>=16.13.0 <17.0.0 || >=18.17.1 <19.0.0',
|
|
537
|
-
fix: 'Install Node.js >=16.13.0 <17.0.0 || >=18.17.1 <19.0.0'
|
|
538
|
-
},
|
|
539
|
-
sp: SharePointVersion.SPO,
|
|
540
|
-
yo: {
|
|
541
|
-
range: '^4',
|
|
542
|
-
fix: 'npm i -g yo@4'
|
|
543
|
-
}
|
|
544
|
-
},
|
|
545
|
-
'1.18.1': {
|
|
546
|
-
gulpCli: {
|
|
547
|
-
range: '^1 || ^2',
|
|
548
|
-
fix: 'npm i -g gulp-cli@2'
|
|
549
|
-
},
|
|
550
|
-
node: {
|
|
551
|
-
range: '>=16.13.0 <17.0.0 || >=18.17.1 <19.0.0',
|
|
552
|
-
fix: 'Install Node.js >=16.13.0 <17.0.0 || >=18.17.1 <19.0.0'
|
|
553
|
-
},
|
|
554
|
-
sp: SharePointVersion.SPO,
|
|
555
|
-
yo: {
|
|
556
|
-
range: '^4',
|
|
557
|
-
fix: 'npm i -g yo@4'
|
|
558
|
-
}
|
|
559
|
-
},
|
|
560
|
-
'1.18.2': {
|
|
561
|
-
gulpCli: {
|
|
562
|
-
range: '^1 || ^2',
|
|
563
|
-
fix: 'npm i -g gulp-cli@2'
|
|
564
|
-
},
|
|
565
|
-
node: {
|
|
566
|
-
range: '>=16.13.0 <17.0.0 || >=18.17.1 <19.0.0',
|
|
567
|
-
fix: 'Install Node.js >=16.13.0 <17.0.0 || >=18.17.1 <19.0.0'
|
|
568
|
-
},
|
|
569
|
-
sp: SharePointVersion.SPO,
|
|
570
|
-
yo: {
|
|
571
|
-
range: '^4 || ^5',
|
|
572
|
-
fix: 'npm i -g yo@5'
|
|
573
|
-
}
|
|
574
|
-
},
|
|
575
|
-
'1.19.0': {
|
|
576
|
-
gulpCli: {
|
|
577
|
-
range: '^1 || ^2 || ^3',
|
|
578
|
-
fix: 'npm i -g gulp-cli@3'
|
|
579
|
-
},
|
|
580
|
-
node: {
|
|
581
|
-
range: '>=18.17.1 <19.0.0',
|
|
582
|
-
fix: 'Install Node.js >=18.17.1 <19.0.0'
|
|
583
|
-
},
|
|
584
|
-
sp: SharePointVersion.SPO,
|
|
585
|
-
yo: {
|
|
586
|
-
range: '^4 || ^5',
|
|
587
|
-
fix: 'npm i -g yo@5'
|
|
588
|
-
}
|
|
589
|
-
},
|
|
590
|
-
'1.20.0': {
|
|
591
|
-
gulpCli: {
|
|
592
|
-
range: '^1 || ^2 || ^3',
|
|
593
|
-
fix: 'npm i -g gulp-cli@3'
|
|
594
|
-
},
|
|
595
|
-
node: {
|
|
596
|
-
range: '>=18.17.1 <19.0.0',
|
|
597
|
-
fix: 'Install Node.js >=18.17.1 <19.0.0'
|
|
598
|
-
},
|
|
599
|
-
sp: SharePointVersion.SPO,
|
|
600
|
-
yo: {
|
|
601
|
-
range: '^4 || ^5',
|
|
602
|
-
fix: 'npm i -g yo@5'
|
|
603
|
-
}
|
|
604
|
-
},
|
|
605
|
-
'1.21.0': {
|
|
606
|
-
gulpCli: {
|
|
607
|
-
range: '^1 || ^2 || ^3',
|
|
608
|
-
fix: 'npm i -g gulp-cli@3'
|
|
609
|
-
},
|
|
610
|
-
node: {
|
|
611
|
-
range: '>=22.14.0 <23.0.0',
|
|
612
|
-
fix: 'Install Node.js >=22.14.0 <23.0.0'
|
|
613
|
-
},
|
|
614
|
-
sp: SharePointVersion.SPO,
|
|
615
|
-
yo: {
|
|
616
|
-
range: '^4 || ^5',
|
|
617
|
-
fix: 'npm i -g yo@5'
|
|
618
|
-
}
|
|
619
|
-
},
|
|
620
|
-
'1.21.1': {
|
|
621
|
-
gulpCli: {
|
|
622
|
-
range: '^1 || ^2 || ^3',
|
|
623
|
-
fix: 'npm i -g gulp-cli@3'
|
|
624
|
-
},
|
|
625
|
-
node: {
|
|
626
|
-
range: '>=22.14.0 <23.0.0',
|
|
627
|
-
fix: 'Install Node.js >=22.14.0 <23.0.0'
|
|
628
|
-
},
|
|
629
|
-
sp: SharePointVersion.SPO,
|
|
630
|
-
yo: {
|
|
631
|
-
range: '^4 || ^5',
|
|
632
|
-
fix: 'npm i -g yo@5'
|
|
633
|
-
}
|
|
634
|
-
},
|
|
635
|
-
'1.22.0': {
|
|
636
|
-
heft: {
|
|
637
|
-
range: '^1',
|
|
638
|
-
fix: 'npm i -g @rushstack/heft@1'
|
|
639
|
-
},
|
|
640
|
-
node: {
|
|
641
|
-
range: '>=22.14.0 <23.0.0',
|
|
642
|
-
fix: 'Install Node.js >=22.14.0 <23.0.0'
|
|
643
|
-
},
|
|
644
|
-
sp: SharePointVersion.SPO,
|
|
645
|
-
yo: {
|
|
646
|
-
range: '^4 || ^5 || ^6',
|
|
647
|
-
fix: 'npm i -g yo@6'
|
|
648
|
-
}
|
|
649
|
-
},
|
|
650
|
-
'1.22.1': {
|
|
651
|
-
heft: {
|
|
652
|
-
range: '^1',
|
|
653
|
-
fix: 'npm i -g @rushstack/heft@1'
|
|
654
|
-
},
|
|
655
|
-
node: {
|
|
656
|
-
range: '>=22.14.0 <23.0.0',
|
|
657
|
-
fix: 'Install Node.js >=22.14.0 <23.0.0'
|
|
658
|
-
},
|
|
659
|
-
sp: SharePointVersion.SPO,
|
|
660
|
-
yo: {
|
|
661
|
-
range: '^4 || ^5 || ^6',
|
|
662
|
-
fix: 'npm i -g yo@6'
|
|
663
|
-
}
|
|
664
|
-
},
|
|
665
|
-
'1.22.2': {
|
|
666
|
-
heft: {
|
|
667
|
-
range: '^1',
|
|
668
|
-
fix: 'npm i -g @rushstack/heft@1'
|
|
669
|
-
},
|
|
670
|
-
node: {
|
|
671
|
-
range: '>=22.14.0 <23.0.0',
|
|
672
|
-
fix: 'Install Node.js >=22.14.0 <23.0.0'
|
|
673
|
-
},
|
|
674
|
-
sp: SharePointVersion.SPO,
|
|
675
|
-
yo: {
|
|
676
|
-
range: '^4 || ^5 || ^6',
|
|
677
|
-
fix: 'npm i -g yo@6'
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
};
|
|
681
55
|
this.output = '';
|
|
682
56
|
this.resultsObject = [];
|
|
683
57
|
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initTelemetry).call(this);
|
|
@@ -690,17 +64,16 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
690
64
|
if (!args.options.output) {
|
|
691
65
|
args.options.output = 'text';
|
|
692
66
|
}
|
|
693
|
-
this.logger = logger;
|
|
694
67
|
this.output = args.options.output;
|
|
695
68
|
this.projectRootPath = this.getProjectRoot(process.cwd());
|
|
69
|
+
this.logger = logger;
|
|
696
70
|
yield this.logMessage(' ');
|
|
697
71
|
yield this.logMessage('CLI for Microsoft 365 SharePoint Framework doctor');
|
|
698
72
|
yield this.logMessage('Verifying configuration of your system for working with the SharePoint Framework');
|
|
699
73
|
yield this.logMessage(' ');
|
|
700
|
-
let spfxVersion = '';
|
|
701
74
|
let prerequisites;
|
|
702
75
|
try {
|
|
703
|
-
spfxVersion = (_a = args.options.spfxVersion) !== null && _a !== void 0 ? _a : yield this.getSharePointFrameworkVersion();
|
|
76
|
+
const spfxVersion = (_a = args.options.spfxVersion) !== null && _a !== void 0 ? _a : yield this.getSharePointFrameworkVersion();
|
|
704
77
|
if (!spfxVersion) {
|
|
705
78
|
yield this.logMessage(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `SharePoint Framework`));
|
|
706
79
|
this.resultsObject.push({
|
|
@@ -710,7 +83,7 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
710
83
|
});
|
|
711
84
|
throw `SharePoint Framework not found`;
|
|
712
85
|
}
|
|
713
|
-
prerequisites =
|
|
86
|
+
prerequisites = SpfxCompatibilityMatrix_1.versions[spfxVersion];
|
|
714
87
|
if (!prerequisites) {
|
|
715
88
|
const message = `spfx doctor doesn't support SPFx v${spfxVersion} at this moment`;
|
|
716
89
|
this.resultsObject.push({
|
|
@@ -719,7 +92,7 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
719
92
|
version: spfxVersion,
|
|
720
93
|
message: message
|
|
721
94
|
});
|
|
722
|
-
yield this.logMessage(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure,
|
|
95
|
+
yield this.logMessage(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `SharePoint Framework v${spfxVersion}`));
|
|
723
96
|
throw message;
|
|
724
97
|
}
|
|
725
98
|
else {
|
|
@@ -776,7 +149,7 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
776
149
|
}
|
|
777
150
|
finally {
|
|
778
151
|
if (args.options.output === 'json' && this.resultsObject.length > 0) {
|
|
779
|
-
yield
|
|
152
|
+
yield logger.log(this.resultsObject);
|
|
780
153
|
}
|
|
781
154
|
}
|
|
782
155
|
});
|
|
@@ -796,7 +169,7 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
796
169
|
if (args.options.env) {
|
|
797
170
|
const sp = this.spVersionStringToEnum(args.options.env);
|
|
798
171
|
if ((prerequisites.sp & sp) === sp) {
|
|
799
|
-
const message = `Supported in ${SharePointVersion[sp]}`;
|
|
172
|
+
const message = `Supported in ${SpfxCompatibilityMatrix_1.SharePointVersion[sp]}`;
|
|
800
173
|
this.resultsObject.push({
|
|
801
174
|
check: 'env',
|
|
802
175
|
passed: true,
|
|
@@ -806,8 +179,8 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
806
179
|
yield this.logMessage(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Success, message));
|
|
807
180
|
return;
|
|
808
181
|
}
|
|
809
|
-
const fix = `Use SharePoint Framework v${(sp === SharePointVersion.SP2016 ? '1.1' : '1.4.1')}`;
|
|
810
|
-
const message = `Not supported in ${SharePointVersion[sp]}`;
|
|
182
|
+
const fix = `Use SharePoint Framework v${(sp === SpfxCompatibilityMatrix_1.SharePointVersion.SP2016 ? '1.1' : '1.4.1')}`;
|
|
183
|
+
const message = `Not supported in ${SpfxCompatibilityMatrix_1.SharePointVersion[sp]}`;
|
|
811
184
|
this.resultsObject.push({
|
|
812
185
|
check: 'env',
|
|
813
186
|
passed: false,
|
|
@@ -816,14 +189,14 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
816
189
|
version: args.options.env
|
|
817
190
|
});
|
|
818
191
|
yield this.logMessage(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, message));
|
|
819
|
-
throw `SharePoint Framework v${spfxVersion} is not supported in ${SharePointVersion[sp]}`;
|
|
192
|
+
throw `SharePoint Framework v${spfxVersion} is not supported in ${SpfxCompatibilityMatrix_1.SharePointVersion[sp]}`;
|
|
820
193
|
}
|
|
821
194
|
});
|
|
822
195
|
}
|
|
823
196
|
checkNodeVersion(prerequisites) {
|
|
824
197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
825
198
|
const nodeVersion = this.getNodeVersion();
|
|
826
|
-
this.checkStatus('Node', nodeVersion, prerequisites.node);
|
|
199
|
+
yield this.checkStatus('Node', nodeVersion, prerequisites.node);
|
|
827
200
|
});
|
|
828
201
|
}
|
|
829
202
|
checkSharePointFrameworkVersion(spfxVersionRequested) {
|
|
@@ -837,7 +210,7 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
837
210
|
fix: `npm i -g @microsoft/generator-sharepoint@${spfxVersionRequested}`
|
|
838
211
|
};
|
|
839
212
|
if (spfxVersionDetected) {
|
|
840
|
-
this.checkStatus(`SharePoint Framework`, spfxVersionDetected, versionCheck);
|
|
213
|
+
yield this.checkStatus(`SharePoint Framework`, spfxVersionDetected, versionCheck);
|
|
841
214
|
}
|
|
842
215
|
else {
|
|
843
216
|
const message = `SharePoint Framework v${spfxVersionRequested} not found`;
|
|
@@ -856,7 +229,7 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
856
229
|
return __awaiter(this, void 0, void 0, function* () {
|
|
857
230
|
const yoVersion = yield this.getPackageVersion('yo', PackageSearchMode.GlobalOnly, HandlePromise.Continue);
|
|
858
231
|
if (yoVersion) {
|
|
859
|
-
this.checkStatus('yo', yoVersion, prerequisites.yo);
|
|
232
|
+
yield this.checkStatus('yo', yoVersion, prerequisites.yo);
|
|
860
233
|
}
|
|
861
234
|
else {
|
|
862
235
|
const message = 'yo not found';
|
|
@@ -957,43 +330,45 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
957
330
|
});
|
|
958
331
|
}
|
|
959
332
|
spVersionStringToEnum(sp) {
|
|
960
|
-
return SharePointVersion[sp.toUpperCase()];
|
|
333
|
+
return SpfxCompatibilityMatrix_1.SharePointVersion[sp.toUpperCase()];
|
|
961
334
|
}
|
|
962
335
|
getSPFxVersionFromYoRcFile() {
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
if (
|
|
967
|
-
this.
|
|
336
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
337
|
+
if (this.projectRootPath !== null) {
|
|
338
|
+
const spfxVersion = this.getProjectVersion();
|
|
339
|
+
if (spfxVersion) {
|
|
340
|
+
if (this.debug) {
|
|
341
|
+
yield this.logger.logToStderr(`SPFx version retrieved from .yo-rc.json file. Retrieved version: ${spfxVersion}`);
|
|
342
|
+
}
|
|
343
|
+
return spfxVersion;
|
|
968
344
|
}
|
|
969
|
-
return spfxVersion;
|
|
970
345
|
}
|
|
971
|
-
|
|
972
|
-
|
|
346
|
+
return undefined;
|
|
347
|
+
});
|
|
973
348
|
}
|
|
974
349
|
getSharePointFrameworkVersion() {
|
|
975
350
|
return __awaiter(this, void 0, void 0, function* () {
|
|
976
|
-
let spfxVersion = this.getSPFxVersionFromYoRcFile();
|
|
351
|
+
let spfxVersion = yield this.getSPFxVersionFromYoRcFile();
|
|
977
352
|
if (spfxVersion) {
|
|
978
353
|
return spfxVersion;
|
|
979
354
|
}
|
|
980
355
|
try {
|
|
981
356
|
spfxVersion = yield this.getPackageVersion('@microsoft/sp-core-library', PackageSearchMode.LocalOnly, HandlePromise.Fail);
|
|
982
357
|
if (this.debug) {
|
|
983
|
-
this.logger.logToStderr(`Found @microsoft/sp-core-library@${spfxVersion}`);
|
|
358
|
+
yield this.logger.logToStderr(`Found @microsoft/sp-core-library@${spfxVersion}`);
|
|
984
359
|
}
|
|
985
360
|
return spfxVersion;
|
|
986
361
|
}
|
|
987
362
|
catch (_a) {
|
|
988
363
|
if (this.debug) {
|
|
989
|
-
this.logger.logToStderr(`@microsoft/sp-core-library not found. Search for @microsoft/generator-sharepoint local or global...`);
|
|
364
|
+
yield this.logger.logToStderr(`@microsoft/sp-core-library not found. Search for @microsoft/generator-sharepoint local or global...`);
|
|
990
365
|
}
|
|
991
366
|
try {
|
|
992
367
|
return yield this.getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.LocalAndGlobal, HandlePromise.Fail);
|
|
993
368
|
}
|
|
994
369
|
catch (error) {
|
|
995
370
|
if (this.debug) {
|
|
996
|
-
this.logger.logToStderr('@microsoft/generator-sharepoint not found');
|
|
371
|
+
yield this.logger.logToStderr('@microsoft/generator-sharepoint not found');
|
|
997
372
|
}
|
|
998
373
|
if (error && error.indexOf('ENOENT') > -1) {
|
|
999
374
|
throw 'npm not found';
|
|
@@ -1038,34 +413,36 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
1038
413
|
});
|
|
1039
414
|
}
|
|
1040
415
|
getPackageVersionFromNpm(args) {
|
|
1041
|
-
return
|
|
1042
|
-
const packageName = args[1];
|
|
416
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1043
417
|
if (this.debug) {
|
|
1044
|
-
this.logger.logToStderr(`Executing npm: ${args.join(' ')}...`);
|
|
418
|
+
yield this.logger.logToStderr(`Executing npm: ${args.join(' ')}...`);
|
|
1045
419
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
try {
|
|
1052
|
-
const packageInfo = JSON.parse(responseString);
|
|
1053
|
-
if (packageInfo.dependencies &&
|
|
1054
|
-
packageInfo.dependencies[packageName]) {
|
|
1055
|
-
resolve(packageInfo.dependencies[packageName].version);
|
|
420
|
+
return new Promise((resolve, reject) => {
|
|
421
|
+
const packageName = args[1];
|
|
422
|
+
child_process.exec(`npm ${args.join(' ')}`, (err, stdout) => {
|
|
423
|
+
if (err) {
|
|
424
|
+
reject(err.message);
|
|
1056
425
|
}
|
|
1057
|
-
|
|
1058
|
-
|
|
426
|
+
const responseString = stdout;
|
|
427
|
+
try {
|
|
428
|
+
const packageInfo = JSON.parse(responseString);
|
|
429
|
+
if (packageInfo.dependencies &&
|
|
430
|
+
packageInfo.dependencies[packageName]) {
|
|
431
|
+
resolve(packageInfo.dependencies[packageName].version);
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
reject('Package not found');
|
|
435
|
+
}
|
|
1059
436
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
}
|
|
437
|
+
catch (ex) {
|
|
438
|
+
return reject(ex);
|
|
439
|
+
}
|
|
440
|
+
});
|
|
1064
441
|
});
|
|
1065
442
|
});
|
|
1066
443
|
}
|
|
1067
444
|
getNodeVersion() {
|
|
1068
|
-
return process.version.
|
|
445
|
+
return process.version.substring(1);
|
|
1069
446
|
}
|
|
1070
447
|
checkStatus(what, versionFound, versionCheck) {
|
|
1071
448
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1108,7 +485,7 @@ _SpfxDoctorCommand_instances = new WeakSet(), _SpfxDoctorCommand_initTelemetry =
|
|
|
1108
485
|
autocomplete: ['sp2016', 'sp2019', 'spo']
|
|
1109
486
|
}, {
|
|
1110
487
|
option: '-v, --spfxVersion [spfxVersion]',
|
|
1111
|
-
autocomplete: Object.keys(
|
|
488
|
+
autocomplete: Object.keys(SpfxCompatibilityMatrix_1.versions)
|
|
1112
489
|
});
|
|
1113
490
|
}, _SpfxDoctorCommand_initValidators = function _SpfxDoctorCommand_initValidators() {
|
|
1114
491
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1119,8 +496,8 @@ _SpfxDoctorCommand_instances = new WeakSet(), _SpfxDoctorCommand_initTelemetry =
|
|
|
1119
496
|
}
|
|
1120
497
|
}
|
|
1121
498
|
if (args.options.spfxVersion) {
|
|
1122
|
-
if (!
|
|
1123
|
-
return `${args.options.spfxVersion} is not a supported SharePoint Framework version. Supported versions are ${Object.keys(
|
|
499
|
+
if (!SpfxCompatibilityMatrix_1.versions[args.options.spfxVersion]) {
|
|
500
|
+
return `${args.options.spfxVersion} is not a supported SharePoint Framework version. Supported versions are ${Object.keys(SpfxCompatibilityMatrix_1.versions).join(', ')}`;
|
|
1124
501
|
}
|
|
1125
502
|
}
|
|
1126
503
|
return true;
|