@teambit/generator 0.0.1136 → 0.0.1138

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.
@@ -4,8 +4,10 @@ import { Logger } from '@teambit/logger';
4
4
  import { TrackerMain } from '@teambit/tracker';
5
5
  import { NewComponentHelperMain } from '@teambit/new-component-helper';
6
6
  import { ComponentID } from '@teambit/component-id';
7
+ import { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';
7
8
  import { ComponentTemplate } from './component-template';
8
9
  import { CreateOptions } from './create.cmd';
10
+ import { OnComponentCreateSlot } from './generator.main.runtime';
9
11
  export declare type GenerateResult = {
10
12
  id: ComponentID;
11
13
  dir: string;
@@ -14,6 +16,7 @@ export declare type GenerateResult = {
14
16
  envSetBy: string;
15
17
  packageName: string;
16
18
  };
19
+ export declare type OnComponentCreateFn = (generateResults: GenerateResult[]) => Promise<void>;
17
20
  export declare class ComponentGenerator {
18
21
  private workspace;
19
22
  private componentIds;
@@ -22,11 +25,23 @@ export declare class ComponentGenerator {
22
25
  private envs;
23
26
  private newComponentHelper;
24
27
  private tracker;
28
+ private wsConfigFiles;
25
29
  private logger;
30
+ private onComponentCreateSlot;
26
31
  private aspectId;
27
32
  private envId?;
28
- constructor(workspace: Workspace, componentIds: ComponentID[], options: CreateOptions, template: ComponentTemplate, envs: EnvsMain, newComponentHelper: NewComponentHelperMain, tracker: TrackerMain, logger: Logger, aspectId: string, envId?: ComponentID | undefined);
33
+ constructor(workspace: Workspace, componentIds: ComponentID[], options: CreateOptions, template: ComponentTemplate, envs: EnvsMain, newComponentHelper: NewComponentHelperMain, tracker: TrackerMain, wsConfigFiles: WorkspaceConfigFilesMain, logger: Logger, onComponentCreateSlot: OnComponentCreateSlot, aspectId: string, envId?: ComponentID | undefined);
29
34
  generate(): Promise<GenerateResult[]>;
35
+ private tryLinkToNodeModules;
36
+ private runOnComponentCreateHook;
37
+ /**
38
+ * The function `tryWriteConfigFiles` attempts to write workspace config files, and if it fails, it logs an error
39
+ * message.
40
+ * @returns If the condition `!shouldWrite` is true, then nothing is being returned. Otherwise, if the `writeConfigFiles`
41
+ * function is successfully executed, nothing is being returned. If an error occurs during the execution of
42
+ * `writeConfigFiles`, an error message is being returned.
43
+ */
44
+ private tryWriteConfigFiles;
30
45
  private deleteGeneratedComponents;
31
46
  private generateOneComponent;
32
47
  private addEnvIfProvidedByFlag;
@@ -92,7 +92,7 @@ function _componentId() {
92
92
  return data;
93
93
  }
94
94
  class ComponentGenerator {
95
- constructor(workspace, componentIds, options, template, envs, newComponentHelper, tracker, logger, aspectId, envId) {
95
+ constructor(workspace, componentIds, options, template, envs, newComponentHelper, tracker, wsConfigFiles, logger, onComponentCreateSlot, aspectId, envId) {
96
96
  this.workspace = workspace;
97
97
  this.componentIds = componentIds;
98
98
  this.options = options;
@@ -100,7 +100,9 @@ class ComponentGenerator {
100
100
  this.envs = envs;
101
101
  this.newComponentHelper = newComponentHelper;
102
102
  this.tracker = tracker;
103
+ this.wsConfigFiles = wsConfigFiles;
103
104
  this.logger = logger;
105
+ this.onComponentCreateSlot = onComponentCreateSlot;
104
106
  this.aspectId = aspectId;
105
107
  this.envId = envId;
106
108
  }
@@ -108,7 +110,7 @@ class ComponentGenerator {
108
110
  const dirsToDeleteIfFailed = [];
109
111
  const generateResults = await (0, _pMapSeries().default)(this.componentIds, async componentId => {
110
112
  try {
111
- const componentPath = this.newComponentHelper.getNewComponentPath(componentId, this.options.path);
113
+ const componentPath = this.newComponentHelper.getNewComponentPath(componentId, this.options.path, this.componentIds.length);
112
114
  if (_fsExtra().default.existsSync(_path().default.join(this.workspace.path, componentPath))) {
113
115
  throw new (_bitError().BitError)(`unable to create a component at "${componentPath}", this path already exist`);
114
116
  }
@@ -124,12 +126,47 @@ class ComponentGenerator {
124
126
  });
125
127
  await this.workspace.bitMap.write();
126
128
  const ids = generateResults.map(r => r.id);
129
+ await this.tryLinkToNodeModules(ids);
130
+ await this.runOnComponentCreateHook(generateResults);
131
+ // We are running this after the runOnComponentCreateHook as it require
132
+ // the env to be installed to work properly, and the hook might install
133
+ // the env.
134
+ await this.tryWriteConfigFiles(ids);
135
+ return generateResults;
136
+ }
137
+ async tryLinkToNodeModules(ids) {
127
138
  try {
128
139
  await (0, _workspaceModules().linkToNodeModulesByIds)(this.workspace, ids.map(id => id._legacy));
129
140
  } catch (err) {
130
141
  this.logger.consoleFailure(`failed linking the new components to node_modules, please run "bit link" manually. error: ${err.message}`);
131
142
  }
132
- return generateResults;
143
+ }
144
+ async runOnComponentCreateHook(generateResults) {
145
+ const fns = this.onComponentCreateSlot.values();
146
+ if (!fns.length) return;
147
+ await Promise.all(fns.map(fn => fn(generateResults)));
148
+ }
149
+
150
+ /**
151
+ * The function `tryWriteConfigFiles` attempts to write workspace config files, and if it fails, it logs an error
152
+ * message.
153
+ * @returns If the condition `!shouldWrite` is true, then nothing is being returned. Otherwise, if the `writeConfigFiles`
154
+ * function is successfully executed, nothing is being returned. If an error occurs during the execution of
155
+ * `writeConfigFiles`, an error message is being returned.
156
+ */
157
+ async tryWriteConfigFiles(ids) {
158
+ try {
159
+ const shouldWrite = this.wsConfigFiles.isWorkspaceConfigWriteEnabled();
160
+ if (!shouldWrite) return;
161
+ ids.map(id => this.workspace.clearComponentCache(id));
162
+ await this.wsConfigFiles.writeConfigFiles({
163
+ clean: true,
164
+ silent: true,
165
+ dedupe: true
166
+ });
167
+ } catch (err) {
168
+ this.logger.consoleFailure(`failed generating workspace config files, please run "bit ws-config write" manually. error: ${err.message}`);
169
+ }
133
170
  }
134
171
  async deleteGeneratedComponents(dirs) {
135
172
  await Promise.all(dirs.map(async dir => {
@@ -1 +1 @@
1
- {"version":3,"names":["_vinyl","data","_interopRequireDefault","require","_fsExtra","_pMapSeries","_path","_envs","_camelcase","_bitError","_workspaceModules","_sources","_componentIdToPackageName","_dataToPersist","_componentId","ComponentGenerator","constructor","workspace","componentIds","options","template","envs","newComponentHelper","tracker","logger","aspectId","envId","generate","dirsToDeleteIfFailed","generateResults","pMapSeries","componentId","componentPath","getNewComponentPath","path","fs","existsSync","join","BitError","hasName","fullName","push","generateOneComponent","err","deleteGeneratedComponents","bitMap","write","ids","map","r","id","linkToNodeModulesByIds","_legacy","consoleFailure","message","dirs","Promise","all","dir","absoluteDir","remove","code","_config","_config$EnvsAspect$id","name","namePascalCase","camelcase","pascalCase","nameCamelCase","ComponentID","fromString","files","generateFiles","mainFile","find","file","isMain","writeComponentFiles","addResults","track","rootDir","relativePath","componentName","defaultScope","scope","component","get","hasEnvConfiguredOriginally","hasEnvConfigured","envBeforeConfigChanges","getEnv","config","_this$template$config","boundConfig","bind","isInWorkspace","exists","toStringWithoutVersion","toString","env","templateEnv","EnvsAspect","Object","keys","length","undefined","configWithEnv","addEnvIfProvidedByFlag","setEntireConfig","getEnvData","_config2","_config2$EnvsAspect$i","envFromFlag","envFromTemplate","setBy","packageName","componentIdToPackageName","state","_consumer","envSetBy","_config3","_config3$EnvsAspect$i","userEnv","addEnvToConfig","templateFiles","dataToPersist","DataToPersist","vinylFiles","templateFile","templateFileVinyl","Vinyl","base","contents","Buffer","from","content","AbstractVinyl","fromVinyl","results","v","addManyFiles","addBasePath","persistAllToFS","exports"],"sources":["component-generator.ts"],"sourcesContent":["import Vinyl from 'vinyl';\nimport fs from 'fs-extra';\nimport pMapSeries from 'p-map-series';\nimport path from 'path';\nimport { Workspace } from '@teambit/workspace';\nimport EnvsAspect, { EnvsMain } from '@teambit/envs';\nimport camelcase from 'camelcase';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { TrackerMain } from '@teambit/tracker';\nimport { linkToNodeModulesByIds } from '@teambit/workspace.modules.node-modules-linker';\nimport { PathOsBasedRelative } from '@teambit/legacy/dist/utils/path';\nimport { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport { NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { ComponentID } from '@teambit/component-id';\nimport { ComponentTemplate, ComponentFile, ComponentConfig } from './component-template';\nimport { CreateOptions } from './create.cmd';\n\nexport type GenerateResult = {\n id: ComponentID;\n dir: string;\n files: string[];\n envId: string;\n envSetBy: string;\n packageName: string;\n};\n\nexport class ComponentGenerator {\n constructor(\n private workspace: Workspace,\n private componentIds: ComponentID[],\n private options: CreateOptions,\n private template: ComponentTemplate,\n private envs: EnvsMain,\n private newComponentHelper: NewComponentHelperMain,\n private tracker: TrackerMain,\n private logger: Logger,\n private aspectId: string,\n private envId?: ComponentID\n ) {}\n\n async generate(): Promise<GenerateResult[]> {\n const dirsToDeleteIfFailed: string[] = [];\n const generateResults = await pMapSeries(this.componentIds, async (componentId) => {\n try {\n const componentPath = this.newComponentHelper.getNewComponentPath(componentId, this.options.path);\n if (fs.existsSync(path.join(this.workspace.path, componentPath))) {\n throw new BitError(`unable to create a component at \"${componentPath}\", this path already exist`);\n }\n if (await this.workspace.hasName(componentId.fullName)) {\n throw new BitError(\n `unable to create a component \"${componentId.fullName}\", a component with the same name already exist`\n );\n }\n dirsToDeleteIfFailed.push(componentPath);\n return await this.generateOneComponent(componentId, componentPath);\n } catch (err: any) {\n await this.deleteGeneratedComponents(dirsToDeleteIfFailed);\n throw err;\n }\n });\n\n await this.workspace.bitMap.write();\n\n const ids = generateResults.map((r) => r.id);\n try {\n await linkToNodeModulesByIds(\n this.workspace,\n ids.map((id) => id._legacy)\n );\n } catch (err: any) {\n this.logger.consoleFailure(\n `failed linking the new components to node_modules, please run \"bit link\" manually. error: ${err.message}`\n );\n }\n\n return generateResults;\n }\n\n private async deleteGeneratedComponents(dirs: string[]) {\n await Promise.all(\n dirs.map(async (dir) => {\n const absoluteDir = path.join(this.workspace.path, dir);\n try {\n await fs.remove(absoluteDir);\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n // if not exist, it's fine\n throw err;\n }\n }\n })\n );\n }\n\n private async generateOneComponent(componentId: ComponentID, componentPath: string): Promise<GenerateResult> {\n const name = componentId.name;\n const namePascalCase = camelcase(name, { pascalCase: true });\n const nameCamelCase = camelcase(name);\n const aspectId = ComponentID.fromString(this.aspectId);\n\n const files = await this.template.generateFiles({\n name,\n namePascalCase,\n nameCamelCase,\n componentId,\n aspectId,\n envId: this.envId,\n });\n const mainFile = files.find((file) => file.isMain);\n await this.writeComponentFiles(componentPath, files);\n const addResults = await this.tracker.track({\n rootDir: componentPath,\n mainFile: mainFile?.relativePath,\n componentName: componentId.fullName,\n defaultScope: this.options.scope,\n });\n const component = await this.workspace.get(componentId);\n const hasEnvConfiguredOriginally = this.envs.hasEnvConfigured(component);\n const envBeforeConfigChanges = this.envs.getEnv(component);\n let config = this.template.config;\n if (config && typeof config === 'function') {\n const boundConfig = this.template.config?.bind(this.template);\n config = boundConfig({ aspectId: this.aspectId });\n }\n\n if (!config && this.envId) {\n const isInWorkspace = this.workspace.exists(this.envId);\n config = {\n [isInWorkspace ? this.envId.toStringWithoutVersion() : this.envId.toString()]: {},\n 'teambit.envs/envs': {\n env: this.envId.toStringWithoutVersion(),\n },\n };\n }\n\n const templateEnv = config?.[EnvsAspect.id]?.env;\n\n if (config && templateEnv && hasEnvConfiguredOriginally) {\n // remove the env we got from the template.\n delete config[templateEnv];\n delete config[EnvsAspect.id].env;\n if (Object.keys(config[EnvsAspect.id]).length === 0) delete config[EnvsAspect.id];\n if (Object.keys(config).length === 0) config = undefined;\n }\n\n const configWithEnv = await this.addEnvIfProvidedByFlag(config);\n if (configWithEnv) this.workspace.bitMap.setEntireConfig(component.id, configWithEnv);\n\n const getEnvData = () => {\n const envFromFlag = this.options.env; // env entered by the user when running `bit create --env`\n const envFromTemplate = config?.[EnvsAspect.id]?.env;\n if (envFromFlag) {\n return {\n envId: envFromFlag,\n setBy: '--env flag',\n };\n }\n if (envFromTemplate) {\n return {\n envId: envFromTemplate,\n setBy: 'template',\n };\n }\n return {\n envId: envBeforeConfigChanges.id,\n setBy: hasEnvConfiguredOriginally ? 'workspace variants' : '<default>',\n };\n };\n const { envId, setBy } = getEnvData();\n return {\n id: componentId,\n dir: componentPath,\n files: addResults.files,\n packageName: componentIdToPackageName(component.state._consumer),\n envId,\n envSetBy: setBy,\n };\n }\n\n private async addEnvIfProvidedByFlag(config?: ComponentConfig): Promise<ComponentConfig | undefined> {\n const userEnv = this.options.env; // env entered by the user when running `bit create --env`\n const templateEnv = config?.[EnvsAspect.id]?.env;\n if (!userEnv || userEnv === templateEnv) {\n return config;\n }\n config = config || {};\n if (templateEnv) {\n // the component template has an env and the user wants a different env.\n delete config[templateEnv];\n }\n await this.tracker.addEnvToConfig(userEnv, config);\n\n return config;\n }\n\n /**\n * writes the generated template files to the default directory set in the workspace config\n */\n private async writeComponentFiles(\n componentPath: string,\n templateFiles: ComponentFile[]\n ): Promise<PathOsBasedRelative[]> {\n const dataToPersist = new DataToPersist();\n const vinylFiles = templateFiles.map((templateFile) => {\n const templateFileVinyl = new Vinyl({\n base: componentPath,\n path: path.join(componentPath, templateFile.relativePath),\n contents: Buffer.from(templateFile.content),\n });\n return AbstractVinyl.fromVinyl(templateFileVinyl);\n });\n const results = vinylFiles.map((v) => v.path);\n dataToPersist.addManyFiles(vinylFiles);\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\n return results;\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,WAAA,YAAAA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IAAKA,CAAC,CAACzG,IAAI,CAAC;IAC7C2F,aAAa,CAACe,YAAY,CAACb,UAAU,CAAC;IACtCF,aAAa,CAACgB,WAAW,CAAC,IAAI,CAAC5H,SAAS,CAACiB,IAAI,CAAC;IAC9C,MAAM2F,aAAa,CAACiB,cAAc,CAAC,CAAC;IACpC,OAAOJ,OAAO;EAChB;AACF;AAACK,OAAA,CAAAhI,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"names":["_vinyl","data","_interopRequireDefault","require","_fsExtra","_pMapSeries","_path","_envs","_camelcase","_bitError","_workspaceModules","_sources","_componentIdToPackageName","_dataToPersist","_componentId","ComponentGenerator","constructor","workspace","componentIds","options","template","envs","newComponentHelper","tracker","wsConfigFiles","logger","onComponentCreateSlot","aspectId","envId","generate","dirsToDeleteIfFailed","generateResults","pMapSeries","componentId","componentPath","getNewComponentPath","path","length","fs","existsSync","join","BitError","hasName","fullName","push","generateOneComponent","err","deleteGeneratedComponents","bitMap","write","ids","map","r","id","tryLinkToNodeModules","runOnComponentCreateHook","tryWriteConfigFiles","linkToNodeModulesByIds","_legacy","consoleFailure","message","fns","values","Promise","all","fn","shouldWrite","isWorkspaceConfigWriteEnabled","clearComponentCache","writeConfigFiles","clean","silent","dedupe","dirs","dir","absoluteDir","remove","code","_config","_config$EnvsAspect$id","name","namePascalCase","camelcase","pascalCase","nameCamelCase","ComponentID","fromString","files","generateFiles","mainFile","find","file","isMain","writeComponentFiles","addResults","track","rootDir","relativePath","componentName","defaultScope","scope","component","get","hasEnvConfiguredOriginally","hasEnvConfigured","envBeforeConfigChanges","getEnv","config","_this$template$config","boundConfig","bind","isInWorkspace","exists","toStringWithoutVersion","toString","env","templateEnv","EnvsAspect","Object","keys","undefined","configWithEnv","addEnvIfProvidedByFlag","setEntireConfig","getEnvData","_config2","_config2$EnvsAspect$i","envFromFlag","envFromTemplate","setBy","packageName","componentIdToPackageName","state","_consumer","envSetBy","_config3","_config3$EnvsAspect$i","userEnv","addEnvToConfig","templateFiles","dataToPersist","DataToPersist","vinylFiles","templateFile","templateFileVinyl","Vinyl","base","contents","Buffer","from","content","AbstractVinyl","fromVinyl","results","v","addManyFiles","addBasePath","persistAllToFS","exports"],"sources":["component-generator.ts"],"sourcesContent":["import Vinyl from 'vinyl';\nimport fs from 'fs-extra';\nimport pMapSeries from 'p-map-series';\nimport path from 'path';\nimport { Workspace } from '@teambit/workspace';\nimport EnvsAspect, { EnvsMain } from '@teambit/envs';\nimport camelcase from 'camelcase';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { TrackerMain } from '@teambit/tracker';\nimport { linkToNodeModulesByIds } from '@teambit/workspace.modules.node-modules-linker';\nimport { PathOsBasedRelative } from '@teambit/legacy/dist/utils/path';\nimport { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport { NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { ComponentID } from '@teambit/component-id';\nimport { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\n\nimport { ComponentTemplate, ComponentFile, ComponentConfig } from './component-template';\nimport { CreateOptions } from './create.cmd';\nimport { OnComponentCreateSlot } from './generator.main.runtime';\n\nexport type GenerateResult = {\n id: ComponentID;\n dir: string;\n files: string[];\n envId: string;\n envSetBy: string;\n packageName: string;\n};\n\nexport type OnComponentCreateFn = (generateResults: GenerateResult[]) => Promise<void>;\n\nexport class ComponentGenerator {\n constructor(\n private workspace: Workspace,\n private componentIds: ComponentID[],\n private options: CreateOptions,\n private template: ComponentTemplate,\n private envs: EnvsMain,\n private newComponentHelper: NewComponentHelperMain,\n private tracker: TrackerMain,\n private wsConfigFiles: WorkspaceConfigFilesMain,\n private logger: Logger,\n private onComponentCreateSlot: OnComponentCreateSlot,\n private aspectId: string,\n private envId?: ComponentID\n ) {}\n\n async generate(): Promise<GenerateResult[]> {\n const dirsToDeleteIfFailed: string[] = [];\n const generateResults = await pMapSeries(this.componentIds, async (componentId) => {\n try {\n const componentPath = this.newComponentHelper.getNewComponentPath(\n componentId,\n this.options.path,\n this.componentIds.length\n );\n if (fs.existsSync(path.join(this.workspace.path, componentPath))) {\n throw new BitError(`unable to create a component at \"${componentPath}\", this path already exist`);\n }\n if (await this.workspace.hasName(componentId.fullName)) {\n throw new BitError(\n `unable to create a component \"${componentId.fullName}\", a component with the same name already exist`\n );\n }\n dirsToDeleteIfFailed.push(componentPath);\n return await this.generateOneComponent(componentId, componentPath);\n } catch (err: any) {\n await this.deleteGeneratedComponents(dirsToDeleteIfFailed);\n throw err;\n }\n });\n\n await this.workspace.bitMap.write();\n\n const ids = generateResults.map((r) => r.id);\n await this.tryLinkToNodeModules(ids);\n await this.runOnComponentCreateHook(generateResults);\n // We are running this after the runOnComponentCreateHook as it require\n // the env to be installed to work properly, and the hook might install\n // the env.\n await this.tryWriteConfigFiles(ids);\n\n return generateResults;\n }\n\n private async tryLinkToNodeModules(ids: ComponentID[]) {\n try {\n await linkToNodeModulesByIds(\n this.workspace,\n ids.map((id) => id._legacy)\n );\n } catch (err: any) {\n this.logger.consoleFailure(\n `failed linking the new components to node_modules, please run \"bit link\" manually. error: ${err.message}`\n );\n }\n }\n\n private async runOnComponentCreateHook(generateResults: GenerateResult[]) {\n const fns = this.onComponentCreateSlot.values();\n if (!fns.length) return;\n await Promise.all(fns.map((fn) => fn(generateResults)));\n }\n\n /**\n * The function `tryWriteConfigFiles` attempts to write workspace config files, and if it fails, it logs an error\n * message.\n * @returns If the condition `!shouldWrite` is true, then nothing is being returned. Otherwise, if the `writeConfigFiles`\n * function is successfully executed, nothing is being returned. If an error occurs during the execution of\n * `writeConfigFiles`, an error message is being returned.\n */\n private async tryWriteConfigFiles(ids: ComponentID[]) {\n try {\n const shouldWrite = this.wsConfigFiles.isWorkspaceConfigWriteEnabled();\n if (!shouldWrite) return;\n ids.map((id) => this.workspace.clearComponentCache(id));\n await this.wsConfigFiles.writeConfigFiles({\n clean: true,\n silent: true,\n dedupe: true,\n });\n } catch (err: any) {\n this.logger.consoleFailure(\n `failed generating workspace config files, please run \"bit ws-config write\" manually. error: ${err.message}`\n );\n }\n }\n\n private async deleteGeneratedComponents(dirs: string[]) {\n await Promise.all(\n dirs.map(async (dir) => {\n const absoluteDir = path.join(this.workspace.path, dir);\n try {\n await fs.remove(absoluteDir);\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n // if not exist, it's fine\n throw err;\n }\n }\n })\n );\n }\n\n private async generateOneComponent(componentId: ComponentID, componentPath: string): Promise<GenerateResult> {\n const name = componentId.name;\n const namePascalCase = camelcase(name, { pascalCase: true });\n const nameCamelCase = camelcase(name);\n const aspectId = ComponentID.fromString(this.aspectId);\n\n const files = await this.template.generateFiles({\n name,\n namePascalCase,\n nameCamelCase,\n componentId,\n aspectId,\n envId: this.envId,\n });\n const mainFile = files.find((file) => file.isMain);\n await this.writeComponentFiles(componentPath, files);\n const addResults = await this.tracker.track({\n rootDir: componentPath,\n mainFile: mainFile?.relativePath,\n componentName: componentId.fullName,\n defaultScope: this.options.scope,\n });\n const component = await this.workspace.get(componentId);\n const hasEnvConfiguredOriginally = this.envs.hasEnvConfigured(component);\n const envBeforeConfigChanges = this.envs.getEnv(component);\n let config = this.template.config;\n if (config && typeof config === 'function') {\n const boundConfig = this.template.config?.bind(this.template);\n config = boundConfig({ aspectId: this.aspectId });\n }\n\n if (!config && this.envId) {\n const isInWorkspace = this.workspace.exists(this.envId);\n config = {\n [isInWorkspace ? this.envId.toStringWithoutVersion() : this.envId.toString()]: {},\n 'teambit.envs/envs': {\n env: this.envId.toStringWithoutVersion(),\n },\n };\n }\n\n const templateEnv = config?.[EnvsAspect.id]?.env;\n\n if (config && templateEnv && hasEnvConfiguredOriginally) {\n // remove the env we got from the template.\n delete config[templateEnv];\n delete config[EnvsAspect.id].env;\n if (Object.keys(config[EnvsAspect.id]).length === 0) delete config[EnvsAspect.id];\n if (Object.keys(config).length === 0) config = undefined;\n }\n\n const configWithEnv = await this.addEnvIfProvidedByFlag(config);\n if (configWithEnv) this.workspace.bitMap.setEntireConfig(component.id, configWithEnv);\n\n const getEnvData = () => {\n const envFromFlag = this.options.env; // env entered by the user when running `bit create --env`\n const envFromTemplate = config?.[EnvsAspect.id]?.env;\n if (envFromFlag) {\n return {\n envId: envFromFlag,\n setBy: '--env flag',\n };\n }\n if (envFromTemplate) {\n return {\n envId: envFromTemplate,\n setBy: 'template',\n };\n }\n return {\n envId: envBeforeConfigChanges.id,\n setBy: hasEnvConfiguredOriginally ? 'workspace variants' : '<default>',\n };\n };\n const { envId, setBy } = getEnvData();\n return {\n id: componentId,\n dir: componentPath,\n files: addResults.files,\n packageName: componentIdToPackageName(component.state._consumer),\n envId,\n envSetBy: setBy,\n };\n }\n\n private async addEnvIfProvidedByFlag(config?: ComponentConfig): Promise<ComponentConfig | undefined> {\n const userEnv = this.options.env; // env entered by the user when running `bit create --env`\n const templateEnv = config?.[EnvsAspect.id]?.env;\n if (!userEnv || userEnv === templateEnv) {\n return config;\n }\n config = config || {};\n if (templateEnv) {\n // the component template has an env and the user wants a different env.\n delete config[templateEnv];\n }\n await this.tracker.addEnvToConfig(userEnv, config);\n\n return config;\n }\n\n /**\n * writes the generated template files to the default directory set in the workspace config\n */\n private async writeComponentFiles(\n componentPath: string,\n templateFiles: ComponentFile[]\n ): Promise<PathOsBasedRelative[]> {\n const dataToPersist = new DataToPersist();\n const vinylFiles = templateFiles.map((templateFile) => {\n const templateFileVinyl = new Vinyl({\n base: componentPath,\n path: path.join(componentPath, templateFile.relativePath),\n contents: Buffer.from(templateFile.content),\n });\n return AbstractVinyl.fromVinyl(templateFileVinyl);\n });\n const results = vinylFiles.map((v) => v.path);\n dataToPersist.addManyFiles(vinylFiles);\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\n return results;\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,OAAA;E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iB,GAAG,KAAIC,gBAAK,EAAC;QAClCC,IAAI,EAAEhH,aAAa;QACnBE,IAAI,EAAEA,eAAI,CAACI,IAAI,CAACN,aAAa,EAAE6G,YAAY,CAAC9C,YAAY,CAAC;QACzDkD,QAAQ,EAAEC,MAAM,CAACC,IAAI,CAACN,YAAY,CAACO,OAAO;MAC5C,CAAC,CAAC;MACF,OAAOC,wBAAa,CAACC,SAAS,CAACR,iBAAiB,CAAC;IACnD,CAAC,CAAC;IACF,MAAMS,OAAO,GAAGX,UAAU,CAAC3F,GAAG,CAAEuG,CAAC,IAAKA,CAAC,CAACtH,IAAI,CAAC;IAC7CwG,aAAa,CAACe,YAAY,CAACb,UAAU,CAAC;IACtCF,aAAa,CAACgB,WAAW,CAAC,IAAI,CAAC3I,SAAS,CAACmB,IAAI,CAAC;IAC9C,MAAMwG,aAAa,CAACiB,cAAc,CAAC,CAAC;IACpC,OAAOJ,OAAO;EAChB;AACF;AAACK,OAAA,CAAA/I,kBAAA,GAAAA,kBAAA"}
@@ -3,6 +3,7 @@ import { CLIMain } from '@teambit/cli';
3
3
  import { Workspace } from '@teambit/workspace';
4
4
  import { EnvDefinition, EnvsMain } from '@teambit/envs';
5
5
  import type { CommunityMain } from '@teambit/community';
6
+ import { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';
6
7
  import type { ComponentMain, Component } from '@teambit/component';
7
8
  import { SlotRegistry } from '@teambit/harmony';
8
9
  import { GitMain } from '@teambit/git';
@@ -12,11 +13,12 @@ import { NewComponentHelperMain } from '@teambit/new-component-helper';
12
13
  import { Logger, LoggerMain } from '@teambit/logger';
13
14
  import { ComponentTemplate } from './component-template';
14
15
  import { CreateOptions } from './create.cmd';
15
- import { GenerateResult } from './component-generator';
16
+ import { GenerateResult, OnComponentCreateFn } from './component-generator';
16
17
  import { WorkspaceTemplate } from './workspace-template';
17
18
  import { NewOptions } from './new.cmd';
18
19
  export declare type ComponentTemplateSlot = SlotRegistry<ComponentTemplate[]>;
19
20
  export declare type WorkspaceTemplateSlot = SlotRegistry<WorkspaceTemplate[]>;
21
+ export declare type OnComponentCreateSlot = SlotRegistry<OnComponentCreateFn>;
20
22
  export declare type TemplateDescriptor = {
21
23
  aspectId: string;
22
24
  titlePrefix?: string;
@@ -56,6 +58,7 @@ export declare type GeneratorConfig = {
56
58
  export declare class GeneratorMain {
57
59
  private componentTemplateSlot;
58
60
  private workspaceTemplateSlot;
61
+ private onComponentCreateSlot;
59
62
  private config;
60
63
  private workspace;
61
64
  private envs;
@@ -65,8 +68,9 @@ export declare class GeneratorMain {
65
68
  private tracker;
66
69
  private logger;
67
70
  private git;
71
+ private wsConfigFiles;
68
72
  private aspectLoaded;
69
- constructor(componentTemplateSlot: ComponentTemplateSlot, workspaceTemplateSlot: WorkspaceTemplateSlot, config: GeneratorConfig, workspace: Workspace, envs: EnvsMain, aspectLoader: AspectLoaderMain, newComponentHelper: NewComponentHelperMain, componentAspect: ComponentMain, tracker: TrackerMain, logger: Logger, git: GitMain);
73
+ 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);
70
74
  /**
71
75
  * register a new component template.
72
76
  */
@@ -75,6 +79,7 @@ export declare class GeneratorMain {
75
79
  * register a new component template.
76
80
  */
77
81
  registerWorkspaceTemplate(templates: WorkspaceTemplate[]): this;
82
+ registerOnComponentCreate(fn: OnComponentCreateFn): this;
78
83
  /**
79
84
  * list all component templates registered in the workspace or workspace templates in case the
80
85
  * workspace is not available
@@ -140,10 +145,10 @@ export declare class GeneratorMain {
140
145
  listEnvComponentTemplates(ids?: string[], aspectId?: string): Promise<Array<ComponentTemplateWithId>>;
141
146
  loadEnvs(ids?: string[], remoteEnvsAspect?: EnvsMain): Promise<EnvDefinition[]>;
142
147
  loadAspects(): Promise<void>;
143
- static slots: (((registerFn: () => string) => SlotRegistry<ComponentTemplate[]>) | ((registerFn: () => string) => SlotRegistry<WorkspaceTemplate[]>))[];
148
+ static slots: (((registerFn: () => string) => SlotRegistry<ComponentTemplate[]>) | ((registerFn: () => string) => SlotRegistry<WorkspaceTemplate[]>) | ((registerFn: () => string) => SlotRegistry<OnComponentCreateFn>))[];
144
149
  static dependencies: import("@teambit/bit").Aspect[];
145
150
  static runtime: import("@teambit/bit").RuntimeDefinition;
146
- static provider([workspace, cli, graphql, envs, aspectLoader, newComponentHelper, community, componentAspect, tracker, loggerMain, git,]: [
151
+ static provider([workspace, cli, graphql, envs, aspectLoader, newComponentHelper, community, componentAspect, tracker, loggerMain, git, wsConfigFiles,]: [
147
152
  Workspace,
148
153
  CLIMain,
149
154
  GraphqlMain,
@@ -154,7 +159,12 @@ export declare class GeneratorMain {
154
159
  ComponentMain,
155
160
  TrackerMain,
156
161
  LoggerMain,
157
- GitMain
158
- ], config: GeneratorConfig, [componentTemplateSlot, workspaceTemplateSlot]: [ComponentTemplateSlot, WorkspaceTemplateSlot]): Promise<GeneratorMain>;
162
+ GitMain,
163
+ WorkspaceConfigFilesMain
164
+ ], config: GeneratorConfig, [componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot]: [
165
+ ComponentTemplateSlot,
166
+ WorkspaceTemplateSlot,
167
+ OnComponentCreateSlot
168
+ ]): Promise<GeneratorMain>;
159
169
  }
160
170
  export {};
@@ -60,6 +60,13 @@ function _config() {
60
60
  };
61
61
  return data;
62
62
  }
63
+ function _workspaceConfigFiles() {
64
+ const data = _interopRequireDefault(require("@teambit/workspace-config-files"));
65
+ _workspaceConfigFiles = function () {
66
+ return data;
67
+ };
68
+ return data;
69
+ }
63
70
  function _component() {
64
71
  const data = _interopRequireWildcard(require("@teambit/component"));
65
72
  _component = function () {
@@ -219,9 +226,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
219
226
  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; }
220
227
  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; }
221
228
  class GeneratorMain {
222
- constructor(componentTemplateSlot, workspaceTemplateSlot, config, workspace, envs, aspectLoader, newComponentHelper, componentAspect, tracker, logger, git) {
229
+ constructor(componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot, config, workspace, envs, aspectLoader, newComponentHelper, componentAspect, tracker, logger, git, wsConfigFiles) {
223
230
  this.componentTemplateSlot = componentTemplateSlot;
224
231
  this.workspaceTemplateSlot = workspaceTemplateSlot;
232
+ this.onComponentCreateSlot = onComponentCreateSlot;
225
233
  this.config = config;
226
234
  this.workspace = workspace;
227
235
  this.envs = envs;
@@ -231,6 +239,7 @@ class GeneratorMain {
231
239
  this.tracker = tracker;
232
240
  this.logger = logger;
233
241
  this.git = git;
242
+ this.wsConfigFiles = wsConfigFiles;
234
243
  (0, _defineProperty2().default)(this, "aspectLoaded", false);
235
244
  (0, _defineProperty2().default)(this, "getTemplateDescriptor", ({
236
245
  id,
@@ -265,6 +274,10 @@ class GeneratorMain {
265
274
  this.workspaceTemplateSlot.register(templates);
266
275
  return this;
267
276
  }
277
+ registerOnComponentCreate(fn) {
278
+ this.onComponentCreateSlot.register(fn);
279
+ return this;
280
+ }
268
281
 
269
282
  /**
270
283
  * list all component templates registered in the workspace or workspace templates in case the
@@ -439,7 +452,7 @@ class GeneratorMain {
439
452
  _config().default.componentConfigLoadingRegistry = componentConfigLoadingRegistry;
440
453
  if (!templateWithId) throw new (_bitError().BitError)(`template "${templateName}" was not found`);
441
454
  const componentIds = componentNames.map(componentName => this.newComponentHelper.getNewComponentId(componentName, namespace, options.scope));
442
- const componentGenerator = new (_componentGenerator().ComponentGenerator)(this.workspace, componentIds, options, templateWithId.template, this.envs, this.newComponentHelper, this.tracker, this.logger, templateWithId.id, templateWithId.envName ? _component().ComponentID.fromString(templateWithId.id) : undefined);
455
+ const componentGenerator = new (_componentGenerator().ComponentGenerator)(this.workspace, componentIds, options, templateWithId.template, this.envs, this.newComponentHelper, this.tracker, this.wsConfigFiles, this.logger, this.onComponentCreateSlot, templateWithId.id, templateWithId.envName ? _component().ComponentID.fromString(templateWithId.id) : undefined);
443
456
  return componentGenerator.generate();
444
457
  }
445
458
  async generateWorkspaceTemplate(workspaceName, templateName, options) {
@@ -581,9 +594,9 @@ class GeneratorMain {
581
594
  await this.workspace.loadAspects(this.config.aspects);
582
595
  this.aspectLoaded = true;
583
596
  }
584
- static async provider([workspace, cli, graphql, envs, aspectLoader, newComponentHelper, community, componentAspect, tracker, loggerMain, git], config, [componentTemplateSlot, workspaceTemplateSlot]) {
597
+ static async provider([workspace, cli, graphql, envs, aspectLoader, newComponentHelper, community, componentAspect, tracker, loggerMain, git, wsConfigFiles], config, [componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot]) {
585
598
  const logger = loggerMain.createLogger(_generator().GeneratorAspect.id);
586
- const generator = new GeneratorMain(componentTemplateSlot, workspaceTemplateSlot, config, workspace, envs, aspectLoader, newComponentHelper, componentAspect, tracker, logger, git);
599
+ const generator = new GeneratorMain(componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot, config, workspace, envs, aspectLoader, newComponentHelper, componentAspect, tracker, logger, git, wsConfigFiles);
587
600
  const commands = [new (_create().CreateCmd)(generator, community.getDocsDomain()), new (_templates().TemplatesCmd)(generator), new (_new().NewCmd)(generator)];
588
601
  cli.register(...commands);
589
602
  graphql.register((0, _generator2().generatorSchema)(generator));
@@ -594,8 +607,8 @@ class GeneratorMain {
594
607
  }
595
608
  }
596
609
  exports.GeneratorMain = GeneratorMain;
597
- (0, _defineProperty2().default)(GeneratorMain, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType()]);
598
- (0, _defineProperty2().default)(GeneratorMain, "dependencies", [_workspace().default, _cli().CLIAspect, _graphql().GraphqlAspect, _envs().EnvsAspect, _aspectLoader().default, _newComponentHelper().default, _community().CommunityAspect, _component().default, _tracker().default, _logger().LoggerAspect, _git().default]);
610
+ (0, _defineProperty2().default)(GeneratorMain, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
611
+ (0, _defineProperty2().default)(GeneratorMain, "dependencies", [_workspace().default, _cli().CLIAspect, _graphql().GraphqlAspect, _envs().EnvsAspect, _aspectLoader().default, _newComponentHelper().default, _community().CommunityAspect, _component().default, _tracker().default, _logger().LoggerAspect, _git().default, _workspaceConfigFiles().default]);
599
612
  (0, _defineProperty2().default)(GeneratorMain, "runtime", _cli().MainRuntime);
600
613
  _generator().GeneratorAspect.addRuntime(GeneratorMain);
601
614
 
@@ -1 +1 @@
1
- {"version":3,"names":["_graphql","data","require","_cli","_workspace","_interopRequireWildcard","_envs","_community","_config","_interopRequireDefault","_component","_bit","_harmony","_git","_bitError","_aspectLoader","_tracker","_newComponentHelper","_lodash","_logger","_generator","_create","_templates","_generator2","_componentGenerator","_workspaceGenerator","_new","_componentGenerator2","_workspaceGenerator2","_starter","_starter2","_generator3","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","GeneratorMain","constructor","componentTemplateSlot","workspaceTemplateSlot","config","workspace","envs","aspectLoader","newComponentHelper","componentAspect","tracker","logger","git","id","template","shouldBeHidden","hidden","hideCoreTemplates","isCoreAspect","aspectId","name","description","registerComponentTemplate","templates","register","registerWorkspaceTemplate","listTemplates","aspect","isRunningInsideWorkspace","getAllComponentTemplatesDescriptorsFlattened","getAllWorkspaceTemplatesDescriptorFlattened","listComponentTemplates","opts","Boolean","getComponentTemplateByAspect","getComponentTemplate","fromEnv","listEnvComponentTemplates","found","findTemplateByAspectIdAndName","getAllComponentTemplatesFlattened","find","idWithoutVersion","split","getGlobalGeneratorEnvs","globalScopeHarmony","components","loadAspectsFromGlobalScope","remoteGenerator","GeneratorAspect","remoteEnvsAspect","EnvsAspect","fullAspectId","toString","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","componentGenerator","ComponentGenerator","envName","ComponentID","fromString","undefined","generate","generateWorkspaceTemplate","workspaceName","loadFrom","workspaceGenerator","WorkspaceGenerator","appName","envTemplates","listEnvComponentTemplateDescriptors","filtered","flattened","getTemplateDescriptor","templatesByAspects","toArray","flatMap","componentTemplates","workspaceTemplates","envId","loadEnvs","env","getGeneratorStarters","envStarters","starter","componentId","compact","ids","envTemplate","toStringWithoutVersion","titlePrefix","configEnvs","includes","globals","allIds","concat","getGeneratorTemplates","tpls","host","getHost","envsAspect","potentialEnvs","getEnvDefinition","aspectLoaded","aspects","provider","cli","graphql","community","loggerMain","createLogger","commands","CreateCmd","getDocsDomain","TemplatesCmd","NewCmd","generatorSchema","registerPlugins","StarterPlugin","registerService","GeneratorService","componentGeneratorTemplate","starterTemplate","workspaceGeneratorTemplate","exports","Slot","withType","CLIAspect","GraphqlAspect","AspectLoaderAspect","NewComponentHelperAspect","CommunityAspect","ComponentAspect","TrackerAspect","LoggerAspect","GitAspect","MainRuntime","addRuntime"],"sources":["generator.main.runtime.ts"],"sourcesContent":["import { 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 { CommunityAspect } from '@teambit/community';\nimport type { CommunityMain } from '@teambit/community';\nimport ComponentConfig from '@teambit/legacy/dist/consumer/config';\n\nimport ComponentAspect, { ComponentID } from '@teambit/component';\nimport type { ComponentMain, Component } from '@teambit/component';\n\nimport { isCoreAspect, loadBit } 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 } 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 } from './component-generator';\nimport { WorkspaceGenerator } from './workspace-generator';\nimport { WorkspaceTemplate } from './workspace-template';\nimport { NewCmd, NewOptions } from './new.cmd';\nimport { componentGeneratorTemplate } from './templates/component-generator';\nimport { workspaceGeneratorTemplate } from './templates/workspace-generator';\nimport { starterTemplate } from './templates/starter';\nimport { StarterPlugin } from './starter.plugin';\nimport { GeneratorService } from './generator.service';\n\nexport type ComponentTemplateSlot = SlotRegistry<ComponentTemplate[]>;\nexport type WorkspaceTemplateSlot = SlotRegistry<WorkspaceTemplate[]>;\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 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 ) {}\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 component template.\n */\n registerWorkspaceTemplate(templates: WorkspaceTemplate[]) {\n this.workspaceTemplateSlot.register(templates);\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 } = 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 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(`template \"${name}\" was not found, if this is a custom-template, please use --aspect flag`);\n }\n\n const { workspaceTemplate, aspect } = await this.findWorkspaceTemplateInGlobalScope(aspectId, name);\n if (workspaceTemplate) {\n return { workspaceTemplate, aspect };\n }\n throw new BitError(`template \"${name}\" was not found`);\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: CreateOptions\n ): Promise<GenerateResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n await this.loadAspects();\n const { namespace, aspect: aspectId } = options;\n\n const componentConfigLoadingRegistry = ComponentConfig.componentConfigLoadingRegistry;\n\n const templateWithId = await this.getComponentTemplate(templateName, aspectId);\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 componentGenerator = new ComponentGenerator(\n this.workspace,\n componentIds,\n options,\n templateWithId.template,\n this.envs,\n this.newComponentHelper,\n this.tracker,\n this.logger,\n templateWithId.id,\n templateWithId.envName ? ComponentID.fromString(templateWithId.id) : undefined\n );\n return componentGenerator.generate();\n }\n\n async generateWorkspaceTemplate(\n workspaceName: string,\n templateName: string,\n options: NewOptions\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 { 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, options, workspaceTemplate, aspect);\n const workspacePath = await workspaceGenerator.generate();\n\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 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 = 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 = [Slot.withType<ComponentTemplate[]>(), Slot.withType<WorkspaceTemplate[]>()];\n\n static dependencies = [\n WorkspaceAspect,\n CLIAspect,\n GraphqlAspect,\n EnvsAspect,\n AspectLoaderAspect,\n NewComponentHelperAspect,\n CommunityAspect,\n ComponentAspect,\n TrackerAspect,\n LoggerAspect,\n GitAspect,\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 community,\n componentAspect,\n tracker,\n loggerMain,\n git,\n ]: [\n Workspace,\n CLIMain,\n GraphqlMain,\n EnvsMain,\n AspectLoaderMain,\n NewComponentHelperMain,\n CommunityMain,\n ComponentMain,\n TrackerMain,\n LoggerMain,\n GitMain\n ],\n config: GeneratorConfig,\n [componentTemplateSlot, workspaceTemplateSlot]: [ComponentTemplateSlot, WorkspaceTemplateSlot]\n ) {\n const logger = loggerMain.createLogger(GeneratorAspect.id);\n const generator = new GeneratorMain(\n componentTemplateSlot,\n workspaceTemplateSlot,\n config,\n workspace,\n envs,\n aspectLoader,\n newComponentHelper,\n componentAspect,\n tracker,\n logger,\n git\n );\n const commands = [\n new CreateCmd(generator, community.getDocsDomain()),\n new TemplatesCmd(generator),\n new NewCmd(generator),\n ];\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([componentGeneratorTemplate, starterTemplate, workspaceGeneratorTemplate]);\n return generator;\n }\n}\n\nGeneratorAspect.addRuntime(GeneratorMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAQ,sBAAA,CAAAP,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OA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AA0B,EAAEC,0BAAe,EAAEC,iDAA0B,CAAC,CAAC;IAChH,OAAOvF,SAAS;EAClB;AACF;AAACwF,OAAA,CAAA/J,aAAA,GAAAA,aAAA;AAAA,IAAAH,gBAAA,GAAAjC,OAAA,EAvdYoC,aAAa,WA4YT,CAACgK,eAAI,CAACC,QAAQ,CAAsB,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAsB,CAAC,CAAC;AAAA,IAAApK,gBAAA,GAAAjC,OAAA,EA5YhFoC,aAAa,kBA8YF,CACpB+D,oBAAe,EACfmG,gBAAS,EACTC,wBAAa,EACbhH,kBAAU,EACViH,uBAAkB,EAClBC,6BAAwB,EACxBC,4BAAe,EACfC,oBAAe,EACfC,kBAAa,EACbC,sBAAY,EACZC,cAAS,CACV;AAAA,IAAA7K,gBAAA,GAAAjC,OAAA,EA1ZUoC,aAAa,aA4ZP2K,kBAAW;AA6D9B1H,4BAAe,CAAC2H,UAAU,CAAC5K,aAAa,CAAC"}
1
+ {"version":3,"names":["_graphql","data","require","_cli","_workspace","_interopRequireWildcard","_envs","_community","_config","_interopRequireDefault","_workspaceConfigFiles","_component","_bit","_harmony","_git","_bitError","_aspectLoader","_tracker","_newComponentHelper","_lodash","_logger","_generator","_create","_templates","_generator2","_componentGenerator","_workspaceGenerator","_new","_componentGenerator2","_workspaceGenerator2","_starter","_starter2","_generator3","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","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","getComponentTemplate","fromEnv","listEnvComponentTemplates","found","findTemplateByAspectIdAndName","getAllComponentTemplatesFlattened","find","idWithoutVersion","split","getGlobalGeneratorEnvs","globalScopeHarmony","components","loadAspectsFromGlobalScope","remoteGenerator","GeneratorAspect","remoteEnvsAspect","EnvsAspect","fullAspectId","toString","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","componentGenerator","ComponentGenerator","envName","ComponentID","fromString","undefined","generate","generateWorkspaceTemplate","workspaceName","loadFrom","workspaceGenerator","WorkspaceGenerator","appName","envTemplates","listEnvComponentTemplateDescriptors","filtered","flattened","getTemplateDescriptor","templatesByAspects","toArray","flatMap","componentTemplates","workspaceTemplates","envId","loadEnvs","env","getGeneratorStarters","envStarters","starter","componentId","compact","ids","envTemplate","toStringWithoutVersion","titlePrefix","configEnvs","includes","globals","allIds","concat","getGeneratorTemplates","tpls","host","getHost","envsAspect","potentialEnvs","getEnvDefinition","aspectLoaded","aspects","provider","cli","graphql","community","loggerMain","createLogger","commands","CreateCmd","getDocsDomain","TemplatesCmd","NewCmd","generatorSchema","registerPlugins","StarterPlugin","registerService","GeneratorService","componentGeneratorTemplate","starterTemplate","workspaceGeneratorTemplate","exports","Slot","withType","CLIAspect","GraphqlAspect","AspectLoaderAspect","NewComponentHelperAspect","CommunityAspect","ComponentAspect","TrackerAspect","LoggerAspect","GitAspect","WorkspaceConfigFilesAspect","MainRuntime","addRuntime"],"sources":["generator.main.runtime.ts"],"sourcesContent":["import { 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 { CommunityAspect } from '@teambit/community';\nimport type { CommunityMain } from '@teambit/community';\nimport ComponentConfig from '@teambit/legacy/dist/consumer/config';\nimport WorkspaceConfigFilesAspect, { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\n\nimport ComponentAspect, { ComponentID } from '@teambit/component';\nimport type { ComponentMain, Component } from '@teambit/component';\n\nimport { isCoreAspect, loadBit } 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 } 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 { componentGeneratorTemplate } from './templates/component-generator';\nimport { workspaceGeneratorTemplate } from './templates/workspace-generator';\nimport { starterTemplate } from './templates/starter';\nimport { StarterPlugin } from './starter.plugin';\nimport { GeneratorService } from './generator.service';\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 component template.\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 } = 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 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(`template \"${name}\" was not found, if this is a custom-template, please use --aspect flag`);\n }\n\n const { workspaceTemplate, aspect } = await this.findWorkspaceTemplateInGlobalScope(aspectId, name);\n if (workspaceTemplate) {\n return { workspaceTemplate, aspect };\n }\n throw new BitError(`template \"${name}\" was not found`);\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: CreateOptions\n ): Promise<GenerateResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n await this.loadAspects();\n const { namespace, aspect: aspectId } = options;\n\n const componentConfigLoadingRegistry = ComponentConfig.componentConfigLoadingRegistry;\n\n const templateWithId = await this.getComponentTemplate(templateName, aspectId);\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 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 templateWithId.envName ? ComponentID.fromString(templateWithId.id) : undefined\n );\n return componentGenerator.generate();\n }\n\n async generateWorkspaceTemplate(\n workspaceName: string,\n templateName: string,\n options: NewOptions\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 { 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, options, workspaceTemplate, aspect);\n const workspacePath = await workspaceGenerator.generate();\n\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 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 = 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 CommunityAspect,\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 community,\n componentAspect,\n tracker,\n loggerMain,\n git,\n wsConfigFiles,\n ]: [\n Workspace,\n CLIMain,\n GraphqlMain,\n EnvsMain,\n AspectLoaderMain,\n NewComponentHelperMain,\n CommunityMain,\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 = [\n new CreateCmd(generator, community.getDocsDomain()),\n new TemplatesCmd(generator),\n new NewCmd(generator),\n ];\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([componentGeneratorTemplate, starterTemplate, workspaceGeneratorTemplate]);\n return generator;\n }\n}\n\nGeneratorAspect.addRuntime(GeneratorMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAA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EACViH,uBAAkB,EAClBC,6BAAwB,EACxBC,4BAAe,EACfC,oBAAe,EACfC,kBAAa,EACbC,sBAAY,EACZC,cAAS,EACTC,+BAA0B,CAC3B;AAAA,IAAAlL,gBAAA,GAAAjC,OAAA,EAxaUoC,aAAa,aA0aPgL,kBAAW;AAqE9B3H,4BAAe,CAAC4H,UAAU,CAACjL,aAAa,CAAC"}
package/dist/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export { GeneratorEnv } from './generator-env-type';
5
5
  export { GeneratorAspect } from './generator.aspect';
6
6
  export { TemplateList } from './template-list';
7
7
  export { StarterList } from './starter-list';
8
+ export type { GenerateResult } from './component-generator';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_componentTemplate","data","require","_workspaceTemplate","_generatorEnvType","_generator","_templateList","_starterList"],"sources":["index.ts"],"sourcesContent":["export type { GeneratorMain } from './generator.main.runtime';\nexport {\n ComponentContext,\n ComponentTemplate,\n ComponentFile,\n ComponentConfig,\n ConfigContext,\n} from './component-template';\nexport { WorkspaceContext, WorkspaceTemplate, WorkspaceTemplate as Starter, WorkspaceFile } from './workspace-template';\nexport { GeneratorEnv } from './generator-env-type';\nexport { GeneratorAspect } from './generator.aspect';\nexport { TemplateList } from './template-list';\nexport { StarterList } from './starter-list';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,kBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,iBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA"}
1
+ {"version":3,"names":["_componentTemplate","data","require","_workspaceTemplate","_generatorEnvType","_generator","_templateList","_starterList"],"sources":["index.ts"],"sourcesContent":["export type { GeneratorMain } from './generator.main.runtime';\nexport {\n ComponentContext,\n ComponentTemplate,\n ComponentFile,\n ComponentConfig,\n ConfigContext,\n} from './component-template';\nexport { WorkspaceContext, WorkspaceTemplate, WorkspaceTemplate as Starter, WorkspaceFile } from './workspace-template';\nexport { GeneratorEnv } from './generator-env-type';\nexport { GeneratorAspect } from './generator.aspect';\nexport { TemplateList } from './template-list';\nexport { StarterList } from './starter-list';\nexport type { GenerateResult } from './component-generator';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,kBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,iBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1136/dist/generator.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1136/dist/generator.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1138/dist/generator.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1138/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": "0.0.1136",
3
+ "version": "0.0.1138",
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": "0.0.1136"
9
+ "version": "0.0.1138"
10
10
  },
11
11
  "dependencies": {
12
12
  "camelcase": "6.2.0",
@@ -22,25 +22,25 @@
22
22
  "@teambit/component-id": "0.0.427",
23
23
  "@teambit/harmony": "0.4.6",
24
24
  "@teambit/bit-error": "0.0.402",
25
- "@teambit/envs": "0.0.1136",
26
- "@teambit/logger": "0.0.854",
27
- "@teambit/new-component-helper": "0.0.540",
28
- "@teambit/tracker": "0.0.167",
29
- "@teambit/workspace.modules.node-modules-linker": "0.0.103",
30
- "@teambit/workspace": "0.0.1136",
31
- "@teambit/cli": "0.0.761",
32
- "@teambit/graphql": "0.0.1136",
33
- "@teambit/aspect-loader": "0.0.1136",
34
- "@teambit/bit": "0.2.29",
35
- "@teambit/community": "0.0.309",
36
- "@teambit/component": "0.0.1136",
37
- "@teambit/git": "0.0.41",
38
- "@teambit/compiler": "0.0.1136",
39
- "@teambit/forking": "0.0.540",
40
- "@teambit/importer": "0.0.565",
41
- "@teambit/install": "0.0.220",
42
- "@teambit/ui": "0.0.1136",
43
- "@teambit/workspace-config-files": "0.0.116"
25
+ "@teambit/envs": "0.0.1138",
26
+ "@teambit/logger": "0.0.855",
27
+ "@teambit/new-component-helper": "0.0.542",
28
+ "@teambit/tracker": "0.0.169",
29
+ "@teambit/workspace-config-files": "0.0.118",
30
+ "@teambit/workspace.modules.node-modules-linker": "0.0.104",
31
+ "@teambit/workspace": "0.0.1138",
32
+ "@teambit/cli": "0.0.762",
33
+ "@teambit/graphql": "0.0.1138",
34
+ "@teambit/aspect-loader": "0.0.1138",
35
+ "@teambit/bit": "0.2.31",
36
+ "@teambit/community": "0.0.310",
37
+ "@teambit/component": "0.0.1138",
38
+ "@teambit/git": "0.0.43",
39
+ "@teambit/compiler": "0.0.1138",
40
+ "@teambit/forking": "0.0.542",
41
+ "@teambit/importer": "0.0.567",
42
+ "@teambit/install": "0.0.222",
43
+ "@teambit/ui": "0.0.1138"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/fs-extra": "9.0.7",
@@ -54,7 +54,7 @@
54
54
  "@teambit/generator.aspect-docs.generator": "0.0.160"
55
55
  },
56
56
  "peerDependencies": {
57
- "@teambit/legacy": "1.0.545",
57
+ "@teambit/legacy": "1.0.546",
58
58
  "react": "^16.8.0 || ^17.0.0",
59
59
  "react-dom": "^16.8.0 || ^17.0.0"
60
60
  },
File without changes