@teambit/generator 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generator.graphql.js +2 -2
- package/dist/generator.graphql.js.map +1 -1
- package/dist/generator.main.runtime.js +5 -4
- package/dist/generator.main.runtime.js.map +1 -1
- package/dist/{preview-1695698249502.js → preview-1695807370382.js} +2 -2
- package/dist/templates/basic/basic.starter.js +8 -4
- package/dist/templates/basic/basic.starter.js.map +1 -1
- package/dist/templates/basic/template/files/workspace-config.js +4 -4
- package/dist/templates/basic/template/files/workspace-config.js.map +1 -1
- package/dist/templates/starter/files/starter.js +4 -0
- package/dist/templates/starter/files/starter.js.map +1 -1
- package/dist/templates/starter/files/workspace-config-tpl.js +19 -9
- package/dist/templates/starter/files/workspace-config-tpl.js.map +1 -1
- package/dist/templates/starter-standalone/files/starter.js +9 -0
- package/dist/templates/starter-standalone/files/starter.js.map +1 -1
- package/dist/templates/starter-standalone/files/workspace-config-tpl.js +19 -8
- package/dist/templates/starter-standalone/files/workspace-config-tpl.js.map +1 -1
- package/package.json +22 -22
- package/templates/basic/basic.starter.ts +10 -5
- package/templates/basic/template/files/workspace-config.ts +2 -2
- package/templates/starter/files/starter.ts +5 -1
- package/templates/starter/files/workspace-config-tpl.ts +20 -10
- package/templates/starter-standalone/files/starter.ts +10 -1
- package/templates/starter-standalone/files/workspace-config-tpl.ts +20 -9
@@ -13,8 +13,8 @@ function _graphqlTag() {
|
|
13
13
|
}
|
14
14
|
const _excluded = ["name", "templateName"];
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
|
-
function ownKeys(
|
17
|
-
function _objectSpread(
|
16
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
17
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
18
18
|
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; }
|
19
19
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
20
20
|
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); }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_graphqlTag","data","_interopRequireDefault","require","_excluded","obj","__esModule","default","ownKeys","
|
1
|
+
{"version":3,"names":["_graphqlTag","data","_interopRequireDefault","require","_excluded","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","_objectWithoutProperties","source","excluded","target","_objectWithoutPropertiesLoose","i","sourceSymbolKeys","indexOf","prototype","propertyIsEnumerable","sourceKeys","generatorSchema","generator","typeDefs","gql","resolvers","Mutation","createComponent","req","_ref","name","templateName","options","generateComponentTemplate","map","component","id","toString","dir","files","Generator","templates","listTemplates","Query"],"sources":["generator.graphql.ts"],"sourcesContent":["import { Schema } from '@teambit/graphql';\nimport gql from 'graphql-tag';\nimport { GeneratorMain } from './generator.main.runtime';\nimport { CreateOptions } from './create.cmd';\n\nexport type CreateQueryOptions = CreateOptions & { templateName: string };\n\nexport function generatorSchema(generator: GeneratorMain): Schema {\n return {\n typeDefs: gql`\n type GenerateResult {\n id: String\n dir: String\n files: [String]\n }\n\n type Mutation {\n # create Component by template\n createComponent(\n name: String!\n templateName: String!\n scope: String\n namespace: String\n aspect: String\n ): [GenerateResult]\n }\n\n type TemplateDescriptor {\n aspectId: String!\n name: String!\n }\n\n type Generator {\n templates: [TemplateDescriptor]\n }\n\n type Query {\n generator: Generator\n }\n `,\n resolvers: {\n Mutation: {\n createComponent: async (req: any, { name, templateName, ...options }: CreateQueryOptions) => {\n const res = await generator.generateComponentTemplate([name], templateName, { name, ...options });\n return res.map((component) => ({\n id: component.id.toString(),\n dir: component.dir,\n files: component.files,\n }));\n },\n },\n Generator: {\n templates: async () => {\n return generator.listTemplates();\n },\n },\n Query: {\n generator: () => generator,\n },\n },\n };\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8B,MAAAG,SAAA;AAAA,SAAAF,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC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AG,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IACDC,SAAS,EAAE;MACTC,QAAQ,EAAE;QACRC,eAAe,EAAE,MAAAA,CAAOC,GAAQ,EAAAC,IAAA,KAA6D;UAAA,IAA3D;cAAEC,IAAI;cAAEC;YAA6C,CAAC,GAAAF,IAAA;YAA7BG,OAAO,GAAAtB,wBAAA,CAAAmB,IAAA,EAAA9D,SAAA;UAChE,MAAMuC,GAAG,GAAG,MAAMgB,SAAS,CAACW,yBAAyB,CAAC,CAACH,IAAI,CAAC,EAAEC,YAAY,EAAA/C,aAAA;YAAI8C;UAAI,GAAKE,OAAO,CAAE,CAAC;UACjG,OAAO1B,GAAG,CAAC4B,GAAG,CAAEC,SAAS,KAAM;YAC7BC,EAAE,EAAED,SAAS,CAACC,EAAE,CAACC,QAAQ,CAAC,CAAC;YAC3BC,GAAG,EAAEH,SAAS,CAACG,GAAG;YAClBC,KAAK,EAAEJ,SAAS,CAACI;UACnB,CAAC,CAAC,CAAC;QACL;MACF,CAAC;MACDC,SAAS,EAAE;QACTC,SAAS,EAAE,MAAAA,CAAA,KAAY;UACrB,OAAOnB,SAAS,CAACoB,aAAa,CAAC,CAAC;QAClC;MACF,CAAC;MACDC,KAAK,EAAE;QACLrB,SAAS,EAAEA,CAAA,KAAMA;MACnB;IACF;EACF,CAAC;AACH"}
|
@@ -196,8 +196,8 @@ function _generator3() {
|
|
196
196
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
197
197
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
198
198
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
199
|
-
function ownKeys(
|
200
|
-
function _objectSpread(
|
199
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
200
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
201
201
|
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; }
|
202
202
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
203
203
|
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); }
|
@@ -533,9 +533,10 @@ class GeneratorMain {
|
|
533
533
|
remoteEnvsAspect = globals.remoteEnvsAspect;
|
534
534
|
fullAspectId = globals.fullAspectId;
|
535
535
|
}
|
536
|
-
const allIds =
|
536
|
+
const allIds = [...new Set(configEnvs.concat(ids).concat([aspectId, fullAspectId]).filter(Boolean))];
|
537
537
|
const envs = await this.loadEnvs(allIds, remoteEnvsAspect);
|
538
|
-
const
|
538
|
+
const uniqueEnvs = envs.filter((v, i, a) => a.findIndex(t => t.id === v.id) === i);
|
539
|
+
const templates = uniqueEnvs.flatMap(env => {
|
539
540
|
if (!env.env.getGeneratorTemplates) return [];
|
540
541
|
const tpls = env.env.getGeneratorTemplates() || [];
|
541
542
|
const componentId = _component().ComponentID.fromString(env.id);
|
@@ -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","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(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n const { workspaceTemplate, aspect } = await this.findWorkspaceTemplateInGlobalScope(aspectId, name);\n if (workspaceTemplate) {\n return { workspaceTemplate, aspect };\n }\n throw new BitError(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n async searchRegisteredWorkspaceTemplate(\n name?: string,\n aspectId?: string,\n remoteEnvsAspect?: EnvsMain\n ): Promise<WorkspaceTemplate | undefined> {\n let fromEnv;\n\n if (aspectId) {\n fromEnv = await this.listEnvWorkspaceTemplates(aspectId, remoteEnvsAspect);\n }\n const templates = fromEnv && fromEnv.length ? fromEnv : this.getAllWorkspaceTemplatesFlattened();\n const found = templates.find(({ id, template: tpl }) => {\n if (aspectId && name) return aspectId === id && name === tpl.name;\n if (aspectId) return aspectId === id;\n if (name) return name === tpl.name;\n throw new Error(`searchRegisteredWorkspaceTemplate expects to get \"name\" or \"aspectId\"`);\n });\n\n return found?.template;\n }\n\n async generateComponentTemplate(\n componentNames: string[],\n templateName: string,\n options: Partial<CreateOptions>\n ): Promise<GenerateResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n await this.loadAspects();\n const { namespace, aspect } = options;\n\n const componentConfigLoadingRegistry = ComponentConfig.componentConfigLoadingRegistry;\n\n const templateWithId = await this.getComponentTemplate(templateName, aspect);\n\n ComponentConfig.componentConfigLoadingRegistry = componentConfigLoadingRegistry;\n\n if (!templateWithId) throw new BitError(`template \"${templateName}\" was not found`);\n\n const componentIds = componentNames.map((componentName) =>\n this.newComponentHelper.getNewComponentId(componentName, namespace, options.scope)\n );\n\n const 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,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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,CAhfYmB,aAAa,WAwZT,CACbmK,eAAI,CAACC,QAAQ,CAAsB,CAAC,EACpCD,eAAI,CAACC,QAAQ,CAAsB,CAAC,EACpCD,eAAI,CAACC,QAAQ,CAAsB,CAAC,CACrC;AAAAvL,eAAA,CA5ZUmB,aAAa,kBA8ZF,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,CA1aUmB,aAAa,aA4aP8K,kBAAW;AAsE9BzH,4BAAe,CAAC0H,UAAU,CAAC/K,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","e","r","t","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","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","Set","concat","uniqueEnvs","v","i","a","findIndex","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(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n const { workspaceTemplate, aspect } = await this.findWorkspaceTemplateInGlobalScope(aspectId, name);\n if (workspaceTemplate) {\n return { workspaceTemplate, aspect };\n }\n throw new BitError(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n async searchRegisteredWorkspaceTemplate(\n name?: string,\n aspectId?: string,\n remoteEnvsAspect?: EnvsMain\n ): Promise<WorkspaceTemplate | undefined> {\n let fromEnv;\n\n if (aspectId) {\n fromEnv = await this.listEnvWorkspaceTemplates(aspectId, remoteEnvsAspect);\n }\n const templates = fromEnv && fromEnv.length ? fromEnv : this.getAllWorkspaceTemplatesFlattened();\n const found = templates.find(({ id, template: tpl }) => {\n if (aspectId && name) return aspectId === id && name === tpl.name;\n if (aspectId) return aspectId === id;\n if (name) return name === tpl.name;\n throw new Error(`searchRegisteredWorkspaceTemplate expects to get \"name\" or \"aspectId\"`);\n });\n\n return found?.template;\n }\n\n async generateComponentTemplate(\n componentNames: string[],\n templateName: string,\n options: Partial<CreateOptions>\n ): Promise<GenerateResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n await this.loadAspects();\n const { namespace, aspect } = options;\n\n const componentConfigLoadingRegistry = ComponentConfig.componentConfigLoadingRegistry;\n\n const templateWithId = await this.getComponentTemplate(templateName, aspect);\n\n ComponentConfig.componentConfigLoadingRegistry = componentConfigLoadingRegistry;\n\n if (!templateWithId) throw new BitError(`template \"${templateName}\" was not found`);\n\n const componentIds = componentNames.map((componentName) =>\n this.newComponentHelper.getNewComponentId(componentName, namespace, options.scope)\n );\n\n const 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\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\n const allIds = [...new Set(configEnvs.concat(ids).concat([aspectId, fullAspectId]).filter(Boolean))];\n\n const envs = await this.loadEnvs(allIds, remoteEnvsAspect);\n const uniqueEnvs = envs.filter((v, i, a) => a.findIndex(t => (t.id === v.id)) === i);\n const templates = uniqueEnvs.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 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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sH,uBAAkB,EAClBC,6BAAwB,EACxBC,oBAAe,EACfC,kBAAa,EACbC,sBAAY,EACZC,cAAS,EACTC,+BAA0B,CAC3B;AAAAtM,eAAA,CA7aUmB,aAAa,aA+aPoL,kBAAW;AAsE9B/H,4BAAe,CAACgI,UAAU,CAACrL,aAAa,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@1.0.10/dist/generator.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@1.0.10/dist/generator.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
@@ -22,13 +22,17 @@ const BasicWorkspaceStarter = {
|
|
22
22
|
name: 'basic',
|
23
23
|
description: 'a basic workspace',
|
24
24
|
generateFiles: async context => {
|
25
|
-
|
25
|
+
const files = [{
|
26
26
|
relativePath: 'workspace.jsonc',
|
27
27
|
content: await (0, _workspaceConfig().workspaceConfig)(context)
|
28
|
-
}, {
|
29
|
-
relativePath: '.gitignore',
|
30
|
-
content: (0, _gitIgnore().gitIgnore)()
|
31
28
|
}];
|
29
|
+
if (!context.skipGit) {
|
30
|
+
files.push({
|
31
|
+
relativePath: '.gitignore',
|
32
|
+
content: (0, _gitIgnore().gitIgnore)()
|
33
|
+
});
|
34
|
+
}
|
35
|
+
return files;
|
32
36
|
}
|
33
37
|
};
|
34
38
|
exports.BasicWorkspaceStarter = BasicWorkspaceStarter;
|
@@ -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
|
1
|
+
{"version":3,"names":["_workspaceConfig","data","require","_gitIgnore","BasicWorkspaceStarter","name","description","generateFiles","context","files","relativePath","content","workspaceConfig","skipGit","push","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 const files = [\n {\n relativePath: 'workspace.jsonc',\n content: await workspaceConfig(context),\n },\n ];\n\n if (!context.skipGit) {\n files.push({\n relativePath: '.gitignore',\n content: gitIgnore(),\n });\n }\n\n return files;\n },\n};\n\nexport default BasicWorkspaceStarter;"],"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,MAAMC,KAAK,GAAG,CACZ;MACEC,YAAY,EAAE,iBAAiB;MAC/BC,OAAO,EAAE,MAAM,IAAAC,kCAAe,EAACJ,OAAO;IACxC,CAAC,CACF;IAED,IAAI,CAACA,OAAO,CAACK,OAAO,EAAE;MACpBJ,KAAK,CAACK,IAAI,CAAC;QACTJ,YAAY,EAAE,YAAY;QAC1BC,OAAO,EAAE,IAAAI,sBAAS,EAAC;MACrB,CAAC,CAAC;IACJ;IAEA,OAAON,KAAK;EACd;AACF,CAAC;AAACO,OAAA,CAAAZ,qBAAA,GAAAA,qBAAA;AAAA,IAAAa,QAAA,GAEab,qBAAqB;AAAAY,OAAA,CAAAE,OAAA,GAAAD,QAAA"}
|
@@ -11,8 +11,8 @@ function _config() {
|
|
11
11
|
};
|
12
12
|
return data;
|
13
13
|
}
|
14
|
-
function ownKeys(
|
15
|
-
function _objectSpread(
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
16
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
17
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
18
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); }
|
@@ -21,10 +21,10 @@ async function workspaceConfig({
|
|
21
21
|
defaultScope
|
22
22
|
}) {
|
23
23
|
const configParsed = await (0, _config().getWorkspaceConfigTemplateParsed)();
|
24
|
-
const
|
24
|
+
const dependencyResolverDefaultConfig = configParsed['teambit.dependencies/dependency-resolver'];
|
25
25
|
configParsed['teambit.workspace/workspace'].name = name;
|
26
26
|
configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';
|
27
|
-
configParsed['teambit.dependencies/dependency-resolver'] = _objectSpread(_objectSpread({},
|
27
|
+
configParsed['teambit.dependencies/dependency-resolver'] = _objectSpread(_objectSpread({}, dependencyResolverDefaultConfig), {}, {
|
28
28
|
policy: {
|
29
29
|
dependencies: {
|
30
30
|
'@teambit/node.node': 'latest',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_config","data","require","ownKeys","
|
1
|
+
{"version":3,"names":["_config","data","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","workspaceConfig","name","defaultScope","configParsed","getWorkspaceConfigTemplateParsed","dependencyResolverDefaultConfig","policy","dependencies","eslint","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 dependencyResolverDefaultConfig = 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 ...dependencyResolverDefaultConfig,\n policy: {\n dependencies: {\n '@teambit/node.node': 'latest',\n '@types/node': '16.18.44',\n '@types/jest': '29.5.4',\n eslint: '7.32.0',\n '@typescript-eslint/eslint-plugin': '5.62.0',\n 'eslint-import-resolver-node': '0.3.6',\n 'eslint-plugin-import': '2.22.1',\n 'eslint-plugin-jest': '24.1.5',\n 'eslint-plugin-jsx-a11y': '6.4.1',\n 'eslint-plugin-mdx': '1.17.1',\n 'eslint-plugin-react': '7.22.0',\n },\n },\n };\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,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,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U,MAAA,EAAAT,KAAA;AAGtF,eAAeU,eAAeA,CAAC;EAAEC,IAAI;EAAEC;AAA+B,CAAC,EAAE;EAC9E,MAAMC,YAAY,GAAG,MAAM,IAAAC,0CAAgC,EAAC,CAAC;EAC7D,MAAMC,+BAA+B,GAAGF,YAAY,CAAC,0CAA0C,CAAC;EAChGA,YAAY,CAAC,6BAA6B,CAAC,CAACF,IAAI,GAAGA,IAAI;EACvDE,YAAY,CAAC,6BAA6B,CAAC,CAACD,YAAY,GAAGA,YAAY,IAAI,WAAW;EACtFC,YAAY,CAAC,0CAA0C,CAAC,GAAA9B,aAAA,CAAAA,aAAA,KACnDgC,+BAA+B;IAClCC,MAAM,EAAE;MACNC,YAAY,EAAE;QACZ,oBAAoB,EAAE,QAAQ;QAC9B,aAAa,EAAE,UAAU;QACzB,aAAa,EAAE,QAAQ;QACvBC,MAAM,EAAE,QAAQ;QAChB,kCAAkC,EAAE,QAAQ;QAC5C,6BAA6B,EAAE,OAAO;QACtC,sBAAsB,EAAE,QAAQ;QAChC,oBAAoB,EAAE,QAAQ;QAC9B,wBAAwB,EAAE,OAAO;QACjC,mBAAmB,EAAE,QAAQ;QAC7B,qBAAqB,EAAE;MACzB;IACF;EAAC,EACF;EAEDL,YAAY,CAAC,6BAA6B,CAAC,GAAG;IAC5CM,IAAI,EAAE,CACJ;IACA;IACA;IACA;IACA;IAAA;EAEJ,CAAC;;EAED,OAAO,IAAAC,kCAAwB,EAACP,YAAY,CAAC;AAC/C"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["starterFile","namePascalCase","name"],"sources":["starter.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function starterFile({ namePascalCase, name }: ComponentContext) {\n return `import { WorkspaceContext, WorkspaceTemplate } from '@teambit/generator';\n import { generateFiles as generateCommonFiles } from './template/files/generate-files';\n \n export type ${namePascalCase}StarterOptions = Pick<WorkspaceTemplate, 'name' | 'description' | 'hidden'>;\n \n export class ${namePascalCase}WorkspaceStarter implements WorkspaceTemplate {\n constructor(\n readonly name = '${name}-workspace',\n readonly description = '${namePascalCase} workspace with a custom react env',\n readonly hidden = false\n ) {}\n \n async generateFiles(context: WorkspaceContext) {\n return generateCommonFiles(context);\n }\n \n fork() {\n return [\n {\n id: 'teambit.react/react-env-extension',\n targetName: 'envs/my-react-env',\n },\n ];\n }\n \n static from(options: Partial<${namePascalCase}StarterOptions>) {\n return () =>\n new ${namePascalCase}WorkspaceStarter(\n options.name,\n options.description,\n options.hidden\n );\n }\n }\n \n`;\n}
|
1
|
+
{"version":3,"names":["starterFile","namePascalCase","name"],"sources":["starter.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function starterFile({ namePascalCase, name }: ComponentContext) {\n return `import { WorkspaceContext, WorkspaceTemplate } from '@teambit/generator';\n import { generateFiles as generateCommonFiles } from './template/files/generate-files';\n \n export type ${namePascalCase}StarterOptions = Pick<WorkspaceTemplate, 'name' | 'description' | 'hidden'>;\n \n export class ${namePascalCase}WorkspaceStarter implements WorkspaceTemplate {\n constructor(\n readonly name = '${name}-workspace',\n readonly description = '${namePascalCase} workspace with a custom react env',\n readonly hidden = false\n ) {}\n \n async generateFiles(context: WorkspaceContext) {\n return generateCommonFiles(context);\n }\n \n fork() {\n return [\n {\n id: 'teambit.react/react-env-extension',\n targetName: 'envs/my-react-env',\n },\n ];\n }\n\n // import: () => [\n // { id: 'teambit.community/component-showcase' },\n // ]\n \n static from(options: Partial<${namePascalCase}StarterOptions>) {\n return () =>\n new ${namePascalCase}WorkspaceStarter(\n options.name,\n options.description,\n options.hidden\n );\n }\n }\n \n`;\n}"],"mappings":";;;;;;AAEO,SAASA,WAAWA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACtE,OAAQ;AACV;AACA;AACA,gBAAgBD,cAAe;AAC/B;AACA,iBAAiBA,cAAe;AAChC;AACA,yBAAyBC,IAAK;AAC9B,gCAAgCD,cAAe;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmCA,cAAe;AAClD;AACA,cAAcA,cAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
|
@@ -9,17 +9,27 @@ function workspaceConfigTemplate() {
|
|
9
9
|
import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';
|
10
10
|
|
11
11
|
export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
|
12
|
-
const scope = defaultScope || 'org.scope';
|
13
12
|
const configParsed = await getWorkspaceConfigTemplateParsed();
|
13
|
+
const packageManagerDefaultConfig = configParsed['teambit.dependencies/dependency-resolver'];
|
14
14
|
configParsed['teambit.workspace/workspace'].name = name;
|
15
|
-
configParsed['teambit.workspace/workspace'].defaultScope = scope;
|
16
|
-
configParsed['teambit.
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';
|
16
|
+
configParsed['teambit.dependencies/dependency-resolver'] = {
|
17
|
+
...packageManagerDefaultConfig,
|
18
|
+
policy: {
|
19
|
+
dependencies: {
|
20
|
+
'@teambit/node.node': 'latest',
|
21
|
+
'@types/node': '16.18.44',
|
22
|
+
'@types/jest': '29.5.4',
|
23
|
+
eslint: '7.32.0',
|
24
|
+
'@typescript-eslint/eslint-plugin': '5.62.0',
|
25
|
+
'eslint-import-resolver-node': '0.3.6',
|
26
|
+
'eslint-plugin-import': '2.22.1',
|
27
|
+
'eslint-plugin-jest': '24.1.5',
|
28
|
+
'eslint-plugin-jsx-a11y': '6.4.1',
|
29
|
+
'eslint-plugin-mdx': '1.17.1',
|
30
|
+
'eslint-plugin-react': '7.22.0',
|
31
|
+
},
|
32
|
+
},
|
23
33
|
};
|
24
34
|
|
25
35
|
return stringifyWorkspaceConfig(configParsed);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["workspaceConfigTemplate"],"sources":["workspace-config-tpl.ts"],"sourcesContent":["export function workspaceConfigTemplate() {\n return `import { WorkspaceContext } from '@teambit/generator';\nimport { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';\n\nexport async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {\n const
|
1
|
+
{"version":3,"names":["workspaceConfigTemplate"],"sources":["workspace-config-tpl.ts"],"sourcesContent":["export function workspaceConfigTemplate() {\n return `import { WorkspaceContext } from '@teambit/generator';\nimport { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';\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 eslint: '7.32.0',\n '@typescript-eslint/eslint-plugin': '5.62.0',\n 'eslint-import-resolver-node': '0.3.6',\n 'eslint-plugin-import': '2.22.1',\n 'eslint-plugin-jest': '24.1.5',\n 'eslint-plugin-jsx-a11y': '6.4.1',\n 'eslint-plugin-mdx': '1.17.1',\n 'eslint-plugin-react': '7.22.0',\n },\n },\n };\n\n return stringifyWorkspaceConfig(configParsed);\n}\n`;\n}"],"mappings":";;;;;;AAAO,SAASA,uBAAuBA,CAAA,EAAG;EACxC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
|
@@ -35,6 +35,15 @@ function starterFile({
|
|
35
35
|
import: () => [
|
36
36
|
{ id: 'teambit.community/component-showcase' },
|
37
37
|
]
|
38
|
+
// you can also fork components
|
39
|
+
// fork: () => [
|
40
|
+
// {
|
41
|
+
// id: 'teambit.react/react-env-extension',
|
42
|
+
// targetName: 'envs/my-react-env',
|
43
|
+
// },
|
44
|
+
// ]
|
45
|
+
|
46
|
+
|
38
47
|
};
|
39
48
|
|
40
49
|
export default ${namePascalCase}WorkspaceStarter;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["starterFile","namePascalCase","name"],"sources":["starter.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function starterFile({ namePascalCase, name }: ComponentContext) {\n return `import { WorkspaceContext, Starter } from '@teambit/generator';\n import { workspaceConfig } from './template/files/workspace-config';\n import { gitIgnore } from './template/files/git-ignore';\n \n export const ${namePascalCase}WorkspaceStarter: Starter = {\n name: '${name}-workspace',\n description: 'a ${name} workspace',\n generateFiles: async (context: WorkspaceContext) => {\n const files = [\n {\n relativePath: 'workspace.jsonc',\n content: await workspaceConfig(context),\n },\n ];\n \n if (!context.skipGit) {\n files.push({\n relativePath: '.gitignore',\n content: gitIgnore(),\n });\n }\n \n return files;\n },\n import: () => [\n { id: 'teambit.community/component-showcase' },\n ]\n };\n \n export default ${namePascalCase}WorkspaceStarter;\n`;\n}
|
1
|
+
{"version":3,"names":["starterFile","namePascalCase","name"],"sources":["starter.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function starterFile({ namePascalCase, name }: ComponentContext) {\n return `import { WorkspaceContext, Starter } from '@teambit/generator';\n import { workspaceConfig } from './template/files/workspace-config';\n import { gitIgnore } from './template/files/git-ignore';\n \n export const ${namePascalCase}WorkspaceStarter: Starter = {\n name: '${name}-workspace',\n description: 'a ${name} workspace',\n generateFiles: async (context: WorkspaceContext) => {\n const files = [\n {\n relativePath: 'workspace.jsonc',\n content: await workspaceConfig(context),\n },\n ];\n \n if (!context.skipGit) {\n files.push({\n relativePath: '.gitignore',\n content: gitIgnore(),\n });\n }\n \n return files;\n },\n import: () => [\n { id: 'teambit.community/component-showcase' },\n ]\n// you can also fork components\n// fork: () => [\n// {\n// id: 'teambit.react/react-env-extension',\n// targetName: 'envs/my-react-env',\n// },\n// ]\n\n\n };\n \n export default ${namePascalCase}WorkspaceStarter;\n`;\n}"],"mappings":";;;;;;AAEO,SAASA,WAAWA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACtE,OAAQ;AACV;AACA;AACA;AACA,iBAAiBD,cAAe;AAChC,aAAaC,IAAK;AAClB,sBAAsBA,IAAK;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmBD,cAAe;AAClC,CAAC;AACD"}
|
@@ -10,18 +10,29 @@ import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@tea
|
|
10
10
|
|
11
11
|
export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
|
12
12
|
const configParsed = await getWorkspaceConfigTemplateParsed();
|
13
|
+
const packageManagerDefaultConfig = configParsed['teambit.dependencies/dependency-resolver'];
|
13
14
|
configParsed['teambit.workspace/workspace'].name = name;
|
14
15
|
configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';
|
15
|
-
configParsed['teambit.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
16
|
+
configParsed['teambit.dependencies/dependency-resolver'] = {
|
17
|
+
...packageManagerDefaultConfig,
|
18
|
+
policy: {
|
19
|
+
dependencies: {
|
20
|
+
'@teambit/node.node': 'latest',
|
21
|
+
'@types/node': '16.18.44',
|
22
|
+
'@types/jest': '29.5.4',
|
23
|
+
eslint: '7.32.0',
|
24
|
+
'@typescript-eslint/eslint-plugin': '5.62.0',
|
25
|
+
'eslint-import-resolver-node': '0.3.6',
|
26
|
+
'eslint-plugin-import': '2.22.1',
|
27
|
+
'eslint-plugin-jest': '24.1.5',
|
28
|
+
'eslint-plugin-jsx-a11y': '6.4.1',
|
29
|
+
'eslint-plugin-mdx': '1.17.1',
|
30
|
+
'eslint-plugin-react': '7.22.0',
|
31
|
+
},
|
32
|
+
},
|
23
33
|
};
|
24
34
|
|
35
|
+
|
25
36
|
return stringifyWorkspaceConfig(configParsed);
|
26
37
|
}
|
27
38
|
`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["workspaceConfigTemplate"],"sources":["workspace-config-tpl.ts"],"sourcesContent":["export function workspaceConfigTemplate() {\n return `import { WorkspaceContext } from '@teambit/generator';\nimport { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';\n\nexport async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {\n const configParsed = await getWorkspaceConfigTemplateParsed();\n configParsed['teambit.workspace/workspace'].name = name;\n configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';\n configParsed['teambit.
|
1
|
+
{"version":3,"names":["workspaceConfigTemplate"],"sources":["workspace-config-tpl.ts"],"sourcesContent":["export function workspaceConfigTemplate() {\n return `import { WorkspaceContext } from '@teambit/generator';\nimport { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';\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 eslint: '7.32.0',\n '@typescript-eslint/eslint-plugin': '5.62.0',\n 'eslint-import-resolver-node': '0.3.6',\n 'eslint-plugin-import': '2.22.1',\n 'eslint-plugin-jest': '24.1.5',\n 'eslint-plugin-jsx-a11y': '6.4.1',\n 'eslint-plugin-mdx': '1.17.1',\n 'eslint-plugin-react': '7.22.0',\n },\n },\n };\n\n\n return stringifyWorkspaceConfig(configParsed);\n}\n`;\n}"],"mappings":";;;;;;AAAO,SAASA,uBAAuBA,CAAA,EAAG;EACxC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/generator",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.10",
|
4
4
|
"homepage": "https://bit.cloud/teambit/generator/generator",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.generator",
|
8
8
|
"name": "generator",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.10"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"camelcase": "6.2.0",
|
@@ -22,25 +22,25 @@
|
|
22
22
|
"@teambit/component-id": "0.0.427",
|
23
23
|
"@teambit/harmony": "0.4.6",
|
24
24
|
"@teambit/bit-error": "0.0.404",
|
25
|
-
"@teambit/envs": "1.0.
|
26
|
-
"@teambit/logger": "0.0.
|
27
|
-
"@teambit/new-component-helper": "1.0.
|
28
|
-
"@teambit/tracker": "1.0.
|
29
|
-
"@teambit/workspace-config-files": "1.0.
|
30
|
-
"@teambit/workspace.modules.node-modules-linker": "0.0.
|
31
|
-
"@teambit/workspace": "1.0.
|
32
|
-
"@teambit/component": "1.0.
|
33
|
-
"@teambit/cli": "0.0.
|
34
|
-
"@teambit/graphql": "1.0.
|
35
|
-
"@teambit/aspect-loader": "1.0.
|
36
|
-
"@teambit/bit": "1.0.
|
37
|
-
"@teambit/git": "1.0.
|
38
|
-
"@teambit/compiler": "1.0.
|
39
|
-
"@teambit/forking": "1.0.
|
40
|
-
"@teambit/importer": "1.0.
|
41
|
-
"@teambit/install": "1.0.
|
42
|
-
"@teambit/ui": "1.0.
|
43
|
-
"@teambit/config": "0.0.
|
25
|
+
"@teambit/envs": "1.0.9",
|
26
|
+
"@teambit/logger": "0.0.884",
|
27
|
+
"@teambit/new-component-helper": "1.0.9",
|
28
|
+
"@teambit/tracker": "1.0.9",
|
29
|
+
"@teambit/workspace-config-files": "1.0.9",
|
30
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.133",
|
31
|
+
"@teambit/workspace": "1.0.9",
|
32
|
+
"@teambit/component": "1.0.9",
|
33
|
+
"@teambit/cli": "0.0.791",
|
34
|
+
"@teambit/graphql": "1.0.9",
|
35
|
+
"@teambit/aspect-loader": "1.0.9",
|
36
|
+
"@teambit/bit": "1.0.9",
|
37
|
+
"@teambit/git": "1.0.9",
|
38
|
+
"@teambit/compiler": "1.0.9",
|
39
|
+
"@teambit/forking": "1.0.9",
|
40
|
+
"@teambit/importer": "1.0.9",
|
41
|
+
"@teambit/install": "1.0.9",
|
42
|
+
"@teambit/ui": "1.0.9",
|
43
|
+
"@teambit/config": "0.0.806"
|
44
44
|
},
|
45
45
|
"devDependencies": {
|
46
46
|
"@types/fs-extra": "9.0.7",
|
@@ -54,7 +54,7 @@
|
|
54
54
|
"@teambit/generator.aspect-docs.generator": "0.0.165"
|
55
55
|
},
|
56
56
|
"peerDependencies": {
|
57
|
-
"@teambit/legacy": "1.0.
|
57
|
+
"@teambit/legacy": "1.0.571",
|
58
58
|
"react": "^16.8.0 || ^17.0.0",
|
59
59
|
"react-dom": "^16.8.0 || ^17.0.0"
|
60
60
|
},
|
@@ -6,17 +6,22 @@ export const BasicWorkspaceStarter: Starter = {
|
|
6
6
|
name: 'basic',
|
7
7
|
description: 'a basic workspace',
|
8
8
|
generateFiles: async (context: WorkspaceContext) => {
|
9
|
-
|
9
|
+
const files = [
|
10
10
|
{
|
11
11
|
relativePath: 'workspace.jsonc',
|
12
12
|
content: await workspaceConfig(context),
|
13
13
|
},
|
14
|
-
|
14
|
+
];
|
15
|
+
|
16
|
+
if (!context.skipGit) {
|
17
|
+
files.push({
|
15
18
|
relativePath: '.gitignore',
|
16
19
|
content: gitIgnore(),
|
17
|
-
}
|
18
|
-
|
20
|
+
});
|
21
|
+
}
|
22
|
+
|
23
|
+
return files;
|
19
24
|
},
|
20
25
|
};
|
21
26
|
|
22
|
-
export default BasicWorkspaceStarter;
|
27
|
+
export default BasicWorkspaceStarter;
|
@@ -3,11 +3,11 @@ import { WorkspaceContext } from '../../../..';
|
|
3
3
|
|
4
4
|
export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
|
5
5
|
const configParsed = await getWorkspaceConfigTemplateParsed();
|
6
|
-
const
|
6
|
+
const dependencyResolverDefaultConfig = configParsed['teambit.dependencies/dependency-resolver'];
|
7
7
|
configParsed['teambit.workspace/workspace'].name = name;
|
8
8
|
configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';
|
9
9
|
configParsed['teambit.dependencies/dependency-resolver'] = {
|
10
|
-
...
|
10
|
+
...dependencyResolverDefaultConfig,
|
11
11
|
policy: {
|
12
12
|
dependencies: {
|
13
13
|
'@teambit/node.node': 'latest',
|
@@ -25,6 +25,10 @@ export function starterFile({ namePascalCase, name }: ComponentContext) {
|
|
25
25
|
},
|
26
26
|
];
|
27
27
|
}
|
28
|
+
|
29
|
+
// import: () => [
|
30
|
+
// { id: 'teambit.community/component-showcase' },
|
31
|
+
// ]
|
28
32
|
|
29
33
|
static from(options: Partial<${namePascalCase}StarterOptions>) {
|
30
34
|
return () =>
|
@@ -37,4 +41,4 @@ export function starterFile({ namePascalCase, name }: ComponentContext) {
|
|
37
41
|
}
|
38
42
|
|
39
43
|
`;
|
40
|
-
}
|
44
|
+
}
|
@@ -3,20 +3,30 @@ export function workspaceConfigTemplate() {
|
|
3
3
|
import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';
|
4
4
|
|
5
5
|
export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
|
6
|
-
const scope = defaultScope || 'org.scope';
|
7
6
|
const configParsed = await getWorkspaceConfigTemplateParsed();
|
7
|
+
const packageManagerDefaultConfig = configParsed['teambit.dependencies/dependency-resolver'];
|
8
8
|
configParsed['teambit.workspace/workspace'].name = name;
|
9
|
-
configParsed['teambit.workspace/workspace'].defaultScope = scope;
|
10
|
-
configParsed['teambit.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';
|
10
|
+
configParsed['teambit.dependencies/dependency-resolver'] = {
|
11
|
+
...packageManagerDefaultConfig,
|
12
|
+
policy: {
|
13
|
+
dependencies: {
|
14
|
+
'@teambit/node.node': 'latest',
|
15
|
+
'@types/node': '16.18.44',
|
16
|
+
'@types/jest': '29.5.4',
|
17
|
+
eslint: '7.32.0',
|
18
|
+
'@typescript-eslint/eslint-plugin': '5.62.0',
|
19
|
+
'eslint-import-resolver-node': '0.3.6',
|
20
|
+
'eslint-plugin-import': '2.22.1',
|
21
|
+
'eslint-plugin-jest': '24.1.5',
|
22
|
+
'eslint-plugin-jsx-a11y': '6.4.1',
|
23
|
+
'eslint-plugin-mdx': '1.17.1',
|
24
|
+
'eslint-plugin-react': '7.22.0',
|
25
|
+
},
|
26
|
+
},
|
17
27
|
};
|
18
28
|
|
19
29
|
return stringifyWorkspaceConfig(configParsed);
|
20
30
|
}
|
21
31
|
`;
|
22
|
-
}
|
32
|
+
}
|
@@ -28,8 +28,17 @@ export function starterFile({ namePascalCase, name }: ComponentContext) {
|
|
28
28
|
import: () => [
|
29
29
|
{ id: 'teambit.community/component-showcase' },
|
30
30
|
]
|
31
|
+
// you can also fork components
|
32
|
+
// fork: () => [
|
33
|
+
// {
|
34
|
+
// id: 'teambit.react/react-env-extension',
|
35
|
+
// targetName: 'envs/my-react-env',
|
36
|
+
// },
|
37
|
+
// ]
|
38
|
+
|
39
|
+
|
31
40
|
};
|
32
41
|
|
33
42
|
export default ${namePascalCase}WorkspaceStarter;
|
34
43
|
`;
|
35
|
-
}
|
44
|
+
}
|
@@ -4,19 +4,30 @@ import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@tea
|
|
4
4
|
|
5
5
|
export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
|
6
6
|
const configParsed = await getWorkspaceConfigTemplateParsed();
|
7
|
+
const packageManagerDefaultConfig = configParsed['teambit.dependencies/dependency-resolver'];
|
7
8
|
configParsed['teambit.workspace/workspace'].name = name;
|
8
9
|
configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';
|
9
|
-
configParsed['teambit.
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
configParsed['teambit.dependencies/dependency-resolver'] = {
|
11
|
+
...packageManagerDefaultConfig,
|
12
|
+
policy: {
|
13
|
+
dependencies: {
|
14
|
+
'@teambit/node.node': 'latest',
|
15
|
+
'@types/node': '16.18.44',
|
16
|
+
'@types/jest': '29.5.4',
|
17
|
+
eslint: '7.32.0',
|
18
|
+
'@typescript-eslint/eslint-plugin': '5.62.0',
|
19
|
+
'eslint-import-resolver-node': '0.3.6',
|
20
|
+
'eslint-plugin-import': '2.22.1',
|
21
|
+
'eslint-plugin-jest': '24.1.5',
|
22
|
+
'eslint-plugin-jsx-a11y': '6.4.1',
|
23
|
+
'eslint-plugin-mdx': '1.17.1',
|
24
|
+
'eslint-plugin-react': '7.22.0',
|
25
|
+
},
|
26
|
+
},
|
17
27
|
};
|
18
28
|
|
29
|
+
|
19
30
|
return stringifyWorkspaceConfig(configParsed);
|
20
31
|
}
|
21
32
|
`;
|
22
|
-
}
|
33
|
+
}
|