@teambit/generator 1.0.210 → 1.0.211
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_generator_generator-preview.js +1 -1
- package/artifacts/schema.json +1 -1
- package/dist/create.cmd.js +1 -1
- package/dist/create.cmd.js.map +1 -1
- package/dist/generator.graphql.js +1 -1
- package/dist/generator.graphql.js.map +1 -1
- package/dist/generator.main.runtime.js +1 -1
- package/dist/generator.main.runtime.js.map +1 -1
- package/dist/generator.service.js +1 -1
- package/dist/new.cmd.js +1 -1
- package/dist/new.cmd.js.map +1 -1
- package/dist/{preview-1711509617758.js → preview-1711617900376.js} +2 -2
- package/dist/starter.plugin.js +1 -1
- package/dist/starter.plugin.js.map +1 -1
- package/dist/templates/basic/template/files/workspace-config.js +1 -1
- package/dist/templates/basic/template/files/workspace-config.js.map +1 -1
- package/dist/templates.cmd.js +1 -1
- package/dist/templates.cmd.js.map +1 -1
- package/dist/workspace-generator.js +1 -1
- package/dist/workspace-generator.js.map +1 -1
- package/package.json +18 -18
@@ -1,4 +1,4 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<testsuites tests="0" failures="0" errors="0" skipped="0">
|
3
|
-
<testsuite name="teambit.generator/generator@1.0.
|
3
|
+
<testsuite name="teambit.generator/generator@1.0.211" tests="0" failures="0" errors="0" skipped="0"/>
|
4
4
|
</testsuites>
|
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.generator/generator-preview"]=t():e["teambit.generator/generator-preview"]=t()}(self,(()=>(()=>{"use strict";var e={
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.generator/generator-preview"]=t():e["teambit.generator/generator-preview"]=t()}(self,(()=>(()=>{"use strict";var e={76094:(e,t,n)=>{var o={id:"teambit.generator/aspect-docs/generator@0.0.171",homepage:"https://bit.cloud/teambit/generator/aspect-docs/generator",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=c,l(n(41594));var a=n(5016),r=["components"];function l(e){return e&&e.__esModule?e:{default:e}}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},p.apply(this,arguments)}function m(e,t){if(null==e)return{};var n,o,a=i(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function i(e,t){if(null==e)return{};var n,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(a[n]=e[n]);return a}l.__bit_component=o,p.__bit_component=o,m.__bit_component=o,i.__bit_component=o;var s={},d="wrapper";function c(e){var t=e.components,n=m(e,r);return(0,a.mdx)(d,p({},s,n,{components:t,mdxType:"MDXLayout"}),(0,a.mdx)("p",null,"Generator extension enable generating new components by pre-defined templates"),(0,a.mdx)("h3",null,"Component location"),(0,a.mdx)("p",null,"Component location in the workspace directory tree is defined with the ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit create")," command (see below). For example, a component named ",(0,a.mdx)("inlineCode",{parentName:"p"},"ShoppingCart")," created in the ",(0,a.mdx)("inlineCode",{parentName:"p"},"acme.shopper")," and the namespace ",(0,a.mdx)("inlineCode",{parentName:"p"},"ui")," will be generated in the following directory:"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre"},"acme.shopper/ui/shopping-cart\n")),(0,a.mdx)("h3",null,"Component name"),(0,a.mdx)("p",null,"When using templates Bit will use CamelCasing for passing the component-name to the template, but generated file structure should be in kebab-case, for better cross-operating-system compatibility of the component."),(0,a.mdx)("h3",null,"Automatically ",(0,a.mdx)("inlineCode",{parentName:"h3"},"add")," component"),(0,a.mdx)("p",null,"Bit should automatically register the new component to the ",(0,a.mdx)("inlineCode",{parentName:"p"},".bitmap")," file with a symmetrical name to the component-location in the workspace."),(0,a.mdx)("h2",null,"Register a template"),(0,a.mdx)("p",null,"Any aspect (include envs) can register templates. Each template should have a name and a list of files. Each file has a relative-path to the component-dir and template content. See the ",(0,a.mdx)("inlineCode",{parentName:"p"},"component-template.ts")," file for more info about the exact API."),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},"Component name should be available as a param for the file-content-template."),(0,a.mdx)("li",{parentName:"ul"},"TBD: An environment must have a default template (if not set, use first template in array?).")),(0,a.mdx)("p",null,"To register a template, use the Generator API: ",(0,a.mdx)("inlineCode",{parentName:"p"},"registerComponentTemplate(templates: ComponentTemplate[])"),"."),(0,a.mdx)("p",null,"To make the templates of an aspect available on a workspace, they need to be added to the workspace.jsonc. For example:"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.generator/generator": {\n "aspects": [\n "teambit.harmony/aspect"\n ]\n },\n')),(0,a.mdx)("p",null,"In the example above, the aspect ",(0,a.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/aspect")," is configured to be available for the generator."),(0,a.mdx)("h2",null,"Show all available templates"),(0,a.mdx)("p",null,"Introduce a new command ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit templates"),", which groups all available templates by aspects."),(0,a.mdx)("h2",null,"Hide core templates"),(0,a.mdx)("p",null,"Configure the Generator aspect to hide core templates when running ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit templates"),". They'll be only shown when using ",(0,a.mdx)("inlineCode",{parentName:"p"},"--show-all")," flag."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.generator/generator": {\n "hideCoreTemplates": true\n },\n')),(0,a.mdx)("h2",null,"Generate a template from CLI"),(0,a.mdx)("p",null,"Introduce a ",(0,a.mdx)("inlineCode",{parentName:"p"},"create")," command to use templates."),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-sh"},"bit create <template-name> <component-name...> [--scope | -s] [--namespace | -n] [--aspect | -a]\n")),(0,a.mdx)("h3",null,"Args"),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"<component name>")),(0,a.mdx)("p",null,"Name of the component to create. Will be used as the component's dir name and fed to the component template."),(0,a.mdx)("p",null,(0,a.mdx)("strong",{parentName:"p"},"generated file structure should use kebab-case, while the template itself be in camel case"),"."),(0,a.mdx)("h3",null,"Options"),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"[--scope | -s]")),(0,a.mdx)("p",null,"Sets the component's scope and base directory. If not defined, use the ",(0,a.mdx)("inlineCode",{parentName:"p"},"defaultScope")," from ",(0,a.mdx)("inlineCode",{parentName:"p"},"teambit.workspace/workspace")," config."),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"[--namespace | -n]")),(0,a.mdx)("p",null,"Sets the component's namespace and nested dirs inside the scope. If not define, use empty string."),(0,a.mdx)("h4",null,(0,a.mdx)("inlineCode",{parentName:"h4"},"[--aspect | -a]")),(0,a.mdx)("p",null,"Aspect ID that registered this template, required only if there are two templates with the same name from several aspects in the workspace."),(0,a.mdx)("h2",null,"Creating a custom template generator"),(0,a.mdx)("p",null,"See our ",(0,a.mdx)("a",{parentName:"p",href:"https://harmony-docs.bit.dev/extending-bit/creating-a-custom-generator"},"tutorial")," on how to Create your own custom component generator."))}c.__bit_component=o,c.isMDXComponent=!0},30862:(e,t,n)=>{Object.defineProperty(t,"W",{enumerable:!0,get:function(){return o.default}});var o=a(n(76094));function a(e){return e&&e.__esModule?e:{default:e}}a.__bit_component={id:"teambit.generator/aspect-docs/generator@0.0.171",homepage:"https://bit.cloud/teambit/generator/aspect-docs/generator",exported:!0}},73518:(e,t,n)=>{var o={id:"teambit.generator/generator@1.0.211",homepage:"https://bit.cloud/teambit/generator/generator",exported:!0};function a(){const e=r(n(41594));return a=function(){return e},e}function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,a.__bit_component=o,r.__bit_component=o;const l=()=>a().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},a().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/generator-new.svg"}));l.__bit_component=o,t.Logo=l},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{compositions:()=>c,compositions_metadata:()=>h,overview:()=>u});var e={};n.r(e),n.d(e,{default:()=>d});var t=n(73518),a=(n(41594),n(5016));const r=TeambitMdxUiMdxScopeContext;var l=n(30862),p=["components"];function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},m.apply(this,arguments)}var i={},s="wrapper";function d(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,a=function(e,t){if(null==e)return{};var n,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,p);return(0,a.mdx)(s,m({},i,n,{components:t,mdxType:"MDXLayout"}),(0,a.mdx)(r.MDXScopeProvider,{components:{Generator:l.W},mdxType:"MDXScopeProvider"},(0,a.mdx)(l.W,{mdxType:"Generator"})))}d.isMDXComponent=!0;const c=[t],u=[e],h={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
|
package/artifacts/schema.json
CHANGED
@@ -13159,7 +13159,7 @@
|
|
13159
13159
|
"componentId": {
|
13160
13160
|
"scope": "teambit.generator",
|
13161
13161
|
"name": "generator",
|
13162
|
-
"version": "1.0.
|
13162
|
+
"version": "1.0.211"
|
13163
13163
|
},
|
13164
13164
|
"taggedModuleExports": []
|
13165
13165
|
}
|
package/dist/create.cmd.js
CHANGED
@@ -13,7 +13,7 @@ function _chalk() {
|
|
13
13
|
}
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
17
17
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
18
18
|
/**
|
19
19
|
* CreateOptions combines foundational properties with additional options for creating a component.
|
package/dist/create.cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","CreateCmd","constructor","generator","name","description","cmd","report","templateName","componentNames","options","aspectId","template","results","generateComponentTemplate","title","length","componentsData","map","result","chalk","bold","id","toString","dir","envId","envSetBy","packageName","join","footer","green","exports"],"sources":["create.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentID } from '@teambit/component';\nimport chalk from 'chalk';\nimport { GeneratorMain } from './generator.main.runtime';\nimport type { BaseComponentTemplateOptions } from './component-template';\n\n/**\n * CreateOptions combines foundational properties with additional options for creating a component.\n */\nexport type CreateOptions = BaseComponentTemplateOptions & {\n env?: string;\n aspect?: string;\n force?: boolean;\n};\n\nexport class CreateCmd implements Command {\n name = 'create <template-name> <component-names...>';\n description = 'create a new component (source files and config) using a template.';\n alias = '';\n loader = true;\n helpUrl = 'reference/starters/create-starter';\n arguments = [\n {\n name: 'template-name',\n description:\n \"the template for generating the component \\n(run 'bit templates' for a list of available templates)\",\n },\n {\n name: 'component-names...',\n description: 'a list of component names to generate',\n },\n ];\n examples = [\n {\n cmd: 'bit create react ui/button --aspect teambit.react/react-env',\n description: \"creates a component named 'ui/button' using the 'react' template\",\n },\n {\n cmd: 'bit create node utils/is-string utils/is-number --aspect teambit.node/node',\n description:\n \"creates two components, 'utils/is-string' and 'utils/is-number' using the 'node' template from the 'node' aspect(env)\",\n },\n {\n cmd: 'bit create mdx docs/create-components --aspect teambit.mdx/mdx-env --scope my-org.my-scope',\n description:\n \"creates an mdx component named 'docs/create-components' and sets it scope to 'my-org.my-scope'. \\nby default, the scope is the `defaultScope` value, configured in your `workspace.jsonc`.\",\n },\n {\n cmd: 'bit create react ui/button --aspect teambit.react/react-env --env teambit.community/envs/community-react@3.0.3',\n description:\n \"creates a component named 'ui/button' from the teambit.react/react-env env and sets it to use the 'community-react' env. \\n(the template's default env is 'teambit.react/react-env').\",\n },\n ];\n group = 'development';\n options = [\n ['n', 'namespace <string>', `sets the component's namespace and nested dirs inside the scope`],\n ['s', 'scope <string>', `sets the component's scope-name. if not entered, the default-scope will be used`],\n ['a', 'aspect <string>', 'aspect-id of the template. helpful when multiple aspects use the same template name'],\n ['t', 'template <string>', 'env-id of the template. alias for --aspect.'],\n ['p', 'path <string>', 'relative path in the workspace. by default the path is `<scope>/<namespace>/<name>`'],\n ['e', 'env <string>', \"set the component's environment. (overrides the env from variants and the template)\"],\n ['f', 'force', 'replace existing files at the target location'],\n ] as CommandOptions;\n\n constructor(private generator: GeneratorMain) {}\n\n async report(\n [templateName, componentNames]: [string, string[]],\n options: Partial<CreateOptions> & {\n template?: string | ComponentID;\n force?: boolean;\n }\n ) {\n options.aspectId = options.aspectId ?? options.template;\n const results = await this.generator.generateComponentTemplate(componentNames, templateName, options);\n const title = `${results.length} component(s) were created`;\n\n const componentsData = results\n .map((result) => {\n return `${chalk.bold(result.id.toString())}\n location: ${result.dir}\n env: ${result.envId} (set by ${result.envSetBy})\n package: ${result.packageName}\n`;\n })\n .join('\\n');\n const footer = `env configuration is according to workspace variants, template config or --env flag.`;\n\n return `${chalk.green(title)}\\n\\n${componentsData}\\n\\n${footer}`;\n }\n}\n"],"mappings":";;;;;;AAEA,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,KA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AAA,SAAA","ignoreList":[]}
|
@@ -15,7 +15,7 @@ const _excluded = ["name", "templateName"];
|
|
15
15
|
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; }
|
16
16
|
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; }
|
17
17
|
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; }
|
18
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
19
19
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
20
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
21
21
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_graphqlTag","data","require","_excluded","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","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_graphqlTag","data","require","_excluded","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","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","_objectWithoutProperties","source","excluded","target","_objectWithoutPropertiesLoose","sourceSymbolKeys","indexOf","prototype","propertyIsEnumerable","sourceKeys","generatorSchema","generator","typeDefs","gql","resolvers","Mutation","createComponent","req","_ref","name","templateName","options","res","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,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkC,MAAAE,SAAA;AAAA,SAAAC,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,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,CAAAc,yBAAA,CAAAf,CAAA,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EC,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,OAAOpB,SAAS,CAACqB,aAAa,CAAC,CAAC;QAClC;MACF,CAAC;MACDC,KAAK,EAAE;QACLtB,SAAS,EAAEA,CAAA,KAAMA;MACnB;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
@@ -218,7 +218,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
218
218
|
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; }
|
219
219
|
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; }
|
220
220
|
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; }
|
221
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
221
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
222
222
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
223
223
|
class GeneratorMain {
|
224
224
|
constructor(componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot, config, workspace, envs, aspectLoader, newComponentHelper, componentAspect, tracker, logger, git, wsConfigFiles) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_graphql","_cli","_workspace","_envs","_config","_workspaceConfigFiles","_component","_bit","_harmony","_git","_bitError","_aspectLoader","_tracker","_newComponentHelper","_lodash","_logger","_generator","_create","_templates","_generator2","_componentGenerator","_workspaceGenerator","_new","_templates2","_basic","_starter","_generator3","_workspacePathExists","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","i","_toPrimitive","String","Symbol","toPrimitive","call","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","get","getComponentTemplate","fromEnv","listEnvComponentTemplates","found","findTemplateByAspectIdAndName","getAllComponentTemplatesFlattened","find","idWithoutVersion","split","getGlobalGeneratorEnvs","globalScopeHarmony","components","loadAspectsFromGlobalScope","remoteGenerator","GeneratorAspect","remoteEnvsAspect","EnvsAspect","fullAspectId","toString","restoreGlobals","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","envId","getEnvIdFromTemplateWithId","componentGenerator","ComponentGenerator","generate","force","envIdFromTemplate","env","parsedFromTemplate","ComponentID","tryFromString","resolvedId","resolveEnvIdWithPotentialVersionForConfig","fromString","envName","Promise","resolve","undefined","generateWorkspaceTemplate","workspaceName","currentDir","process","cwd","fs","existsSync","WorkspacePathExists","loadFrom","workspaceGenerator","WorkspaceGenerator","appName","envTemplates","listEnvComponentTemplateDescriptors","filtered","flattened","getTemplateDescriptor","templatesByAspects","toArray","flatMap","componentTemplates","workspaceTemplates","loadEnvs","getGeneratorStarters","envStarters","starter","componentId","compact","ids","envTemplate","toStringWithoutVersion","titlePrefix","getConfiguredEnvs","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 fs from 'fs-extra';\nimport { resolve } from 'path';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { EnvDefinition, EnvsAspect, EnvsMain } from '@teambit/envs';\nimport ComponentConfig from '@teambit/legacy/dist/consumer/config';\nimport { WorkspaceConfigFilesAspect, WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\nimport { ComponentAspect, ComponentID } from '@teambit/component';\nimport type { ComponentMain, Component } from '@teambit/component';\nimport { isCoreAspect, loadBit, restoreGlobals } 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';\nimport { WorkspacePathExists } from './exceptions/workspace-path-exists';\n\nexport type ComponentTemplateSlot = SlotRegistry<ComponentTemplate[]>;\nexport type WorkspaceTemplateSlot = SlotRegistry<WorkspaceTemplate[]>;\nexport type OnComponentCreateSlot = SlotRegistry<OnComponentCreateFn>;\n\nexport type TemplateDescriptor = {\n aspectId: string;\n titlePrefix?: string;\n name: string;\n description?: string;\n hidden?: boolean;\n};\n\ntype TemplateWithId = { id: string; envName?: string };\ntype WorkspaceTemplateWithId = TemplateWithId & { template: WorkspaceTemplate };\ntype ComponentTemplateWithId = TemplateWithId & { template: ComponentTemplate };\ntype AnyTemplateWithId = TemplateWithId & { template: ComponentTemplate | WorkspaceTemplate };\n\nexport type GenerateWorkspaceTemplateResult = { workspacePath: string; appName?: string };\n\nexport type GeneratorConfig = {\n /**\n * array of aspects to include in the list of templates.\n */\n aspects: string[];\n\n /**\n * by default core templates are shown.\n * use this to hide them unless `--show-all` flag of `bit templates` was used\n */\n hideCoreTemplates: boolean;\n\n /**\n * default envs.\n */\n envs?: string[];\n};\n\nexport class GeneratorMain {\n private aspectLoaded = false;\n constructor(\n private componentTemplateSlot: ComponentTemplateSlot,\n private workspaceTemplateSlot: WorkspaceTemplateSlot,\n private onComponentCreateSlot: OnComponentCreateSlot,\n private config: GeneratorConfig,\n private workspace: Workspace,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain,\n private newComponentHelper: NewComponentHelperMain,\n private componentAspect: ComponentMain,\n private tracker: TrackerMain,\n private logger: Logger,\n private git: GitMain,\n private wsConfigFiles: WorkspaceConfigFilesMain\n ) {}\n\n /**\n * register a new component template.\n */\n registerComponentTemplate(templates: ComponentTemplate[]) {\n this.componentTemplateSlot.register(templates);\n return this;\n }\n\n /**\n * register a new workspace starter.\n */\n registerWorkspaceTemplate(templates: WorkspaceTemplate[]) {\n this.workspaceTemplateSlot.register(templates);\n return this;\n }\n\n registerOnComponentCreate(fn: OnComponentCreateFn) {\n this.onComponentCreateSlot.register(fn);\n return this;\n }\n\n /**\n * list all component templates registered in the workspace or workspace templates in case the\n * workspace is not available\n */\n async listTemplates({ aspect }: { aspect?: string } = {}): Promise<TemplateDescriptor[]> {\n if (this.isRunningInsideWorkspace()) {\n return this.getAllComponentTemplatesDescriptorsFlattened(aspect);\n }\n return this.getAllWorkspaceTemplatesDescriptorFlattened(aspect);\n }\n\n private getTemplateDescriptor = ({ id, template }: AnyTemplateWithId): TemplateDescriptor => {\n const shouldBeHidden = () => {\n if (template.hidden) return true;\n if (this.config.hideCoreTemplates && isCoreAspect(id)) return true;\n return false;\n };\n return {\n aspectId: id,\n name: template.name,\n description: template.description,\n hidden: shouldBeHidden(),\n };\n };\n\n /**\n * @deprecated use this.listTemplates()\n */\n async listComponentTemplates(opts: { aspect?: string }): Promise<TemplateDescriptor[]> {\n return this.listTemplates(opts);\n }\n\n isRunningInsideWorkspace(): boolean {\n return Boolean(this.workspace);\n }\n\n /**\n * get all component templates registered by a specific aspect ID.\n */\n getComponentTemplateByAspect(aspectId: string): ComponentTemplate[] {\n return this.componentTemplateSlot.get(aspectId) || [];\n }\n\n /**\n * returns a specific component template.\n */\n async getComponentTemplate(name: string, aspectId?: string): Promise<ComponentTemplateWithId | undefined> {\n const fromEnv = await this.listEnvComponentTemplates([], aspectId);\n if (fromEnv && fromEnv.length) {\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, fromEnv);\n if (found) return found;\n }\n // fallback to aspect id not from env if provided\n const templates = await this.getAllComponentTemplatesFlattened();\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, templates);\n return found;\n }\n\n private findTemplateByAspectIdAndName<T>(\n aspectId: string | undefined,\n name: string,\n templates: Array<T>\n ): T | undefined {\n // @ts-ignore (should set T to be extends ComponentTemplateWithId or WorkspaceTemplateWithId)\n const found = templates.find(({ id, template }) => {\n // When doing something like:\n // bit create react-env my-env --aspect teambit.react/react-env\n // we will get the aspectId without version\n // but the env might be loaded from the global scope then it will be with a version\n // so it won't found if we don't look for it like this\n const idWithoutVersion = id.split('@')[0];\n if (aspectId && id !== aspectId && idWithoutVersion !== aspectId) return false;\n return template.name === name;\n });\n return found;\n }\n\n /**\n * Get the generator aspect and the envs aspect from an harmony instance of the global scope\n */\n private async getGlobalGeneratorEnvs(\n aspectId: string\n ): Promise<{ remoteGenerator: GeneratorMain; fullAspectId: string; remoteEnvsAspect: EnvsMain; aspect: any }> {\n const { globalScopeHarmony, components } = 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 restoreGlobals();\n\n return { remoteGenerator, fullAspectId, remoteEnvsAspect, aspect };\n }\n\n /**\n * in the case the aspect-id is given and this aspect doesn't exist locally, import it to the\n * global scope and load it from the capsule\n */\n async findWorkspaceTemplateInGlobalScope(\n aspectId: string,\n name?: string\n ): Promise<{ workspaceTemplate?: WorkspaceTemplate; aspect?: Component }> {\n const { remoteGenerator, fullAspectId, remoteEnvsAspect, aspect } = await this.getGlobalGeneratorEnvs(aspectId);\n const fromGlobal = await remoteGenerator.searchRegisteredWorkspaceTemplate.call(\n remoteGenerator,\n name,\n fullAspectId,\n remoteEnvsAspect\n );\n return { workspaceTemplate: fromGlobal, aspect };\n }\n\n async findTemplateInOtherWorkspace(workspacePath: string, name: string, aspectId?: string) {\n if (!aspectId)\n throw new BitError(\n `to load a template from a different workspace, please provide the aspect-id using --aspect flag`\n );\n const harmony = await loadBit(workspacePath);\n let workspace: Workspace;\n try {\n workspace = harmony.get<Workspace>(WorkspaceAspect.id);\n } catch (err: any) {\n throw new Error(`fatal: \"${workspacePath}\" is not a valid Bit workspace, make sure the path is correct`);\n }\n const aspectComponentId = await workspace.resolveComponentId(aspectId);\n await workspace.loadAspects([aspectId], true);\n const aspectComponent = await workspace.get(aspectComponentId);\n const aspectFullId = aspectComponentId.toString();\n const generator = harmony.get<GeneratorMain>(GeneratorAspect.id);\n const workspaceTemplate = await generator.searchRegisteredWorkspaceTemplate(name, aspectFullId);\n return { workspaceTemplate, aspect: aspectComponent };\n }\n\n /**\n * returns a specific workspace template.\n */\n async getWorkspaceTemplate(\n name: string,\n aspectId?: string\n ): Promise<{ workspaceTemplate: WorkspaceTemplate; aspect?: Component }> {\n const registeredTemplate = await this.searchRegisteredWorkspaceTemplate(name, aspectId);\n if (registeredTemplate) {\n return { workspaceTemplate: registeredTemplate };\n }\n if (!aspectId) {\n throw new BitError(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n const { workspaceTemplate, aspect } = await this.findWorkspaceTemplateInGlobalScope(aspectId, name);\n if (workspaceTemplate) {\n return { workspaceTemplate, aspect };\n }\n throw new BitError(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n async searchRegisteredWorkspaceTemplate(\n name?: string,\n aspectId?: string,\n remoteEnvsAspect?: EnvsMain\n ): Promise<WorkspaceTemplate | undefined> {\n let fromEnv;\n\n if (aspectId) {\n fromEnv = await this.listEnvWorkspaceTemplates(aspectId, remoteEnvsAspect);\n }\n const templates = fromEnv && fromEnv.length ? fromEnv : this.getAllWorkspaceTemplatesFlattened();\n const found = templates.find(({ id, template: tpl }) => {\n if (aspectId && name) return aspectId === id && name === tpl.name;\n if (aspectId) return aspectId === id;\n if (name) return name === tpl.name;\n throw new Error(`searchRegisteredWorkspaceTemplate expects to get \"name\" or \"aspectId\"`);\n });\n\n return found?.template;\n }\n\n async generateComponentTemplate(\n componentNames: string[],\n templateName: string,\n options: Partial<CreateOptions>\n ): Promise<GenerateResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n await this.loadAspects();\n const { namespace, aspect } = options;\n\n const componentConfigLoadingRegistry = ComponentConfig.componentConfigLoadingRegistry;\n\n const templateWithId = await this.getComponentTemplate(templateName, aspect);\n\n ComponentConfig.componentConfigLoadingRegistry = componentConfigLoadingRegistry;\n\n if (!templateWithId) throw new BitError(`template \"${templateName}\" was not found`);\n\n const componentIds = componentNames.map((componentName) =>\n this.newComponentHelper.getNewComponentId(componentName, namespace, options.scope)\n );\n\n const envId = await this.getEnvIdFromTemplateWithId(templateWithId);\n\n const componentGenerator = new ComponentGenerator(\n this.workspace,\n componentIds,\n options,\n templateWithId.template,\n this.envs,\n this.newComponentHelper,\n this.tracker,\n this.wsConfigFiles,\n this.logger,\n this.onComponentCreateSlot,\n templateWithId.id,\n envId\n );\n return componentGenerator.generate(options.force);\n }\n\n private async getEnvIdFromTemplateWithId(templateWithId: ComponentTemplateWithId): Promise<ComponentID | undefined> {\n const envIdFromTemplate = templateWithId.template.env;\n if (envIdFromTemplate) {\n const parsedFromTemplate = ComponentID.tryFromString(envIdFromTemplate);\n if (!parsedFromTemplate) {\n throw new BitError(\n `Error: unable to parse envId from template. template name: ${templateWithId.template.name}, envId: ${envIdFromTemplate}`\n );\n }\n const resolvedId = await this.workspace.resolveEnvIdWithPotentialVersionForConfig(parsedFromTemplate);\n return ComponentID.fromString(resolvedId);\n }\n if (templateWithId.envName) {\n return ComponentID.fromString(templateWithId.id);\n }\n return Promise.resolve(undefined);\n }\n\n async generateWorkspaceTemplate(\n workspaceName: string,\n templateName: string,\n options: NewOptions & { aspect?: string; currentDir?: boolean }\n ): Promise<GenerateWorkspaceTemplateResult> {\n if (this.workspace) {\n throw new BitError('Error: unable to generate a new workspace inside of an existing workspace');\n }\n const workspacePath = options.currentDir ? process.cwd() : resolve(workspaceName);\n if (!options.currentDir && fs.existsSync(workspacePath)) {\n throw new WorkspacePathExists(workspacePath);\n }\n const { aspect: aspectId, loadFrom } = options;\n const { workspaceTemplate, aspect } = loadFrom\n ? await this.findTemplateInOtherWorkspace(loadFrom, templateName, aspectId)\n : await this.getWorkspaceTemplate(templateName, aspectId);\n\n if (!workspaceTemplate) throw new BitError(`template \"${templateName}\" was not found`);\n const workspaceGenerator = new WorkspaceGenerator(workspaceName, workspacePath, options, workspaceTemplate, aspect);\n await workspaceGenerator.generate();\n return { workspacePath, appName: workspaceTemplate.appName };\n }\n\n private async getAllComponentTemplatesDescriptorsFlattened(aspectId?: string): Promise<Array<TemplateDescriptor>> {\n const envTemplates = await this.listEnvComponentTemplateDescriptors([], aspectId);\n if (envTemplates && envTemplates.length) {\n if (!aspectId) return envTemplates;\n const filtered = envTemplates.filter((template) => template.aspectId === aspectId);\n if (filtered.length) return filtered;\n }\n\n const flattened = this.getAllComponentTemplatesFlattened();\n const filtered = aspectId ? flattened.filter((template) => template.id === aspectId) : flattened;\n return filtered.map((template) => this.getTemplateDescriptor(template));\n }\n\n private getAllComponentTemplatesFlattened(): Array<{ id: string; template: ComponentTemplate }> {\n const templatesByAspects = this.componentTemplateSlot.toArray();\n const flattened = templatesByAspects.flatMap(([id, componentTemplates]) => {\n return componentTemplates.map((template) => ({\n id,\n template,\n }));\n });\n return flattened;\n }\n\n private async getAllWorkspaceTemplatesDescriptorFlattened(aspectId?: string): Promise<Array<TemplateDescriptor>> {\n let envTemplates;\n if (aspectId) {\n envTemplates = await this.listEnvWorkspaceTemplates(aspectId);\n }\n\n const templates = envTemplates && envTemplates.length ? envTemplates : this.getAllWorkspaceTemplatesFlattened();\n return templates.map((template) => this.getTemplateDescriptor(template));\n }\n\n private getAllWorkspaceTemplatesFlattened(): Array<{ id: string; template: WorkspaceTemplate }> {\n const templatesByAspects = this.workspaceTemplateSlot.toArray();\n return templatesByAspects.flatMap(([id, workspaceTemplates]) => {\n return workspaceTemplates.map((template) => ({\n id,\n template,\n }));\n });\n }\n\n /**\n * list all starter templates registered by an env.\n */\n async listEnvWorkspaceTemplates(envId: string, remoteEnvsAspect?: EnvsMain): Promise<Array<WorkspaceTemplateWithId>> {\n const envs = await this.loadEnvs([envId], remoteEnvsAspect);\n const workspaceTemplates = envs.flatMap((env) => {\n if (!env.env.getGeneratorStarters) return undefined;\n const envStarters = env.env.getGeneratorStarters();\n return envStarters.map((starter) => {\n const componentId = ComponentID.fromString(env.id);\n return {\n id: componentId.toString(),\n envName: env.name,\n template: starter,\n };\n });\n });\n\n return compact(workspaceTemplates);\n }\n\n /**\n * list all component templates registered by an env.\n */\n async listEnvComponentTemplateDescriptors(ids: string[] = [], aspectId?: string): Promise<TemplateDescriptor[]> {\n const envTemplates = await this.listEnvComponentTemplates(ids, aspectId);\n const templates: TemplateDescriptor[] = envTemplates.map((envTemplate) => {\n const componentId = ComponentID.fromString(envTemplate.id);\n return {\n aspectId: componentId.toStringWithoutVersion(),\n titlePrefix: envTemplate.envName,\n ...envTemplate.template,\n };\n });\n\n return templates;\n }\n\n getConfiguredEnvs(): string[] {\n return this.config.envs ?? [];\n }\n\n async listEnvComponentTemplates(ids: string[] = [], aspectId?: string): Promise<Array<ComponentTemplateWithId>> {\n const configEnvs = this.config.envs || [];\n let remoteEnvsAspect;\n let fullAspectId;\n if (aspectId && !configEnvs.includes(aspectId)) {\n const globals = await this.getGlobalGeneratorEnvs(aspectId);\n remoteEnvsAspect = globals.remoteEnvsAspect;\n fullAspectId = globals.fullAspectId;\n }\n const allIds = 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([BasicWorkspaceSt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EAClBC,8CAAwB,EACxBC,4BAAe,EACfC,wBAAa,EACbC,sBAAY,EACZC,gBAAS,EACTC,kDAA0B,CAC3B;AAAAjN,eAAA,CAxcUiB,aAAa,aA0cPiM,kBAAW;AAsE9B3I,4BAAe,CAAC4I,UAAU,CAAClM,aAAa,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_graphql","_cli","_workspace","_envs","_config","_workspaceConfigFiles","_component","_bit","_harmony","_git","_bitError","_aspectLoader","_tracker","_newComponentHelper","_lodash","_logger","_generator","_create","_templates","_generator2","_componentGenerator","_workspaceGenerator","_new","_templates2","_basic","_starter","_generator3","_workspacePathExists","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","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","GeneratorMain","constructor","componentTemplateSlot","workspaceTemplateSlot","onComponentCreateSlot","config","workspace","envs","aspectLoader","newComponentHelper","componentAspect","tracker","logger","git","wsConfigFiles","id","template","shouldBeHidden","hidden","hideCoreTemplates","isCoreAspect","aspectId","name","description","registerComponentTemplate","templates","register","registerWorkspaceTemplate","registerOnComponentCreate","fn","listTemplates","aspect","isRunningInsideWorkspace","getAllComponentTemplatesDescriptorsFlattened","getAllWorkspaceTemplatesDescriptorFlattened","listComponentTemplates","opts","Boolean","getComponentTemplateByAspect","get","getComponentTemplate","fromEnv","listEnvComponentTemplates","found","findTemplateByAspectIdAndName","getAllComponentTemplatesFlattened","find","idWithoutVersion","split","getGlobalGeneratorEnvs","globalScopeHarmony","components","loadAspectsFromGlobalScope","remoteGenerator","GeneratorAspect","remoteEnvsAspect","EnvsAspect","fullAspectId","toString","restoreGlobals","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","envId","getEnvIdFromTemplateWithId","componentGenerator","ComponentGenerator","generate","force","envIdFromTemplate","env","parsedFromTemplate","ComponentID","tryFromString","resolvedId","resolveEnvIdWithPotentialVersionForConfig","fromString","envName","Promise","resolve","undefined","generateWorkspaceTemplate","workspaceName","currentDir","process","cwd","fs","existsSync","WorkspacePathExists","loadFrom","workspaceGenerator","WorkspaceGenerator","appName","envTemplates","listEnvComponentTemplateDescriptors","filtered","flattened","getTemplateDescriptor","templatesByAspects","toArray","flatMap","componentTemplates","workspaceTemplates","loadEnvs","getGeneratorStarters","envStarters","starter","componentId","compact","ids","envTemplate","toStringWithoutVersion","titlePrefix","getConfiguredEnvs","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 fs from 'fs-extra';\nimport { resolve } from 'path';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { EnvDefinition, EnvsAspect, EnvsMain } from '@teambit/envs';\nimport ComponentConfig from '@teambit/legacy/dist/consumer/config';\nimport { WorkspaceConfigFilesAspect, WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\nimport { ComponentAspect, ComponentID } from '@teambit/component';\nimport type { ComponentMain, Component } from '@teambit/component';\nimport { isCoreAspect, loadBit, restoreGlobals } 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';\nimport { WorkspacePathExists } from './exceptions/workspace-path-exists';\n\nexport type ComponentTemplateSlot = SlotRegistry<ComponentTemplate[]>;\nexport type WorkspaceTemplateSlot = SlotRegistry<WorkspaceTemplate[]>;\nexport type OnComponentCreateSlot = SlotRegistry<OnComponentCreateFn>;\n\nexport type TemplateDescriptor = {\n aspectId: string;\n titlePrefix?: string;\n name: string;\n description?: string;\n hidden?: boolean;\n};\n\ntype TemplateWithId = { id: string; envName?: string };\ntype WorkspaceTemplateWithId = TemplateWithId & { template: WorkspaceTemplate };\ntype ComponentTemplateWithId = TemplateWithId & { template: ComponentTemplate };\ntype AnyTemplateWithId = TemplateWithId & { template: ComponentTemplate | WorkspaceTemplate };\n\nexport type GenerateWorkspaceTemplateResult = { workspacePath: string; appName?: string };\n\nexport type GeneratorConfig = {\n /**\n * array of aspects to include in the list of templates.\n */\n aspects: string[];\n\n /**\n * by default core templates are shown.\n * use this to hide them unless `--show-all` flag of `bit templates` was used\n */\n hideCoreTemplates: boolean;\n\n /**\n * default envs.\n */\n envs?: string[];\n};\n\nexport class GeneratorMain {\n private aspectLoaded = false;\n constructor(\n private componentTemplateSlot: ComponentTemplateSlot,\n private workspaceTemplateSlot: WorkspaceTemplateSlot,\n private onComponentCreateSlot: OnComponentCreateSlot,\n private config: GeneratorConfig,\n private workspace: Workspace,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain,\n private newComponentHelper: NewComponentHelperMain,\n private componentAspect: ComponentMain,\n private tracker: TrackerMain,\n private logger: Logger,\n private git: GitMain,\n private wsConfigFiles: WorkspaceConfigFilesMain\n ) {}\n\n /**\n * register a new component template.\n */\n registerComponentTemplate(templates: ComponentTemplate[]) {\n this.componentTemplateSlot.register(templates);\n return this;\n }\n\n /**\n * register a new workspace starter.\n */\n registerWorkspaceTemplate(templates: WorkspaceTemplate[]) {\n this.workspaceTemplateSlot.register(templates);\n return this;\n }\n\n registerOnComponentCreate(fn: OnComponentCreateFn) {\n this.onComponentCreateSlot.register(fn);\n return this;\n }\n\n /**\n * list all component templates registered in the workspace or workspace templates in case the\n * workspace is not available\n */\n async listTemplates({ aspect }: { aspect?: string } = {}): Promise<TemplateDescriptor[]> {\n if (this.isRunningInsideWorkspace()) {\n return this.getAllComponentTemplatesDescriptorsFlattened(aspect);\n }\n return this.getAllWorkspaceTemplatesDescriptorFlattened(aspect);\n }\n\n private getTemplateDescriptor = ({ id, template }: AnyTemplateWithId): TemplateDescriptor => {\n const shouldBeHidden = () => {\n if (template.hidden) return true;\n if (this.config.hideCoreTemplates && isCoreAspect(id)) return true;\n return false;\n };\n return {\n aspectId: id,\n name: template.name,\n description: template.description,\n hidden: shouldBeHidden(),\n };\n };\n\n /**\n * @deprecated use this.listTemplates()\n */\n async listComponentTemplates(opts: { aspect?: string }): Promise<TemplateDescriptor[]> {\n return this.listTemplates(opts);\n }\n\n isRunningInsideWorkspace(): boolean {\n return Boolean(this.workspace);\n }\n\n /**\n * get all component templates registered by a specific aspect ID.\n */\n getComponentTemplateByAspect(aspectId: string): ComponentTemplate[] {\n return this.componentTemplateSlot.get(aspectId) || [];\n }\n\n /**\n * returns a specific component template.\n */\n async getComponentTemplate(name: string, aspectId?: string): Promise<ComponentTemplateWithId | undefined> {\n const fromEnv = await this.listEnvComponentTemplates([], aspectId);\n if (fromEnv && fromEnv.length) {\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, fromEnv);\n if (found) return found;\n }\n // fallback to aspect id not from env if provided\n const templates = await this.getAllComponentTemplatesFlattened();\n const found = this.findTemplateByAspectIdAndName<ComponentTemplateWithId>(aspectId, name, templates);\n return found;\n }\n\n private findTemplateByAspectIdAndName<T>(\n aspectId: string | undefined,\n name: string,\n templates: Array<T>\n ): T | undefined {\n // @ts-ignore (should set T to be extends ComponentTemplateWithId or WorkspaceTemplateWithId)\n const found = templates.find(({ id, template }) => {\n // When doing something like:\n // bit create react-env my-env --aspect teambit.react/react-env\n // we will get the aspectId without version\n // but the env might be loaded from the global scope then it will be with a version\n // so it won't found if we don't look for it like this\n const idWithoutVersion = id.split('@')[0];\n if (aspectId && id !== aspectId && idWithoutVersion !== aspectId) return false;\n return template.name === name;\n });\n return found;\n }\n\n /**\n * Get the generator aspect and the envs aspect from an harmony instance of the global scope\n */\n private async getGlobalGeneratorEnvs(\n aspectId: string\n ): Promise<{ remoteGenerator: GeneratorMain; fullAspectId: string; remoteEnvsAspect: EnvsMain; aspect: any }> {\n const { globalScopeHarmony, components } = 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 restoreGlobals();\n\n return { remoteGenerator, fullAspectId, remoteEnvsAspect, aspect };\n }\n\n /**\n * in the case the aspect-id is given and this aspect doesn't exist locally, import it to the\n * global scope and load it from the capsule\n */\n async findWorkspaceTemplateInGlobalScope(\n aspectId: string,\n name?: string\n ): Promise<{ workspaceTemplate?: WorkspaceTemplate; aspect?: Component }> {\n const { remoteGenerator, fullAspectId, remoteEnvsAspect, aspect } = await this.getGlobalGeneratorEnvs(aspectId);\n const fromGlobal = await remoteGenerator.searchRegisteredWorkspaceTemplate.call(\n remoteGenerator,\n name,\n fullAspectId,\n remoteEnvsAspect\n );\n return { workspaceTemplate: fromGlobal, aspect };\n }\n\n async findTemplateInOtherWorkspace(workspacePath: string, name: string, aspectId?: string) {\n if (!aspectId)\n throw new BitError(\n `to load a template from a different workspace, please provide the aspect-id using --aspect flag`\n );\n const harmony = await loadBit(workspacePath);\n let workspace: Workspace;\n try {\n workspace = harmony.get<Workspace>(WorkspaceAspect.id);\n } catch (err: any) {\n throw new Error(`fatal: \"${workspacePath}\" is not a valid Bit workspace, make sure the path is correct`);\n }\n const aspectComponentId = await workspace.resolveComponentId(aspectId);\n await workspace.loadAspects([aspectId], true);\n const aspectComponent = await workspace.get(aspectComponentId);\n const aspectFullId = aspectComponentId.toString();\n const generator = harmony.get<GeneratorMain>(GeneratorAspect.id);\n const workspaceTemplate = await generator.searchRegisteredWorkspaceTemplate(name, aspectFullId);\n return { workspaceTemplate, aspect: aspectComponent };\n }\n\n /**\n * returns a specific workspace template.\n */\n async getWorkspaceTemplate(\n name: string,\n aspectId?: string\n ): Promise<{ workspaceTemplate: WorkspaceTemplate; aspect?: Component }> {\n const registeredTemplate = await this.searchRegisteredWorkspaceTemplate(name, aspectId);\n if (registeredTemplate) {\n return { workspaceTemplate: registeredTemplate };\n }\n if (!aspectId) {\n throw new BitError(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n const { workspaceTemplate, aspect } = await this.findWorkspaceTemplateInGlobalScope(aspectId, name);\n if (workspaceTemplate) {\n return { workspaceTemplate, aspect };\n }\n throw new BitError(\n `template \"${name}\" was not found, please use --aspect flag to load from an env i.e --aspect teambit.react/react-env\\n Learn more about component templates here: https://bit.dev/reference/generator/create-generator`\n );\n }\n\n async searchRegisteredWorkspaceTemplate(\n name?: string,\n aspectId?: string,\n remoteEnvsAspect?: EnvsMain\n ): Promise<WorkspaceTemplate | undefined> {\n let fromEnv;\n\n if (aspectId) {\n fromEnv = await this.listEnvWorkspaceTemplates(aspectId, remoteEnvsAspect);\n }\n const templates = fromEnv && fromEnv.length ? fromEnv : this.getAllWorkspaceTemplatesFlattened();\n const found = templates.find(({ id, template: tpl }) => {\n if (aspectId && name) return aspectId === id && name === tpl.name;\n if (aspectId) return aspectId === id;\n if (name) return name === tpl.name;\n throw new Error(`searchRegisteredWorkspaceTemplate expects to get \"name\" or \"aspectId\"`);\n });\n\n return found?.template;\n }\n\n async generateComponentTemplate(\n componentNames: string[],\n templateName: string,\n options: Partial<CreateOptions>\n ): Promise<GenerateResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n await this.loadAspects();\n const { namespace, aspect } = options;\n\n const componentConfigLoadingRegistry = ComponentConfig.componentConfigLoadingRegistry;\n\n const templateWithId = await this.getComponentTemplate(templateName, aspect);\n\n ComponentConfig.componentConfigLoadingRegistry = componentConfigLoadingRegistry;\n\n if (!templateWithId) throw new BitError(`template \"${templateName}\" was not found`);\n\n const componentIds = componentNames.map((componentName) =>\n this.newComponentHelper.getNewComponentId(componentName, namespace, options.scope)\n );\n\n const envId = await this.getEnvIdFromTemplateWithId(templateWithId);\n\n const componentGenerator = new ComponentGenerator(\n this.workspace,\n componentIds,\n options,\n templateWithId.template,\n this.envs,\n this.newComponentHelper,\n this.tracker,\n this.wsConfigFiles,\n this.logger,\n this.onComponentCreateSlot,\n templateWithId.id,\n envId\n );\n return componentGenerator.generate(options.force);\n }\n\n private async getEnvIdFromTemplateWithId(templateWithId: ComponentTemplateWithId): Promise<ComponentID | undefined> {\n const envIdFromTemplate = templateWithId.template.env;\n if (envIdFromTemplate) {\n const parsedFromTemplate = ComponentID.tryFromString(envIdFromTemplate);\n if (!parsedFromTemplate) {\n throw new BitError(\n `Error: unable to parse envId from template. template name: ${templateWithId.template.name}, envId: ${envIdFromTemplate}`\n );\n }\n const resolvedId = await this.workspace.resolveEnvIdWithPotentialVersionForConfig(parsedFromTemplate);\n return ComponentID.fromString(resolvedId);\n }\n if (templateWithId.envName) {\n return ComponentID.fromString(templateWithId.id);\n }\n return Promise.resolve(undefined);\n }\n\n async generateWorkspaceTemplate(\n workspaceName: string,\n templateName: string,\n options: NewOptions & { aspect?: string; currentDir?: boolean }\n ): Promise<GenerateWorkspaceTemplateResult> {\n if (this.workspace) {\n throw new BitError('Error: unable to generate a new workspace inside of an existing workspace');\n }\n const workspacePath = options.currentDir ? process.cwd() : resolve(workspaceName);\n if (!options.currentDir && fs.existsSync(workspacePath)) {\n throw new WorkspacePathExists(workspacePath);\n }\n const { aspect: aspectId, loadFrom } = options;\n const { workspaceTemplate, aspect } = loadFrom\n ? await this.findTemplateInOtherWorkspace(loadFrom, templateName, aspectId)\n : await this.getWorkspaceTemplate(templateName, aspectId);\n\n if (!workspaceTemplate) throw new BitError(`template \"${templateName}\" was not found`);\n const workspaceGenerator = new WorkspaceGenerator(workspaceName, workspacePath, options, workspaceTemplate, aspect);\n await workspaceGenerator.generate();\n return { workspacePath, appName: workspaceTemplate.appName };\n }\n\n private async getAllComponentTemplatesDescriptorsFlattened(aspectId?: string): Promise<Array<TemplateDescriptor>> {\n const envTemplates = await this.listEnvComponentTemplateDescriptors([], aspectId);\n if (envTemplates && envTemplates.length) {\n if (!aspectId) return envTemplates;\n const filtered = envTemplates.filter((template) => template.aspectId === aspectId);\n if (filtered.length) return filtered;\n }\n\n const flattened = this.getAllComponentTemplatesFlattened();\n const filtered = aspectId ? flattened.filter((template) => template.id === aspectId) : flattened;\n return filtered.map((template) => this.getTemplateDescriptor(template));\n }\n\n private getAllComponentTemplatesFlattened(): Array<{ id: string; template: ComponentTemplate }> {\n const templatesByAspects = this.componentTemplateSlot.toArray();\n const flattened = templatesByAspects.flatMap(([id, componentTemplates]) => {\n return componentTemplates.map((template) => ({\n id,\n template,\n }));\n });\n return flattened;\n }\n\n private async getAllWorkspaceTemplatesDescriptorFlattened(aspectId?: string): Promise<Array<TemplateDescriptor>> {\n let envTemplates;\n if (aspectId) {\n envTemplates = await this.listEnvWorkspaceTemplates(aspectId);\n }\n\n const templates = envTemplates && envTemplates.length ? envTemplates : this.getAllWorkspaceTemplatesFlattened();\n return templates.map((template) => this.getTemplateDescriptor(template));\n }\n\n private getAllWorkspaceTemplatesFlattened(): Array<{ id: string; template: WorkspaceTemplate }> {\n const templatesByAspects = this.workspaceTemplateSlot.toArray();\n return templatesByAspects.flatMap(([id, workspaceTemplates]) => {\n return workspaceTemplates.map((template) => ({\n id,\n template,\n }));\n });\n }\n\n /**\n * list all starter templates registered by an env.\n */\n async listEnvWorkspaceTemplates(envId: string, remoteEnvsAspect?: EnvsMain): Promise<Array<WorkspaceTemplateWithId>> {\n const envs = await this.loadEnvs([envId], remoteEnvsAspect);\n const workspaceTemplates = envs.flatMap((env) => {\n if (!env.env.getGeneratorStarters) return undefined;\n const envStarters = env.env.getGeneratorStarters();\n return envStarters.map((starter) => {\n const componentId = ComponentID.fromString(env.id);\n return {\n id: componentId.toString(),\n envName: env.name,\n template: starter,\n };\n });\n });\n\n return compact(workspaceTemplates);\n }\n\n /**\n * list all component templates registered by an env.\n */\n async listEnvComponentTemplateDescriptors(ids: string[] = [], aspectId?: string): Promise<TemplateDescriptor[]> {\n const envTemplates = await this.listEnvComponentTemplates(ids, aspectId);\n const templates: TemplateDescriptor[] = envTemplates.map((envTemplate) => {\n const componentId = ComponentID.fromString(envTemplate.id);\n return {\n aspectId: componentId.toStringWithoutVersion(),\n titlePrefix: envTemplate.envName,\n ...envTemplate.template,\n };\n });\n\n return templates;\n }\n\n getConfiguredEnvs(): string[] {\n return this.config.envs ?? [];\n }\n\n async listEnvComponentTemplates(ids: string[] = [], aspectId?: string): Promise<Array<ComponentTemplateWithId>> {\n const configEnvs = this.config.envs || [];\n let remoteEnvsAspect;\n let fullAspectId;\n if (aspectId && !configEnvs.includes(aspectId)) {\n const globals = await this.getGlobalGeneratorEnvs(aspectId);\n remoteEnvsAspect = globals.remoteEnvsAspect;\n fullAspectId = globals.fullAspectId;\n }\n const allIds = 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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EACZC,gBAAS,EACTC,kDAA0B,CAC3B;AAAAjN,eAAA,CAxcUiB,aAAa,aA0cPiM,kBAAW;AAsE9B3I,4BAAe,CAAC4I,UAAU,CAAClM,aAAa,CAAC","ignoreList":[]}
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.GeneratorService = void 0;
|
7
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
9
9
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
10
10
|
class GeneratorService {
|
11
11
|
constructor() {
|
package/dist/new.cmd.js
CHANGED
@@ -13,7 +13,7 @@ function _chalk() {
|
|
13
13
|
}
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
17
17
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
18
18
|
/**
|
19
19
|
* NewOptions combines foundational properties with additional options for creating a workspace.
|
package/dist/new.cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","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>', 'id of the dev environment to use for the template. Alias for --env.'],\n ['', 'env <env-id>', 'id of the dev environment to use for the template. Alias -t'],\n [\n 'd',\n 'default-scope <scope-name>',\n `set the default scope for the workspace. used in the generated workspace.jsonc`,\n ],\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 [\n 'c',\n 'current-dir',\n 'create the new workspace in current directory (default is to create a new directory, inside the current dir)',\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 currentDir?: boolean;\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,OA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QH,gBAAK,CAACG,MAAM,CAAC,aAAa,CAAE;AACpC;AACA;AACA,QAAQH,gBAAK,CAACG,MAAM,CAAC,UAAU,CAAE;AACjC;AACA;AACA,QAAQH,gBAAK,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,CAACf,aAAa,EAAEQ,OAAO,CAAE;AACjD,OACI,CAAC;EACH;AACF;AAACQ,OAAA,CAAAvB,MAAA,GAAAA,MAAA;AAED,SAASsB,gBAAgBA,CAACf,aAAqB,EAAEQ,OAA2B,EAAE;EAC5E,MAAMS,MAAM,GAAGP,gBAAK,CAACG,MAAM,CAAE,MAAKb,aAAc,EAAC,CAAC;EAClD,MAAMkB,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","ignoreList":[]}
|
@@ -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.211/dist/generator.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@1.0.211/dist/generator.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/dist/starter.plugin.js
CHANGED
@@ -12,7 +12,7 @@ function _cli() {
|
|
12
12
|
return data;
|
13
13
|
}
|
14
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
16
16
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
17
17
|
class StarterPlugin {
|
18
18
|
constructor(generator) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_cli","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","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,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AAGpC,MAAMW,aAAa,CAA6B;EACrDC,WAAWA,CAASC,SAAwB,EAAE;IAAA,KAA1BA,SAAwB,GAAxBA,SAAwB;IAAAvB,eAAA,kBAElC,aAAa;IAAAA,eAAA,mBAEZ,CAACwB,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","ignoreList":[]}
|
@@ -14,7 +14,7 @@ function _config() {
|
|
14
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
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
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
18
18
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
19
19
|
async function workspaceConfig({
|
20
20
|
name,
|
@@ -1 +1 @@
|
|
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","i","_toPrimitive","
|
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","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","workspaceConfig","name","defaultScope","configParsed","getWorkspaceConfigTemplateParsed","packageManagerDefaultConfig","policy","dependencies","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 '@types/node': '16.18.44',\n '@types/jest': '29.5.4',\n },\n },\n };\n\n // configParsed['teambit.generator/generator'] = {\n // envs: [\n // 'teambit.node/node',\n // \"bitdev.react/react-env\",\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,CAAA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ArB,CAAA,QAAAwB,CAAA,GAAAC,YAAA,CAAAzB,CAAA,uCAAAwB,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAzB,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAA0B,MAAA,CAAAC,WAAA,kBAAA7B,CAAA,QAAA0B,CAAA,GAAA1B,CAAA,CAAA8B,IAAA,CAAA5B,CAAA,EAAAD,CAAA,uCAAAyB,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAA9B,CAAA,GAAA+B,MAAA,GAAAC,MAAA,EAAA/B,CAAA;AAGtF,eAAegC,eAAeA,CAAC;EAAEC,IAAI;EAAEC;AAA+B,CAAC,EAAE;EAC9E,MAAMC,YAAY,GAAG,MAAM,IAAAC,0CAAgC,EAAC,CAAC;EAC7D,MAAMC,2BAA2B,GAAGF,YAAY,CAAC,0CAA0C,CAAC;EAC5FA,YAAY,CAAC,6BAA6B,CAAC,CAACF,IAAI,GAAGA,IAAI;EACvDE,YAAY,CAAC,6BAA6B,CAAC,CAACD,YAAY,GAAGA,YAAY,IAAI,WAAW;EACtFC,YAAY,CAAC,0CAA0C,CAAC,GAAAzB,aAAA,CAAAA,aAAA,KACnD2B,2BAA2B;IAC9BC,MAAM,EAAE;MACNC,YAAY,EAAE;QACZ,aAAa,EAAE,UAAU;QACzB,aAAa,EAAE;MACjB;IACF;EAAC,EACF;;EAED;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA,OAAO,IAAAC,kCAAwB,EAACL,YAAY,CAAC;AAC/C","ignoreList":[]}
|
package/dist/templates.cmd.js
CHANGED
@@ -20,7 +20,7 @@ function _lodash() {
|
|
20
20
|
}
|
21
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
22
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
23
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
24
24
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
25
25
|
class TemplatesCmd {
|
26
26
|
constructor(generator) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","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","learnMore","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\n const learnMore = `\\nfind and add templates in https://bit.dev/reference/generator/use-component-generator`;\n return title + output + learnMore;\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,GA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KAAK,GAAGQ,MAAM,GAAGU,SAAS;EACnC;AACF;AAACC,OAAA,CAAAnC,YAAA,GAAAA,YAAA","ignoreList":[]}
|
@@ -132,7 +132,7 @@ function _generator() {
|
|
132
132
|
}
|
133
133
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
134
134
|
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; }
|
135
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
135
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
136
136
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // import { ComponentGenerator } from './component-generator';
|
137
137
|
class WorkspaceGenerator {
|
138
138
|
constructor(workspaceName, workspacePath, options, template, aspectComponent) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_bit","_execa","_pMapSeries","_ui","_logger","_workspace","_forking","_consumer","_importer","_compiler","_gitExecutable","_gitNotFound","_path","_git","_install","_workspaceConfigFiles","_generator","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","WorkspaceGenerator","constructor","workspaceName","workspacePath","options","template","aspectComponent","generate","fs","ensureDir","process","chdir","initGit","init","skipGit","writeWorkspaceFiles","reloadBitInWorkspaceDir","workspace","inInstallContext","setupGitBitmapMergeDriver","createComponentsFromRemote","forkComponentsFromRemote","importComponentsFromRemote","clearCache","install","undefined","dedupe","import","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","updateExisting","compileComponents","wsConfigFiles","writeConfigFiles","err","logger","error","remove","gitExecutablePath","getGitExecutablePath","params","execa","exitCodeName","GitNotFound","git","setGitMergeDriver","global","buildUI","uiMain","harmony","get","UIAspect","id","createRuntime","getWorkspaceContext","name","defaultScope","empty","workspaceContext","templateFiles","generateFiles","Promise","all","map","templateFile","outputFile","join","relativePath","content","loadBit","WorkspaceAspect","InstallAspect","loggerMain","LoggerAspect","createLogger","GeneratorAspect","importer","ImporterAspect","forking","ForkingAspect","GitAspect","WorkspaceConfigFilesAspect","generator","create","componentsToCreate","pMapSeries","componentToCreate","generateComponentTemplate","componentName","templateName","aspect","env","path","scope","componentsToFork","importComponents","fork","length","componentsToForkRestructured","targetName","config","targetScope","sourceId","targetId","forkMultipleFromRemote","refactor","componentsToImport","componentToImport","ids","installNpmPackages","writeToPath","bitMap","write","compiler","CompilerAspect","compileOnWorkspace","exports"],"sources":["workspace-generator.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { loadBit } from '@teambit/bit';\nimport { Harmony } from '@teambit/harmony';\nimport { Component } from '@teambit/component';\nimport execa from 'execa';\nimport pMapSeries from 'p-map-series';\nimport { UIAspect, UiMain } from '@teambit/ui';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport { ForkingAspect, ForkingMain } from '@teambit/forking';\nimport { init } from '@teambit/legacy/dist/api/consumer';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport getGitExecutablePath from '@teambit/legacy/dist/utils/git/git-executable';\nimport GitNotFound from '@teambit/legacy/dist/utils/git/exceptions/git-not-found';\nimport { join } from 'path';\nimport { ComponentID } from '@teambit/component-id';\nimport { GitAspect, GitMain } from '@teambit/git';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport { WorkspaceConfigFilesAspect, WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\n// import { ComponentGenerator } from './component-generator';\nimport { WorkspaceTemplate, WorkspaceContext } from './workspace-template';\nimport { NewOptions } from './new.cmd';\nimport { GeneratorAspect } from './generator.aspect';\nimport { GeneratorMain } from './generator.main.runtime';\n\nexport type GenerateResult = { id: ComponentID; dir: string; files: string[]; envId: string };\n\nexport class WorkspaceGenerator {\n private harmony: Harmony;\n private workspace: Workspace;\n private install: InstallMain;\n private importer: ImporterMain;\n private logger?: Logger;\n private forking: ForkingMain;\n private git: GitMain;\n private wsConfigFiles: WorkspaceConfigFilesMain;\n private generator: GeneratorMain;\n\n constructor(\n private workspaceName: string,\n private workspacePath: string,\n private options: NewOptions & { currentDir?: boolean },\n private template: WorkspaceTemplate,\n private aspectComponent?: Component\n ) {}\n\n async generate(): Promise<string> {\n await fs.ensureDir(this.workspacePath);\n try {\n process.chdir(this.workspacePath);\n await this.initGit();\n await init(this.workspacePath, this.options.skipGit, false, false, false, false, false, false, false, {});\n await this.writeWorkspaceFiles();\n await this.reloadBitInWorkspaceDir();\n // Setting the workspace to be in install context to prevent errors during the workspace generation\n // the workspace will be in install context until the end of the generation install process\n this.workspace.inInstallContext = true;\n await this.setupGitBitmapMergeDriver();\n await this.createComponentsFromRemote();\n await this.forkComponentsFromRemote();\n await this.importComponentsFromRemote();\n await this.workspace.clearCache();\n await this.install.install(undefined, {\n dedupe: true,\n import: false,\n copyPeerToRuntimeOnRoot: true,\n copyPeerToRuntimeOnComponents: false,\n updateExisting: false,\n });\n\n // compile the components again now that we have the dependencies installed\n await this.compileComponents(true);\n await this.wsConfigFiles.writeConfigFiles({});\n } catch (err: any) {\n this.logger?.error(`failed generating a new workspace, will delete the dir ${this.workspacePath}`, err);\n await fs.remove(this.workspacePath);\n throw err;\n }\n\n return this.workspacePath;\n }\n\n private async initGit() {\n if (this.options.skipGit) return;\n const gitExecutablePath = getGitExecutablePath();\n const params = ['init'];\n try {\n await execa(gitExecutablePath, params);\n } catch (err: any) {\n if (err.exitCodeName === 'ENOENT') {\n throw new GitNotFound(gitExecutablePath, err);\n }\n throw err;\n }\n }\n\n private async setupGitBitmapMergeDriver() {\n if (this.options.skipGit) return;\n await this.git.setGitMergeDriver({ global: false });\n }\n\n private async buildUI() {\n const uiMain = this.harmony.get<UiMain>(UIAspect.id);\n await uiMain.createRuntime({});\n }\n\n private getWorkspaceContext(): WorkspaceContext {\n return {\n name: this.workspaceName,\n defaultScope: this.options.defaultScope,\n empty: this.options.empty,\n aspectComponent: this.aspectComponent,\n template: this.template,\n skipGit: this.options.skipGit,\n };\n }\n\n /**\n * writes the generated template files to the default directory set in the workspace config\n */\n private async writeWorkspaceFiles(): Promise<void> {\n const workspaceContext = this.getWorkspaceContext();\n const templateFiles = await this.template.generateFiles(workspaceContext);\n await Promise.all(\n templateFiles.map(async (templateFile) => {\n await fs.outputFile(join(this.workspacePath, templateFile.relativePath), templateFile.content);\n })\n );\n }\n\n private async reloadBitInWorkspaceDir() {\n this.harmony = await loadBit(this.workspacePath);\n this.workspace = this.harmony.get<Workspace>(WorkspaceAspect.id);\n this.install = this.harmony.get<InstallMain>(InstallAspect.id);\n const loggerMain = this.harmony.get<LoggerMain>(LoggerAspect.id);\n this.logger = loggerMain.createLogger(GeneratorAspect.id);\n this.importer = this.harmony.get<ImporterMain>(ImporterAspect.id);\n this.forking = this.harmony.get<ForkingMain>(ForkingAspect.id);\n this.git = this.harmony.get<GitMain>(GitAspect.id);\n this.wsConfigFiles = this.harmony.get<WorkspaceConfigFilesMain>(WorkspaceConfigFilesAspect.id);\n this.generator = this.harmony.get<GeneratorMain>(GeneratorAspect.id);\n }\n\n private async createComponentsFromRemote() {\n if (this.options.empty || !this.template.create) return;\n const workspaceContext = this.getWorkspaceContext();\n const componentsToCreate = this.template.create(workspaceContext);\n await pMapSeries(componentsToCreate, async (componentToCreate) => {\n return this.generator.generateComponentTemplate(\n [componentToCreate.componentName],\n componentToCreate.templateName,\n {\n aspect: componentToCreate.aspect,\n env: componentToCreate.env,\n path: componentToCreate.path,\n scope: componentToCreate.scope,\n }\n );\n });\n }\n\n private async forkComponentsFromRemote() {\n if (this.options.empty) return;\n const workspaceContext = this.getWorkspaceContext();\n const componentsToFork =\n this.template?.importComponents?.(workspaceContext) || this.template?.fork?.(workspaceContext) || [];\n if (!componentsToFork.length) return;\n const componentsToForkRestructured = componentsToFork.map(({ id, targetName, path, env, config, targetScope }) => ({\n sourceId: id,\n targetId: targetName,\n targetScope,\n path,\n env,\n config,\n }));\n await this.forking.forkMultipleFromRemote(componentsToForkRestructured, {\n scope: this.workspace.defaultScope,\n refactor: true,\n install: false,\n });\n }\n\n private async importComponentsFromRemote() {\n if (this.options.empty) return;\n const workspaceContext = this.getWorkspaceContext();\n const componentsToImport = this.template?.import?.(workspaceContext) || [];\n\n if (!componentsToImport.length) return;\n\n await pMapSeries(componentsToImport, async (componentToImport) => {\n await this.importer.import(\n {\n ids: [componentToImport.id],\n installNpmPackages: false,\n writeConfigFiles: false,\n writeToPath: componentToImport.path,\n },\n []\n );\n });\n\n await this.workspace.bitMap.write('new');\n }\n\n private async compileComponents(clearCache = true) {\n if (clearCache) {\n await this.workspace.clearCache();\n }\n const compiler = this.harmony.get<CompilerMain>(CompilerAspect.id);\n await compiler.compileOnWorkspace();\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,YAAA;EAAA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QAAQ,EAAE,IAAI;MACdjF,OAAO,EAAE;IACX,CAAC,CAAC;EACJ;EAEA,MAAcF,0BAA0BA,CAAA,EAAG;IACzC,IAAI,IAAI,CAAClB,OAAO,CAACqD,KAAK,EAAE;IACxB,MAAMC,gBAAgB,GAAG,IAAI,CAACJ,mBAAmB,CAAC,CAAC;IACnD,MAAMoD,kBAAkB,GAAG,IAAI,CAACrG,QAAQ,EAAEsB,MAAM,GAAG+B,gBAAgB,CAAC,IAAI,EAAE;IAE1E,IAAI,CAACgD,kBAAkB,CAACT,MAAM,EAAE;IAEhC,MAAM,IAAAZ,qBAAU,EAACqB,kBAAkB,EAAE,MAAOC,iBAAiB,IAAK;MAChE,MAAM,IAAI,CAAC/B,QAAQ,CAACjD,MAAM,CACxB;QACEiF,GAAG,EAAE,CAACD,iBAAiB,CAACvD,EAAE,CAAC;QAC3ByD,kBAAkB,EAAE,KAAK;QACzB5E,gBAAgB,EAAE,KAAK;QACvB6E,WAAW,EAAEH,iBAAiB,CAACf;MACjC,CAAC,EACD,EACF,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,IAAI,CAAC3E,SAAS,CAAC8F,MAAM,CAACC,KAAK,CAAC,KAAK,CAAC;EAC1C;EAEA,MAAcjF,iBAAiBA,CAACR,UAAU,GAAG,IAAI,EAAE;IACjD,IAAIA,UAAU,EAAE;MACd,MAAM,IAAI,CAACN,SAAS,CAACM,UAAU,CAAC,CAAC;IACnC;IACA,MAAM0F,QAAQ,GAAG,IAAI,CAAChE,OAAO,CAACC,GAAG,CAAegE,0BAAc,CAAC9D,EAAE,CAAC;IAClE,MAAM6D,QAAQ,CAACE,kBAAkB,CAAC,CAAC;EACrC;AACF;AAACC,OAAA,CAAApH,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_bit","_execa","_pMapSeries","_ui","_logger","_workspace","_forking","_consumer","_importer","_compiler","_gitExecutable","_gitNotFound","_path","_git","_install","_workspaceConfigFiles","_generator","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","WorkspaceGenerator","constructor","workspaceName","workspacePath","options","template","aspectComponent","generate","fs","ensureDir","process","chdir","initGit","init","skipGit","writeWorkspaceFiles","reloadBitInWorkspaceDir","workspace","inInstallContext","setupGitBitmapMergeDriver","createComponentsFromRemote","forkComponentsFromRemote","importComponentsFromRemote","clearCache","install","undefined","dedupe","import","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","updateExisting","compileComponents","wsConfigFiles","writeConfigFiles","err","logger","error","remove","gitExecutablePath","getGitExecutablePath","params","execa","exitCodeName","GitNotFound","git","setGitMergeDriver","global","buildUI","uiMain","harmony","get","UIAspect","id","createRuntime","getWorkspaceContext","name","defaultScope","empty","workspaceContext","templateFiles","generateFiles","Promise","all","map","templateFile","outputFile","join","relativePath","content","loadBit","WorkspaceAspect","InstallAspect","loggerMain","LoggerAspect","createLogger","GeneratorAspect","importer","ImporterAspect","forking","ForkingAspect","GitAspect","WorkspaceConfigFilesAspect","generator","create","componentsToCreate","pMapSeries","componentToCreate","generateComponentTemplate","componentName","templateName","aspect","env","path","scope","componentsToFork","importComponents","fork","length","componentsToForkRestructured","targetName","config","targetScope","sourceId","targetId","forkMultipleFromRemote","refactor","componentsToImport","componentToImport","ids","installNpmPackages","writeToPath","bitMap","write","compiler","CompilerAspect","compileOnWorkspace","exports"],"sources":["workspace-generator.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { loadBit } from '@teambit/bit';\nimport { Harmony } from '@teambit/harmony';\nimport { Component } from '@teambit/component';\nimport execa from 'execa';\nimport pMapSeries from 'p-map-series';\nimport { UIAspect, UiMain } from '@teambit/ui';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport { ForkingAspect, ForkingMain } from '@teambit/forking';\nimport { init } from '@teambit/legacy/dist/api/consumer';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport getGitExecutablePath from '@teambit/legacy/dist/utils/git/git-executable';\nimport GitNotFound from '@teambit/legacy/dist/utils/git/exceptions/git-not-found';\nimport { join } from 'path';\nimport { ComponentID } from '@teambit/component-id';\nimport { GitAspect, GitMain } from '@teambit/git';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport { WorkspaceConfigFilesAspect, WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\n// import { ComponentGenerator } from './component-generator';\nimport { WorkspaceTemplate, WorkspaceContext } from './workspace-template';\nimport { NewOptions } from './new.cmd';\nimport { GeneratorAspect } from './generator.aspect';\nimport { GeneratorMain } from './generator.main.runtime';\n\nexport type GenerateResult = { id: ComponentID; dir: string; files: string[]; envId: string };\n\nexport class WorkspaceGenerator {\n private harmony: Harmony;\n private workspace: Workspace;\n private install: InstallMain;\n private importer: ImporterMain;\n private logger?: Logger;\n private forking: ForkingMain;\n private git: GitMain;\n private wsConfigFiles: WorkspaceConfigFilesMain;\n private generator: GeneratorMain;\n\n constructor(\n private workspaceName: string,\n private workspacePath: string,\n private options: NewOptions & { currentDir?: boolean },\n private template: WorkspaceTemplate,\n private aspectComponent?: Component\n ) {}\n\n async generate(): Promise<string> {\n await fs.ensureDir(this.workspacePath);\n try {\n process.chdir(this.workspacePath);\n await this.initGit();\n await init(this.workspacePath, this.options.skipGit, false, false, false, false, false, false, false, {});\n await this.writeWorkspaceFiles();\n await this.reloadBitInWorkspaceDir();\n // Setting the workspace to be in install context to prevent errors during the workspace generation\n // the workspace will be in install context until the end of the generation install process\n this.workspace.inInstallContext = true;\n await this.setupGitBitmapMergeDriver();\n await this.createComponentsFromRemote();\n await this.forkComponentsFromRemote();\n await this.importComponentsFromRemote();\n await this.workspace.clearCache();\n await this.install.install(undefined, {\n dedupe: true,\n import: false,\n copyPeerToRuntimeOnRoot: true,\n copyPeerToRuntimeOnComponents: false,\n updateExisting: false,\n });\n\n // compile the components again now that we have the dependencies installed\n await this.compileComponents(true);\n await this.wsConfigFiles.writeConfigFiles({});\n } catch (err: any) {\n this.logger?.error(`failed generating a new workspace, will delete the dir ${this.workspacePath}`, err);\n await fs.remove(this.workspacePath);\n throw err;\n }\n\n return this.workspacePath;\n }\n\n private async initGit() {\n if (this.options.skipGit) return;\n const gitExecutablePath = getGitExecutablePath();\n const params = ['init'];\n try {\n await execa(gitExecutablePath, params);\n } catch (err: any) {\n if (err.exitCodeName === 'ENOENT') {\n throw new GitNotFound(gitExecutablePath, err);\n }\n throw err;\n }\n }\n\n private async setupGitBitmapMergeDriver() {\n if (this.options.skipGit) return;\n await this.git.setGitMergeDriver({ global: false });\n }\n\n private async buildUI() {\n const uiMain = this.harmony.get<UiMain>(UIAspect.id);\n await uiMain.createRuntime({});\n }\n\n private getWorkspaceContext(): WorkspaceContext {\n return {\n name: this.workspaceName,\n defaultScope: this.options.defaultScope,\n empty: this.options.empty,\n aspectComponent: this.aspectComponent,\n template: this.template,\n skipGit: this.options.skipGit,\n };\n }\n\n /**\n * writes the generated template files to the default directory set in the workspace config\n */\n private async writeWorkspaceFiles(): Promise<void> {\n const workspaceContext = this.getWorkspaceContext();\n const templateFiles = await this.template.generateFiles(workspaceContext);\n await Promise.all(\n templateFiles.map(async (templateFile) => {\n await fs.outputFile(join(this.workspacePath, templateFile.relativePath), templateFile.content);\n })\n );\n }\n\n private async reloadBitInWorkspaceDir() {\n this.harmony = await loadBit(this.workspacePath);\n this.workspace = this.harmony.get<Workspace>(WorkspaceAspect.id);\n this.install = this.harmony.get<InstallMain>(InstallAspect.id);\n const loggerMain = this.harmony.get<LoggerMain>(LoggerAspect.id);\n this.logger = loggerMain.createLogger(GeneratorAspect.id);\n this.importer = this.harmony.get<ImporterMain>(ImporterAspect.id);\n this.forking = this.harmony.get<ForkingMain>(ForkingAspect.id);\n this.git = this.harmony.get<GitMain>(GitAspect.id);\n this.wsConfigFiles = this.harmony.get<WorkspaceConfigFilesMain>(WorkspaceConfigFilesAspect.id);\n this.generator = this.harmony.get<GeneratorMain>(GeneratorAspect.id);\n }\n\n private async createComponentsFromRemote() {\n if (this.options.empty || !this.template.create) return;\n const workspaceContext = this.getWorkspaceContext();\n const componentsToCreate = this.template.create(workspaceContext);\n await pMapSeries(componentsToCreate, async (componentToCreate) => {\n return this.generator.generateComponentTemplate(\n [componentToCreate.componentName],\n componentToCreate.templateName,\n {\n aspect: componentToCreate.aspect,\n env: componentToCreate.env,\n path: componentToCreate.path,\n scope: componentToCreate.scope,\n }\n );\n });\n }\n\n private async forkComponentsFromRemote() {\n if (this.options.empty) return;\n const workspaceContext = this.getWorkspaceContext();\n const componentsToFork =\n this.template?.importComponents?.(workspaceContext) || this.template?.fork?.(workspaceContext) || [];\n if (!componentsToFork.length) return;\n const componentsToForkRestructured = componentsToFork.map(({ id, targetName, path, env, config, targetScope }) => ({\n sourceId: id,\n targetId: targetName,\n targetScope,\n path,\n env,\n config,\n }));\n await this.forking.forkMultipleFromRemote(componentsToForkRestructured, {\n scope: this.workspace.defaultScope,\n refactor: true,\n install: false,\n });\n }\n\n private async importComponentsFromRemote() {\n if (this.options.empty) return;\n const workspaceContext = this.getWorkspaceContext();\n const componentsToImport = this.template?.import?.(workspaceContext) || [];\n\n if (!componentsToImport.length) return;\n\n await pMapSeries(componentsToImport, async (componentToImport) => {\n await this.importer.import(\n {\n ids: [componentToImport.id],\n installNpmPackages: false,\n writeConfigFiles: false,\n writeToPath: componentToImport.path,\n },\n []\n );\n });\n\n await this.workspace.bitMap.write('new');\n }\n\n private async compileComponents(clearCache = true) {\n if (clearCache) {\n await this.workspace.clearCache();\n }\n const compiler = this.harmony.get<CompilerMain>(CompilerAspect.id);\n await compiler.compileOnWorkspace();\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,Y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ACnC;IACA,MAAM0F,QAAQ,GAAG,IAAI,CAAChE,OAAO,CAACC,GAAG,CAAegE,0BAAc,CAAC9D,EAAE,CAAC;IAClE,MAAM6D,QAAQ,CAACE,kBAAkB,CAAC,CAAC;EACrC;AACF;AAACC,OAAA,CAAApH,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/generator",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.211",
|
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.211"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"camelcase": "6.2.0",
|
@@ -21,25 +21,25 @@
|
|
21
21
|
"@teambit/component-id": "1.2.0",
|
22
22
|
"@teambit/harmony": "0.4.6",
|
23
23
|
"@teambit/git.modules.git-ignore": "1.0.2",
|
24
|
-
"@teambit/envs": "1.0.
|
24
|
+
"@teambit/envs": "1.0.210",
|
25
25
|
"@teambit/logger": "0.0.951",
|
26
|
-
"@teambit/new-component-helper": "1.0.
|
27
|
-
"@teambit/tracker": "1.0.
|
28
|
-
"@teambit/workspace-config-files": "1.0.
|
26
|
+
"@teambit/new-component-helper": "1.0.210",
|
27
|
+
"@teambit/tracker": "1.0.210",
|
28
|
+
"@teambit/workspace-config-files": "1.0.210",
|
29
29
|
"@teambit/workspace.modules.node-modules-linker": "0.0.165",
|
30
|
-
"@teambit/workspace": "1.0.
|
31
|
-
"@teambit/component": "1.0.
|
30
|
+
"@teambit/workspace": "1.0.210",
|
31
|
+
"@teambit/component": "1.0.210",
|
32
32
|
"@teambit/cli": "0.0.858",
|
33
|
-
"@teambit/graphql": "1.0.
|
34
|
-
"@teambit/aspect-loader": "1.0.
|
35
|
-
"@teambit/bit": "1.6.
|
36
|
-
"@teambit/git": "1.0.
|
37
|
-
"@teambit/compiler": "1.0.
|
38
|
-
"@teambit/forking": "1.0.
|
39
|
-
"@teambit/importer": "1.0.
|
40
|
-
"@teambit/install": "1.0.
|
41
|
-
"@teambit/ui": "1.0.
|
42
|
-
"@teambit/config": "0.0.
|
33
|
+
"@teambit/graphql": "1.0.210",
|
34
|
+
"@teambit/aspect-loader": "1.0.210",
|
35
|
+
"@teambit/bit": "1.6.103",
|
36
|
+
"@teambit/git": "1.0.210",
|
37
|
+
"@teambit/compiler": "1.0.210",
|
38
|
+
"@teambit/forking": "1.0.210",
|
39
|
+
"@teambit/importer": "1.0.210",
|
40
|
+
"@teambit/install": "1.0.210",
|
41
|
+
"@teambit/ui": "1.0.210",
|
42
|
+
"@teambit/config": "0.0.961"
|
43
43
|
},
|
44
44
|
"devDependencies": {
|
45
45
|
"@types/fs-extra": "9.0.7",
|