@teambit/preview 1.0.484 → 1.0.485

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,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="1" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.preview/preview@1.0.484" tests="1" failures="0" errors="0" skipped="0">
4
- <testcase classname="dist/bundler/create-peer-link.spec.js" name="should output snapshot" time="0.005"/>
3
+ <testsuite name="teambit.preview/preview@1.0.485" tests="1" failures="0" errors="0" skipped="0">
4
+ <testcase classname="dist/bundler/create-peer-link.spec.js" name="should output snapshot" time="0.004"/>
5
5
  </testsuite>
6
6
  </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.preview/preview-preview"]=t():e["teambit.preview/preview-preview"]=t()}(self,(()=>(()=>{"use strict";var e={48896:(e,t,n)=>{Object.defineProperty(t,"l",{enumerable:!0,get:function(){return o.default}});var o=r(n(57257));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.preview/aspect-docs/preview@0.0.168",homepage:"https://bit.cloud/teambit/preview/aspect-docs/preview",exported:!0}},57257:(e,t,n)=>{var o={id:"teambit.preview/aspect-docs/preview@0.0.168",homepage:"https://bit.cloud/teambit/preview/aspect-docs/preview",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=m,a(n(41594));var r=n(5016),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(null,arguments)}function p(e,t){if(null==e)return{};var n,o,r=l(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.includes(o))continue;n[o]=e[o]}return n}a.__bit_component=o,s.__bit_component=o,p.__bit_component=o,l.__bit_component=o;var d={},c="wrapper";function m(e){var t=e.components,n=p(e,i);return(0,r.mdx)(c,s({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"The Preview aspect handles the bundling and rendering of component compositions and documentation, for the Workspace UI and Scope UI."),(0,r.mdx)("p",null,"Preview is used to display components in development (on ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit start"),") as well as in their released versions (assets for the release version are generated as part of the build process)."),(0,r.mdx)("p",null,"The Preview aspect handles each component according to the configurations set by the environment that is used by that component. That means both the documentation and the component compositions will be bundled and displayed differently for different environments."),(0,r.mdx)("h2",null,"Rational"),(0,r.mdx)("p",null,"In a standard web application, UI components ",(0,r.mdx)("em",{parentName:"p"},"serving the same application")," are bundled together to produce the necessary assets to make them renderable by the browser."),(0,r.mdx)("p",null,"Components in a Bit workspace are not all in the service of the same application. Each component is authored, tagged and exported as an independent component.\nThat means a few things:"),(0,r.mdx)("ol",null,(0,r.mdx)("li",{parentName:"ol"},(0,r.mdx)("p",{parentName:"li"},"Components in a Bit workspace are not consumed ,directly or indirectly, by a single entry file (e.g, the app's ",(0,r.mdx)("inlineCode",{parentName:"p"},"index.js"),"). That makes it impossible for the bundler to follow the files needed to be bundled.")),(0,r.mdx)("li",{parentName:"ol"},(0,r.mdx)("p",{parentName:"li"},"Different components in a single workspace may be implemented using different technologies and bundled using different configurations or even different bundlers."))),(0,r.mdx)("p",null,"Preview solves the above challenges by creating a temporary entry file for each group of components using the same environment.\nIt then serves this file to the Bundler, to be bundled according to the environment and the purpose of bundling. That is, to display components in development or to display the components' release versions (for a \"production-level\" exhibition of the component's documentation and compositions)."),(0,r.mdx)("h2",null,"Usage"),(0,r.mdx)("h3",null,"Extending the Preview aspect"),(0,r.mdx)("p",null,"The preview aspect can be extended to generate other renderable artifacts , either when running Bit's development server or as part of the build pipeline (for a component's tagged version).\nThese artifacts can present additional information that assists in inspecting a component (for example, showing the results of accessibility tests)."))}m.__bit_component=o,m.isMDXComponent=!0},10459:(e,t,n)=>{var o={id:"teambit.preview/preview@1.0.484",homepage:"https://bit.cloud/teambit/preview/preview",exported:!0};function r(){const e=i(n(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=o,i.__bit_component=o;const a=()=>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/preview.svg"}));a.__bit_component=o,t.Logo=a},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};n.r(o),n.d(o,{compositions:()=>f,compositions_metadata:()=>b,overview:()=>v});var r={};n.r(r),n.d(r,{default:()=>u});var i=n(10459),a=(n(41594),n(5016));const s=TeambitMdxUiMdxScopeContext;var p=n(48896),l=["components"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(null,arguments)}var c={},m="wrapper";function u(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.includes(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,l);return(0,a.mdx)(m,d({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.mdx)(s.MDXScopeProvider,{components:{Preview:p.l},mdxType:"MDXScopeProvider"},(0,a.mdx)(p.l,{mdxType:"Preview"})))}u.isMDXComponent=!0;const f=[i],v=[r],b={compositions:[{displayName:"Logo",identifier:"Logo"}]};return o})()));
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.preview/preview-preview"]=t():e["teambit.preview/preview-preview"]=t()}(self,(()=>(()=>{"use strict";var e={48896:(e,t,n)=>{Object.defineProperty(t,"l",{enumerable:!0,get:function(){return o.default}});var o=r(n(57257));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.preview/aspect-docs/preview@0.0.168",homepage:"https://bit.cloud/teambit/preview/aspect-docs/preview",exported:!0}},57257:(e,t,n)=>{var o={id:"teambit.preview/aspect-docs/preview@0.0.168",homepage:"https://bit.cloud/teambit/preview/aspect-docs/preview",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=m,a(n(41594));var r=n(5016),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(null,arguments)}function p(e,t){if(null==e)return{};var n,o,r=l(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.includes(o))continue;n[o]=e[o]}return n}a.__bit_component=o,s.__bit_component=o,p.__bit_component=o,l.__bit_component=o;var d={},c="wrapper";function m(e){var t=e.components,n=p(e,i);return(0,r.mdx)(c,s({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"The Preview aspect handles the bundling and rendering of component compositions and documentation, for the Workspace UI and Scope UI."),(0,r.mdx)("p",null,"Preview is used to display components in development (on ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit start"),") as well as in their released versions (assets for the release version are generated as part of the build process)."),(0,r.mdx)("p",null,"The Preview aspect handles each component according to the configurations set by the environment that is used by that component. That means both the documentation and the component compositions will be bundled and displayed differently for different environments."),(0,r.mdx)("h2",null,"Rational"),(0,r.mdx)("p",null,"In a standard web application, UI components ",(0,r.mdx)("em",{parentName:"p"},"serving the same application")," are bundled together to produce the necessary assets to make them renderable by the browser."),(0,r.mdx)("p",null,"Components in a Bit workspace are not all in the service of the same application. Each component is authored, tagged and exported as an independent component.\nThat means a few things:"),(0,r.mdx)("ol",null,(0,r.mdx)("li",{parentName:"ol"},(0,r.mdx)("p",{parentName:"li"},"Components in a Bit workspace are not consumed ,directly or indirectly, by a single entry file (e.g, the app's ",(0,r.mdx)("inlineCode",{parentName:"p"},"index.js"),"). That makes it impossible for the bundler to follow the files needed to be bundled.")),(0,r.mdx)("li",{parentName:"ol"},(0,r.mdx)("p",{parentName:"li"},"Different components in a single workspace may be implemented using different technologies and bundled using different configurations or even different bundlers."))),(0,r.mdx)("p",null,"Preview solves the above challenges by creating a temporary entry file for each group of components using the same environment.\nIt then serves this file to the Bundler, to be bundled according to the environment and the purpose of bundling. That is, to display components in development or to display the components' release versions (for a \"production-level\" exhibition of the component's documentation and compositions)."),(0,r.mdx)("h2",null,"Usage"),(0,r.mdx)("h3",null,"Extending the Preview aspect"),(0,r.mdx)("p",null,"The preview aspect can be extended to generate other renderable artifacts , either when running Bit's development server or as part of the build pipeline (for a component's tagged version).\nThese artifacts can present additional information that assists in inspecting a component (for example, showing the results of accessibility tests)."))}m.__bit_component=o,m.isMDXComponent=!0},45626:(e,t,n)=>{var o={id:"teambit.preview/preview@1.0.485",homepage:"https://bit.cloud/teambit/preview/preview",exported:!0};function r(){const e=i(n(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=o,i.__bit_component=o;const a=()=>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/preview.svg"}));a.__bit_component=o,t.Logo=a},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};n.r(o),n.d(o,{compositions:()=>f,compositions_metadata:()=>b,overview:()=>v});var r={};n.r(r),n.d(r,{default:()=>u});var i=n(45626),a=(n(41594),n(5016));const s=TeambitMdxUiMdxScopeContext;var p=n(48896),l=["components"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(null,arguments)}var c={},m="wrapper";function u(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.includes(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,l);return(0,a.mdx)(m,d({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.mdx)(s.MDXScopeProvider,{components:{Preview:p.l},mdxType:"MDXScopeProvider"},(0,a.mdx)(p.l,{mdxType:"Preview"})))}u.isMDXComponent=!0;const f=[i],v=[r],b={compositions:[{displayName:"Logo",identifier:"Logo"}]};return o})()));
@@ -249,7 +249,7 @@
249
249
  "_legacy": {
250
250
  "scope": "teambit.preview",
251
251
  "name": "preview",
252
- "version": "1.0.484"
252
+ "version": "1.0.485"
253
253
  },
254
254
  "_scope": "teambit.preview"
255
255
  }
@@ -3373,6 +3373,108 @@
3373
3373
  },
3374
3374
  "modifiers": []
3375
3375
  },
3376
+ {
3377
+ "__schema": "FunctionLikeSchema",
3378
+ "location": {
3379
+ "filePath": "preview.main.runtime.ts",
3380
+ "line": 804,
3381
+ "character": 3
3382
+ },
3383
+ "signature": "(method) PreviewMain.writePreviewEntry(context: {\n components: Component[];\n}, aspectsIdsToNotFilterOut?: string[]): Promise<string>",
3384
+ "name": "writePreviewEntry",
3385
+ "params": [
3386
+ {
3387
+ "__schema": "ParameterSchema",
3388
+ "location": {
3389
+ "filePath": "preview.main.runtime.ts",
3390
+ "line": 804,
3391
+ "character": 27
3392
+ },
3393
+ "name": "context",
3394
+ "type": {
3395
+ "__schema": "TypeLiteralSchema",
3396
+ "location": {
3397
+ "filePath": "preview.main.runtime.ts",
3398
+ "line": 804,
3399
+ "character": 36
3400
+ },
3401
+ "members": [
3402
+ {
3403
+ "__schema": "VariableLikeSchema",
3404
+ "location": {
3405
+ "filePath": "preview.main.runtime.ts",
3406
+ "line": 804,
3407
+ "character": 38
3408
+ },
3409
+ "signature": "(property) components: Component[]",
3410
+ "name": "components",
3411
+ "type": {
3412
+ "__schema": "TypeArraySchema",
3413
+ "location": {
3414
+ "filePath": "preview.main.runtime.ts",
3415
+ "line": 804,
3416
+ "character": 50
3417
+ },
3418
+ "type": {
3419
+ "__schema": "TypeRefSchema",
3420
+ "location": {
3421
+ "filePath": "preview.main.runtime.ts",
3422
+ "line": 804,
3423
+ "character": 50
3424
+ },
3425
+ "name": "Component"
3426
+ }
3427
+ },
3428
+ "isOptional": false
3429
+ }
3430
+ ]
3431
+ },
3432
+ "isOptional": false,
3433
+ "isSpread": false
3434
+ },
3435
+ {
3436
+ "__schema": "ParameterSchema",
3437
+ "location": {
3438
+ "filePath": "preview.main.runtime.ts",
3439
+ "line": 804,
3440
+ "character": 65
3441
+ },
3442
+ "name": "aspectsIdsToNotFilterOut",
3443
+ "type": {
3444
+ "__schema": "TypeArraySchema",
3445
+ "location": {
3446
+ "filePath": "preview.main.runtime.ts",
3447
+ "line": 804,
3448
+ "character": 91
3449
+ },
3450
+ "type": {
3451
+ "__schema": "KeywordTypeSchema",
3452
+ "location": {
3453
+ "filePath": "preview.main.runtime.ts",
3454
+ "line": 804,
3455
+ "character": 91
3456
+ },
3457
+ "name": "string"
3458
+ }
3459
+ },
3460
+ "isOptional": true,
3461
+ "defaultValue": "[]",
3462
+ "isSpread": false
3463
+ }
3464
+ ],
3465
+ "returnType": {
3466
+ "__schema": "InferenceTypeSchema",
3467
+ "location": {
3468
+ "filePath": "preview.main.runtime.ts",
3469
+ "line": 804,
3470
+ "character": 3
3471
+ },
3472
+ "type": "Promise<string>"
3473
+ },
3474
+ "modifiers": [
3475
+ "async"
3476
+ ]
3477
+ },
3376
3478
  {
3377
3479
  "__schema": "FunctionLikeSchema",
3378
3480
  "location": {
@@ -3476,9 +3578,31 @@
3476
3578
  "__schema": "FunctionLikeSchema",
3477
3579
  "location": {
3478
3580
  "filePath": "preview.main.runtime.ts",
3479
- "line": 887,
3581
+ "line": 891,
3480
3582
  "character": 3
3481
3583
  },
3584
+ "doc": {
3585
+ "__schema": "DocSchema",
3586
+ "location": {
3587
+ "filePath": "preview.main.runtime.ts",
3588
+ "line": 887,
3589
+ "character": 3
3590
+ },
3591
+ "raw": "/**\n * @deprecated\n * use `writePreviewEntry` instead\n */",
3592
+ "comment": "",
3593
+ "tags": [
3594
+ {
3595
+ "__schema": "TagSchema",
3596
+ "location": {
3597
+ "filePath": "preview.main.runtime.ts",
3598
+ "line": 888,
3599
+ "character": 6
3600
+ },
3601
+ "tagName": "deprecated",
3602
+ "comment": "use `writePreviewEntry` instead"
3603
+ }
3604
+ ]
3605
+ },
3482
3606
  "signature": "(method) PreviewMain.writePreviewRuntime(context: {\n components: Component[];\n}, aspectsIdsToNotFilterOut?: string[]): Promise<string>",
3483
3607
  "name": "writePreviewRuntime",
3484
3608
  "params": [
@@ -3486,7 +3610,7 @@
3486
3610
  "__schema": "ParameterSchema",
3487
3611
  "location": {
3488
3612
  "filePath": "preview.main.runtime.ts",
3489
- "line": 887,
3613
+ "line": 891,
3490
3614
  "character": 29
3491
3615
  },
3492
3616
  "name": "context",
@@ -3494,7 +3618,7 @@
3494
3618
  "__schema": "TypeLiteralSchema",
3495
3619
  "location": {
3496
3620
  "filePath": "preview.main.runtime.ts",
3497
- "line": 887,
3621
+ "line": 891,
3498
3622
  "character": 38
3499
3623
  },
3500
3624
  "members": [
@@ -3502,7 +3626,7 @@
3502
3626
  "__schema": "VariableLikeSchema",
3503
3627
  "location": {
3504
3628
  "filePath": "preview.main.runtime.ts",
3505
- "line": 887,
3629
+ "line": 891,
3506
3630
  "character": 40
3507
3631
  },
3508
3632
  "signature": "(property) components: Component[]",
@@ -3511,14 +3635,14 @@
3511
3635
  "__schema": "TypeArraySchema",
3512
3636
  "location": {
3513
3637
  "filePath": "preview.main.runtime.ts",
3514
- "line": 887,
3638
+ "line": 891,
3515
3639
  "character": 52
3516
3640
  },
3517
3641
  "type": {
3518
3642
  "__schema": "TypeRefSchema",
3519
3643
  "location": {
3520
3644
  "filePath": "preview.main.runtime.ts",
3521
- "line": 887,
3645
+ "line": 891,
3522
3646
  "character": 52
3523
3647
  },
3524
3648
  "name": "Component"
@@ -3535,7 +3659,7 @@
3535
3659
  "__schema": "ParameterSchema",
3536
3660
  "location": {
3537
3661
  "filePath": "preview.main.runtime.ts",
3538
- "line": 887,
3662
+ "line": 891,
3539
3663
  "character": 67
3540
3664
  },
3541
3665
  "name": "aspectsIdsToNotFilterOut",
@@ -3543,14 +3667,14 @@
3543
3667
  "__schema": "TypeArraySchema",
3544
3668
  "location": {
3545
3669
  "filePath": "preview.main.runtime.ts",
3546
- "line": 887,
3670
+ "line": 891,
3547
3671
  "character": 93
3548
3672
  },
3549
3673
  "type": {
3550
3674
  "__schema": "KeywordTypeSchema",
3551
3675
  "location": {
3552
3676
  "filePath": "preview.main.runtime.ts",
3553
- "line": 887,
3677
+ "line": 891,
3554
3678
  "character": 93
3555
3679
  },
3556
3680
  "name": "string"
@@ -3565,7 +3689,7 @@
3565
3689
  "__schema": "InferenceTypeSchema",
3566
3690
  "location": {
3567
3691
  "filePath": "preview.main.runtime.ts",
3568
- "line": 887,
3692
+ "line": 891,
3569
3693
  "character": 3
3570
3694
  },
3571
3695
  "type": "Promise<string>"
@@ -6681,7 +6805,7 @@
6681
6805
  "_legacy": {
6682
6806
  "scope": "teambit.preview",
6683
6807
  "name": "preview",
6684
- "version": "1.0.484"
6808
+ "version": "1.0.485"
6685
6809
  },
6686
6810
  "_scope": "teambit.preview"
6687
6811
  }
@@ -10944,6 +11068,108 @@
10944
11068
  },
10945
11069
  "modifiers": []
10946
11070
  },
11071
+ {
11072
+ "__schema": "FunctionLikeSchema",
11073
+ "location": {
11074
+ "filePath": "preview.main.runtime.ts",
11075
+ "line": 804,
11076
+ "character": 3
11077
+ },
11078
+ "signature": "(method) PreviewMain.writePreviewEntry(context: {\n components: Component[];\n}, aspectsIdsToNotFilterOut?: string[]): Promise<string>",
11079
+ "name": "writePreviewEntry",
11080
+ "params": [
11081
+ {
11082
+ "__schema": "ParameterSchema",
11083
+ "location": {
11084
+ "filePath": "preview.main.runtime.ts",
11085
+ "line": 804,
11086
+ "character": 27
11087
+ },
11088
+ "name": "context",
11089
+ "type": {
11090
+ "__schema": "TypeLiteralSchema",
11091
+ "location": {
11092
+ "filePath": "preview.main.runtime.ts",
11093
+ "line": 804,
11094
+ "character": 36
11095
+ },
11096
+ "members": [
11097
+ {
11098
+ "__schema": "VariableLikeSchema",
11099
+ "location": {
11100
+ "filePath": "preview.main.runtime.ts",
11101
+ "line": 804,
11102
+ "character": 38
11103
+ },
11104
+ "signature": "(property) components: Component[]",
11105
+ "name": "components",
11106
+ "type": {
11107
+ "__schema": "TypeArraySchema",
11108
+ "location": {
11109
+ "filePath": "preview.main.runtime.ts",
11110
+ "line": 804,
11111
+ "character": 50
11112
+ },
11113
+ "type": {
11114
+ "__schema": "TypeRefSchema",
11115
+ "location": {
11116
+ "filePath": "preview.main.runtime.ts",
11117
+ "line": 804,
11118
+ "character": 50
11119
+ },
11120
+ "name": "Component"
11121
+ }
11122
+ },
11123
+ "isOptional": false
11124
+ }
11125
+ ]
11126
+ },
11127
+ "isOptional": false,
11128
+ "isSpread": false
11129
+ },
11130
+ {
11131
+ "__schema": "ParameterSchema",
11132
+ "location": {
11133
+ "filePath": "preview.main.runtime.ts",
11134
+ "line": 804,
11135
+ "character": 65
11136
+ },
11137
+ "name": "aspectsIdsToNotFilterOut",
11138
+ "type": {
11139
+ "__schema": "TypeArraySchema",
11140
+ "location": {
11141
+ "filePath": "preview.main.runtime.ts",
11142
+ "line": 804,
11143
+ "character": 91
11144
+ },
11145
+ "type": {
11146
+ "__schema": "KeywordTypeSchema",
11147
+ "location": {
11148
+ "filePath": "preview.main.runtime.ts",
11149
+ "line": 804,
11150
+ "character": 91
11151
+ },
11152
+ "name": "string"
11153
+ }
11154
+ },
11155
+ "isOptional": true,
11156
+ "defaultValue": "[]",
11157
+ "isSpread": false
11158
+ }
11159
+ ],
11160
+ "returnType": {
11161
+ "__schema": "InferenceTypeSchema",
11162
+ "location": {
11163
+ "filePath": "preview.main.runtime.ts",
11164
+ "line": 804,
11165
+ "character": 3
11166
+ },
11167
+ "type": "Promise<string>"
11168
+ },
11169
+ "modifiers": [
11170
+ "async"
11171
+ ]
11172
+ },
10947
11173
  {
10948
11174
  "__schema": "FunctionLikeSchema",
10949
11175
  "location": {
@@ -11047,9 +11273,31 @@
11047
11273
  "__schema": "FunctionLikeSchema",
11048
11274
  "location": {
11049
11275
  "filePath": "preview.main.runtime.ts",
11050
- "line": 887,
11276
+ "line": 891,
11051
11277
  "character": 3
11052
11278
  },
11279
+ "doc": {
11280
+ "__schema": "DocSchema",
11281
+ "location": {
11282
+ "filePath": "preview.main.runtime.ts",
11283
+ "line": 887,
11284
+ "character": 3
11285
+ },
11286
+ "raw": "/**\n * @deprecated\n * use `writePreviewEntry` instead\n */",
11287
+ "comment": "",
11288
+ "tags": [
11289
+ {
11290
+ "__schema": "TagSchema",
11291
+ "location": {
11292
+ "filePath": "preview.main.runtime.ts",
11293
+ "line": 888,
11294
+ "character": 6
11295
+ },
11296
+ "tagName": "deprecated",
11297
+ "comment": "use `writePreviewEntry` instead"
11298
+ }
11299
+ ]
11300
+ },
11053
11301
  "signature": "(method) PreviewMain.writePreviewRuntime(context: {\n components: Component[];\n}, aspectsIdsToNotFilterOut?: string[]): Promise<string>",
11054
11302
  "name": "writePreviewRuntime",
11055
11303
  "params": [
@@ -11057,7 +11305,7 @@
11057
11305
  "__schema": "ParameterSchema",
11058
11306
  "location": {
11059
11307
  "filePath": "preview.main.runtime.ts",
11060
- "line": 887,
11308
+ "line": 891,
11061
11309
  "character": 29
11062
11310
  },
11063
11311
  "name": "context",
@@ -11065,7 +11313,7 @@
11065
11313
  "__schema": "TypeLiteralSchema",
11066
11314
  "location": {
11067
11315
  "filePath": "preview.main.runtime.ts",
11068
- "line": 887,
11316
+ "line": 891,
11069
11317
  "character": 38
11070
11318
  },
11071
11319
  "members": [
@@ -11073,7 +11321,7 @@
11073
11321
  "__schema": "VariableLikeSchema",
11074
11322
  "location": {
11075
11323
  "filePath": "preview.main.runtime.ts",
11076
- "line": 887,
11324
+ "line": 891,
11077
11325
  "character": 40
11078
11326
  },
11079
11327
  "signature": "(property) components: Component[]",
@@ -11082,14 +11330,14 @@
11082
11330
  "__schema": "TypeArraySchema",
11083
11331
  "location": {
11084
11332
  "filePath": "preview.main.runtime.ts",
11085
- "line": 887,
11333
+ "line": 891,
11086
11334
  "character": 52
11087
11335
  },
11088
11336
  "type": {
11089
11337
  "__schema": "TypeRefSchema",
11090
11338
  "location": {
11091
11339
  "filePath": "preview.main.runtime.ts",
11092
- "line": 887,
11340
+ "line": 891,
11093
11341
  "character": 52
11094
11342
  },
11095
11343
  "name": "Component"
@@ -11106,7 +11354,7 @@
11106
11354
  "__schema": "ParameterSchema",
11107
11355
  "location": {
11108
11356
  "filePath": "preview.main.runtime.ts",
11109
- "line": 887,
11357
+ "line": 891,
11110
11358
  "character": 67
11111
11359
  },
11112
11360
  "name": "aspectsIdsToNotFilterOut",
@@ -11114,14 +11362,14 @@
11114
11362
  "__schema": "TypeArraySchema",
11115
11363
  "location": {
11116
11364
  "filePath": "preview.main.runtime.ts",
11117
- "line": 887,
11365
+ "line": 891,
11118
11366
  "character": 93
11119
11367
  },
11120
11368
  "type": {
11121
11369
  "__schema": "KeywordTypeSchema",
11122
11370
  "location": {
11123
11371
  "filePath": "preview.main.runtime.ts",
11124
- "line": 887,
11372
+ "line": 891,
11125
11373
  "character": 93
11126
11374
  },
11127
11375
  "name": "string"
@@ -11136,7 +11384,7 @@
11136
11384
  "__schema": "InferenceTypeSchema",
11137
11385
  "location": {
11138
11386
  "filePath": "preview.main.runtime.ts",
11139
- "line": 887,
11387
+ "line": 891,
11140
11388
  "character": 3
11141
11389
  },
11142
11390
  "type": "Promise<string>"
@@ -13785,7 +14033,7 @@
13785
14033
  "componentId": {
13786
14034
  "scope": "teambit.preview",
13787
14035
  "name": "preview",
13788
- "version": "1.0.484"
14036
+ "version": "1.0.485"
13789
14037
  },
13790
14038
  "taggedModuleExports": []
13791
14039
  }
@@ -181,7 +181,7 @@ class EnvPreviewTemplateTask {
181
181
  if (!capsule) throw new Error('no capsule found');
182
182
  // Passing here the env itself to make sure it's preview runtime will be part of the preview root file
183
183
  // that's needed to make sure the providers register there are running correctly
184
- const previewRoot = await this.preview.writePreviewRuntime(context, [envComponent.id.toString()]);
184
+ const previewRoot = await this.preview.writePreviewEntry(context, [envComponent.id.toString()]);
185
185
  const entries = await this.generateEntries({
186
186
  envDef,
187
187
  splitComponentBundle: envPreviewConfig.splitComponentBundle ?? false,
@@ -1 +1 @@
1
- {"version":3,"names":["_builder","data","require","_cli","_pMapSeries","_interopRequireDefault","_component","_path","_lodash","_fsExtra","_chunks","_htmlPlugin","_createPeersLink","_excluded","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_objectWithoutProperties","i","_objectWithoutPropertiesLoose","s","includes","propertyIsEnumerable","call","n","hasOwnProperty","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","GENERATE_ENV_TEMPLATE_TASK_NAME","exports","EnvPreviewTemplateTask","constructor","preview","envs","aspectLoader","dependencyResolver","logger","execute","context","previewDefs","getDefs","htmlConfig","map","previewModule","generateHtmlConfig","dev","originalSeedersIds","capsuleNetwork","originalSeedersCapsules","c","component","id","toString","grouped","mapSeries","components","undefined","envDef","getEnvFromComponent","env","bundlingStrategy","getBundlingStrategy","name","target","getEnvTargetFromComponent","shouldUseDefaultBundler","envToGetBundler","getEnvsEnvDefinition","groupEnvId","targets","isEmpty","componentsResults","runBundlerForGroups","groups","bundlerContext","assign","entry","development","metaData","initiator","envId","isEnvTemplate","bundlerResults","entries","targetsGroup","bundler","getTemplateBundler","bundlerResult","run","results","computeResults","flatten","isCoreEnv","envComponent","envPreviewConfig","getEnvPreviewConfig","peers","getPreviewHostDependenciesFromEnv","capsule","graphCapsules","getCapsule","Error","previewRoot","writePreviewRuntime","generateEntries","splitComponentBundle","workDir","path","outputPath","computeOutputPath","existsSync","mkdirpSync","resolvedEnvAspects","resolveAspects","MainRuntime","requestedOnly","filterByRuntime","resolvedEnv","hostRootDir","aspectPath","warn","html","chunking","splitChunks","hostDependencies","aliasHostDependencies","previewModules","getPreviewModules","previewEntries","_ref","rest","linkFile","writeLink","ComponentMap","create","peerLink","writePeerLink","generateTemplateEntries","previewRootPath","allResults","result","errors","err","message","warning","warnings","startTime","endTime","artifacts","getArtifactDef","modules","compact","Promise","all","def","renderTemplatePathByEnv","prefix","include","join","getArtifactDirectory","CAPSULE_ARTIFACTS_DIR","globPatterns","rootDir"],"sources":["env-preview-template.task.ts"],"sourcesContent":["import {\n BuildContext,\n BuiltTaskResult,\n BuildTask,\n TaskLocation,\n ComponentResult,\n CAPSULE_ARTIFACTS_DIR,\n} from '@teambit/builder';\nimport { MainRuntime } from '@teambit/cli';\nimport mapSeries from 'p-map-series';\nimport { Component, ComponentMap } from '@teambit/component';\nimport { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { Bundler, BundlerContext, BundlerHtmlConfig, BundlerResult, Target } from '@teambit/bundler';\nimport type { EnvDefinition, Environment, EnvsMain } from '@teambit/envs';\nimport { join } from 'path';\nimport { compact, flatten, isEmpty } from 'lodash';\nimport { Logger } from '@teambit/logger';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { existsSync, mkdirpSync } from 'fs-extra';\nimport type { PreviewMain } from './preview.main.runtime';\nimport { generateTemplateEntries } from './bundler/chunks';\nimport { generateHtmlConfig } from './bundler/html-plugin';\nimport { writePeerLink } from './bundler/create-peers-link';\n\nexport type ModuleExpose = {\n name: string;\n path: string;\n include?: string[];\n};\n\ntype TargetsGroup = {\n env: Environment;\n envToGetBundler: Environment;\n targets: Target[];\n};\ntype TargetsGroupMap = {\n [envId: string]: TargetsGroup;\n};\n\nexport const GENERATE_ENV_TEMPLATE_TASK_NAME = 'GenerateEnvTemplate';\n\nexport class EnvPreviewTemplateTask implements BuildTask {\n aspectId = 'teambit.preview/preview';\n name = GENERATE_ENV_TEMPLATE_TASK_NAME;\n location: TaskLocation = 'end';\n // readonly dependencies = [CompilerAspect.id];\n\n constructor(\n private preview: PreviewMain,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain,\n private dependencyResolver: DependencyResolverMain,\n private logger: Logger\n ) {}\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const previewDefs = this.preview.getDefs();\n const htmlConfig = previewDefs.map((previewModule) => generateHtmlConfig(previewModule, { dev: context.dev }));\n const originalSeedersIds = context.capsuleNetwork.originalSeedersCapsules.map((c) => c.component.id.toString());\n const grouped: TargetsGroupMap = {};\n // avoid running them with `Promise.all` because getEnv methods do import/isolate which can't be in parallel.\n await mapSeries(context.components, async (component) => {\n // Do not run over other components in the graph. it make the process much longer with no need\n if (originalSeedersIds && originalSeedersIds.length && !originalSeedersIds.includes(component.id.toString())) {\n return undefined;\n }\n const envDef = this.envs.getEnvFromComponent(component);\n if (!envDef) return undefined;\n const env = envDef.env;\n const bundlingStrategy = this.preview.getBundlingStrategy(envDef.env);\n if (bundlingStrategy.name === 'env') {\n return undefined;\n }\n const target = await this.getEnvTargetFromComponent(context, component, envDef, htmlConfig);\n if (!target) return undefined;\n const shouldUseDefaultBundler = this.shouldUseDefaultBundler(envDef);\n let envToGetBundler = this.envs.getEnvsEnvDefinition().env;\n let groupEnvId = 'default';\n if (!shouldUseDefaultBundler) {\n envToGetBundler = env;\n groupEnvId = envDef.id;\n }\n if (!grouped[groupEnvId]) {\n grouped[groupEnvId] = {\n env,\n envToGetBundler,\n targets: [target],\n };\n } else {\n grouped[groupEnvId].targets.push(target);\n }\n return undefined;\n });\n if (isEmpty(grouped)) {\n return { componentsResults: [] };\n }\n\n return this.runBundlerForGroups(context, grouped);\n }\n\n private async runBundlerForGroups(context: BuildContext, groups: TargetsGroupMap): Promise<BuiltTaskResult> {\n const bundlerContext: BundlerContext = Object.assign(context, {\n targets: [],\n entry: [],\n development: context.dev,\n metaData: {\n initiator: `${GENERATE_ENV_TEMPLATE_TASK_NAME} task`,\n envId: context.id,\n isEnvTemplate: true,\n },\n });\n\n const bundlerResults = await mapSeries(Object.entries(groups), async ([, targetsGroup]) => {\n bundlerContext.targets = targetsGroup.targets;\n const bundler: Bundler = await targetsGroup.envToGetBundler.getTemplateBundler(bundlerContext);\n const bundlerResult = await bundler.run();\n return bundlerResult;\n });\n\n const results = await this.computeResults(bundlerContext, flatten(bundlerResults));\n return results;\n }\n\n private shouldUseDefaultBundler(envDef: EnvDefinition): boolean {\n if (this.aspectLoader.isCoreEnv(envDef.id) && envDef.id !== 'teambit.react/react-native') return true;\n const env = envDef.env;\n if (env.getTemplateBundler && typeof env.getTemplateBundler === 'function') return false;\n return true;\n }\n\n private async getEnvTargetFromComponent(\n context: BuildContext,\n envComponent: Component,\n envDef: EnvDefinition,\n htmlConfig: BundlerHtmlConfig[]\n ): Promise<Target | undefined> {\n const envPreviewConfig = this.preview.getEnvPreviewConfig(envDef.env);\n\n const peers = await this.dependencyResolver.getPreviewHostDependenciesFromEnv(envDef.env);\n // const module = await this.getPreviewModule(envComponent);\n // const entries = Object.keys(module).map((key) => module.exposes[key]);\n const capsule = context.capsuleNetwork.graphCapsules.getCapsule(envComponent.id);\n if (!capsule) throw new Error('no capsule found');\n // Passing here the env itself to make sure it's preview runtime will be part of the preview root file\n // that's needed to make sure the providers register there are running correctly\n const previewRoot = await this.preview.writePreviewRuntime(context, [envComponent.id.toString()]);\n const entries = await this.generateEntries({\n envDef,\n splitComponentBundle: envPreviewConfig.splitComponentBundle ?? false,\n workDir: capsule.path,\n peers,\n previewRoot,\n });\n const outputPath = this.computeOutputPath(context, envComponent);\n if (!existsSync(outputPath)) mkdirpSync(outputPath);\n const resolvedEnvAspects = await this.preview.resolveAspects(MainRuntime.name, [envComponent.id], undefined, {\n requestedOnly: true,\n // required to support envs that are plguins (.bit-env files)\n filterByRuntime: false,\n });\n const resolvedEnv = resolvedEnvAspects[0];\n const hostRootDir = resolvedEnv?.aspectPath;\n\n if (!hostRootDir) {\n this.logger.warn(`env preview template task, hostRootDir is not defined, for env ${envComponent.id.toString()}`);\n }\n\n return {\n peers,\n html: htmlConfig,\n entries,\n chunking: { splitChunks: true },\n components: [envComponent],\n outputPath,\n /* It's a path to the root of the host component. */\n hostRootDir,\n hostDependencies: peers,\n aliasHostDependencies: true,\n };\n }\n\n private async generateEntries({\n previewRoot,\n workDir,\n peers,\n envDef,\n splitComponentBundle,\n }: {\n previewRoot: string;\n workDir: string;\n peers: string[];\n envDef: EnvDefinition;\n splitComponentBundle: boolean;\n }) {\n const previewModules = await this.getPreviewModules(envDef);\n const previewEntries = previewModules.map(({ name, path, ...rest }) => {\n const linkFile = this.preview.writeLink(\n name,\n ComponentMap.create([]),\n { default: path },\n workDir,\n splitComponentBundle\n );\n\n return { name, path, ...rest, entry: linkFile };\n });\n const peerLink = await writePeerLink(peers, workDir);\n\n const entries = generateTemplateEntries({\n peers: peerLink,\n previewRootPath: previewRoot,\n previewModules: previewEntries,\n });\n return entries;\n }\n\n async computeResults(context: BundlerContext, results: BundlerResult[]) {\n const allResults = results.map((result) => {\n const componentsResults: ComponentResult[] = result.components.map((component) => {\n return {\n component,\n errors: result.errors.map((err) => (typeof err === 'string' ? err : err.message)),\n warning: result.warnings,\n startTime: result.startTime,\n endTime: result.endTime,\n };\n });\n return componentsResults;\n });\n\n const componentsResults = flatten(allResults);\n\n const artifacts = getArtifactDef();\n\n return {\n componentsResults,\n artifacts,\n };\n }\n\n private async getPreviewModules(envDef: EnvDefinition): Promise<ModuleExpose[]> {\n const previewDefs = this.preview.getDefs();\n\n const modules = compact(\n await Promise.all(\n previewDefs.map(async (def) => {\n if (!def.renderTemplatePathByEnv) return undefined;\n return {\n name: def.prefix,\n path: (await def.renderTemplatePathByEnv(envDef.env)) || '',\n include: def.include,\n };\n })\n )\n );\n\n return modules;\n }\n\n private computeOutputPath(context: BuildContext, component: Component) {\n const capsule = context.capsuleNetwork.graphCapsules.getCapsule(component.id);\n if (!capsule) throw new Error('no capsule found');\n return join(capsule.path, getArtifactDirectory());\n }\n}\n\nexport function getArtifactDirectory() {\n return join(CAPSULE_ARTIFACTS_DIR, 'env-template');\n}\n\nexport function getArtifactDef() {\n return [\n {\n name: 'env-template',\n globPatterns: ['**'],\n rootDir: getArtifactDirectory(),\n },\n ];\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,KAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAS,QAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ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AE,cAAc;IACpBmG,YAAY,EAAE,CAAC,IAAI,CAAC;IACpBC,OAAO,EAAEH,oBAAoB,CAAC;EAChC,CAAC,CACF;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_builder","data","require","_cli","_pMapSeries","_interopRequireDefault","_component","_path","_lodash","_fsExtra","_chunks","_htmlPlugin","_createPeersLink","_excluded","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_objectWithoutProperties","i","_objectWithoutPropertiesLoose","s","includes","propertyIsEnumerable","call","n","hasOwnProperty","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","GENERATE_ENV_TEMPLATE_TASK_NAME","exports","EnvPreviewTemplateTask","constructor","preview","envs","aspectLoader","dependencyResolver","logger","execute","context","previewDefs","getDefs","htmlConfig","map","previewModule","generateHtmlConfig","dev","originalSeedersIds","capsuleNetwork","originalSeedersCapsules","c","component","id","toString","grouped","mapSeries","components","undefined","envDef","getEnvFromComponent","env","bundlingStrategy","getBundlingStrategy","name","target","getEnvTargetFromComponent","shouldUseDefaultBundler","envToGetBundler","getEnvsEnvDefinition","groupEnvId","targets","isEmpty","componentsResults","runBundlerForGroups","groups","bundlerContext","assign","entry","development","metaData","initiator","envId","isEnvTemplate","bundlerResults","entries","targetsGroup","bundler","getTemplateBundler","bundlerResult","run","results","computeResults","flatten","isCoreEnv","envComponent","envPreviewConfig","getEnvPreviewConfig","peers","getPreviewHostDependenciesFromEnv","capsule","graphCapsules","getCapsule","Error","previewRoot","writePreviewEntry","generateEntries","splitComponentBundle","workDir","path","outputPath","computeOutputPath","existsSync","mkdirpSync","resolvedEnvAspects","resolveAspects","MainRuntime","requestedOnly","filterByRuntime","resolvedEnv","hostRootDir","aspectPath","warn","html","chunking","splitChunks","hostDependencies","aliasHostDependencies","previewModules","getPreviewModules","previewEntries","_ref","rest","linkFile","writeLink","ComponentMap","create","peerLink","writePeerLink","generateTemplateEntries","previewRootPath","allResults","result","errors","err","message","warning","warnings","startTime","endTime","artifacts","getArtifactDef","modules","compact","Promise","all","def","renderTemplatePathByEnv","prefix","include","join","getArtifactDirectory","CAPSULE_ARTIFACTS_DIR","globPatterns","rootDir"],"sources":["env-preview-template.task.ts"],"sourcesContent":["import {\n BuildContext,\n BuiltTaskResult,\n BuildTask,\n TaskLocation,\n ComponentResult,\n CAPSULE_ARTIFACTS_DIR,\n} from '@teambit/builder';\nimport { MainRuntime } from '@teambit/cli';\nimport mapSeries from 'p-map-series';\nimport { Component, ComponentMap } from '@teambit/component';\nimport { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { Bundler, BundlerContext, BundlerHtmlConfig, BundlerResult, Target } from '@teambit/bundler';\nimport type { EnvDefinition, Environment, EnvsMain } from '@teambit/envs';\nimport { join } from 'path';\nimport { compact, flatten, isEmpty } from 'lodash';\nimport { Logger } from '@teambit/logger';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { existsSync, mkdirpSync } from 'fs-extra';\nimport type { PreviewMain } from './preview.main.runtime';\nimport { generateTemplateEntries } from './bundler/chunks';\nimport { generateHtmlConfig } from './bundler/html-plugin';\nimport { writePeerLink } from './bundler/create-peers-link';\n\nexport type ModuleExpose = {\n name: string;\n path: string;\n include?: string[];\n};\n\ntype TargetsGroup = {\n env: Environment;\n envToGetBundler: Environment;\n targets: Target[];\n};\ntype TargetsGroupMap = {\n [envId: string]: TargetsGroup;\n};\n\nexport const GENERATE_ENV_TEMPLATE_TASK_NAME = 'GenerateEnvTemplate';\n\nexport class EnvPreviewTemplateTask implements BuildTask {\n aspectId = 'teambit.preview/preview';\n name = GENERATE_ENV_TEMPLATE_TASK_NAME;\n location: TaskLocation = 'end';\n // readonly dependencies = [CompilerAspect.id];\n\n constructor(\n private preview: PreviewMain,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain,\n private dependencyResolver: DependencyResolverMain,\n private logger: Logger\n ) {}\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const previewDefs = this.preview.getDefs();\n const htmlConfig = previewDefs.map((previewModule) => generateHtmlConfig(previewModule, { dev: context.dev }));\n const originalSeedersIds = context.capsuleNetwork.originalSeedersCapsules.map((c) => c.component.id.toString());\n const grouped: TargetsGroupMap = {};\n // avoid running them with `Promise.all` because getEnv methods do import/isolate which can't be in parallel.\n await mapSeries(context.components, async (component) => {\n // Do not run over other components in the graph. it make the process much longer with no need\n if (originalSeedersIds && originalSeedersIds.length && !originalSeedersIds.includes(component.id.toString())) {\n return undefined;\n }\n const envDef = this.envs.getEnvFromComponent(component);\n if (!envDef) return undefined;\n const env = envDef.env;\n const bundlingStrategy = this.preview.getBundlingStrategy(envDef.env);\n if (bundlingStrategy.name === 'env') {\n return undefined;\n }\n const target = await this.getEnvTargetFromComponent(context, component, envDef, htmlConfig);\n if (!target) return undefined;\n const shouldUseDefaultBundler = this.shouldUseDefaultBundler(envDef);\n let envToGetBundler = this.envs.getEnvsEnvDefinition().env;\n let groupEnvId = 'default';\n if (!shouldUseDefaultBundler) {\n envToGetBundler = env;\n groupEnvId = envDef.id;\n }\n if (!grouped[groupEnvId]) {\n grouped[groupEnvId] = {\n env,\n envToGetBundler,\n targets: [target],\n };\n } else {\n grouped[groupEnvId].targets.push(target);\n }\n return undefined;\n });\n if (isEmpty(grouped)) {\n return { componentsResults: [] };\n }\n\n return this.runBundlerForGroups(context, grouped);\n }\n\n private async runBundlerForGroups(context: BuildContext, groups: TargetsGroupMap): Promise<BuiltTaskResult> {\n const bundlerContext: BundlerContext = Object.assign(context, {\n targets: [],\n entry: [],\n development: context.dev,\n metaData: {\n initiator: `${GENERATE_ENV_TEMPLATE_TASK_NAME} task`,\n envId: context.id,\n isEnvTemplate: true,\n },\n });\n\n const bundlerResults = await mapSeries(Object.entries(groups), async ([, targetsGroup]) => {\n bundlerContext.targets = targetsGroup.targets;\n const bundler: Bundler = await targetsGroup.envToGetBundler.getTemplateBundler(bundlerContext);\n const bundlerResult = await bundler.run();\n return bundlerResult;\n });\n\n const results = await this.computeResults(bundlerContext, flatten(bundlerResults));\n return results;\n }\n\n private shouldUseDefaultBundler(envDef: EnvDefinition): boolean {\n if (this.aspectLoader.isCoreEnv(envDef.id) && envDef.id !== 'teambit.react/react-native') return true;\n const env = envDef.env;\n if (env.getTemplateBundler && typeof env.getTemplateBundler === 'function') return false;\n return true;\n }\n\n private async getEnvTargetFromComponent(\n context: BuildContext,\n envComponent: Component,\n envDef: EnvDefinition,\n htmlConfig: BundlerHtmlConfig[]\n ): Promise<Target | undefined> {\n const envPreviewConfig = this.preview.getEnvPreviewConfig(envDef.env);\n\n const peers = await this.dependencyResolver.getPreviewHostDependenciesFromEnv(envDef.env);\n // const module = await this.getPreviewModule(envComponent);\n // const entries = Object.keys(module).map((key) => module.exposes[key]);\n const capsule = context.capsuleNetwork.graphCapsules.getCapsule(envComponent.id);\n if (!capsule) throw new Error('no capsule found');\n // Passing here the env itself to make sure it's preview runtime will be part of the preview root file\n // that's needed to make sure the providers register there are running correctly\n const previewRoot = await this.preview.writePreviewEntry(context, [envComponent.id.toString()]);\n const entries = await this.generateEntries({\n envDef,\n splitComponentBundle: envPreviewConfig.splitComponentBundle ?? false,\n workDir: capsule.path,\n peers,\n previewRoot,\n });\n const outputPath = this.computeOutputPath(context, envComponent);\n if (!existsSync(outputPath)) mkdirpSync(outputPath);\n const resolvedEnvAspects = await this.preview.resolveAspects(MainRuntime.name, [envComponent.id], undefined, {\n requestedOnly: true,\n // required to support envs that are plguins (.bit-env files)\n filterByRuntime: false,\n });\n const resolvedEnv = resolvedEnvAspects[0];\n const hostRootDir = resolvedEnv?.aspectPath;\n\n if (!hostRootDir) {\n this.logger.warn(`env preview template task, hostRootDir is not defined, for env ${envComponent.id.toString()}`);\n }\n\n return {\n peers,\n html: htmlConfig,\n entries,\n chunking: { splitChunks: true },\n components: [envComponent],\n outputPath,\n /* It's a path to the root of the host component. */\n hostRootDir,\n hostDependencies: peers,\n aliasHostDependencies: true,\n };\n }\n\n private async generateEntries({\n previewRoot,\n workDir,\n peers,\n envDef,\n splitComponentBundle,\n }: {\n previewRoot: string;\n workDir: string;\n peers: string[];\n envDef: EnvDefinition;\n splitComponentBundle: boolean;\n }) {\n const previewModules = await this.getPreviewModules(envDef);\n const previewEntries = previewModules.map(({ name, path, ...rest }) => {\n const linkFile = this.preview.writeLink(\n name,\n ComponentMap.create([]),\n { default: path },\n workDir,\n splitComponentBundle\n );\n\n return { name, path, ...rest, entry: linkFile };\n });\n const peerLink = await writePeerLink(peers, workDir);\n\n const entries = generateTemplateEntries({\n peers: peerLink,\n previewRootPath: previewRoot,\n previewModules: previewEntries,\n });\n return entries;\n }\n\n async computeResults(context: BundlerContext, results: BundlerResult[]) {\n const allResults = results.map((result) => {\n const componentsResults: ComponentResult[] = result.components.map((component) => {\n return {\n component,\n errors: result.errors.map((err) => (typeof err === 'string' ? err : err.message)),\n warning: result.warnings,\n startTime: result.startTime,\n endTime: result.endTime,\n };\n });\n return componentsResults;\n });\n\n const componentsResults = flatten(allResults);\n\n const artifacts = getArtifactDef();\n\n return {\n componentsResults,\n artifacts,\n };\n }\n\n private async getPreviewModules(envDef: EnvDefinition): Promise<ModuleExpose[]> {\n const previewDefs = this.preview.getDefs();\n\n const modules = compact(\n await Promise.all(\n previewDefs.map(async (def) => {\n if (!def.renderTemplatePathByEnv) return undefined;\n return {\n name: def.prefix,\n path: (await def.renderTemplatePathByEnv(envDef.env)) || '',\n include: def.include,\n };\n })\n )\n );\n\n return modules;\n }\n\n private computeOutputPath(context: BuildContext, component: Component) {\n const capsule = context.capsuleNetwork.graphCapsules.getCapsule(component.id);\n if (!capsule) throw new Error('no capsule found');\n return join(capsule.path, getArtifactDirectory());\n }\n}\n\nexport function getArtifactDirectory() {\n return join(CAPSULE_ARTIFACTS_DIR, 'env-template');\n}\n\nexport function getArtifactDef() {\n return [\n {\n name: 'env-template',\n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AA2B;IAC9E,MAAMlB,WAAW,GAAG,IAAI,CAACP,OAAO,CAACQ,OAAO,CAAC,CAAC;IAE1C,MAAM8G,OAAO,GAAG,IAAAC,iBAAO,EACrB,MAAMC,OAAO,CAACC,GAAG,CACflH,WAAW,CAACG,GAAG,CAAC,MAAOgH,GAAG,IAAK;MAC7B,IAAI,CAACA,GAAG,CAACC,uBAAuB,EAAE,OAAOnG,SAAS;MAClD,OAAO;QACLM,IAAI,EAAE4F,GAAG,CAACE,MAAM;QAChBjD,IAAI,EAAE,CAAC,MAAM+C,GAAG,CAACC,uBAAuB,CAAClG,MAAM,CAACE,GAAG,CAAC,KAAK,EAAE;QAC3DkG,OAAO,EAAEH,GAAG,CAACG;MACf,CAAC;IACH,CAAC,CACH,CACF,CAAC;IAED,OAAOP,OAAO;EAChB;EAEQzC,iBAAiBA,CAACvE,OAAqB,EAAEY,SAAoB,EAAE;IACrE,MAAMgD,OAAO,GAAG5D,OAAO,CAACS,cAAc,CAACoD,aAAa,CAACC,UAAU,CAAClD,SAAS,CAACC,EAAE,CAAC;IAC7E,IAAI,CAAC+C,OAAO,EAAE,MAAM,IAAIG,KAAK,CAAC,kBAAkB,CAAC;IACjD,OAAO,IAAAyD,YAAI,EAAC5D,OAAO,CAACS,IAAI,EAAEoD,oBAAoB,CAAC,CAAC,CAAC;EACnD;AACF;AAAClI,OAAA,CAAAC,sBAAA,GAAAA,sBAAA;AAEM,SAASiI,oBAAoBA,CAAA,EAAG;EACrC,OAAO,IAAAD,YAAI,EAACE,gCAAqB,EAAE,cAAc,CAAC;AACpD;AAEO,SAASX,cAAcA,CAAA,EAAG;EAC/B,OAAO,CACL;IACEvF,IAAI,EAAE,cAAc;IACpBmG,YAAY,EAAE,CAAC,IAAI,CAAC;IACpBC,OAAO,EAAEH,oBAAoB,CAAC;EAChC,CAAC,CACF;AACH","ignoreList":[]}
@@ -74,7 +74,7 @@ function generateLink(prefix, componentMap, mainModulesMap, isSplitComponentBund
74
74
  };
75
75
  });
76
76
  const contents = `
77
- import { linkModules } from '${(0, _normalizePath().default)((0, _path().join)(previewDistDir, 'preview.preview.runtime.js'))}';
77
+ import { linkModules } from '${(0, _normalizePath().default)((0, _path().join)(previewDistDir, 'preview-modules.js'))}';
78
78
 
79
79
  ${getModuleImports(moduleLinks, tempPackageDir)}
80
80