@teambit/bundler 0.0.919 → 0.0.920
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/dev-server.service.tsx +1 -1
- package/dist/dedup-envs.js +4 -1
- package/dist/dedup-envs.js.map +1 -1
- package/dist/dev-server.d.ts +10 -5
- package/dist/dev-server.js.map +1 -1
- package/dist/dev-server.service.js +1 -1
- package/dist/dev-server.service.js.map +1 -1
- package/{preview-1669865271197.js → dist/preview-1669911866429.js} +2 -2
- package/package-tar/teambit-bundler-0.0.920.tgz +0 -0
- package/package.json +10 -10
- package/package-tar/teambit-bundler-0.0.919.tgz +0 -0
package/dev-server.service.tsx
CHANGED
|
@@ -143,7 +143,7 @@ export class DevServerService implements EnvService<ComponentServer, DevServerDe
|
|
|
143
143
|
): Promise<DevServerContext> {
|
|
144
144
|
context.relatedContexts = additionalContexts.map((ctx) => ctx.envDefinition.id);
|
|
145
145
|
context.components = context.components.concat(this.getComponentsFromContexts(additionalContexts));
|
|
146
|
-
const peers = await this.dependencyResolver.
|
|
146
|
+
const peers = await this.dependencyResolver.getPreviewHostDependenciesFromEnv(context.envDefinition.env);
|
|
147
147
|
const hostRootDir = context.envRuntime.envAspectDefinition?.aspectPath;
|
|
148
148
|
|
|
149
149
|
return Object.assign(context, {
|
package/dist/dedup-envs.js
CHANGED
|
@@ -16,7 +16,10 @@ exports.dedupEnvs = dedupEnvs;
|
|
|
16
16
|
*/
|
|
17
17
|
async function dedupEnvs(contexts, dependencyResolver, dedicatedEnvDevServers) {
|
|
18
18
|
const idsGroups = groupByEnvId(contexts, dedicatedEnvDevServers);
|
|
19
|
-
const
|
|
19
|
+
const hasRootComponents = dependencyResolver.hasRootComponents();
|
|
20
|
+
// Do not split envs by peers if root components is enabled as it should be already handled by the package manager
|
|
21
|
+
// this will improve the performance of the dev server when root components is enabled
|
|
22
|
+
const finalGroups = hasRootComponents ? idsGroups : await splitByPeers(idsGroups, dependencyResolver);
|
|
20
23
|
return finalGroups;
|
|
21
24
|
}
|
|
22
25
|
function groupByEnvId(contexts, dedicatedEnvDevServers) {
|
package/dist/dedup-envs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dedupEnvs","contexts","dependencyResolver","dedicatedEnvDevServers","idsGroups","groupByEnvId","finalGroups","splitByPeers","groupedEnvs","forEach","context","envId","getEnvId","push","newGroupedEnvs","promises","Object","values","map","peersGroups","groupByPeersHash","assign","Promise","all","dedicatedServers","id","split","includes","env","getDevEnvId","peerGroups","policy","getComponentEnvPolicyFromEnv","autoDetectPeersHash","peersAutoDetectPolicy","hashNameVersion","regularPeersHash","variantPolicy","byLifecycleType","combinedHash","indexPeerGroupsById","result","reduce","acc","firstId"],"sources":["dedup-envs.ts"],"sourcesContent":["import { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport type { ExecutionContext } from '@teambit/envs';\n\ntype GroupIdContextMap = Record<string, ExecutionContext[]>;\n\n/**\n * de-duping dev servers by the amount of type the dev server configuration was overridden by envs.\n * This will split the dev server to groups of dev server that share the same webpack config, and same peer dependencies\n * @param contexts\n * @param dependencyResolver\n * @param dedicatedEnvDevServers\n */\nexport async function dedupEnvs(\n contexts: ExecutionContext[],\n dependencyResolver: DependencyResolverMain,\n dedicatedEnvDevServers?: string[]\n) {\n const idsGroups = groupByEnvId(contexts, dedicatedEnvDevServers);\n const finalGroups = await splitByPeers(idsGroups, dependencyResolver);\n return finalGroups;\n}\n\nfunction groupByEnvId(contexts: ExecutionContext[], dedicatedEnvDevServers?: string[]) {\n const groupedEnvs: GroupIdContextMap = {};\n\n contexts.forEach((context) => {\n const envId = getEnvId(context, dedicatedEnvDevServers);\n if (!envId) return;\n if (!(envId in groupedEnvs)) groupedEnvs[envId] = [];\n\n groupedEnvs[envId].push(context);\n });\n\n return groupedEnvs;\n}\n\nasync function splitByPeers(idsGroups: GroupIdContextMap, dependencyResolver: DependencyResolverMain) {\n const newGroupedEnvs: GroupIdContextMap = {};\n const promises = Object.values(idsGroups).map(async (contexts) => {\n const peersGroups = await groupByPeersHash(contexts, dependencyResolver);\n Object.assign(newGroupedEnvs, peersGroups);\n });\n await Promise.all(promises);\n return newGroupedEnvs;\n}\n\nfunction getEnvId(context: ExecutionContext, dedicatedServers?: string[]): string | undefined {\n const id = context.id.split('@')[0];\n\n if (dedicatedServers?.includes(id)) {\n return context.id;\n }\n\n return context.env?.getDevEnvId(context);\n}\n\nasync function groupByPeersHash(contexts: ExecutionContext[], dependencyResolver: DependencyResolverMain) {\n const peerGroups: GroupIdContextMap = {};\n\n await Promise.all(\n contexts.map(async (context) => {\n const env = context.env;\n const policy = await dependencyResolver.getComponentEnvPolicyFromEnv(env);\n const autoDetectPeersHash = policy.peersAutoDetectPolicy.hashNameVersion();\n const regularPeersHash = policy.variantPolicy.byLifecycleType('peer').hashNameVersion();\n const combinedHash = `${autoDetectPeersHash}:${regularPeersHash}`;\n if (!peerGroups[combinedHash]) {\n peerGroups[combinedHash] = [];\n }\n peerGroups[combinedHash].push(context);\n })\n );\n return indexPeerGroupsById(peerGroups);\n}\n\nfunction indexPeerGroupsById(peerGroups: GroupIdContextMap) {\n const result: GroupIdContextMap = Object.values(peerGroups).reduce((acc, contexts) => {\n const firstId = contexts[0].id;\n acc[firstId] = contexts;\n return acc;\n }, {});\n return result;\n}\n"],"mappings":";;;;;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeA,SAAS,CAC7BC,QAA4B,EAC5BC,kBAA0C,EAC1CC,sBAAiC,EACjC;EACA,MAAMC,SAAS,GAAGC,YAAY,CAACJ,QAAQ,EAAEE,sBAAsB,CAAC;EAChE,MAAMG,WAAW,GAAG,
|
|
1
|
+
{"version":3,"names":["dedupEnvs","contexts","dependencyResolver","dedicatedEnvDevServers","idsGroups","groupByEnvId","hasRootComponents","finalGroups","splitByPeers","groupedEnvs","forEach","context","envId","getEnvId","push","newGroupedEnvs","promises","Object","values","map","peersGroups","groupByPeersHash","assign","Promise","all","dedicatedServers","id","split","includes","env","getDevEnvId","peerGroups","policy","getComponentEnvPolicyFromEnv","autoDetectPeersHash","peersAutoDetectPolicy","hashNameVersion","regularPeersHash","variantPolicy","byLifecycleType","combinedHash","indexPeerGroupsById","result","reduce","acc","firstId"],"sources":["dedup-envs.ts"],"sourcesContent":["import { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport type { ExecutionContext } from '@teambit/envs';\n\ntype GroupIdContextMap = Record<string, ExecutionContext[]>;\n\n/**\n * de-duping dev servers by the amount of type the dev server configuration was overridden by envs.\n * This will split the dev server to groups of dev server that share the same webpack config, and same peer dependencies\n * @param contexts\n * @param dependencyResolver\n * @param dedicatedEnvDevServers\n */\nexport async function dedupEnvs(\n contexts: ExecutionContext[],\n dependencyResolver: DependencyResolverMain,\n dedicatedEnvDevServers?: string[]\n) {\n const idsGroups = groupByEnvId(contexts, dedicatedEnvDevServers);\n const hasRootComponents = dependencyResolver.hasRootComponents();\n // Do not split envs by peers if root components is enabled as it should be already handled by the package manager\n // this will improve the performance of the dev server when root components is enabled\n const finalGroups = hasRootComponents ? idsGroups : await splitByPeers(idsGroups, dependencyResolver);\n return finalGroups;\n}\n\nfunction groupByEnvId(contexts: ExecutionContext[], dedicatedEnvDevServers?: string[]) {\n const groupedEnvs: GroupIdContextMap = {};\n\n contexts.forEach((context) => {\n const envId = getEnvId(context, dedicatedEnvDevServers);\n if (!envId) return;\n if (!(envId in groupedEnvs)) groupedEnvs[envId] = [];\n\n groupedEnvs[envId].push(context);\n });\n\n return groupedEnvs;\n}\n\nasync function splitByPeers(idsGroups: GroupIdContextMap, dependencyResolver: DependencyResolverMain) {\n const newGroupedEnvs: GroupIdContextMap = {};\n const promises = Object.values(idsGroups).map(async (contexts) => {\n const peersGroups = await groupByPeersHash(contexts, dependencyResolver);\n Object.assign(newGroupedEnvs, peersGroups);\n });\n await Promise.all(promises);\n return newGroupedEnvs;\n}\n\nfunction getEnvId(context: ExecutionContext, dedicatedServers?: string[]): string | undefined {\n const id = context.id.split('@')[0];\n\n if (dedicatedServers?.includes(id)) {\n return context.id;\n }\n\n return context.env?.getDevEnvId(context);\n}\n\nasync function groupByPeersHash(contexts: ExecutionContext[], dependencyResolver: DependencyResolverMain) {\n const peerGroups: GroupIdContextMap = {};\n\n await Promise.all(\n contexts.map(async (context) => {\n const env = context.env;\n const policy = await dependencyResolver.getComponentEnvPolicyFromEnv(env);\n const autoDetectPeersHash = policy.peersAutoDetectPolicy.hashNameVersion();\n const regularPeersHash = policy.variantPolicy.byLifecycleType('peer').hashNameVersion();\n const combinedHash = `${autoDetectPeersHash}:${regularPeersHash}`;\n if (!peerGroups[combinedHash]) {\n peerGroups[combinedHash] = [];\n }\n peerGroups[combinedHash].push(context);\n })\n );\n return indexPeerGroupsById(peerGroups);\n}\n\nfunction indexPeerGroupsById(peerGroups: GroupIdContextMap) {\n const result: GroupIdContextMap = Object.values(peerGroups).reduce((acc, contexts) => {\n const firstId = contexts[0].id;\n acc[firstId] = contexts;\n return acc;\n }, {});\n return result;\n}\n"],"mappings":";;;;;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeA,SAAS,CAC7BC,QAA4B,EAC5BC,kBAA0C,EAC1CC,sBAAiC,EACjC;EACA,MAAMC,SAAS,GAAGC,YAAY,CAACJ,QAAQ,EAAEE,sBAAsB,CAAC;EAChE,MAAMG,iBAAiB,GAAGJ,kBAAkB,CAACI,iBAAiB,EAAE;EAChE;EACA;EACA,MAAMC,WAAW,GAAGD,iBAAiB,GAAGF,SAAS,GAAG,MAAMI,YAAY,CAACJ,SAAS,EAAEF,kBAAkB,CAAC;EACrG,OAAOK,WAAW;AACpB;AAEA,SAASF,YAAY,CAACJ,QAA4B,EAAEE,sBAAiC,EAAE;EACrF,MAAMM,WAA8B,GAAG,CAAC,CAAC;EAEzCR,QAAQ,CAACS,OAAO,CAAEC,OAAO,IAAK;IAC5B,MAAMC,KAAK,GAAGC,QAAQ,CAACF,OAAO,EAAER,sBAAsB,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AGlB,OAAO,CAACkB,GAAG;IACvB,MAAMG,MAAM,GAAG,MAAM9B,kBAAkB,CAAC+B,4BAA4B,CAACJ,GAAG,CAAC;IACzE,MAAMK,mBAAmB,GAAGF,MAAM,CAACG,qBAAqB,CAACC,eAAe,EAAE;IAC1E,MAAMC,gBAAgB,GAAGL,MAAM,CAACM,aAAa,CAACC,eAAe,CAAC,MAAM,CAAC,CAACH,eAAe,EAAE;IACvF,MAAMI,YAAY,GAAI,GAAEN,mBAAoB,IAAGG,gBAAiB,EAAC;IACjE,IAAI,CAACN,UAAU,CAACS,YAAY,CAAC,EAAE;MAC7BT,UAAU,CAACS,YAAY,CAAC,GAAG,EAAE;IAC/B;IACAT,UAAU,CAACS,YAAY,CAAC,CAAC1B,IAAI,CAACH,OAAO,CAAC;EACxC,CAAC,CAAC,CACH;EACD,OAAO8B,mBAAmB,CAACV,UAAU,CAAC;AACxC;AAEA,SAASU,mBAAmB,CAACV,UAA6B,EAAE;EAC1D,MAAMW,MAAyB,GAAGzB,MAAM,CAACC,MAAM,CAACa,UAAU,CAAC,CAACY,MAAM,CAAC,CAACC,GAAG,EAAE3C,QAAQ,KAAK;IACpF,MAAM4C,OAAO,GAAG5C,QAAQ,CAAC,CAAC,CAAC,CAACyB,EAAE;IAC9BkB,GAAG,CAACC,OAAO,CAAC,GAAG5C,QAAQ;IACvB,OAAO2C,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAC;EACN,OAAOF,MAAM;AACf"}
|
package/dist/dev-server.d.ts
CHANGED
|
@@ -9,15 +9,15 @@ export interface DevServer {
|
|
|
9
9
|
*/
|
|
10
10
|
listen(port: number): Server | Promise<Server>;
|
|
11
11
|
/**
|
|
12
|
-
* display name of the
|
|
12
|
+
* display name of the dev server.
|
|
13
13
|
*/
|
|
14
14
|
displayName?: string;
|
|
15
15
|
/**
|
|
16
|
-
* icon of the
|
|
16
|
+
* icon of the dev server.
|
|
17
17
|
*/
|
|
18
18
|
icon?: string;
|
|
19
19
|
/**
|
|
20
|
-
* serialized config of the
|
|
20
|
+
* serialized config of the dev server.
|
|
21
21
|
*/
|
|
22
22
|
displayConfig?(): string;
|
|
23
23
|
/**
|
|
@@ -25,11 +25,16 @@ export interface DevServer {
|
|
|
25
25
|
*/
|
|
26
26
|
configPath?: string;
|
|
27
27
|
/**
|
|
28
|
-
* id of the
|
|
28
|
+
* id of the dev server.
|
|
29
29
|
*/
|
|
30
30
|
id: string;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* hash of the dev server.
|
|
33
|
+
* This is used in order to determine if we should spin a different dev server.
|
|
34
|
+
*/
|
|
35
|
+
hash?(): string;
|
|
36
|
+
/**
|
|
37
|
+
* return the dev server version.
|
|
33
38
|
*/
|
|
34
39
|
version?(): string;
|
|
35
40
|
}
|
package/dist/dev-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["dev-server.ts"],"sourcesContent":["import { Server } from 'http';\n\n/**\n * interface for implementing dev servers.\n */\nexport interface DevServer {\n /**\n * attach to given port and start an http server\n */\n listen(port: number): Server | Promise<Server>;\n\n /**\n * display name of the
|
|
1
|
+
{"version":3,"names":[],"sources":["dev-server.ts"],"sourcesContent":["import { Server } from 'http';\n\n/**\n * interface for implementing dev servers.\n */\nexport interface DevServer {\n /**\n * attach to given port and start an http server\n */\n listen(port: number): Server | Promise<Server>;\n\n /**\n * display name of the dev server.\n */\n displayName?: string;\n\n /**\n * icon of the dev server.\n */\n icon?: string;\n\n /**\n * serialized config of the dev server.\n */\n displayConfig?(): string;\n\n /**\n * path to the config in the filesystem.\n */\n configPath?: string;\n\n /**\n * id of the dev server.\n */\n id: string;\n\n /**\n * hash of the dev server.\n * This is used in order to determine if we should spin a different dev server.\n */\n hash?(): string;\n\n /**\n * return the dev server version.\n */\n version?(): string;\n}\n"],"mappings":""}
|
|
@@ -147,7 +147,7 @@ class DevServerService {
|
|
|
147
147
|
var _context$envRuntime$e;
|
|
148
148
|
context.relatedContexts = additionalContexts.map(ctx => ctx.envDefinition.id);
|
|
149
149
|
context.components = context.components.concat(this.getComponentsFromContexts(additionalContexts));
|
|
150
|
-
const peers = await this.dependencyResolver.
|
|
150
|
+
const peers = await this.dependencyResolver.getPreviewHostDependenciesFromEnv(context.envDefinition.env);
|
|
151
151
|
const hostRootDir = (_context$envRuntime$e = context.envRuntime.envAspectDefinition) === null || _context$envRuntime$e === void 0 ? void 0 : _context$envRuntime$e.aspectPath;
|
|
152
152
|
return Object.assign(context, {
|
|
153
153
|
entry: await (0, _getEntry().getEntry)(context, this.runtimeSlot),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DevServerService","constructor","pubsub","dependencyResolver","runtimeSlot","render","env","context","descriptor","getDescriptor","id","displayName","version","highlight","config","language","ignoreIllegals","environment","getDevServer","undefined","mergedContext","buildContext","devServer","icon","displayConfig","runOnce","contexts","dedicatedEnvDevServers","groupedEnvs","dedupEnvs","servers","Promise","all","Object","entries","map","contextList","mainContext","find","envDefinition","additionalContexts","filter","devServerContext","envRuntime","ComponentServer","mergeContext","getComponentsFromContexts","flatten","components","relatedContexts","ctx","concat","peers","
|
|
1
|
+
{"version":3,"names":["DevServerService","constructor","pubsub","dependencyResolver","runtimeSlot","render","env","context","descriptor","getDescriptor","id","displayName","version","highlight","config","language","ignoreIllegals","environment","getDevServer","undefined","mergedContext","buildContext","devServer","icon","displayConfig","runOnce","contexts","dedicatedEnvDevServers","groupedEnvs","dedupEnvs","servers","Promise","all","Object","entries","map","contextList","mainContext","find","envDefinition","additionalContexts","filter","devServerContext","envRuntime","ComponentServer","mergeContext","getComponentsFromContexts","flatten","components","relatedContexts","ctx","concat","peers","getPreviewHostDependenciesFromEnv","hostRootDir","envAspectDefinition","aspectPath","assign","entry","getEntry","rootPath","publicPath","sep","hostDependencies","aliasHostDependencies"],"sources":["dev-server.service.tsx"],"sourcesContent":["import { EnvService, ExecutionContext, EnvDefinition } from '@teambit/envs';\nimport { PubsubMain } from '@teambit/pubsub';\nimport { flatten } from 'lodash';\nimport React from 'react';\nimport { Text, Newline } from 'ink';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport highlight from 'cli-highlight';\nimport { sep } from 'path';\nimport { BrowserRuntimeSlot } 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\nexport type DevServerDescriptor = {\n /**\n * id of the dev server (e.g. jest/mocha)\n */\n id: string;\n\n /**\n * display name of the dev server (e.g. Jest / Mocha)\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 /**\n * browser runtime slot\n */\n private pubsub: PubsubMain,\n\n private dependencyResolver: DependencyResolverMain,\n\n /**\n * browser runtime slot\n */\n private runtimeSlot: BrowserRuntimeSlot\n ) {}\n\n async render(env: EnvDefinition, context: ExecutionContext[]) {\n const descriptor = await this.getDescriptor(env, context);\n return (\n <Text key={descriptor?.id}>\n <Text color=\"cyan\">configured dev server: </Text>\n <Text>\n {descriptor?.id} ({descriptor?.displayName} @ {descriptor?.version})\n </Text>\n <Newline />\n <Text underline color=\"cyan\">\n dev server config:\n </Text>\n <Newline />\n <Text>\n {/* refactor a separate component which highlights for cli */}\n {highlight(descriptor?.config || '', { language: 'javascript', ignoreIllegals: true })}\n </Text>\n <Newline />\n </Text>\n );\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 // 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 const servers = await Promise.all(\n Object.entries(groupedEnvs).map(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\n return new ComponentServer(this.pubsub, devServerContext, [3300, 3400], devServer);\n })\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 aliasH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CAACkD,iCAAiC,CAAC9C,OAAO,CAACgC,aAAa,CAACjC,GAAG,CAAC;IACxG,MAAMgD,WAAW,4BAAG/C,OAAO,CAACoC,UAAU,CAACY,mBAAmB,0DAAtC,sBAAwCC,UAAU;IAEtE,OAAOvB,MAAM,CAACwB,MAAM,CAAClD,OAAO,EAAE;MAC5BmD,KAAK,EAAE,MAAM,IAAAC,oBAAQ,EAACpD,OAAO,EAAE,IAAI,CAACH,WAAW,CAAC;MAChD;MACAwD,QAAQ,EAAG,WAAUrD,OAAO,CAACoC,UAAU,CAACjC,EAAG,EAAC;MAC5CmD,UAAU,EAAG,GAAEC,WAAI,QAAO;MAC1BR,WAAW;MACXS,gBAAgB,EAAEX,KAAK;MACvBY,qBAAqB,EAAE;IACzB,CAAC,CAAC;EACJ;AACF;AAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@0.0.920/dist/bundler.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@0.0.920/dist/bundler.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
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.920",
|
|
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.920"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"cli-highlight": "2.1.9",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"@babel/runtime": "7.20.0",
|
|
16
16
|
"core-js": "^3.0.0",
|
|
17
17
|
"@teambit/harmony": "0.3.3",
|
|
18
|
-
"@teambit/envs": "0.0.
|
|
19
|
-
"@teambit/builder": "0.0.
|
|
20
|
-
"@teambit/component": "0.0.
|
|
21
|
-
"@teambit/cli": "0.0.
|
|
22
|
-
"@teambit/dependency-resolver": "0.0.
|
|
23
|
-
"@teambit/graphql": "0.0.
|
|
24
|
-
"@teambit/pubsub": "0.0.
|
|
18
|
+
"@teambit/envs": "0.0.920",
|
|
19
|
+
"@teambit/builder": "0.0.920",
|
|
20
|
+
"@teambit/component": "0.0.920",
|
|
21
|
+
"@teambit/cli": "0.0.616",
|
|
22
|
+
"@teambit/dependency-resolver": "0.0.920",
|
|
23
|
+
"@teambit/graphql": "0.0.920",
|
|
24
|
+
"@teambit/pubsub": "0.0.920",
|
|
25
25
|
"@teambit/toolbox.network.get-port": "0.0.121"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@apollo/client": "^3.6.0",
|
|
38
|
-
"@teambit/legacy": "1.0.
|
|
38
|
+
"@teambit/legacy": "1.0.397",
|
|
39
39
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
40
40
|
"react": "^16.8.0 || ^17.0.0"
|
|
41
41
|
},
|
|
Binary file
|