@teambit/bundler 1.0.208 → 1.0.210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_compilation_bundler-preview.js +1 -1
- package/artifacts/schema.json +6 -6
- package/dist/bundler.main.runtime.js +1 -1
- package/dist/bundler.main.runtime.js.map +1 -1
- package/dist/bundler.service.js +1 -1
- package/dist/component-server.js +1 -1
- package/dist/component-server.js.map +1 -1
- package/dist/dev-server.service.js +1 -1
- package/dist/dev-server.service.js.map +1 -1
- package/dist/events/components-server-started-event.js +1 -1
- package/dist/events/components-server-started-event.js.map +1 -1
- package/dist/{preview-1711458141302.js → preview-1711617900376.js} +2 -2
- package/package.json +8 -8
@@ -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.compilation/bundler@1.0.
|
3
|
+
<testsuite name="teambit.compilation/bundler@1.0.210" 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.compilation/bundler-preview"]=t():e["teambit.compilation/bundler-preview"]=t()}(self,(()=>(()=>{"use strict";var e={
|
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.compilation/bundler-preview"]=t():e["teambit.compilation/bundler-preview"]=t()}(self,(()=>(()=>{"use strict";var e={2271:(e,t,o)=>{var n={id:"teambit.compilation/bundler@1.0.210",homepage:"https://bit.cloud/teambit/compilation/bundler",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 p=()=>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/bundler.svg"}));p.__bit_component=n,t.Logo=p},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={};return(()=>{o.r(n),o.d(n,{compositions:()=>l,compositions_metadata:()=>f,overview:()=>u});var e={};o.r(e),o.d(e,{default:()=>d});var t=o(2271);o(41594);const r=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var p=["components"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},a.apply(this,arguments)}var c={},s="wrapper";function d(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,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,p);return(0,r.mdx)(s,a({},c,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}d.isMDXComponent=!0;const l=[t],u=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
|
package/artifacts/schema.json
CHANGED
@@ -689,7 +689,7 @@
|
|
689
689
|
"_legacy": {
|
690
690
|
"scope": "teambit.compilation",
|
691
691
|
"name": "bundler",
|
692
|
-
"version": "1.0.
|
692
|
+
"version": "1.0.210"
|
693
693
|
},
|
694
694
|
"_scope": "teambit.compilation"
|
695
695
|
}
|
@@ -1085,7 +1085,7 @@
|
|
1085
1085
|
"_legacy": {
|
1086
1086
|
"scope": "teambit.compilation",
|
1087
1087
|
"name": "bundler",
|
1088
|
-
"version": "1.0.
|
1088
|
+
"version": "1.0.210"
|
1089
1089
|
},
|
1090
1090
|
"_scope": "teambit.compilation"
|
1091
1091
|
}
|
@@ -4670,7 +4670,7 @@
|
|
4670
4670
|
"_legacy": {
|
4671
4671
|
"scope": "teambit.compilation",
|
4672
4672
|
"name": "bundler",
|
4673
|
-
"version": "1.0.
|
4673
|
+
"version": "1.0.210"
|
4674
4674
|
},
|
4675
4675
|
"_scope": "teambit.compilation"
|
4676
4676
|
}
|
@@ -6921,7 +6921,7 @@
|
|
6921
6921
|
"_legacy": {
|
6922
6922
|
"scope": "teambit.compilation",
|
6923
6923
|
"name": "bundler",
|
6924
|
-
"version": "1.0.
|
6924
|
+
"version": "1.0.210"
|
6925
6925
|
},
|
6926
6926
|
"_scope": "teambit.compilation"
|
6927
6927
|
}
|
@@ -9648,7 +9648,7 @@
|
|
9648
9648
|
"_legacy": {
|
9649
9649
|
"scope": "teambit.compilation",
|
9650
9650
|
"name": "bundler",
|
9651
|
-
"version": "1.0.
|
9651
|
+
"version": "1.0.210"
|
9652
9652
|
},
|
9653
9653
|
"_scope": "teambit.compilation"
|
9654
9654
|
}
|
@@ -9818,7 +9818,7 @@
|
|
9818
9818
|
"componentId": {
|
9819
9819
|
"scope": "teambit.compilation",
|
9820
9820
|
"name": "bundler",
|
9821
|
-
"version": "1.0.
|
9821
|
+
"version": "1.0.210"
|
9822
9822
|
},
|
9823
9823
|
"taggedModuleExports": []
|
9824
9824
|
}
|
@@ -82,7 +82,7 @@ function _bundler2() {
|
|
82
82
|
return data;
|
83
83
|
}
|
84
84
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
85
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
85
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
86
86
|
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); }
|
87
87
|
/**
|
88
88
|
* bundler extension.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_pubsub","data","require","_cli","_component","_dependencyResolver","_envs","_graphql","_harmony","_bundler","_devServer","_devServer2","_bundler2","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","BundlerMain","constructor","config","pubsub","envs","devService","runtimeSlot","devServerTransformerSlot","devServer","components","envRuntime","createEnvironment","servers","runOnce","dedicatedEnvDevServers","_componentServers","indexByComponent","getComponentServer","component","undefined","envId","getEnvId","server","find","componentServer","context","relatedContexts","includes","id","computeEntries","slotEntries","Promise","all","values","map","browserRuntime","entry","slotPaths","reduce","acc","current","concat","registerTarget","runtime","register","registerDevServerTransformer","devServerTransformer","provider","graphql","dependencyResolver","devServerService","DevServerService","bundler","registerService","BundlerService","devServerSchema","exports","Slot","withType","MainRuntime","PubsubAspect","EnvsAspect","GraphqlAspect","DependencyResolverAspect","ComponentAspect","BundlerAspect","addRuntime"],"sources":["bundler.main.runtime.ts"],"sourcesContent":["import { PubsubAspect, PubsubMain } from '@teambit/pubsub';\nimport { MainRuntime } from '@teambit/cli';\nimport { Component, ComponentAspect } from '@teambit/component';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { BrowserRuntime } from './browser-runtime';\nimport { BundlerAspect } from './bundler.aspect';\nimport { ComponentServer } from './component-server';\nimport { BundlerContext } from './bundler-context';\nimport { devServerSchema } from './dev-server.graphql';\nimport { DevServerService } from './dev-server.service';\nimport { BundlerService } from './bundler.service';\nimport { DevServer } from './dev-server';\n\nexport type DevServerTransformer = (devServer: DevServer, { envId }: { envId: string }) => DevServer;\n\nexport type BrowserRuntimeSlot = SlotRegistry<BrowserRuntime>;\nexport type DevServerTransformerSlot = SlotRegistry<DevServerTransformer>;\n\nexport type BundlerConfig = {\n dedicatedEnvDevServers: string[];\n};\n\n/**\n * bundler extension.\n */\nexport class BundlerMain {\n constructor(\n readonly config: BundlerConfig,\n /**\n * Pubsub extension.\n */\n private pubsub: PubsubMain,\n\n /**\n * environments extension.\n */\n private envs: EnvsMain,\n\n /**\n * dev server service.\n */\n private devService: DevServerService,\n\n /**\n * browser runtime slot.\n */\n private runtimeSlot: BrowserRuntimeSlot,\n\n /**\n * dev server transformer slot.\n */\n private devServerTransformerSlot: DevServerTransformerSlot\n ) {}\n\n /**\n * load all given components in corresponding dev servers.\n * @param components defaults to all components in the workspace.\n */\n async devServer(components: Component[]): Promise<ComponentServer[]> {\n const envRuntime = await this.envs.createEnvironment(components);\n // TODO: this must be refactored away from here. this logic should be in the Preview.\n // @ts-ignore\n const servers: ComponentServer[] = await envRuntime.runOnce<ComponentServer[]>(this.devService, {\n dedicatedEnvDevServers: this.config.dedicatedEnvDevServers,\n });\n this._componentServers = servers;\n\n this.indexByComponent();\n\n return this._componentServers;\n }\n\n /**\n * get a dev server instance containing a component.\n * @param component\n */\n getComponentServer(component: Component): undefined | ComponentServer {\n if (!this._componentServers) return undefined;\n const envId = this.envs.getEnvId(component);\n const server = this._componentServers.find(\n (componentServer) =>\n componentServer.context.relatedContexts.includes(envId) || componentServer.context.id === envId\n );\n\n return server;\n }\n\n /**\n * compute entry files for bundling components in a given execution context.\n */\n async computeEntries(context: BundlerContext) {\n const slotEntries = await Promise.all(\n this.runtimeSlot.values().map(async (browserRuntime) => browserRuntime.entry(context))\n );\n\n const slotPaths = slotEntries.reduce((acc, current) => {\n acc = acc.concat(current);\n return acc;\n });\n\n return slotPaths;\n }\n\n /**\n * register a new browser runtime environment.\n * @param browserRuntime\n */\n registerTarget(browserRuntime: BrowserRuntime[]) {\n browserRuntime.map((runtime) => {\n return this.runtimeSlot.register(runtime);\n });\n\n return this;\n }\n\n /**\n * register a new dev server transformer.\n * @param devServerTransformer\n */\n registerDevServerTransformer(devServerTransformer: DevServerTransformer) {\n this.devServerTransformerSlot.register(devServerTransformer);\n return this;\n }\n\n /**\n * component servers.\n */\n private _componentServers: null | ComponentServer[];\n\n private indexByComponent() {}\n\n static slots = [Slot.withType<BrowserRuntime>(), Slot.withType<DevServerTransformerSlot>()];\n\n static runtime = MainRuntime;\n static dependencies = [PubsubAspect, EnvsAspect, GraphqlAspect, DependencyResolverAspect, ComponentAspect];\n\n static defaultConfig = {\n dedicatedEnvDevServers: [],\n };\n\n static async provider(\n [pubsub, envs, graphql, dependencyResolver]: [PubsubMain, EnvsMain, GraphqlMain, DependencyResolverMain],\n config,\n [runtimeSlot, devServerTransformerSlot]: [BrowserRuntimeSlot, DevServerTransformerSlot]\n ) {\n const devServerService = new DevServerService(pubsub, dependencyResolver, runtimeSlot, devServerTransformerSlot);\n const bundler = new BundlerMain(config, pubsub, envs, devServerService, runtimeSlot, devServerTransformerSlot);\n envs.registerService(devServerService, new BundlerService());\n\n graphql.register(devServerSchema(bundler));\n\n return bundler;\n }\n}\n\nBundlerAspect.addRuntime(BundlerMain);\n"],"mappings":";;;;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AArB,eAAA,CAhIYqB,WAAW,WA0GP,CAACyD,eAAI,CAACC,QAAQ,CAAiB,CAAC,EAAED,eAAI,CAACC,QAAQ,CAA2B,CAAC,CAAC;AAAA/E,eAAA,CA1GhFqB,WAAW,aA4GL2D,kBAAW;AAAAhF,eAAA,CA5GjBqB,WAAW,kBA6GA,CAAC4D,sBAAY,EAAEC,kBAAU,EAAEC,wBAAa,EAAEC,8CAAwB,EAAEC,4BAAe,CAAC;AAAArF,eAAA,CA7G/FqB,WAAW,mBA+GC;EACrBc,sBAAsB,EAAE;AAC1B,CAAC;AAiBHmD,wBAAa,CAACC,UAAU,CAAClE,WAAW,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_pubsub","data","require","_cli","_component","_dependencyResolver","_envs","_graphql","_harmony","_bundler","_devServer","_devServer2","_bundler2","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","BundlerMain","constructor","config","pubsub","envs","devService","runtimeSlot","devServerTransformerSlot","devServer","components","envRuntime","createEnvironment","servers","runOnce","dedicatedEnvDevServers","_componentServers","indexByComponent","getComponentServer","component","undefined","envId","getEnvId","server","find","componentServer","context","relatedContexts","includes","id","computeEntries","slotEntries","Promise","all","values","map","browserRuntime","entry","slotPaths","reduce","acc","current","concat","registerTarget","runtime","register","registerDevServerTransformer","devServerTransformer","provider","graphql","dependencyResolver","devServerService","DevServerService","bundler","registerService","BundlerService","devServerSchema","exports","Slot","withType","MainRuntime","PubsubAspect","EnvsAspect","GraphqlAspect","DependencyResolverAspect","ComponentAspect","BundlerAspect","addRuntime"],"sources":["bundler.main.runtime.ts"],"sourcesContent":["import { PubsubAspect, PubsubMain } from '@teambit/pubsub';\nimport { MainRuntime } from '@teambit/cli';\nimport { Component, ComponentAspect } from '@teambit/component';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { BrowserRuntime } from './browser-runtime';\nimport { BundlerAspect } from './bundler.aspect';\nimport { ComponentServer } from './component-server';\nimport { BundlerContext } from './bundler-context';\nimport { devServerSchema } from './dev-server.graphql';\nimport { DevServerService } from './dev-server.service';\nimport { BundlerService } from './bundler.service';\nimport { DevServer } from './dev-server';\n\nexport type DevServerTransformer = (devServer: DevServer, { envId }: { envId: string }) => DevServer;\n\nexport type BrowserRuntimeSlot = SlotRegistry<BrowserRuntime>;\nexport type DevServerTransformerSlot = SlotRegistry<DevServerTransformer>;\n\nexport type BundlerConfig = {\n dedicatedEnvDevServers: string[];\n};\n\n/**\n * bundler extension.\n */\nexport class BundlerMain {\n constructor(\n readonly config: BundlerConfig,\n /**\n * Pubsub extension.\n */\n private pubsub: PubsubMain,\n\n /**\n * environments extension.\n */\n private envs: EnvsMain,\n\n /**\n * dev server service.\n */\n private devService: DevServerService,\n\n /**\n * browser runtime slot.\n */\n private runtimeSlot: BrowserRuntimeSlot,\n\n /**\n * dev server transformer slot.\n */\n private devServerTransformerSlot: DevServerTransformerSlot\n ) {}\n\n /**\n * load all given components in corresponding dev servers.\n * @param components defaults to all components in the workspace.\n */\n async devServer(components: Component[]): Promise<ComponentServer[]> {\n const envRuntime = await this.envs.createEnvironment(components);\n // TODO: this must be refactored away from here. this logic should be in the Preview.\n // @ts-ignore\n const servers: ComponentServer[] = await envRuntime.runOnce<ComponentServer[]>(this.devService, {\n dedicatedEnvDevServers: this.config.dedicatedEnvDevServers,\n });\n this._componentServers = servers;\n\n this.indexByComponent();\n\n return this._componentServers;\n }\n\n /**\n * get a dev server instance containing a component.\n * @param component\n */\n getComponentServer(component: Component): undefined | ComponentServer {\n if (!this._componentServers) return undefined;\n const envId = this.envs.getEnvId(component);\n const server = this._componentServers.find(\n (componentServer) =>\n componentServer.context.relatedContexts.includes(envId) || componentServer.context.id === envId\n );\n\n return server;\n }\n\n /**\n * compute entry files for bundling components in a given execution context.\n */\n async computeEntries(context: BundlerContext) {\n const slotEntries = await Promise.all(\n this.runtimeSlot.values().map(async (browserRuntime) => browserRuntime.entry(context))\n );\n\n const slotPaths = slotEntries.reduce((acc, current) => {\n acc = acc.concat(current);\n return acc;\n });\n\n return slotPaths;\n }\n\n /**\n * register a new browser runtime environment.\n * @param browserRuntime\n */\n registerTarget(browserRuntime: BrowserRuntime[]) {\n browserRuntime.map((runtime) => {\n return this.runtimeSlot.register(runtime);\n });\n\n return this;\n }\n\n /**\n * register a new dev server transformer.\n * @param devServerTransformer\n */\n registerDevServerTransformer(devServerTransformer: DevServerTransformer) {\n this.devServerTransformerSlot.register(devServerTransformer);\n return this;\n }\n\n /**\n * component servers.\n */\n private _componentServers: null | ComponentServer[];\n\n private indexByComponent() {}\n\n static slots = [Slot.withType<BrowserRuntime>(), Slot.withType<DevServerTransformerSlot>()];\n\n static runtime = MainRuntime;\n static dependencies = [PubsubAspect, EnvsAspect, GraphqlAspect, DependencyResolverAspect, ComponentAspect];\n\n static defaultConfig = {\n dedicatedEnvDevServers: [],\n };\n\n static async provider(\n [pubsub, envs, graphql, dependencyResolver]: [PubsubMain, EnvsMain, GraphqlMain, DependencyResolverMain],\n config,\n [runtimeSlot, devServerTransformerSlot]: [BrowserRuntimeSlot, DevServerTransformerSlot]\n ) {\n const devServerService = new DevServerService(pubsub, dependencyResolver, runtimeSlot, devServerTransformerSlot);\n const bundler = new BundlerMain(config, pubsub, envs, devServerService, runtimeSlot, devServerTransformerSlot);\n envs.registerService(devServerService, new BundlerService());\n\n graphql.register(devServerSchema(bundler));\n\n return bundler;\n }\n}\n\nBundlerAspect.addRuntime(BundlerMain);\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAA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D,kBAAW;AAAAhF,eAAA,CA5GjBqB,WAAW,kBA6GA,CAAC4D,sBAAY,EAAEC,kBAAU,EAAEC,wBAAa,EAAEC,8CAAwB,EAAEC,4BAAe,CAAC;AAAArF,eAAA,CA7G/FqB,WAAW,mBA+GC;EACrBc,sBAAsB,EAAE;AAC1B,CAAC;AAiBHmD,wBAAa,CAACC,UAAU,CAAClE,WAAW,CAAC","ignoreList":[]}
|
package/dist/bundler.service.js
CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.BundlerService = void 0;
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
9
9
|
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); }
|
10
10
|
class BundlerService {
|
11
11
|
constructor() {
|
package/dist/component-server.js
CHANGED
@@ -33,7 +33,7 @@ function _selectPort() {
|
|
33
33
|
return data;
|
34
34
|
}
|
35
35
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
36
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
36
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
37
37
|
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); }
|
38
38
|
class ComponentServer {
|
39
39
|
constructor(
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_exceptions","data","require","_events","_bundler","_selectPort","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_exceptions","data","require","_events","_bundler","_selectPort","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","ComponentServer","constructor","pubsub","context","portRange","devServer","componentsServer","hostname","port","ComponentsServerStartedEvent","Date","now","hasComponent","component","components","find","contextComponent","equals","_port","listen","selectPort","server","address","getHostname","BindError","pub","BundlerAspect","id","createComponentsServerStartedEvent","onChange","url","envRuntime","exports"],"sources":["component-server.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { ExecutionContext } from '@teambit/envs';\nimport { PubsubMain } from '@teambit/pubsub';\n\nimport { AddressInfo } from 'net';\n\nimport { DevServer } from './dev-server';\nimport { BindError } from './exceptions';\nimport { ComponentsServerStartedEvent } from './events';\nimport { BundlerAspect } from './bundler.aspect';\nimport { selectPort } from './select-port';\n\nexport class ComponentServer {\n // why is this here\n errors?: Error[];\n constructor(\n /**\n * browser runtime slot\n */\n private pubsub: PubsubMain,\n\n /**\n * components contained in the existing component server.\n */\n readonly context: ExecutionContext,\n\n /**\n * port range of the component server.\n */\n readonly portRange: number[],\n\n /**\n * env dev server.\n */\n readonly devServer: DevServer\n ) {}\n\n hostname: string | undefined;\n\n /**\n * determine whether component server contains a component.\n */\n hasComponent(component: Component) {\n return this.context.components.find((contextComponent) => contextComponent.equals(component));\n }\n\n get port() {\n return this._port;\n }\n\n _port: number;\n async listen() {\n const port = await selectPort(this.portRange);\n this._port = port;\n const server = await this.devServer.listen(port);\n const address = server.address();\n const hostname = this.getHostname(address);\n if (!address) throw new BindError();\n this.hostname = hostname;\n this.pubsub.pub(BundlerAspect.id, this.createComponentsServerStartedEvent(server, this.context, hostname, port));\n }\n\n private getHostname(address: string | AddressInfo | null) {\n if (address === null) throw new BindError();\n if (typeof address === 'string') return address;\n\n let hostname = address.address;\n if (hostname === '::') {\n hostname = 'localhost';\n }\n\n return hostname;\n }\n\n private onChange() {}\n\n private createComponentsServerStartedEvent: (\n DevServer,\n ExecutionContext,\n string,\n number\n ) => ComponentsServerStartedEvent = (componentsServer, context, hostname, port) => {\n return new ComponentsServerStartedEvent(Date.now(), componentsServer, context, hostname, port);\n };\n\n /**\n * get the url of the component server.\n */\n get url() {\n // tailing `/` is required!\n return `/preview/${this.context.envRuntime.id}/`;\n }\n}\n"],"mappings":";;;;;;AAOA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2C,SAAAK,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC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AE;EAClD;AACF;AAACK,OAAA,CAAAhC,eAAA,GAAAA,eAAA","ignoreList":[]}
|
@@ -62,7 +62,7 @@ function _getEntry() {
|
|
62
62
|
}
|
63
63
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
64
64
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
65
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
65
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
66
66
|
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); }
|
67
67
|
class DevServerService {
|
68
68
|
constructor(pubsub, dependencyResolver,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_cliHighlight","_path","_pMapSeries","_componentServer","_dedupEnvs","_getEntry","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","DevServerService","constructor","pubsub","dependencyResolver","runtimeSlot","devServerTransformerSlot","render","env","context","descriptor","getDescriptor","name","chalk","green","id","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","environment","getDevServer","undefined","mergedContext","buildContext","devServer","icon","displayConfig","transform","envContext","preview","getDevEnvId","runOnce","contexts","dedicatedEnvDevServers","groupedEnvs","dedupEnvs","servers","pMapSeries","entries","contextList","mainContext","find","envDefinition","additionalContexts","filter","devServerContext","envRuntime","transformedDevServer","transformDevServer","envId","ComponentServer","mergeContext","getComponentsFromContexts","flatten","map","components","relatedContexts","ctx","concat","peers","getPreviewHostDependenciesFromEnv","hostRootDir","envAspectDefinition","aspectPath","assign","entry","getEntry","rootPath","publicPath","sep","hostDependencies","aliasHostDependencies","values","reduce","updatedDevServer","transformFn","exports"],"sources":["dev-server.service.ts"],"sourcesContent":["import { EnvService, ExecutionContext, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport { PubsubMain } from '@teambit/pubsub';\nimport chalk from 'chalk';\nimport { flatten } from 'lodash';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport highlight from 'cli-highlight';\nimport { sep } from 'path';\nimport pMapSeries from 'p-map-series';\nimport { BrowserRuntimeSlot, DevServerTransformerSlot } from './bundler.main.runtime';\nimport { ComponentServer } from './component-server';\nimport { dedupEnvs } from './dedup-envs';\nimport { DevServer } from './dev-server';\nimport { DevServerContext } from './dev-server-context';\nimport { getEntry } from './get-entry';\n\nexport type DevServerServiceOptions = { dedicatedEnvDevServers?: string[] };\n\ntype DevServiceTransformationMap = ServiceTransformationMap & {\n /**\n * Required for `bit start`\n */\n getDevEnvId?: (context?: any) => string;\n\n /**\n * Returns and configures the dev server\n * Required for `bit start`\n */\n getDevServer?: (context: DevServerContext) => DevServer | Promise<DevServer>;\n};\n\nexport type DevServerDescriptor = {\n /**\n * id of the dev server (e.g. webpack)\n */\n id: string;\n\n /**\n * display name of the dev server (e.g. Webpack dev server)\n */\n displayName: string;\n\n /**\n * icon of the configured dev server.\n */\n icon: string;\n\n /**\n * string containing the config for display.\n */\n config: string;\n\n version?: string;\n};\n\nexport class DevServerService implements EnvService<ComponentServer, DevServerDescriptor> {\n name = 'dev server';\n\n constructor(\n private pubsub: PubsubMain,\n\n private dependencyResolver: DependencyResolverMain,\n\n /**\n * browser runtime slot\n */\n private runtimeSlot: BrowserRuntimeSlot,\n\n private devServerTransformerSlot: DevServerTransformerSlot\n ) {}\n\n async render(env: EnvDefinition, context: ExecutionContext[]) {\n const descriptor = await this.getDescriptor(env, context);\n const name = `${chalk.green('configured dev server:')} ${descriptor?.id} (${descriptor?.displayName} @ ${\n descriptor?.version\n })`;\n const configLabel = chalk.green('dev server config:');\n const configObj = descriptor?.config\n ? highlight(descriptor?.config, { language: 'javascript', ignoreIllegals: true })\n : '';\n return `${name}\\n${configLabel}\\n${configObj}`;\n }\n\n async getDescriptor(\n environment: EnvDefinition,\n context?: ExecutionContext[]\n ): Promise<DevServerDescriptor | undefined> {\n if (!environment.env.getDevServer || !context) return undefined;\n const mergedContext = await this.buildContext(context[0], []);\n const devServer: DevServer = environment.env.getDevServer(mergedContext);\n\n return {\n id: devServer.id || '',\n displayName: devServer.displayName || '',\n icon: devServer.icon || '',\n config: devServer.displayConfig ? devServer.displayConfig() : '',\n version: devServer.version ? devServer.version() : '?',\n };\n }\n\n transform(env: Env, envContext: EnvContext): DevServiceTransformationMap | undefined {\n // Old env\n if (!env?.preview) return undefined;\n const preview = env.preview()(envContext);\n\n return {\n getDevEnvId: () => {\n return preview.getDevEnvId();\n },\n getDevServer: (context) => {\n return preview.getDevServer(context)(envContext);\n },\n };\n }\n\n // async run(context: ExecutionContext): Promise<ComponentServer[]> {\n // const devServerContext = await this.buildContext(context);\n // const devServer: DevServer = context.env.getDevServer(devServerContext);\n // const port = await selectPort();\n // // TODO: refactor to replace with a component server instance.\n // return new ComponentServer(this.pubsub, context, port, devServer);\n // }\n\n async runOnce(\n contexts: ExecutionContext[],\n { dedicatedEnvDevServers }: DevServerServiceOptions\n ): Promise<ComponentServer[]> {\n const groupedEnvs = await dedupEnvs(contexts, this.dependencyResolver, dedicatedEnvDevServers);\n\n // TODO: (gilad) - change this back to promise all once we make the preview pre-bundle to run before that loop\n const servers = await pMapSeries(Object.entries(groupedEnvs), async ([id, contextList]) => {\n const mainContext = contextList.find((context) => context.envDefinition.id === id) || contextList[0];\n const additionalContexts = contextList.filter((context) => context.envDefinition.id !== id);\n\n const devServerContext = await this.buildContext(mainContext, additionalContexts);\n const devServer: DevServer = await devServerContext.envRuntime.env.getDevServer(devServerContext);\n const transformedDevServer: DevServer = this.transformDevServer(devServer, { envId: id });\n\n return new ComponentServer(this.pubsub, devServerContext, [3300, 3400], transformedDevServer);\n });\n\n return servers;\n }\n\n mergeContext() {}\n\n private getComponentsFromContexts(contexts: ExecutionContext[]) {\n return flatten(\n contexts.map((context) => {\n return context.components;\n })\n );\n }\n\n /**\n * builds the execution context for the dev server.\n */\n private async buildContext(\n context: ExecutionContext,\n additionalContexts: ExecutionContext[] = []\n ): Promise<DevServerContext> {\n context.relatedContexts = additionalContexts.map((ctx) => ctx.envDefinition.id);\n context.components = context.components.concat(this.getComponentsFromContexts(additionalContexts));\n const peers = await this.dependencyResolver.getPreviewHostDependenciesFromEnv(context.envDefinition.env);\n const hostRootDir = context.envRuntime.envAspectDefinition?.aspectPath;\n\n return Object.assign(context, {\n entry: await getEntry(context, this.runtimeSlot),\n // don't start with a leading \"/\" because it generates errors on Windows\n rootPath: `preview/${context.envRuntime.id}`,\n publicPath: `${sep}public`,\n hostRootDir,\n hostDependencies: peers,\n aliasHostDependencies: true,\n });\n }\n\n private transformDevServer(devServer: DevServer, { envId }: { envId: string }): DevServer {\n return this.devServerTransformerSlot\n .values()\n .reduce((updatedDevServer, transformFn) => transformFn(updatedDevServer, { envId }), devServer);\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,cAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAA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,CAACoD,eAAe,GAAGb,kBAAkB,CAACW,GAAG,CAAEG,GAAG,IAAKA,GAAG,CAACf,aAAa,CAAChC,EAAE,CAAC;IAC/EN,OAAO,CAACmD,UAAU,GAAGnD,OAAO,CAACmD,UAAU,CAACG,MAAM,CAAC,IAAI,CAACN,yBAAyB,CAACT,kBAAkB,CAAC,CAAC;IAClG,MAAMgB,KAAK,GAAG,MAAM,IAAI,CAAC5D,kBAAkB,CAAC6D,iCAAiC,CAACxD,OAAO,CAACsC,aAAa,CAACvC,GAAG,CAAC;IACxG,MAAM0D,WAAW,GAAGzD,OAAO,CAAC0C,UAAU,CAACgB,mBAAmB,EAAEC,UAAU;IAEtE,OAAOnF,MAAM,CAACoF,MAAM,CAAC5D,OAAO,EAAE;MAC5B6D,KAAK,EAAE,MAAM,IAAAC,oBAAQ,EAAC9D,OAAO,EAAE,IAAI,CAACJ,WAAW,CAAC;MAChD;MACAmE,QAAQ,EAAG,WAAU/D,OAAO,CAAC0C,UAAU,CAACpC,EAAG,EAAC;MAC5C0D,UAAU,EAAG,GAAEC,WAAI,QAAO;MAC1BR,WAAW;MACXS,gBAAgB,EAAEX,KAAK;MACvBY,qBAAqB,EAAE;IACzB,CAAC,CAAC;EACJ;EAEQvB,kBAAkBA,CAACxB,SAAoB,EAAE;IAAEyB;EAAyB,CAAC,EAAa;IACxF,OAAO,IAAI,CAAChD,wBAAwB,CACjCuE,MAAM,CAAC,CAAC,CACRC,MAAM,CAAC,CAACC,gBAAgB,EAAEC,WAAW,KAAKA,WAAW,CAACD,gBAAgB,EAAE;MAAEzB;IAAM,CAAC,CAAC,EAAEzB,SAAS,CAAC;EACnG;AACF;AAACoD,OAAA,CAAAhF,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_cliHighlight","_path","_pMapSeries","_componentServer","_dedupEnvs","_getEntry","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","DevServerService","constructor","pubsub","dependencyResolver","runtimeSlot","devServerTransformerSlot","render","env","context","descriptor","getDescriptor","name","chalk","green","id","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","environment","getDevServer","undefined","mergedContext","buildContext","devServer","icon","displayConfig","transform","envContext","preview","getDevEnvId","runOnce","contexts","dedicatedEnvDevServers","groupedEnvs","dedupEnvs","servers","pMapSeries","entries","contextList","mainContext","find","envDefinition","additionalContexts","filter","devServerContext","envRuntime","transformedDevServer","transformDevServer","envId","ComponentServer","mergeContext","getComponentsFromContexts","flatten","map","components","relatedContexts","ctx","concat","peers","getPreviewHostDependenciesFromEnv","hostRootDir","envAspectDefinition","aspectPath","assign","entry","getEntry","rootPath","publicPath","sep","hostDependencies","aliasHostDependencies","values","reduce","updatedDevServer","transformFn","exports"],"sources":["dev-server.service.ts"],"sourcesContent":["import { EnvService, ExecutionContext, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport { PubsubMain } from '@teambit/pubsub';\nimport chalk from 'chalk';\nimport { flatten } from 'lodash';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport highlight from 'cli-highlight';\nimport { sep } from 'path';\nimport pMapSeries from 'p-map-series';\nimport { BrowserRuntimeSlot, DevServerTransformerSlot } from './bundler.main.runtime';\nimport { ComponentServer } from './component-server';\nimport { dedupEnvs } from './dedup-envs';\nimport { DevServer } from './dev-server';\nimport { DevServerContext } from './dev-server-context';\nimport { getEntry } from './get-entry';\n\nexport type DevServerServiceOptions = { dedicatedEnvDevServers?: string[] };\n\ntype DevServiceTransformationMap = ServiceTransformationMap & {\n /**\n * Required for `bit start`\n */\n getDevEnvId?: (context?: any) => string;\n\n /**\n * Returns and configures the dev server\n * Required for `bit start`\n */\n getDevServer?: (context: DevServerContext) => DevServer | Promise<DevServer>;\n};\n\nexport type DevServerDescriptor = {\n /**\n * id of the dev server (e.g. webpack)\n */\n id: string;\n\n /**\n * display name of the dev server (e.g. Webpack dev server)\n */\n displayName: string;\n\n /**\n * icon of the configured dev server.\n */\n icon: string;\n\n /**\n * string containing the config for display.\n */\n config: string;\n\n version?: string;\n};\n\nexport class DevServerService implements EnvService<ComponentServer, DevServerDescriptor> {\n name = 'dev server';\n\n constructor(\n private pubsub: PubsubMain,\n\n private dependencyResolver: DependencyResolverMain,\n\n /**\n * browser runtime slot\n */\n private runtimeSlot: BrowserRuntimeSlot,\n\n private devServerTransformerSlot: DevServerTransformerSlot\n ) {}\n\n async render(env: EnvDefinition, context: ExecutionContext[]) {\n const descriptor = await this.getDescriptor(env, context);\n const name = `${chalk.green('configured dev server:')} ${descriptor?.id} (${descriptor?.displayName} @ ${\n descriptor?.version\n })`;\n const configLabel = chalk.green('dev server config:');\n const configObj = descriptor?.config\n ? highlight(descriptor?.config, { language: 'javascript', ignoreIllegals: true })\n : '';\n return `${name}\\n${configLabel}\\n${configObj}`;\n }\n\n async getDescriptor(\n environment: EnvDefinition,\n context?: ExecutionContext[]\n ): Promise<DevServerDescriptor | undefined> {\n if (!environment.env.getDevServer || !context) return undefined;\n const mergedContext = await this.buildContext(context[0], []);\n const devServer: DevServer = environment.env.getDevServer(mergedContext);\n\n return {\n id: devServer.id || '',\n displayName: devServer.displayName || '',\n icon: devServer.icon || '',\n config: devServer.displayConfig ? devServer.displayConfig() : '',\n version: devServer.version ? devServer.version() : '?',\n };\n }\n\n transform(env: Env, envContext: EnvContext): DevServiceTransformationMap | undefined {\n // Old env\n if (!env?.preview) return undefined;\n const preview = env.preview()(envContext);\n\n return {\n getDevEnvId: () => {\n return preview.getDevEnvId();\n },\n getDevServer: (context) => {\n return preview.getDevServer(context)(envContext);\n },\n };\n }\n\n // async run(context: ExecutionContext): Promise<ComponentServer[]> {\n // const devServerContext = await this.buildContext(context);\n // const devServer: DevServer = context.env.getDevServer(devServerContext);\n // const port = await selectPort();\n // // TODO: refactor to replace with a component server instance.\n // return new ComponentServer(this.pubsub, context, port, devServer);\n // }\n\n async runOnce(\n contexts: ExecutionContext[],\n { dedicatedEnvDevServers }: DevServerServiceOptions\n ): Promise<ComponentServer[]> {\n const groupedEnvs = await dedupEnvs(contexts, this.dependencyResolver, dedicatedEnvDevServers);\n\n // TODO: (gilad) - change this back to promise all once we make the preview pre-bundle to run before that loop\n const servers = await pMapSeries(Object.entries(groupedEnvs), async ([id, contextList]) => {\n const mainContext = contextList.find((context) => context.envDefinition.id === id) || contextList[0];\n const additionalContexts = contextList.filter((context) => context.envDefinition.id !== id);\n\n const devServerContext = await this.buildContext(mainContext, additionalContexts);\n const devServer: DevServer = await devServerContext.envRuntime.env.getDevServer(devServerContext);\n const transformedDevServer: DevServer = this.transformDevServer(devServer, { envId: id });\n\n return new ComponentServer(this.pubsub, devServerContext, [3300, 3400], transformedDevServer);\n });\n\n return servers;\n }\n\n mergeContext() {}\n\n private getComponentsFromContexts(contexts: ExecutionContext[]) {\n return flatten(\n contexts.map((context) => {\n return context.components;\n })\n );\n }\n\n /**\n * builds the execution context for the dev server.\n */\n private async buildContext(\n context: ExecutionContext,\n additionalContexts: ExecutionContext[] = []\n ): Promise<DevServerContext> {\n context.relatedContexts = additionalContexts.map((ctx) => ctx.envDefinition.id);\n context.components = context.components.concat(this.getComponentsFromContexts(additionalContexts));\n const peers = await this.dependencyResolver.getPreviewHostDependenciesFromEnv(context.envDefinition.env);\n const hostRootDir = context.envRuntime.envAspectDefinition?.aspectPath;\n\n return Object.assign(context, {\n entry: await getEntry(context, this.runtimeSlot),\n // don't start with a leading \"/\" because it generates errors on Windows\n rootPath: `preview/${context.envRuntime.id}`,\n publicPath: `${sep}public`,\n hostRootDir,\n hostDependencies: peers,\n aliasHostDependencies: true,\n });\n }\n\n private transformDevServer(devServer: DevServer, { envId }: { envId: string }): DevServer {\n return this.devServerTransformerSlot\n .values()\n .reduce((updatedDevServer, transformFn) => transformFn(updatedDevServer, { envId }), devServer);\n }\n}\n"],"mappings":";;;;;;A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,OAAO,IAAI,CAAChD,wBAAwB,CACjCuE,MAAM,CAAC,CAAC,CACRC,MAAM,CAAC,CAACC,gBAAgB,EAAEC,WAAW,KAAKA,WAAW,CAACD,gBAAgB,EAAE;MAAEzB;IAAM,CAAC,CAAC,EAAEzB,SAAS,CAAC;EACnG;AACF;AAACoD,OAAA,CAAAhF,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
@@ -12,7 +12,7 @@ function _pubsub() {
|
|
12
12
|
return data;
|
13
13
|
}
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
16
16
|
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); } /* eslint-disable max-classes-per-file */
|
17
17
|
class ComponentsServerStartedEventData {
|
18
18
|
constructor(componentsServer, context, hostname, port) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","ComponentsServerStartedEventData","constructor","componentsServer","context","hostname","port","ComponentsServerStartedEvent","BitBaseEvent","timestamp","TYPE","exports"],"sources":["components-server-started-event.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\n\nimport { BitBaseEvent } from '@teambit/pubsub';\n\nclass ComponentsServerStartedEventData {\n constructor(readonly componentsServer, readonly context, readonly hostname, readonly port) {}\n}\n\nexport class ComponentsServerStartedEvent extends BitBaseEvent<ComponentsServerStartedEventData> {\n static readonly TYPE = 'components-server-started';\n\n constructor(readonly timestamp, readonly componentsServer, readonly context, readonly hostname, readonly port) {\n super(\n ComponentsServerStartedEvent.TYPE,\n '0.0.1',\n timestamp,\n new ComponentsServerStartedEventData(componentsServer, context, hostname, port)\n );\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA,KAF/C;AAIA,MAAMW,gCAAgC,CAAC;EACrCC,WAAWA,CAAUC,gBAAgB,EAAWC,OAAO,EAAWC,QAAQ,EAAWC,IAAI,EAAE;IAAA,KAAtEH,gBAAgB,GAAhBA,gBAAgB;IAAA,KAAWC,OAAO,GAAPA,OAAO;IAAA,KAAWC,QAAQ,GAARA,QAAQ;IAAA,KAAWC,IAAI,GAAJA,IAAI;EAAG;AAC9F;AAEO,MAAMC,4BAA4B,SAASC,sBAAY,CAAmC;EAG/FN,WAAWA,CAAUO,SAAS,EAAWN,gBAAgB,EAAWC,OAAO,EAAWC,QAAQ,EAAWC,IAAI,EAAE;IAC7G,KAAK,CACHC,4BAA4B,CAACG,IAAI,EACjC,OAAO,EACPD,SAAS,EACT,IAAIR,gCAAgC,CAACE,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,IAAI,CAChF,CAAC;IAAC,KANiBG,SAAS,GAATA,SAAS;IAAA,KAAWN,gBAAgB,GAAhBA,gBAAgB;IAAA,KAAWC,OAAO,GAAPA,OAAO;IAAA,KAAWC,QAAQ,GAARA,QAAQ;IAAA,KAAWC,IAAI,GAAJA,IAAI;EAO7G;AACF;AAACK,OAAA,CAAAJ,4BAAA,GAAAA,4BAAA;AAAA3B,eAAA,CAXY2B,4BAA4B,UAChB,2BAA2B","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@1.0.210/dist/bundler.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@1.0.210/dist/bundler.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/bundler",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.210",
|
4
4
|
"homepage": "https://bit.cloud/teambit/compilation/bundler",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.compilation",
|
8
8
|
"name": "bundler",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.210"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -14,13 +14,13 @@
|
|
14
14
|
"lodash": "4.17.21",
|
15
15
|
"p-map-series": "2.1.0",
|
16
16
|
"@teambit/harmony": "0.4.6",
|
17
|
-
"@teambit/envs": "1.0.
|
18
|
-
"@teambit/builder": "1.0.
|
19
|
-
"@teambit/component": "1.0.
|
17
|
+
"@teambit/envs": "1.0.210",
|
18
|
+
"@teambit/builder": "1.0.210",
|
19
|
+
"@teambit/component": "1.0.210",
|
20
20
|
"@teambit/cli": "0.0.858",
|
21
|
-
"@teambit/dependency-resolver": "1.0.
|
22
|
-
"@teambit/graphql": "1.0.
|
23
|
-
"@teambit/pubsub": "1.0.
|
21
|
+
"@teambit/dependency-resolver": "1.0.210",
|
22
|
+
"@teambit/graphql": "1.0.210",
|
23
|
+
"@teambit/pubsub": "1.0.210",
|
24
24
|
"@teambit/toolbox.network.get-port": "1.0.6"
|
25
25
|
},
|
26
26
|
"devDependencies": {
|