@teambit/bundler 0.0.667 → 0.0.670
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/dist/component-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["component-server.ts"],"names":["ComponentServer","constructor","pubsub","context","portRange","devServer","componentsServer","hostname","port","ComponentsServerStartedEvent","Date","now","hasComponent","component","components","find","contextComponent","equals","_port","listen","server","address","getHostname","BindError","pub","BundlerAspect","id","createComponentsServerStartedEvent","onChange","url","envRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAKA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,eAAN,CAAsB;AAC3B;AAEAC,EAAAA,WAAW;AACT;AACJ;AACA;AACYC,EAAAA,MAJC;AAMT;AACJ;AACA;AACaC,EAAAA,OATA;AAWT;AACJ;AACA;AACaC,EAAAA,SAdA;AAgBT;AACJ;AACA;AACaC,EAAAA,SAnBA,EAoBT;AAAA,SAhBQH,MAgBR,GAhBQA,MAgBR;AAAA,SAXSC,OAWT,GAXSA,OAWT;AAAA,SANSC,SAMT,GANSA,SAMT;AAAA,SADSC,SACT,GADSA,SACT;AAAA;AAAA;AAAA;AAAA,gFA+CkC,CAACC,gBAAD,EAAmBH,OAAnB,EAA4BI,QAA5B,EAAsCC,IAAtC,KAA+C;AACjF,aAAO,KAAIC,sCAAJ,EAAiCC,IAAI,CAACC,GAAL,EAAjC,EAA6CL,gBAA7C,EAA+DH,OAA/D,EAAwEI,QAAxE,EAAkFC,IAAlF,CAAP;AACD,KAjDC;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B,OAAL,CAAa2B,UAAb,CAAwBJ,EAAG,
|
|
1
|
+
{"version":3,"sources":["component-server.ts"],"names":["ComponentServer","constructor","pubsub","context","portRange","devServer","componentsServer","hostname","port","ComponentsServerStartedEvent","Date","now","hasComponent","component","components","find","contextComponent","equals","_port","listen","server","address","getHostname","BindError","pub","BundlerAspect","id","createComponentsServerStartedEvent","onChange","url","envRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAKA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,eAAN,CAAsB;AAC3B;AAEAC,EAAAA,WAAW;AACT;AACJ;AACA;AACYC,EAAAA,MAJC;AAMT;AACJ;AACA;AACaC,EAAAA,OATA;AAWT;AACJ;AACA;AACaC,EAAAA,SAdA;AAgBT;AACJ;AACA;AACaC,EAAAA,SAnBA,EAoBT;AAAA,SAhBQH,MAgBR,GAhBQA,MAgBR;AAAA,SAXSC,OAWT,GAXSA,OAWT;AAAA,SANSC,SAMT,GANSA,SAMT;AAAA,SADSC,SACT,GADSA,SACT;AAAA;AAAA;AAAA;AAAA,gFA+CkC,CAACC,gBAAD,EAAmBH,OAAnB,EAA4BI,QAA5B,EAAsCC,IAAtC,KAA+C;AACjF,aAAO,KAAIC,sCAAJ,EAAiCC,IAAI,CAACC,GAAL,EAAjC,EAA6CL,gBAA7C,EAA+DH,OAA/D,EAAwEI,QAAxE,EAAkFC,IAAlF,CAAP;AACD,KAjDC;AAAE;;AAIJ;AACF;AACA;AACEI,EAAAA,YAAY,CAACC,SAAD,EAAuB;AACjC,WAAO,KAAKV,OAAL,CAAaW,UAAb,CAAwBC,I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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\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"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/bundler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.670",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/compilation/bundler",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.compilation",
|
|
8
8
|
"name": "bundler",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.670"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.2.11",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"lodash": "4.17.21",
|
|
16
16
|
"@babel/runtime": "7.12.18",
|
|
17
17
|
"core-js": "^3.0.0",
|
|
18
|
-
"@teambit/envs": "0.0.
|
|
19
|
-
"@teambit/builder": "0.0.
|
|
20
|
-
"@teambit/component": "0.0.
|
|
21
|
-
"@teambit/cli": "0.0.
|
|
22
|
-
"@teambit/graphql": "0.0.
|
|
23
|
-
"@teambit/pubsub": "0.0.
|
|
18
|
+
"@teambit/envs": "0.0.670",
|
|
19
|
+
"@teambit/builder": "0.0.670",
|
|
20
|
+
"@teambit/component": "0.0.670",
|
|
21
|
+
"@teambit/cli": "0.0.452",
|
|
22
|
+
"@teambit/graphql": "0.0.670",
|
|
23
|
+
"@teambit/pubsub": "0.0.670",
|
|
24
24
|
"@teambit/toolbox.network.get-port": "0.0.113"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@apollo/client": "^3.0.0",
|
|
37
|
-
"@teambit/legacy": "1.0.
|
|
37
|
+
"@teambit/legacy": "1.0.231",
|
|
38
38
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
39
39
|
"react": "^16.8.0 || ^17.0.0"
|
|
40
40
|
},
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"react": "-"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@teambit/legacy": "1.0.
|
|
65
|
+
"@teambit/legacy": "1.0.231",
|
|
66
66
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
67
67
|
"react": "^16.8.0 || ^17.0.0"
|
|
68
68
|
}
|
|
File without changes
|
|
Binary file
|