@teambit/bundler 0.0.735 → 0.0.738
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/browser-runtime.js.map +1 -1
- package/dist/bundle.js.map +1 -1
- package/dist/bundler-context.js.map +1 -1
- package/dist/bundler.aspect.js.map +1 -1
- package/dist/bundler.composition.js.map +1 -1
- package/dist/bundler.js.map +1 -1
- package/dist/bundler.main.runtime.js.map +1 -1
- package/dist/component-server.js.map +1 -1
- package/dist/dedup-envs.js.map +1 -1
- package/dist/dev-server-context.js.map +1 -1
- package/dist/dev-server.graphql.js.map +1 -1
- package/dist/dev-server.js.map +1 -1
- package/dist/dev-server.service.js.map +1 -1
- package/dist/events/components-server-started-event.js.map +1 -1
- package/dist/events/index.js.map +1 -1
- package/dist/exceptions/bind-error.js.map +1 -1
- package/dist/exceptions/index.js.map +1 -1
- package/dist/get-entry.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/select-port.js.map +1 -1
- package/package-tar/teambit-bundler-0.0.738.tgz +0 -0
- package/package.json +7 -7
- package/{preview-1652808661748.js → preview-1653227849497.js} +2 -2
- package/tsconfig.json +1 -1
- package/package-tar/teambit-bundler-0.0.735.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["browser-runtime.ts"],"sourcesContent":["import { ExecutionContext } from '@teambit/envs';\n\nexport type BrowserRuntime = {\n entry: (context: ExecutionContext) => Promise<string[]>;\n};\n"],"mappings":""}
|
package/dist/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Bundle","constructor","errors"],"sources":["bundle.ts"],"sourcesContent":["export class Bundle {\n constructor(readonly errors: Error) {}\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,MAAN,CAAa;EAClBC,WAAW,CAAUC,MAAV,EAAyB;IAAA,KAAfA,MAAe,GAAfA,MAAe;EAAE;;AADpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["bundler-context.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { BuildContext } from '@teambit/builder';\n\nexport type LibraryOptions = {\n /**\n * Specify a name for the library\n */\n name: string;\n // TODO: decide which exact types we want to support and their exact names\n /**\n * Configure how the library will be exposed\n * could be values like: 'umd', 'umd2', 'amd', 'commonjs',\n */\n type?: string;\n};\n\nexport type Entry = {\n /**\n * Specifies the name of each output file on disk\n */\n filename: string;\n /**\n * Module(s) that are loaded upon startup\n */\n import: string | string[];\n\n /**\n * Specify library options to bundle a library from current entry\n */\n library?: LibraryOptions;\n};\n\nexport type EntryMap = {\n [entryName: string]: Entry;\n};\n\nexport type Target = {\n /**\n * entries of the target.\n */\n entries: string[] | EntryMap;\n\n /**\n * array of components included in the target.\n */\n components: Component[];\n\n /**\n * output path of the target\n */\n outputPath: string;\n\n /**\n * This option determines the name of each output bundle\n */\n filename?: string;\n\n /**\n * This option determines the name of non-initial chunk files\n */\n chunkFilename?: string;\n\n /**\n * Make the peer dependencies externals.\n */\n externalizePeer?: boolean;\n\n /**\n * Whether to run compression by the bundler\n */\n compress?: boolean;\n\n /**\n * List of peer dependencies\n */\n peers?: string[];\n\n /**\n * config for html generation\n */\n html?: HtmlConfig[];\n\n /**\n * module targets to expose.\n */\n modules?: ModuleTarget[];\n\n /**\n * Name for the runtime chunk\n */\n runtimeChunkName?: string;\n\n /**\n * Different configuration related to chunking\n */\n chunking?: Chunking;\n\n /**\n * A path for the host root dir\n * Host root dir is usually the env root dir\n * This can be used in different bundle options which run require.resolve\n * for example when configuring webpack aliases or webpack expose loader on the peers deps\n */\n hostRootDir?: string;\n};\n\nexport type ModuleTarget = {\n /**\n * name of the module.\n */\n name: string;\n\n /**\n * module exposes.\n */\n exposes: {\n [internalPath: string]: string;\n };\n\n shared: {\n [key: string]: any;\n };\n};\n\nexport type HtmlConfig = {\n /**\n * The title to use for the generated HTML document\n */\n title: string;\n /**\n * The file to write the HTML to. Defaults to index.html\n */\n filename?: string;\n /**\n * Allows you to add only some chunks (e.g only the unit-test chunk)\n */\n chunks?: string[];\n /**\n * provide an inline template\n */\n templateContent: string;\n /**\n * Controls if and in what ways the output should be minified\n */\n minify?: boolean;\n\n /**\n * The favicon for the html page\n */\n favicon?: string;\n\n // TODO: consider add chunksSortMode if there are more needs\n};\n\nexport type Chunking = {\n /**\n * include all types of chunks (async / non-async) in splitting\n */\n splitChunks: boolean;\n};\n\nexport type MetaData = {\n /**\n * Who initiate the bundling process\n */\n initiator?: string;\n /**\n * Env id (used usually to calculate the config)\n */\n envId?: string;\n};\nexport interface BundlerContext extends BuildContext {\n /**\n * targets for bundling.\n */\n targets: Target[];\n\n /**\n * determines whether it is a production build, default is `true`.\n * in development, expect the bundler to favour debugging on the expanse of optimization.\n */\n development?: boolean;\n\n /**\n * public path output of the bundle.\n */\n publicPath?: string;\n\n /**\n * root path\n */\n rootPath?: string;\n\n /**\n * Make the peer dependencies externals for all targets\n */\n externalizePeer?: boolean;\n\n /**\n * Whether to run compression by the bundler\n */\n compress?: boolean;\n\n /**\n * config for html generation for all targets\n */\n html?: HtmlConfig[];\n\n /**\n * modules for bundle to expose. used by module federation at webpack, or with different methods applied by various bundlers.\n */\n modules?: {\n name: string;\n fileName: string;\n exposes: { [key: string]: string };\n };\n\n /**\n * Additional info that can be used by the bundler for different stuff like logging info\n */\n metaData?: MetaData;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["BundlerAspect","Aspect","create","id"],"sources":["bundler.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const BundlerAspect = Aspect.create({\n id: 'teambit.compilation/bundler',\n});\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,aAAa,GAAGC,iBAAA,CAAOC,MAAP,CAAc;EACzCC,EAAE,EAAE;AADqC,CAAd,CAAtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["bundler.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/bundler.svg\" />\n </div>\n);\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAV;IAAkBC,OAAO,EAAE,MAA3B;IAAmCC,cAAc,EAAE;EAAnD;AAAZ,gBACE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAT,CAAZ;EAA2B,GAAG,EAAC;AAA/B,EADF,CADK"}
|
package/dist/bundler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["bundler.ts"],"sourcesContent":["import { Component } from '@teambit/component';\n\nexport interface DevServer {\n start(): void;\n}\n\nexport type Asset = {\n /**\n * name of the asset.\n */\n name: string;\n\n /**\n * size of the asset in bytes.\n */\n size: number;\n\n /**\n * size of the compressed asset in bytes.\n */\n compressedSize?: number;\n};\n\nexport type ChunksAssetsMap = {\n [assetName: string]: string[];\n};\n\nexport type EntryAssets = {\n assets: Asset[];\n auxiliaryAssets: Asset[];\n assetsSize: number;\n compressedAssetsSize?: number;\n auxiliaryAssetsSize: number;\n compressedAuxiliaryAssetsSize: number;\n};\n\nexport type EntriesAssetsMap = {\n [entryId: string]: EntryAssets;\n};\n\nexport type BundlerResult = {\n /**\n * list of generated assets.\n */\n assets: Asset[];\n\n /**\n * A map of assets names for each chunk\n */\n assetsByChunkName?: ChunksAssetsMap;\n\n /**\n * A map of assets for each entry point\n */\n entriesAssetsMap?: EntriesAssetsMap;\n\n /**\n * errors thrown during the bundling process.\n */\n errors: Error[];\n\n /**\n * warnings thrown during the bundling process.\n */\n warnings: string[];\n\n /**\n * components included in the bundling process.\n */\n components: Component[];\n\n /**\n * timestamp in milliseconds when the task started\n */\n startTime?: number;\n\n /**\n * timestamp in milliseconds when the task ended\n */\n endTime?: number;\n\n /**\n * out put path of the Bundler Result\n */\n outputPath?: string;\n};\n\nexport interface Bundler {\n run(): Promise<BundlerResult[]>;\n}\n\nexport type BundlerMode = 'dev' | 'prod';\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["BundlerMain","constructor","config","pubsub","envs","devService","runtimeSlot","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","provider","graphql","devServerService","DevServerService","bundler","registerService","devServerSchema","Slot","withType","MainRuntime","PubsubAspect","EnvsAspect","GraphqlAspect","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 { 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';\n\nexport type BrowserRuntimeSlot = SlotRegistry<BrowserRuntime>;\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 /**\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 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 * component servers.\n */\n private _componentServers: null | ComponentServer[];\n\n private indexByComponent() {}\n\n static slots = [Slot.withType<BrowserRuntime>()];\n\n static runtime = MainRuntime;\n static dependencies = [PubsubAspect, EnvsAspect, GraphqlAspect, ComponentAspect];\n\n static defaultConfig = {\n dedicatedEnvDevServers: [],\n };\n\n static async provider(\n [pubsub, envs, graphql]: [PubsubMain, EnvsMain, GraphqlMain],\n config,\n [runtimeSlot]: [BrowserRuntimeSlot]\n ) {\n const devServerService = new DevServerService(pubsub, runtimeSlot);\n const bundler = new BundlerMain(config, pubsub, envs, devServerService, runtimeSlot);\n envs.registerService(devServerService);\n\n graphql.register(devServerSchema(bundler));\n\n return bundler;\n }\n}\n\nBundlerAspect.addRuntime(BundlerMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAQA;AACA;AACA;AACO,MAAMA,WAAN,CAAkB;EACvBC,WAAW,CACAC,MADA;EAET;AACJ;AACA;EACYC,MALC;EAOT;AACJ;AACA;EACYC,IAVC;EAYT;AACJ;AACA;EACYC,UAfC;EAiBT;AACJ;AACA;EACYC,WApBC,EAqBT;IAAA,KApBSJ,MAoBT,GApBSA,MAoBT;IAAA,KAhBQC,MAgBR,GAhBQA,MAgBR;IAAA,KAXQC,IAWR,GAXQA,IAWR;IAAA,KANQC,UAMR,GANQA,UAMR;IAAA,KADQC,WACR,GADQA,WACR;IAAA;EAAE;EAEJ;AACF;AACA;AACA;;;EACiB,MAATC,SAAS,CAACC,UAAD,EAAsD;IACnE,MAAMC,UAAU,GAAG,MAAM,KAAKL,IA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f,CAAoBS,OAAD,IAAa;MAC9B,OAAO,KAAKpC,WAAL,CAAiBqC,QAAjB,CAA0BD,OAA1B,CAAP;IACD,CAFD;IAIA,OAAO,IAAP;EACD;EAED;AACF;AACA;;;EAGU3B,gBAAgB,GAAG,CAAE;;EAWR,aAAR6B,QAAQ,CACnB,CAACzC,MAAD,EAASC,IAAT,EAAeyC,OAAf,CADmB,EAEnB3C,MAFmB,EAGnB,CAACI,WAAD,CAHmB,EAInB;IACA,MAAMwC,gBAAgB,GAAG,KAAIC,8BAAJ,EAAqB5C,MAArB,EAA6BG,WAA7B,CAAzB;IACA,MAAM0C,OAAO,GAAG,IAAIhD,WAAJ,CAAgBE,MAAhB,EAAwBC,MAAxB,EAAgCC,IAAhC,EAAsC0C,gBAAtC,EAAwDxC,WAAxD,CAAhB;IACAF,IAAI,CAAC6C,eAAL,CAAqBH,gBAArB;IAEAD,OAAO,CAACF,QAAR,CAAiB,IAAAO,4BAAA,EAAgBF,OAAhB,CAAjB;IAEA,OAAOA,OAAP;EACD;;AAhHsB;;;gCAAZhD,W,WA2FI,CAACmD,eAAA,CAAKC,QAAL,EAAD,C;gCA3FJpD,W,aA6FMqD,kB;gCA7FNrD,W,kBA8FW,CAACsD,iBAAD,EAAeC,kBAAf,EAA2BC,wBAA3B,EAA0CC,4BAA1C,C;gCA9FXzD,W,mBAgGY;EACrBa,sBAAsB,EAAE;AADH,C;;AAmBzB6C,wBAAA,CAAcC,UAAd,CAAyB3D,WAAzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["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"],"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\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":";;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA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AAjB,CAAjB;IACA,IAAI,CAACA,OAAL,EAAc,MAAM,KAAIE,uBAAJ,GAAN;IACd,KAAKjB,QAAL,GAAgBA,QAAhB;IAEA,KAAKL,MAAL,CAAYuB,GAAZ,CAAgBC,wBAAA,CAAcC,EAA9B,EAAkC,KAAKC,kCAAL,CAAwCP,MAAxC,EAAgD,KAAKlB,OAArD,EAA8DI,QAA9D,EAAwEC,IAAxE,CAAlC;EACD;;EAEOe,WAAW,CAACD,OAAD,EAAuC;IACxD,IAAIA,OAAO,KAAK,IAAhB,EAAsB,MAAM,KAAIE,uBAAJ,GAAN;IACtB,IAAI,OAAOF,OAAP,KAAmB,QAAvB,EAAiC,OAAOA,OAAP;IAEjC,IAAIf,QAAQ,GAAGe,OAAO,CAACA,OAAvB;;IACA,IAAIf,QAAQ,KAAK,IAAjB,EAAuB;MACrBA,QAAQ,GAAG,WAAX;IACD;;IAED,OAAOA,QAAP;EACD;;EAEOsB,QAAQ,GAAG,CAAE;;EAWrB;AACF;AACA;EACS,IAAHC,GAAG,GAAG;IACR;IACA,OAAQ,YAAW,KAAK3B,OAAL,CAAa4B,UAAb,CAAwBJ,EAAG,GAA9C;EACD;;AAhF0B"}
|
package/dist/dedup-envs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["dedupEnvs","contexts","dedicatedEnvDevServers","groupedEnvs","forEach","context","envId","getEnvId","push","dedicatedServers","id","split","includes","env","getDevEnvId"],"sources":["dedup-envs.ts"],"sourcesContent":["import type { ExecutionContext } from '@teambit/envs';\n\n// de-duping dev servers by the amount of type the dev server configuration was overridden by envs.\nexport function dedupEnvs(contexts: ExecutionContext[], dedicatedEnvDevServers?: string[]) {\n const groupedEnvs: Record<string, ExecutionContext[]> = {};\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\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"],"mappings":";;;;;;;;;AAEA;AACO,SAASA,SAAT,CAAmBC,QAAnB,EAAiDC,sBAAjD,EAAoF;EACzF,MAAMC,WAA+C,GAAG,EAAxD;EAEAF,QAAQ,CAACG,OAAT,CAAkBC,OAAD,IAAa;IAC5B,MAAMC,KAAK,GAAGC,QAAQ,CAACF,OAAD,EAAUH,sBAAV,CAAtB;IACA,IAAI,CAACI,KAAL,EAAY;IACZ,IAAI,EAAEA,KAAK,IAAIH,WAAX,CAAJ,EAA6BA,WAAW,CAACG,KAAD,CAAX,GAAqB,EAArB;IAE7BH,WAAW,CAACG,KAAD,CAAX,CAAmBE,IAAnB,CAAwBH,OAAxB;EACD,CAND;EAQA,OAAOF,WAAP;AACD;;AAED,SAASI,QAAT,CAAkBF,OAAlB,EAA6CI,gBAA7C,EAA8F;EAAA;;EAC5F,MAAMC,EAAE,GAAGL,OAAO,CAACK,EAAR,CAAWC,KAAX,CAAiB,GAAjB,EAAsB,CAAtB,CAAX;;EAEA,IAAIF,gBAAJ,aAAIA,gBAAJ,eAAIA,gBAAgB,CAAEG,QAAlB,CAA2BF,EAA3B,CAAJ,EAAoC;IAClC,OAAOL,OAAO,CAACK,EAAf;EACD;;EAED,uBAAOL,OAAO,CAACQ,GAAf,iDAAO,aAAaC,WAAb,CAAyBT,OAAzB,CAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["dev-server-context.ts"],"sourcesContent":["import { ExecutionContext } from '@teambit/envs';\n\nexport interface DevServerContext extends ExecutionContext {\n /**\n * array of files to include.\n */\n entry: string[];\n\n /**\n * public path.\n */\n publicPath: string;\n\n /**\n * root path of the workspace.\n */\n rootPath: string;\n\n /**\n * title of the page.\n */\n title?: string;\n\n /**\n * favicon of the page.\n */\n favicon?: string;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["devServerSchema","bundler","typeDefs","gql","resolvers","Component","server","component","args","context","requestedId","body","variables","id","includes","componentServer","getComponentServer","env","envRuntime","url"],"sources":["dev-server.graphql.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { Schema } from '@teambit/graphql';\nimport { gql } from '@apollo/client';\n\nimport { BundlerMain } from './bundler.main.runtime';\n\n// TODO: this has to be refactored to the Preview aspect. with the entire preview logic here.\nexport function devServerSchema(bundler: BundlerMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n server: ComponentServer\n }\n\n type ComponentServer {\n env: String\n url: String\n }\n `,\n resolvers: {\n Component: {\n server: (component: Component, args, context) => {\n // This is a bit of a hack to get the requested id. it assumes the variable name of\n // the gotHost.get query is \"id\".\n // see it in scopes/component/component/component.graphql.ts\n const requestedId = context.body.variables.id;\n // if we ask for specific id with specific version it means we want to fetch if from scope\n // so don't return the server url\n // see https://github.com/teambit/bit/issues/5328\n if (requestedId && requestedId.includes('@')) {\n return {};\n }\n const componentServer = bundler.getComponentServer(component);\n if (!componentServer) return {};\n\n return {\n env: componentServer.context.envRuntime.id,\n url: componentServer.url,\n };\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;AACO,SAASA,eAAT,CAAyBC,OAAzB,EAAuD;EAC5D,OAAO;IACLC,QAAQ,EAAE,IAAAC,aAAA,CAAI;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAVS;IAWLC,SAAS,EAAE;MACTC,SAAS,EAAE;QACTC,MAAM,EAAE,CAACC,SAAD,EAAuBC,IAAvB,EAA6BC,OAA7B,KAAyC;UAC/C;UACA;UACA;UACA,MAAMC,WAAW,GAAGD,OAAO,CAACE,IAAR,CAAaC,SAAb,CAAuBC,EAA3C,CAJ+C,CAK/C;UACA;UACA;;UACA,IAAIH,WAAW,IAAIA,WAAW,CAACI,QAAZ,CAAqB,GAArB,CAAnB,EAA8C;YAC5C,OAAO,EAAP;UACD;;UACD,MAAMC,eAAe,GAAGd,OAAO,CAACe,kBAAR,CAA2BT,SAA3B,CAAxB;UACA,IAAI,CAACQ,eAAL,EAAsB,OAAO,EAAP;UAEtB,OAAO;YACLE,GAAG,EAAEF,eAAe,CAACN,OAAhB,CAAwBS,UAAxB,CAAmCL,EADnC;YAELM,GAAG,EAAEJ,eAAe,CAACI;UAFhB,CAAP;QAID;MAnBQ;IADF;EAXN,CAAP;AAmCD"}
|
package/dist/dev-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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 tester.\n */\n displayName?: string;\n\n /**\n * icon of the tester.\n */\n icon?: string;\n\n /**\n * serialized config of the tester.\n */\n displayConfig?(): string;\n\n /**\n * path to the config in the filesystem.\n */\n configPath?: string;\n\n /**\n * id of the tester.\n */\n id: string;\n\n /**\n * return the tester version.\n */\n version?(): string;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DevServerService","constructor","pubsub","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","assign","entry","getEntry","rootPath","publicPath","sep"],"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 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 /**\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 = dedupEnvs(contexts, 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\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 });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA;EAAA;;EAAA;IAAA;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B,KAAKH,WAAvB,CADe;MAE5B;MACAmD,QAAQ,EAAG,WAAUhD,OAAO,CAACoC,UAAR,CAAmBjC,EAAG,EAHf;MAI5B8C,UAAU,EAAG,GAAEC,WAAI;IAJS,CAAvB,CAAP;EAMD;;AA7GuF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["ComponentsServerStartedEventData","constructor","componentsServer","context","hostname","port","ComponentsServerStartedEvent","BitBaseEvent","timestamp","TYPE"],"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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAFA;AAIA,MAAMA,gCAAN,CAAuC;EACrCC,WAAW,CAAUC,gBAAV,EAAqCC,OAArC,EAAuDC,QAAvD,EAA0EC,IAA1E,EAAgF;IAAA,KAAtEH,gBAAsE,GAAtEA,gBAAsE;IAAA,KAA3CC,OAA2C,GAA3CA,OAA2C;IAAA,KAAzBC,QAAyB,GAAzBA,QAAyB;IAAA,KAANC,IAAM,GAANA,IAAM;EAAE;;AADxD;;AAIhC,MAAMC,4BAAN,SAA2CC,sBAA3C,CAA0F;EAG/FN,WAAW,CAAUO,SAAV,EAA8BN,gBAA9B,EAAyDC,OAAzD,EAA2EC,QAA3E,EAA8FC,IAA9F,EAAoG;IAC7G,MACEC,4BAA4B,CAACG,IAD/B,EAEE,OAFF,EAGED,SAHF,EAIE,IAAIR,gCAAJ,CAAqCE,gBAArC,EAAuDC,OAAvD,EAAgEC,QAAhE,EAA0EC,IAA1E,CAJF;IAD6G,KAA1FG,SAA0F,GAA1FA,SAA0F;IAAA,KAAtEN,gBAAsE,GAAtEA,gBAAsE;IAAA,KAA3CC,OAA2C,GAA3CA,OAA2C;IAAA,KAAzBC,QAAyB,GAAzBA,QAAyB;IAAA,KAANC,IAAM,GAANA,IAAM;EAO9G;;AAV8F;;;gCAApFC,4B,UACY,2B"}
|
package/dist/events/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './components-server-started-event';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["bind-error.ts"],"
|
|
1
|
+
{"version":3,"names":["BindError","Error"],"sources":["bind-error.ts"],"sourcesContent":["export class BindError extends Error {}\n"],"mappings":";;;;;;;AAAO,MAAMA,SAAN,SAAwBC,KAAxB,CAA8B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { BindError } from './bind-error';\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
|
package/dist/get-entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["getEntry","context","runtimeSlot","slotEntries","Promise","all","values","map","browserRuntime","entry","slotPaths","reduce","acc","current","concat"],"sources":["get-entry.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component';\nimport { ExecutionContext } from '@teambit/envs';\nimport { GetBitMapComponentOptions } from '@teambit/legacy/dist/consumer/bit-map/bit-map';\nimport { PathOsBased } from '@teambit/legacy/dist/utils/path';\n\nimport { BrowserRuntimeSlot } from './bundler.main.runtime';\n\nexport type ComponentDir = {\n componentDir?: (\n componentId: ComponentID,\n bitMapOptions?: GetBitMapComponentOptions,\n options?: { relative: boolean }\n ) => PathOsBased | undefined;\n};\n\n/**\n * computes the bundler entry.\n */\nexport async function getEntry(context: ExecutionContext, runtimeSlot: BrowserRuntimeSlot): Promise<string[]> {\n // TODO: refactor this away from here and use computePaths instead\n const slotEntries = await Promise.all(\n 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"],"mappings":";;;;;;;;;;;AAeA;AACA;AACA;AACO,eAAeA,QAAf,CAAwBC,OAAxB,EAAmDC,WAAnD,EAAuG;EAC5G;EACA,MAAMC,WAAW,GAAG,MAAMC,OAAO,CAACC,GAAR,CACxBH,WAAW,CAACI,MAAZ,GAAqBC,GAArB,CAAyB,MAAOC,cAAP,IAA0BA,cAAc,CAACC,KAAf,CAAqBR,OAArB,CAAnD,CADwB,CAA1B;EAIA,MAAMS,SAAS,GAAGP,WAAW,CAACQ,MAAZ,CAAmB,CAACC,GAAD,EAAMC,OAAN,KAAkB;IACrDD,GAAG,GAAGA,GAAG,CAACE,MAAJ,CAAWD,OAAX,CAAN;IACA,OAAOD,GAAP;EACD,CAHiB,CAAlB;EAKA,OAAOF,SAAP;AACD"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { DevServer } from './dev-server';\nexport { DevServerContext } from './dev-server-context';\nexport {\n BundlerContext,\n Target,\n ModuleTarget,\n HtmlConfig as BundlerHtmlConfig,\n EntryMap as BundlerEntryMap,\n Entry as BundlerEntry,\n MetaData as BundlerContextMetaData,\n} from './bundler-context';\nexport { Bundler, BundlerResult, BundlerMode, Asset, ChunksAssetsMap, EntriesAssetsMap, EntryAssets } from './bundler';\nexport type { BundlerMain } from './bundler.main.runtime';\nexport { BundlerAspect } from './bundler.aspect';\nexport { ComponentDir } from './get-entry';\nexport { ComponentServer } from './component-server';\nexport * from './events';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AASA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
package/dist/select-port.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["selectPort","range","Port","getPortFromRange"],"sources":["select-port.ts"],"sourcesContent":["import { Port } from '@teambit/toolbox.network.get-port';\n\n/**\n * get an available port between range 3000 to 3200 or from port range\n */\nexport async function selectPort(range: number[] | number): Promise<number> {\n return Port.getPortFromRange(range);\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;AACA;AACA;AACO,eAAeA,UAAf,CAA0BC,KAA1B,EAAqE;EAC1E,OAAOC,sBAAA,CAAKC,gBAAL,CAAsBF,KAAtB,CAAP;AACD"}
|
|
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.738",
|
|
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.738"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"cli-highlight": "2.1.9",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"@babel/runtime": "7.12.18",
|
|
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.
|
|
18
|
+
"@teambit/envs": "0.0.738",
|
|
19
|
+
"@teambit/builder": "0.0.738",
|
|
20
|
+
"@teambit/component": "0.0.738",
|
|
21
21
|
"@teambit/cli": "0.0.491",
|
|
22
|
-
"@teambit/graphql": "0.0.
|
|
23
|
-
"@teambit/pubsub": "0.0.
|
|
22
|
+
"@teambit/graphql": "0.0.738",
|
|
23
|
+
"@teambit/pubsub": "0.0.738",
|
|
24
24
|
"@teambit/toolbox.network.get-port": "0.0.113"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@0.0.738/dist/bundler.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_bundler@0.0.738/dist/bundler.docs.mdx')]
|
package/tsconfig.json
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"declaration": true,
|
|
16
16
|
"sourceMap": true,
|
|
17
17
|
"skipLibCheck": true,
|
|
18
|
+
"experimentalDecorators": true,
|
|
18
19
|
"outDir": "dist",
|
|
19
20
|
"moduleResolution": "node",
|
|
20
21
|
"esModuleInterop": true,
|
|
21
22
|
"rootDir": ".",
|
|
22
23
|
"resolveJsonModule": true,
|
|
23
24
|
"emitDeclarationOnly": true,
|
|
24
|
-
"experimentalDecorators": true,
|
|
25
25
|
"emitDecoratorMetadata": true,
|
|
26
26
|
"allowSyntheticDefaultImports": true,
|
|
27
27
|
"strictPropertyInitialization": false,
|
|
Binary file
|