@teambit/application 0.0.695 → 0.0.697

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.
@@ -122,7 +122,7 @@ export declare class ApplicationMain {
122
122
  /**
123
123
  * get the component ID of a certain app.
124
124
  */
125
- getAppIdOrThrow(appName: string): ComponentID;
125
+ getAppIdOrThrow(appName: string): Promise<ComponentID>;
126
126
  private createAppContext;
127
127
  static runtime: import("@teambit/harmony").RuntimeDefinition;
128
128
  static dependencies: import("@teambit/harmony").Aspect[];
@@ -87,7 +87,7 @@ function _envs() {
87
87
  return data;
88
88
  }
89
89
  function _component() {
90
- const data = _interopRequireWildcard(require("@teambit/component"));
90
+ const data = _interopRequireDefault(require("@teambit/component"));
91
91
  _component = function () {
92
92
  return data;
93
93
  };
@@ -177,8 +177,6 @@ function _appNoSsr() {
177
177
  };
178
178
  return data;
179
179
  }
180
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
181
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
182
180
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
183
181
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
184
182
  class ApplicationMain {
@@ -382,18 +380,20 @@ class ApplicationMain {
382
380
  /**
383
381
  * get the component ID of a certain app.
384
382
  */
385
- getAppIdOrThrow(appName) {
383
+ async getAppIdOrThrow(appName) {
386
384
  const maybeApp = this.appSlot.toArray().find(([, apps]) => {
387
385
  return apps.find(app => app.name === appName);
388
386
  });
389
387
  if (!maybeApp) throw new (_exceptions().AppNotFound)(appName);
390
- return _component().ComponentID.fromString(maybeApp[0]);
388
+ const host = this.componentAspect.getHost();
389
+ return host.resolveComponentId(maybeApp[0]);
391
390
  }
392
391
  async createAppContext(appName) {
393
392
  const host = this.componentAspect.getHost();
394
- const components = await host.list();
395
- const id = this.getAppIdOrThrow(appName);
396
- const component = components.find(c => c.id.isEqual(id));
393
+ // const components = await host.list();
394
+ const id = await this.getAppIdOrThrow(appName);
395
+ // const component = components.find((c) => c.id.isEqual(id));
396
+ const component = await host.get(id);
397
397
  if (!component) throw new (_exceptions().AppNotFound)(appName);
398
398
  const env = await this.envs.createEnvironment([component]);
399
399
  const res = await env.run(this.appService);
@@ -1 +1 @@
1
- {"version":3,"names":["ApplicationMain","constructor","appSlot","appTypeSlot","deploymentProviderSlot","config","envs","componentAspect","appService","aspectLoader","workspace","logger","watcher","dev","ssr","watch","defaultPortRange","registerApp","app","register","listApps","flatten","values","mapApps","toArray","listAppsById","id","undefined","get","toString","getAppById","apps","head","calculateAppByComponent","component","listAppTypes","listAppsFromComponents","components","getHost","list","appTypesPatterns","getAppPatterns","filter","files","filesystem","byGlob","length","appTypes","map","appType","getAppPattern","loadApps","pluginsToLoad","flatMap","appComponent","file","path","appManifests","compact","pluginPath","appManifest","require","default","err","error","getApp","appName","find","name","getAppByNameOrId","appNameOrId","byName","byId","BitError","globPattern","registerAppType","plugin","AppTypePlugin","registerPlugins","getAppAspect","getAppOrThrow","AppNotFound","computeOptions","opts","defaultOpts","loadAppsToSlot","runApp","options","context","createAppContext","runSsr","AppNoSsr","result","port","run","preCompile","catch","errors","getAppIdOrThrow","maybeApp","ComponentID","fromString","host","c","isEqual","env","createEnvironment","res","results","data","hostRootDir","getComponentPackagePath","appContext","AppContext","provider","cli","loggerAspect","builder","createLogger","ApplicationAspect","AppService","application","bind","appCmd","AppCmd","commands","AppListCmd","RunCmd","AppPlugin","registerBuildTasks","AppsBuildTask","registerSnapTasks","DeployTask","registerTagTasks","registerService","registerGroup","AppListCmdDeprecated","onComponentLoad","loadedComponent","type","applicationType","MainRuntime","CLIAspect","LoggerAspect","BuilderAspect","EnvsAspect","ComponentAspect","AspectLoaderAspect","WorkspaceAspect","WatcherAspect","Slot","withType","addRuntime"],"sources":["application.main.runtime.ts"],"sourcesContent":["import { MainRuntime, CLIMain, CLIAspect } from '@teambit/cli';\nimport { compact, flatten, 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 WatcherAspect, { WatcherMain } from '@teambit/watcher';\nimport { BuilderAspect, BuilderMain } from '@teambit/builder';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport ComponentAspect, { ComponentMain, ComponentID, Component } 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 /**\n * envs ids to load app types.\n */\n envs?: string[];\n};\n\n/**\n * Application meta data that is stored on the component on load if it's an application.\n */\nexport type ApplicationMetadata = {\n appName: string;\n type?: string;\n};\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 config: ApplicationAspectConfig,\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 private watcher: WatcherMain\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 async getAppById(id: ComponentID) {\n const apps = await this.listAppsById(id);\n if (!apps) return undefined;\n return head(apps);\n }\n\n /**\n * calculate an application by a component.\n * This should be only used during the on component load slot\n */\n calculateAppByComponent(component: Component) {\n const apps = this.appSlot.get(component.id.toString());\n if (!apps) return undefined;\n return head(apps);\n }\n\n listAppTypes() {\n return flatten(this.appTypeSlot.values());\n }\n\n async listAppsFromComponents() {\n const components = await this.componentAspect.getHost().list();\n const appTypesPatterns = this.getAppPatterns();\n const apps = components.filter((component) => {\n // has app plugin from registered types.\n const files = component.filesystem.byGlob(appTypesPatterns);\n return !!files.length;\n });\n\n return apps;\n }\n\n getAppPatterns() {\n const appTypes = this.listAppTypes();\n const appTypesPatterns = appTypes.map((appType) => {\n return this.getAppPattern(appType);\n });\n\n return appTypesPatterns;\n }\n\n async loadApps(): Promise<Application[]> {\n const apps = await this.listAppsFromComponents();\n const appTypesPatterns = this.getAppPatterns();\n\n const pluginsToLoad = apps.flatMap((appComponent) => {\n const files = appComponent.filesystem.byGlob(appTypesPatterns);\n return files.map((file) => file.path);\n });\n // const app = require(appPath);\n const appManifests = compact(\n pluginsToLoad.map((pluginPath) => {\n try {\n // eslint-disable-next-line\n const appManifest = require(pluginPath)?.default;\n return appManifest;\n } catch (err) {\n this.logger.error(`failed loading app manifest: ${pluginPath}`);\n return undefined;\n }\n })\n );\n\n return appManifests;\n }\n\n /**\n * get an app.\n */\n getApp(appName: string, id?: ComponentID): Application | undefined {\n const apps = id ? this.listAppsById(id) : this.listApps();\n if (!apps) return undefined;\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 getAppPattern(appType: ApplicationType<unknown>) {\n if (appType.globPattern) return appType.globPattern;\n return `*.${appType.name}.*`;\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(this.getAppPattern(appType), 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): Application {\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 loadAppsToSlot() {\n const apps = await this.loadApps();\n this.appSlot.register(apps);\n return this;\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.watcher\n .watch({\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\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 const appContext = new AppContext(appName, context.dev, component, this.workspace.path, context, hostRootDir);\n return appContext;\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n CLIAspect,\n LoggerAspect,\n BuilderAspect,\n EnvsAspect,\n ComponentAspect,\n AspectLoaderAspect,\n WorkspaceAspect,\n WatcherAspect,\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, watcher]: [\n CLIMain,\n LoggerMain,\n BuilderMain,\n EnvsMain,\n ComponentMain,\n AspectLoaderMain,\n Workspace,\n WatcherMain\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 config,\n envs,\n component,\n appService,\n aspectLoader,\n workspace,\n logger,\n watcher\n );\n appService.registerAppType = application.registerAppType.bind(application);\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 envs.registerService(appService);\n cli.registerGroup('apps', 'Applications');\n cli.register(new RunCmd(application, logger), new AppListCmdDeprecated(application), appCmd);\n // cli.registerOnStart(async () => {\n // await application.loadAppsToSlot();\n // });\n if (workspace) {\n workspace.onComponentLoad(async (loadedComponent): Promise<ApplicationMetadata | undefined> => {\n const app = application.calculateAppByComponent(loadedComponent);\n if (!app) return undefined;\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;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;AACA;EAAA;EAAA;IAAA;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BAAa,CACd;AAAA,gCA5PUrJ,eAAe,WA8PX,CACbsJ,eAAI,CAACC,QAAQ,EAA8B,EAC3CD,eAAI,CAACC,QAAQ,EAAiB,EAC9BD,eAAI,CAACC,QAAQ,EAAwB,CACtC;AA2DHhC,gCAAiB,CAACiC,UAAU,CAACxJ,eAAe,CAAC"}
1
+ {"version":3,"names":["ApplicationMain","constructor","appSlot","appTypeSlot","deploymentProviderSlot","config","envs","componentAspect","appService","aspectLoader","workspace","logger","watcher","dev","ssr","watch","defaultPortRange","registerApp","app","register","listApps","flatten","values","mapApps","toArray","listAppsById","id","undefined","get","toString","getAppById","apps","head","calculateAppByComponent","component","listAppTypes","listAppsFromComponents","components","getHost","list","appTypesPatterns","getAppPatterns","filter","files","filesystem","byGlob","length","appTypes","map","appType","getAppPattern","loadApps","pluginsToLoad","flatMap","appComponent","file","path","appManifests","compact","pluginPath","appManifest","require","default","err","error","getApp","appName","find","name","getAppByNameOrId","appNameOrId","byName","byId","BitError","globPattern","registerAppType","plugin","AppTypePlugin","registerPlugins","getAppAspect","getAppOrThrow","AppNotFound","computeOptions","opts","defaultOpts","loadAppsToSlot","runApp","options","context","createAppContext","runSsr","AppNoSsr","result","port","run","preCompile","catch","errors","getAppIdOrThrow","maybeApp","host","resolveComponentId","env","createEnvironment","res","results","data","hostRootDir","getComponentPackagePath","appContext","AppContext","provider","cli","loggerAspect","builder","createLogger","ApplicationAspect","AppService","application","bind","appCmd","AppCmd","commands","AppListCmd","RunCmd","AppPlugin","registerBuildTasks","AppsBuildTask","registerSnapTasks","DeployTask","registerTagTasks","registerService","registerGroup","AppListCmdDeprecated","onComponentLoad","loadedComponent","type","applicationType","MainRuntime","CLIAspect","LoggerAspect","BuilderAspect","EnvsAspect","ComponentAspect","AspectLoaderAspect","WorkspaceAspect","WatcherAspect","Slot","withType","addRuntime"],"sources":["application.main.runtime.ts"],"sourcesContent":["import { MainRuntime, CLIMain, CLIAspect } from '@teambit/cli';\nimport { compact, flatten, 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 WatcherAspect, { WatcherMain } from '@teambit/watcher';\nimport { BuilderAspect, BuilderMain } from '@teambit/builder';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport ComponentAspect, { ComponentMain, ComponentID, Component } 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 /**\n * envs ids to load app types.\n */\n envs?: string[];\n};\n\n/**\n * Application meta data that is stored on the component on load if it's an application.\n */\nexport type ApplicationMetadata = {\n appName: string;\n type?: string;\n};\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 config: ApplicationAspectConfig,\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 private watcher: WatcherMain\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 async getAppById(id: ComponentID) {\n const apps = await this.listAppsById(id);\n if (!apps) return undefined;\n return head(apps);\n }\n\n /**\n * calculate an application by a component.\n * This should be only used during the on component load slot\n */\n calculateAppByComponent(component: Component) {\n const apps = this.appSlot.get(component.id.toString());\n if (!apps) return undefined;\n return head(apps);\n }\n\n listAppTypes() {\n return flatten(this.appTypeSlot.values());\n }\n\n async listAppsFromComponents() {\n const components = await this.componentAspect.getHost().list();\n const appTypesPatterns = this.getAppPatterns();\n const apps = components.filter((component) => {\n // has app plugin from registered types.\n const files = component.filesystem.byGlob(appTypesPatterns);\n return !!files.length;\n });\n\n return apps;\n }\n\n getAppPatterns() {\n const appTypes = this.listAppTypes();\n const appTypesPatterns = appTypes.map((appType) => {\n return this.getAppPattern(appType);\n });\n\n return appTypesPatterns;\n }\n\n async loadApps(): Promise<Application[]> {\n const apps = await this.listAppsFromComponents();\n const appTypesPatterns = this.getAppPatterns();\n\n const pluginsToLoad = apps.flatMap((appComponent) => {\n const files = appComponent.filesystem.byGlob(appTypesPatterns);\n return files.map((file) => file.path);\n });\n // const app = require(appPath);\n const appManifests = compact(\n pluginsToLoad.map((pluginPath) => {\n try {\n // eslint-disable-next-line\n const appManifest = require(pluginPath)?.default;\n return appManifest;\n } catch (err) {\n this.logger.error(`failed loading app manifest: ${pluginPath}`);\n return undefined;\n }\n })\n );\n\n return appManifests;\n }\n\n /**\n * get an app.\n */\n getApp(appName: string, id?: ComponentID): Application | undefined {\n const apps = id ? this.listAppsById(id) : this.listApps();\n if (!apps) return undefined;\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 getAppPattern(appType: ApplicationType<unknown>) {\n if (appType.globPattern) return appType.globPattern;\n return `*.${appType.name}.*`;\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(this.getAppPattern(appType), 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): Application {\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 loadAppsToSlot() {\n const apps = await this.loadApps();\n this.appSlot.register(apps);\n return this;\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.watcher\n .watch({\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 async 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\n const host = this.componentAspect.getHost();\n return host.resolveComponentId(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 = await this.getAppIdOrThrow(appName);\n // const component = components.find((c) => c.id.isEqual(id));\n const component = await host.get(id);\n if (!component) throw new AppNotFound(appName);\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 const appContext = new AppContext(appName, context.dev, component, this.workspace.path, context, hostRootDir);\n return appContext;\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n CLIAspect,\n LoggerAspect,\n BuilderAspect,\n EnvsAspect,\n ComponentAspect,\n AspectLoaderAspect,\n WorkspaceAspect,\n WatcherAspect,\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, watcher]: [\n CLIMain,\n LoggerMain,\n BuilderMain,\n EnvsMain,\n ComponentMain,\n AspectLoaderMain,\n Workspace,\n WatcherMain\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 config,\n envs,\n component,\n appService,\n aspectLoader,\n workspace,\n logger,\n watcher\n );\n appService.registerAppType = application.registerAppType.bind(application);\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 envs.registerService(appService);\n cli.registerGroup('apps', 'Applications');\n cli.register(new RunCmd(application, logger), new AppListCmdDeprecated(application), appCmd);\n // cli.registerOnStart(async () => {\n // await application.loadAppsToSlot();\n // });\n if (workspace) {\n workspace.onComponentLoad(async (loadedComponent): Promise<ApplicationMetadata | undefined> => {\n const app = application.calculateAppByComponent(loadedComponent);\n if (!app) return undefined;\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;AACA;EAAA;EAAA;IAAA;EAAA;E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AG,EAAE,OAAOS,SAAS;QAC1B,OAAO;UACLuC,OAAO,EAAEhD,GAAG,CAACkD,IAAI;UACjBoE,IAAI,EAAEtH,GAAG,CAACuH;QACZ,CAAC;MACH,CAAC,CAAC;IACJ;IAEA,OAAOnB,WAAW;EACpB;AACF;AAAC;AAAA,gCA9TYtH,eAAe,aAqPT0I,kBAAW;AAAA,gCArPjB1I,eAAe,kBAsPJ,CACpB2I,gBAAS,EACTC,sBAAY,EACZC,wBAAa,EACbC,kBAAU,EACVC,oBAAe,EACfC,kCAAkB,EAClBC,oBAAe,EACfC,kBAAa,CACd;AAAA,gCA/PUlJ,eAAe,WAiQX,CACbmJ,eAAI,CAACC,QAAQ,EAA8B,EAC3CD,eAAI,CAACC,QAAQ,EAAiB,EAC9BD,eAAI,CAACC,QAAQ,EAAwB,CACtC;AA2DHhC,gCAAiB,CAACiC,UAAU,CAACrJ,eAAe,CAAC"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.695/dist/application.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.695/dist/application.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.697/dist/application.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.697/dist/application.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/application",
3
- "version": "0.0.695",
3
+ "version": "0.0.697",
4
4
  "homepage": "https://bit.cloud/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.695"
9
+ "version": "0.0.697"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -17,17 +17,17 @@
17
17
  "core-js": "^3.0.0",
18
18
  "@babel/runtime": "7.20.0",
19
19
  "@teambit/harmony": "0.4.6",
20
- "@teambit/builder": "0.0.1053",
21
- "@teambit/component": "0.0.1053",
22
- "@teambit/isolator": "0.0.1053",
23
- "@teambit/envs": "0.0.1053",
20
+ "@teambit/builder": "0.0.1055",
21
+ "@teambit/component": "0.0.1055",
22
+ "@teambit/isolator": "0.0.1055",
23
+ "@teambit/envs": "0.0.1055",
24
24
  "@teambit/cli-table": "0.0.41",
25
- "@teambit/cli": "0.0.709",
26
- "@teambit/aspect-loader": "0.0.1053",
25
+ "@teambit/cli": "0.0.711",
26
+ "@teambit/aspect-loader": "0.0.1055",
27
27
  "@teambit/bit-error": "0.0.402",
28
- "@teambit/logger": "0.0.802",
29
- "@teambit/watcher": "0.0.65",
30
- "@teambit/workspace": "0.0.1053"
28
+ "@teambit/logger": "0.0.804",
29
+ "@teambit/watcher": "0.0.67",
30
+ "@teambit/workspace": "0.0.1055"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/react": "^17.0.8",
@@ -40,7 +40,7 @@
40
40
  "@types/testing-library__jest-dom": "5.9.5"
41
41
  },
42
42
  "peerDependencies": {
43
- "@teambit/legacy": "1.0.489",
43
+ "@teambit/legacy": "1.0.491",
44
44
  "react": "^16.8.0 || ^17.0.0",
45
45
  "react-dom": "^16.8.0 || ^17.0.0"
46
46
  },