@teambit/application 0.0.486 → 0.0.489
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/application.main.runtime.d.ts +5 -0
- package/dist/application.main.runtime.js +47 -2
- package/dist/application.main.runtime.js.map +1 -1
- package/package-tar/teambit-application-0.0.489.tgz +0 -0
- package/package.json +13 -12
- package/{preview-1662281577904.js → preview-1662694416892.js} +2 -2
- package/package-tar/teambit-application-0.0.486.tgz +0 -0
|
@@ -61,10 +61,15 @@ export declare class ApplicationMain {
|
|
|
61
61
|
* list apps by a component id.
|
|
62
62
|
*/
|
|
63
63
|
listAppsById(id?: ComponentID): Application[] | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* get an application by a component id.
|
|
66
|
+
*/
|
|
67
|
+
getAppById(id: ComponentID): Application | undefined;
|
|
64
68
|
/**
|
|
65
69
|
* get an app.
|
|
66
70
|
*/
|
|
67
71
|
getApp(appName: string, id?: ComponentID): Application | undefined;
|
|
72
|
+
getAppByNameOrId(appNameOrId: string): Application | undefined;
|
|
68
73
|
/**
|
|
69
74
|
* registers a new app and sets a plugin for it.
|
|
70
75
|
*/
|
|
@@ -71,6 +71,16 @@ function _workspace() {
|
|
|
71
71
|
return data;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
function _bitError() {
|
|
75
|
+
const data = require("@teambit/bit-error");
|
|
76
|
+
|
|
77
|
+
_bitError = function () {
|
|
78
|
+
return data;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return data;
|
|
82
|
+
}
|
|
83
|
+
|
|
74
84
|
function _builder() {
|
|
75
85
|
const data = require("@teambit/builder");
|
|
76
86
|
|
|
@@ -282,6 +292,16 @@ class ApplicationMain {
|
|
|
282
292
|
if (!id) return undefined;
|
|
283
293
|
return this.appSlot.get(id.toString());
|
|
284
294
|
}
|
|
295
|
+
/**
|
|
296
|
+
* get an application by a component id.
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
getAppById(id) {
|
|
301
|
+
const apps = this.listAppsById(id);
|
|
302
|
+
if (!apps) return undefined;
|
|
303
|
+
return (0, _lodash().head)(apps);
|
|
304
|
+
}
|
|
285
305
|
/**
|
|
286
306
|
* get an app.
|
|
287
307
|
*/
|
|
@@ -291,6 +311,19 @@ class ApplicationMain {
|
|
|
291
311
|
const apps = this.listAppsById(id) || this.listApps();
|
|
292
312
|
return apps.find(app => app.name === appName);
|
|
293
313
|
}
|
|
314
|
+
|
|
315
|
+
getAppByNameOrId(appNameOrId) {
|
|
316
|
+
const byName = this.getApp(appNameOrId);
|
|
317
|
+
if (byName) return byName;
|
|
318
|
+
const byId = this.appSlot.get(appNameOrId);
|
|
319
|
+
if (!byId || !byId.length) return undefined;
|
|
320
|
+
|
|
321
|
+
if (byId.length > 1) {
|
|
322
|
+
throw new (_bitError().BitError)(`unable to figure out what app to retrieve. the id "${appNameOrId}" has more than one app. please use the app-name`);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return byId[0];
|
|
326
|
+
}
|
|
294
327
|
/**
|
|
295
328
|
* registers a new app and sets a plugin for it.
|
|
296
329
|
*/
|
|
@@ -318,7 +351,7 @@ class ApplicationMain {
|
|
|
318
351
|
|
|
319
352
|
|
|
320
353
|
getAppOrThrow(appName) {
|
|
321
|
-
const app = this.
|
|
354
|
+
const app = this.getAppByNameOrId(appName);
|
|
322
355
|
if (!app) throw new (_exceptions().AppNotFound)(appName);
|
|
323
356
|
return app;
|
|
324
357
|
}
|
|
@@ -330,7 +363,7 @@ class ApplicationMain {
|
|
|
330
363
|
async runApp(appName, options) {
|
|
331
364
|
options = this.computeOptions(options);
|
|
332
365
|
const app = this.getAppOrThrow(appName);
|
|
333
|
-
const context = await this.createAppContext(
|
|
366
|
+
const context = await this.createAppContext(app.name);
|
|
334
367
|
if (!context) throw new (_exceptions().AppNotFound)(appName);
|
|
335
368
|
|
|
336
369
|
if (options.ssr) {
|
|
@@ -403,6 +436,18 @@ class ApplicationMain {
|
|
|
403
436
|
builder.registerTagTasks([new (_deploy().DeployTask)(application, builder)]);
|
|
404
437
|
cli.registerGroup('apps', 'Applications');
|
|
405
438
|
cli.register(new (_run().RunCmd)(application, logger), new (_appList().AppListCmdDeprecated)(application), appCmd);
|
|
439
|
+
|
|
440
|
+
if (workspace) {
|
|
441
|
+
workspace.onComponentLoad(async loadedComponent => {
|
|
442
|
+
const app = application.getAppById(loadedComponent.id);
|
|
443
|
+
if (!app) return {};
|
|
444
|
+
return {
|
|
445
|
+
appName: app === null || app === void 0 ? void 0 : app.name,
|
|
446
|
+
type: app === null || app === void 0 ? void 0 : app.applicationType
|
|
447
|
+
};
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
|
|
406
451
|
return application;
|
|
407
452
|
}
|
|
408
453
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ApplicationMain","constructor","appSlot","appTypeSlot","deploymentProviderSlot","envs","componentAspect","appService","aspectLoader","workspace","logger","dev","ssr","watch","defaultPortRange","registerApp","app","register","listApps","flatten","values","mapApps","toArray","listAppsById","id","undefined","get","toString","getApp","appName","apps","find","name","registerAppType","appType","plugin","AppTypePlugin","registerPlugins","getAppAspect","getAppOrThrow","AppNotFound","computeOptions","opts","defaultOpts","runApp","options","context","createAppContext","runSsr","AppNoSsr","result","port","run","watcher","watchAll","preCompile","catch","err","error","errors","getAppIdOrThrow","maybeApp","ComponentID","fromString","host","getHost","components","list","component","c","isEqual","env","createEnvironment","res","results","data","hostRootDir","getComponentPackagePath","Object","assign","cloneDeep","appComponent","workdir","path","provider","cli","loggerAspect","builder","config","createLogger","ApplicationAspect","AppService","application","appCmd","AppCmd","commands","AppListCmd","RunCmd","AppPlugin","registerBuildTasks","AppsBuildTask","registerSnapTasks","DeployTask","registerTagTasks","registerGroup","AppListCmdDeprecated","MainRuntime","CLIAspect","LoggerAspect","BuilderAspect","EnvsAspect","ComponentAspect","AspectLoaderAspect","WorkspaceAspect","Slot","withType","addRuntime"],"sources":["application.main.runtime.ts"],"sourcesContent":["import { MainRuntime, CLIMain, CLIAspect } from '@teambit/cli';\nimport { flatten, cloneDeep } from 'lodash';\nimport { AspectLoaderMain, AspectLoaderAspect } from '@teambit/aspect-loader';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { BuilderAspect, BuilderMain } from '@teambit/builder';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport ComponentAspect, { ComponentMain, ComponentID } from '@teambit/component';\nimport { ApplicationType } from './application-type';\nimport { Application } from './application';\nimport { DeploymentProvider } from './deployment-provider';\nimport { AppNotFound } from './exceptions';\nimport { ApplicationAspect } from './application.aspect';\nimport { AppListCmdDeprecated } from './app-list.cmd';\nimport { AppsBuildTask } from './build.task';\nimport { RunCmd } from './run.cmd';\nimport { AppService } from './application.service';\nimport { AppCmd, AppListCmd } from './app.cmd';\nimport { AppPlugin } from './app.plugin';\nimport { AppTypePlugin } from './app-type.plugin';\nimport { AppContext } from './app-context';\nimport { DeployTask } from './deploy.task';\nimport { AppNoSsr } from './exceptions/app-no-ssr';\n\nexport type ApplicationTypeSlot = SlotRegistry<ApplicationType<unknown>[]>;\nexport type ApplicationSlot = SlotRegistry<Application[]>;\nexport type DeploymentProviderSlot = SlotRegistry<DeploymentProvider[]>;\n\nexport type ApplicationAspectConfig = {};\n\nexport type ServeAppOptions = {\n /**\n * default port range used to serve applications.\n */\n defaultPortRange?: [start: number, end: number];\n\n /**\n * determine whether to start the application in dev mode.\n */\n dev: boolean;\n\n /**\n * actively watch and compile the workspace (like the bit watch command)\n * @default true\n */\n watch?: boolean;\n\n /**\n * determine whether to start the application in server side mode.\n * @default false\n */\n ssr?: boolean;\n};\n\nexport class ApplicationMain {\n constructor(\n private appSlot: ApplicationSlot,\n // TODO unused\n private appTypeSlot: ApplicationTypeSlot,\n private deploymentProviderSlot: DeploymentProviderSlot,\n private envs: EnvsMain,\n private componentAspect: ComponentMain,\n private appService: AppService,\n private aspectLoader: AspectLoaderMain,\n private workspace: Workspace,\n private logger: Logger\n ) {}\n\n /**\n * register a new app.\n */\n registerApp(app: Application) {\n this.appSlot.register([app]);\n return this;\n }\n\n /**\n * list all registered apps.\n */\n listApps(): Application[] {\n return flatten(this.appSlot.values());\n }\n\n /**\n * map all apps by component ID.\n */\n mapApps() {\n return this.appSlot.toArray();\n }\n\n /**\n * list apps by a component id.\n */\n listAppsById(id?: ComponentID): Application[] | undefined {\n if (!id) return undefined;\n return this.appSlot.get(id.toString());\n }\n\n /**\n * get an app.\n */\n getApp(appName: string, id?: ComponentID): Application | undefined {\n const apps = this.listAppsById(id) || this.listApps();\n return apps.find((app) => app.name === appName);\n }\n\n /**\n * registers a new app and sets a plugin for it.\n */\n registerAppType<T>(appType: ApplicationType<T>) {\n const plugin = new AppTypePlugin(`*.${appType.name}.*`, appType, this.appSlot);\n this.aspectLoader.registerPlugins([plugin]);\n this.appTypeSlot.register([appType]);\n return this;\n }\n\n /**\n * get an app AspectId.\n */\n getAppAspect(appName: string): string | undefined {\n return this.appSlot.toArray().find(([, apps]) => apps.find((app) => app.name === appName))?.[0];\n }\n\n /**\n * get app to throw.\n */\n getAppOrThrow(appName: string) {\n const app = this.getApp(appName);\n if (!app) throw new AppNotFound(appName);\n return app;\n }\n\n defaultOpts: ServeAppOptions = {\n dev: false,\n ssr: false,\n watch: true,\n defaultPortRange: [3100, 3500],\n };\n private computeOptions(opts: Partial<ServeAppOptions> = {}) {\n return {\n ...this.defaultOpts,\n ...opts,\n };\n }\n\n async runApp(appName: string, options?: ServeAppOptions) {\n options = this.computeOptions(options);\n const app = this.getAppOrThrow(appName);\n const context = await this.createAppContext(appName);\n if (!context) throw new AppNotFound(appName);\n\n if (options.ssr) {\n if (!app.runSsr) throw new AppNoSsr(appName);\n\n const result = await app.runSsr(context);\n return { app, ...result };\n }\n\n const port = await app.run(context);\n if (options.watch) {\n this.workspace.watcher\n .watchAll({\n preCompile: false,\n })\n .catch((err) => {\n // don't throw an error, we don't want to break the \"run\" process\n this.logger.error(`compilation failed`, err);\n });\n }\n return { app, port, errors: undefined };\n }\n\n /**\n * get the component ID of a certain app.\n */\n getAppIdOrThrow(appName: string) {\n const maybeApp = this.appSlot.toArray().find(([, apps]) => {\n return apps.find((app) => app.name === appName);\n });\n\n if (!maybeApp) throw new AppNotFound(appName);\n return ComponentID.fromString(maybeApp[0]);\n }\n\n private async createAppContext(appName: string): Promise<AppContext> {\n const host = this.componentAspect.getHost();\n const components = await host.list();\n const id = this.getAppIdOrThrow(appName);\n const component = components.find((c) => c.id.isEqual(id));\n if (!component) throw new AppNotFound(appName);\n // console.log(comp)\n\n const env = await this.envs.createEnvironment([component]);\n const res = await env.run(this.appService);\n const context = res.results[0].data;\n if (!context) throw new AppNotFound(appName);\n const hostRootDir = this.workspace.getComponentPackagePath(component);\n return Object.assign(cloneDeep(context), {\n appName,\n appComponent: component,\n hostRootDir,\n workdir: this.workspace.path,\n });\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n CLIAspect,\n LoggerAspect,\n BuilderAspect,\n EnvsAspect,\n ComponentAspect,\n AspectLoaderAspect,\n WorkspaceAspect,\n ];\n\n static slots = [\n Slot.withType<ApplicationType<unknown>[]>(),\n Slot.withType<Application[]>(),\n Slot.withType<DeploymentProvider[]>(),\n ];\n\n static async provider(\n [cli, loggerAspect, builder, envs, component, aspectLoader, workspace]: [\n CLIMain,\n LoggerMain,\n BuilderMain,\n EnvsMain,\n ComponentMain,\n AspectLoaderMain,\n Workspace\n ],\n config: ApplicationAspectConfig,\n [appTypeSlot, appSlot, deploymentProviderSlot]: [ApplicationTypeSlot, ApplicationSlot, DeploymentProviderSlot]\n ) {\n const logger = loggerAspect.createLogger(ApplicationAspect.id);\n const appService = new AppService();\n const application = new ApplicationMain(\n appSlot,\n appTypeSlot,\n deploymentProviderSlot,\n envs,\n component,\n appService,\n aspectLoader,\n workspace,\n logger\n );\n const appCmd = new AppCmd();\n appCmd.commands = [new AppListCmd(application), new RunCmd(application, logger)];\n aspectLoader.registerPlugins([new AppPlugin(appSlot)]);\n builder.registerBuildTasks([new AppsBuildTask(application)]);\n builder.registerSnapTasks([new DeployTask(application, builder)]);\n builder.registerTagTasks([new DeployTask(application, builder)]);\n cli.registerGroup('apps', 'Applications');\n cli.register(new RunCmd(application, logger), new AppListCmdDeprecated(application), appCmd);\n\n return application;\n }\n}\n\nApplicationAspect.addRuntime(ApplicationMain);\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;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;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;;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;;AACA;EAAA;;EAAA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JoB,EAKpBC,oBALoB,EAMpBC,kCANoB,EAOpBC,oBAPoB,C;gCAxJXjH,e,WAkKI,CACbkH,eAAA,CAAKC,QAAL,EADa,EAEbD,eAAA,CAAKC,QAAL,EAFa,EAGbD,eAAA,CAAKC,QAAL,EAHa,C;;AA6CjBzB,gCAAA,CAAkB0B,UAAlB,CAA6BpH,eAA7B"}
|
|
1
|
+
{"version":3,"names":["ApplicationMain","constructor","appSlot","appTypeSlot","deploymentProviderSlot","envs","componentAspect","appService","aspectLoader","workspace","logger","dev","ssr","watch","defaultPortRange","registerApp","app","register","listApps","flatten","values","mapApps","toArray","listAppsById","id","undefined","get","toString","getAppById","apps","head","getApp","appName","find","name","getAppByNameOrId","appNameOrId","byName","byId","length","BitError","registerAppType","appType","plugin","AppTypePlugin","registerPlugins","getAppAspect","getAppOrThrow","AppNotFound","computeOptions","opts","defaultOpts","runApp","options","context","createAppContext","runSsr","AppNoSsr","result","port","run","watcher","watchAll","preCompile","catch","err","error","errors","getAppIdOrThrow","maybeApp","ComponentID","fromString","host","getHost","components","list","component","c","isEqual","env","createEnvironment","res","results","data","hostRootDir","getComponentPackagePath","Object","assign","cloneDeep","appComponent","workdir","path","provider","cli","loggerAspect","builder","config","createLogger","ApplicationAspect","AppService","application","appCmd","AppCmd","commands","AppListCmd","RunCmd","AppPlugin","registerBuildTasks","AppsBuildTask","registerSnapTasks","DeployTask","registerTagTasks","registerGroup","AppListCmdDeprecated","onComponentLoad","loadedComponent","type","applicationType","MainRuntime","CLIAspect","LoggerAspect","BuilderAspect","EnvsAspect","ComponentAspect","AspectLoaderAspect","WorkspaceAspect","Slot","withType","addRuntime"],"sources":["application.main.runtime.ts"],"sourcesContent":["import { MainRuntime, CLIMain, CLIAspect } from '@teambit/cli';\nimport { flatten, cloneDeep, head } from 'lodash';\nimport { AspectLoaderMain, AspectLoaderAspect } from '@teambit/aspect-loader';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { BuilderAspect, BuilderMain } from '@teambit/builder';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport ComponentAspect, { ComponentMain, ComponentID } from '@teambit/component';\nimport { ApplicationType } from './application-type';\nimport { Application } from './application';\nimport { DeploymentProvider } from './deployment-provider';\nimport { AppNotFound } from './exceptions';\nimport { ApplicationAspect } from './application.aspect';\nimport { AppListCmdDeprecated } from './app-list.cmd';\nimport { AppsBuildTask } from './build.task';\nimport { RunCmd } from './run.cmd';\nimport { AppService } from './application.service';\nimport { AppCmd, AppListCmd } from './app.cmd';\nimport { AppPlugin } from './app.plugin';\nimport { AppTypePlugin } from './app-type.plugin';\nimport { AppContext } from './app-context';\nimport { DeployTask } from './deploy.task';\nimport { AppNoSsr } from './exceptions/app-no-ssr';\n\nexport type ApplicationTypeSlot = SlotRegistry<ApplicationType<unknown>[]>;\nexport type ApplicationSlot = SlotRegistry<Application[]>;\nexport type DeploymentProviderSlot = SlotRegistry<DeploymentProvider[]>;\n\nexport type ApplicationAspectConfig = {};\n\nexport type ServeAppOptions = {\n /**\n * default port range used to serve applications.\n */\n defaultPortRange?: [start: number, end: number];\n\n /**\n * determine whether to start the application in dev mode.\n */\n dev: boolean;\n\n /**\n * actively watch and compile the workspace (like the bit watch command)\n * @default true\n */\n watch?: boolean;\n\n /**\n * determine whether to start the application in server side mode.\n * @default false\n */\n ssr?: boolean;\n};\n\nexport class ApplicationMain {\n constructor(\n private appSlot: ApplicationSlot,\n // TODO unused\n private appTypeSlot: ApplicationTypeSlot,\n private deploymentProviderSlot: DeploymentProviderSlot,\n private envs: EnvsMain,\n private componentAspect: ComponentMain,\n private appService: AppService,\n private aspectLoader: AspectLoaderMain,\n private workspace: Workspace,\n private logger: Logger\n ) {}\n\n /**\n * register a new app.\n */\n registerApp(app: Application) {\n this.appSlot.register([app]);\n return this;\n }\n\n /**\n * list all registered apps.\n */\n listApps(): Application[] {\n return flatten(this.appSlot.values());\n }\n\n /**\n * map all apps by component ID.\n */\n mapApps() {\n return this.appSlot.toArray();\n }\n\n /**\n * list apps by a component id.\n */\n listAppsById(id?: ComponentID): Application[] | undefined {\n if (!id) return undefined;\n return this.appSlot.get(id.toString());\n }\n\n /**\n * get an application by a component id.\n */\n getAppById(id: ComponentID) {\n const apps = this.listAppsById(id);\n if (!apps) return undefined;\n return head(apps);\n }\n\n /**\n * get an app.\n */\n getApp(appName: string, id?: ComponentID): Application | undefined {\n const apps = this.listAppsById(id) || this.listApps();\n return apps.find((app) => app.name === appName);\n }\n\n getAppByNameOrId(appNameOrId: string): Application | undefined {\n const byName = this.getApp(appNameOrId);\n if (byName) return byName;\n const byId = this.appSlot.get(appNameOrId);\n if (!byId || !byId.length) return undefined;\n if (byId.length > 1) {\n throw new BitError(\n `unable to figure out what app to retrieve. the id \"${appNameOrId}\" has more than one app. please use the app-name`\n );\n }\n return byId[0];\n }\n\n /**\n * registers a new app and sets a plugin for it.\n */\n registerAppType<T>(appType: ApplicationType<T>) {\n const plugin = new AppTypePlugin(`*.${appType.name}.*`, appType, this.appSlot);\n this.aspectLoader.registerPlugins([plugin]);\n this.appTypeSlot.register([appType]);\n return this;\n }\n\n /**\n * get an app AspectId.\n */\n getAppAspect(appName: string): string | undefined {\n return this.appSlot.toArray().find(([, apps]) => apps.find((app) => app.name === appName))?.[0];\n }\n\n /**\n * get app to throw.\n */\n getAppOrThrow(appName: string) {\n const app = this.getAppByNameOrId(appName);\n if (!app) throw new AppNotFound(appName);\n return app;\n }\n\n defaultOpts: ServeAppOptions = {\n dev: false,\n ssr: false,\n watch: true,\n defaultPortRange: [3100, 3500],\n };\n private computeOptions(opts: Partial<ServeAppOptions> = {}) {\n return {\n ...this.defaultOpts,\n ...opts,\n };\n }\n\n async runApp(appName: string, options?: ServeAppOptions) {\n options = this.computeOptions(options);\n const app = this.getAppOrThrow(appName);\n const context = await this.createAppContext(app.name);\n if (!context) throw new AppNotFound(appName);\n\n if (options.ssr) {\n if (!app.runSsr) throw new AppNoSsr(appName);\n\n const result = await app.runSsr(context);\n return { app, ...result };\n }\n\n const port = await app.run(context);\n if (options.watch) {\n this.workspace.watcher\n .watchAll({\n preCompile: false,\n })\n .catch((err) => {\n // don't throw an error, we don't want to break the \"run\" process\n this.logger.error(`compilation failed`, err);\n });\n }\n return { app, port, errors: undefined };\n }\n\n /**\n * get the component ID of a certain app.\n */\n getAppIdOrThrow(appName: string) {\n const maybeApp = this.appSlot.toArray().find(([, apps]) => {\n return apps.find((app) => app.name === appName);\n });\n\n if (!maybeApp) throw new AppNotFound(appName);\n return ComponentID.fromString(maybeApp[0]);\n }\n\n private async createAppContext(appName: string): Promise<AppContext> {\n const host = this.componentAspect.getHost();\n const components = await host.list();\n const id = this.getAppIdOrThrow(appName);\n const component = components.find((c) => c.id.isEqual(id));\n if (!component) throw new AppNotFound(appName);\n // console.log(comp)\n\n const env = await this.envs.createEnvironment([component]);\n const res = await env.run(this.appService);\n const context = res.results[0].data;\n if (!context) throw new AppNotFound(appName);\n const hostRootDir = this.workspace.getComponentPackagePath(component);\n return Object.assign(cloneDeep(context), {\n appName,\n appComponent: component,\n hostRootDir,\n workdir: this.workspace.path,\n });\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n CLIAspect,\n LoggerAspect,\n BuilderAspect,\n EnvsAspect,\n ComponentAspect,\n AspectLoaderAspect,\n WorkspaceAspect,\n ];\n\n static slots = [\n Slot.withType<ApplicationType<unknown>[]>(),\n Slot.withType<Application[]>(),\n Slot.withType<DeploymentProvider[]>(),\n ];\n\n static async provider(\n [cli, loggerAspect, builder, envs, component, aspectLoader, workspace]: [\n CLIMain,\n LoggerMain,\n BuilderMain,\n EnvsMain,\n ComponentMain,\n AspectLoaderMain,\n Workspace\n ],\n config: ApplicationAspectConfig,\n [appTypeSlot, appSlot, deploymentProviderSlot]: [ApplicationTypeSlot, ApplicationSlot, DeploymentProviderSlot]\n ) {\n const logger = loggerAspect.createLogger(ApplicationAspect.id);\n const appService = new AppService();\n const application = new ApplicationMain(\n appSlot,\n appTypeSlot,\n deploymentProviderSlot,\n envs,\n component,\n appService,\n aspectLoader,\n workspace,\n logger\n );\n const appCmd = new AppCmd();\n appCmd.commands = [new AppListCmd(application), new RunCmd(application, logger)];\n aspectLoader.registerPlugins([new AppPlugin(appSlot)]);\n builder.registerBuildTasks([new AppsBuildTask(application)]);\n builder.registerSnapTasks([new DeployTask(application, builder)]);\n builder.registerTagTasks([new DeployTask(application, builder)]);\n cli.registerGroup('apps', 'Applications');\n cli.register(new RunCmd(application, logger), new AppListCmdDeprecated(application), appCmd);\n if (workspace) {\n workspace.onComponentLoad(async (loadedComponent) => {\n const app = application.getAppById(loadedComponent.id);\n if (!app) return {};\n return {\n appName: app?.name,\n type: app?.applicationType,\n };\n }); \n }\n\n return application;\n }\n}\n\nApplicationAspect.addRuntime(ApplicationMain);\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;;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;;AAIA;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;A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EACD;;AA5O0B;;;gCAAhBpG,e,aA6KMsH,kB;gCA7KNtH,e,kBA8KW,CACpBuH,gBADoB,EAEpBC,sBAFoB,EAGpBC,wBAHoB,EAIpBC,kBAJoB,EAKpBC,oBALoB,EAMpBC,kCANoB,EAOpBC,oBAPoB,C;gCA9KX7H,e,WAwLI,CACb8H,eAAA,CAAKC,QAAL,EADa,EAEbD,eAAA,CAAKC,QAAL,EAFa,EAGbD,eAAA,CAAKC,QAAL,EAHa,C;;AAuDjB7B,gCAAA,CAAkB8B,UAAlB,CAA6BhI,eAA7B"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/application",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.489",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/harmony/application",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.harmony",
|
|
8
8
|
"name": "application",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.489"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -16,16 +16,17 @@
|
|
|
16
16
|
"pluralize": "8.0.0",
|
|
17
17
|
"@babel/runtime": "7.12.18",
|
|
18
18
|
"core-js": "^3.0.0",
|
|
19
|
-
"@teambit/
|
|
20
|
-
"@teambit/
|
|
21
|
-
"@teambit/
|
|
22
|
-
"@teambit/
|
|
23
|
-
"@teambit/envs": "0.0.844",
|
|
19
|
+
"@teambit/builder": "0.0.847",
|
|
20
|
+
"@teambit/component": "0.0.847",
|
|
21
|
+
"@teambit/isolator": "0.0.847",
|
|
22
|
+
"@teambit/envs": "0.0.847",
|
|
24
23
|
"@teambit/cli-table": "0.0.40",
|
|
25
|
-
"@teambit/cli": "0.0.
|
|
26
|
-
"@teambit/aspect-loader": "0.0.
|
|
27
|
-
"@teambit/
|
|
28
|
-
"@teambit/
|
|
24
|
+
"@teambit/cli": "0.0.565",
|
|
25
|
+
"@teambit/aspect-loader": "0.0.847",
|
|
26
|
+
"@teambit/harmony": "0.3.3",
|
|
27
|
+
"@teambit/bit-error": "0.0.400",
|
|
28
|
+
"@teambit/logger": "0.0.658",
|
|
29
|
+
"@teambit/workspace": "0.0.847"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@types/react": "^17.0.8",
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"@types/node": "12.20.4"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
|
-
"@teambit/legacy": "1.0.
|
|
42
|
+
"@teambit/legacy": "1.0.346",
|
|
42
43
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
43
44
|
"react": "^16.8.0 || ^17.0.0"
|
|
44
45
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.489/dist/application.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.489/dist/application.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
Binary file
|