@teambit/generator 1.0.381 → 1.0.383
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/{preview-1723432857627.js → preview-1723605522122.js} +2 -2
- package/dist/workspace-generator.js +4 -2
- package/dist/workspace-generator.js.map +1 -1
- package/package.json +21 -21
@@ -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.383" 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={15826:(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.indexOf(n)>=0||{}.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.indexOf(a)>=0)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},32450:(e,t,n)=>{Object.defineProperty(t,"W",{enumerable:!0,get:function(){return a.default}});var a=o(n(15826));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={15826:(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.indexOf(n)>=0||{}.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.indexOf(a)>=0)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},32450:(e,t,n)=>{Object.defineProperty(t,"W",{enumerable:!0,get:function(){return a.default}});var a=o(n(15826));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}},20221:(e,t,n)=>{var a={id:"teambit.generator/generator@1.0.383",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(20221),l=(n(41594),n(5016));const m=TeambitMdxUiMdxScopeContext;var p=n(32450),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
@@ -13558,7 +13558,7 @@
|
|
13558
13558
|
"componentId": {
|
13559
13559
|
"scope": "teambit.generator",
|
13560
13560
|
"name": "generator",
|
13561
|
-
"version": "1.0.
|
13561
|
+
"version": "1.0.383"
|
13562
13562
|
},
|
13563
13563
|
"taggedModuleExports": []
|
13564
13564
|
}
|
@@ -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.383/dist/generator.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.generator_generator@1.0.383/dist/generator.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
@@ -173,10 +173,12 @@ class WorkspaceGenerator {
|
|
173
173
|
import: false,
|
174
174
|
copyPeerToRuntimeOnRoot: true,
|
175
175
|
copyPeerToRuntimeOnComponents: false,
|
176
|
-
updateExisting: false
|
176
|
+
updateExisting: false
|
177
|
+
// This is not needed anymore since PR:
|
178
|
+
// keep it here for a while to make sure it doesn't break anything
|
177
179
|
// skip pruning here to prevent cases which it caused an error about
|
178
180
|
// tsconfig not found because the env location was changed
|
179
|
-
skipPrune: true
|
181
|
+
// skipPrune: true,
|
180
182
|
});
|
181
183
|
|
182
184
|
// compile the components again now that we have the dependencies installed
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_bit","_execa","_pMapSeries","_ui","_logger","_workspace","_forking","_importer","_compiler","_gitModules","_path","_lodash","_git","_install","_hostInitializer","_workspaceConfigFiles","_generator","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WorkspaceGenerator","constructor","workspaceName","workspacePath","options","template","aspectComponent","generate","fs","ensureDir","process","chdir","initGit","HostInitializerMain","init","skipGit","writeWorkspaceFiles","reloadBitInWorkspaceDir","workspace","inInstallContext","setupGitBitmapMergeDriver","forkComponentsFromRemote","installBeforeCreateComponentsIfNeeded","createComponentsFromRemote","importComponentsFromRemote","clearCache","install","undefined","dedupe","import","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","updateExisting","skipPrune","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","configuredEnvs","getConfiguredEnvs","length","componentsToCreate","aspectsForComponentsToCreate","compact","componentToCreate","aspect","needInstall","some","includes","console","pMapSeries","generateComponentTemplate","componentName","templateName","env","path","scope","componentsToFork","importComponents","fork","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 { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { getGitExecutablePath, GitNotFound } from '@teambit/git.modules.git-executable';\nimport { join } from 'path';\nimport { compact, some } from 'lodash';\nimport { ComponentID } from '@teambit/component-id';\nimport { GitAspect, GitMain } from '@teambit/git';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport { HostInitializerMain } from '@teambit/host-initializer';\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 HostInitializerMain.init(\n this.workspacePath,\n this.options.skipGit,\n false,\n false,\n false,\n false,\n false,\n false,\n false,\n {}\n );\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.forkComponentsFromRemote();\n await this.installBeforeCreateComponentsIfNeeded();\n await this.createComponentsFromRemote();\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 // skip pruning here to prevent cases which it caused an error about\n // tsconfig not found because the env location was changed\n skipPrune: true,\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 installBeforeCreateComponentsIfNeeded() {\n if (this.options.empty || !this.template.create) return;\n const configuredEnvs = this.generator.getConfiguredEnvs();\n if (!configuredEnvs.length) return;\n const workspaceContext = this.getWorkspaceContext();\n const componentsToCreate = this.template.create(workspaceContext);\n const aspectsForComponentsToCreate = compact(\n componentsToCreate.map((componentToCreate) => componentToCreate.aspect)\n );\n const needInstall = some(aspectsForComponentsToCreate, (aspect) => {\n return configuredEnvs.includes(aspect);\n });\n if (needInstall) {\n this.logger?.console(\n `installing dependencies in workspace using to load components templates from the following envs: ${configuredEnvs.join(\n ', '\n )}`\n );\n await this.install.install(undefined, {\n dedupe: true,\n import: false,\n copyPeerToRuntimeOnRoot: true,\n copyPeerToRuntimeOnComponents: false,\n updateExisting: false,\n });\n }\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,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,IAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,GAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,WAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,UAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,SAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAAO,QAAA,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AiBA,CAACT,UAAU,GAAG,IAAI,EAAE;IACjD,IAAIA,UAAU,EAAE;MACd,MAAM,IAAI,CAACP,SAAS,CAACO,UAAU,CAAC,CAAC;IACnC;IACA,MAAMmG,QAAQ,GAAG,IAAI,CAACxE,OAAO,CAACC,GAAG,CAAewE,0BAAc,CAACtE,EAAE,CAAC;IAClE,MAAMqE,QAAQ,CAACE,kBAAkB,CAAC,CAAC;EACrC;AACF;AAACC,OAAA,CAAA/H,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_bit","_execa","_pMapSeries","_ui","_logger","_workspace","_forking","_importer","_compiler","_gitModules","_path","_lodash","_git","_install","_hostInitializer","_workspaceConfigFiles","_generator","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WorkspaceGenerator","constructor","workspaceName","workspacePath","options","template","aspectComponent","generate","fs","ensureDir","process","chdir","initGit","HostInitializerMain","init","skipGit","writeWorkspaceFiles","reloadBitInWorkspaceDir","workspace","inInstallContext","setupGitBitmapMergeDriver","forkComponentsFromRemote","installBeforeCreateComponentsIfNeeded","createComponentsFromRemote","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","configuredEnvs","getConfiguredEnvs","length","componentsToCreate","aspectsForComponentsToCreate","compact","componentToCreate","aspect","needInstall","some","includes","console","pMapSeries","generateComponentTemplate","componentName","templateName","env","path","scope","componentsToFork","importComponents","fork","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 { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { getGitExecutablePath, GitNotFound } from '@teambit/git.modules.git-executable';\nimport { join } from 'path';\nimport { compact, some } from 'lodash';\nimport { ComponentID } from '@teambit/component-id';\nimport { GitAspect, GitMain } from '@teambit/git';\nimport { InstallAspect, InstallMain } from '@teambit/install';\nimport { HostInitializerMain } from '@teambit/host-initializer';\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 HostInitializerMain.init(\n this.workspacePath,\n this.options.skipGit,\n false,\n false,\n false,\n false,\n false,\n false,\n false,\n {}\n );\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.forkComponentsFromRemote();\n await this.installBeforeCreateComponentsIfNeeded();\n await this.createComponentsFromRemote();\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 // This is not needed anymore since PR:\n // keep it here for a while to make sure it doesn't break anything\n // skip pruning here to prevent cases which it caused an error about\n // tsconfig not found because the env location was changed\n // skipPrune: true,\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 installBeforeCreateComponentsIfNeeded() {\n if (this.options.empty || !this.template.create) return;\n const configuredEnvs = this.generator.getConfiguredEnvs();\n if (!configuredEnvs.length) return;\n const workspaceContext = this.getWorkspaceContext();\n const componentsToCreate = this.template.create(workspaceContext);\n const aspectsForComponentsToCreate = compact(\n componentsToCreate.map((componentToCreate) => componentToCreate.aspect)\n );\n const needInstall = some(aspectsForComponentsToCreate, (aspect) => {\n return configuredEnvs.includes(aspect);\n });\n if (needInstall) {\n this.logger?.console(\n `installing dependencies in workspace using to load components templates from the following envs: ${configuredEnvs.join(\n ', '\n )}`\n );\n await this.install.install(undefined, {\n dedupe: true,\n import: false,\n copyPeerToRuntimeOnRoot: true,\n copyPeerToRuntimeOnComponents: false,\n updateExisting: false,\n });\n }\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;AAA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
|
2
2
|
"name": "@teambit/generator",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.383",
|
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.383"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"camelcase": "6.2.0",
|
@@ -22,29 +22,29 @@
|
|
22
22
|
"@teambit/harmony": "0.4.6",
|
23
23
|
"@teambit/git.modules.git-ignore": "1.0.2",
|
24
24
|
"@teambit/component.sources": "0.0.20",
|
25
|
-
"@teambit/envs": "1.0.
|
26
|
-
"@teambit/logger": "0.0.
|
27
|
-
"@teambit/new-component-helper": "1.0.
|
25
|
+
"@teambit/envs": "1.0.382",
|
26
|
+
"@teambit/logger": "0.0.1052",
|
27
|
+
"@teambit/new-component-helper": "1.0.382",
|
28
28
|
"@teambit/pkg.modules.component-package-name": "0.0.3",
|
29
29
|
"@teambit/toolbox.path.path": "0.0.2",
|
30
|
-
"@teambit/tracker": "1.0.
|
31
|
-
"@teambit/workspace-config-files": "1.0.
|
30
|
+
"@teambit/tracker": "1.0.382",
|
31
|
+
"@teambit/workspace-config-files": "1.0.382",
|
32
32
|
"@teambit/workspace.modules.node-modules-linker": "0.0.195",
|
33
|
-
"@teambit/workspace": "1.0.
|
34
|
-
"@teambit/component": "1.0.
|
35
|
-
"@teambit/cli": "0.0.
|
36
|
-
"@teambit/graphql": "1.0.
|
37
|
-
"@teambit/aspect-loader": "1.0.
|
38
|
-
"@teambit/bit": "1.8.
|
39
|
-
"@teambit/git": "1.0.
|
40
|
-
"@teambit/compiler": "1.0.
|
41
|
-
"@teambit/forking": "1.0.
|
33
|
+
"@teambit/workspace": "1.0.382",
|
34
|
+
"@teambit/component": "1.0.382",
|
35
|
+
"@teambit/cli": "0.0.959",
|
36
|
+
"@teambit/graphql": "1.0.382",
|
37
|
+
"@teambit/aspect-loader": "1.0.382",
|
38
|
+
"@teambit/bit": "1.8.33",
|
39
|
+
"@teambit/git": "1.0.382",
|
40
|
+
"@teambit/compiler": "1.0.382",
|
41
|
+
"@teambit/forking": "1.0.382",
|
42
42
|
"@teambit/git.modules.git-executable": "0.0.1",
|
43
|
-
"@teambit/host-initializer": "0.0.
|
44
|
-
"@teambit/importer": "1.0.
|
45
|
-
"@teambit/install": "1.0.
|
46
|
-
"@teambit/ui": "1.0.
|
47
|
-
"@teambit/config": "0.0.
|
43
|
+
"@teambit/host-initializer": "0.0.95",
|
44
|
+
"@teambit/importer": "1.0.382",
|
45
|
+
"@teambit/install": "1.0.382",
|
46
|
+
"@teambit/ui": "1.0.382",
|
47
|
+
"@teambit/config": "0.0.1133"
|
48
48
|
},
|
49
49
|
"devDependencies": {
|
50
50
|
"@types/fs-extra": "9.0.7",
|