@teambit/generator 1.0.455 → 1.0.457
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_generator_generator-preview.js +1 -1
- package/artifacts/schema.json +99 -99
- package/dist/component-generator.d.ts +0 -4
- package/dist/component-generator.js +4 -35
- package/dist/component-generator.js.map +1 -1
- package/dist/{preview-1730949656105.js → preview-1731122628865.js} +2 -2
- package/package.json +23 -26
|
@@ -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.457" 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={78636:(e,t,n)=>{var a={id:"teambit.generator/aspect-docs/generator@0.0.172",homepage:"https://bit.cloud/teambit/generator/aspect-docs/generator",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=c,l(n(41594));var o=n(5016),r=["components"];function l(e){return e&&e.__esModule?e:{default:e}}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 a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},m.apply(null,arguments)}function p(e,t){if(null==e)return{};var n,a,o=i(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function i(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}l.__bit_component=a,m.__bit_component=a,p.__bit_component=a,i.__bit_component=a;var s={},d="wrapper";function c(e){var t=e.components,n=p(e,r);return(0,o.mdx)(d,m({},s,n,{components:t,mdxType:"MDXLayout"}),(0,o.mdx)("p",null,"Generator extension enable generating new components by pre-defined templates"),(0,o.mdx)("h3",null,"Component location"),(0,o.mdx)("p",null,"Component location in the workspace directory tree is defined with the ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit create")," command (see below). For example, a component named ",(0,o.mdx)("inlineCode",{parentName:"p"},"ShoppingCart")," created in the ",(0,o.mdx)("inlineCode",{parentName:"p"},"acme.shopper")," and the namespace ",(0,o.mdx)("inlineCode",{parentName:"p"},"ui")," will be generated in the following directory:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre"},"acme.shopper/ui/shopping-cart\n")),(0,o.mdx)("h3",null,"Component name"),(0,o.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,o.mdx)("h3",null,"Automatically ",(0,o.mdx)("inlineCode",{parentName:"h3"},"add")," component"),(0,o.mdx)("p",null,"Bit should automatically register the new component to the ",(0,o.mdx)("inlineCode",{parentName:"p"},".bitmap")," file with a symmetrical name to the component-location in the workspace."),(0,o.mdx)("h2",null,"Register a template"),(0,o.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,o.mdx)("inlineCode",{parentName:"p"},"component-template.ts")," file for more info about the exact API."),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"Component name should be available as a param for the file-content-template."),(0,o.mdx)("li",{parentName:"ul"},"TBD: An environment must have a default template (if not set, use first template in array?).")),(0,o.mdx)("p",null,"To register a template, use the Generator API: ",(0,o.mdx)("inlineCode",{parentName:"p"},"registerComponentTemplate(templates: ComponentTemplate[])"),"."),(0,o.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,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.generator/generator": {\n "aspects": [\n "teambit.harmony/aspect"\n ]\n },\n')),(0,o.mdx)("p",null,"In the example above, the aspect ",(0,o.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/aspect")," is configured to be available for the generator."),(0,o.mdx)("h2",null,"Show all available templates"),(0,o.mdx)("p",null,"Introduce a new command ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit templates"),", which groups all available templates by aspects."),(0,o.mdx)("h2",null,"Hide core templates"),(0,o.mdx)("p",null,"Configure the Generator aspect to hide core templates when running ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit templates"),". They'll be only shown when using ",(0,o.mdx)("inlineCode",{parentName:"p"},"--show-all")," flag."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.generator/generator": {\n "hideCoreTemplates": true\n },\n')),(0,o.mdx)("h2",null,"Generate a template from CLI"),(0,o.mdx)("p",null,"Introduce a ",(0,o.mdx)("inlineCode",{parentName:"p"},"create")," command to use templates."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-sh"},"bit create <template-name> <component-name...> [--scope | -s] [--namespace | -n] [--aspect | -a]\n")),(0,o.mdx)("h3",null,"Args"),(0,o.mdx)("h4",null,(0,o.mdx)("inlineCode",{parentName:"h4"},"<component name>")),(0,o.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,o.mdx)("p",null,(0,o.mdx)("strong",{parentName:"p"},"generated file structure should use kebab-case, while the template itself be in camel case"),"."),(0,o.mdx)("h3",null,"Options"),(0,o.mdx)("h4",null,(0,o.mdx)("inlineCode",{parentName:"h4"},"[--scope | -s]")),(0,o.mdx)("p",null,"Sets the component's scope and base directory. If not defined, use the ",(0,o.mdx)("inlineCode",{parentName:"p"},"defaultScope")," from ",(0,o.mdx)("inlineCode",{parentName:"p"},"teambit.workspace/workspace")," config."),(0,o.mdx)("h4",null,(0,o.mdx)("inlineCode",{parentName:"h4"},"[--namespace | -n]")),(0,o.mdx)("p",null,"Sets the component's namespace and nested dirs inside the scope. If not define, use empty string."),(0,o.mdx)("h4",null,(0,o.mdx)("inlineCode",{parentName:"h4"},"[--aspect | -a]")),(0,o.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,o.mdx)("h2",null,"Creating a custom template generator"),(0,o.mdx)("p",null,"See our ",(0,o.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=a,c.isMDXComponent=!0},47152:(e,t,n)=>{Object.defineProperty(t,"W",{enumerable:!0,get:function(){return a.default}});var a=o(n(78636));function o(e){return e&&e.__esModule?e:{default:e}}o.__bit_component={id:"teambit.generator/aspect-docs/generator@0.0.172",homepage:"https://bit.cloud/teambit/generator/aspect-docs/generator",exported:!0}},
|
|
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={78636:(e,t,n)=>{var a={id:"teambit.generator/aspect-docs/generator@0.0.172",homepage:"https://bit.cloud/teambit/generator/aspect-docs/generator",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=c,l(n(41594));var o=n(5016),r=["components"];function l(e){return e&&e.__esModule?e:{default:e}}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 a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},m.apply(null,arguments)}function p(e,t){if(null==e)return{};var n,a,o=i(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function i(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}l.__bit_component=a,m.__bit_component=a,p.__bit_component=a,i.__bit_component=a;var s={},d="wrapper";function c(e){var t=e.components,n=p(e,r);return(0,o.mdx)(d,m({},s,n,{components:t,mdxType:"MDXLayout"}),(0,o.mdx)("p",null,"Generator extension enable generating new components by pre-defined templates"),(0,o.mdx)("h3",null,"Component location"),(0,o.mdx)("p",null,"Component location in the workspace directory tree is defined with the ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit create")," command (see below). For example, a component named ",(0,o.mdx)("inlineCode",{parentName:"p"},"ShoppingCart")," created in the ",(0,o.mdx)("inlineCode",{parentName:"p"},"acme.shopper")," and the namespace ",(0,o.mdx)("inlineCode",{parentName:"p"},"ui")," will be generated in the following directory:"),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre"},"acme.shopper/ui/shopping-cart\n")),(0,o.mdx)("h3",null,"Component name"),(0,o.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,o.mdx)("h3",null,"Automatically ",(0,o.mdx)("inlineCode",{parentName:"h3"},"add")," component"),(0,o.mdx)("p",null,"Bit should automatically register the new component to the ",(0,o.mdx)("inlineCode",{parentName:"p"},".bitmap")," file with a symmetrical name to the component-location in the workspace."),(0,o.mdx)("h2",null,"Register a template"),(0,o.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,o.mdx)("inlineCode",{parentName:"p"},"component-template.ts")," file for more info about the exact API."),(0,o.mdx)("ul",null,(0,o.mdx)("li",{parentName:"ul"},"Component name should be available as a param for the file-content-template."),(0,o.mdx)("li",{parentName:"ul"},"TBD: An environment must have a default template (if not set, use first template in array?).")),(0,o.mdx)("p",null,"To register a template, use the Generator API: ",(0,o.mdx)("inlineCode",{parentName:"p"},"registerComponentTemplate(templates: ComponentTemplate[])"),"."),(0,o.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,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.generator/generator": {\n "aspects": [\n "teambit.harmony/aspect"\n ]\n },\n')),(0,o.mdx)("p",null,"In the example above, the aspect ",(0,o.mdx)("inlineCode",{parentName:"p"},"teambit.harmony/aspect")," is configured to be available for the generator."),(0,o.mdx)("h2",null,"Show all available templates"),(0,o.mdx)("p",null,"Introduce a new command ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit templates"),", which groups all available templates by aspects."),(0,o.mdx)("h2",null,"Hide core templates"),(0,o.mdx)("p",null,"Configure the Generator aspect to hide core templates when running ",(0,o.mdx)("inlineCode",{parentName:"p"},"bit templates"),". They'll be only shown when using ",(0,o.mdx)("inlineCode",{parentName:"p"},"--show-all")," flag."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-json"},'"teambit.generator/generator": {\n "hideCoreTemplates": true\n },\n')),(0,o.mdx)("h2",null,"Generate a template from CLI"),(0,o.mdx)("p",null,"Introduce a ",(0,o.mdx)("inlineCode",{parentName:"p"},"create")," command to use templates."),(0,o.mdx)("pre",null,(0,o.mdx)("code",{parentName:"pre",className:"language-sh"},"bit create <template-name> <component-name...> [--scope | -s] [--namespace | -n] [--aspect | -a]\n")),(0,o.mdx)("h3",null,"Args"),(0,o.mdx)("h4",null,(0,o.mdx)("inlineCode",{parentName:"h4"},"<component name>")),(0,o.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,o.mdx)("p",null,(0,o.mdx)("strong",{parentName:"p"},"generated file structure should use kebab-case, while the template itself be in camel case"),"."),(0,o.mdx)("h3",null,"Options"),(0,o.mdx)("h4",null,(0,o.mdx)("inlineCode",{parentName:"h4"},"[--scope | -s]")),(0,o.mdx)("p",null,"Sets the component's scope and base directory. If not defined, use the ",(0,o.mdx)("inlineCode",{parentName:"p"},"defaultScope")," from ",(0,o.mdx)("inlineCode",{parentName:"p"},"teambit.workspace/workspace")," config."),(0,o.mdx)("h4",null,(0,o.mdx)("inlineCode",{parentName:"h4"},"[--namespace | -n]")),(0,o.mdx)("p",null,"Sets the component's namespace and nested dirs inside the scope. If not define, use empty string."),(0,o.mdx)("h4",null,(0,o.mdx)("inlineCode",{parentName:"h4"},"[--aspect | -a]")),(0,o.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,o.mdx)("h2",null,"Creating a custom template generator"),(0,o.mdx)("p",null,"See our ",(0,o.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=a,c.isMDXComponent=!0},47152:(e,t,n)=>{Object.defineProperty(t,"W",{enumerable:!0,get:function(){return a.default}});var a=o(n(78636));function o(e){return e&&e.__esModule?e:{default:e}}o.__bit_component={id:"teambit.generator/aspect-docs/generator@0.0.172",homepage:"https://bit.cloud/teambit/generator/aspect-docs/generator",exported:!0}},77643:(e,t,n)=>{var a={id:"teambit.generator/generator@1.0.457",homepage:"https://bit.cloud/teambit/generator/generator",exported:!0};function o(){const e=r(n(41594));return o=function(){return e},e}function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,o.__bit_component=a,r.__bit_component=a;const l=()=>o().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},o().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/generator-new.svg"}));l.__bit_component=a,t.Logo=l},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,n),r.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},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 a={};n.r(a),n.d(a,{compositions:()=>h,compositions_metadata:()=>x,overview:()=>f});var o={};n.r(o),n.d(o,{default:()=>u});var r=n(77643),l=(n(41594),n(5016));const m=TeambitMdxUiMdxScopeContext;var p=n(47152),i=["components"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},s.apply(null,arguments)}var d={},c="wrapper";function u(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i);return(0,l.mdx)(c,s({},d,n,{components:t,mdxType:"MDXLayout"}),(0,l.mdx)(m.MDXScopeProvider,{components:{Generator:p.W},mdxType:"MDXScopeProvider"},(0,l.mdx)(p.W,{mdxType:"Generator"})))}u.isMDXComponent=!0;const h=[r],f=[o],x={compositions:[{displayName:"Logo",identifier:"Logo"}]};return a})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -6118,7 +6118,7 @@
|
|
|
6118
6118
|
"__schema": "TypeSchema",
|
|
6119
6119
|
"location": {
|
|
6120
6120
|
"filePath": "component-generator.ts",
|
|
6121
|
-
"line":
|
|
6121
|
+
"line": 20,
|
|
6122
6122
|
"character": 1
|
|
6123
6123
|
},
|
|
6124
6124
|
"signature": "type GenerateResult = {\n id: ComponentID;\n dir: string;\n files: string[];\n envId: string;\n envSetBy: string;\n packageName: string;\n isApp?: boolean | undefined;\n isEnv?: boolean | undefined;\n dependencies?: string[] | undefined;\n installMissingDependencies?: boolean | undefined;\n}",
|
|
@@ -6127,7 +6127,7 @@
|
|
|
6127
6127
|
"__schema": "TypeLiteralSchema",
|
|
6128
6128
|
"location": {
|
|
6129
6129
|
"filePath": "component-generator.ts",
|
|
6130
|
-
"line":
|
|
6130
|
+
"line": 20,
|
|
6131
6131
|
"character": 30
|
|
6132
6132
|
},
|
|
6133
6133
|
"members": [
|
|
@@ -6135,7 +6135,7 @@
|
|
|
6135
6135
|
"__schema": "VariableLikeSchema",
|
|
6136
6136
|
"location": {
|
|
6137
6137
|
"filePath": "component-generator.ts",
|
|
6138
|
-
"line":
|
|
6138
|
+
"line": 21,
|
|
6139
6139
|
"character": 3
|
|
6140
6140
|
},
|
|
6141
6141
|
"signature": "(property) id: ComponentID",
|
|
@@ -6144,7 +6144,7 @@
|
|
|
6144
6144
|
"__schema": "TypeRefSchema",
|
|
6145
6145
|
"location": {
|
|
6146
6146
|
"filePath": "component-generator.ts",
|
|
6147
|
-
"line":
|
|
6147
|
+
"line": 21,
|
|
6148
6148
|
"character": 3
|
|
6149
6149
|
},
|
|
6150
6150
|
"name": "ComponentID",
|
|
@@ -6160,7 +6160,7 @@
|
|
|
6160
6160
|
"__schema": "VariableLikeSchema",
|
|
6161
6161
|
"location": {
|
|
6162
6162
|
"filePath": "component-generator.ts",
|
|
6163
|
-
"line":
|
|
6163
|
+
"line": 22,
|
|
6164
6164
|
"character": 3
|
|
6165
6165
|
},
|
|
6166
6166
|
"signature": "(property) dir: string",
|
|
@@ -6169,7 +6169,7 @@
|
|
|
6169
6169
|
"__schema": "KeywordTypeSchema",
|
|
6170
6170
|
"location": {
|
|
6171
6171
|
"filePath": "component-generator.ts",
|
|
6172
|
-
"line":
|
|
6172
|
+
"line": 22,
|
|
6173
6173
|
"character": 8
|
|
6174
6174
|
},
|
|
6175
6175
|
"name": "string"
|
|
@@ -6180,7 +6180,7 @@
|
|
|
6180
6180
|
"__schema": "VariableLikeSchema",
|
|
6181
6181
|
"location": {
|
|
6182
6182
|
"filePath": "component-generator.ts",
|
|
6183
|
-
"line":
|
|
6183
|
+
"line": 23,
|
|
6184
6184
|
"character": 3
|
|
6185
6185
|
},
|
|
6186
6186
|
"signature": "(property) files: string[]",
|
|
@@ -6189,14 +6189,14 @@
|
|
|
6189
6189
|
"__schema": "TypeArraySchema",
|
|
6190
6190
|
"location": {
|
|
6191
6191
|
"filePath": "component-generator.ts",
|
|
6192
|
-
"line":
|
|
6192
|
+
"line": 23,
|
|
6193
6193
|
"character": 10
|
|
6194
6194
|
},
|
|
6195
6195
|
"type": {
|
|
6196
6196
|
"__schema": "KeywordTypeSchema",
|
|
6197
6197
|
"location": {
|
|
6198
6198
|
"filePath": "component-generator.ts",
|
|
6199
|
-
"line":
|
|
6199
|
+
"line": 23,
|
|
6200
6200
|
"character": 10
|
|
6201
6201
|
},
|
|
6202
6202
|
"name": "string"
|
|
@@ -6208,7 +6208,7 @@
|
|
|
6208
6208
|
"__schema": "VariableLikeSchema",
|
|
6209
6209
|
"location": {
|
|
6210
6210
|
"filePath": "component-generator.ts",
|
|
6211
|
-
"line":
|
|
6211
|
+
"line": 24,
|
|
6212
6212
|
"character": 3
|
|
6213
6213
|
},
|
|
6214
6214
|
"signature": "(property) envId: string",
|
|
@@ -6217,7 +6217,7 @@
|
|
|
6217
6217
|
"__schema": "KeywordTypeSchema",
|
|
6218
6218
|
"location": {
|
|
6219
6219
|
"filePath": "component-generator.ts",
|
|
6220
|
-
"line":
|
|
6220
|
+
"line": 24,
|
|
6221
6221
|
"character": 10
|
|
6222
6222
|
},
|
|
6223
6223
|
"name": "string"
|
|
@@ -6228,7 +6228,7 @@
|
|
|
6228
6228
|
"__schema": "VariableLikeSchema",
|
|
6229
6229
|
"location": {
|
|
6230
6230
|
"filePath": "component-generator.ts",
|
|
6231
|
-
"line":
|
|
6231
|
+
"line": 25,
|
|
6232
6232
|
"character": 3
|
|
6233
6233
|
},
|
|
6234
6234
|
"signature": "(property) envSetBy: string",
|
|
@@ -6237,7 +6237,7 @@
|
|
|
6237
6237
|
"__schema": "KeywordTypeSchema",
|
|
6238
6238
|
"location": {
|
|
6239
6239
|
"filePath": "component-generator.ts",
|
|
6240
|
-
"line":
|
|
6240
|
+
"line": 25,
|
|
6241
6241
|
"character": 13
|
|
6242
6242
|
},
|
|
6243
6243
|
"name": "string"
|
|
@@ -6248,7 +6248,7 @@
|
|
|
6248
6248
|
"__schema": "VariableLikeSchema",
|
|
6249
6249
|
"location": {
|
|
6250
6250
|
"filePath": "component-generator.ts",
|
|
6251
|
-
"line":
|
|
6251
|
+
"line": 26,
|
|
6252
6252
|
"character": 3
|
|
6253
6253
|
},
|
|
6254
6254
|
"signature": "(property) packageName: string",
|
|
@@ -6257,7 +6257,7 @@
|
|
|
6257
6257
|
"__schema": "KeywordTypeSchema",
|
|
6258
6258
|
"location": {
|
|
6259
6259
|
"filePath": "component-generator.ts",
|
|
6260
|
-
"line":
|
|
6260
|
+
"line": 26,
|
|
6261
6261
|
"character": 16
|
|
6262
6262
|
},
|
|
6263
6263
|
"name": "string"
|
|
@@ -6268,7 +6268,7 @@
|
|
|
6268
6268
|
"__schema": "VariableLikeSchema",
|
|
6269
6269
|
"location": {
|
|
6270
6270
|
"filePath": "component-generator.ts",
|
|
6271
|
-
"line":
|
|
6271
|
+
"line": 27,
|
|
6272
6272
|
"character": 3
|
|
6273
6273
|
},
|
|
6274
6274
|
"signature": "(property) isApp?: boolean | undefined",
|
|
@@ -6277,7 +6277,7 @@
|
|
|
6277
6277
|
"__schema": "KeywordTypeSchema",
|
|
6278
6278
|
"location": {
|
|
6279
6279
|
"filePath": "component-generator.ts",
|
|
6280
|
-
"line":
|
|
6280
|
+
"line": 27,
|
|
6281
6281
|
"character": 11
|
|
6282
6282
|
},
|
|
6283
6283
|
"name": "boolean"
|
|
@@ -6288,7 +6288,7 @@
|
|
|
6288
6288
|
"__schema": "VariableLikeSchema",
|
|
6289
6289
|
"location": {
|
|
6290
6290
|
"filePath": "component-generator.ts",
|
|
6291
|
-
"line":
|
|
6291
|
+
"line": 28,
|
|
6292
6292
|
"character": 3
|
|
6293
6293
|
},
|
|
6294
6294
|
"signature": "(property) isEnv?: boolean | undefined",
|
|
@@ -6297,7 +6297,7 @@
|
|
|
6297
6297
|
"__schema": "KeywordTypeSchema",
|
|
6298
6298
|
"location": {
|
|
6299
6299
|
"filePath": "component-generator.ts",
|
|
6300
|
-
"line":
|
|
6300
|
+
"line": 28,
|
|
6301
6301
|
"character": 11
|
|
6302
6302
|
},
|
|
6303
6303
|
"name": "boolean"
|
|
@@ -6308,7 +6308,7 @@
|
|
|
6308
6308
|
"__schema": "VariableLikeSchema",
|
|
6309
6309
|
"location": {
|
|
6310
6310
|
"filePath": "component-generator.ts",
|
|
6311
|
-
"line":
|
|
6311
|
+
"line": 29,
|
|
6312
6312
|
"character": 3
|
|
6313
6313
|
},
|
|
6314
6314
|
"signature": "(property) dependencies?: string[] | undefined",
|
|
@@ -6317,14 +6317,14 @@
|
|
|
6317
6317
|
"__schema": "TypeArraySchema",
|
|
6318
6318
|
"location": {
|
|
6319
6319
|
"filePath": "component-generator.ts",
|
|
6320
|
-
"line":
|
|
6320
|
+
"line": 29,
|
|
6321
6321
|
"character": 18
|
|
6322
6322
|
},
|
|
6323
6323
|
"type": {
|
|
6324
6324
|
"__schema": "KeywordTypeSchema",
|
|
6325
6325
|
"location": {
|
|
6326
6326
|
"filePath": "component-generator.ts",
|
|
6327
|
-
"line":
|
|
6327
|
+
"line": 29,
|
|
6328
6328
|
"character": 18
|
|
6329
6329
|
},
|
|
6330
6330
|
"name": "string"
|
|
@@ -6336,7 +6336,7 @@
|
|
|
6336
6336
|
"__schema": "VariableLikeSchema",
|
|
6337
6337
|
"location": {
|
|
6338
6338
|
"filePath": "component-generator.ts",
|
|
6339
|
-
"line":
|
|
6339
|
+
"line": 30,
|
|
6340
6340
|
"character": 3
|
|
6341
6341
|
},
|
|
6342
6342
|
"signature": "(property) installMissingDependencies?: boolean | undefined",
|
|
@@ -6345,7 +6345,7 @@
|
|
|
6345
6345
|
"__schema": "KeywordTypeSchema",
|
|
6346
6346
|
"location": {
|
|
6347
6347
|
"filePath": "component-generator.ts",
|
|
6348
|
-
"line":
|
|
6348
|
+
"line": 30,
|
|
6349
6349
|
"character": 32
|
|
6350
6350
|
},
|
|
6351
6351
|
"name": "boolean"
|
|
@@ -13366,7 +13366,7 @@
|
|
|
13366
13366
|
"__schema": "TypeSchema",
|
|
13367
13367
|
"location": {
|
|
13368
13368
|
"filePath": "component-generator.ts",
|
|
13369
|
-
"line":
|
|
13369
|
+
"line": 20,
|
|
13370
13370
|
"character": 1
|
|
13371
13371
|
},
|
|
13372
13372
|
"signature": "type GenerateResult = {\n id: ComponentID;\n dir: string;\n files: string[];\n envId: string;\n envSetBy: string;\n packageName: string;\n isApp?: boolean | undefined;\n isEnv?: boolean | undefined;\n dependencies?: string[] | undefined;\n installMissingDependencies?: boolean | undefined;\n}",
|
|
@@ -13375,7 +13375,7 @@
|
|
|
13375
13375
|
"__schema": "TypeLiteralSchema",
|
|
13376
13376
|
"location": {
|
|
13377
13377
|
"filePath": "component-generator.ts",
|
|
13378
|
-
"line":
|
|
13378
|
+
"line": 20,
|
|
13379
13379
|
"character": 30
|
|
13380
13380
|
},
|
|
13381
13381
|
"members": [
|
|
@@ -13383,7 +13383,7 @@
|
|
|
13383
13383
|
"__schema": "VariableLikeSchema",
|
|
13384
13384
|
"location": {
|
|
13385
13385
|
"filePath": "component-generator.ts",
|
|
13386
|
-
"line":
|
|
13386
|
+
"line": 21,
|
|
13387
13387
|
"character": 3
|
|
13388
13388
|
},
|
|
13389
13389
|
"signature": "(property) id: ComponentID",
|
|
@@ -13392,7 +13392,7 @@
|
|
|
13392
13392
|
"__schema": "TypeRefSchema",
|
|
13393
13393
|
"location": {
|
|
13394
13394
|
"filePath": "component-generator.ts",
|
|
13395
|
-
"line":
|
|
13395
|
+
"line": 21,
|
|
13396
13396
|
"character": 3
|
|
13397
13397
|
},
|
|
13398
13398
|
"name": "ComponentID",
|
|
@@ -13408,7 +13408,7 @@
|
|
|
13408
13408
|
"__schema": "VariableLikeSchema",
|
|
13409
13409
|
"location": {
|
|
13410
13410
|
"filePath": "component-generator.ts",
|
|
13411
|
-
"line":
|
|
13411
|
+
"line": 22,
|
|
13412
13412
|
"character": 3
|
|
13413
13413
|
},
|
|
13414
13414
|
"signature": "(property) dir: string",
|
|
@@ -13417,7 +13417,7 @@
|
|
|
13417
13417
|
"__schema": "KeywordTypeSchema",
|
|
13418
13418
|
"location": {
|
|
13419
13419
|
"filePath": "component-generator.ts",
|
|
13420
|
-
"line":
|
|
13420
|
+
"line": 22,
|
|
13421
13421
|
"character": 8
|
|
13422
13422
|
},
|
|
13423
13423
|
"name": "string"
|
|
@@ -13428,7 +13428,7 @@
|
|
|
13428
13428
|
"__schema": "VariableLikeSchema",
|
|
13429
13429
|
"location": {
|
|
13430
13430
|
"filePath": "component-generator.ts",
|
|
13431
|
-
"line":
|
|
13431
|
+
"line": 23,
|
|
13432
13432
|
"character": 3
|
|
13433
13433
|
},
|
|
13434
13434
|
"signature": "(property) files: string[]",
|
|
@@ -13437,14 +13437,14 @@
|
|
|
13437
13437
|
"__schema": "TypeArraySchema",
|
|
13438
13438
|
"location": {
|
|
13439
13439
|
"filePath": "component-generator.ts",
|
|
13440
|
-
"line":
|
|
13440
|
+
"line": 23,
|
|
13441
13441
|
"character": 10
|
|
13442
13442
|
},
|
|
13443
13443
|
"type": {
|
|
13444
13444
|
"__schema": "KeywordTypeSchema",
|
|
13445
13445
|
"location": {
|
|
13446
13446
|
"filePath": "component-generator.ts",
|
|
13447
|
-
"line":
|
|
13447
|
+
"line": 23,
|
|
13448
13448
|
"character": 10
|
|
13449
13449
|
},
|
|
13450
13450
|
"name": "string"
|
|
@@ -13456,7 +13456,7 @@
|
|
|
13456
13456
|
"__schema": "VariableLikeSchema",
|
|
13457
13457
|
"location": {
|
|
13458
13458
|
"filePath": "component-generator.ts",
|
|
13459
|
-
"line":
|
|
13459
|
+
"line": 24,
|
|
13460
13460
|
"character": 3
|
|
13461
13461
|
},
|
|
13462
13462
|
"signature": "(property) envId: string",
|
|
@@ -13465,7 +13465,7 @@
|
|
|
13465
13465
|
"__schema": "KeywordTypeSchema",
|
|
13466
13466
|
"location": {
|
|
13467
13467
|
"filePath": "component-generator.ts",
|
|
13468
|
-
"line":
|
|
13468
|
+
"line": 24,
|
|
13469
13469
|
"character": 10
|
|
13470
13470
|
},
|
|
13471
13471
|
"name": "string"
|
|
@@ -13476,7 +13476,7 @@
|
|
|
13476
13476
|
"__schema": "VariableLikeSchema",
|
|
13477
13477
|
"location": {
|
|
13478
13478
|
"filePath": "component-generator.ts",
|
|
13479
|
-
"line":
|
|
13479
|
+
"line": 25,
|
|
13480
13480
|
"character": 3
|
|
13481
13481
|
},
|
|
13482
13482
|
"signature": "(property) envSetBy: string",
|
|
@@ -13485,7 +13485,7 @@
|
|
|
13485
13485
|
"__schema": "KeywordTypeSchema",
|
|
13486
13486
|
"location": {
|
|
13487
13487
|
"filePath": "component-generator.ts",
|
|
13488
|
-
"line":
|
|
13488
|
+
"line": 25,
|
|
13489
13489
|
"character": 13
|
|
13490
13490
|
},
|
|
13491
13491
|
"name": "string"
|
|
@@ -13496,7 +13496,7 @@
|
|
|
13496
13496
|
"__schema": "VariableLikeSchema",
|
|
13497
13497
|
"location": {
|
|
13498
13498
|
"filePath": "component-generator.ts",
|
|
13499
|
-
"line":
|
|
13499
|
+
"line": 26,
|
|
13500
13500
|
"character": 3
|
|
13501
13501
|
},
|
|
13502
13502
|
"signature": "(property) packageName: string",
|
|
@@ -13505,7 +13505,7 @@
|
|
|
13505
13505
|
"__schema": "KeywordTypeSchema",
|
|
13506
13506
|
"location": {
|
|
13507
13507
|
"filePath": "component-generator.ts",
|
|
13508
|
-
"line":
|
|
13508
|
+
"line": 26,
|
|
13509
13509
|
"character": 16
|
|
13510
13510
|
},
|
|
13511
13511
|
"name": "string"
|
|
@@ -13516,7 +13516,7 @@
|
|
|
13516
13516
|
"__schema": "VariableLikeSchema",
|
|
13517
13517
|
"location": {
|
|
13518
13518
|
"filePath": "component-generator.ts",
|
|
13519
|
-
"line":
|
|
13519
|
+
"line": 27,
|
|
13520
13520
|
"character": 3
|
|
13521
13521
|
},
|
|
13522
13522
|
"signature": "(property) isApp?: boolean | undefined",
|
|
@@ -13525,7 +13525,7 @@
|
|
|
13525
13525
|
"__schema": "KeywordTypeSchema",
|
|
13526
13526
|
"location": {
|
|
13527
13527
|
"filePath": "component-generator.ts",
|
|
13528
|
-
"line":
|
|
13528
|
+
"line": 27,
|
|
13529
13529
|
"character": 11
|
|
13530
13530
|
},
|
|
13531
13531
|
"name": "boolean"
|
|
@@ -13536,7 +13536,7 @@
|
|
|
13536
13536
|
"__schema": "VariableLikeSchema",
|
|
13537
13537
|
"location": {
|
|
13538
13538
|
"filePath": "component-generator.ts",
|
|
13539
|
-
"line":
|
|
13539
|
+
"line": 28,
|
|
13540
13540
|
"character": 3
|
|
13541
13541
|
},
|
|
13542
13542
|
"signature": "(property) isEnv?: boolean | undefined",
|
|
@@ -13545,7 +13545,7 @@
|
|
|
13545
13545
|
"__schema": "KeywordTypeSchema",
|
|
13546
13546
|
"location": {
|
|
13547
13547
|
"filePath": "component-generator.ts",
|
|
13548
|
-
"line":
|
|
13548
|
+
"line": 28,
|
|
13549
13549
|
"character": 11
|
|
13550
13550
|
},
|
|
13551
13551
|
"name": "boolean"
|
|
@@ -13556,7 +13556,7 @@
|
|
|
13556
13556
|
"__schema": "VariableLikeSchema",
|
|
13557
13557
|
"location": {
|
|
13558
13558
|
"filePath": "component-generator.ts",
|
|
13559
|
-
"line":
|
|
13559
|
+
"line": 29,
|
|
13560
13560
|
"character": 3
|
|
13561
13561
|
},
|
|
13562
13562
|
"signature": "(property) dependencies?: string[] | undefined",
|
|
@@ -13565,14 +13565,14 @@
|
|
|
13565
13565
|
"__schema": "TypeArraySchema",
|
|
13566
13566
|
"location": {
|
|
13567
13567
|
"filePath": "component-generator.ts",
|
|
13568
|
-
"line":
|
|
13568
|
+
"line": 29,
|
|
13569
13569
|
"character": 18
|
|
13570
13570
|
},
|
|
13571
13571
|
"type": {
|
|
13572
13572
|
"__schema": "KeywordTypeSchema",
|
|
13573
13573
|
"location": {
|
|
13574
13574
|
"filePath": "component-generator.ts",
|
|
13575
|
-
"line":
|
|
13575
|
+
"line": 29,
|
|
13576
13576
|
"character": 18
|
|
13577
13577
|
},
|
|
13578
13578
|
"name": "string"
|
|
@@ -13584,7 +13584,7 @@
|
|
|
13584
13584
|
"__schema": "VariableLikeSchema",
|
|
13585
13585
|
"location": {
|
|
13586
13586
|
"filePath": "component-generator.ts",
|
|
13587
|
-
"line":
|
|
13587
|
+
"line": 30,
|
|
13588
13588
|
"character": 3
|
|
13589
13589
|
},
|
|
13590
13590
|
"signature": "(property) installMissingDependencies?: boolean | undefined",
|
|
@@ -13593,7 +13593,7 @@
|
|
|
13593
13593
|
"__schema": "KeywordTypeSchema",
|
|
13594
13594
|
"location": {
|
|
13595
13595
|
"filePath": "component-generator.ts",
|
|
13596
|
-
"line":
|
|
13596
|
+
"line": 30,
|
|
13597
13597
|
"character": 32
|
|
13598
13598
|
},
|
|
13599
13599
|
"name": "boolean"
|
|
@@ -13607,7 +13607,7 @@
|
|
|
13607
13607
|
"__schema": "TypeSchema",
|
|
13608
13608
|
"location": {
|
|
13609
13609
|
"filePath": "component-generator.ts",
|
|
13610
|
-
"line":
|
|
13610
|
+
"line": 33,
|
|
13611
13611
|
"character": 1
|
|
13612
13612
|
},
|
|
13613
13613
|
"signature": "type InstallOptions = {\n optimizeReportForNonTerminal?: boolean | undefined;\n}",
|
|
@@ -13616,7 +13616,7 @@
|
|
|
13616
13616
|
"__schema": "TypeLiteralSchema",
|
|
13617
13617
|
"location": {
|
|
13618
13618
|
"filePath": "component-generator.ts",
|
|
13619
|
-
"line":
|
|
13619
|
+
"line": 33,
|
|
13620
13620
|
"character": 30
|
|
13621
13621
|
},
|
|
13622
13622
|
"members": [
|
|
@@ -13624,7 +13624,7 @@
|
|
|
13624
13624
|
"__schema": "VariableLikeSchema",
|
|
13625
13625
|
"location": {
|
|
13626
13626
|
"filePath": "component-generator.ts",
|
|
13627
|
-
"line":
|
|
13627
|
+
"line": 33,
|
|
13628
13628
|
"character": 32
|
|
13629
13629
|
},
|
|
13630
13630
|
"signature": "(property) optimizeReportForNonTerminal?: boolean | undefined",
|
|
@@ -13633,7 +13633,7 @@
|
|
|
13633
13633
|
"__schema": "KeywordTypeSchema",
|
|
13634
13634
|
"location": {
|
|
13635
13635
|
"filePath": "component-generator.ts",
|
|
13636
|
-
"line":
|
|
13636
|
+
"line": 33,
|
|
13637
13637
|
"character": 63
|
|
13638
13638
|
},
|
|
13639
13639
|
"name": "boolean"
|
|
@@ -13647,7 +13647,7 @@
|
|
|
13647
13647
|
"__schema": "TypeSchema",
|
|
13648
13648
|
"location": {
|
|
13649
13649
|
"filePath": "component-generator.ts",
|
|
13650
|
-
"line":
|
|
13650
|
+
"line": 35,
|
|
13651
13651
|
"character": 1
|
|
13652
13652
|
},
|
|
13653
13653
|
"signature": "type OnComponentCreateFn = (generateResults: GenerateResult[], installOptions?: InstallOptions) => Promise<void>",
|
|
@@ -13656,7 +13656,7 @@
|
|
|
13656
13656
|
"__schema": "FunctionLikeSchema",
|
|
13657
13657
|
"location": {
|
|
13658
13658
|
"filePath": "component-generator.ts",
|
|
13659
|
-
"line":
|
|
13659
|
+
"line": 35,
|
|
13660
13660
|
"character": 35
|
|
13661
13661
|
},
|
|
13662
13662
|
"signature": "(generateResults: GenerateResult[], installOptions?: InstallOptions): Promise<void>",
|
|
@@ -13666,7 +13666,7 @@
|
|
|
13666
13666
|
"__schema": "ParameterSchema",
|
|
13667
13667
|
"location": {
|
|
13668
13668
|
"filePath": "component-generator.ts",
|
|
13669
|
-
"line":
|
|
13669
|
+
"line": 35,
|
|
13670
13670
|
"character": 36
|
|
13671
13671
|
},
|
|
13672
13672
|
"name": "generateResults",
|
|
@@ -13674,14 +13674,14 @@
|
|
|
13674
13674
|
"__schema": "TypeArraySchema",
|
|
13675
13675
|
"location": {
|
|
13676
13676
|
"filePath": "component-generator.ts",
|
|
13677
|
-
"line":
|
|
13677
|
+
"line": 35,
|
|
13678
13678
|
"character": 53
|
|
13679
13679
|
},
|
|
13680
13680
|
"type": {
|
|
13681
13681
|
"__schema": "TypeRefSchema",
|
|
13682
13682
|
"location": {
|
|
13683
13683
|
"filePath": "component-generator.ts",
|
|
13684
|
-
"line":
|
|
13684
|
+
"line": 35,
|
|
13685
13685
|
"character": 53
|
|
13686
13686
|
},
|
|
13687
13687
|
"name": "GenerateResult"
|
|
@@ -13694,7 +13694,7 @@
|
|
|
13694
13694
|
"__schema": "ParameterSchema",
|
|
13695
13695
|
"location": {
|
|
13696
13696
|
"filePath": "component-generator.ts",
|
|
13697
|
-
"line":
|
|
13697
|
+
"line": 35,
|
|
13698
13698
|
"character": 71
|
|
13699
13699
|
},
|
|
13700
13700
|
"name": "installOptions",
|
|
@@ -13702,7 +13702,7 @@
|
|
|
13702
13702
|
"__schema": "TypeRefSchema",
|
|
13703
13703
|
"location": {
|
|
13704
13704
|
"filePath": "component-generator.ts",
|
|
13705
|
-
"line":
|
|
13705
|
+
"line": 35,
|
|
13706
13706
|
"character": 88
|
|
13707
13707
|
},
|
|
13708
13708
|
"name": "InstallOptions",
|
|
@@ -13716,7 +13716,7 @@
|
|
|
13716
13716
|
"__schema": "TypeRefSchema",
|
|
13717
13717
|
"location": {
|
|
13718
13718
|
"filePath": "component-generator.ts",
|
|
13719
|
-
"line":
|
|
13719
|
+
"line": 35,
|
|
13720
13720
|
"character": 107
|
|
13721
13721
|
},
|
|
13722
13722
|
"name": "Promise",
|
|
@@ -13725,7 +13725,7 @@
|
|
|
13725
13725
|
"__schema": "KeywordTypeSchema",
|
|
13726
13726
|
"location": {
|
|
13727
13727
|
"filePath": "component-generator.ts",
|
|
13728
|
-
"line":
|
|
13728
|
+
"line": 35,
|
|
13729
13729
|
"character": 115
|
|
13730
13730
|
},
|
|
13731
13731
|
"name": "void"
|
|
@@ -13739,7 +13739,7 @@
|
|
|
13739
13739
|
"__schema": "ClassSchema",
|
|
13740
13740
|
"location": {
|
|
13741
13741
|
"filePath": "component-generator.ts",
|
|
13742
|
-
"line":
|
|
13742
|
+
"line": 37,
|
|
13743
13743
|
"character": 1
|
|
13744
13744
|
},
|
|
13745
13745
|
"signature": "class ComponentGenerator",
|
|
@@ -13749,7 +13749,7 @@
|
|
|
13749
13749
|
"__schema": "ConstructorSchema",
|
|
13750
13750
|
"location": {
|
|
13751
13751
|
"filePath": "component-generator.ts",
|
|
13752
|
-
"line":
|
|
13752
|
+
"line": 38,
|
|
13753
13753
|
"character": 3
|
|
13754
13754
|
},
|
|
13755
13755
|
"signature": "constructor ComponentGenerator(workspace: Workspace, componentIds: ComponentID[], options: Partial<CreateOptions>, template: ComponentTemplate, envs: EnvsMain, newComponentHelper: NewComponentHelperMain, tracker: TrackerMain, wsConfigFiles: WorkspaceConfigFilesMain, logger: Logger, onComponentCreateSlot: OnComponentCreateSlot, aspectId: string, envId?: ComponentID, installOptions?: InstallOptions): ComponentGenerator",
|
|
@@ -13759,7 +13759,7 @@
|
|
|
13759
13759
|
"__schema": "ParameterSchema",
|
|
13760
13760
|
"location": {
|
|
13761
13761
|
"filePath": "component-generator.ts",
|
|
13762
|
-
"line":
|
|
13762
|
+
"line": 39,
|
|
13763
13763
|
"character": 5
|
|
13764
13764
|
},
|
|
13765
13765
|
"name": "workspace",
|
|
@@ -13767,7 +13767,7 @@
|
|
|
13767
13767
|
"__schema": "TypeRefSchema",
|
|
13768
13768
|
"location": {
|
|
13769
13769
|
"filePath": "component-generator.ts",
|
|
13770
|
-
"line":
|
|
13770
|
+
"line": 39,
|
|
13771
13771
|
"character": 24
|
|
13772
13772
|
},
|
|
13773
13773
|
"name": "Workspace",
|
|
@@ -13783,7 +13783,7 @@
|
|
|
13783
13783
|
"__schema": "ParameterSchema",
|
|
13784
13784
|
"location": {
|
|
13785
13785
|
"filePath": "component-generator.ts",
|
|
13786
|
-
"line":
|
|
13786
|
+
"line": 40,
|
|
13787
13787
|
"character": 5
|
|
13788
13788
|
},
|
|
13789
13789
|
"name": "componentIds",
|
|
@@ -13791,14 +13791,14 @@
|
|
|
13791
13791
|
"__schema": "TypeArraySchema",
|
|
13792
13792
|
"location": {
|
|
13793
13793
|
"filePath": "component-generator.ts",
|
|
13794
|
-
"line":
|
|
13794
|
+
"line": 40,
|
|
13795
13795
|
"character": 27
|
|
13796
13796
|
},
|
|
13797
13797
|
"type": {
|
|
13798
13798
|
"__schema": "TypeRefSchema",
|
|
13799
13799
|
"location": {
|
|
13800
13800
|
"filePath": "component-generator.ts",
|
|
13801
|
-
"line":
|
|
13801
|
+
"line": 40,
|
|
13802
13802
|
"character": 27
|
|
13803
13803
|
},
|
|
13804
13804
|
"name": "ComponentID",
|
|
@@ -13816,7 +13816,7 @@
|
|
|
13816
13816
|
"__schema": "ParameterSchema",
|
|
13817
13817
|
"location": {
|
|
13818
13818
|
"filePath": "component-generator.ts",
|
|
13819
|
-
"line":
|
|
13819
|
+
"line": 41,
|
|
13820
13820
|
"character": 5
|
|
13821
13821
|
},
|
|
13822
13822
|
"name": "options",
|
|
@@ -13824,7 +13824,7 @@
|
|
|
13824
13824
|
"__schema": "TypeRefSchema",
|
|
13825
13825
|
"location": {
|
|
13826
13826
|
"filePath": "component-generator.ts",
|
|
13827
|
-
"line":
|
|
13827
|
+
"line": 41,
|
|
13828
13828
|
"character": 22
|
|
13829
13829
|
},
|
|
13830
13830
|
"name": "Partial",
|
|
@@ -13833,7 +13833,7 @@
|
|
|
13833
13833
|
"__schema": "TypeRefSchema",
|
|
13834
13834
|
"location": {
|
|
13835
13835
|
"filePath": "component-generator.ts",
|
|
13836
|
-
"line":
|
|
13836
|
+
"line": 41,
|
|
13837
13837
|
"character": 30
|
|
13838
13838
|
},
|
|
13839
13839
|
"name": "CreateOptions",
|
|
@@ -13848,7 +13848,7 @@
|
|
|
13848
13848
|
"__schema": "ParameterSchema",
|
|
13849
13849
|
"location": {
|
|
13850
13850
|
"filePath": "component-generator.ts",
|
|
13851
|
-
"line":
|
|
13851
|
+
"line": 42,
|
|
13852
13852
|
"character": 5
|
|
13853
13853
|
},
|
|
13854
13854
|
"name": "template",
|
|
@@ -13856,7 +13856,7 @@
|
|
|
13856
13856
|
"__schema": "TypeRefSchema",
|
|
13857
13857
|
"location": {
|
|
13858
13858
|
"filePath": "component-generator.ts",
|
|
13859
|
-
"line":
|
|
13859
|
+
"line": 42,
|
|
13860
13860
|
"character": 23
|
|
13861
13861
|
},
|
|
13862
13862
|
"name": "ComponentTemplate"
|
|
@@ -13868,7 +13868,7 @@
|
|
|
13868
13868
|
"__schema": "ParameterSchema",
|
|
13869
13869
|
"location": {
|
|
13870
13870
|
"filePath": "component-generator.ts",
|
|
13871
|
-
"line":
|
|
13871
|
+
"line": 43,
|
|
13872
13872
|
"character": 5
|
|
13873
13873
|
},
|
|
13874
13874
|
"name": "envs",
|
|
@@ -13876,7 +13876,7 @@
|
|
|
13876
13876
|
"__schema": "TypeRefSchema",
|
|
13877
13877
|
"location": {
|
|
13878
13878
|
"filePath": "component-generator.ts",
|
|
13879
|
-
"line":
|
|
13879
|
+
"line": 43,
|
|
13880
13880
|
"character": 19
|
|
13881
13881
|
},
|
|
13882
13882
|
"name": "EnvsMain",
|
|
@@ -13892,7 +13892,7 @@
|
|
|
13892
13892
|
"__schema": "ParameterSchema",
|
|
13893
13893
|
"location": {
|
|
13894
13894
|
"filePath": "component-generator.ts",
|
|
13895
|
-
"line":
|
|
13895
|
+
"line": 44,
|
|
13896
13896
|
"character": 5
|
|
13897
13897
|
},
|
|
13898
13898
|
"name": "newComponentHelper",
|
|
@@ -13900,7 +13900,7 @@
|
|
|
13900
13900
|
"__schema": "TypeRefSchema",
|
|
13901
13901
|
"location": {
|
|
13902
13902
|
"filePath": "component-generator.ts",
|
|
13903
|
-
"line":
|
|
13903
|
+
"line": 44,
|
|
13904
13904
|
"character": 33
|
|
13905
13905
|
},
|
|
13906
13906
|
"name": "NewComponentHelperMain",
|
|
@@ -13916,7 +13916,7 @@
|
|
|
13916
13916
|
"__schema": "ParameterSchema",
|
|
13917
13917
|
"location": {
|
|
13918
13918
|
"filePath": "component-generator.ts",
|
|
13919
|
-
"line":
|
|
13919
|
+
"line": 45,
|
|
13920
13920
|
"character": 5
|
|
13921
13921
|
},
|
|
13922
13922
|
"name": "tracker",
|
|
@@ -13924,7 +13924,7 @@
|
|
|
13924
13924
|
"__schema": "TypeRefSchema",
|
|
13925
13925
|
"location": {
|
|
13926
13926
|
"filePath": "component-generator.ts",
|
|
13927
|
-
"line":
|
|
13927
|
+
"line": 45,
|
|
13928
13928
|
"character": 22
|
|
13929
13929
|
},
|
|
13930
13930
|
"name": "TrackerMain",
|
|
@@ -13940,7 +13940,7 @@
|
|
|
13940
13940
|
"__schema": "ParameterSchema",
|
|
13941
13941
|
"location": {
|
|
13942
13942
|
"filePath": "component-generator.ts",
|
|
13943
|
-
"line":
|
|
13943
|
+
"line": 46,
|
|
13944
13944
|
"character": 5
|
|
13945
13945
|
},
|
|
13946
13946
|
"name": "wsConfigFiles",
|
|
@@ -13948,7 +13948,7 @@
|
|
|
13948
13948
|
"__schema": "TypeRefSchema",
|
|
13949
13949
|
"location": {
|
|
13950
13950
|
"filePath": "component-generator.ts",
|
|
13951
|
-
"line":
|
|
13951
|
+
"line": 46,
|
|
13952
13952
|
"character": 28
|
|
13953
13953
|
},
|
|
13954
13954
|
"name": "WorkspaceConfigFilesMain",
|
|
@@ -13964,7 +13964,7 @@
|
|
|
13964
13964
|
"__schema": "ParameterSchema",
|
|
13965
13965
|
"location": {
|
|
13966
13966
|
"filePath": "component-generator.ts",
|
|
13967
|
-
"line":
|
|
13967
|
+
"line": 47,
|
|
13968
13968
|
"character": 5
|
|
13969
13969
|
},
|
|
13970
13970
|
"name": "logger",
|
|
@@ -13972,7 +13972,7 @@
|
|
|
13972
13972
|
"__schema": "TypeRefSchema",
|
|
13973
13973
|
"location": {
|
|
13974
13974
|
"filePath": "component-generator.ts",
|
|
13975
|
-
"line":
|
|
13975
|
+
"line": 47,
|
|
13976
13976
|
"character": 21
|
|
13977
13977
|
},
|
|
13978
13978
|
"name": "Logger",
|
|
@@ -13988,7 +13988,7 @@
|
|
|
13988
13988
|
"__schema": "ParameterSchema",
|
|
13989
13989
|
"location": {
|
|
13990
13990
|
"filePath": "component-generator.ts",
|
|
13991
|
-
"line":
|
|
13991
|
+
"line": 48,
|
|
13992
13992
|
"character": 5
|
|
13993
13993
|
},
|
|
13994
13994
|
"name": "onComponentCreateSlot",
|
|
@@ -13996,7 +13996,7 @@
|
|
|
13996
13996
|
"__schema": "TypeRefSchema",
|
|
13997
13997
|
"location": {
|
|
13998
13998
|
"filePath": "component-generator.ts",
|
|
13999
|
-
"line":
|
|
13999
|
+
"line": 48,
|
|
14000
14000
|
"character": 36
|
|
14001
14001
|
},
|
|
14002
14002
|
"name": "OnComponentCreateSlot",
|
|
@@ -14009,7 +14009,7 @@
|
|
|
14009
14009
|
"__schema": "ParameterSchema",
|
|
14010
14010
|
"location": {
|
|
14011
14011
|
"filePath": "component-generator.ts",
|
|
14012
|
-
"line":
|
|
14012
|
+
"line": 49,
|
|
14013
14013
|
"character": 5
|
|
14014
14014
|
},
|
|
14015
14015
|
"name": "aspectId",
|
|
@@ -14017,7 +14017,7 @@
|
|
|
14017
14017
|
"__schema": "KeywordTypeSchema",
|
|
14018
14018
|
"location": {
|
|
14019
14019
|
"filePath": "component-generator.ts",
|
|
14020
|
-
"line":
|
|
14020
|
+
"line": 49,
|
|
14021
14021
|
"character": 23
|
|
14022
14022
|
},
|
|
14023
14023
|
"name": "string"
|
|
@@ -14029,7 +14029,7 @@
|
|
|
14029
14029
|
"__schema": "ParameterSchema",
|
|
14030
14030
|
"location": {
|
|
14031
14031
|
"filePath": "component-generator.ts",
|
|
14032
|
-
"line":
|
|
14032
|
+
"line": 50,
|
|
14033
14033
|
"character": 5
|
|
14034
14034
|
},
|
|
14035
14035
|
"name": "envId",
|
|
@@ -14037,7 +14037,7 @@
|
|
|
14037
14037
|
"__schema": "TypeRefSchema",
|
|
14038
14038
|
"location": {
|
|
14039
14039
|
"filePath": "component-generator.ts",
|
|
14040
|
-
"line":
|
|
14040
|
+
"line": 50,
|
|
14041
14041
|
"character": 21
|
|
14042
14042
|
},
|
|
14043
14043
|
"name": "ComponentID",
|
|
@@ -14054,7 +14054,7 @@
|
|
|
14054
14054
|
"__schema": "ParameterSchema",
|
|
14055
14055
|
"location": {
|
|
14056
14056
|
"filePath": "component-generator.ts",
|
|
14057
|
-
"line":
|
|
14057
|
+
"line": 51,
|
|
14058
14058
|
"character": 5
|
|
14059
14059
|
},
|
|
14060
14060
|
"name": "installOptions",
|
|
@@ -14062,7 +14062,7 @@
|
|
|
14062
14062
|
"__schema": "TypeRefSchema",
|
|
14063
14063
|
"location": {
|
|
14064
14064
|
"filePath": "component-generator.ts",
|
|
14065
|
-
"line":
|
|
14065
|
+
"line": 51,
|
|
14066
14066
|
"character": 29
|
|
14067
14067
|
},
|
|
14068
14068
|
"name": "InstallOptions",
|
|
@@ -14077,7 +14077,7 @@
|
|
|
14077
14077
|
"__schema": "ThisTypeSchema",
|
|
14078
14078
|
"location": {
|
|
14079
14079
|
"filePath": "component-generator.ts",
|
|
14080
|
-
"line":
|
|
14080
|
+
"line": 37,
|
|
14081
14081
|
"character": 1
|
|
14082
14082
|
},
|
|
14083
14083
|
"name": "ComponentGenerator"
|
|
@@ -14088,7 +14088,7 @@
|
|
|
14088
14088
|
"__schema": "FunctionLikeSchema",
|
|
14089
14089
|
"location": {
|
|
14090
14090
|
"filePath": "component-generator.ts",
|
|
14091
|
-
"line":
|
|
14091
|
+
"line": 54,
|
|
14092
14092
|
"character": 3
|
|
14093
14093
|
},
|
|
14094
14094
|
"signature": "(method) ComponentGenerator.generate(force?: boolean): Promise<GenerateResult[]>",
|
|
@@ -14098,7 +14098,7 @@
|
|
|
14098
14098
|
"__schema": "ParameterSchema",
|
|
14099
14099
|
"location": {
|
|
14100
14100
|
"filePath": "component-generator.ts",
|
|
14101
|
-
"line":
|
|
14101
|
+
"line": 54,
|
|
14102
14102
|
"character": 18
|
|
14103
14103
|
},
|
|
14104
14104
|
"name": "force",
|
|
@@ -14106,7 +14106,7 @@
|
|
|
14106
14106
|
"__schema": "InferenceTypeSchema",
|
|
14107
14107
|
"location": {
|
|
14108
14108
|
"filePath": "component-generator.ts",
|
|
14109
|
-
"line":
|
|
14109
|
+
"line": 54,
|
|
14110
14110
|
"character": 18
|
|
14111
14111
|
},
|
|
14112
14112
|
"type": "boolean"
|
|
@@ -14120,7 +14120,7 @@
|
|
|
14120
14120
|
"__schema": "TypeRefSchema",
|
|
14121
14121
|
"location": {
|
|
14122
14122
|
"filePath": "component-generator.ts",
|
|
14123
|
-
"line":
|
|
14123
|
+
"line": 54,
|
|
14124
14124
|
"character": 34
|
|
14125
14125
|
},
|
|
14126
14126
|
"name": "Promise",
|
|
@@ -14129,14 +14129,14 @@
|
|
|
14129
14129
|
"__schema": "TypeArraySchema",
|
|
14130
14130
|
"location": {
|
|
14131
14131
|
"filePath": "component-generator.ts",
|
|
14132
|
-
"line":
|
|
14132
|
+
"line": 54,
|
|
14133
14133
|
"character": 42
|
|
14134
14134
|
},
|
|
14135
14135
|
"type": {
|
|
14136
14136
|
"__schema": "TypeRefSchema",
|
|
14137
14137
|
"location": {
|
|
14138
14138
|
"filePath": "component-generator.ts",
|
|
14139
|
-
"line":
|
|
14139
|
+
"line": 54,
|
|
14140
14140
|
"character": 42
|
|
14141
14141
|
},
|
|
14142
14142
|
"name": "GenerateResult"
|
|
@@ -14159,7 +14159,7 @@
|
|
|
14159
14159
|
"componentId": {
|
|
14160
14160
|
"scope": "teambit.generator",
|
|
14161
14161
|
"name": "generator",
|
|
14162
|
-
"version": "1.0.
|
|
14162
|
+
"version": "1.0.457"
|
|
14163
14163
|
},
|
|
14164
14164
|
"taggedModuleExports": []
|
|
14165
14165
|
}
|
|
@@ -53,8 +53,4 @@ export declare class ComponentGenerator {
|
|
|
53
53
|
private deleteGeneratedComponents;
|
|
54
54
|
private generateOneComponent;
|
|
55
55
|
private addEnvIfProvidedByFlag;
|
|
56
|
-
/**
|
|
57
|
-
* writes the generated template files to the default directory set in the workspace config
|
|
58
|
-
*/
|
|
59
|
-
private writeComponentFiles;
|
|
60
56
|
}
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ComponentGenerator = void 0;
|
|
7
|
-
function _vinyl() {
|
|
8
|
-
const data = _interopRequireDefault(require("vinyl"));
|
|
9
|
-
_vinyl = function () {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _fsExtra() {
|
|
15
8
|
const data = _interopRequireDefault(require("fs-extra"));
|
|
16
9
|
_fsExtra = function () {
|
|
@@ -67,13 +60,6 @@ function _pkgModules() {
|
|
|
67
60
|
};
|
|
68
61
|
return data;
|
|
69
62
|
}
|
|
70
|
-
function _component() {
|
|
71
|
-
const data = require("@teambit/component.sources");
|
|
72
|
-
_component = function () {
|
|
73
|
-
return data;
|
|
74
|
-
};
|
|
75
|
-
return data;
|
|
76
|
-
}
|
|
77
63
|
function _componentId() {
|
|
78
64
|
const data = require("@teambit/component-id");
|
|
79
65
|
_componentId = function () {
|
|
@@ -191,7 +177,10 @@ class ComponentGenerator {
|
|
|
191
177
|
envId: this.envId
|
|
192
178
|
});
|
|
193
179
|
const mainFile = files.find(file => file.isMain);
|
|
194
|
-
await this.writeComponentFiles(componentPath, files
|
|
180
|
+
await this.newComponentHelper.writeComponentFiles(componentPath, files.map(f => ({
|
|
181
|
+
path: f.relativePath,
|
|
182
|
+
content: f.content
|
|
183
|
+
})));
|
|
195
184
|
const addResults = await this.tracker.track({
|
|
196
185
|
rootDir: componentPath,
|
|
197
186
|
mainFile: mainFile?.relativePath,
|
|
@@ -287,26 +276,6 @@ class ComponentGenerator {
|
|
|
287
276
|
await this.tracker.addEnvToConfig(userEnv, config);
|
|
288
277
|
return config;
|
|
289
278
|
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* writes the generated template files to the default directory set in the workspace config
|
|
293
|
-
*/
|
|
294
|
-
async writeComponentFiles(componentPath, templateFiles) {
|
|
295
|
-
const dataToPersist = new (_component().DataToPersist)();
|
|
296
|
-
const vinylFiles = templateFiles.map(templateFile => {
|
|
297
|
-
const templateFileVinyl = new (_vinyl().default)({
|
|
298
|
-
base: componentPath,
|
|
299
|
-
path: _path().default.join(componentPath, templateFile.relativePath),
|
|
300
|
-
contents: Buffer.from(templateFile.content)
|
|
301
|
-
});
|
|
302
|
-
return _component().AbstractVinyl.fromVinyl(templateFileVinyl);
|
|
303
|
-
});
|
|
304
|
-
const results = vinylFiles.map(v => v.path);
|
|
305
|
-
dataToPersist.addManyFiles(vinylFiles);
|
|
306
|
-
dataToPersist.addBasePath(this.workspace.path);
|
|
307
|
-
await dataToPersist.persistAllToFS();
|
|
308
|
-
return results;
|
|
309
|
-
}
|
|
310
279
|
}
|
|
311
280
|
exports.ComponentGenerator = ComponentGenerator;
|
|
312
281
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_vinyl","data","_interopRequireDefault","require","_fsExtra","_pMapSeries","_path","_envs","_camelcase","_bitError","_workspaceModules","_pkgModules","_component","_componentId","e","__esModule","default","ComponentGenerator","constructor","workspace","componentIds","options","template","envs","newComponentHelper","tracker","wsConfigFiles","logger","onComponentCreateSlot","aspectId","envId","installOptions","generate","force","dirsToDeleteIfFailed","generateResults","pMapSeries","componentId","componentPath","getNewComponentPath","pathFromUser","path","componentsToCreate","length","fs","existsSync","join","BitError","push","generateOneComponent","err","deleteGeneratedComponents","bitMap","write","ids","map","r","id","tryLinkToNodeModules","runOnComponentCreateHook","tryWriteConfigFiles","linkToNodeModulesByIds","consoleFailure","message","fns","values","Promise","all","fn","shouldWrite","isWorkspaceConfigWriteEnabled","clearComponentCache","writeConfigFiles","clean","silent","dedupe","throw","dirs","dir","absoluteDir","remove","code","name","namePascalCase","camelcase","pascalCase","nameCamelCase","ComponentID","fromString","files","generateFiles","mainFile","find","file","isMain","writeComponentFiles","addResults","track","rootDir","relativePath","componentName","fullName","defaultScope","scope","component","get","hasEnvConfiguredOriginally","hasEnvConfigured","envBeforeConfigChanges","getEnv","config","boundConfig","bind","userEnv","env","isInWorkspace","exists","toStringWithoutVersion","toString","templateEnv","EnvsAspect","Object","keys","undefined","configWithEnv","addEnvIfProvidedByFlag","setEntireConfig","getEnvData","envFromFlag","envFromTemplate","setBy","isSameAsThisEnvId","packageName","componentIdToPackageName","state","_consumer","envSetBy","isApp","isEnv","dependencies","installMissingDependencies","addEnvToConfig","templateFiles","dataToPersist","DataToPersist","vinylFiles","templateFile","templateFileVinyl","Vinyl","base","contents","Buffer","from","content","AbstractVinyl","fromVinyl","results","v","addManyFiles","addBasePath","persistAllToFS","exports"],"sources":["component-generator.ts"],"sourcesContent":["import Vinyl from 'vinyl';\nimport fs from 'fs-extra';\nimport pMapSeries from 'p-map-series';\nimport path from 'path';\nimport { Workspace } from '@teambit/workspace';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport camelcase from 'camelcase';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { TrackerMain } from '@teambit/tracker';\nimport { linkToNodeModulesByIds } from '@teambit/workspace.modules.node-modules-linker';\nimport { PathOsBasedRelative } from '@teambit/toolbox.path.path';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport { AbstractVinyl, DataToPersist } from '@teambit/component.sources';\nimport { NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { ComponentID } from '@teambit/component-id';\nimport { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\n\nimport { ComponentTemplate, ComponentFile, ComponentConfig } from './component-template';\nimport { CreateOptions } from './create.cmd';\nimport { OnComponentCreateSlot } from './generator.main.runtime';\n\nexport type GenerateResult = {\n id: ComponentID;\n dir: string;\n files: string[];\n envId: string;\n envSetBy: string;\n packageName: string;\n isApp?: boolean;\n isEnv?: boolean;\n dependencies?: string[];\n installMissingDependencies?: boolean;\n};\n\nexport type InstallOptions = { optimizeReportForNonTerminal?: boolean };\n\nexport type OnComponentCreateFn = (generateResults: GenerateResult[], installOptions?: InstallOptions) => Promise<void>;\n\nexport class ComponentGenerator {\n constructor(\n private workspace: Workspace,\n private componentIds: ComponentID[],\n private options: Partial<CreateOptions>,\n private template: ComponentTemplate,\n private envs: EnvsMain,\n private newComponentHelper: NewComponentHelperMain,\n private tracker: TrackerMain,\n private wsConfigFiles: WorkspaceConfigFilesMain,\n private logger: Logger,\n private onComponentCreateSlot: OnComponentCreateSlot,\n private aspectId: string,\n private envId?: ComponentID,\n private installOptions: InstallOptions = {}\n ) {}\n\n async generate(force = false): Promise<GenerateResult[]> {\n const dirsToDeleteIfFailed: string[] = [];\n const generateResults = await pMapSeries(this.componentIds, async (componentId) => {\n try {\n const componentPath = this.newComponentHelper.getNewComponentPath(componentId, {\n pathFromUser: this.options.path,\n componentsToCreate: this.componentIds.length,\n });\n if (!force && fs.existsSync(path.join(this.workspace.path, componentPath))) {\n throw new BitError(\n `unable to create a component at \"${componentPath}\", this path already exists, please use \"--path\" to create the component in a different path`\n );\n }\n dirsToDeleteIfFailed.push(componentPath);\n return await this.generateOneComponent(componentId, componentPath);\n } catch (err: any) {\n await this.deleteGeneratedComponents(dirsToDeleteIfFailed);\n throw err;\n }\n });\n\n await this.workspace.bitMap.write(`create (${this.componentIds.length} components)`);\n\n const ids = generateResults.map((r) => r.id);\n await this.tryLinkToNodeModules(ids);\n await this.runOnComponentCreateHook(generateResults);\n // We are running this after the runOnComponentCreateHook as it require\n // the env to be installed to work properly, and the hook might install\n // the env.\n await this.tryWriteConfigFiles(ids);\n\n return generateResults;\n }\n\n private async tryLinkToNodeModules(ids: ComponentID[]) {\n try {\n await linkToNodeModulesByIds(\n this.workspace,\n ids.map((id) => id)\n );\n } catch (err: any) {\n this.logger.consoleFailure(\n `failed linking the new components to node_modules, please run \"bit link\" manually. error: ${err.message}`\n );\n }\n }\n\n private async runOnComponentCreateHook(generateResults: GenerateResult[]) {\n const fns = this.onComponentCreateSlot.values();\n if (!fns.length) return;\n await Promise.all(fns.map((fn) => fn(generateResults, this.installOptions)));\n }\n\n /**\n * The function `tryWriteConfigFiles` attempts to write workspace config files, and if it fails, it logs an error\n * message.\n * @returns If the condition `!shouldWrite` is true, then nothing is being returned. Otherwise, if the `writeConfigFiles`\n * function is successfully executed, nothing is being returned. If an error occurs during the execution of\n * `writeConfigFiles`, an error message is being returned.\n */\n private async tryWriteConfigFiles(ids: ComponentID[]) {\n const shouldWrite = this.wsConfigFiles.isWorkspaceConfigWriteEnabled();\n if (!shouldWrite) return;\n ids.map((id) => this.workspace.clearComponentCache(id));\n const { err } = await this.wsConfigFiles.writeConfigFiles({\n clean: true,\n silent: true,\n dedupe: true,\n throw: false,\n });\n if (err) {\n this.logger.consoleFailure(\n `failed generating workspace config files, please run \"bit ws-config write\" manually. error: ${err.message}`\n );\n }\n }\n\n private async deleteGeneratedComponents(dirs: string[]) {\n await Promise.all(\n dirs.map(async (dir) => {\n const absoluteDir = path.join(this.workspace.path, dir);\n try {\n await fs.remove(absoluteDir);\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n // if not exist, it's fine\n throw err;\n }\n }\n })\n );\n }\n\n private async generateOneComponent(componentId: ComponentID, componentPath: string): Promise<GenerateResult> {\n const name = componentId.name;\n const namePascalCase = camelcase(name, { pascalCase: true });\n const nameCamelCase = camelcase(name);\n const aspectId = ComponentID.fromString(this.aspectId);\n\n const files = await this.template.generateFiles({\n name,\n namePascalCase,\n nameCamelCase,\n componentId,\n aspectId,\n envId: this.envId,\n });\n const mainFile = files.find((file) => file.isMain);\n await this.writeComponentFiles(componentPath, files);\n const addResults = await this.tracker.track({\n rootDir: componentPath,\n mainFile: mainFile?.relativePath,\n componentName: componentId.fullName,\n defaultScope: this.options.scope || componentId.scope,\n });\n const component = await this.workspace.get(componentId);\n const hasEnvConfiguredOriginally = this.envs.hasEnvConfigured(component);\n const envBeforeConfigChanges = this.envs.getEnv(component);\n let config = this.template.config;\n if (config && typeof config === 'function') {\n const boundConfig = this.template.config?.bind(this.template);\n config = boundConfig({ aspectId: this.aspectId });\n }\n\n const userEnv = this.options.env;\n\n if (!config && this.envId && !userEnv) {\n const isInWorkspace = this.workspace.exists(this.envId);\n config = {\n [isInWorkspace ? this.envId.toStringWithoutVersion() : this.envId.toString()]: {},\n 'teambit.envs/envs': {\n env: this.envId.toStringWithoutVersion(),\n },\n };\n }\n\n const templateEnv = config?.[EnvsAspect.id]?.env;\n\n if (config && templateEnv && hasEnvConfiguredOriginally) {\n // remove the env we got from the template.\n delete config[templateEnv];\n delete config[EnvsAspect.id].env;\n if (Object.keys(config[EnvsAspect.id]).length === 0) delete config[EnvsAspect.id];\n if (Object.keys(config).length === 0) config = undefined;\n }\n\n const configWithEnv = await this.addEnvIfProvidedByFlag(config);\n if (configWithEnv) this.workspace.bitMap.setEntireConfig(component.id, configWithEnv);\n\n const getEnvData = () => {\n const envFromFlag = this.options.env; // env entered by the user when running `bit create --env`\n const envFromTemplate = config?.[EnvsAspect.id]?.env;\n if (envFromFlag) {\n return {\n envId: envFromFlag,\n setBy: '--env flag',\n };\n }\n if (envFromTemplate) {\n return {\n envId: envFromTemplate,\n setBy: 'template',\n };\n }\n return {\n envId: envBeforeConfigChanges.id,\n setBy: hasEnvConfiguredOriginally ? 'workspace variants' : '<default>',\n };\n };\n // eslint-disable-next-line prefer-const\n let { envId, setBy } = getEnvData();\n if (envId) {\n const isInWorkspace = this.workspace.exists(envId);\n const isSameAsThisEnvId = envId === this.envId?.toString() || envId === this.envId?.toStringWithoutVersion();\n if (isSameAsThisEnvId && this.envId) {\n envId = isInWorkspace ? this.envId.toStringWithoutVersion() : this.envId.toString();\n }\n }\n return {\n id: componentId,\n dir: componentPath,\n files: addResults.files,\n packageName: componentIdToPackageName(component.state._consumer),\n envId,\n envSetBy: setBy,\n isApp: this.template.isApp,\n isEnv: this.template.isEnv,\n dependencies: this.template.dependencies,\n installMissingDependencies: this.template.installMissingDependencies,\n };\n }\n\n private async addEnvIfProvidedByFlag(config?: ComponentConfig): Promise<ComponentConfig | undefined> {\n const userEnv = this.options.env; // env entered by the user when running `bit create --env`\n const templateEnv = config?.[EnvsAspect.id]?.env;\n if (!userEnv || userEnv === templateEnv) {\n return config;\n }\n config = config || {};\n if (templateEnv) {\n // the component template has an env and the user wants a different env.\n delete config[templateEnv];\n }\n await this.tracker.addEnvToConfig(userEnv, config);\n\n return config;\n }\n\n /**\n * writes the generated template files to the default directory set in the workspace config\n */\n private async writeComponentFiles(\n componentPath: string,\n templateFiles: ComponentFile[]\n ): Promise<PathOsBasedRelative[]> {\n const dataToPersist = new DataToPersist();\n const vinylFiles = templateFiles.map((templateFile) => {\n const templateFileVinyl = new Vinyl({\n base: componentPath,\n path: path.join(componentPath, templateFile.relativePath),\n contents: Buffer.from(templateFile.content),\n });\n return AbstractVinyl.fromVinyl(templateFileVinyl);\n });\n const results = vinylFiles.map((v) => v.path);\n dataToPersist.addManyFiles(vinylFiles);\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\n return results;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,O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AG,KAAIC,0BAAa,EAAC,CAAC;IACzC,MAAMC,UAAU,GAAGH,aAAa,CAACvF,GAAG,CAAE2F,YAAY,IAAK;MACrD,MAAMC,iBAAiB,GAAG,KAAIC,gBAAK,EAAC;QAClCC,IAAI,EAAE/G,aAAa;QACnBG,IAAI,EAAEA,eAAI,CAACK,IAAI,CAACR,aAAa,EAAE4G,YAAY,CAAC/C,YAAY,CAAC;QACzDmD,QAAQ,EAAEC,MAAM,CAACC,IAAI,CAACN,YAAY,CAACO,OAAO;MAC5C,CAAC,CAAC;MACF,OAAOC,0BAAa,CAACC,SAAS,CAACR,iBAAiB,CAAC;IACnD,CAAC,CAAC;IACF,MAAMS,OAAO,GAAGX,UAAU,CAAC1F,GAAG,CAAEsG,CAAC,IAAKA,CAAC,CAACpH,IAAI,CAAC;IAC7CsG,aAAa,CAACe,YAAY,CAACb,UAAU,CAAC;IACtCF,aAAa,CAACgB,WAAW,CAAC,IAAI,CAAC5I,SAAS,CAACsB,IAAI,CAAC;IAC9C,MAAMsG,aAAa,CAACiB,cAAc,CAAC,CAAC;IACpC,OAAOJ,OAAO;EAChB;AACF;AAACK,OAAA,CAAAhJ,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_pMapSeries","_path","_envs","_camelcase","_bitError","_workspaceModules","_pkgModules","_componentId","e","__esModule","default","ComponentGenerator","constructor","workspace","componentIds","options","template","envs","newComponentHelper","tracker","wsConfigFiles","logger","onComponentCreateSlot","aspectId","envId","installOptions","generate","force","dirsToDeleteIfFailed","generateResults","pMapSeries","componentId","componentPath","getNewComponentPath","pathFromUser","path","componentsToCreate","length","fs","existsSync","join","BitError","push","generateOneComponent","err","deleteGeneratedComponents","bitMap","write","ids","map","r","id","tryLinkToNodeModules","runOnComponentCreateHook","tryWriteConfigFiles","linkToNodeModulesByIds","consoleFailure","message","fns","values","Promise","all","fn","shouldWrite","isWorkspaceConfigWriteEnabled","clearComponentCache","writeConfigFiles","clean","silent","dedupe","throw","dirs","dir","absoluteDir","remove","code","name","namePascalCase","camelcase","pascalCase","nameCamelCase","ComponentID","fromString","files","generateFiles","mainFile","find","file","isMain","writeComponentFiles","f","relativePath","content","addResults","track","rootDir","componentName","fullName","defaultScope","scope","component","get","hasEnvConfiguredOriginally","hasEnvConfigured","envBeforeConfigChanges","getEnv","config","boundConfig","bind","userEnv","env","isInWorkspace","exists","toStringWithoutVersion","toString","templateEnv","EnvsAspect","Object","keys","undefined","configWithEnv","addEnvIfProvidedByFlag","setEntireConfig","getEnvData","envFromFlag","envFromTemplate","setBy","isSameAsThisEnvId","packageName","componentIdToPackageName","state","_consumer","envSetBy","isApp","isEnv","dependencies","installMissingDependencies","addEnvToConfig","exports"],"sources":["component-generator.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport pMapSeries from 'p-map-series';\nimport path from 'path';\nimport { Workspace } from '@teambit/workspace';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport camelcase from 'camelcase';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { TrackerMain } from '@teambit/tracker';\nimport { linkToNodeModulesByIds } from '@teambit/workspace.modules.node-modules-linker';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport { NewComponentHelperMain } from '@teambit/new-component-helper';\nimport { ComponentID } from '@teambit/component-id';\nimport { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\n\nimport { ComponentTemplate, ComponentConfig } from './component-template';\nimport { CreateOptions } from './create.cmd';\nimport { OnComponentCreateSlot } from './generator.main.runtime';\n\nexport type GenerateResult = {\n id: ComponentID;\n dir: string;\n files: string[];\n envId: string;\n envSetBy: string;\n packageName: string;\n isApp?: boolean;\n isEnv?: boolean;\n dependencies?: string[];\n installMissingDependencies?: boolean;\n};\n\nexport type InstallOptions = { optimizeReportForNonTerminal?: boolean };\n\nexport type OnComponentCreateFn = (generateResults: GenerateResult[], installOptions?: InstallOptions) => Promise<void>;\n\nexport class ComponentGenerator {\n constructor(\n private workspace: Workspace,\n private componentIds: ComponentID[],\n private options: Partial<CreateOptions>,\n private template: ComponentTemplate,\n private envs: EnvsMain,\n private newComponentHelper: NewComponentHelperMain,\n private tracker: TrackerMain,\n private wsConfigFiles: WorkspaceConfigFilesMain,\n private logger: Logger,\n private onComponentCreateSlot: OnComponentCreateSlot,\n private aspectId: string,\n private envId?: ComponentID,\n private installOptions: InstallOptions = {}\n ) {}\n\n async generate(force = false): Promise<GenerateResult[]> {\n const dirsToDeleteIfFailed: string[] = [];\n const generateResults = await pMapSeries(this.componentIds, async (componentId) => {\n try {\n const componentPath = this.newComponentHelper.getNewComponentPath(componentId, {\n pathFromUser: this.options.path,\n componentsToCreate: this.componentIds.length,\n });\n if (!force && fs.existsSync(path.join(this.workspace.path, componentPath))) {\n throw new BitError(\n `unable to create a component at \"${componentPath}\", this path already exists, please use \"--path\" to create the component in a different path`\n );\n }\n dirsToDeleteIfFailed.push(componentPath);\n return await this.generateOneComponent(componentId, componentPath);\n } catch (err: any) {\n await this.deleteGeneratedComponents(dirsToDeleteIfFailed);\n throw err;\n }\n });\n\n await this.workspace.bitMap.write(`create (${this.componentIds.length} components)`);\n\n const ids = generateResults.map((r) => r.id);\n await this.tryLinkToNodeModules(ids);\n await this.runOnComponentCreateHook(generateResults);\n // We are running this after the runOnComponentCreateHook as it require\n // the env to be installed to work properly, and the hook might install\n // the env.\n await this.tryWriteConfigFiles(ids);\n\n return generateResults;\n }\n\n private async tryLinkToNodeModules(ids: ComponentID[]) {\n try {\n await linkToNodeModulesByIds(\n this.workspace,\n ids.map((id) => id)\n );\n } catch (err: any) {\n this.logger.consoleFailure(\n `failed linking the new components to node_modules, please run \"bit link\" manually. error: ${err.message}`\n );\n }\n }\n\n private async runOnComponentCreateHook(generateResults: GenerateResult[]) {\n const fns = this.onComponentCreateSlot.values();\n if (!fns.length) return;\n await Promise.all(fns.map((fn) => fn(generateResults, this.installOptions)));\n }\n\n /**\n * The function `tryWriteConfigFiles` attempts to write workspace config files, and if it fails, it logs an error\n * message.\n * @returns If the condition `!shouldWrite` is true, then nothing is being returned. Otherwise, if the `writeConfigFiles`\n * function is successfully executed, nothing is being returned. If an error occurs during the execution of\n * `writeConfigFiles`, an error message is being returned.\n */\n private async tryWriteConfigFiles(ids: ComponentID[]) {\n const shouldWrite = this.wsConfigFiles.isWorkspaceConfigWriteEnabled();\n if (!shouldWrite) return;\n ids.map((id) => this.workspace.clearComponentCache(id));\n const { err } = await this.wsConfigFiles.writeConfigFiles({\n clean: true,\n silent: true,\n dedupe: true,\n throw: false,\n });\n if (err) {\n this.logger.consoleFailure(\n `failed generating workspace config files, please run \"bit ws-config write\" manually. error: ${err.message}`\n );\n }\n }\n\n private async deleteGeneratedComponents(dirs: string[]) {\n await Promise.all(\n dirs.map(async (dir) => {\n const absoluteDir = path.join(this.workspace.path, dir);\n try {\n await fs.remove(absoluteDir);\n } catch (err: any) {\n if (err.code !== 'ENOENT') {\n // if not exist, it's fine\n throw err;\n }\n }\n })\n );\n }\n\n private async generateOneComponent(componentId: ComponentID, componentPath: string): Promise<GenerateResult> {\n const name = componentId.name;\n const namePascalCase = camelcase(name, { pascalCase: true });\n const nameCamelCase = camelcase(name);\n const aspectId = ComponentID.fromString(this.aspectId);\n\n const files = await this.template.generateFiles({\n name,\n namePascalCase,\n nameCamelCase,\n componentId,\n aspectId,\n envId: this.envId,\n });\n const mainFile = files.find((file) => file.isMain);\n await this.newComponentHelper.writeComponentFiles(\n componentPath,\n files.map((f) => ({ path: f.relativePath, content: f.content }))\n );\n const addResults = await this.tracker.track({\n rootDir: componentPath,\n mainFile: mainFile?.relativePath,\n componentName: componentId.fullName,\n defaultScope: this.options.scope || componentId.scope,\n });\n const component = await this.workspace.get(componentId);\n const hasEnvConfiguredOriginally = this.envs.hasEnvConfigured(component);\n const envBeforeConfigChanges = this.envs.getEnv(component);\n let config = this.template.config;\n if (config && typeof config === 'function') {\n const boundConfig = this.template.config?.bind(this.template);\n config = boundConfig({ aspectId: this.aspectId });\n }\n\n const userEnv = this.options.env;\n\n if (!config && this.envId && !userEnv) {\n const isInWorkspace = this.workspace.exists(this.envId);\n config = {\n [isInWorkspace ? this.envId.toStringWithoutVersion() : this.envId.toString()]: {},\n 'teambit.envs/envs': {\n env: this.envId.toStringWithoutVersion(),\n },\n };\n }\n\n const templateEnv = config?.[EnvsAspect.id]?.env;\n\n if (config && templateEnv && hasEnvConfiguredOriginally) {\n // remove the env we got from the template.\n delete config[templateEnv];\n delete config[EnvsAspect.id].env;\n if (Object.keys(config[EnvsAspect.id]).length === 0) delete config[EnvsAspect.id];\n if (Object.keys(config).length === 0) config = undefined;\n }\n\n const configWithEnv = await this.addEnvIfProvidedByFlag(config);\n if (configWithEnv) this.workspace.bitMap.setEntireConfig(component.id, configWithEnv);\n\n const getEnvData = () => {\n const envFromFlag = this.options.env; // env entered by the user when running `bit create --env`\n const envFromTemplate = config?.[EnvsAspect.id]?.env;\n if (envFromFlag) {\n return {\n envId: envFromFlag,\n setBy: '--env flag',\n };\n }\n if (envFromTemplate) {\n return {\n envId: envFromTemplate,\n setBy: 'template',\n };\n }\n return {\n envId: envBeforeConfigChanges.id,\n setBy: hasEnvConfiguredOriginally ? 'workspace variants' : '<default>',\n };\n };\n // eslint-disable-next-line prefer-const\n let { envId, setBy } = getEnvData();\n if (envId) {\n const isInWorkspace = this.workspace.exists(envId);\n const isSameAsThisEnvId = envId === this.envId?.toString() || envId === this.envId?.toStringWithoutVersion();\n if (isSameAsThisEnvId && this.envId) {\n envId = isInWorkspace ? this.envId.toStringWithoutVersion() : this.envId.toString();\n }\n }\n return {\n id: componentId,\n dir: componentPath,\n files: addResults.files,\n packageName: componentIdToPackageName(component.state._consumer),\n envId,\n envSetBy: setBy,\n isApp: this.template.isApp,\n isEnv: this.template.isEnv,\n dependencies: this.template.dependencies,\n installMissingDependencies: this.template.installMissingDependencies,\n };\n }\n\n private async addEnvIfProvidedByFlag(config?: ComponentConfig): Promise<ComponentConfig | undefined> {\n const userEnv = this.options.env; // env entered by the user when running `bit create --env`\n const templateEnv = config?.[EnvsAspect.id]?.env;\n if (!userEnv || userEnv === templateEnv) {\n return config;\n }\n config = config || {};\n if (templateEnv) {\n // the component template has an env and the user wants a different env.\n delete config[templateEnv];\n }\n await this.tracker.addEnvToConfig(userEnv, config);\n\n return config;\n }\n}\n"],"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,YAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAQ,kBAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,iBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,YAAA;EAA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AIA,OAAO,KAAKM,WAAW,EAAE;MACvC,OAAOT,MAAM;IACf;IACAA,MAAM,GAAGA,MAAM,IAAI,CAAC,CAAC;IACrB,IAAIS,WAAW,EAAE;MACf;MACA,OAAOT,MAAM,CAACS,WAAW,CAAC;IAC5B;IACA,MAAM,IAAI,CAAChG,OAAO,CAACsH,cAAc,CAAC5B,OAAO,EAAEH,MAAM,CAAC;IAElD,OAAOA,MAAM;EACf;AACF;AAACgC,OAAA,CAAA/H,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.generator_generator@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.generator_generator@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.generator_generator@1.0.457/dist/generator.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.generator_generator@1.0.457/dist/generator.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/generator",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.457",
|
|
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.457"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"camelcase": "6.2.0",
|
|
13
13
|
"fs-extra": "10.0.0",
|
|
14
14
|
"p-map-series": "2.1.0",
|
|
15
|
-
"vinyl": "2.2.1",
|
|
16
15
|
"chalk": "2.4.2",
|
|
17
16
|
"graphql-tag": "2.12.1",
|
|
18
17
|
"lodash": "4.17.21",
|
|
@@ -21,31 +20,29 @@
|
|
|
21
20
|
"@teambit/component-id": "1.2.2",
|
|
22
21
|
"@teambit/harmony": "0.4.6",
|
|
23
22
|
"@teambit/git.modules.git-ignore": "1.0.2",
|
|
24
|
-
"@teambit/
|
|
25
|
-
"@teambit/
|
|
26
|
-
"@teambit/
|
|
27
|
-
"@teambit/new-component-helper": "1.0.454",
|
|
23
|
+
"@teambit/envs": "1.0.456",
|
|
24
|
+
"@teambit/logger": "0.0.1126",
|
|
25
|
+
"@teambit/new-component-helper": "1.0.456",
|
|
28
26
|
"@teambit/pkg.modules.component-package-name": "0.0.5",
|
|
29
|
-
"@teambit/
|
|
30
|
-
"@teambit/
|
|
31
|
-
"@teambit/workspace-
|
|
32
|
-
"@teambit/workspace
|
|
33
|
-
"@teambit/
|
|
34
|
-
"@teambit/
|
|
35
|
-
"@teambit/
|
|
36
|
-
"@teambit/
|
|
37
|
-
"@teambit/
|
|
38
|
-
"@teambit/
|
|
39
|
-
"@teambit/
|
|
40
|
-
"@teambit/
|
|
41
|
-
"@teambit/
|
|
42
|
-
"@teambit/forking": "1.0.454",
|
|
27
|
+
"@teambit/tracker": "1.0.456",
|
|
28
|
+
"@teambit/workspace-config-files": "1.0.456",
|
|
29
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.218",
|
|
30
|
+
"@teambit/workspace": "1.0.456",
|
|
31
|
+
"@teambit/component": "1.0.456",
|
|
32
|
+
"@teambit/cli": "0.0.1033",
|
|
33
|
+
"@teambit/graphql": "1.0.456",
|
|
34
|
+
"@teambit/aspect-loader": "1.0.456",
|
|
35
|
+
"@teambit/bit": "1.8.107",
|
|
36
|
+
"@teambit/deprecation": "1.0.456",
|
|
37
|
+
"@teambit/git": "1.0.456",
|
|
38
|
+
"@teambit/compiler": "1.0.456",
|
|
39
|
+
"@teambit/forking": "1.0.456",
|
|
43
40
|
"@teambit/git.modules.git-executable": "0.0.1",
|
|
44
|
-
"@teambit/host-initializer": "0.0.
|
|
45
|
-
"@teambit/importer": "1.0.
|
|
46
|
-
"@teambit/install": "1.0.
|
|
47
|
-
"@teambit/ui": "1.0.
|
|
48
|
-
"@teambit/config": "0.0.
|
|
41
|
+
"@teambit/host-initializer": "0.0.169",
|
|
42
|
+
"@teambit/importer": "1.0.456",
|
|
43
|
+
"@teambit/install": "1.0.456",
|
|
44
|
+
"@teambit/ui": "1.0.456",
|
|
45
|
+
"@teambit/config": "0.0.1207"
|
|
49
46
|
},
|
|
50
47
|
"devDependencies": {
|
|
51
48
|
"@types/fs-extra": "9.0.7",
|