@teambit/generator 1.0.393 → 1.0.395

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,7 @@ import { AspectLoaderMain } from '@teambit/aspect-loader';
10
10
  import { TrackerMain } from '@teambit/tracker';
11
11
  import { NewComponentHelperMain } from '@teambit/new-component-helper';
12
12
  import { Logger, LoggerMain } from '@teambit/logger';
13
+ import { DeprecationMain } from '@teambit/deprecation';
13
14
  import { ComponentTemplate } from './component-template';
14
15
  import { CreateOptions } from './create.cmd';
15
16
  import { GenerateResult, OnComponentCreateFn } from './component-generator';
@@ -68,8 +69,9 @@ export declare class GeneratorMain {
68
69
  private logger;
69
70
  private git;
70
71
  private wsConfigFiles;
72
+ private deprecation;
71
73
  private aspectLoaded;
72
- constructor(componentTemplateSlot: ComponentTemplateSlot, workspaceTemplateSlot: WorkspaceTemplateSlot, onComponentCreateSlot: OnComponentCreateSlot, config: GeneratorConfig, workspace: Workspace, envs: EnvsMain, aspectLoader: AspectLoaderMain, newComponentHelper: NewComponentHelperMain, componentAspect: ComponentMain, tracker: TrackerMain, logger: Logger, git: GitMain, wsConfigFiles: WorkspaceConfigFilesMain);
74
+ constructor(componentTemplateSlot: ComponentTemplateSlot, workspaceTemplateSlot: WorkspaceTemplateSlot, onComponentCreateSlot: OnComponentCreateSlot, config: GeneratorConfig, workspace: Workspace, envs: EnvsMain, aspectLoader: AspectLoaderMain, newComponentHelper: NewComponentHelperMain, componentAspect: ComponentMain, tracker: TrackerMain, logger: Logger, git: GitMain, wsConfigFiles: WorkspaceConfigFilesMain, deprecation: DeprecationMain);
73
75
  /**
74
76
  * register a new component template.
75
77
  */
@@ -133,6 +135,7 @@ export declare class GeneratorMain {
133
135
  aspect?: string;
134
136
  currentDir?: boolean;
135
137
  }): Promise<GenerateWorkspaceTemplateResult>;
138
+ private warnAboutDeprecation;
136
139
  private getAllComponentTemplatesDescriptorsFlattened;
137
140
  private getAllComponentTemplatesFlattened;
138
141
  private getAllWorkspaceTemplatesDescriptorFlattened;
@@ -152,7 +155,7 @@ export declare class GeneratorMain {
152
155
  static slots: (((registerFn: () => string) => SlotRegistry<ComponentTemplate[]>) | ((registerFn: () => string) => SlotRegistry<WorkspaceTemplate[]>) | ((registerFn: () => string) => SlotRegistry<OnComponentCreateFn>))[];
153
156
  static dependencies: import("@teambit/bit").Aspect[];
154
157
  static runtime: import("@teambit/bit").RuntimeDefinition;
155
- static provider([workspace, cli, graphql, envs, aspectLoader, newComponentHelper, componentAspect, tracker, loggerMain, git, wsConfigFiles,]: [
158
+ static provider([workspace, cli, graphql, envs, aspectLoader, newComponentHelper, componentAspect, tracker, loggerMain, git, wsConfigFiles, deprecation,]: [
156
159
  Workspace,
157
160
  CLIMain,
158
161
  GraphqlMain,
@@ -163,7 +166,8 @@ export declare class GeneratorMain {
163
166
  TrackerMain,
164
167
  LoggerMain,
165
168
  GitMain,
166
- WorkspaceConfigFilesMain
169
+ WorkspaceConfigFilesMain,
170
+ DeprecationMain
167
171
  ], config: GeneratorConfig, [componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot]: [
168
172
  ComponentTemplateSlot,
169
173
  WorkspaceTemplateSlot,
@@ -137,6 +137,13 @@ function _logger() {
137
137
  };
138
138
  return data;
139
139
  }
140
+ function _deprecation() {
141
+ const data = require("@teambit/deprecation");
142
+ _deprecation = function () {
143
+ return data;
144
+ };
145
+ return data;
146
+ }
140
147
  function _generator() {
141
148
  const data = require("./generator.aspect");
142
149
  _generator = function () {
@@ -228,7 +235,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
228
235
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
229
236
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
230
237
  class GeneratorMain {
231
- constructor(componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot, config, workspace, envs, aspectLoader, newComponentHelper, componentAspect, tracker, logger, git, wsConfigFiles) {
238
+ constructor(componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot, config, workspace, envs, aspectLoader, newComponentHelper, componentAspect, tracker, logger, git, wsConfigFiles, deprecation) {
232
239
  this.componentTemplateSlot = componentTemplateSlot;
233
240
  this.workspaceTemplateSlot = workspaceTemplateSlot;
234
241
  this.onComponentCreateSlot = onComponentCreateSlot;
@@ -242,6 +249,7 @@ class GeneratorMain {
242
249
  this.logger = logger;
243
250
  this.git = git;
244
251
  this.wsConfigFiles = wsConfigFiles;
252
+ this.deprecation = deprecation;
245
253
  _defineProperty(this, "aspectLoaded", false);
246
254
  _defineProperty(this, "getTemplateDescriptor", ({
247
255
  id,
@@ -501,12 +509,21 @@ the reason is that after refactoring, the code will have this invalid class: "cl
501
509
  } = loadFrom ? await this.findTemplateInOtherWorkspace(loadFrom, templateName, aspectId) : await this.getWorkspaceTemplate(templateName, aspectId);
502
510
  if (!workspaceTemplate) throw new (_bitError().BitError)(`template "${templateName}" was not found`);
503
511
  const workspaceGenerator = new (_workspaceGenerator().WorkspaceGenerator)(workspaceName, workspacePath, options, workspaceTemplate, aspect);
512
+ await this.warnAboutDeprecation(aspect);
504
513
  await workspaceGenerator.generate();
505
514
  return {
506
515
  workspacePath,
507
516
  appName: workspaceTemplate.appName
508
517
  };
509
518
  }
519
+ async warnAboutDeprecation(aspect) {
520
+ if (!aspect) return;
521
+ const deprecationInfo = await this.deprecation.getDeprecationInfo(aspect);
522
+ if (deprecationInfo.isDeprecate) {
523
+ const newStarterMsg = deprecationInfo.newId ? `, use "${deprecationInfo.newId.toString()}" instead` : '';
524
+ this.logger.consoleWarning(`the starter "${aspect?.id.toString()}" is deprecated${newStarterMsg}`);
525
+ }
526
+ }
510
527
  async getAllComponentTemplatesDescriptorsFlattened(aspectId) {
511
528
  const envTemplates = await this.listEnvComponentTemplateDescriptors([], aspectId);
512
529
  if (envTemplates && envTemplates.length) {
@@ -629,9 +646,9 @@ the reason is that after refactoring, the code will have this invalid class: "cl
629
646
  await this.workspace.loadAspects(this.config.aspects);
630
647
  this.aspectLoaded = true;
631
648
  }
632
- static async provider([workspace, cli, graphql, envs, aspectLoader, newComponentHelper, componentAspect, tracker, loggerMain, git, wsConfigFiles], config, [componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot]) {
649
+ static async provider([workspace, cli, graphql, envs, aspectLoader, newComponentHelper, componentAspect, tracker, loggerMain, git, wsConfigFiles, deprecation], config, [componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot]) {
633
650
  const logger = loggerMain.createLogger(_generator().GeneratorAspect.id);
634
- const generator = new GeneratorMain(componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot, config, workspace, envs, aspectLoader, newComponentHelper, componentAspect, tracker, logger, git, wsConfigFiles);
651
+ const generator = new GeneratorMain(componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot, config, workspace, envs, aspectLoader, newComponentHelper, componentAspect, tracker, logger, git, wsConfigFiles, deprecation);
635
652
  const commands = [new (_create().CreateCmd)(generator), new (_templates().TemplatesCmd)(generator), new (_new().NewCmd)(generator)];
636
653
  cli.register(...commands);
637
654
  graphql.register((0, _generator2().generatorSchema)(generator));
@@ -644,7 +661,7 @@ the reason is that after refactoring, the code will have this invalid class: "cl
644
661
  }
645
662
  exports.GeneratorMain = GeneratorMain;
646
663
  _defineProperty(GeneratorMain, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
647
- _defineProperty(GeneratorMain, "dependencies", [_workspace().WorkspaceAspect, _cli().CLIAspect, _graphql().GraphqlAspect, _envs().EnvsAspect, _aspectLoader().AspectLoaderAspect, _newComponentHelper().NewComponentHelperAspect, _component().ComponentAspect, _tracker().TrackerAspect, _logger().LoggerAspect, _git().GitAspect, _workspaceConfigFiles().WorkspaceConfigFilesAspect]);
664
+ _defineProperty(GeneratorMain, "dependencies", [_workspace().WorkspaceAspect, _cli().CLIAspect, _graphql().GraphqlAspect, _envs().EnvsAspect, _aspectLoader().AspectLoaderAspect, _newComponentHelper().NewComponentHelperAspect, _component().ComponentAspect, _tracker().TrackerAspect, _logger().LoggerAspect, _git().GitAspect, _workspaceConfigFiles().WorkspaceConfigFilesAspect, _deprecation().DeprecationAspect]);
648
665
  _defineProperty(GeneratorMain, "runtime", _cli().MainRuntime);
649
666
  _generator().GeneratorAspect.addRuntime(GeneratorMain);
650
667
 
@@ -1 +1 @@
1
- {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_camelcase","_path","_graphql","_cli","_workspace","_envs","_config","_workspaceConfigFiles","_component","_bit","_harmony","_git","_bitError","_aspectLoader","_tracker","_newComponentHelper","_lodash","_logger","_generator","_create","_templates","_generator2","_componentGenerator","_workspaceGenerator","_new","_templates2","_basic","_starter","_generator3","_workspacePathExists","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","GeneratorMain","constructor","componentTemplateSlot","workspaceTemplateSlot","onComponentCreateSlot","config","workspace","envs","aspectLoader","newComponentHelper","componentAspect","tracker","logger","git","wsConfigFiles","id","template","shouldBeHidden","hidden","hideCoreTemplates","isCoreAspect","aspectId","name","description","registerComponentTemplate","templates","register","registerWorkspaceTemplate","registerOnComponentCreate","fn","listTemplates","aspect","isRunningInsideWorkspace","getAllComponentTemplatesDescriptorsFlattened","getAllWorkspaceTemplatesDescriptorFlattened","listComponentTemplates","opts","Boolean","getComponentTemplateByAspect","get","getComponentTemplate","fromEnv","listEnvComponentTemplates","found","findTemplateByAspectIdAndName","getAllComponentTemplatesFlattened","find","idWithoutVersion","split","getGlobalGeneratorEnvs","globalScopeHarmony","components","legacyGlobalsSnapshot","loadAspectsFromGlobalScope","remoteGenerator","GeneratorAspect","remoteEnvsAspect","EnvsAspect","fullAspectId","toString","restoreGlobalsFromSnapshot","findWorkspaceTemplateInGlobalScope","fromGlobal","searchRegisteredWorkspaceTemplate","workspaceTemplate","findTemplateInOtherWorkspace","workspacePath","BitError","harmony","loadBit","WorkspaceAspect","err","Error","aspectComponentId","resolveComponentId","loadAspects","aspectComponent","aspectFullId","generator","getWorkspaceTemplate","registeredTemplate","listEnvWorkspaceTemplates","getAllWorkspaceTemplatesFlattened","tpl","generateComponentTemplate","componentNames","templateName","options","OutsideWorkspaceError","namespace","componentConfigLoadingRegistry","ComponentConfig","templateWithId","componentIds","map","componentName","getNewComponentId","scope","componentNameSameAsTemplateName","componentId","compNamePascal","camelCase","pascalCase","envId","getEnvIdFromTemplateWithId","componentGenerator","ComponentGenerator","generate","force","envIdFromTemplate","env","parsedFromTemplate","ComponentID","tryFromString","resolvedId","resolveEnvIdWithPotentialVersionForConfig","fromString","envName","Promise","resolve","undefined","generateWorkspaceTemplate","workspaceName","currentDir","process","cwd","fs","existsSync","WorkspacePathExists","loadFrom","workspaceGenerator","WorkspaceGenerator","appName","envTemplates","listEnvComponentTemplateDescriptors","filtered","flattened","getTemplateDescriptor","templatesByAspects","toArray","flatMap","componentTemplates","workspaceTemplates","loadEnvs","getGeneratorStarters","envStarters","starter","compact","ids","envTemplate","toStringWithoutVersion","titlePrefix","getConfiguredEnvs","configEnvs","includes","globals","allIds","uniq","concat","getGeneratorTemplates","tpls","host","getHost","envsAspect","potentialEnvs","getEnvDefinition","aspectLoaded","aspects","provider","cli","graphql","loggerMain","createLogger","commands","CreateCmd","TemplatesCmd","NewCmd","generatorSchema","registerPlugins","StarterPlugin","registerService","GeneratorService","componentGeneratorTemplate","componentGeneratorTemplateStandalone","starterTemplate","starterTemplateStandalone","BasicWorkspaceStarter","exports","Slot","withType","CLIAspect","GraphqlAspect","AspectLoaderAspect","NewComponentHelperAspect","ComponentAspect","TrackerAspect","LoggerAspect","GitAspect","WorkspaceConfigFilesAspect","MainRuntime","addRuntime"],"sources":["generator.main.runtime.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport camelCase from 'camelcase';\nimport { resolve } from 'path';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { EnvDefinition, EnvsAspect, EnvsMain } from '@teambit/envs';\nimport ComponentConfig from '@teambit/legacy/dist/consumer/config';\nimport { WorkspaceConfigFilesAspect, WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\nimport { ComponentAspect, ComponentID } from '@teambit/component';\nimport type { ComponentMain, Component } from '@teambit/component';\nimport { isCoreAspect, loadBit, restoreGlobalsFromSnapshot } from '@teambit/bit';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { GitAspect, GitMain } from '@teambit/git';\nimport { BitError } from '@teambit/bit-error';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport { TrackerAspect, TrackerMain } from '@teambit/tracker';\nimport { NewComponentHelperAspect, NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { compact, uniq } from 'lodash';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { ComponentTemplate } from './component-template';\nimport { GeneratorAspect } from './generator.aspect';\nimport { CreateCmd, CreateOptions } from './create.cmd';\nimport { TemplatesCmd } from './templates.cmd';\nimport { generatorSchema } from './generator.graphql';\nimport { ComponentGenerator, GenerateResult, OnComponentCreateFn } from './component-generator';\nimport { WorkspaceGenerator } from './workspace-generator';\nimport { WorkspaceTemplate } from './workspace-template';\nimport { NewCmd, NewOptions } from './new.cmd';\nimport {\n componentGeneratorTemplate,\n componentGeneratorTemplateStandalone,\n starterTemplate,\n starterTemplateStandalone,\n} from './templates';\nimport { BasicWorkspaceStarter } from './templates/basic';\nimport { StarterPlugin } from './starter.plugin';\nimport { GeneratorService } from './generator.service';\nimport { WorkspacePathExists } from './exceptions/workspace-path-exists';\n\nexport type ComponentTemplateSlot = SlotRegistry<ComponentTemplate[]>;\nexport type WorkspaceTemplateSlot = SlotRegistry<WorkspaceTemplate[]>;\nexport type OnComponentCreateSlot = SlotRegistry<OnComponentCreateFn>;\n\nexport type TemplateDescriptor = {\n aspectId: string;\n titlePrefix?: string;\n name: string;\n description?: string;\n hidden?: boolean;\n};\n\ntype TemplateWithId = { id: string; envName?: string };\ntype WorkspaceTemplateWithId = TemplateWithId & { template: WorkspaceTemplate };\ntype ComponentTemplateWithId = TemplateWithId & { template: ComponentTemplate };\ntype AnyTemplateWithId = TemplateWithId & { template: ComponentTemplate | WorkspaceTemplate };\n\nexport type GenerateWorkspaceTemplateResult = { workspacePath: string; appName?: string };\n\nexport type GeneratorConfig = {\n /**\n * array of aspects to include in the list of templates.\n */\n aspects: string[];\n\n /**\n * by default core templates are shown.\n * use this to hide them unless `--show-all` flag of `bit templates` was used\n */\n hideCoreTemplates: boolean;\n\n /**\n * default envs.\n */\n envs?: string[];\n};\n\nexport class GeneratorMain {\n private aspectLoaded = false;\n constructor(\n private componentTemplateSlot: ComponentTemplateSlot,\n private workspaceTemplateSlot: WorkspaceTemplateSlot,\n private onComponentCreateSlot: OnComponentCreateSlot,\n private config: GeneratorConfig,\n private workspace: Workspace,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain,\n private newComponentHelper: NewComponentHelperMain,\n private componentAspect: ComponentMain,\n private tracker: TrackerMain,\n private logger: Logger,\n private git: GitMain,\n private wsConfigFiles: WorkspaceConfigFilesMain\n ) {}\n\n /**\n * register a new component template.\n */\n registerComponentTemplate(templates: ComponentTemplate[]) {\n this.componentTemplateSlot.register(templates);\n return this;\n }\n\n /**\n * register a new workspace starter.\n */\n registerWorkspaceTemplate(templates: WorkspaceTemplate[]) {\n this.workspaceTemplateSlot.register(templates);\n return this;\n }\n\n registerOnComponentCreate(fn: OnComponentCreateFn) {\n this.onComponentCreateSlot.register(fn);\n return this;\n }\n\n /**\n * list all component templates registered in the workspace or workspace templates in case the\n * workspace is not available\n */\n async listTemplates({ aspect }: { aspect?: string } = {}): Promise<TemplateDescriptor[]> {\n if (this.isRunningInsideWorkspace()) {\n return this.getAllComponentTemplatesDescriptorsFlattened(aspect);\n }\n return this.getAllWorkspaceTemplatesDescriptorFlattened(aspect);\n }\n\n private getTemplateDescriptor = ({ id, template }: AnyTemplateWithId): TemplateDescriptor => {\n const shouldBeHidden = () => {\n if (template.hidden) return true;\n if (this.config.hideCoreTemplates && isCoreAspect(id)) return true;\n return false;\n };\n return {\n aspectId: id,\n name: template.name,\n description: template.description,\n hidden: shouldBeHidden(),\n };\n };\n\n /**\n * @deprecated use this.listTemplates()\n */\n async listComponentTemplates(opts: { aspect?: string }): Promise<TemplateDescriptor[]> {\n return this.listTemplates(opts);\n }\n\n isRunningInsideWorkspace(): boolean {\n return Boolean(this.workspace);\n }\n\n /**\n * get all component templates registered by a specific aspect ID.\n */\n getComponentTemplateByAspect(aspectId: string): ComponentTemplate[] {\n return this.componentTemplateSlot.get(aspectId) || [];\n }\n\n /**\n * returns a specific component template.\n */\n async getComponentTemplate(name: string, aspectId?: string): Promise<ComponentTemplateWithId | undefined> {\n const fromEnv = await this.listEnvComponentTemplates([], aspectId);\n if (fromEnv && fromEnv.length) {\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, fromEnv);\n if (found) return found;\n }\n // fallback to aspect id not from env if provided\n const templates = await this.getAllComponentTemplatesFlattened();\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, templates);\n return found;\n }\n\n private findTemplateByAspectIdAndName<T>(\n aspectId: string | undefined,\n name: string,\n templates: Array<T>\n ): T | undefined {\n // @ts-ignore (should set T to be extends ComponentTemplateWithId or WorkspaceTemplateWithId)\n const found = templates.find(({ id, template }) => {\n // When doing something like:\n // bit create react-env my-env --aspect teambit.react/react-env\n // we will get the aspectId without version\n // but the env might be loaded from the global scope then it will be with a version\n // so it won't found if we don't look for it like this\n const idWithoutVersion = id.split('@')[0];\n if (aspectId && id !== aspectId && idWithoutVersion !== aspectId) return false;\n return template.name === name;\n });\n return found;\n }\n\n /**\n * Get the generator aspect and the envs aspect from an harmony instance of the global scope\n */\n private async getGlobalGeneratorEnvs(\n aspectId: string\n ): Promise<{ remoteGenerator: GeneratorMain; fullAspectId: string; remoteEnvsAspect: EnvsMain; aspect: any }> {\n const { globalScopeHarmony, components, legacyGlobalsSnapshot } =\n await this.aspectLoader.loadAspectsFromGlobalScope([aspectId]);\n const remoteGenerator = globalScopeHarmony.get<GeneratorMain>(GeneratorAspect.id);\n const remoteEnvsAspect = globalScopeHarmony.get<EnvsMain>(EnvsAspect.id);\n const aspect = components[0];\n const fullAspectId = aspect.id.toString();\n restoreGlobalsFromSnapshot(legacyGlobalsSnapshot);\n\n return { remoteGenerator, fullAspectId, remoteEnvsAspect, aspect };\n }\n\n /**\n * in the case the aspect-id is given and this aspect doesn't exist locally, import it to the\n * global scope and load it from the capsule\n */\n async findWorkspaceTemplateInGlobalScope(\n aspectId: string,\n name?: string\n ): Promise<{ workspaceTemplate?: WorkspaceTemplate; aspect?: Component }> {\n const { remoteGenerator, fullAspectId, remoteEnvsAspect, aspect } = await this.getGlobalGeneratorEnvs(aspectId);\n const fromGlobal = await remoteGenerator.searchRegisteredWorkspaceTemplate.call(\n remoteGenerator,\n name,\n fullAspectId,\n remoteEnvsAspect\n );\n return { workspaceTemplate: fromGlobal, aspect };\n }\n\n async findTemplateInOtherWorkspace(workspacePath: string, name: string, aspectId?: string) {\n if (!aspectId)\n throw new BitError(\n `to load a template from a different workspace, please provide the aspect-id using --aspect flag`\n );\n const harmony = await loadBit(workspacePath);\n let workspace: Workspace;\n try {\n workspace = harmony.get<Workspace>(WorkspaceAspect.id);\n } catch (err: any) {\n throw new Error(`fatal: \"${workspacePath}\" is not a valid Bit workspace, make sure the path is correct`);\n }\n const aspectComponentId = await workspace.resolveComponentId(aspectId);\n await workspace.loadAspects([aspectId], true);\n const aspectComponent = await workspace.get(aspectComponentId);\n const aspectFullId = aspectComponentId.toString();\n const generator = harmony.get<GeneratorMain>(GeneratorAspect.id);\n const workspaceTemplate = await generator.searchRegisteredWorkspaceTemplate(name, aspectFullId);\n return { workspaceTemplate, aspect: aspectComponent };\n }\n\n /**\n * returns a specific workspace template.\n */\n async getWorkspaceTemplate(\n name: string,\n aspectId?: string\n ): Promise<{ workspaceTemplate: WorkspaceTemplate; aspect?: Component }> {\n const registeredTemplate = await this.searchRegisteredWorkspaceTemplate(name, aspectId);\n if (registeredTemplate) {\n return { workspaceTemplate: registeredTemplate };\n }\n if (!aspectId) {\n throw new BitError(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n const { workspaceTemplate, aspect } = await this.findWorkspaceTemplateInGlobalScope(aspectId, name);\n if (workspaceTemplate) {\n return { workspaceTemplate, aspect };\n }\n throw new BitError(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n async searchRegisteredWorkspaceTemplate(\n name?: string,\n aspectId?: string,\n remoteEnvsAspect?: EnvsMain\n ): Promise<WorkspaceTemplate | undefined> {\n let fromEnv;\n\n if (aspectId) {\n fromEnv = await this.listEnvWorkspaceTemplates(aspectId, remoteEnvsAspect);\n }\n const templates = fromEnv && fromEnv.length ? fromEnv : this.getAllWorkspaceTemplatesFlattened();\n const found = templates.find(({ id, template: tpl }) => {\n if (aspectId && name) return aspectId === id && name === tpl.name;\n if (aspectId) return aspectId === id;\n if (name) return name === tpl.name;\n throw new Error(`searchRegisteredWorkspaceTemplate expects to get \"name\" or \"aspectId\"`);\n });\n\n return found?.template;\n }\n\n async generateComponentTemplate(\n componentNames: string[],\n templateName: string,\n options: Partial<CreateOptions>\n ): Promise<GenerateResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n await this.loadAspects();\n const { namespace, aspect } = options;\n\n const componentConfigLoadingRegistry = ComponentConfig.componentConfigLoadingRegistry;\n\n const templateWithId = await this.getComponentTemplate(templateName, aspect);\n\n ComponentConfig.componentConfigLoadingRegistry = componentConfigLoadingRegistry;\n\n if (!templateWithId) throw new BitError(`template \"${templateName}\" was not found`);\n\n const componentIds = componentNames.map((componentName) =>\n this.newComponentHelper.getNewComponentId(componentName, namespace, options.scope)\n );\n\n const componentNameSameAsTemplateName = componentIds.find((componentId) => componentId.name === templateName);\n if (componentNameSameAsTemplateName) {\n const compNamePascal = camelCase(templateName, { pascalCase: true });\n throw new BitError(\n `unable to create a component with the same name as the template \"${templateName}\", please use a different name.\nthe reason is that after refactoring, the code will have this invalid class: \"class ${compNamePascal} extends ${compNamePascal} {}\"`\n );\n }\n\n const envId = await this.getEnvIdFromTemplateWithId(templateWithId);\n\n const componentGenerator = new ComponentGenerator(\n this.workspace,\n componentIds,\n options,\n templateWithId.template,\n this.envs,\n this.newComponentHelper,\n this.tracker,\n this.wsConfigFiles,\n this.logger,\n this.onComponentCreateSlot,\n templateWithId.id,\n envId\n );\n return componentGenerator.generate(options.force);\n }\n\n private async getEnvIdFromTemplateWithId(templateWithId: ComponentTemplateWithId): Promise<ComponentID | undefined> {\n const envIdFromTemplate = templateWithId.template.env;\n if (envIdFromTemplate) {\n const parsedFromTemplate = ComponentID.tryFromString(envIdFromTemplate);\n if (!parsedFromTemplate) {\n throw new BitError(\n `Error: unable to parse envId from template. template name: ${templateWithId.template.name}, envId: ${envIdFromTemplate}`\n );\n }\n const resolvedId = await this.workspace.resolveEnvIdWithPotentialVersionForConfig(parsedFromTemplate);\n return ComponentID.fromString(resolvedId);\n }\n if (templateWithId.envName) {\n return ComponentID.fromString(templateWithId.id);\n }\n return Promise.resolve(undefined);\n }\n\n async generateWorkspaceTemplate(\n workspaceName: string,\n templateName: string,\n options: NewOptions & { aspect?: string; currentDir?: boolean }\n ): Promise<GenerateWorkspaceTemplateResult> {\n if (this.workspace) {\n throw new BitError('Error: unable to generate a new workspace inside of an existing workspace');\n }\n const workspacePath = options.currentDir ? process.cwd() : resolve(workspaceName);\n if (!options.currentDir && fs.existsSync(workspacePath)) {\n throw new WorkspacePathExists(workspacePath);\n }\n const { aspect: aspectId, loadFrom } = options;\n const { workspaceTemplate, aspect } = loadFrom\n ? await this.findTemplateInOtherWorkspace(loadFrom, templateName, aspectId)\n : await this.getWorkspaceTemplate(templateName, aspectId);\n\n if (!workspaceTemplate) throw new BitError(`template \"${templateName}\" was not found`);\n const workspaceGenerator = new WorkspaceGenerator(workspaceName, workspacePath, options, workspaceTemplate, aspect);\n await workspaceGenerator.generate();\n return { workspacePath, appName: workspaceTemplate.appName };\n }\n\n private async getAllComponentTemplatesDescriptorsFlattened(aspectId?: string): Promise<Array<TemplateDescriptor>> {\n const envTemplates = await this.listEnvComponentTemplateDescriptors([], aspectId);\n if (envTemplates && envTemplates.length) {\n if (!aspectId) return envTemplates;\n const filtered = envTemplates.filter((template) => template.aspectId === aspectId);\n if (filtered.length) return filtered;\n }\n\n const flattened = this.getAllComponentTemplatesFlattened();\n const filtered = aspectId ? flattened.filter((template) => template.id === aspectId) : flattened;\n return filtered.map((template) => this.getTemplateDescriptor(template));\n }\n\n private getAllComponentTemplatesFlattened(): Array<{ id: string; template: ComponentTemplate }> {\n const templatesByAspects = this.componentTemplateSlot.toArray();\n const flattened = templatesByAspects.flatMap(([id, componentTemplates]) => {\n return componentTemplates.map((template) => ({\n id,\n template,\n }));\n });\n return flattened;\n }\n\n private async getAllWorkspaceTemplatesDescriptorFlattened(aspectId?: string): Promise<Array<TemplateDescriptor>> {\n let envTemplates;\n if (aspectId) {\n envTemplates = await this.listEnvWorkspaceTemplates(aspectId);\n }\n\n const templates = envTemplates && envTemplates.length ? envTemplates : this.getAllWorkspaceTemplatesFlattened();\n return templates.map((template) => this.getTemplateDescriptor(template));\n }\n\n private getAllWorkspaceTemplatesFlattened(): Array<{ id: string; template: WorkspaceTemplate }> {\n const templatesByAspects = this.workspaceTemplateSlot.toArray();\n return templatesByAspects.flatMap(([id, workspaceTemplates]) => {\n return workspaceTemplates.map((template) => ({\n id,\n template,\n }));\n });\n }\n\n /**\n * list all starter templates registered by an env.\n */\n async listEnvWorkspaceTemplates(envId: string, remoteEnvsAspect?: EnvsMain): Promise<Array<WorkspaceTemplateWithId>> {\n const envs = await this.loadEnvs([envId], remoteEnvsAspect);\n const workspaceTemplates = envs.flatMap((env) => {\n if (!env.env.getGeneratorStarters) return undefined;\n const envStarters = env.env.getGeneratorStarters();\n return envStarters.map((starter) => {\n const componentId = ComponentID.fromString(env.id);\n return {\n id: componentId.toString(),\n envName: env.name,\n template: starter,\n };\n });\n });\n\n return compact(workspaceTemplates);\n }\n\n /**\n * list all component templates registered by an env.\n */\n async listEnvComponentTemplateDescriptors(ids: string[] = [], aspectId?: string): Promise<TemplateDescriptor[]> {\n const envTemplates = await this.listEnvComponentTemplates(ids, aspectId);\n const templates: TemplateDescriptor[] = envTemplates.map((envTemplate) => {\n const componentId = ComponentID.fromString(envTemplate.id);\n return {\n aspectId: componentId.toStringWithoutVersion(),\n titlePrefix: envTemplate.envName,\n ...envTemplate.template,\n };\n });\n\n return templates;\n }\n\n getConfiguredEnvs(): string[] {\n return this.config.envs ?? [];\n }\n\n async listEnvComponentTemplates(ids: string[] = [], aspectId?: string): Promise<Array<ComponentTemplateWithId>> {\n const configEnvs = this.config.envs || [];\n let remoteEnvsAspect;\n let fullAspectId;\n if (aspectId && !configEnvs.includes(aspectId)) {\n const globals = await this.getGlobalGeneratorEnvs(aspectId);\n remoteEnvsAspect = globals.remoteEnvsAspect;\n fullAspectId = globals.fullAspectId;\n }\n const allIds = uniq(configEnvs?.concat(ids).concat([aspectId, fullAspectId]).filter(Boolean));\n const envs = await this.loadEnvs(allIds, remoteEnvsAspect);\n const templates = envs.flatMap((env) => {\n if (!env.env.getGeneratorTemplates) return [];\n const tpls = env.env.getGeneratorTemplates() || [];\n const componentId = ComponentID.fromString(env.id);\n return tpls.map((template) => {\n return {\n id: componentId.toString(),\n envName: env.name,\n template,\n };\n });\n });\n\n return templates;\n }\n\n async loadEnvs(ids: string[] = this.config.envs || [], remoteEnvsAspect?: EnvsMain): Promise<EnvDefinition[]> {\n // In case we have remoteEnvsAspect it means that we are running from the global scope\n // in that case the aspect / env were already loaded before to the global scope harmony instance\n // so no reason to load it here\n if (!remoteEnvsAspect) {\n const host = this.componentAspect.getHost();\n if (!host) return [];\n await host.loadAspects(ids);\n }\n\n const envsAspect = remoteEnvsAspect || this.envs;\n\n const potentialEnvs = ids.map((id) => {\n const componentId = ComponentID.fromString(id);\n return envsAspect.getEnvDefinition(componentId);\n });\n\n return compact(potentialEnvs);\n }\n\n async loadAspects() {\n if (this.aspectLoaded) return;\n await this.workspace.loadAspects(this.config.aspects);\n this.aspectLoaded = true;\n }\n\n static slots = [\n Slot.withType<ComponentTemplate[]>(),\n Slot.withType<WorkspaceTemplate[]>(),\n Slot.withType<OnComponentCreateFn>(),\n ];\n\n static dependencies = [\n WorkspaceAspect,\n CLIAspect,\n GraphqlAspect,\n EnvsAspect,\n AspectLoaderAspect,\n NewComponentHelperAspect,\n ComponentAspect,\n TrackerAspect,\n LoggerAspect,\n GitAspect,\n WorkspaceConfigFilesAspect,\n ];\n\n static runtime = MainRuntime;\n\n static async provider(\n [\n workspace,\n cli,\n graphql,\n envs,\n aspectLoader,\n newComponentHelper,\n componentAspect,\n tracker,\n loggerMain,\n git,\n wsConfigFiles,\n ]: [\n Workspace,\n CLIMain,\n GraphqlMain,\n EnvsMain,\n AspectLoaderMain,\n NewComponentHelperMain,\n ComponentMain,\n TrackerMain,\n LoggerMain,\n GitMain,\n WorkspaceConfigFilesMain\n ],\n config: GeneratorConfig,\n [componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot]: [\n ComponentTemplateSlot,\n WorkspaceTemplateSlot,\n OnComponentCreateSlot\n ]\n ) {\n const logger = loggerMain.createLogger(GeneratorAspect.id);\n const generator = new GeneratorMain(\n componentTemplateSlot,\n workspaceTemplateSlot,\n onComponentCreateSlot,\n config,\n workspace,\n envs,\n aspectLoader,\n newComponentHelper,\n componentAspect,\n tracker,\n logger,\n git,\n wsConfigFiles\n );\n const commands = [new CreateCmd(generator), new TemplatesCmd(generator), new NewCmd(generator)];\n cli.register(...commands);\n graphql.register(generatorSchema(generator));\n aspectLoader.registerPlugins([new StarterPlugin(generator)]);\n envs.registerService(new GeneratorService());\n\n if (generator)\n generator.registerComponentTemplate([\n componentGeneratorTemplate,\n componentGeneratorTemplateStandalone,\n starterTemplate,\n starterTemplateStandalone,\n ]);\n generator.registerWorkspaceTemplate([BasicWorkspaceStarter]);\n\n return generator;\n }\n}\n\nGeneratorAspect.addRuntime(GeneratorMain);\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,KAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,WAAA;EAAA,MAA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cli","_workspace","_envs","_config","_workspaceConfigFiles","_component","_bit","_harmony","_git","_bitError","_aspectLoader","_tracker","_newComponentHelper","_lodash","_logger","_deprecation","_generator","_create","_templates","_generator2","_componentGenerator","_workspaceGenerator","_new","_templates2","_basic","_starter","_generator3","_workspacePathExists","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","GeneratorMain","constructor","componentTemplateSlot","workspaceTemplateSlot","onComponentCreateSlot","config","workspace","envs","aspectLoader","newComponentHelper","componentAspect","tracker","logger","git","wsConfigFiles","deprecation","id","template","shouldBeHidden","hidden","hideCoreTemplates","isCoreAspect","aspectId","name","description","registerComponentTemplate","templates","register","registerWorkspaceTemplate","registerOnComponentCreate","fn","listTemplates","aspect","isRunningInsideWorkspace","getAllComponentTemplatesDescriptorsFlattened","getAllWorkspaceTemplatesDescriptorFlattened","listComponentTemplates","opts","Boolean","getComponentTemplateByAspect","get","getComponentTemplate","fromEnv","listEnvComponentTemplates","found","findTemplateByAspectIdAndName","getAllComponentTemplatesFlattened","find","idWithoutVersion","split","getGlobalGeneratorEnvs","globalScopeHarmony","components","legacyGlobalsSnapshot","loadAspectsFromGlobalScope","remoteGenerator","GeneratorAspect","remoteEnvsAspect","EnvsAspect","fullAspectId","toString","restoreGlobalsFromSnapshot","findWorkspaceTemplateInGlobalScope","fromGlobal","searchRegisteredWorkspaceTemplate","workspaceTemplate","findTemplateInOtherWorkspace","workspacePath","BitError","harmony","loadBit","WorkspaceAspect","err","Error","aspectComponentId","resolveComponentId","loadAspects","aspectComponent","aspectFullId","generator","getWorkspaceTemplate","registeredTemplate","listEnvWorkspaceTemplates","getAllWorkspaceTemplatesFlattened","tpl","generateComponentTemplate","componentNames","templateName","options","OutsideWorkspaceError","namespace","componentConfigLoadingRegistry","ComponentConfig","templateWithId","componentIds","map","componentName","getNewComponentId","scope","componentNameSameAsTemplateName","componentId","compNamePascal","camelCase","pascalCase","envId","getEnvIdFromTemplateWithId","componentGenerator","ComponentGenerator","generate","force","envIdFromTemplate","env","parsedFromTemplate","ComponentID","tryFromString","resolvedId","resolveEnvIdWithPotentialVersionForConfig","fromString","envName","Promise","resolve","undefined","generateWorkspaceTemplate","workspaceName","currentDir","process","cwd","fs","existsSync","WorkspacePathExists","loadFrom","workspaceGenerator","WorkspaceGenerator","warnAboutDeprecation","appName","deprecationInfo","getDeprecationInfo","isDeprecate","newStarterMsg","newId","consoleWarning","envTemplates","listEnvComponentTemplateDescriptors","filtered","flattened","getTemplateDescriptor","templatesByAspects","toArray","flatMap","componentTemplates","workspaceTemplates","loadEnvs","getGeneratorStarters","envStarters","starter","compact","ids","envTemplate","toStringWithoutVersion","titlePrefix","getConfiguredEnvs","configEnvs","includes","globals","allIds","uniq","concat","getGeneratorTemplates","tpls","host","getHost","envsAspect","potentialEnvs","getEnvDefinition","aspectLoaded","aspects","provider","cli","graphql","loggerMain","createLogger","commands","CreateCmd","TemplatesCmd","NewCmd","generatorSchema","registerPlugins","StarterPlugin","registerService","GeneratorService","componentGeneratorTemplate","componentGeneratorTemplateStandalone","starterTemplate","starterTemplateStandalone","BasicWorkspaceStarter","exports","Slot","withType","CLIAspect","GraphqlAspect","AspectLoaderAspect","NewComponentHelperAspect","ComponentAspect","TrackerAspect","LoggerAspect","GitAspect","WorkspaceConfigFilesAspect","DeprecationAspect","MainRuntime","addRuntime"],"sources":["generator.main.runtime.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport camelCase from 'camelcase';\nimport { resolve } from 'path';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { EnvDefinition, EnvsAspect, EnvsMain } from '@teambit/envs';\nimport ComponentConfig from '@teambit/legacy/dist/consumer/config';\nimport { WorkspaceConfigFilesAspect, WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\nimport { ComponentAspect, ComponentID } from '@teambit/component';\nimport type { ComponentMain, Component } from '@teambit/component';\nimport { isCoreAspect, loadBit, restoreGlobalsFromSnapshot } from '@teambit/bit';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { GitAspect, GitMain } from '@teambit/git';\nimport { BitError } from '@teambit/bit-error';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport { TrackerAspect, TrackerMain } from '@teambit/tracker';\nimport { NewComponentHelperAspect, NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { compact, uniq } from 'lodash';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DeprecationAspect, DeprecationMain } from '@teambit/deprecation';\nimport { ComponentTemplate } from './component-template';\nimport { GeneratorAspect } from './generator.aspect';\nimport { CreateCmd, CreateOptions } from './create.cmd';\nimport { TemplatesCmd } from './templates.cmd';\nimport { generatorSchema } from './generator.graphql';\nimport { ComponentGenerator, GenerateResult, OnComponentCreateFn } from './component-generator';\nimport { WorkspaceGenerator } from './workspace-generator';\nimport { WorkspaceTemplate } from './workspace-template';\nimport { NewCmd, NewOptions } from './new.cmd';\nimport {\n componentGeneratorTemplate,\n componentGeneratorTemplateStandalone,\n starterTemplate,\n starterTemplateStandalone,\n} from './templates';\nimport { BasicWorkspaceStarter } from './templates/basic';\nimport { StarterPlugin } from './starter.plugin';\nimport { GeneratorService } from './generator.service';\nimport { WorkspacePathExists } from './exceptions/workspace-path-exists';\n\nexport type ComponentTemplateSlot = SlotRegistry<ComponentTemplate[]>;\nexport type WorkspaceTemplateSlot = SlotRegistry<WorkspaceTemplate[]>;\nexport type OnComponentCreateSlot = SlotRegistry<OnComponentCreateFn>;\n\nexport type TemplateDescriptor = {\n aspectId: string;\n titlePrefix?: string;\n name: string;\n description?: string;\n hidden?: boolean;\n};\n\ntype TemplateWithId = { id: string; envName?: string };\ntype WorkspaceTemplateWithId = TemplateWithId & { template: WorkspaceTemplate };\ntype ComponentTemplateWithId = TemplateWithId & { template: ComponentTemplate };\ntype AnyTemplateWithId = TemplateWithId & { template: ComponentTemplate | WorkspaceTemplate };\n\nexport type GenerateWorkspaceTemplateResult = { workspacePath: string; appName?: string };\n\nexport type GeneratorConfig = {\n /**\n * array of aspects to include in the list of templates.\n */\n aspects: string[];\n\n /**\n * by default core templates are shown.\n * use this to hide them unless `--show-all` flag of `bit templates` was used\n */\n hideCoreTemplates: boolean;\n\n /**\n * default envs.\n */\n envs?: string[];\n};\n\nexport class GeneratorMain {\n private aspectLoaded = false;\n constructor(\n private componentTemplateSlot: ComponentTemplateSlot,\n private workspaceTemplateSlot: WorkspaceTemplateSlot,\n private onComponentCreateSlot: OnComponentCreateSlot,\n private config: GeneratorConfig,\n private workspace: Workspace,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain,\n private newComponentHelper: NewComponentHelperMain,\n private componentAspect: ComponentMain,\n private tracker: TrackerMain,\n private logger: Logger,\n private git: GitMain,\n private wsConfigFiles: WorkspaceConfigFilesMain,\n private deprecation: DeprecationMain\n ) {}\n\n /**\n * register a new component template.\n */\n registerComponentTemplate(templates: ComponentTemplate[]) {\n this.componentTemplateSlot.register(templates);\n return this;\n }\n\n /**\n * register a new workspace starter.\n */\n registerWorkspaceTemplate(templates: WorkspaceTemplate[]) {\n this.workspaceTemplateSlot.register(templates);\n return this;\n }\n\n registerOnComponentCreate(fn: OnComponentCreateFn) {\n this.onComponentCreateSlot.register(fn);\n return this;\n }\n\n /**\n * list all component templates registered in the workspace or workspace templates in case the\n * workspace is not available\n */\n async listTemplates({ aspect }: { aspect?: string } = {}): Promise<TemplateDescriptor[]> {\n if (this.isRunningInsideWorkspace()) {\n return this.getAllComponentTemplatesDescriptorsFlattened(aspect);\n }\n return this.getAllWorkspaceTemplatesDescriptorFlattened(aspect);\n }\n\n private getTemplateDescriptor = ({ id, template }: AnyTemplateWithId): TemplateDescriptor => {\n const shouldBeHidden = () => {\n if (template.hidden) return true;\n if (this.config.hideCoreTemplates && isCoreAspect(id)) return true;\n return false;\n };\n return {\n aspectId: id,\n name: template.name,\n description: template.description,\n hidden: shouldBeHidden(),\n };\n };\n\n /**\n * @deprecated use this.listTemplates()\n */\n async listComponentTemplates(opts: { aspect?: string }): Promise<TemplateDescriptor[]> {\n return this.listTemplates(opts);\n }\n\n isRunningInsideWorkspace(): boolean {\n return Boolean(this.workspace);\n }\n\n /**\n * get all component templates registered by a specific aspect ID.\n */\n getComponentTemplateByAspect(aspectId: string): ComponentTemplate[] {\n return this.componentTemplateSlot.get(aspectId) || [];\n }\n\n /**\n * returns a specific component template.\n */\n async getComponentTemplate(name: string, aspectId?: string): Promise<ComponentTemplateWithId | undefined> {\n const fromEnv = await this.listEnvComponentTemplates([], aspectId);\n if (fromEnv && fromEnv.length) {\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, fromEnv);\n if (found) return found;\n }\n // fallback to aspect id not from env if provided\n const templates = await this.getAllComponentTemplatesFlattened();\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, templates);\n return found;\n }\n\n private findTemplateByAspectIdAndName<T>(\n aspectId: string | undefined,\n name: string,\n templates: Array<T>\n ): T | undefined {\n // @ts-ignore (should set T to be extends ComponentTemplateWithId or WorkspaceTemplateWithId)\n const found = templates.find(({ id, template }) => {\n // When doing something like:\n // bit create react-env my-env --aspect teambit.react/react-env\n // we will get the aspectId without version\n // but the env might be loaded from the global scope then it will be with a version\n // so it won't found if we don't look for it like this\n const idWithoutVersion = id.split('@')[0];\n if (aspectId && id !== aspectId && idWithoutVersion !== aspectId) return false;\n return template.name === name;\n });\n return found;\n }\n\n /**\n * Get the generator aspect and the envs aspect from an harmony instance of the global scope\n */\n private async getGlobalGeneratorEnvs(\n aspectId: string\n ): Promise<{ remoteGenerator: GeneratorMain; fullAspectId: string; remoteEnvsAspect: EnvsMain; aspect: any }> {\n const { globalScopeHarmony, components, legacyGlobalsSnapshot } =\n await this.aspectLoader.loadAspectsFromGlobalScope([aspectId]);\n const remoteGenerator = globalScopeHarmony.get<GeneratorMain>(GeneratorAspect.id);\n const remoteEnvsAspect = globalScopeHarmony.get<EnvsMain>(EnvsAspect.id);\n const aspect = components[0];\n const fullAspectId = aspect.id.toString();\n restoreGlobalsFromSnapshot(legacyGlobalsSnapshot);\n\n return { remoteGenerator, fullAspectId, remoteEnvsAspect, aspect };\n }\n\n /**\n * in the case the aspect-id is given and this aspect doesn't exist locally, import it to the\n * global scope and load it from the capsule\n */\n async findWorkspaceTemplateInGlobalScope(\n aspectId: string,\n name?: string\n ): Promise<{ workspaceTemplate?: WorkspaceTemplate; aspect?: Component }> {\n const { remoteGenerator, fullAspectId, remoteEnvsAspect, aspect } = await this.getGlobalGeneratorEnvs(aspectId);\n const fromGlobal = await remoteGenerator.searchRegisteredWorkspaceTemplate.call(\n remoteGenerator,\n name,\n fullAspectId,\n remoteEnvsAspect\n );\n return { workspaceTemplate: fromGlobal, aspect };\n }\n\n async findTemplateInOtherWorkspace(workspacePath: string, name: string, aspectId?: string) {\n if (!aspectId)\n throw new BitError(\n `to load a template from a different workspace, please provide the aspect-id using --aspect flag`\n );\n const harmony = await loadBit(workspacePath);\n let workspace: Workspace;\n try {\n workspace = harmony.get<Workspace>(WorkspaceAspect.id);\n } catch (err: any) {\n throw new Error(`fatal: \"${workspacePath}\" is not a valid Bit workspace, make sure the path is correct`);\n }\n const aspectComponentId = await workspace.resolveComponentId(aspectId);\n await workspace.loadAspects([aspectId], true);\n const aspectComponent = await workspace.get(aspectComponentId);\n const aspectFullId = aspectComponentId.toString();\n const generator = harmony.get<GeneratorMain>(GeneratorAspect.id);\n const workspaceTemplate = await generator.searchRegisteredWorkspaceTemplate(name, aspectFullId);\n return { workspaceTemplate, aspect: aspectComponent };\n }\n\n /**\n * returns a specific workspace template.\n */\n async getWorkspaceTemplate(\n name: string,\n aspectId?: string\n ): Promise<{ workspaceTemplate: WorkspaceTemplate; aspect?: Component }> {\n const registeredTemplate = await this.searchRegisteredWorkspaceTemplate(name, aspectId);\n if (registeredTemplate) {\n return { workspaceTemplate: registeredTemplate };\n }\n if (!aspectId) {\n throw new BitError(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n const { workspaceTemplate, aspect } = await this.findWorkspaceTemplateInGlobalScope(aspectId, name);\n if (workspaceTemplate) {\n return { workspaceTemplate, aspect };\n }\n throw new BitError(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n async searchRegisteredWorkspaceTemplate(\n name?: string,\n aspectId?: string,\n remoteEnvsAspect?: EnvsMain\n ): Promise<WorkspaceTemplate | undefined> {\n let fromEnv;\n\n if (aspectId) {\n fromEnv = await this.listEnvWorkspaceTemplates(aspectId, remoteEnvsAspect);\n }\n const templates = fromEnv && fromEnv.length ? fromEnv : this.getAllWorkspaceTemplatesFlattened();\n const found = templates.find(({ id, template: tpl }) => {\n if (aspectId && name) return aspectId === id && name === tpl.name;\n if (aspectId) return aspectId === id;\n if (name) return name === tpl.name;\n throw new Error(`searchRegisteredWorkspaceTemplate expects to get \"name\" or \"aspectId\"`);\n });\n\n return found?.template;\n }\n\n async generateComponentTemplate(\n componentNames: string[],\n templateName: string,\n options: Partial<CreateOptions>\n ): Promise<GenerateResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n await this.loadAspects();\n const { namespace, aspect } = options;\n\n const componentConfigLoadingRegistry = ComponentConfig.componentConfigLoadingRegistry;\n\n const templateWithId = await this.getComponentTemplate(templateName, aspect);\n\n ComponentConfig.componentConfigLoadingRegistry = componentConfigLoadingRegistry;\n\n if (!templateWithId) throw new BitError(`template \"${templateName}\" was not found`);\n\n const componentIds = componentNames.map((componentName) =>\n this.newComponentHelper.getNewComponentId(componentName, namespace, options.scope)\n );\n\n const componentNameSameAsTemplateName = componentIds.find((componentId) => componentId.name === templateName);\n if (componentNameSameAsTemplateName) {\n const compNamePascal = camelCase(templateName, { pascalCase: true });\n throw new BitError(\n `unable to create a component with the same name as the template \"${templateName}\", please use a different name.\nthe reason is that after refactoring, the code will have this invalid class: \"class ${compNamePascal} extends ${compNamePascal} {}\"`\n );\n }\n\n const envId = await this.getEnvIdFromTemplateWithId(templateWithId);\n\n const componentGenerator = new ComponentGenerator(\n this.workspace,\n componentIds,\n options,\n templateWithId.template,\n this.envs,\n this.newComponentHelper,\n this.tracker,\n this.wsConfigFiles,\n this.logger,\n this.onComponentCreateSlot,\n templateWithId.id,\n envId\n );\n return componentGenerator.generate(options.force);\n }\n\n private async getEnvIdFromTemplateWithId(templateWithId: ComponentTemplateWithId): Promise<ComponentID | undefined> {\n const envIdFromTemplate = templateWithId.template.env;\n if (envIdFromTemplate) {\n const parsedFromTemplate = ComponentID.tryFromString(envIdFromTemplate);\n if (!parsedFromTemplate) {\n throw new BitError(\n `Error: unable to parse envId from template. template name: ${templateWithId.template.name}, envId: ${envIdFromTemplate}`\n );\n }\n const resolvedId = await this.workspace.resolveEnvIdWithPotentialVersionForConfig(parsedFromTemplate);\n return ComponentID.fromString(resolvedId);\n }\n if (templateWithId.envName) {\n return ComponentID.fromString(templateWithId.id);\n }\n return Promise.resolve(undefined);\n }\n\n async generateWorkspaceTemplate(\n workspaceName: string,\n templateName: string,\n options: NewOptions & { aspect?: string; currentDir?: boolean }\n ): Promise<GenerateWorkspaceTemplateResult> {\n if (this.workspace) {\n throw new BitError('Error: unable to generate a new workspace inside of an existing workspace');\n }\n const workspacePath = options.currentDir ? process.cwd() : resolve(workspaceName);\n if (!options.currentDir && fs.existsSync(workspacePath)) {\n throw new WorkspacePathExists(workspacePath);\n }\n const { aspect: aspectId, loadFrom } = options;\n const { workspaceTemplate, aspect } = loadFrom\n ? await this.findTemplateInOtherWorkspace(loadFrom, templateName, aspectId)\n : await this.getWorkspaceTemplate(templateName, aspectId);\n\n if (!workspaceTemplate) throw new BitError(`template \"${templateName}\" was not found`);\n const workspaceGenerator = new WorkspaceGenerator(workspaceName, workspacePath, options, workspaceTemplate, aspect);\n await this.warnAboutDeprecation(aspect);\n await workspaceGenerator.generate();\n return { workspacePath, appName: workspaceTemplate.appName };\n }\n\n private async warnAboutDeprecation(aspect?: Component) {\n if (!aspect) return;\n const deprecationInfo = await this.deprecation.getDeprecationInfo(aspect);\n if (deprecationInfo.isDeprecate) {\n const newStarterMsg = deprecationInfo.newId ? `, use \"${deprecationInfo.newId.toString()}\" instead` : '';\n this.logger.consoleWarning(`the starter \"${aspect?.id.toString()}\" is deprecated${newStarterMsg}`);\n }\n }\n\n private async getAllComponentTemplatesDescriptorsFlattened(aspectId?: string): Promise<Array<TemplateDescriptor>> {\n const envTemplates = await this.listEnvComponentTemplateDescriptors([], aspectId);\n if (envTemplates && envTemplates.length) {\n if (!aspectId) return envTemplates;\n const filtered = envTemplates.filter((template) => template.aspectId === aspectId);\n if (filtered.length) return filtered;\n }\n\n const flattened = this.getAllComponentTemplatesFlattened();\n const filtered = aspectId ? flattened.filter((template) => template.id === aspectId) : flattened;\n return filtered.map((template) => this.getTemplateDescriptor(template));\n }\n\n private getAllComponentTemplatesFlattened(): Array<{ id: string; template: ComponentTemplate }> {\n const templatesByAspects = this.componentTemplateSlot.toArray();\n const flattened = templatesByAspects.flatMap(([id, componentTemplates]) => {\n return componentTemplates.map((template) => ({\n id,\n template,\n }));\n });\n return flattened;\n }\n\n private async getAllWorkspaceTemplatesDescriptorFlattened(aspectId?: string): Promise<Array<TemplateDescriptor>> {\n let envTemplates;\n if (aspectId) {\n envTemplates = await this.listEnvWorkspaceTemplates(aspectId);\n }\n\n const templates = envTemplates && envTemplates.length ? envTemplates : this.getAllWorkspaceTemplatesFlattened();\n return templates.map((template) => this.getTemplateDescriptor(template));\n }\n\n private getAllWorkspaceTemplatesFlattened(): Array<{ id: string; template: WorkspaceTemplate }> {\n const templatesByAspects = this.workspaceTemplateSlot.toArray();\n return templatesByAspects.flatMap(([id, workspaceTemplates]) => {\n return workspaceTemplates.map((template) => ({\n id,\n template,\n }));\n });\n }\n\n /**\n * list all starter templates registered by an env.\n */\n async listEnvWorkspaceTemplates(envId: string, remoteEnvsAspect?: EnvsMain): Promise<Array<WorkspaceTemplateWithId>> {\n const envs = await this.loadEnvs([envId], remoteEnvsAspect);\n const workspaceTemplates = envs.flatMap((env) => {\n if (!env.env.getGeneratorStarters) return undefined;\n const envStarters = env.env.getGeneratorStarters();\n return envStarters.map((starter) => {\n const componentId = ComponentID.fromString(env.id);\n return {\n id: componentId.toString(),\n envName: env.name,\n template: starter,\n };\n });\n });\n\n return compact(workspaceTemplates);\n }\n\n /**\n * list all component templates registered by an env.\n */\n async listEnvComponentTemplateDescriptors(ids: string[] = [], aspectId?: string): Promise<TemplateDescriptor[]> {\n const envTemplates = await this.listEnvComponentTemplates(ids, aspectId);\n const templates: TemplateDescriptor[] = envTemplates.map((envTemplate) => {\n const componentId = ComponentID.fromString(envTemplate.id);\n return {\n aspectId: componentId.toStringWithoutVersion(),\n titlePrefix: envTemplate.envName,\n ...envTemplate.template,\n };\n });\n\n return templates;\n }\n\n getConfiguredEnvs(): string[] {\n return this.config.envs ?? [];\n }\n\n async listEnvComponentTemplates(ids: string[] = [], aspectId?: string): Promise<Array<ComponentTemplateWithId>> {\n const configEnvs = this.config.envs || [];\n let remoteEnvsAspect;\n let fullAspectId;\n if (aspectId && !configEnvs.includes(aspectId)) {\n const globals = await this.getGlobalGeneratorEnvs(aspectId);\n remoteEnvsAspect = globals.remoteEnvsAspect;\n fullAspectId = globals.fullAspectId;\n }\n const allIds = uniq(configEnvs?.concat(ids).concat([aspectId, fullAspectId]).filter(Boolean));\n const envs = await this.loadEnvs(allIds, remoteEnvsAspect);\n const templates = envs.flatMap((env) => {\n if (!env.env.getGeneratorTemplates) return [];\n const tpls = env.env.getGeneratorTemplates() || [];\n const componentId = ComponentID.fromString(env.id);\n return tpls.map((template) => {\n return {\n id: componentId.toString(),\n envName: env.name,\n template,\n };\n });\n });\n\n return templates;\n }\n\n async loadEnvs(ids: string[] = this.config.envs || [], remoteEnvsAspect?: EnvsMain): Promise<EnvDefinition[]> {\n // In case we have remoteEnvsAspect it means that we are running from the global scope\n // in that case the aspect / env were already loaded before to the global scope harmony instance\n // so no reason to load it here\n if (!remoteEnvsAspect) {\n const host = this.componentAspect.getHost();\n if (!host) return [];\n await host.loadAspects(ids);\n }\n\n const envsAspect = remoteEnvsAspect || this.envs;\n\n const potentialEnvs = ids.map((id) => {\n const componentId = ComponentID.fromString(id);\n return envsAspect.getEnvDefinition(componentId);\n });\n\n return compact(potentialEnvs);\n }\n\n async loadAspects() {\n if (this.aspectLoaded) return;\n await this.workspace.loadAspects(this.config.aspects);\n this.aspectLoaded = true;\n }\n\n static slots = [\n Slot.withType<ComponentTemplate[]>(),\n Slot.withType<WorkspaceTemplate[]>(),\n Slot.withType<OnComponentCreateFn>(),\n ];\n\n static dependencies = [\n WorkspaceAspect,\n CLIAspect,\n GraphqlAspect,\n EnvsAspect,\n AspectLoaderAspect,\n NewComponentHelperAspect,\n ComponentAspect,\n TrackerAspect,\n LoggerAspect,\n GitAspect,\n WorkspaceConfigFilesAspect,\n DeprecationAspect,\n ];\n\n static runtime = MainRuntime;\n\n static async provider(\n [\n workspace,\n cli,\n graphql,\n envs,\n aspectLoader,\n newComponentHelper,\n componentAspect,\n tracker,\n loggerMain,\n git,\n wsConfigFiles,\n deprecation,\n ]: [\n Workspace,\n CLIMain,\n GraphqlMain,\n EnvsMain,\n AspectLoaderMain,\n NewComponentHelperMain,\n ComponentMain,\n TrackerMain,\n LoggerMain,\n GitMain,\n WorkspaceConfigFilesMain,\n DeprecationMain\n ],\n config: GeneratorConfig,\n [componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot]: [\n ComponentTemplateSlot,\n WorkspaceTemplateSlot,\n OnComponentCreateSlot\n ]\n ) {\n const logger = loggerMain.createLogger(GeneratorAspect.id);\n const generator = new GeneratorMain(\n componentTemplateSlot,\n workspaceTemplateSlot,\n onComponentCreateSlot,\n config,\n workspace,\n envs,\n aspectLoader,\n newComponentHelper,\n componentAspect,\n tracker,\n logger,\n git,\n wsConfigFiles,\n deprecation\n );\n const commands = [new CreateCmd(generator), new TemplatesCmd(generator), new NewCmd(generator)];\n cli.register(...commands);\n graphql.register(generatorSchema(generator));\n aspectLoader.registerPlugins([new StarterPlugin(generator)]);\n envs.registerService(new GeneratorService());\n\n if (generator)\n generator.registerComponentTemplate([\n componentGeneratorTemplate,\n componentGeneratorTemplateStandalone,\n starterTemplate,\n starterTemplateStandalone,\n ]);\n generator.registerWorkspaceTemplate([BasicWorkspaceStarter]);\n\n return generator;\n }\n}\n\nGeneratorAspect.addRuntime(GeneratorMain);\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,KAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA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SAAS,EACXA,SAAS,CAACtD,yBAAyB,CAAC,CAClCqK,wCAA0B,EAC1BC,kDAAoC,EACpCC,6BAAe,EACfC,uCAAyB,CAC1B,CAAC;IACJlH,SAAS,CAACnD,yBAAyB,CAAC,CAACsK,8BAAqB,CAAC,CAAC;IAE5D,OAAOnH,SAAS;EAClB;AACF;AAACoH,OAAA,CAAAnM,aAAA,GAAAA,aAAA;AAAAhB,eAAA,CAviBYgB,aAAa,WA2cT,CACboM,eAAI,CAACC,QAAQ,CAAsB,CAAC,EACpCD,eAAI,CAACC,QAAQ,CAAsB,CAAC,EACpCD,eAAI,CAACC,QAAQ,CAAsB,CAAC,CACrC;AAAArN,eAAA,CA/cUgB,aAAa,kBAidF,CACpBuE,4BAAe,EACf+H,gBAAS,EACTC,wBAAa,EACb7I,kBAAU,EACV8I,kCAAkB,EAClBC,8CAAwB,EACxBC,4BAAe,EACfC,wBAAa,EACbC,sBAAY,EACZC,gBAAS,EACTC,kDAA0B,EAC1BC,gCAAiB,CAClB;AAAA/N,eAAA,CA9dUgB,aAAa,aAgePgN,kBAAW;AAyE9BxJ,4BAAe,CAACyJ,UAAU,CAACjN,aAAa,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.generator_generator@1.0.393/dist/generator.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.generator_generator@1.0.393/dist/generator.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.generator_generator@1.0.395/dist/generator.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.generator_generator@1.0.395/dist/generator.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/generator",
3
- "version": "1.0.393",
3
+ "version": "1.0.395",
4
4
  "homepage": "https://bit.cloud/teambit/generator/generator",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.generator",
8
8
  "name": "generator",
9
- "version": "1.0.393"
9
+ "version": "1.0.395"
10
10
  },
11
11
  "dependencies": {
12
12
  "camelcase": "6.2.0",
@@ -21,30 +21,31 @@
21
21
  "@teambit/component-id": "1.2.0",
22
22
  "@teambit/harmony": "0.4.6",
23
23
  "@teambit/git.modules.git-ignore": "1.0.2",
24
- "@teambit/component.sources": "0.0.21",
25
- "@teambit/envs": "1.0.392",
26
- "@teambit/logger": "0.0.1062",
27
- "@teambit/new-component-helper": "1.0.392",
24
+ "@teambit/component.sources": "0.0.22",
25
+ "@teambit/envs": "1.0.394",
26
+ "@teambit/logger": "0.0.1064",
27
+ "@teambit/new-component-helper": "1.0.394",
28
28
  "@teambit/pkg.modules.component-package-name": "0.0.3",
29
29
  "@teambit/toolbox.path.path": "0.0.2",
30
- "@teambit/tracker": "1.0.392",
31
- "@teambit/workspace-config-files": "1.0.392",
32
- "@teambit/workspace.modules.node-modules-linker": "0.0.196",
33
- "@teambit/workspace": "1.0.392",
34
- "@teambit/component": "1.0.392",
35
- "@teambit/cli": "0.0.969",
36
- "@teambit/graphql": "1.0.392",
37
- "@teambit/aspect-loader": "1.0.392",
38
- "@teambit/bit": "1.8.43",
39
- "@teambit/git": "1.0.392",
40
- "@teambit/compiler": "1.0.392",
41
- "@teambit/forking": "1.0.392",
30
+ "@teambit/tracker": "1.0.394",
31
+ "@teambit/workspace-config-files": "1.0.394",
32
+ "@teambit/workspace.modules.node-modules-linker": "0.0.197",
33
+ "@teambit/workspace": "1.0.394",
34
+ "@teambit/component": "1.0.394",
35
+ "@teambit/cli": "0.0.971",
36
+ "@teambit/graphql": "1.0.394",
37
+ "@teambit/aspect-loader": "1.0.394",
38
+ "@teambit/bit": "1.8.45",
39
+ "@teambit/deprecation": "1.0.394",
40
+ "@teambit/git": "1.0.394",
41
+ "@teambit/compiler": "1.0.394",
42
+ "@teambit/forking": "1.0.394",
42
43
  "@teambit/git.modules.git-executable": "0.0.1",
43
- "@teambit/host-initializer": "0.0.105",
44
- "@teambit/importer": "1.0.392",
45
- "@teambit/install": "1.0.392",
46
- "@teambit/ui": "1.0.392",
47
- "@teambit/config": "0.0.1143"
44
+ "@teambit/host-initializer": "0.0.107",
45
+ "@teambit/importer": "1.0.394",
46
+ "@teambit/install": "1.0.394",
47
+ "@teambit/ui": "1.0.394",
48
+ "@teambit/config": "0.0.1145"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@types/fs-extra": "9.0.7",