@react-spectrum/codemods 0.1.2-nightly.5032 → 0.1.2-nightly.5038

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.
@@ -32,6 +32,7 @@ const utils_1 = require("./utils");
32
32
  const changes_1 = require("./changes");
33
33
  const transforms_1 = require("./transforms");
34
34
  const getComponents_1 = require("../getComponents");
35
+ const iconMap_1 = require("../iconMap");
35
36
  const t = __importStar(require("@babel/types"));
36
37
  const styleProps_1 = require("./styleProps");
37
38
  const traverse_1 = __importDefault(require("@babel/traverse"));
@@ -55,6 +56,7 @@ function transformer(file, api, options) {
55
56
  let importedComponents = new Map();
56
57
  let elements = [];
57
58
  let lastImportPath = null;
59
+ let iconImports = new Map();
58
60
  const leadingComments = root.find(j.Program).get('body', 0).node.leadingComments;
59
61
  (0, traverse_1.default)(root.paths()[0].node, {
60
62
  ImportDeclaration(path) {
@@ -108,6 +110,25 @@ function transformer(file, api, options) {
108
110
  }
109
111
  }
110
112
  }
113
+ else if (path.node.source.value.startsWith('@spectrum-icons/workflow/')) {
114
+ let importSource = path.node.source.value;
115
+ let iconName = importSource.split('/').pop();
116
+ if (!iconName) {
117
+ return;
118
+ }
119
+ let specifier = path.node.specifiers[0];
120
+ if (!specifier || !t.isImportDefaultSpecifier(specifier)) {
121
+ return;
122
+ }
123
+ let localName = specifier.local.name;
124
+ if (iconMap_1.iconMap.has(iconName)) {
125
+ let newIconName = iconMap_1.iconMap.get(iconName);
126
+ iconImports.set(localName, { path, newName: newIconName });
127
+ }
128
+ else {
129
+ iconImports.set(localName, { path, newName: null });
130
+ }
131
+ }
111
132
  },
112
133
  Import(path) {
113
134
  let call = path.parentPath;
@@ -123,6 +144,38 @@ function transformer(file, api, options) {
123
144
  }
124
145
  // TODO: implement this. could be a bit challenging. punting for now.
125
146
  (0, utils_1.addComment)(call.node, ' TODO(S2-upgrade): check this dynamic import');
147
+ },
148
+ JSXOpeningElement(path) {
149
+ let name = path.node.name;
150
+ if (t.isJSXIdentifier(name) && iconImports.has(name.name)) {
151
+ let iconInfo = iconImports.get(name.name);
152
+ if (iconInfo.newName === null) {
153
+ (0, utils_1.addComment)(path.node, ` TODO(S2-upgrade): A Spectrum 2 equivalent to '${name.name}' was not found. Please update this icon manually.`);
154
+ }
155
+ }
156
+ }
157
+ });
158
+ iconImports.forEach((iconInfo, localName) => {
159
+ let { path, newName } = iconInfo;
160
+ if (newName) {
161
+ let newImportSource = `@react-spectrum/s2/icons/${newName}`;
162
+ // Check if we can update local name
163
+ let newLocalName = localName;
164
+ if (localName === path.node.source.value.split('/').pop() && localName !== newName) {
165
+ let binding = path.scope.getBinding(localName);
166
+ if (binding && !path.scope.hasBinding(newName)) {
167
+ newLocalName = newName;
168
+ // Rename all references
169
+ binding.referencePaths.forEach(refPath => {
170
+ if (t.isJSXIdentifier(refPath.node)) {
171
+ refPath.node.name = newName;
172
+ }
173
+ });
174
+ }
175
+ }
176
+ // Update the import
177
+ path.node.source = t.stringLiteral(newImportSource);
178
+ path.node.specifiers = [t.importDefaultSpecifier(t.identifier(newLocalName))];
126
179
  }
127
180
  });
128
181
  let hasMacros = false;
@@ -0,0 +1,1162 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.iconMap = void 0;
4
+ // Mappings between Spectrum 1 and Spectrum 2 icons
5
+ exports.iconMap = new Map([
6
+ [
7
+ '123',
8
+ 'TextNumbers'
9
+ ],
10
+ [
11
+ '3DMaterials',
12
+ '3DMaterial'
13
+ ],
14
+ [
15
+ 'Add',
16
+ 'Add'
17
+ ],
18
+ [
19
+ 'AddCircle',
20
+ 'AddCircle'
21
+ ],
22
+ [
23
+ 'Alert',
24
+ 'AlertTriangle'
25
+ ],
26
+ [
27
+ 'AlertCircle',
28
+ 'AlertDiamond'
29
+ ],
30
+ [
31
+ 'AlertCircleFilled',
32
+ 'AlertDiamond'
33
+ ],
34
+ [
35
+ 'AlignBottom',
36
+ 'AlignBottom'
37
+ ],
38
+ [
39
+ 'AlignCenter',
40
+ 'AlignCenter'
41
+ ],
42
+ [
43
+ 'AlignLeft',
44
+ 'AlignLeft'
45
+ ],
46
+ [
47
+ 'AlignMiddle',
48
+ 'AlignMiddle'
49
+ ],
50
+ [
51
+ 'AlignRight',
52
+ 'AlignRight'
53
+ ],
54
+ [
55
+ 'AlignTop',
56
+ 'AlignTop'
57
+ ],
58
+ [
59
+ 'AnchorSelect',
60
+ 'DirectSelect'
61
+ ],
62
+ [
63
+ 'Apps',
64
+ 'AppsAll'
65
+ ],
66
+ [
67
+ 'Archive',
68
+ 'Archive'
69
+ ],
70
+ [
71
+ 'Artboard',
72
+ 'Artboard'
73
+ ],
74
+ [
75
+ 'Asset',
76
+ 'Asset'
77
+ ],
78
+ [
79
+ 'AssetsAdded',
80
+ 'AddContent'
81
+ ],
82
+ [
83
+ 'At',
84
+ 'Mention'
85
+ ],
86
+ [
87
+ 'Attach',
88
+ 'Attach'
89
+ ],
90
+ [
91
+ 'Audio',
92
+ 'MusicNote'
93
+ ],
94
+ [
95
+ 'Beaker',
96
+ 'BetaApp'
97
+ ],
98
+ [
99
+ 'Bell',
100
+ 'Bell'
101
+ ],
102
+ [
103
+ 'Blur',
104
+ 'Blur'
105
+ ],
106
+ [
107
+ 'Boolean',
108
+ 'Toggle'
109
+ ],
110
+ [
111
+ 'Border',
112
+ 'EffectBorder'
113
+ ],
114
+ [
115
+ 'Briefcase',
116
+ 'Briefcase'
117
+ ],
118
+ [
119
+ 'Browse',
120
+ 'Binoculars'
121
+ ],
122
+ [
123
+ 'Brush',
124
+ 'Brush'
125
+ ],
126
+ [
127
+ 'Bug',
128
+ 'Bug'
129
+ ],
130
+ [
131
+ 'Calendar',
132
+ 'Calendar'
133
+ ],
134
+ [
135
+ 'CalendarAdd',
136
+ 'CalendarAdd'
137
+ ],
138
+ [
139
+ 'Camera',
140
+ 'Camera'
141
+ ],
142
+ [
143
+ 'Cancel',
144
+ 'Cancel'
145
+ ],
146
+ [
147
+ 'Capitals',
148
+ 'TextCapsAll'
149
+ ],
150
+ [
151
+ 'CCLibrary',
152
+ 'CCLibrary'
153
+ ],
154
+ [
155
+ 'Channel',
156
+ 'Channel'
157
+ ],
158
+ [
159
+ 'ChatAdd',
160
+ 'Channel'
161
+ ],
162
+ [
163
+ 'Checkmark',
164
+ 'CheckmarkSize300'
165
+ ],
166
+ [
167
+ 'CheckmarkCircle',
168
+ 'CheckmarkCircle'
169
+ ],
170
+ [
171
+ 'CheckmarkCircleOutline',
172
+ 'CheckmarkCircle'
173
+ ],
174
+ [
175
+ 'ChevronDown',
176
+ 'ChevronDownSize300'
177
+ ],
178
+ [
179
+ 'ChevronLeft',
180
+ 'ChevronLeft'
181
+ ],
182
+ [
183
+ 'ChevronRight',
184
+ 'ChevronRight'
185
+ ],
186
+ [
187
+ 'Circle',
188
+ 'Circle'
189
+ ],
190
+ [
191
+ 'CircleFilled',
192
+ 'Circle'
193
+ ],
194
+ [
195
+ 'ClassicGridView',
196
+ 'ViewGrid'
197
+ ],
198
+ [
199
+ 'Clock',
200
+ 'Clock'
201
+ ],
202
+ [
203
+ 'CloneStamp',
204
+ 'StampClone'
205
+ ],
206
+ [
207
+ 'Close',
208
+ 'Close'
209
+ ],
210
+ [
211
+ 'CloseCaptions',
212
+ 'CloseCaptions'
213
+ ],
214
+ [
215
+ 'CloseCircle',
216
+ 'CloseCircle'
217
+ ],
218
+ [
219
+ 'Cloud',
220
+ 'Cloud'
221
+ ],
222
+ [
223
+ 'CloudOutline',
224
+ 'Cloud'
225
+ ],
226
+ [
227
+ 'Collection',
228
+ 'Collection'
229
+ ],
230
+ [
231
+ 'ColorFill',
232
+ 'ColorFill'
233
+ ],
234
+ [
235
+ 'ColorPalette',
236
+ 'Color'
237
+ ],
238
+ [
239
+ 'Comment',
240
+ 'Comment'
241
+ ],
242
+ [
243
+ 'Compass',
244
+ 'Discover'
245
+ ],
246
+ [
247
+ 'Contrast',
248
+ 'Contrast'
249
+ ],
250
+ [
251
+ 'Copy',
252
+ 'Copy'
253
+ ],
254
+ [
255
+ 'Crop',
256
+ 'Crop'
257
+ ],
258
+ [
259
+ 'CropRotate',
260
+ 'CropRotate'
261
+ ],
262
+ [
263
+ 'Cut',
264
+ 'Cut'
265
+ ],
266
+ [
267
+ 'Data',
268
+ 'Data'
269
+ ],
270
+ [
271
+ 'DataAdd',
272
+ 'DataAdd'
273
+ ],
274
+ [
275
+ 'DataSettings',
276
+ 'DataSettings'
277
+ ],
278
+ [
279
+ 'DataUpload',
280
+ 'DataUpload'
281
+ ],
282
+ [
283
+ 'Date',
284
+ 'CalendarDay'
285
+ ],
286
+ [
287
+ 'Delete',
288
+ 'Delete'
289
+ ],
290
+ [
291
+ 'DeleteOutline',
292
+ 'Delete'
293
+ ],
294
+ [
295
+ 'Deselect',
296
+ 'SelectNo'
297
+ ],
298
+ [
299
+ 'DesktopAndMobile',
300
+ 'DeviceDesktopMobile'
301
+ ],
302
+ [
303
+ 'DeviceDesktop',
304
+ 'DeviceDesktop'
305
+ ],
306
+ [
307
+ 'DeviceLaptop',
308
+ 'DeviceLaptop'
309
+ ],
310
+ [
311
+ 'DevicePhone',
312
+ 'DevicePhone'
313
+ ],
314
+ [
315
+ 'Devices',
316
+ 'DeviceMobile'
317
+ ],
318
+ [
319
+ 'DeviceTablet',
320
+ 'DeviceTablet'
321
+ ],
322
+ [
323
+ 'DistributeBottomEdge',
324
+ 'DistributeBottomEdge'
325
+ ],
326
+ [
327
+ 'DistributeHorizontalCenter',
328
+ 'DistributeHorizontalCenter'
329
+ ],
330
+ [
331
+ 'DistributeHorizontally',
332
+ 'DistributeSpaceHorizontally'
333
+ ],
334
+ [
335
+ 'DistributeLeftEdge',
336
+ 'DistributeLeftEdge'
337
+ ],
338
+ [
339
+ 'DistributeRightEdge',
340
+ 'DistributeRightEdge'
341
+ ],
342
+ [
343
+ 'DistributeSpaceHoriz',
344
+ 'DistributeSpaceHorizontally'
345
+ ],
346
+ [
347
+ 'DistributeSpaceVert',
348
+ 'DistributeSpaceVertically'
349
+ ],
350
+ [
351
+ 'DistributeTopEdge',
352
+ 'DistributeTopEdge'
353
+ ],
354
+ [
355
+ 'DistributeVerticalCenter',
356
+ 'DistributeVerticalCenter'
357
+ ],
358
+ [
359
+ 'DistributeVertically',
360
+ 'DistributeSpaceVertically'
361
+ ],
362
+ [
363
+ 'Document',
364
+ 'File'
365
+ ],
366
+ [
367
+ 'DocumentOutline',
368
+ 'File'
369
+ ],
370
+ [
371
+ 'Download',
372
+ 'Download'
373
+ ],
374
+ [
375
+ 'Draw',
376
+ 'Draw'
377
+ ],
378
+ [
379
+ 'Duplicate',
380
+ 'Duplicate'
381
+ ],
382
+ [
383
+ 'Edit',
384
+ 'Edit'
385
+ ],
386
+ [
387
+ 'Education',
388
+ 'Education'
389
+ ],
390
+ [
391
+ 'Effects',
392
+ 'Effects'
393
+ ],
394
+ [
395
+ 'Email',
396
+ 'Email'
397
+ ],
398
+ [
399
+ 'EmailOutline',
400
+ 'Email'
401
+ ],
402
+ [
403
+ 'Engagement',
404
+ 'Interaction'
405
+ ],
406
+ [
407
+ 'Erase',
408
+ 'Erase'
409
+ ],
410
+ [
411
+ 'Events',
412
+ 'CursorClick'
413
+ ],
414
+ [
415
+ 'Export',
416
+ 'ExportTo'
417
+ ],
418
+ [
419
+ 'ExportOriginal',
420
+ 'ExportTo'
421
+ ],
422
+ [
423
+ 'Exposure',
424
+ 'Exposure'
425
+ ],
426
+ [
427
+ 'Feedback',
428
+ 'Feedback'
429
+ ],
430
+ [
431
+ 'FileAdd',
432
+ 'FileAdd'
433
+ ],
434
+ [
435
+ 'FileTxt',
436
+ 'FileText'
437
+ ],
438
+ [
439
+ 'FileUser',
440
+ 'FileUser'
441
+ ],
442
+ [
443
+ 'Filter',
444
+ 'Filter'
445
+ ],
446
+ [
447
+ 'FindAndReplace',
448
+ 'FindAndReplace'
449
+ ],
450
+ [
451
+ 'Flag',
452
+ 'Flag'
453
+ ],
454
+ [
455
+ 'FlipHorizontal',
456
+ 'FlipHorizontal'
457
+ ],
458
+ [
459
+ 'FlipVertical',
460
+ 'FlipVertical'
461
+ ],
462
+ [
463
+ 'Folder',
464
+ 'Folder'
465
+ ],
466
+ [
467
+ 'FolderAdd',
468
+ 'FolderAdd'
469
+ ],
470
+ [
471
+ 'FolderOpen',
472
+ 'FolderOpen'
473
+ ],
474
+ [
475
+ 'FolderOpenOutline',
476
+ 'FolderOpen'
477
+ ],
478
+ [
479
+ 'FolderOutline',
480
+ 'Folder'
481
+ ],
482
+ [
483
+ 'FullScreen',
484
+ 'FullScreen'
485
+ ],
486
+ [
487
+ 'FullScreenExit',
488
+ 'FullScreenExit'
489
+ ],
490
+ [
491
+ 'Gift',
492
+ 'Gift'
493
+ ],
494
+ [
495
+ 'Globe',
496
+ 'GlobeGrid'
497
+ ],
498
+ [
499
+ 'GlobeGrid',
500
+ 'GlobeGrid'
501
+ ],
502
+ [
503
+ 'Gradient',
504
+ 'Gradient'
505
+ ],
506
+ [
507
+ 'Group',
508
+ 'Group'
509
+ ],
510
+ [
511
+ 'Hand',
512
+ 'Hand'
513
+ ],
514
+ [
515
+ 'Heart',
516
+ 'Heart'
517
+ ],
518
+ [
519
+ 'Help',
520
+ 'HelpCircle'
521
+ ],
522
+ [
523
+ 'HelpOutline',
524
+ 'HelpCircle'
525
+ ],
526
+ [
527
+ 'History',
528
+ 'History'
529
+ ],
530
+ [
531
+ 'Home',
532
+ 'Home'
533
+ ],
534
+ [
535
+ 'Homepage',
536
+ 'WebPage'
537
+ ],
538
+ [
539
+ 'Image',
540
+ 'Image'
541
+ ],
542
+ [
543
+ 'ImageAdd',
544
+ 'ImageAdd'
545
+ ],
546
+ [
547
+ 'ImageProfile',
548
+ 'UserAvatar'
549
+ ],
550
+ [
551
+ 'Images',
552
+ 'Images'
553
+ ],
554
+ [
555
+ 'Info',
556
+ 'InfoCircle'
557
+ ],
558
+ [
559
+ 'InfoOutline',
560
+ 'InfoCircle'
561
+ ],
562
+ [
563
+ 'InvertAdj',
564
+ 'Invert'
565
+ ],
566
+ [
567
+ 'Invite',
568
+ 'Invite'
569
+ ],
570
+ [
571
+ 'Keyboard',
572
+ 'Keyboard'
573
+ ],
574
+ [
575
+ 'Label',
576
+ 'Tag'
577
+ ],
578
+ [
579
+ 'Landscape',
580
+ 'OrientationLandscape'
581
+ ],
582
+ [
583
+ 'Layers',
584
+ 'Layers'
585
+ ],
586
+ [
587
+ 'Light',
588
+ 'Lighten'
589
+ ],
590
+ [
591
+ 'Line',
592
+ 'Line'
593
+ ],
594
+ [
595
+ 'LinearGradient',
596
+ 'GradientHorizontal'
597
+ ],
598
+ [
599
+ 'LineHeight',
600
+ 'LineHeight'
601
+ ],
602
+ [
603
+ 'Link',
604
+ 'Link'
605
+ ],
606
+ [
607
+ 'LinkOff',
608
+ 'UnLink'
609
+ ],
610
+ [
611
+ 'LinkOut',
612
+ 'ExportTo'
613
+ ],
614
+ [
615
+ 'LinkOutLight',
616
+ 'ExportTo'
617
+ ],
618
+ [
619
+ 'Location',
620
+ 'Location'
621
+ ],
622
+ [
623
+ 'LockClosed',
624
+ 'Lock'
625
+ ],
626
+ [
627
+ 'LockOpen',
628
+ 'LockOpen'
629
+ ],
630
+ [
631
+ 'Looks',
632
+ 'Filters'
633
+ ],
634
+ [
635
+ 'MagicWand',
636
+ 'MagicWand'
637
+ ],
638
+ [
639
+ 'Magnify',
640
+ 'Search'
641
+ ],
642
+ [
643
+ 'Maximize',
644
+ 'Maximize'
645
+ ],
646
+ [
647
+ 'Measure',
648
+ 'Ruler'
649
+ ],
650
+ [
651
+ 'Minimize',
652
+ 'Minimize'
653
+ ],
654
+ [
655
+ 'More',
656
+ 'More'
657
+ ],
658
+ [
659
+ 'MoreSmall',
660
+ 'More'
661
+ ],
662
+ [
663
+ 'Move',
664
+ 'Move'
665
+ ],
666
+ [
667
+ 'MoveTo',
668
+ 'ExportTo'
669
+ ],
670
+ [
671
+ 'MovieCamera',
672
+ 'MovieCamera'
673
+ ],
674
+ [
675
+ 'NamingOrder',
676
+ 'NamingOrder'
677
+ ],
678
+ [
679
+ 'NewItem',
680
+ 'New'
681
+ ],
682
+ [
683
+ 'NoEdit',
684
+ 'EditNo'
685
+ ],
686
+ [
687
+ 'OpenIn',
688
+ 'OpenIn'
689
+ ],
690
+ [
691
+ 'OpenInLight',
692
+ 'OpenIn'
693
+ ],
694
+ [
695
+ 'Organisations',
696
+ 'Buildings'
697
+ ],
698
+ [
699
+ 'Pan',
700
+ 'Hand'
701
+ ],
702
+ [
703
+ 'Paste',
704
+ 'Paste'
705
+ ],
706
+ [
707
+ 'Pattern',
708
+ 'Pattern'
709
+ ],
710
+ [
711
+ 'Pause',
712
+ 'Pause'
713
+ ],
714
+ [
715
+ 'Pending',
716
+ 'ClockPending'
717
+ ],
718
+ [
719
+ 'Play',
720
+ 'Play'
721
+ ],
722
+ [
723
+ 'Polygon',
724
+ 'Polygon6'
725
+ ],
726
+ [
727
+ 'Portrait',
728
+ 'OrientationPortrait'
729
+ ],
730
+ [
731
+ 'Preview',
732
+ 'Preview'
733
+ ],
734
+ [
735
+ 'Print',
736
+ 'Print'
737
+ ],
738
+ [
739
+ 'PrintPreview',
740
+ 'Preview'
741
+ ],
742
+ [
743
+ 'Project',
744
+ 'Project'
745
+ ],
746
+ [
747
+ 'ProjectAdd',
748
+ 'ProjectCreate'
749
+ ],
750
+ [
751
+ 'Promote',
752
+ 'Promote'
753
+ ],
754
+ [
755
+ 'Properties',
756
+ 'Properties'
757
+ ],
758
+ [
759
+ 'PublishRemove',
760
+ 'PublishNo'
761
+ ],
762
+ [
763
+ 'RadialGradient',
764
+ 'GradientRadial'
765
+ ],
766
+ [
767
+ 'Rail',
768
+ 'MenuHamburger'
769
+ ],
770
+ [
771
+ 'RealTimeCustomerProfile',
772
+ 'UserAvatar'
773
+ ],
774
+ [
775
+ 'Rectangle',
776
+ 'RectangleHoriz'
777
+ ],
778
+ [
779
+ 'RectSelect',
780
+ 'SelectRectangle'
781
+ ],
782
+ [
783
+ 'Redo',
784
+ 'Redo'
785
+ ],
786
+ [
787
+ 'Refresh',
788
+ 'Refresh'
789
+ ],
790
+ [
791
+ 'RegionSelect',
792
+ 'LassoSelect'
793
+ ],
794
+ [
795
+ 'RemoveCircle',
796
+ 'RemoveCircle'
797
+ ],
798
+ [
799
+ 'Rename',
800
+ 'Rename'
801
+ ],
802
+ [
803
+ 'Resize',
804
+ 'Resize'
805
+ ],
806
+ [
807
+ 'Revert',
808
+ 'Revert'
809
+ ],
810
+ [
811
+ 'Ribbon',
812
+ 'Ribbon'
813
+ ],
814
+ [
815
+ 'RotateCCW',
816
+ 'RotateCCW'
817
+ ],
818
+ [
819
+ 'RotateCCWBold',
820
+ 'RotateCCW'
821
+ ],
822
+ [
823
+ 'RotateCW',
824
+ 'RotateCW'
825
+ ],
826
+ [
827
+ 'RotateCWBold',
828
+ 'RotateCW'
829
+ ],
830
+ [
831
+ 'RotateRight',
832
+ 'RotateOrientation'
833
+ ],
834
+ [
835
+ 'RotateRightOutline',
836
+ 'RotateOrientation'
837
+ ],
838
+ [
839
+ 'Sampler',
840
+ 'Eyedropper'
841
+ ],
842
+ [
843
+ 'SaveTo',
844
+ 'Download'
845
+ ],
846
+ [
847
+ 'SaveToLight',
848
+ 'Download'
849
+ ],
850
+ [
851
+ 'Search',
852
+ 'Search'
853
+ ],
854
+ [
855
+ 'Select',
856
+ 'Select'
857
+ ],
858
+ [
859
+ 'SelectBox',
860
+ 'CheckBox'
861
+ ],
862
+ [
863
+ 'SelectBoxAll',
864
+ 'SelectMulti'
865
+ ],
866
+ [
867
+ 'Send',
868
+ 'Send'
869
+ ],
870
+ [
871
+ 'Settings',
872
+ 'Settings'
873
+ ],
874
+ [
875
+ 'Shapes',
876
+ 'Shapes'
877
+ ],
878
+ [
879
+ 'Share',
880
+ 'Share'
881
+ ],
882
+ [
883
+ 'ShareAndroid',
884
+ 'ShareAndroid'
885
+ ],
886
+ [
887
+ 'ShareLight',
888
+ 'Share'
889
+ ],
890
+ [
891
+ 'Shop',
892
+ 'Market'
893
+ ],
894
+ [
895
+ 'ShoppingCart',
896
+ 'ShoppingCart'
897
+ ],
898
+ [
899
+ 'ShowMenu',
900
+ 'MenuHamburger'
901
+ ],
902
+ [
903
+ 'Shuffle',
904
+ 'Shuffle'
905
+ ],
906
+ [
907
+ 'SmallCaps',
908
+ 'TextCapsSmall'
909
+ ],
910
+ [
911
+ 'SocialNetwork',
912
+ 'SocialNetwork'
913
+ ],
914
+ [
915
+ 'SortOrderDown',
916
+ 'SortDown'
917
+ ],
918
+ [
919
+ 'SortOrderUp',
920
+ 'SortUp'
921
+ ],
922
+ [
923
+ 'Star',
924
+ 'StarFilled'
925
+ ],
926
+ [
927
+ 'StarOutline',
928
+ 'Star'
929
+ ],
930
+ [
931
+ 'StepBackward',
932
+ 'StepBackward'
933
+ ],
934
+ [
935
+ 'StepForward',
936
+ 'StepForward'
937
+ ],
938
+ [
939
+ 'StrokeWidth',
940
+ 'StrokeWidth'
941
+ ],
942
+ [
943
+ 'Switch',
944
+ 'Switch'
945
+ ],
946
+ [
947
+ 'Table',
948
+ 'Table'
949
+ ],
950
+ [
951
+ 'Target',
952
+ 'Target'
953
+ ],
954
+ [
955
+ 'TaskList',
956
+ 'ListMultiSelect'
957
+ ],
958
+ [
959
+ 'Temperature',
960
+ 'Temperature'
961
+ ],
962
+ [
963
+ 'Text',
964
+ 'Text'
965
+ ],
966
+ [
967
+ 'TextAdd',
968
+ 'TextAdd'
969
+ ],
970
+ [
971
+ 'TextAlignCenter',
972
+ 'TextAlignCenter'
973
+ ],
974
+ [
975
+ 'TextAlignJustify',
976
+ 'TextAlignJustify'
977
+ ],
978
+ [
979
+ 'TextAlignLeft',
980
+ 'TextAlignLeft'
981
+ ],
982
+ [
983
+ 'TextAlignRight',
984
+ 'TextAlignRight'
985
+ ],
986
+ [
987
+ 'TextBold',
988
+ 'TextBold'
989
+ ],
990
+ [
991
+ 'TextBulleted',
992
+ 'ListBulleted'
993
+ ],
994
+ [
995
+ 'TextItalic',
996
+ 'TextItalic'
997
+ ],
998
+ [
999
+ 'TextNumbered',
1000
+ 'ListNumbered'
1001
+ ],
1002
+ [
1003
+ 'TextParagraph',
1004
+ 'TextParagraph'
1005
+ ],
1006
+ [
1007
+ 'TextSize',
1008
+ 'TextSize'
1009
+ ],
1010
+ [
1011
+ 'TextStrikethrough',
1012
+ 'TextStrikeThrough'
1013
+ ],
1014
+ [
1015
+ 'TextSubscript',
1016
+ 'TextSubscript'
1017
+ ],
1018
+ [
1019
+ 'TextSuperscript',
1020
+ 'TextSuperscript'
1021
+ ],
1022
+ [
1023
+ 'TextUnderline',
1024
+ 'TextUnderline'
1025
+ ],
1026
+ [
1027
+ 'ThumbDown',
1028
+ 'ThumbDown'
1029
+ ],
1030
+ [
1031
+ 'ThumbDownOutline',
1032
+ 'ThumbDown'
1033
+ ],
1034
+ [
1035
+ 'ThumbUp',
1036
+ 'ThumbUp'
1037
+ ],
1038
+ [
1039
+ 'ThumbUpOutline',
1040
+ 'ThumbUp'
1041
+ ],
1042
+ [
1043
+ 'Tips',
1044
+ 'Lightbulb'
1045
+ ],
1046
+ [
1047
+ 'Transparency',
1048
+ 'ViewTransparency'
1049
+ ],
1050
+ [
1051
+ 'Underline',
1052
+ 'TextUnderline'
1053
+ ],
1054
+ [
1055
+ 'Undo',
1056
+ 'Undo'
1057
+ ],
1058
+ [
1059
+ 'Ungroup',
1060
+ 'GroupNo'
1061
+ ],
1062
+ [
1063
+ 'Unlink',
1064
+ 'UnLink'
1065
+ ],
1066
+ [
1067
+ 'UploadToCloud',
1068
+ 'UploadToCloud'
1069
+ ],
1070
+ [
1071
+ 'UploadToCloudOutline',
1072
+ 'UploadToCloud'
1073
+ ],
1074
+ [
1075
+ 'User',
1076
+ 'User'
1077
+ ],
1078
+ [
1079
+ 'UserAdd',
1080
+ 'UserAdd'
1081
+ ],
1082
+ [
1083
+ 'UserEdit',
1084
+ 'UserEdit'
1085
+ ],
1086
+ [
1087
+ 'UserGroup',
1088
+ 'UserGroup'
1089
+ ],
1090
+ [
1091
+ 'UserLock',
1092
+ 'UserLock'
1093
+ ],
1094
+ [
1095
+ 'UsersLock',
1096
+ 'UsersLock'
1097
+ ],
1098
+ [
1099
+ 'VectorDraw',
1100
+ 'VectorDraw'
1101
+ ],
1102
+ [
1103
+ 'VideoFilled',
1104
+ 'Filmstrip'
1105
+ ],
1106
+ [
1107
+ 'VideoOutline',
1108
+ 'Filmstrip'
1109
+ ],
1110
+ [
1111
+ 'ViewDay',
1112
+ 'CalendarDay'
1113
+ ],
1114
+ [
1115
+ 'ViewGrid',
1116
+ 'ViewGrid'
1117
+ ],
1118
+ [
1119
+ 'ViewList',
1120
+ 'ViewList'
1121
+ ],
1122
+ [
1123
+ 'ViewWeek',
1124
+ 'CalendarWeek'
1125
+ ],
1126
+ [
1127
+ 'Visibility',
1128
+ 'Visibility'
1129
+ ],
1130
+ [
1131
+ 'VisibilityOff',
1132
+ 'VisibilityOff'
1133
+ ],
1134
+ [
1135
+ 'VoiceOver',
1136
+ 'Microphone'
1137
+ ],
1138
+ [
1139
+ 'VolumeMute',
1140
+ 'VolumeOff'
1141
+ ],
1142
+ [
1143
+ 'VolumeOne',
1144
+ 'VolumeOne'
1145
+ ],
1146
+ [
1147
+ 'VolumeTwo',
1148
+ 'VolumeTwo'
1149
+ ],
1150
+ [
1151
+ 'WebPage',
1152
+ 'WebPage'
1153
+ ],
1154
+ [
1155
+ 'ZoomIn',
1156
+ 'ZoomIn'
1157
+ ],
1158
+ [
1159
+ 'ZoomOut',
1160
+ 'ZoomOut'
1161
+ ]
1162
+ ]);
@@ -44,14 +44,14 @@ async function s1_to_s2(options) {
44
44
  ` - Vite: ${chalk_1.default.underline('https://github.com/adobe/react-spectrum/tree/main/examples/s2-vite-project')}\n` +
45
45
  ` - Rollup: ${chalk_1.default.underline('https://github.com/adobe/react-spectrum/tree/main/examples/s2-rollup-starter-app')}\n` +
46
46
  ` - ESBuild: ${chalk_1.default.underline('https://github.com/adobe/react-spectrum/tree/main/examples/s2-esbuild-starter-app')}\n\n` +
47
- `or view documentation for the plugin here: ${chalk_1.default.underline('https://jsr.io/@unplugin/macros')}`);
47
+ `or view documentation here: ${chalk_1.default.underline('https://react-spectrum.adobe.com/s2/index.html?path=/docs/intro--docs#configuring-your-bundler')}`);
48
48
  }
49
49
  nextSteps.push('Handle remaining upgrades and run your project\'s linter or formatter.\n\n' +
50
50
  'There may have been some upgrades that we couldn\'t handle automatically. We marked these with comments containing:\n\n' +
51
51
  `${chalk_1.default.bold('TODO(S2-upgrade)')}\n\n` +
52
52
  'You should be able to search your codebase and handle these manually. \n\n' +
53
53
  'We also recommend running your project\'s code formatter (i.e. Prettier, ESLint) after the upgrade process to clean up any extraneous formatting from the codemod.\n\n' +
54
- `For additional help, reference the Spectrum 2 Migration Guide: ${chalk_1.default.underline('https://github.com/adobe/react-spectrum/tree/main/packages/@react-spectrum/codemods/s1-to-s2/UPGRADE.md')}`);
54
+ `For additional help, reference the Spectrum 2 Migration Guide: ${chalk_1.default.underline('https://react-spectrum.adobe.com/s2/index.html?path=/docs/migrating--docs')}`);
55
55
  console.log(boxen(`Next steps:\n\n ${nextSteps.map((step, i) => `${i + 1}. ${step}`).join('\n\n\n')}`, { borderStyle: 'round', padding: 1, borderColor: 'green' }));
56
56
  process.exit(0);
57
57
  }
@@ -38,7 +38,8 @@ async function installPackage(packageName, options) {
38
38
  }
39
39
  try {
40
40
  logger_js_1.default.info(`Installing ${chalk_1.default.bold(packageName)} using ${chalk_1.default.bold(packageManager.name)}...`);
41
- await execa(packageManager.name, [packageManager.installCommand, `${packageName}@latest`, options?.dev ? '-D' : undefined]);
41
+ const devFlag = options?.dev ? ['-D'] : [];
42
+ await execa(packageManager.name, [packageManager.installCommand, `${packageName}@latest`, ...devFlag]);
42
43
  logger_js_1.default.success(`Successfully installed ${chalk_1.default.bold(packageName)}!\n`);
43
44
  return true;
44
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/codemods",
3
- "version": "0.1.2-nightly.5032+bb05fdc36",
3
+ "version": "0.1.2-nightly.5038+3555336a9",
4
4
  "main": "dist/index.js",
5
5
  "source": "src/index.ts",
6
6
  "bin": "dist/index.js",
@@ -24,8 +24,8 @@
24
24
  "@babel/parser": "^7.24.5",
25
25
  "@babel/traverse": "^7.24.5",
26
26
  "@babel/types": "^7.24.5",
27
- "@react-spectrum/s2": "0.3.2-nightly.5032+bb05fdc36",
28
- "@react-types/shared": "3.0.0-nightly.3104+bb05fdc36",
27
+ "@react-spectrum/s2": "0.3.2-nightly.5038+3555336a9",
28
+ "@react-types/shared": "3.0.0-nightly.3110+3555336a9",
29
29
  "@types/node": "^20",
30
30
  "boxen": "^5.1.2",
31
31
  "build": "^0.1.4",
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "bb05fdc361ef3b536a63479c29cc86f90c097a10"
50
+ "gitHead": "3555336a951aed44bb51e55c131dcf7176fc4b59"
51
51
  }