@teambit/deprecation 1.0.397 → 1.0.399

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="0" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.component/deprecation@1.0.397" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.component/deprecation@1.0.399" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.component/deprecation-preview"]=t():e["teambit.component/deprecation-preview"]=t()}(self,(()=>(()=>{"use strict";var e={27448:(e,t,o)=>{var n={id:"teambit.component/deprecation@1.0.397",homepage:"https://bit.cloud/teambit/component/deprecation",exported:!0};function r(){const e=i(o(41594));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=n,i.__bit_component=n;const c=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/deprecation.svg"}));c.__bit_component=n,t.Logo=c},41594:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};o.r(n),o.d(n,{compositions:()=>f,compositions_metadata:()=>v,overview:()=>m});var r={};o.r(r),o.d(r,{default:()=>l});var i=o(27448);o(41594);const c=MdxJsReact,a=TeambitMdxUiMdxScopeContext;var p=["components"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},s.apply(null,arguments)}var d={},u="wrapper";function l(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;o[n]=e[n]}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.includes(o)||{}.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,p);return(0,c.mdx)(u,s({},d,o,{components:t,mdxType:"MDXLayout"}),(0,c.mdx)(a.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}l.isMDXComponent=!0;const f=[i],m=[r],v={compositions:[{displayName:"Logo",identifier:"Logo"}]};return n})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.component/deprecation-preview"]=t():e["teambit.component/deprecation-preview"]=t()}(self,(()=>(()=>{"use strict";var e={50906:(e,t,o)=>{var n={id:"teambit.component/deprecation@1.0.399",homepage:"https://bit.cloud/teambit/component/deprecation",exported:!0};function r(){const e=i(o(41594));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=n,i.__bit_component=n;const c=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/deprecation.svg"}));c.__bit_component=n,t.Logo=c},41594:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};o.r(n),o.d(n,{compositions:()=>f,compositions_metadata:()=>v,overview:()=>m});var r={};o.r(r),o.d(r,{default:()=>l});var i=o(50906);o(41594);const c=MdxJsReact,a=TeambitMdxUiMdxScopeContext;var p=["components"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},s.apply(null,arguments)}var d={},u="wrapper";function l(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;o[n]=e[n]}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.includes(o)||{}.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,p);return(0,c.mdx)(u,s({},d,o,{components:t,mdxType:"MDXLayout"}),(0,c.mdx)(a.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}l.isMDXComponent=!0;const f=[i],m=[r],v={compositions:[{displayName:"Logo",identifier:"Logo"}]};return n})()));
@@ -312,6 +312,156 @@
312
312
  "line": 96,
313
313
  "character": 3
314
314
  },
315
+ "signature": "(method) DeprecationMain.deprecateByCLIValues(id: string, newId?: string, range?: string): Promise<boolean>",
316
+ "name": "deprecateByCLIValues",
317
+ "params": [
318
+ {
319
+ "__schema": "ParameterSchema",
320
+ "location": {
321
+ "filePath": "deprecation.main.runtime.ts",
322
+ "line": 96,
323
+ "character": 30
324
+ },
325
+ "name": "id",
326
+ "type": {
327
+ "__schema": "KeywordTypeSchema",
328
+ "location": {
329
+ "filePath": "deprecation.main.runtime.ts",
330
+ "line": 96,
331
+ "character": 34
332
+ },
333
+ "name": "string"
334
+ },
335
+ "isOptional": false,
336
+ "isSpread": false
337
+ },
338
+ {
339
+ "__schema": "ParameterSchema",
340
+ "location": {
341
+ "filePath": "deprecation.main.runtime.ts",
342
+ "line": 96,
343
+ "character": 42
344
+ },
345
+ "name": "newId",
346
+ "type": {
347
+ "__schema": "KeywordTypeSchema",
348
+ "location": {
349
+ "filePath": "deprecation.main.runtime.ts",
350
+ "line": 96,
351
+ "character": 50
352
+ },
353
+ "name": "string"
354
+ },
355
+ "isOptional": true,
356
+ "isSpread": false
357
+ },
358
+ {
359
+ "__schema": "ParameterSchema",
360
+ "location": {
361
+ "filePath": "deprecation.main.runtime.ts",
362
+ "line": 96,
363
+ "character": 58
364
+ },
365
+ "name": "range",
366
+ "type": {
367
+ "__schema": "KeywordTypeSchema",
368
+ "location": {
369
+ "filePath": "deprecation.main.runtime.ts",
370
+ "line": 96,
371
+ "character": 66
372
+ },
373
+ "name": "string"
374
+ },
375
+ "isOptional": true,
376
+ "isSpread": false
377
+ }
378
+ ],
379
+ "returnType": {
380
+ "__schema": "TypeRefSchema",
381
+ "location": {
382
+ "filePath": "deprecation.main.runtime.ts",
383
+ "line": 96,
384
+ "character": 75
385
+ },
386
+ "name": "Promise",
387
+ "typeArgs": [
388
+ {
389
+ "__schema": "KeywordTypeSchema",
390
+ "location": {
391
+ "filePath": "deprecation.main.runtime.ts",
392
+ "line": 96,
393
+ "character": 83
394
+ },
395
+ "name": "boolean"
396
+ }
397
+ ]
398
+ },
399
+ "modifiers": [
400
+ "async"
401
+ ]
402
+ },
403
+ {
404
+ "__schema": "FunctionLikeSchema",
405
+ "location": {
406
+ "filePath": "deprecation.main.runtime.ts",
407
+ "line": 102,
408
+ "character": 3
409
+ },
410
+ "signature": "(method) DeprecationMain.unDeprecateByCLIValues(id: string): Promise<boolean>",
411
+ "name": "unDeprecateByCLIValues",
412
+ "params": [
413
+ {
414
+ "__schema": "ParameterSchema",
415
+ "location": {
416
+ "filePath": "deprecation.main.runtime.ts",
417
+ "line": 102,
418
+ "character": 32
419
+ },
420
+ "name": "id",
421
+ "type": {
422
+ "__schema": "KeywordTypeSchema",
423
+ "location": {
424
+ "filePath": "deprecation.main.runtime.ts",
425
+ "line": 102,
426
+ "character": 36
427
+ },
428
+ "name": "string"
429
+ },
430
+ "isOptional": false,
431
+ "isSpread": false
432
+ }
433
+ ],
434
+ "returnType": {
435
+ "__schema": "TypeRefSchema",
436
+ "location": {
437
+ "filePath": "deprecation.main.runtime.ts",
438
+ "line": 102,
439
+ "character": 45
440
+ },
441
+ "name": "Promise",
442
+ "typeArgs": [
443
+ {
444
+ "__schema": "KeywordTypeSchema",
445
+ "location": {
446
+ "filePath": "deprecation.main.runtime.ts",
447
+ "line": 102,
448
+ "character": 53
449
+ },
450
+ "name": "boolean"
451
+ }
452
+ ]
453
+ },
454
+ "modifiers": [
455
+ "async"
456
+ ]
457
+ },
458
+ {
459
+ "__schema": "FunctionLikeSchema",
460
+ "location": {
461
+ "filePath": "deprecation.main.runtime.ts",
462
+ "line": 107,
463
+ "character": 3
464
+ },
315
465
  "signature": "(method) DeprecationMain.unDeprecate(componentId: ComponentID): Promise<boolean>",
316
466
  "name": "unDeprecate",
317
467
  "params": [
@@ -319,7 +469,7 @@
319
469
  "__schema": "ParameterSchema",
320
470
  "location": {
321
471
  "filePath": "deprecation.main.runtime.ts",
322
- "line": 96,
472
+ "line": 107,
323
473
  "character": 21
324
474
  },
325
475
  "name": "componentId",
@@ -327,7 +477,7 @@
327
477
  "__schema": "TypeRefSchema",
328
478
  "location": {
329
479
  "filePath": "deprecation.main.runtime.ts",
330
- "line": 96,
480
+ "line": 107,
331
481
  "character": 34
332
482
  },
333
483
  "name": "ComponentID"
@@ -340,7 +490,7 @@
340
490
  "__schema": "InferenceTypeSchema",
341
491
  "location": {
342
492
  "filePath": "deprecation.main.runtime.ts",
343
- "line": 96,
493
+ "line": 107,
344
494
  "character": 3
345
495
  },
346
496
  "type": "Promise<boolean>"
@@ -353,7 +503,7 @@
353
503
  "__schema": "FunctionLikeSchema",
354
504
  "location": {
355
505
  "filePath": "deprecation.main.runtime.ts",
356
- "line": 106,
506
+ "line": 117,
357
507
  "character": 3
358
508
  },
359
509
  "signature": "(method) DeprecationMain.addDeprecatedDependenciesIssues(components: Component[]): Promise<void>",
@@ -363,7 +513,7 @@
363
513
  "__schema": "ParameterSchema",
364
514
  "location": {
365
515
  "filePath": "deprecation.main.runtime.ts",
366
- "line": 106,
516
+ "line": 117,
367
517
  "character": 41
368
518
  },
369
519
  "name": "components",
@@ -371,14 +521,14 @@
371
521
  "__schema": "TypeArraySchema",
372
522
  "location": {
373
523
  "filePath": "deprecation.main.runtime.ts",
374
- "line": 106,
524
+ "line": 117,
375
525
  "character": 53
376
526
  },
377
527
  "type": {
378
528
  "__schema": "TypeRefSchema",
379
529
  "location": {
380
530
  "filePath": "deprecation.main.runtime.ts",
381
- "line": 106,
531
+ "line": 117,
382
532
  "character": 53
383
533
  },
384
534
  "name": "Component"
@@ -392,7 +542,7 @@
392
542
  "__schema": "InferenceTypeSchema",
393
543
  "location": {
394
544
  "filePath": "deprecation.main.runtime.ts",
395
- "line": 106,
545
+ "line": 117,
396
546
  "character": 3
397
547
  },
398
548
  "type": "Promise<void>"
@@ -405,7 +555,7 @@
405
555
  "__schema": "VariableLikeSchema",
406
556
  "location": {
407
557
  "filePath": "deprecation.main.runtime.ts",
408
- "line": 144,
558
+ "line": 155,
409
559
  "character": 3
410
560
  },
411
561
  "signature": "(property) DeprecationMain.runtime: RuntimeDefinition",
@@ -414,7 +564,7 @@
414
564
  "__schema": "InferenceTypeSchema",
415
565
  "location": {
416
566
  "filePath": "deprecation.main.runtime.ts",
417
- "line": 144,
567
+ "line": 155,
418
568
  "character": 3
419
569
  },
420
570
  "type": "RuntimeDefinition"
@@ -426,7 +576,7 @@
426
576
  "__schema": "VariableLikeSchema",
427
577
  "location": {
428
578
  "filePath": "deprecation.main.runtime.ts",
429
- "line": 145,
579
+ "line": 156,
430
580
  "character": 3
431
581
  },
432
582
  "signature": "(property) DeprecationMain.dependencies: Aspect[]",
@@ -435,7 +585,7 @@
435
585
  "__schema": "InferenceTypeSchema",
436
586
  "location": {
437
587
  "filePath": "deprecation.main.runtime.ts",
438
- "line": 145,
588
+ "line": 156,
439
589
  "character": 3
440
590
  },
441
591
  "type": "Aspect[]"
@@ -447,7 +597,7 @@
447
597
  "__schema": "FunctionLikeSchema",
448
598
  "location": {
449
599
  "filePath": "deprecation.main.runtime.ts",
450
- "line": 154,
600
+ "line": 165,
451
601
  "character": 3
452
602
  },
453
603
  "signature": "(method) DeprecationMain.provider([graphql, scope, componentAspect, workspace, cli, depsResolver, issues]: [\n GraphqlMain,\n ScopeMain,\n ComponentMain,\n Workspace,\n CLIMain,\n DependencyResolverMain,\n IssuesMain\n]): Promise<DeprecationMain>",
@@ -457,7 +607,7 @@
457
607
  "__schema": "ParameterSchema",
458
608
  "location": {
459
609
  "filePath": "deprecation.main.runtime.ts",
460
- "line": 154,
610
+ "line": 165,
461
611
  "character": 25
462
612
  },
463
613
  "name": "[ graphql, scope, componentAspect, workspace, cli, depsResolver, issues ]",
@@ -465,7 +615,7 @@
465
615
  "__schema": "TupleTypeSchema",
466
616
  "location": {
467
617
  "filePath": "deprecation.main.runtime.ts",
468
- "line": 154,
618
+ "line": 165,
469
619
  "character": 98
470
620
  },
471
621
  "elements": [
@@ -473,7 +623,7 @@
473
623
  "__schema": "TypeRefSchema",
474
624
  "location": {
475
625
  "filePath": "deprecation.main.runtime.ts",
476
- "line": 155,
626
+ "line": 166,
477
627
  "character": 5
478
628
  },
479
629
  "name": "GraphqlMain"
@@ -482,7 +632,7 @@
482
632
  "__schema": "TypeRefSchema",
483
633
  "location": {
484
634
  "filePath": "deprecation.main.runtime.ts",
485
- "line": 156,
635
+ "line": 167,
486
636
  "character": 5
487
637
  },
488
638
  "name": "ScopeMain"
@@ -491,7 +641,7 @@
491
641
  "__schema": "TypeRefSchema",
492
642
  "location": {
493
643
  "filePath": "deprecation.main.runtime.ts",
494
- "line": 157,
644
+ "line": 168,
495
645
  "character": 5
496
646
  },
497
647
  "name": "ComponentMain"
@@ -500,7 +650,7 @@
500
650
  "__schema": "TypeRefSchema",
501
651
  "location": {
502
652
  "filePath": "deprecation.main.runtime.ts",
503
- "line": 158,
653
+ "line": 169,
504
654
  "character": 5
505
655
  },
506
656
  "name": "Workspace"
@@ -509,7 +659,7 @@
509
659
  "__schema": "TypeRefSchema",
510
660
  "location": {
511
661
  "filePath": "deprecation.main.runtime.ts",
512
- "line": 159,
662
+ "line": 170,
513
663
  "character": 5
514
664
  },
515
665
  "name": "CLIMain"
@@ -518,7 +668,7 @@
518
668
  "__schema": "TypeRefSchema",
519
669
  "location": {
520
670
  "filePath": "deprecation.main.runtime.ts",
521
- "line": 160,
671
+ "line": 171,
522
672
  "character": 5
523
673
  },
524
674
  "name": "DependencyResolverMain"
@@ -527,7 +677,7 @@
527
677
  "__schema": "TypeRefSchema",
528
678
  "location": {
529
679
  "filePath": "deprecation.main.runtime.ts",
530
- "line": 161,
680
+ "line": 172,
531
681
  "character": 5
532
682
  },
533
683
  "name": "IssuesMain"
@@ -542,7 +692,7 @@
542
692
  "__schema": "InferenceTypeSchema",
543
693
  "location": {
544
694
  "filePath": "deprecation.main.runtime.ts",
545
- "line": 154,
695
+ "line": 165,
546
696
  "character": 3
547
697
  },
548
698
  "type": "Promise<DeprecationMain>"
@@ -1335,6 +1485,156 @@
1335
1485
  "line": 96,
1336
1486
  "character": 3
1337
1487
  },
1488
+ "signature": "(method) DeprecationMain.deprecateByCLIValues(id: string, newId?: string, range?: string): Promise<boolean>",
1489
+ "name": "deprecateByCLIValues",
1490
+ "params": [
1491
+ {
1492
+ "__schema": "ParameterSchema",
1493
+ "location": {
1494
+ "filePath": "deprecation.main.runtime.ts",
1495
+ "line": 96,
1496
+ "character": 30
1497
+ },
1498
+ "name": "id",
1499
+ "type": {
1500
+ "__schema": "KeywordTypeSchema",
1501
+ "location": {
1502
+ "filePath": "deprecation.main.runtime.ts",
1503
+ "line": 96,
1504
+ "character": 34
1505
+ },
1506
+ "name": "string"
1507
+ },
1508
+ "isOptional": false,
1509
+ "isSpread": false
1510
+ },
1511
+ {
1512
+ "__schema": "ParameterSchema",
1513
+ "location": {
1514
+ "filePath": "deprecation.main.runtime.ts",
1515
+ "line": 96,
1516
+ "character": 42
1517
+ },
1518
+ "name": "newId",
1519
+ "type": {
1520
+ "__schema": "KeywordTypeSchema",
1521
+ "location": {
1522
+ "filePath": "deprecation.main.runtime.ts",
1523
+ "line": 96,
1524
+ "character": 50
1525
+ },
1526
+ "name": "string"
1527
+ },
1528
+ "isOptional": true,
1529
+ "isSpread": false
1530
+ },
1531
+ {
1532
+ "__schema": "ParameterSchema",
1533
+ "location": {
1534
+ "filePath": "deprecation.main.runtime.ts",
1535
+ "line": 96,
1536
+ "character": 58
1537
+ },
1538
+ "name": "range",
1539
+ "type": {
1540
+ "__schema": "KeywordTypeSchema",
1541
+ "location": {
1542
+ "filePath": "deprecation.main.runtime.ts",
1543
+ "line": 96,
1544
+ "character": 66
1545
+ },
1546
+ "name": "string"
1547
+ },
1548
+ "isOptional": true,
1549
+ "isSpread": false
1550
+ }
1551
+ ],
1552
+ "returnType": {
1553
+ "__schema": "TypeRefSchema",
1554
+ "location": {
1555
+ "filePath": "deprecation.main.runtime.ts",
1556
+ "line": 96,
1557
+ "character": 75
1558
+ },
1559
+ "name": "Promise",
1560
+ "typeArgs": [
1561
+ {
1562
+ "__schema": "KeywordTypeSchema",
1563
+ "location": {
1564
+ "filePath": "deprecation.main.runtime.ts",
1565
+ "line": 96,
1566
+ "character": 83
1567
+ },
1568
+ "name": "boolean"
1569
+ }
1570
+ ]
1571
+ },
1572
+ "modifiers": [
1573
+ "async"
1574
+ ]
1575
+ },
1576
+ {
1577
+ "__schema": "FunctionLikeSchema",
1578
+ "location": {
1579
+ "filePath": "deprecation.main.runtime.ts",
1580
+ "line": 102,
1581
+ "character": 3
1582
+ },
1583
+ "signature": "(method) DeprecationMain.unDeprecateByCLIValues(id: string): Promise<boolean>",
1584
+ "name": "unDeprecateByCLIValues",
1585
+ "params": [
1586
+ {
1587
+ "__schema": "ParameterSchema",
1588
+ "location": {
1589
+ "filePath": "deprecation.main.runtime.ts",
1590
+ "line": 102,
1591
+ "character": 32
1592
+ },
1593
+ "name": "id",
1594
+ "type": {
1595
+ "__schema": "KeywordTypeSchema",
1596
+ "location": {
1597
+ "filePath": "deprecation.main.runtime.ts",
1598
+ "line": 102,
1599
+ "character": 36
1600
+ },
1601
+ "name": "string"
1602
+ },
1603
+ "isOptional": false,
1604
+ "isSpread": false
1605
+ }
1606
+ ],
1607
+ "returnType": {
1608
+ "__schema": "TypeRefSchema",
1609
+ "location": {
1610
+ "filePath": "deprecation.main.runtime.ts",
1611
+ "line": 102,
1612
+ "character": 45
1613
+ },
1614
+ "name": "Promise",
1615
+ "typeArgs": [
1616
+ {
1617
+ "__schema": "KeywordTypeSchema",
1618
+ "location": {
1619
+ "filePath": "deprecation.main.runtime.ts",
1620
+ "line": 102,
1621
+ "character": 53
1622
+ },
1623
+ "name": "boolean"
1624
+ }
1625
+ ]
1626
+ },
1627
+ "modifiers": [
1628
+ "async"
1629
+ ]
1630
+ },
1631
+ {
1632
+ "__schema": "FunctionLikeSchema",
1633
+ "location": {
1634
+ "filePath": "deprecation.main.runtime.ts",
1635
+ "line": 107,
1636
+ "character": 3
1637
+ },
1338
1638
  "signature": "(method) DeprecationMain.unDeprecate(componentId: ComponentID): Promise<boolean>",
1339
1639
  "name": "unDeprecate",
1340
1640
  "params": [
@@ -1342,7 +1642,7 @@
1342
1642
  "__schema": "ParameterSchema",
1343
1643
  "location": {
1344
1644
  "filePath": "deprecation.main.runtime.ts",
1345
- "line": 96,
1645
+ "line": 107,
1346
1646
  "character": 21
1347
1647
  },
1348
1648
  "name": "componentId",
@@ -1350,7 +1650,7 @@
1350
1650
  "__schema": "TypeRefSchema",
1351
1651
  "location": {
1352
1652
  "filePath": "deprecation.main.runtime.ts",
1353
- "line": 96,
1653
+ "line": 107,
1354
1654
  "character": 34
1355
1655
  },
1356
1656
  "name": "ComponentID"
@@ -1363,7 +1663,7 @@
1363
1663
  "__schema": "InferenceTypeSchema",
1364
1664
  "location": {
1365
1665
  "filePath": "deprecation.main.runtime.ts",
1366
- "line": 96,
1666
+ "line": 107,
1367
1667
  "character": 3
1368
1668
  },
1369
1669
  "type": "Promise<boolean>"
@@ -1376,7 +1676,7 @@
1376
1676
  "__schema": "FunctionLikeSchema",
1377
1677
  "location": {
1378
1678
  "filePath": "deprecation.main.runtime.ts",
1379
- "line": 106,
1679
+ "line": 117,
1380
1680
  "character": 3
1381
1681
  },
1382
1682
  "signature": "(method) DeprecationMain.addDeprecatedDependenciesIssues(components: Component[]): Promise<void>",
@@ -1386,7 +1686,7 @@
1386
1686
  "__schema": "ParameterSchema",
1387
1687
  "location": {
1388
1688
  "filePath": "deprecation.main.runtime.ts",
1389
- "line": 106,
1689
+ "line": 117,
1390
1690
  "character": 41
1391
1691
  },
1392
1692
  "name": "components",
@@ -1394,14 +1694,14 @@
1394
1694
  "__schema": "TypeArraySchema",
1395
1695
  "location": {
1396
1696
  "filePath": "deprecation.main.runtime.ts",
1397
- "line": 106,
1697
+ "line": 117,
1398
1698
  "character": 53
1399
1699
  },
1400
1700
  "type": {
1401
1701
  "__schema": "TypeRefSchema",
1402
1702
  "location": {
1403
1703
  "filePath": "deprecation.main.runtime.ts",
1404
- "line": 106,
1704
+ "line": 117,
1405
1705
  "character": 53
1406
1706
  },
1407
1707
  "name": "Component"
@@ -1415,7 +1715,7 @@
1415
1715
  "__schema": "InferenceTypeSchema",
1416
1716
  "location": {
1417
1717
  "filePath": "deprecation.main.runtime.ts",
1418
- "line": 106,
1718
+ "line": 117,
1419
1719
  "character": 3
1420
1720
  },
1421
1721
  "type": "Promise<void>"
@@ -1428,7 +1728,7 @@
1428
1728
  "__schema": "VariableLikeSchema",
1429
1729
  "location": {
1430
1730
  "filePath": "deprecation.main.runtime.ts",
1431
- "line": 144,
1731
+ "line": 155,
1432
1732
  "character": 3
1433
1733
  },
1434
1734
  "signature": "(property) DeprecationMain.runtime: RuntimeDefinition",
@@ -1437,7 +1737,7 @@
1437
1737
  "__schema": "InferenceTypeSchema",
1438
1738
  "location": {
1439
1739
  "filePath": "deprecation.main.runtime.ts",
1440
- "line": 144,
1740
+ "line": 155,
1441
1741
  "character": 3
1442
1742
  },
1443
1743
  "type": "RuntimeDefinition"
@@ -1449,7 +1749,7 @@
1449
1749
  "__schema": "VariableLikeSchema",
1450
1750
  "location": {
1451
1751
  "filePath": "deprecation.main.runtime.ts",
1452
- "line": 145,
1752
+ "line": 156,
1453
1753
  "character": 3
1454
1754
  },
1455
1755
  "signature": "(property) DeprecationMain.dependencies: Aspect[]",
@@ -1458,7 +1758,7 @@
1458
1758
  "__schema": "InferenceTypeSchema",
1459
1759
  "location": {
1460
1760
  "filePath": "deprecation.main.runtime.ts",
1461
- "line": 145,
1761
+ "line": 156,
1462
1762
  "character": 3
1463
1763
  },
1464
1764
  "type": "Aspect[]"
@@ -1470,7 +1770,7 @@
1470
1770
  "__schema": "FunctionLikeSchema",
1471
1771
  "location": {
1472
1772
  "filePath": "deprecation.main.runtime.ts",
1473
- "line": 154,
1773
+ "line": 165,
1474
1774
  "character": 3
1475
1775
  },
1476
1776
  "signature": "(method) DeprecationMain.provider([graphql, scope, componentAspect, workspace, cli, depsResolver, issues]: [\n GraphqlMain,\n ScopeMain,\n ComponentMain,\n Workspace,\n CLIMain,\n DependencyResolverMain,\n IssuesMain\n]): Promise<DeprecationMain>",
@@ -1480,7 +1780,7 @@
1480
1780
  "__schema": "ParameterSchema",
1481
1781
  "location": {
1482
1782
  "filePath": "deprecation.main.runtime.ts",
1483
- "line": 154,
1783
+ "line": 165,
1484
1784
  "character": 25
1485
1785
  },
1486
1786
  "name": "[ graphql, scope, componentAspect, workspace, cli, depsResolver, issues ]",
@@ -1488,7 +1788,7 @@
1488
1788
  "__schema": "TupleTypeSchema",
1489
1789
  "location": {
1490
1790
  "filePath": "deprecation.main.runtime.ts",
1491
- "line": 154,
1791
+ "line": 165,
1492
1792
  "character": 98
1493
1793
  },
1494
1794
  "elements": [
@@ -1496,7 +1796,7 @@
1496
1796
  "__schema": "TypeRefSchema",
1497
1797
  "location": {
1498
1798
  "filePath": "deprecation.main.runtime.ts",
1499
- "line": 155,
1799
+ "line": 166,
1500
1800
  "character": 5
1501
1801
  },
1502
1802
  "name": "GraphqlMain"
@@ -1505,7 +1805,7 @@
1505
1805
  "__schema": "TypeRefSchema",
1506
1806
  "location": {
1507
1807
  "filePath": "deprecation.main.runtime.ts",
1508
- "line": 156,
1808
+ "line": 167,
1509
1809
  "character": 5
1510
1810
  },
1511
1811
  "name": "ScopeMain"
@@ -1514,7 +1814,7 @@
1514
1814
  "__schema": "TypeRefSchema",
1515
1815
  "location": {
1516
1816
  "filePath": "deprecation.main.runtime.ts",
1517
- "line": 157,
1817
+ "line": 168,
1518
1818
  "character": 5
1519
1819
  },
1520
1820
  "name": "ComponentMain"
@@ -1523,7 +1823,7 @@
1523
1823
  "__schema": "TypeRefSchema",
1524
1824
  "location": {
1525
1825
  "filePath": "deprecation.main.runtime.ts",
1526
- "line": 158,
1826
+ "line": 169,
1527
1827
  "character": 5
1528
1828
  },
1529
1829
  "name": "Workspace"
@@ -1532,7 +1832,7 @@
1532
1832
  "__schema": "TypeRefSchema",
1533
1833
  "location": {
1534
1834
  "filePath": "deprecation.main.runtime.ts",
1535
- "line": 159,
1835
+ "line": 170,
1536
1836
  "character": 5
1537
1837
  },
1538
1838
  "name": "CLIMain"
@@ -1541,7 +1841,7 @@
1541
1841
  "__schema": "TypeRefSchema",
1542
1842
  "location": {
1543
1843
  "filePath": "deprecation.main.runtime.ts",
1544
- "line": 160,
1844
+ "line": 171,
1545
1845
  "character": 5
1546
1846
  },
1547
1847
  "name": "DependencyResolverMain"
@@ -1550,7 +1850,7 @@
1550
1850
  "__schema": "TypeRefSchema",
1551
1851
  "location": {
1552
1852
  "filePath": "deprecation.main.runtime.ts",
1553
- "line": 161,
1853
+ "line": 172,
1554
1854
  "character": 5
1555
1855
  },
1556
1856
  "name": "IssuesMain"
@@ -1565,7 +1865,7 @@
1565
1865
  "__schema": "InferenceTypeSchema",
1566
1866
  "location": {
1567
1867
  "filePath": "deprecation.main.runtime.ts",
1568
- "line": 154,
1868
+ "line": 165,
1569
1869
  "character": 3
1570
1870
  },
1571
1871
  "type": "Promise<DeprecationMain>"
@@ -1585,7 +1885,7 @@
1585
1885
  "__schema": "UnImplementedSchema",
1586
1886
  "location": {
1587
1887
  "filePath": "deprecation.main.runtime.ts",
1588
- "line": 173,
1888
+ "line": 184,
1589
1889
  "character": 1
1590
1890
  },
1591
1891
  "name": "DeprecationAspect.addRuntime(DeprecationMain);",
@@ -1644,7 +1944,7 @@
1644
1944
  "componentId": {
1645
1945
  "scope": "teambit.component",
1646
1946
  "name": "deprecation",
1647
- "version": "1.0.397"
1947
+ "version": "1.0.399"
1648
1948
  },
1649
1949
  "taggedModuleExports": []
1650
1950
  }
@@ -1,9 +1,7 @@
1
- import { Workspace } from '@teambit/workspace';
2
1
  import { Command, CommandOptions } from '@teambit/cli';
3
2
  import { DeprecationMain } from './deprecation.main.runtime';
4
3
  export declare class DeprecateCmd implements Command {
5
4
  private deprecation;
6
- private workspace;
7
5
  name: string;
8
6
  arguments: {
9
7
  name: string;
@@ -17,7 +15,7 @@ export declare class DeprecateCmd implements Command {
17
15
  loader: boolean;
18
16
  remoteOp: boolean;
19
17
  helpUrl: string;
20
- constructor(deprecation: DeprecationMain, workspace: Workspace);
18
+ constructor(deprecation: DeprecationMain);
21
19
  report([id]: [string], { newId, range }: {
22
20
  newId?: string;
23
21
  range?: string;
@@ -16,9 +16,8 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
16
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
17
17
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
18
  class DeprecateCmd {
19
- constructor(deprecation, workspace) {
19
+ constructor(deprecation) {
20
20
  this.deprecation = deprecation;
21
- this.workspace = workspace;
22
21
  _defineProperty(this, "name", 'deprecate <component-name>');
23
22
  _defineProperty(this, "arguments", [{
24
23
  name: 'component-name',
@@ -44,9 +43,7 @@ class DeprecateCmd {
44
43
  return _chalk().default.bold(`the component "${id}" is already deprecated. no changes have been made`);
45
44
  }
46
45
  async deprecate(id, newId, range) {
47
- const componentId = await this.workspace.resolveComponentId(id);
48
- const newComponentId = newId ? await this.workspace.resolveComponentId(newId) : undefined;
49
- return this.deprecation.deprecate(componentId, newComponentId, range);
46
+ return this.deprecation.deprecateByCLIValues(id, newId, range);
50
47
  }
51
48
  }
52
49
  exports.DeprecateCmd = DeprecateCmd;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeprecateCmd","constructor","deprecation","workspace","name","description","report","id","newId","range","result","deprecate","chalk","green","bold","componentId","resolveComponentId","newComponentId","undefined","exports"],"sources":["deprecate-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Workspace } from '@teambit/workspace';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { DeprecationMain } from './deprecation.main.runtime';\n\nexport class DeprecateCmd implements Command {\n name = 'deprecate <component-name>';\n arguments = [{ name: 'component-name', description: 'component name or component id' }];\n description = 'deprecate a component';\n group = 'collaborate';\n skipWorkspace = true;\n alias = 'd';\n options = [\n [\n '',\n 'new-id <string>',\n 'if replaced by another component, enter the new component id. alternatively use \"bit rename --deprecate\" to do this automatically',\n ],\n [\n '',\n 'range <string>',\n 'enter a Semver range to deprecate specific versions. see https://www.npmjs.com/package/semver#ranges for the range syntax',\n ],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n helpUrl = 'reference/components/removing-components';\n\n constructor(private deprecation: DeprecationMain, private workspace: Workspace) {}\n\n async report([id]: [string], { newId, range }: { newId?: string; range?: string }): Promise<string> {\n const result = await this.deprecate(id, newId, range);\n if (result) {\n return chalk.green(`the component \"${id}\" has been deprecated successfully`);\n }\n return chalk.bold(`the component \"${id}\" is already deprecated. no changes have been made`);\n }\n\n private async deprecate(id: string, newId?: string, range?: string): Promise<boolean> {\n const componentId = await this.workspace.resolveComponentId(id);\n const newComponentId = newId ? await this.workspace.resolveComponentId(newId) : undefined;\n return this.deprecation.deprecate(componentId, newComponentId, range);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,C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AAoC,CAAC;IAC9E;IACA,OAAOK,gBAAK,CAACE,IAAI,CAAC,kBAAkBP,EAAE,oDAAoD,CAAC;EAC7F;EAEA,MAAcI,SAASA,CAACJ,EAAU,EAAEC,KAAc,EAAEC,KAAc,EAAoB;IACpF,MAAMM,WAAW,GAAG,MAAM,IAAI,CAACZ,SAAS,CAACa,kBAAkB,CAACT,EAAE,CAAC;IAC/D,MAAMU,cAAc,GAAGT,KAAK,GAAG,MAAM,IAAI,CAACL,SAAS,CAACa,kBAAkB,CAACR,KAAK,CAAC,GAAGU,SAAS;IACzF,OAAO,IAAI,CAAChB,WAAW,CAACS,SAAS,CAACI,WAAW,EAAEE,cAAc,EAAER,KAAK,CAAC;EACvE;AACF;AAACU,OAAA,CAAAnB,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeprecateCmd","constructor","deprecation","name","description","report","id","newId","range","result","deprecate","chalk","green","bold","deprecateByCLIValues","exports"],"sources":["deprecate-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { DeprecationMain } from './deprecation.main.runtime';\n\nexport class DeprecateCmd implements Command {\n name = 'deprecate <component-name>';\n arguments = [{ name: 'component-name', description: 'component name or component id' }];\n description = 'deprecate a component';\n group = 'collaborate';\n skipWorkspace = true;\n alias = 'd';\n options = [\n [\n '',\n 'new-id <string>',\n 'if replaced by another component, enter the new component id. alternatively use \"bit rename --deprecate\" to do this automatically',\n ],\n [\n '',\n 'range <string>',\n 'enter a Semver range to deprecate specific versions. see https://www.npmjs.com/package/semver#ranges for the range syntax',\n ],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n helpUrl = 'reference/components/removing-components';\n\n constructor(private deprecation: DeprecationMain) {}\n\n async report([id]: [string], { newId, range }: { newId?: string; range?: string }): Promise<string> {\n const result = await this.deprecate(id, newId, range);\n if (result) {\n return chalk.green(`the component \"${id}\" has been deprecated successfully`);\n }\n return chalk.bold(`the component \"${id}\" is already deprecated. no changes have been made`);\n }\n\n private async deprecate(id: string, newId?: string, range?: string): Promise<boolean> {\n return this.deprecation.deprecateByCLIValues(id, newId, range);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAInB,MAAMgB,YAAY,CAAoB;EAuB3CC,WAAWA,CAASC,WAA4B,EAAE;IAAA,KAA9BA,WAA4B,GAA5BA,WAA4B;IAAApB,eAAA,eAtBzC,4BAA4B;IAAAA,eAAA,oBACvB,CAAC;MAAEqB,IAAI,EAAE,gBAAgB;MAAEC,WAAW,EAAE;IAAiC,CAAC,CAAC;IAAAtB,eAAA,sBACzE,uBAAuB;IAAAA,eAAA,gBAC7B,aAAa;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,gBACZ,GAAG;IAAAA,eAAA,kBACD,CACR,CACE,EAAE,EACF,iBAAiB,EACjB,mIAAmI,CACpI,EACD,CACE,EAAE,EACF,gBAAgB,EAChB,2HAA2H,CAC5H,CACF;IAAAA,eAAA,iBACQ,IAAI;IAAAA,eAAA,mBACF,IAAI;IAAAA,eAAA,kBACL,0CAA0C;EAED;EAEnD,MAAMuB,MAAMA,CAAC,CAACC,EAAE,CAAW,EAAE;IAAEC,KAAK;IAAEC;EAA0C,CAAC,EAAmB;IAClG,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACC,SAAS,CAACJ,EAAE,EAAEC,KAAK,EAAEC,KAAK,CAAC;IACrD,IAAIC,MAAM,EAAE;MACV,OAAOE,gBAAK,CAACC,KAAK,CAAC,kBAAkBN,EAAE,oCAAoC,CAAC;IAC9E;IACA,OAAOK,gBAAK,CAACE,IAAI,CAAC,kBAAkBP,EAAE,oDAAoD,CAAC;EAC7F;EAEA,MAAcI,SAASA,CAACJ,EAAU,EAAEC,KAAc,EAAEC,KAAc,EAAoB;IACpF,OAAO,IAAI,CAACN,WAAW,CAACY,oBAAoB,CAACR,EAAE,EAAEC,KAAK,EAAEC,KAAK,CAAC;EAChE;AACF;AAACO,OAAA,CAAAf,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -41,6 +41,8 @@ export declare class DeprecationMain {
41
41
  * @returns boolean whether or not the component has been deprecated
42
42
  */
43
43
  deprecate(componentId: ComponentID, newId?: ComponentID, range?: string): Promise<boolean>;
44
+ deprecateByCLIValues(id: string, newId?: string, range?: string): Promise<boolean>;
45
+ unDeprecateByCLIValues(id: string): Promise<boolean>;
44
46
  unDeprecate(componentId: ComponentID): Promise<boolean>;
45
47
  addDeprecatedDependenciesIssues(components: Component[]): Promise<void>;
46
48
  private addDeprecatedDepIssue;
@@ -167,6 +167,15 @@ class DeprecationMain {
167
167
  await this.workspace.bitMap.write(`deprecate ${componentId.toString()}`);
168
168
  return results;
169
169
  }
170
+ async deprecateByCLIValues(id, newId, range) {
171
+ const componentId = await this.workspace.resolveComponentId(id);
172
+ const newComponentId = newId ? await this.workspace.resolveComponentId(newId) : undefined;
173
+ return this.deprecate(componentId, newComponentId, range);
174
+ }
175
+ async unDeprecateByCLIValues(id) {
176
+ const componentId = await this.workspace.resolveComponentId(id);
177
+ return this.unDeprecate(componentId);
178
+ }
170
179
  async unDeprecate(componentId) {
171
180
  const results = this.workspace.bitMap.addComponentConfig(componentId, _deprecation().DeprecationAspect.id, {
172
181
  deprecate: false,
@@ -209,7 +218,7 @@ class DeprecationMain {
209
218
  static async provider([graphql, scope, componentAspect, workspace, cli, depsResolver, issues]) {
210
219
  const deprecation = new DeprecationMain(scope, workspace, depsResolver);
211
220
  issues.registerAddComponentsIssues(deprecation.addDeprecatedDependenciesIssues.bind(deprecation));
212
- cli.register(new (_deprecateCmd().DeprecateCmd)(deprecation, workspace), new (_undeprecateCmd().UndeprecateCmd)(deprecation, workspace));
221
+ cli.register(new (_deprecateCmd().DeprecateCmd)(deprecation), new (_undeprecateCmd().UndeprecateCmd)(deprecation));
213
222
  componentAspect.registerShowFragments([new (_deprecation3().DeprecationFragment)(deprecation)]);
214
223
  graphql.register((0, _deprecation2().deprecationSchema)(deprecation));
215
224
  return deprecation;
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_component","_scope","_workspace","_graphql","_deprecation","_deprecation2","_deprecation3","_deprecateCmd","_undeprecateCmd","_issues","_pMapSeries","_dependencyResolver","_lodash","_componentIssues","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeprecationMain","constructor","scope","workspace","depsResolver","getDeprecationInfo","component","headComponent","getHeadComponent","config","extensions","findExtension","DeprecationAspect","id","deprecatedBackwardCompatibility","state","_consumer","deprecated","isDeprecate","Boolean","deprecate","currentTag","getTag","isDeprecateByRange","range","semver","satisfies","version","newId","ComponentID","fromObject","toString","undefined","head","hash","headTag","headComp","get","changeVersion","Error","componentId","results","bitMap","addComponentConfig","toObject","write","unDeprecate","addDeprecatedDependenciesIssues","components","pMapSeries","addDeprecatedDepIssue","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","map","dep","isRemoved","isDeprecatedByIdWithoutLoadingComponent","removed","compact","length","issues","getOrCreate","IssuesClasses","DeprecatedDependencies","hasVersion","bitmapEntry","getBitmapEntryIfExist","isDeprecated","isUndeprecated","modelComp","getBitObjectModelComponent","legacyScope","objects","provider","graphql","componentAspect","cli","deprecation","registerAddComponentsIssues","bind","register","DeprecateCmd","UndeprecateCmd","registerShowFragments","DeprecationFragment","deprecationSchema","exports","MainRuntime","GraphqlAspect","ScopeAspect","ComponentAspect","WorkspaceAspect","CLIAspect","DependencyResolverAspect","IssuesAspect","addRuntime"],"sources":["deprecation.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\nimport { ComponentMain, ComponentAspect, Component, ComponentID } from '@teambit/component';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { ComponentIdObj } from '@teambit/component-id';\nimport { DeprecationAspect } from './deprecation.aspect';\nimport { deprecationSchema } from './deprecation.graphql';\nimport { DeprecationFragment } from './deprecation.fragment';\nimport { DeprecateCmd } from './deprecate-cmd';\nimport { UndeprecateCmd } from './undeprecate-cmd';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { compact } from 'lodash';\nimport { IssuesClasses } from '@teambit/component-issues';\n\nexport type DeprecationInfo = {\n isDeprecate: boolean;\n newId?: string;\n range?: string;\n};\n\nexport type DeprecationMetadata = {\n /**\n * whether the head is deprecated\n */\n deprecate?: boolean;\n /**\n * the new id to use instead of the current one\n */\n newId?: ComponentIdObj;\n /**\n * Semver range to deprecate previous versions\n */\n range?: string;\n};\n\nexport class DeprecationMain {\n constructor(private scope: ScopeMain, private workspace: Workspace, private depsResolver: DependencyResolverMain) {}\n\n async getDeprecationInfo(component: Component): Promise<DeprecationInfo> {\n const headComponent = await this.getHeadComponent(component);\n\n const data = headComponent.config.extensions.findExtension(DeprecationAspect.id)?.config as\n | DeprecationMetadata\n | undefined;\n const deprecatedBackwardCompatibility = component.state._consumer.deprecated;\n const isDeprecate = Boolean(data?.deprecate || deprecatedBackwardCompatibility);\n const currentTag = component.getTag();\n const isDeprecateByRange = Boolean(data?.range && currentTag && semver.satisfies(currentTag.version, data.range));\n const newId = data?.newId ? ComponentID.fromObject(data?.newId).toString() : undefined;\n return {\n isDeprecate: isDeprecate || isDeprecateByRange,\n newId,\n range: data?.range,\n };\n }\n\n private async getHeadComponent(component: Component): Promise<Component> {\n if (\n component.id.version &&\n component.head &&\n component.id.version !== component.head?.hash &&\n component.id.version !== component.headTag?.version.version\n ) {\n const headComp = this.workspace // if workspace exits, prefer using the workspace as it may be modified\n ? await this.workspace.get(component.id.changeVersion(undefined))\n : await this.scope.get(component.id.changeVersion(component.head.hash));\n if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);\n return headComp;\n }\n return component;\n }\n\n /**\n * mark a component as deprecated. after this change, the component will be modified.\n * tag and export the component to have it deprecated on the remote.\n *\n * @param componentId\n * @param newId\n * @returns boolean whether or not the component has been deprecated\n */\n async deprecate(componentId: ComponentID, newId?: ComponentID, range?: string): Promise<boolean> {\n const results = this.workspace.bitMap.addComponentConfig(componentId, DeprecationAspect.id, {\n deprecate: !range,\n newId: newId?.toObject(),\n range,\n });\n await this.workspace.bitMap.write(`deprecate ${componentId.toString()}`);\n\n return results;\n }\n\n async unDeprecate(componentId: ComponentID) {\n const results = this.workspace.bitMap.addComponentConfig(componentId, DeprecationAspect.id, {\n deprecate: false,\n newId: '',\n });\n await this.workspace.bitMap.write(`undeprecate ${componentId.toString()}`);\n\n return results;\n }\n\n async addDeprecatedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addDeprecatedDepIssue(component);\n });\n }\n\n private async addDeprecatedDepIssue(component: Component) {\n const dependencies = this.depsResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isDeprecatedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.DeprecatedDependencies).data = removed;\n }\n }\n\n /**\n * performant version of isDeprecated() in case the component object is not available and loading it is expensive.\n */\n private async isDeprecatedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isDeprecated()) return true;\n if (bitmapEntry && bitmapEntry.isUndeprecated()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId);\n if (!modelComp) return false;\n const isDeprecated = await modelComp.isDeprecated(\n this.workspace.scope.legacyScope.objects,\n componentId.version as string\n );\n return Boolean(isDeprecated);\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n GraphqlAspect,\n ScopeAspect,\n ComponentAspect,\n WorkspaceAspect,\n CLIAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ];\n static async provider([graphql, scope, componentAspect, workspace, cli, depsResolver, issues]: [\n GraphqlMain,\n ScopeMain,\n ComponentMain,\n Workspace,\n CLIMain,\n DependencyResolverMain,\n IssuesMain\n ]) {\n const deprecation = new DeprecationMain(scope, workspace, depsResolver);\n issues.registerAddComponentsIssues(deprecation.addDeprecatedDependenciesIssues.bind(deprecation));\n cli.register(new DeprecateCmd(deprecation, workspace), new UndeprecateCmd(deprecation, workspace));\n componentAspect.registerShowFragments([new DeprecationFragment(deprecation)]);\n graphql.register(deprecationSchema(deprecation));\n\n return deprecation;\n }\n}\n\nDeprecationAspect.addRuntime(DeprecationMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,aAAA;EAAA,MAAAR,IAAA,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;IACpF,IAAI,CAACgC,SAAS,EAAE,OAAO,KAAK;IAC5B,MAAMF,YAAY,GAAG,MAAME,SAAS,CAACF,YAAY,CAC/C,IAAI,CAACnE,SAAS,CAACD,KAAK,CAACwE,WAAW,CAACC,OAAO,EACxCnC,WAAW,CAACb,OACd,CAAC;IACD,OAAOR,OAAO,CAACmD,YAAY,CAAC;EAC9B;EAYA,aAAaM,QAAQA,CAAC,CAACC,OAAO,EAAE3E,KAAK,EAAE4E,eAAe,EAAE3E,SAAS,EAAE4E,GAAG,EAAE3E,YAAY,EAAE2D,MAAM,CAQ3F,EAAE;IACD,MAAMiB,WAAW,GAAG,IAAIhF,eAAe,CAACE,KAAK,EAAEC,SAAS,EAAEC,YAAY,CAAC;IACvE2D,MAAM,CAACkB,2BAA2B,CAACD,WAAW,CAACjC,+BAA+B,CAACmC,IAAI,CAACF,WAAW,CAAC,CAAC;IACjGD,GAAG,CAACI,QAAQ,CAAC,KAAIC,4BAAY,EAACJ,WAAW,EAAE7E,SAAS,CAAC,EAAE,KAAIkF,gCAAc,EAACL,WAAW,EAAE7E,SAAS,CAAC,CAAC;IAClG2E,eAAe,CAACQ,qBAAqB,CAAC,CAAC,KAAIC,mCAAmB,EAACP,WAAW,CAAC,CAAC,CAAC;IAC7EH,OAAO,CAACM,QAAQ,CAAC,IAAAK,iCAAiB,EAACR,WAAW,CAAC,CAAC;IAEhD,OAAOA,WAAW;EACpB;AACF;AAACS,OAAA,CAAAzF,eAAA,GAAAA,eAAA;AAAAlB,eAAA,CAnIYkB,eAAe,aAwGT0F,kBAAW;AAAA5G,eAAA,CAxGjBkB,eAAe,kBAyGJ,CACpB2F,wBAAa,EACbC,oBAAW,EACXC,4BAAe,EACfC,4BAAe,EACfC,gBAAS,EACTC,8CAAwB,EACxBC,sBAAY,CACb;AAoBHrF,gCAAiB,CAACsF,UAAU,CAAClG,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_component","_scope","_workspace","_graphql","_deprecation","_deprecation2","_deprecation3","_deprecateCmd","_undeprecateCmd","_issues","_pMapSeries","_dependencyResolver","_lodash","_componentIssues","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeprecationMain","constructor","scope","workspace","depsResolver","getDeprecationInfo","component","headComponent","getHeadComponent","config","extensions","findExtension","DeprecationAspect","id","deprecatedBackwardCompatibility","state","_consumer","deprecated","isDeprecate","Boolean","deprecate","currentTag","getTag","isDeprecateByRange","range","semver","satisfies","version","newId","ComponentID","fromObject","toString","undefined","head","hash","headTag","headComp","get","changeVersion","Error","componentId","results","bitMap","addComponentConfig","toObject","write","deprecateByCLIValues","resolveComponentId","newComponentId","unDeprecateByCLIValues","unDeprecate","addDeprecatedDependenciesIssues","components","pMapSeries","addDeprecatedDepIssue","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","map","dep","isRemoved","isDeprecatedByIdWithoutLoadingComponent","removed","compact","length","issues","getOrCreate","IssuesClasses","DeprecatedDependencies","hasVersion","bitmapEntry","getBitmapEntryIfExist","isDeprecated","isUndeprecated","modelComp","getBitObjectModelComponent","legacyScope","objects","provider","graphql","componentAspect","cli","deprecation","registerAddComponentsIssues","bind","register","DeprecateCmd","UndeprecateCmd","registerShowFragments","DeprecationFragment","deprecationSchema","exports","MainRuntime","GraphqlAspect","ScopeAspect","ComponentAspect","WorkspaceAspect","CLIAspect","DependencyResolverAspect","IssuesAspect","addRuntime"],"sources":["deprecation.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\nimport { ComponentMain, ComponentAspect, Component, ComponentID } from '@teambit/component';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { ComponentIdObj } from '@teambit/component-id';\nimport { DeprecationAspect } from './deprecation.aspect';\nimport { deprecationSchema } from './deprecation.graphql';\nimport { DeprecationFragment } from './deprecation.fragment';\nimport { DeprecateCmd } from './deprecate-cmd';\nimport { UndeprecateCmd } from './undeprecate-cmd';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { compact } from 'lodash';\nimport { IssuesClasses } from '@teambit/component-issues';\n\nexport type DeprecationInfo = {\n isDeprecate: boolean;\n newId?: string;\n range?: string;\n};\n\nexport type DeprecationMetadata = {\n /**\n * whether the head is deprecated\n */\n deprecate?: boolean;\n /**\n * the new id to use instead of the current one\n */\n newId?: ComponentIdObj;\n /**\n * Semver range to deprecate previous versions\n */\n range?: string;\n};\n\nexport class DeprecationMain {\n constructor(private scope: ScopeMain, private workspace: Workspace, private depsResolver: DependencyResolverMain) {}\n\n async getDeprecationInfo(component: Component): Promise<DeprecationInfo> {\n const headComponent = await this.getHeadComponent(component);\n\n const data = headComponent.config.extensions.findExtension(DeprecationAspect.id)?.config as\n | DeprecationMetadata\n | undefined;\n const deprecatedBackwardCompatibility = component.state._consumer.deprecated;\n const isDeprecate = Boolean(data?.deprecate || deprecatedBackwardCompatibility);\n const currentTag = component.getTag();\n const isDeprecateByRange = Boolean(data?.range && currentTag && semver.satisfies(currentTag.version, data.range));\n const newId = data?.newId ? ComponentID.fromObject(data?.newId).toString() : undefined;\n return {\n isDeprecate: isDeprecate || isDeprecateByRange,\n newId,\n range: data?.range,\n };\n }\n\n private async getHeadComponent(component: Component): Promise<Component> {\n if (\n component.id.version &&\n component.head &&\n component.id.version !== component.head?.hash &&\n component.id.version !== component.headTag?.version.version\n ) {\n const headComp = this.workspace // if workspace exits, prefer using the workspace as it may be modified\n ? await this.workspace.get(component.id.changeVersion(undefined))\n : await this.scope.get(component.id.changeVersion(component.head.hash));\n if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);\n return headComp;\n }\n return component;\n }\n\n /**\n * mark a component as deprecated. after this change, the component will be modified.\n * tag and export the component to have it deprecated on the remote.\n *\n * @param componentId\n * @param newId\n * @returns boolean whether or not the component has been deprecated\n */\n async deprecate(componentId: ComponentID, newId?: ComponentID, range?: string): Promise<boolean> {\n const results = this.workspace.bitMap.addComponentConfig(componentId, DeprecationAspect.id, {\n deprecate: !range,\n newId: newId?.toObject(),\n range,\n });\n await this.workspace.bitMap.write(`deprecate ${componentId.toString()}`);\n\n return results;\n }\n\n async deprecateByCLIValues(id: string, newId?: string, range?: string): Promise<boolean> {\n const componentId = await this.workspace.resolveComponentId(id);\n const newComponentId = newId ? await this.workspace.resolveComponentId(newId) : undefined;\n return this.deprecate(componentId, newComponentId, range);\n }\n\n async unDeprecateByCLIValues(id: string): Promise<boolean> {\n const componentId = await this.workspace.resolveComponentId(id);\n return this.unDeprecate(componentId);\n }\n\n async unDeprecate(componentId: ComponentID) {\n const results = this.workspace.bitMap.addComponentConfig(componentId, DeprecationAspect.id, {\n deprecate: false,\n newId: '',\n });\n await this.workspace.bitMap.write(`undeprecate ${componentId.toString()}`);\n\n return results;\n }\n\n async addDeprecatedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addDeprecatedDepIssue(component);\n });\n }\n\n private async addDeprecatedDepIssue(component: Component) {\n const dependencies = this.depsResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isDeprecatedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.DeprecatedDependencies).data = removed;\n }\n }\n\n /**\n * performant version of isDeprecated() in case the component object is not available and loading it is expensive.\n */\n private async isDeprecatedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isDeprecated()) return true;\n if (bitmapEntry && bitmapEntry.isUndeprecated()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId);\n if (!modelComp) return false;\n const isDeprecated = await modelComp.isDeprecated(\n this.workspace.scope.legacyScope.objects,\n componentId.version as string\n );\n return Boolean(isDeprecated);\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n GraphqlAspect,\n ScopeAspect,\n ComponentAspect,\n WorkspaceAspect,\n CLIAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ];\n static async provider([graphql, scope, componentAspect, workspace, cli, depsResolver, issues]: [\n GraphqlMain,\n ScopeMain,\n ComponentMain,\n Workspace,\n CLIMain,\n DependencyResolverMain,\n IssuesMain\n ]) {\n const deprecation = new DeprecationMain(scope, workspace, depsResolver);\n issues.registerAddComponentsIssues(deprecation.addDeprecatedDependenciesIssues.bind(deprecation));\n cli.register(new DeprecateCmd(deprecation), new UndeprecateCmd(deprecation));\n componentAspect.registerShowFragments([new DeprecationFragment(deprecation)]);\n graphql.register(deprecationSchema(deprecation));\n\n return deprecation;\n }\n}\n\nDeprecationAspect.addRuntime(DeprecationMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;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S,EAAEgF,GAAG,EAAE/E,YAAY,EAAE+D,MAAM,CAQ3F,EAAE;IACD,MAAMiB,WAAW,GAAG,IAAIpF,eAAe,CAACE,KAAK,EAAEC,SAAS,EAAEC,YAAY,CAAC;IACvE+D,MAAM,CAACkB,2BAA2B,CAACD,WAAW,CAACjC,+BAA+B,CAACmC,IAAI,CAACF,WAAW,CAAC,CAAC;IACjGD,GAAG,CAACI,QAAQ,CAAC,KAAIC,4BAAY,EAACJ,WAAW,CAAC,EAAE,KAAIK,gCAAc,EAACL,WAAW,CAAC,CAAC;IAC5EF,eAAe,CAACQ,qBAAqB,CAAC,CAAC,KAAIC,mCAAmB,EAACP,WAAW,CAAC,CAAC,CAAC;IAC7EH,OAAO,CAACM,QAAQ,CAAC,IAAAK,iCAAiB,EAACR,WAAW,CAAC,CAAC;IAEhD,OAAOA,WAAW;EACpB;AACF;AAACS,OAAA,CAAA7F,eAAA,GAAAA,eAAA;AAAAlB,eAAA,CA9IYkB,eAAe,aAmHT8F,kBAAW;AAAAhH,eAAA,CAnHjBkB,eAAe,kBAoHJ,CACpB+F,wBAAa,EACbC,oBAAW,EACXC,4BAAe,EACfC,4BAAe,EACfC,gBAAS,EACTC,8CAAwB,EACxBC,sBAAY,CACb;AAoBHzF,gCAAiB,CAAC0F,UAAU,CAACtG,eAAe,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.397/dist/deprecation.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.397/dist/deprecation.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.399/dist/deprecation.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.399/dist/deprecation.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -1,9 +1,7 @@
1
- import { Workspace } from '@teambit/workspace';
2
1
  import { Command, CommandOptions } from '@teambit/cli';
3
2
  import { DeprecationMain } from './deprecation.main.runtime';
4
3
  export declare class UndeprecateCmd implements Command {
5
4
  private deprecation;
6
- private workspace;
7
5
  name: string;
8
6
  group: string;
9
7
  description: string;
@@ -12,7 +10,6 @@ export declare class UndeprecateCmd implements Command {
12
10
  loader: boolean;
13
11
  skipWorkspace: boolean;
14
12
  remoteOp: boolean;
15
- constructor(deprecation: DeprecationMain, workspace: Workspace);
13
+ constructor(deprecation: DeprecationMain);
16
14
  report([id]: [string]): Promise<string>;
17
- private undeprecate;
18
15
  }
@@ -16,9 +16,8 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
16
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
17
17
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
18
  class UndeprecateCmd {
19
- constructor(deprecation, workspace) {
19
+ constructor(deprecation) {
20
20
  this.deprecation = deprecation;
21
- this.workspace = workspace;
22
21
  _defineProperty(this, "name", 'undeprecate <id>');
23
22
  _defineProperty(this, "group", 'collaborate');
24
23
  _defineProperty(this, "description", 'undeprecate a deprecated component (local/remote)');
@@ -29,16 +28,12 @@ class UndeprecateCmd {
29
28
  _defineProperty(this, "remoteOp", true);
30
29
  }
31
30
  async report([id]) {
32
- const result = await this.undeprecate(id);
31
+ const result = await this.deprecation.unDeprecateByCLIValues(id);
33
32
  if (result) {
34
33
  return _chalk().default.green(`the component "${id}" has been undeprecated successfully`);
35
34
  }
36
35
  return _chalk().default.bold(`the component "${id}" is not currently deprecated. no changes have been made`);
37
36
  }
38
- async undeprecate(id) {
39
- const componentId = await this.workspace.resolveComponentId(id);
40
- return this.deprecation.unDeprecate(componentId);
41
- }
42
37
  }
43
38
  exports.UndeprecateCmd = UndeprecateCmd;
44
39
 
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","UndeprecateCmd","constructor","deprecation","workspace","report","id","result","undeprecate","chalk","green","bold","componentId","resolveComponentId","unDeprecate","exports"],"sources":["undeprecate-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Workspace } from '@teambit/workspace';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { DeprecationMain } from './deprecation.main.runtime';\n\nexport class UndeprecateCmd implements Command {\n name = 'undeprecate <id>';\n group = 'collaborate';\n description = 'undeprecate a deprecated component (local/remote)';\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n skipWorkspace = true;\n remoteOp = true;\n\n constructor(private deprecation: DeprecationMain, private workspace: Workspace) {}\n\n async report([id]: [string]): Promise<string> {\n const result = await this.undeprecate(id);\n if (result) {\n return chalk.green(`the component \"${id}\" has been undeprecated successfully`);\n }\n return chalk.bold(`the component \"${id}\" is not currently deprecated. no changes have been made`);\n }\n\n private async undeprecate(id: string) {\n const componentId = await this.workspace.resolveComponentId(id);\n return this.deprecation.unDeprecate(componentId);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA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AC;IAChF;IACA,OAAOG,gBAAK,CAACE,IAAI,CAAC,kBAAkBL,EAAE,0DAA0D,CAAC;EACnG;EAEA,MAAcE,WAAWA,CAACF,EAAU,EAAE;IACpC,MAAMM,WAAW,GAAG,MAAM,IAAI,CAACR,SAAS,CAACS,kBAAkB,CAACP,EAAE,CAAC;IAC/D,OAAO,IAAI,CAACH,WAAW,CAACW,WAAW,CAACF,WAAW,CAAC;EAClD;AACF;AAACG,OAAA,CAAAd,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","UndeprecateCmd","constructor","deprecation","report","id","result","unDeprecateByCLIValues","chalk","green","bold","exports"],"sources":["undeprecate-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { DeprecationMain } from './deprecation.main.runtime';\n\nexport class UndeprecateCmd implements Command {\n name = 'undeprecate <id>';\n group = 'collaborate';\n description = 'undeprecate a deprecated component (local/remote)';\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n skipWorkspace = true;\n remoteOp = true;\n\n constructor(private deprecation: DeprecationMain) {}\n\n async report([id]: [string]): Promise<string> {\n const result = await this.deprecation.unDeprecateByCLIValues(id);\n if (result) {\n return chalk.green(`the component \"${id}\" has been undeprecated successfully`);\n }\n return chalk.bold(`the component \"${id}\" is not currently deprecated. no changes have been made`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EA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kBAAkBJ,EAAE,sCAAsC,CAAC;IAChF;IACA,OAAOG,gBAAK,CAACE,IAAI,CAAC,kBAAkBL,EAAE,0DAA0D,CAAC;EACnG;AACF;AAACM,OAAA,CAAAV,cAAA,GAAAA,cAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/deprecation",
3
- "version": "1.0.397",
3
+ "version": "1.0.399",
4
4
  "homepage": "https://bit.cloud/teambit/component/deprecation",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "deprecation",
9
- "version": "1.0.397"
9
+ "version": "1.0.399"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -17,16 +17,16 @@
17
17
  "@teambit/harmony": "0.4.6",
18
18
  "@teambit/component-id": "1.2.0",
19
19
  "@teambit/component.ui.component-deprecated": "0.0.39",
20
- "@teambit/cli": "0.0.974",
21
- "@teambit/workspace": "1.0.397",
22
- "@teambit/component": "1.0.397",
23
- "@teambit/graphql": "1.0.397",
20
+ "@teambit/cli": "0.0.976",
21
+ "@teambit/component": "1.0.399",
22
+ "@teambit/graphql": "1.0.399",
24
23
  "@teambit/component-issues": "0.0.150",
25
- "@teambit/dependency-resolver": "1.0.397",
26
- "@teambit/issues": "1.0.397",
27
- "@teambit/scope": "1.0.397",
28
- "@teambit/docs": "1.0.397",
29
- "@teambit/ui": "1.0.397"
24
+ "@teambit/dependency-resolver": "1.0.399",
25
+ "@teambit/issues": "1.0.399",
26
+ "@teambit/scope": "1.0.399",
27
+ "@teambit/workspace": "1.0.399",
28
+ "@teambit/docs": "1.0.399",
29
+ "@teambit/ui": "1.0.399"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/lodash": "4.14.165",