@teambit/generator 0.0.1158 → 0.0.1159

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.
@@ -1 +1 @@
1
- {"version":3,"names":["_graphql","data","require","_cli","_workspace","_interopRequireWildcard","_envs","_config","_interopRequireDefault","_workspaceConfigFiles","_component","_bit","_harmony","_git","_bitError","_aspectLoader","_tracker","_newComponentHelper","_lodash","_logger","_generator","_create","_templates","_generator2","_componentGenerator","_workspaceGenerator","_new","_templates2","_basic","_starter","_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","loggerMain","createLogger","commands","CreateCmd","TemplatesCmd","NewCmd","generatorSchema","registerPlugins","StarterPlugin","registerService","GeneratorService","componentGeneratorTemplate","componentGeneratorTemplateStandalone","starterTemplate","starterTemplateStandalone","BasicWorkspaceStarter","exports","Slot","withType","CLIAspect","GraphqlAspect","AspectLoaderAspect","NewComponentHelperAspect","ComponentAspect","TrackerAspect","LoggerAspect","GitAspect","WorkspaceConfigFilesAspect","MainRuntime","addRuntime"],"sources":["generator.main.runtime.ts"],"sourcesContent":["import { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { EnvDefinition, EnvsAspect, EnvsMain } from '@teambit/envs';\nimport ComponentConfig from '@teambit/legacy/dist/consumer/config';\nimport WorkspaceConfigFilesAspect, { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\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 {\n componentGeneratorTemplate,\n componentGeneratorTemplateStandalone,\n starterTemplate,\n starterTemplateStandalone,\n} from './templates';\nimport { BasicWorkspaceStarter } from './templates/basic';\nimport { StarterPlugin } from './starter.plugin';\nimport { GeneratorService } from './generator.service';\n\nexport type ComponentTemplateSlot = SlotRegistry<ComponentTemplate[]>;\nexport type WorkspaceTemplateSlot = SlotRegistry<WorkspaceTemplate[]>;\nexport type OnComponentCreateSlot = SlotRegistry<OnComponentCreateFn>;\n\nexport type TemplateDescriptor = {\n aspectId: string;\n titlePrefix?: string;\n name: string;\n description?: string;\n hidden?: boolean;\n};\n\ntype TemplateWithId = { id: string; envName?: string };\ntype WorkspaceTemplateWithId = TemplateWithId & { template: WorkspaceTemplate };\ntype ComponentTemplateWithId = TemplateWithId & { template: ComponentTemplate };\ntype AnyTemplateWithId = TemplateWithId & { template: ComponentTemplate | WorkspaceTemplate };\n\nexport type GenerateWorkspaceTemplateResult = { workspacePath: string; appName?: string };\n\nexport type GeneratorConfig = {\n /**\n * array of aspects to include in the list of templates.\n */\n aspects: string[];\n\n /**\n * by default core templates are shown.\n * use this to hide them unless `--show-all` flag of `bit templates` was used\n */\n hideCoreTemplates: boolean;\n\n /**\n * default envs.\n */\n envs?: string[];\n};\n\nexport class GeneratorMain {\n private aspectLoaded = false;\n constructor(\n private componentTemplateSlot: ComponentTemplateSlot,\n private workspaceTemplateSlot: WorkspaceTemplateSlot,\n private onComponentCreateSlot: OnComponentCreateSlot,\n private config: GeneratorConfig,\n private workspace: Workspace,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain,\n private newComponentHelper: NewComponentHelperMain,\n private componentAspect: ComponentMain,\n private tracker: TrackerMain,\n private logger: Logger,\n private git: GitMain,\n private wsConfigFiles: WorkspaceConfigFilesMain\n ) {}\n\n /**\n * register a new component template.\n */\n registerComponentTemplate(templates: ComponentTemplate[]) {\n this.componentTemplateSlot.register(templates);\n return this;\n }\n\n /**\n * register a new workspace starter.\n */\n registerWorkspaceTemplate(templates: WorkspaceTemplate[]) {\n this.workspaceTemplateSlot.register(templates);\n return this;\n }\n\n registerOnComponentCreate(fn: OnComponentCreateFn) {\n this.onComponentCreateSlot.register(fn);\n return this;\n }\n\n /**\n * list all component templates registered in the workspace or workspace templates in case the\n * workspace is not available\n */\n async listTemplates({ aspect }: { aspect?: string } = {}): Promise<TemplateDescriptor[]> {\n if (this.isRunningInsideWorkspace()) {\n return this.getAllComponentTemplatesDescriptorsFlattened(aspect);\n }\n return this.getAllWorkspaceTemplatesDescriptorFlattened(aspect);\n }\n\n private getTemplateDescriptor = ({ id, template }: AnyTemplateWithId): TemplateDescriptor => {\n const shouldBeHidden = () => {\n if (template.hidden) return true;\n if (this.config.hideCoreTemplates && isCoreAspect(id)) return true;\n return false;\n };\n return {\n aspectId: id,\n name: template.name,\n description: template.description,\n hidden: shouldBeHidden(),\n };\n };\n\n /**\n * @deprecated use this.listTemplates()\n */\n async listComponentTemplates(opts: { aspect?: string }): Promise<TemplateDescriptor[]> {\n return this.listTemplates(opts);\n }\n\n isRunningInsideWorkspace(): boolean {\n return Boolean(this.workspace);\n }\n\n /**\n * get all component templates registered by a specific aspect ID.\n */\n getComponentTemplateByAspect(aspectId: string): ComponentTemplate[] {\n return this.componentTemplateSlot.get(aspectId) || [];\n }\n\n /**\n * returns a specific component template.\n */\n async getComponentTemplate(name: string, aspectId?: string): Promise<ComponentTemplateWithId | undefined> {\n const fromEnv = await this.listEnvComponentTemplates([], aspectId);\n if (fromEnv && fromEnv.length) {\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, fromEnv);\n if (found) return found;\n }\n // fallback to aspect id not from env if provided\n const templates = await this.getAllComponentTemplatesFlattened();\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, templates);\n return found;\n }\n\n private findTemplateByAspectIdAndName<T>(\n aspectId: string | undefined,\n name: string,\n templates: Array<T>\n ): T | undefined {\n // @ts-ignore (should set T to be extends ComponentTemplateWithId or WorkspaceTemplateWithId)\n const found = templates.find(({ id, template }) => {\n // When doing something like:\n // bit create react-env my-env --aspect teambit.react/react-env\n // we will get the aspectId without version\n // but the env might be loaded from the global scope then it will be with a version\n // so it won't found if we don't look for it like this\n const idWithoutVersion = id.split('@')[0];\n if (aspectId && id !== aspectId && idWithoutVersion !== aspectId) return false;\n return template.name === name;\n });\n return found;\n }\n\n /**\n * Get the generator aspect and the envs aspect from an harmony instance of the global scope\n */\n private async getGlobalGeneratorEnvs(\n aspectId: string\n ): Promise<{ remoteGenerator: GeneratorMain; fullAspectId: string; remoteEnvsAspect: EnvsMain; aspect: any }> {\n const { globalScopeHarmony, components } = 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 } = options;\n\n const componentConfigLoadingRegistry = ComponentConfig.componentConfigLoadingRegistry;\n\n const templateWithId = await this.getComponentTemplate(templateName, aspect);\n\n ComponentConfig.componentConfigLoadingRegistry = componentConfigLoadingRegistry;\n\n if (!templateWithId) throw new BitError(`template \"${templateName}\" was not found`);\n\n const componentIds = componentNames.map((componentName) =>\n this.newComponentHelper.getNewComponentId(componentName, namespace, options.scope)\n );\n\n const 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 & { aspect?: string }\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 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 ComponentAspect,\n TrackerAspect,\n LoggerAspect,\n GitAspect,\n WorkspaceConfigFilesAspect,\n ];\n\n static runtime = MainRuntime;\n\n static async provider(\n [\n workspace,\n cli,\n graphql,\n envs,\n aspectLoader,\n newComponentHelper,\n componentAspect,\n tracker,\n loggerMain,\n git,\n wsConfigFiles,\n ]: [\n Workspace,\n CLIMain,\n GraphqlMain,\n EnvsMain,\n AspectLoaderMain,\n NewComponentHelperMain,\n ComponentMain,\n TrackerMain,\n LoggerMain,\n GitMain,\n WorkspaceConfigFilesMain\n ],\n config: GeneratorConfig,\n [componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot]: [\n ComponentTemplateSlot,\n WorkspaceTemplateSlot,\n OnComponentCreateSlot\n ]\n ) {\n const logger = loggerMain.createLogger(GeneratorAspect.id);\n const generator = new GeneratorMain(\n componentTemplateSlot,\n workspaceTemplateSlot,\n onComponentCreateSlot,\n config,\n workspace,\n envs,\n aspectLoader,\n newComponentHelper,\n componentAspect,\n tracker,\n logger,\n git,\n wsConfigFiles\n );\n const commands = [new CreateCmd(generator), new TemplatesCmd(generator), new NewCmd(generator)];\n cli.register(...commands);\n graphql.register(generatorSchema(generator));\n aspectLoader.registerPlugins([new StarterPlugin(generator)]);\n envs.registerService(new GeneratorService());\n\n if (generator)\n generator.registerComponentTemplate([\n componentGeneratorTemplate,\n componentGeneratorTemplateStandalone,\n starterTemplate,\n starterTemplateStandalone,\n ]);\n generator.registerWorkspaceTemplate([BasicWorkspaceStarter]);\n\n return generator;\n }\n}\n\nGeneratorAspect.addRuntime(GeneratorMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,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,QAAA;EAAA,MAAAN,IAAA,GAAAO,sBAAA,CAAAN,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,sBAAA;EAAA,MAAAR,IAAA,GAAAO,sBAAA,CAAAN,OAAA;EAAAO,qBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAS,WAAA;EAAA,MAAAT,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAQ,UAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,O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EACfC,uCAAyB,CAC1B,CAAC;IACJtF,SAAS,CAAChD,yBAAyB,CAAC,CAACuI,8BAAqB,CAAC,CAAC;IAE5D,OAAOvF,SAAS;EAClB;AACF;AAACwF,OAAA,CAAAnK,aAAA,GAAAA,aAAA;AAAA,IAAAH,gBAAA,GAAAjC,OAAA,EA5eYoC,aAAa,WAoZT,CACboK,eAAI,CAACC,QAAQ,CAAsB,CAAC,EACpCD,eAAI,CAACC,QAAQ,CAAsB,CAAC,EACpCD,eAAI,CAACC,QAAQ,CAAsB,CAAC,CACrC;AAAA,IAAAxK,gBAAA,GAAAjC,OAAA,EAxZUoC,aAAa,kBA0ZF,CACpBmE,oBAAe,EACfmG,gBAAS,EACTC,wBAAa,EACbhH,kBAAU,EACViH,uBAAkB,EAClBC,6BAAwB,EACxBC,oBAAe,EACfC,kBAAa,EACbC,sBAAY,EACZC,cAAS,EACTC,+BAA0B,CAC3B;AAAA,IAAAjL,gBAAA,GAAAjC,OAAA,EAtaUoC,aAAa,aAwaP+K,kBAAW;AAsE9B1H,4BAAe,CAAC2H,UAAU,CAAChL,aAAa,CAAC"}
1
+ {"version":3,"names":["_graphql","data","require","_cli","_workspace","_interopRequireWildcard","_envs","_config","_interopRequireDefault","_workspaceConfigFiles","_component","_bit","_harmony","_git","_bitError","_aspectLoader","_tracker","_newComponentHelper","_lodash","_logger","_generator","_create","_templates","_generator2","_componentGenerator","_workspaceGenerator","_new","_templates2","_basic","_starter","_generator3","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","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","_defineProperty","getOwnPropertyDescriptors","defineProperties","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","GeneratorMain","constructor","componentTemplateSlot","workspaceTemplateSlot","onComponentCreateSlot","config","workspace","envs","aspectLoader","newComponentHelper","componentAspect","tracker","logger","git","wsConfigFiles","id","template","shouldBeHidden","hidden","hideCoreTemplates","isCoreAspect","aspectId","name","description","registerComponentTemplate","templates","register","registerWorkspaceTemplate","registerOnComponentCreate","fn","listTemplates","aspect","isRunningInsideWorkspace","getAllComponentTemplatesDescriptorsFlattened","getAllWorkspaceTemplatesDescriptorFlattened","listComponentTemplates","opts","Boolean","getComponentTemplateByAspect","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","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","loggerMain","createLogger","commands","CreateCmd","TemplatesCmd","NewCmd","generatorSchema","registerPlugins","StarterPlugin","registerService","GeneratorService","componentGeneratorTemplate","componentGeneratorTemplateStandalone","starterTemplate","starterTemplateStandalone","BasicWorkspaceStarter","exports","Slot","withType","CLIAspect","GraphqlAspect","AspectLoaderAspect","NewComponentHelperAspect","ComponentAspect","TrackerAspect","LoggerAspect","GitAspect","WorkspaceConfigFilesAspect","MainRuntime","addRuntime"],"sources":["generator.main.runtime.ts"],"sourcesContent":["import { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { EnvDefinition, EnvsAspect, EnvsMain } from '@teambit/envs';\nimport ComponentConfig from '@teambit/legacy/dist/consumer/config';\nimport WorkspaceConfigFilesAspect, { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\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 {\n componentGeneratorTemplate,\n componentGeneratorTemplateStandalone,\n starterTemplate,\n starterTemplateStandalone,\n} from './templates';\nimport { BasicWorkspaceStarter } from './templates/basic';\nimport { StarterPlugin } from './starter.plugin';\nimport { GeneratorService } from './generator.service';\n\nexport type ComponentTemplateSlot = SlotRegistry<ComponentTemplate[]>;\nexport type WorkspaceTemplateSlot = SlotRegistry<WorkspaceTemplate[]>;\nexport type OnComponentCreateSlot = SlotRegistry<OnComponentCreateFn>;\n\nexport type TemplateDescriptor = {\n aspectId: string;\n titlePrefix?: string;\n name: string;\n description?: string;\n hidden?: boolean;\n};\n\ntype TemplateWithId = { id: string; envName?: string };\ntype WorkspaceTemplateWithId = TemplateWithId & { template: WorkspaceTemplate };\ntype ComponentTemplateWithId = TemplateWithId & { template: ComponentTemplate };\ntype AnyTemplateWithId = TemplateWithId & { template: ComponentTemplate | WorkspaceTemplate };\n\nexport type GenerateWorkspaceTemplateResult = { workspacePath: string; appName?: string };\n\nexport type GeneratorConfig = {\n /**\n * array of aspects to include in the list of templates.\n */\n aspects: string[];\n\n /**\n * by default core templates are shown.\n * use this to hide them unless `--show-all` flag of `bit templates` was used\n */\n hideCoreTemplates: boolean;\n\n /**\n * default envs.\n */\n envs?: string[];\n};\n\nexport class GeneratorMain {\n private aspectLoaded = false;\n constructor(\n private componentTemplateSlot: ComponentTemplateSlot,\n private workspaceTemplateSlot: WorkspaceTemplateSlot,\n private onComponentCreateSlot: OnComponentCreateSlot,\n private config: GeneratorConfig,\n private workspace: Workspace,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain,\n private newComponentHelper: NewComponentHelperMain,\n private componentAspect: ComponentMain,\n private tracker: TrackerMain,\n private logger: Logger,\n private git: GitMain,\n private wsConfigFiles: WorkspaceConfigFilesMain\n ) {}\n\n /**\n * register a new component template.\n */\n registerComponentTemplate(templates: ComponentTemplate[]) {\n this.componentTemplateSlot.register(templates);\n return this;\n }\n\n /**\n * register a new workspace starter.\n */\n registerWorkspaceTemplate(templates: WorkspaceTemplate[]) {\n this.workspaceTemplateSlot.register(templates);\n return this;\n }\n\n registerOnComponentCreate(fn: OnComponentCreateFn) {\n this.onComponentCreateSlot.register(fn);\n return this;\n }\n\n /**\n * list all component templates registered in the workspace or workspace templates in case the\n * workspace is not available\n */\n async listTemplates({ aspect }: { aspect?: string } = {}): Promise<TemplateDescriptor[]> {\n if (this.isRunningInsideWorkspace()) {\n return this.getAllComponentTemplatesDescriptorsFlattened(aspect);\n }\n return this.getAllWorkspaceTemplatesDescriptorFlattened(aspect);\n }\n\n private getTemplateDescriptor = ({ id, template }: AnyTemplateWithId): TemplateDescriptor => {\n const shouldBeHidden = () => {\n if (template.hidden) return true;\n if (this.config.hideCoreTemplates && isCoreAspect(id)) return true;\n return false;\n };\n return {\n aspectId: id,\n name: template.name,\n description: template.description,\n hidden: shouldBeHidden(),\n };\n };\n\n /**\n * @deprecated use this.listTemplates()\n */\n async listComponentTemplates(opts: { aspect?: string }): Promise<TemplateDescriptor[]> {\n return this.listTemplates(opts);\n }\n\n isRunningInsideWorkspace(): boolean {\n return Boolean(this.workspace);\n }\n\n /**\n * get all component templates registered by a specific aspect ID.\n */\n getComponentTemplateByAspect(aspectId: string): ComponentTemplate[] {\n return this.componentTemplateSlot.get(aspectId) || [];\n }\n\n /**\n * returns a specific component template.\n */\n async getComponentTemplate(name: string, aspectId?: string): Promise<ComponentTemplateWithId | undefined> {\n const fromEnv = await this.listEnvComponentTemplates([], aspectId);\n if (fromEnv && fromEnv.length) {\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, fromEnv);\n if (found) return found;\n }\n // fallback to aspect id not from env if provided\n const templates = await this.getAllComponentTemplatesFlattened();\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, templates);\n return found;\n }\n\n private findTemplateByAspectIdAndName<T>(\n aspectId: string | undefined,\n name: string,\n templates: Array<T>\n ): T | undefined {\n // @ts-ignore (should set T to be extends ComponentTemplateWithId or WorkspaceTemplateWithId)\n const found = templates.find(({ id, template }) => {\n // When doing something like:\n // bit create react-env my-env --aspect teambit.react/react-env\n // we will get the aspectId without version\n // but the env might be loaded from the global scope then it will be with a version\n // so it won't found if we don't look for it like this\n const idWithoutVersion = id.split('@')[0];\n if (aspectId && id !== aspectId && idWithoutVersion !== aspectId) return false;\n return template.name === name;\n });\n return found;\n }\n\n /**\n * Get the generator aspect and the envs aspect from an harmony instance of the global scope\n */\n private async getGlobalGeneratorEnvs(\n aspectId: string\n ): Promise<{ remoteGenerator: GeneratorMain; fullAspectId: string; remoteEnvsAspect: EnvsMain; aspect: any }> {\n const { globalScopeHarmony, components } = 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 } = options;\n\n const componentConfigLoadingRegistry = ComponentConfig.componentConfigLoadingRegistry;\n\n const templateWithId = await this.getComponentTemplate(templateName, aspect);\n\n ComponentConfig.componentConfigLoadingRegistry = componentConfigLoadingRegistry;\n\n if (!templateWithId) throw new BitError(`template \"${templateName}\" was not found`);\n\n const componentIds = componentNames.map((componentName) =>\n this.newComponentHelper.getNewComponentId(componentName, namespace, options.scope)\n );\n\n const 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 & { aspect?: string }\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 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 ComponentAspect,\n TrackerAspect,\n LoggerAspect,\n GitAspect,\n WorkspaceConfigFilesAspect,\n ];\n\n static runtime = MainRuntime;\n\n static async provider(\n [\n workspace,\n cli,\n graphql,\n envs,\n aspectLoader,\n newComponentHelper,\n componentAspect,\n tracker,\n loggerMain,\n git,\n wsConfigFiles,\n ]: [\n Workspace,\n CLIMain,\n GraphqlMain,\n EnvsMain,\n AspectLoaderMain,\n NewComponentHelperMain,\n ComponentMain,\n TrackerMain,\n LoggerMain,\n GitMain,\n WorkspaceConfigFilesMain\n ],\n config: GeneratorConfig,\n [componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot]: [\n ComponentTemplateSlot,\n WorkspaceTemplateSlot,\n OnComponentCreateSlot\n ]\n ) {\n const logger = loggerMain.createLogger(GeneratorAspect.id);\n const generator = new GeneratorMain(\n componentTemplateSlot,\n workspaceTemplateSlot,\n onComponentCreateSlot,\n config,\n workspace,\n envs,\n aspectLoader,\n newComponentHelper,\n componentAspect,\n tracker,\n logger,\n git,\n wsConfigFiles\n );\n const commands = [new CreateCmd(generator), new TemplatesCmd(generator), new NewCmd(generator)];\n cli.register(...commands);\n graphql.register(generatorSchema(generator));\n aspectLoader.registerPlugins([new StarterPlugin(generator)]);\n envs.registerService(new GeneratorService());\n\n if (generator)\n generator.registerComponentTemplate([\n componentGeneratorTemplate,\n componentGeneratorTemplateStandalone,\n starterTemplate,\n starterTemplateStandalone,\n ]);\n generator.registerWorkspaceTemplate([BasicWorkspaceStarter]);\n\n return generator;\n }\n}\n\nGeneratorAspect.addRuntime(GeneratorMain);\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,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,OA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,wBAAa,EAAC/E,SAAS,CAAC,CAAC,CAAC;IAC5DpE,IAAI,CAACoJ,eAAe,CAAC,KAAIC,8BAAgB,EAAC,CAAC,CAAC;IAE5C,IAAIjF,SAAS,EACXA,SAAS,CAACnD,yBAAyB,CAAC,CAClCqI,wCAA0B,EAC1BC,kDAAoC,EACpCC,6BAAe,EACfC,uCAAyB,CAC1B,CAAC;IACJrF,SAAS,CAAChD,yBAAyB,CAAC,CAACsI,8BAAqB,CAAC,CAAC;IAE5D,OAAOtF,SAAS;EAClB;AACF;AAACuF,OAAA,CAAAlK,aAAA,GAAAA,aAAA;AAAAnB,eAAA,CA5eYmB,aAAa,WAoZT,CACbmK,eAAI,CAACC,QAAQ,CAAsB,CAAC,EACpCD,eAAI,CAACC,QAAQ,CAAsB,CAAC,EACpCD,eAAI,CAACC,QAAQ,CAAsB,CAAC,CACrC;AAAAvL,eAAA,CAxZUmB,aAAa,kBA0ZF,CACpBmE,oBAAe,EACfkG,gBAAS,EACTC,wBAAa,EACb/G,kBAAU,EACVgH,uBAAkB,EAClBC,6BAAwB,EACxBC,oBAAe,EACfC,kBAAa,EACbC,sBAAY,EACZC,cAAS,EACTC,+BAA0B,CAC3B;AAAAhM,eAAA,CAtaUmB,aAAa,aAwaP8K,kBAAW;AAsE9BzH,4BAAe,CAAC0H,UAAU,CAAC/K,aAAa,CAAC"}
@@ -1,20 +1,15 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.GeneratorService = void 0;
8
- function _defineProperty2() {
9
- const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- _defineProperty2 = function () {
11
- return data;
12
- };
13
- return data;
14
- }
7
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
9
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
10
  class GeneratorService {
16
11
  constructor() {
17
- (0, _defineProperty2().default)(this, "name", 'generator');
12
+ _defineProperty(this, "name", 'generator');
18
13
  }
19
14
  transform(env, context) {
20
15
  // Old env
@@ -1 +1 @@
1
- {"version":3,"names":["GeneratorService","constructor","_defineProperty2","default","transform","env","context","generators","undefined","getGeneratorTemplates","generatorList","compute","getGeneratorStarters","starters","starterList","exports"],"sources":["generator.service.tsx"],"sourcesContent":["import { EnvService, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport { ComponentTemplate } from './component-template';\nimport { WorkspaceTemplate } from './workspace-template';\n\ntype GeneratorTransformationMap = ServiceTransformationMap & {\n getGeneratorTemplates: () => ComponentTemplate;\n getGeneratorStarters: () => WorkspaceTemplate;\n};\nexport class GeneratorService implements EnvService<any> {\n name = 'generator';\n\n transform(env: Env, context: EnvContext): GeneratorTransformationMap | undefined {\n // Old env\n if (!env?.generators) return undefined;\n return {\n getGeneratorTemplates: () => {\n if (!env.generators) return undefined;\n const generatorList = env.generators()(context);\n return generatorList.compute();\n },\n getGeneratorStarters: () => {\n if (!env.starters) return undefined;\n const starterList = env.starters()(context);\n return starterList.compute();\n },\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAQO,MAAMA,gBAAgB,CAA4B;EAAAC,YAAA;IAAA,IAAAC,gBAAA,GAAAC,OAAA,gBAChD,WAAW;EAAA;EAElBC,SAASA,CAACC,GAAQ,EAAEC,OAAmB,EAA0C;IAC/E;IACA,IAAI,EAACD,GAAG,aAAHA,GAAG,eAAHA,GAAG,CAAEE,UAAU,GAAE,OAAOC,SAAS;IACtC,OAAO;MACLC,qBAAqB,EAAEA,CAAA,KAAM;QAC3B,IAAI,CAACJ,GAAG,CAACE,UAAU,EAAE,OAAOC,SAAS;QACrC,MAAME,aAAa,GAAGL,GAAG,CAACE,UAAU,CAAC,CAAC,CAACD,OAAO,CAAC;QAC/C,OAAOI,aAAa,CAACC,OAAO,CAAC,CAAC;MAChC,CAAC;MACDC,oBAAoB,EAAEA,CAAA,KAAM;QAC1B,IAAI,CAACP,GAAG,CAACQ,QAAQ,EAAE,OAAOL,SAAS;QACnC,MAAMM,WAAW,GAAGT,GAAG,CAACQ,QAAQ,CAAC,CAAC,CAACP,OAAO,CAAC;QAC3C,OAAOQ,WAAW,CAACH,OAAO,CAAC,CAAC;MAC9B;IACF,CAAC;EACH;AACF;AAACI,OAAA,CAAAf,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["GeneratorService","constructor","_defineProperty","transform","env","context","generators","undefined","getGeneratorTemplates","generatorList","compute","getGeneratorStarters","starters","starterList","exports"],"sources":["generator.service.tsx"],"sourcesContent":["import { EnvService, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport { ComponentTemplate } from './component-template';\nimport { WorkspaceTemplate } from './workspace-template';\n\ntype GeneratorTransformationMap = ServiceTransformationMap & {\n getGeneratorTemplates: () => ComponentTemplate;\n getGeneratorStarters: () => WorkspaceTemplate;\n};\nexport class GeneratorService implements EnvService<any> {\n name = 'generator';\n\n transform(env: Env, context: EnvContext): GeneratorTransformationMap | undefined {\n // Old env\n if (!env?.generators) return undefined;\n return {\n getGeneratorTemplates: () => {\n if (!env.generators) return undefined;\n const generatorList = env.generators()(context);\n return generatorList.compute();\n },\n getGeneratorStarters: () => {\n if (!env.starters) return undefined;\n const starterList = env.starters()(context);\n return starterList.compute();\n },\n };\n }\n}\n"],"mappings":";;;;;;;;;AAQO,MAAMA,gBAAgB,CAA4B;EAAAC,YAAA;IAAAC,eAAA,eAChD,WAAW;EAAA;EAElBC,SAASA,CAACC,GAAQ,EAAEC,OAAmB,EAA0C;IAC/E;IACA,IAAI,EAACD,GAAG,aAAHA,GAAG,eAAHA,GAAG,CAAEE,UAAU,GAAE,OAAOC,SAAS;IACtC,OAAO;MACLC,qBAAqB,EAAEA,CAAA,KAAM;QAC3B,IAAI,CAACJ,GAAG,CAACE,UAAU,EAAE,OAAOC,SAAS;QACrC,MAAME,aAAa,GAAGL,GAAG,CAACE,UAAU,CAAC,CAAC,CAACD,OAAO,CAAC;QAC/C,OAAOI,aAAa,CAACC,OAAO,CAAC,CAAC;MAChC,CAAC;MACDC,oBAAoB,EAAEA,CAAA,KAAM;QAC1B,IAAI,CAACP,GAAG,CAACQ,QAAQ,EAAE,OAAOL,SAAS;QACnC,MAAMM,WAAW,GAAGT,GAAG,CAACQ,QAAQ,CAAC,CAAC,CAACP,OAAO,CAAC;QAC3C,OAAOQ,WAAW,CAACH,OAAO,CAAC,CAAC;MAC9B;IACF,CAAC;EACH;AACF;AAACI,OAAA,CAAAd,gBAAA,GAAAA,gBAAA"}
package/dist/new.cmd.js CHANGED
@@ -1,19 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- require("core-js/modules/es.array.iterator.js");
5
- require("core-js/modules/es.promise.js");
6
3
  Object.defineProperty(exports, "__esModule", {
7
4
  value: true
8
5
  });
9
6
  exports.NewCmd = void 0;
10
- function _defineProperty2() {
11
- const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
- _defineProperty2 = function () {
13
- return data;
14
- };
15
- return data;
16
- }
17
7
  function _chalk() {
18
8
  const data = _interopRequireDefault(require("chalk"));
19
9
  _chalk = function () {
@@ -21,6 +11,10 @@ function _chalk() {
21
11
  };
22
12
  return data;
23
13
  }
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
17
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
24
18
  /**
25
19
  * NewOptions combines foundational properties with additional options for creating a workspace.
26
20
  */
@@ -28,24 +22,23 @@ function _chalk() {
28
22
  class NewCmd {
29
23
  constructor(generator) {
30
24
  this.generator = generator;
31
- (0, _defineProperty2().default)(this, "name", 'new <template-name> <workspace-name>');
32
- (0, _defineProperty2().default)(this, "description", 'create a new workspace from a template');
33
- (0, _defineProperty2().default)(this, "arguments", [{
25
+ _defineProperty(this, "name", 'new <template-name> <workspace-name>');
26
+ _defineProperty(this, "description", 'create a new workspace from a template');
27
+ _defineProperty(this, "arguments", [{
34
28
  name: 'template-name',
35
29
  description: "the name of the workspace template (run 'bit templates' outside of a workspace to get a list of available workspace templates)"
36
30
  }, {
37
31
  name: 'workspace-name',
38
32
  description: 'the name for the new workspace and workspace directory that will be created'
39
33
  }]);
40
- (0, _defineProperty2().default)(this, "alias", '');
41
- (0, _defineProperty2().default)(this, "loader", true);
42
- (0, _defineProperty2().default)(this, "group", 'start');
43
- (0, _defineProperty2().default)(this, "options", [['a', 'aspect <aspect-id>', 'id of the aspect that registered the template, mandatory for non-core aspects. helpful for core aspects in case of a name collision'], ['t', 'template <env-id>', "env-id of the template's owner. Alias for --env."], ['', 'env <env-id>', 'env-id of the template. Alias -t'], ['d', 'default-scope <scope-name>', `set defaultScope in the new workspace's workspace.jsonc`], ['', 'standalone', 'DEPRECATED. use --skip-git instead'], ['s', 'skip-git', 'skip generation of Git repository in the new workspace'], ['e', 'empty', "skip template's default component creation (relevant for templates that add components by default)"], ['', 'load-from <path-to-template>', 'local path to the workspace containing the template. Helpful during a development of a workspace-template']]);
34
+ _defineProperty(this, "alias", '');
35
+ _defineProperty(this, "loader", true);
36
+ _defineProperty(this, "group", 'start');
37
+ _defineProperty(this, "options", [['a', 'aspect <aspect-id>', 'id of the aspect that registered the template, mandatory for non-core aspects. helpful for core aspects in case of a name collision'], ['t', 'template <env-id>', "env-id of the template's owner. Alias for --env."], ['', 'env <env-id>', 'env-id of the template. Alias -t'], ['d', 'default-scope <scope-name>', `set defaultScope in the new workspace's workspace.jsonc`], ['', 'standalone', 'DEPRECATED. use --skip-git instead'], ['s', 'skip-git', 'skip generation of Git repository in the new workspace'], ['e', 'empty', "skip template's default component creation (relevant for templates that add components by default)"], ['', 'load-from <path-to-template>', 'local path to the workspace containing the template. Helpful during a development of a workspace-template']]);
44
38
  }
45
39
  async report([templateName, workspaceName], options) {
46
- var _options$skipGit, _ref, _options$aspect;
47
- options.skipGit = (_options$skipGit = options.skipGit) !== null && _options$skipGit !== void 0 ? _options$skipGit : options.standalone;
48
- options.aspect = (_ref = (_options$aspect = options.aspect) !== null && _options$aspect !== void 0 ? _options$aspect : options.env) !== null && _ref !== void 0 ? _ref : options.template;
40
+ options.skipGit = options.skipGit ?? options.standalone;
41
+ options.aspect = options.aspect ?? options.env ?? options.template;
49
42
  const {
50
43
  workspacePath,
51
44
  appName
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","NewCmd","constructor","generator","_defineProperty2","default","name","description","report","templateName","workspaceName","options","_options$skipGit","_ref","_options$aspect","skipGit","standalone","aspect","env","template","workspacePath","appName","generateWorkspaceTemplate","chalk","white","green","yellow","bold","getBottomSection","exports","cdLine","parts","push","join"],"sources":["new.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { GeneratorMain } from './generator.main.runtime';\nimport { BaseWorkspaceOptions } from './workspace-template';\n\n/**\n * NewOptions combines foundational properties with additional options for creating a workspace.\n */\nexport type NewOptions = BaseWorkspaceOptions;\n\nexport class NewCmd implements Command {\n name = 'new <template-name> <workspace-name>';\n description = 'create a new workspace from a template';\n arguments = [\n {\n name: 'template-name',\n description:\n \"the name of the workspace template (run 'bit templates' outside of a workspace to get a list of available workspace templates)\",\n },\n {\n name: 'workspace-name',\n description: 'the name for the new workspace and workspace directory that will be created',\n },\n ];\n alias = '';\n loader = true;\n group = 'start';\n options = [\n [\n 'a',\n 'aspect <aspect-id>',\n 'id of the aspect that registered the template, mandatory for non-core aspects. helpful for core aspects in case of a name collision',\n ],\n ['t', 'template <env-id>', \"env-id of the template's owner. Alias for --env.\"],\n ['', 'env <env-id>', 'env-id of the template. Alias -t'],\n ['d', 'default-scope <scope-name>', `set defaultScope in the new workspace's workspace.jsonc`],\n ['', 'standalone', 'DEPRECATED. use --skip-git instead'],\n ['s', 'skip-git', 'skip generation of Git repository in the new workspace'],\n [\n 'e',\n 'empty',\n \"skip template's default component creation (relevant for templates that add components by default)\",\n ],\n [\n '',\n 'load-from <path-to-template>',\n 'local path to the workspace containing the template. Helpful during a development of a workspace-template',\n ],\n ] as CommandOptions;\n\n constructor(private generator: GeneratorMain) {}\n\n async report(\n [templateName, workspaceName]: [string, string],\n options: NewOptions & {\n standalone: boolean;\n env?: string;\n template?: string;\n aspect?: string;\n }\n ) {\n options.skipGit = options.skipGit ?? options.standalone;\n options.aspect = options.aspect ?? options.env ?? options.template;\n const { workspacePath, appName } = await this.generator.generateWorkspaceTemplate(\n workspaceName,\n templateName,\n options\n );\n return chalk.white(\n `${chalk.green(`\n\nCongrats! A new workspace has been created successfully at '${workspacePath}'`)}\n\nInside the directory '${workspaceName}' you can run various commands including:\n\n ${chalk.yellow('bit start')}\n Starts the local dev server\n\n ${chalk.yellow('bit install')}\n Installs any missing dependencies\n\n ${chalk.yellow('bit status')}\n Shows the status of the components\n\n ${chalk.yellow('bit compile')}\n Compiles the components\n\n ${chalk.yellow('bit test')}\n Runs the tests on all your components\n\n ${chalk.yellow('bit templates')}\n Shows all available component templates\n\n ${chalk.yellow('bit help')}\n Shows all available commands\n\n\n${chalk.green.bold(\"Let's get started!\")}\n\n ${getBottomSection(workspaceName, appName)}\n `\n );\n }\n}\n\nfunction getBottomSection(workspaceName: string, appName: string | undefined) {\n const cdLine = chalk.yellow(`cd ${workspaceName}`);\n const parts = [cdLine];\n if (appName) {\n parts.push(chalk.yellow(` bit run ${appName}`));\n }\n parts.push(chalk.yellow(` bit start`));\n return parts.join('\\n');\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA;AACA;AACA;;AAGO,MAAMG,MAAM,CAAoB;EAwCrCC,WAAWA,CAASC,SAAwB,EAAE;IAAA,KAA1BA,SAAwB,GAAxBA,SAAwB;IAAA,IAAAC,gBAAA,GAAAC,OAAA,gBAvCrC,sCAAsC;IAAA,IAAAD,gBAAA,GAAAC,OAAA,uBAC/B,wCAAwC;IAAA,IAAAD,gBAAA,GAAAC,OAAA,qBAC1C,CACV;MACEC,IAAI,EAAE,eAAe;MACrBC,WAAW,EACT;IACJ,CAAC,EACD;MACED,IAAI,EAAE,gBAAgB;MACtBC,WAAW,EAAE;IACf,CAAC,CACF;IAAA,IAAAH,gBAAA,GAAAC,OAAA,iBACO,EAAE;IAAA,IAAAD,gBAAA,GAAAC,OAAA,kBACD,IAAI;IAAA,IAAAD,gBAAA,GAAAC,OAAA,iBACL,OAAO;IAAA,IAAAD,gBAAA,GAAAC,OAAA,mBACL,CACR,CACE,GAAG,EACH,oBAAoB,EACpB,qIAAqI,CACtI,EACD,CAAC,GAAG,EAAE,mBAAmB,EAAE,kDAAkD,CAAC,EAC9E,CAAC,EAAE,EAAE,cAAc,EAAE,kCAAkC,CAAC,EACxD,CAAC,GAAG,EAAE,4BAA4B,EAAG,yDAAwD,CAAC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AAK,CAACG,MAAM,CAAC,eAAe,CAAE;AACtC;AACA;AACA,QAAQH,gBAAK,CAACG,MAAM,CAAC,UAAU,CAAE;AACjC;AACA;AACA;AACA,EAAEH,gBAAK,CAACE,KAAK,CAACE,IAAI,CAAC,oBAAoB,CAAE;AACzC;AACA,QAAQC,gBAAgB,CAAClB,aAAa,EAAEW,OAAO,CAAE;AACjD,OACI,CAAC;EACH;AACF;AAACQ,OAAA,CAAA5B,MAAA,GAAAA,MAAA;AAED,SAAS2B,gBAAgBA,CAAClB,aAAqB,EAAEW,OAA2B,EAAE;EAC5E,MAAMS,MAAM,GAAGP,gBAAK,CAACG,MAAM,CAAE,MAAKhB,aAAc,EAAC,CAAC;EAClD,MAAMqB,KAAK,GAAG,CAACD,MAAM,CAAC;EACtB,IAAIT,OAAO,EAAE;IACXU,KAAK,CAACC,IAAI,CAACT,gBAAK,CAACG,MAAM,CAAE,iBAAgBL,OAAQ,EAAC,CAAC,CAAC;EACtD;EACAU,KAAK,CAACC,IAAI,CAACT,gBAAK,CAACG,MAAM,CAAE,iBAAgB,CAAC,CAAC;EAC3C,OAAOK,KAAK,CAACE,IAAI,CAAC,IAAI,CAAC;AACzB"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","NewCmd","constructor","generator","name","description","report","templateName","workspaceName","options","skipGit","standalone","aspect","env","template","workspacePath","appName","generateWorkspaceTemplate","chalk","white","green","yellow","bold","getBottomSection","exports","cdLine","parts","push","join"],"sources":["new.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { GeneratorMain } from './generator.main.runtime';\nimport { BaseWorkspaceOptions } from './workspace-template';\n\n/**\n * NewOptions combines foundational properties with additional options for creating a workspace.\n */\nexport type NewOptions = BaseWorkspaceOptions;\n\nexport class NewCmd implements Command {\n name = 'new <template-name> <workspace-name>';\n description = 'create a new workspace from a template';\n arguments = [\n {\n name: 'template-name',\n description:\n \"the name of the workspace template (run 'bit templates' outside of a workspace to get a list of available workspace templates)\",\n },\n {\n name: 'workspace-name',\n description: 'the name for the new workspace and workspace directory that will be created',\n },\n ];\n alias = '';\n loader = true;\n group = 'start';\n options = [\n [\n 'a',\n 'aspect <aspect-id>',\n 'id of the aspect that registered the template, mandatory for non-core aspects. helpful for core aspects in case of a name collision',\n ],\n ['t', 'template <env-id>', \"env-id of the template's owner. Alias for --env.\"],\n ['', 'env <env-id>', 'env-id of the template. Alias -t'],\n ['d', 'default-scope <scope-name>', `set defaultScope in the new workspace's workspace.jsonc`],\n ['', 'standalone', 'DEPRECATED. use --skip-git instead'],\n ['s', 'skip-git', 'skip generation of Git repository in the new workspace'],\n [\n 'e',\n 'empty',\n \"skip template's default component creation (relevant for templates that add components by default)\",\n ],\n [\n '',\n 'load-from <path-to-template>',\n 'local path to the workspace containing the template. Helpful during a development of a workspace-template',\n ],\n ] as CommandOptions;\n\n constructor(private generator: GeneratorMain) {}\n\n async report(\n [templateName, workspaceName]: [string, string],\n options: NewOptions & {\n standalone: boolean;\n env?: string;\n template?: string;\n aspect?: string;\n }\n ) {\n options.skipGit = options.skipGit ?? options.standalone;\n options.aspect = options.aspect ?? options.env ?? options.template;\n const { workspacePath, appName } = await this.generator.generateWorkspaceTemplate(\n workspaceName,\n templateName,\n options\n );\n return chalk.white(\n `${chalk.green(`\n\nCongrats! A new workspace has been created successfully at '${workspacePath}'`)}\n\nInside the directory '${workspaceName}' you can run various commands including:\n\n ${chalk.yellow('bit start')}\n Starts the local dev server\n\n ${chalk.yellow('bit install')}\n Installs any missing dependencies\n\n ${chalk.yellow('bit status')}\n Shows the status of the components\n\n ${chalk.yellow('bit compile')}\n Compiles the components\n\n ${chalk.yellow('bit test')}\n Runs the tests on all your components\n\n ${chalk.yellow('bit templates')}\n Shows all available component templates\n\n ${chalk.yellow('bit help')}\n Shows all available commands\n\n\n${chalk.green.bold(\"Let's get started!\")}\n\n ${getBottomSection(workspaceName, appName)}\n `\n );\n }\n}\n\nfunction getBottomSection(workspaceName: string, appName: string | undefined) {\n const cdLine = chalk.yellow(`cd ${workspaceName}`);\n const parts = [cdLine];\n if (appName) {\n parts.push(chalk.yellow(` bit run ${appName}`));\n }\n parts.push(chalk.yellow(` bit start`));\n return parts.join('\\n');\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,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AAC;AACzB"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1158/dist/generator.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1158/dist/generator.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1159/dist/generator.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1159/dist/generator.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -1,17 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.StarterPlugin = void 0;
8
- function _defineProperty2() {
9
- const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- _defineProperty2 = function () {
11
- return data;
12
- };
13
- return data;
14
- }
15
7
  function _cli() {
16
8
  const data = require("@teambit/cli");
17
9
  _cli = function () {
@@ -19,11 +11,14 @@ function _cli() {
19
11
  };
20
12
  return data;
21
13
  }
14
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
16
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
22
17
  class StarterPlugin {
23
18
  constructor(generator) {
24
19
  this.generator = generator;
25
- (0, _defineProperty2().default)(this, "pattern", '*.starter.*');
26
- (0, _defineProperty2().default)(this, "runtimes", [_cli().MainRuntime.name]);
20
+ _defineProperty(this, "pattern", '*.starter.*');
21
+ _defineProperty(this, "runtimes", [_cli().MainRuntime.name]);
27
22
  }
28
23
  register(object) {
29
24
  const templates = Array.isArray(object) ? object : [object];
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","StarterPlugin","constructor","generator","_defineProperty2","default","MainRuntime","name","register","object","templates","Array","isArray","registerWorkspaceTemplate","exports"],"sources":["starter.plugin.ts"],"sourcesContent":["import { PluginDefinition } from '@teambit/aspect-loader';\nimport { MainRuntime } from '@teambit/cli';\nimport { GeneratorMain } from './generator.main.runtime';\n\nexport class StarterPlugin implements PluginDefinition {\n constructor(private generator: GeneratorMain) {}\n\n pattern = '*.starter.*';\n\n runtimes = [MainRuntime.name];\n\n register(object: any) {\n const templates = Array.isArray(object) ? object : [object];\n return this.generator.registerWorkspaceTemplate(templates);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAME,aAAa,CAA6B;EACrDC,WAAWA,CAASC,SAAwB,EAAE;IAAA,KAA1BA,SAAwB,GAAxBA,SAAwB;IAAA,IAAAC,gBAAA,GAAAC,OAAA,mBAElC,aAAa;IAAA,IAAAD,gBAAA,GAAAC,OAAA,oBAEZ,CAACC,kBAAW,CAACC,IAAI,CAAC;EAJkB;EAM/CC,QAAQA,CAACC,MAAW,EAAE;IACpB,MAAMC,SAAS,GAAGC,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC;IAC3D,OAAO,IAAI,CAACN,SAAS,CAACU,yBAAyB,CAACH,SAAS,CAAC;EAC5D;AACF;AAACI,OAAA,CAAAb,aAAA,GAAAA,aAAA"}
1
+ {"version":3,"names":["_cli","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","StarterPlugin","constructor","generator","MainRuntime","name","register","object","templates","Array","isArray","registerWorkspaceTemplate","exports"],"sources":["starter.plugin.ts"],"sourcesContent":["import { PluginDefinition } from '@teambit/aspect-loader';\nimport { MainRuntime } from '@teambit/cli';\nimport { GeneratorMain } from './generator.main.runtime';\n\nexport class StarterPlugin implements PluginDefinition {\n constructor(private generator: GeneratorMain) {}\n\n pattern = '*.starter.*';\n\n runtimes = [MainRuntime.name];\n\n register(object: any) {\n const templates = Array.isArray(object) ? object : [object];\n return this.generator.registerWorkspaceTemplate(templates);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2C,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAGpC,MAAMU,aAAa,CAA6B;EACrDC,WAAWA,CAASC,SAAwB,EAAE;IAAA,KAA1BA,SAAwB,GAAxBA,SAAwB;IAAAzB,eAAA,kBAElC,aAAa;IAAAA,eAAA,mBAEZ,CAAC0B,kBAAW,CAACC,IAAI,CAAC;EAJkB;EAM/CC,QAAQA,CAACC,MAAW,EAAE;IACpB,MAAMC,SAAS,GAAGC,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC;IAC3D,OAAO,IAAI,CAACJ,SAAS,CAACQ,yBAAyB,CAACH,SAAS,CAAC;EAC5D;AACF;AAACI,OAAA,CAAAX,aAAA,GAAAA,aAAA"}
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.promise.js");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_workspaceConfig","data","require","_gitIgnore","BasicWorkspaceStarter","name","description","generateFiles","context","relativePath","content","workspaceConfig","gitIgnore","exports","_default","default"],"sources":["basic.starter.ts"],"sourcesContent":["import { WorkspaceContext, Starter } from '../..';\nimport { workspaceConfig } from './template/files/workspace-config';\nimport { gitIgnore } from './template/files/git-ignore';\n\nexport const BasicWorkspaceStarter: Starter = {\n name: 'basic',\n description: 'a basic workspace',\n generateFiles: async (context: WorkspaceContext) => {\n return [\n {\n relativePath: 'workspace.jsonc',\n content: await workspaceConfig(context),\n },\n {\n relativePath: '.gitignore',\n content: gitIgnore(),\n },\n ];\n },\n};\n\nexport default BasicWorkspaceStarter;\n"],"mappings":";;;;;;;AACA,SAAAA,iBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,gBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,qBAA8B,GAAG;EAC5CC,IAAI,EAAE,OAAO;EACbC,WAAW,EAAE,mBAAmB;EAChCC,aAAa,EAAE,MAAOC,OAAyB,IAAK;IAClD,OAAO,CACL;MACEC,YAAY,EAAE,iBAAiB;MAC/BC,OAAO,EAAE,MAAM,IAAAC,kCAAe,EAACH,OAAO;IACxC,CAAC,EACD;MACEC,YAAY,EAAE,YAAY;MAC1BC,OAAO,EAAE,IAAAE,sBAAS,EAAC;IACrB,CAAC,CACF;EACH;AACF,CAAC;AAACC,OAAA,CAAAT,qBAAA,GAAAA,qBAAA;AAAA,IAAAU,QAAA,GAEaV,qBAAqB;AAAAS,OAAA,CAAAE,OAAA,GAAAD,QAAA"}
1
+ {"version":3,"names":["_workspaceConfig","data","require","_gitIgnore","BasicWorkspaceStarter","name","description","generateFiles","context","relativePath","content","workspaceConfig","gitIgnore","exports","_default","default"],"sources":["basic.starter.ts"],"sourcesContent":["import { WorkspaceContext, Starter } from '../..';\nimport { workspaceConfig } from './template/files/workspace-config';\nimport { gitIgnore } from './template/files/git-ignore';\n\nexport const BasicWorkspaceStarter: Starter = {\n name: 'basic',\n description: 'a basic workspace',\n generateFiles: async (context: WorkspaceContext) => {\n return [\n {\n relativePath: 'workspace.jsonc',\n content: await workspaceConfig(context),\n },\n {\n relativePath: '.gitignore',\n content: gitIgnore(),\n },\n ];\n },\n};\n\nexport default BasicWorkspaceStarter;\n"],"mappings":";;;;;;AACA,SAAAA,iBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,gBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,qBAA8B,GAAG;EAC5CC,IAAI,EAAE,OAAO;EACbC,WAAW,EAAE,mBAAmB;EAChCC,aAAa,EAAE,MAAOC,OAAyB,IAAK;IAClD,OAAO,CACL;MACEC,YAAY,EAAE,iBAAiB;MAC/BC,OAAO,EAAE,MAAM,IAAAC,kCAAe,EAACH,OAAO;IACxC,CAAC,EACD;MACEC,YAAY,EAAE,YAAY;MAC1BC,OAAO,EAAE,IAAAE,sBAAS,EAAC;IACrB,CAAC,CACF;EACH;AACF,CAAC;AAACC,OAAA,CAAAT,qBAAA,GAAAA,qBAAA;AAAA,IAAAU,QAAA,GAEaV,qBAAqB;AAAAS,OAAA,CAAAE,OAAA,GAAAD,QAAA"}
@@ -1,18 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- require("core-js/modules/es.promise.js");
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.workspaceConfig = workspaceConfig;
9
- function _defineProperty2() {
10
- const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
- _defineProperty2 = function () {
12
- return data;
13
- };
14
- return data;
15
- }
16
7
  function _config() {
17
8
  const data = require("@teambit/config");
18
9
  _config = function () {
@@ -21,7 +12,10 @@ function _config() {
21
12
  return data;
22
13
  }
23
14
  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; }
24
- 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; }
15
+ 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) { _defineProperty(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; }
16
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
25
19
  async function workspaceConfig({
26
20
  name,
27
21
  defaultScope
@@ -1 +1 @@
1
- {"version":3,"names":["_config","data","require","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","workspaceConfig","name","defaultScope","configParsed","getWorkspaceConfigTemplateParsed","packageManagerDefaultConfig","policy","dependencies","envs","stringifyWorkspaceConfig"],"sources":["workspace-config.ts"],"sourcesContent":["import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';\nimport { WorkspaceContext } from '../../../..';\n\nexport async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {\n const configParsed = await getWorkspaceConfigTemplateParsed();\n const packageManagerDefaultConfig = configParsed['teambit.dependencies/dependency-resolver'];\n configParsed['teambit.workspace/workspace'].name = name;\n configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';\n configParsed['teambit.dependencies/dependency-resolver'] = {\n ...packageManagerDefaultConfig,\n policy: {\n dependencies: {\n '@teambit/node.node': 'latest',\n '@types/node': '16.18.44',\n '@types/jest': '29.5.4',\n },\n },\n };\n\n delete configParsed['teambit.workspace/variants'];\n\n configParsed['teambit.generator/generator'] = {\n envs: [\n 'teambit.node/node',\n // \"teambit.angular/angular\",\n // \"teambit.vue/vue\",\n // \"teambit.react/react-env\",\n // \"teambit.html/html-env\"\n ],\n };\n\n return stringifyWorkspaceConfig(configParsed);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6F,SAAAE,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC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,CACJ;IACA;IACA;IACA;IACA;IAAA;EAEJ,CAAC;;EAED,OAAO,IAAAC,kCAAwB,EAACN,YAAY,CAAC;AAC/C"}
1
+ {"version":3,"names":["_config","data","require","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","workspaceConfig","name","defaultScope","configParsed","getWorkspaceConfigTemplateParsed","packageManagerDefaultConfig","policy","dependencies","envs","stringifyWorkspaceConfig"],"sources":["workspace-config.ts"],"sourcesContent":["import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';\nimport { WorkspaceContext } from '../../../..';\n\nexport async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {\n const configParsed = await getWorkspaceConfigTemplateParsed();\n const packageManagerDefaultConfig = configParsed['teambit.dependencies/dependency-resolver'];\n configParsed['teambit.workspace/workspace'].name = name;\n configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';\n configParsed['teambit.dependencies/dependency-resolver'] = {\n ...packageManagerDefaultConfig,\n policy: {\n dependencies: {\n '@teambit/node.node': 'latest',\n '@types/node': '16.18.44',\n '@types/jest': '29.5.4',\n },\n },\n };\n\n delete configParsed['teambit.workspace/variants'];\n\n configParsed['teambit.generator/generator'] = {\n envs: [\n 'teambit.node/node',\n // \"teambit.angular/angular\",\n // \"teambit.vue/vue\",\n // \"teambit.react/react-env\",\n // \"teambit.html/html-env\"\n ],\n };\n\n return stringifyWorkspaceConfig(configParsed);\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA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YAAY,CAAC;AAC/C"}
@@ -1,19 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- require("core-js/modules/es.symbol.description.js");
5
- require("core-js/modules/es.promise.js");
6
3
  Object.defineProperty(exports, "__esModule", {
7
4
  value: true
8
5
  });
9
6
  exports.TemplatesCmd = void 0;
10
- function _defineProperty2() {
11
- const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
- _defineProperty2 = function () {
13
- return data;
14
- };
15
- return data;
16
- }
17
7
  function _chalk() {
18
8
  const data = _interopRequireDefault(require("chalk"));
19
9
  _chalk = function () {
@@ -28,16 +18,20 @@ function _lodash() {
28
18
  };
29
19
  return data;
30
20
  }
21
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
24
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
31
25
  class TemplatesCmd {
32
26
  constructor(generator) {
33
27
  this.generator = generator;
34
- (0, _defineProperty2().default)(this, "name", 'templates');
35
- (0, _defineProperty2().default)(this, "description", 'list available templates for "bit create" and "bit new"');
36
- (0, _defineProperty2().default)(this, "extendedDescription", 'list components templates when inside bit-workspace (for bit-create), otherwise, list workspace templates (for bit-new)');
37
- (0, _defineProperty2().default)(this, "alias", '');
38
- (0, _defineProperty2().default)(this, "loader", true);
39
- (0, _defineProperty2().default)(this, "group", 'development');
40
- (0, _defineProperty2().default)(this, "options", [['s', 'show-all', 'show hidden templates'], ['a', 'aspect <aspect-id>', 'show templates provided by the aspect-id']]);
28
+ _defineProperty(this, "name", 'templates');
29
+ _defineProperty(this, "description", 'list available templates for "bit create" and "bit new"');
30
+ _defineProperty(this, "extendedDescription", 'list components templates when inside bit-workspace (for bit-create), otherwise, list workspace templates (for bit-new)');
31
+ _defineProperty(this, "alias", '');
32
+ _defineProperty(this, "loader", true);
33
+ _defineProperty(this, "group", 'development');
34
+ _defineProperty(this, "options", [['s', 'show-all', 'show hidden templates'], ['a', 'aspect <aspect-id>', 'show templates provided by the aspect-id']]);
41
35
  }
42
36
 
43
37
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","TemplatesCmd","constructor","generator","_defineProperty2","default","report","args","templatesOptions","results","listTemplates","showAll","filter","template","hidden","grouped","groupBy","titleStr","isRunningInsideWorkspace","title","chalk","green","templateOutput","desc","description","name","dim","output","Object","keys","map","aspectId","names","join","groupTitle","titlePrefix","blue","bold","exports"],"sources":["templates.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { groupBy } from 'lodash';\nimport { GeneratorMain, TemplateDescriptor } from './generator.main.runtime';\n\nexport type TemplatesOptions = {\n showAll?: boolean;\n aspect?: string;\n};\n\nexport class TemplatesCmd implements Command {\n name = 'templates';\n description = 'list available templates for \"bit create\" and \"bit new\"';\n extendedDescription =\n 'list components templates when inside bit-workspace (for bit-create), otherwise, list workspace templates (for bit-new)';\n alias = '';\n loader = true;\n group = 'development';\n options = [\n ['s', 'show-all', 'show hidden templates'],\n ['a', 'aspect <aspect-id>', 'show templates provided by the aspect-id'],\n ] as CommandOptions;\n\n constructor(private generator: GeneratorMain) {}\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async report(args: [], templatesOptions: TemplatesOptions) {\n let results = await this.generator.listTemplates(templatesOptions);\n\n // Make sure that we don't list hidden templates\n if (!templatesOptions.showAll) {\n results = results.filter((template) => !template.hidden);\n }\n\n const grouped = groupBy(results, 'aspectId');\n const titleStr = this.generator.isRunningInsideWorkspace()\n ? `The following template(s) are available with the command bit create: \\nExample - bit create <template-name> <component-name>`\n : `The following template(s) are available with the command bit new: \\nExample - bit new <template-name> <workspace-name>`;\n const title = chalk.green(`\\n${titleStr}\\n`);\n const templateOutput = (template: TemplateDescriptor) => {\n const desc = template.description ? ` (${template.description})` : '';\n return ` ${template.name}${chalk.dim(desc)}`;\n };\n const output = Object.keys(grouped)\n .map((aspectId) => {\n const names = grouped[aspectId].map(templateOutput).join('\\n');\n const groupTitle = grouped[aspectId][0].titlePrefix\n ? `${grouped[aspectId][0].titlePrefix} (${aspectId})`\n : aspectId;\n return `${chalk.blue.bold(groupTitle)}\\n${names}\\n`;\n })\n .join('\\n');\n return title + output;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQO,MAAMI,YAAY,CAAoB;EAa3CC,WAAWA,CAASC,SAAwB,EAAE;IAAA,KAA1BA,SAAwB,GAAxBA,SAAwB;IAAA,IAAAC,gBAAA,GAAAC,OAAA,gBAZrC,WAAW;IAAA,IAAAD,gBAAA,GAAAC,OAAA,uBACJ,yDAAyD;IAAA,IAAAD,gBAAA,GAAAC,OAAA,+BAErE,yHAAyH;IAAA,IAAAD,gBAAA,GAAAC,OAAA,iBACnH,EAAE;IAAA,IAAAD,gBAAA,GAAAC,OAAA,kBACD,IAAI;IAAA,IAAAD,gBAAA,GAAAC,OAAA,iBACL,aAAa;IAAA,IAA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C,GAAEpB,OAAO,CAACgB,QAAQ,CAAC,CAAC,CAAC,CAAC,CAACI,WAAY,KAAIJ,QAAS,GAAE,GACnDA,QAAQ;MACZ,OAAQ,GAAEX,gBAAK,CAACgB,IAAI,CAACC,IAAI,CAACH,UAAU,CAAE,KAAIF,KAAM,IAAG;IACrD,CAAC,CAAC,CACDC,IAAI,CAAC,IAAI,CAAC;IACb,OAAOd,KAAK,GAAGQ,MAAM;EACvB;AACF;AAACW,OAAA,CAAArC,YAAA,GAAAA,YAAA"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","TemplatesCmd","constructor","generator","report","args","templatesOptions","results","listTemplates","showAll","filter","template","hidden","grouped","groupBy","titleStr","isRunningInsideWorkspace","title","chalk","green","templateOutput","desc","description","name","dim","output","keys","map","aspectId","names","join","groupTitle","titlePrefix","blue","bold","exports"],"sources":["templates.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { groupBy } from 'lodash';\nimport { GeneratorMain, TemplateDescriptor } from './generator.main.runtime';\n\nexport type TemplatesOptions = {\n showAll?: boolean;\n aspect?: string;\n};\n\nexport class TemplatesCmd implements Command {\n name = 'templates';\n description = 'list available templates for \"bit create\" and \"bit new\"';\n extendedDescription =\n 'list components templates when inside bit-workspace (for bit-create), otherwise, list workspace templates (for bit-new)';\n alias = '';\n loader = true;\n group = 'development';\n options = [\n ['s', 'show-all', 'show hidden templates'],\n ['a', 'aspect <aspect-id>', 'show templates provided by the aspect-id'],\n ] as CommandOptions;\n\n constructor(private generator: GeneratorMain) {}\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async report(args: [], templatesOptions: TemplatesOptions) {\n let results = await this.generator.listTemplates(templatesOptions);\n\n // Make sure that we don't list hidden templates\n if (!templatesOptions.showAll) {\n results = results.filter((template) => !template.hidden);\n }\n\n const grouped = groupBy(results, 'aspectId');\n const titleStr = this.generator.isRunningInsideWorkspace()\n ? `The following template(s) are available with the command bit create: \\nExample - bit create <template-name> <component-name>`\n : `The following template(s) are available with the command bit new: \\nExample - bit new <template-name> <workspace-name>`;\n const title = chalk.green(`\\n${titleStr}\\n`);\n const templateOutput = (template: TemplateDescriptor) => {\n const desc = template.description ? ` (${template.description})` : '';\n return ` ${template.name}${chalk.dim(desc)}`;\n };\n const output = Object.keys(grouped)\n .map((aspectId) => {\n const names = grouped[aspectId].map(templateOutput).join('\\n');\n const groupTitle = grouped[aspectId][0].titlePrefix\n ? `${grouped[aspectId][0].titlePrefix} (${aspectId})`\n : aspectId;\n return `${chalk.blue.bold(groupTitle)}\\n${names}\\n`;\n })\n .join('\\n');\n return title + output;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiC,SAAAC,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;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