@teambit/generator 0.0.1133 → 0.0.1134

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/new.cmd.js CHANGED
@@ -28,15 +28,15 @@ class NewCmd {
28
28
  (0, _defineProperty2().default)(this, "description", 'create a new workspace from a template');
29
29
  (0, _defineProperty2().default)(this, "arguments", [{
30
30
  name: 'template-name',
31
- description: "the name of the workspace template (run 'bit templates', outside of a workspace, to get a list of available templates)"
31
+ description: "the name of the workspace template (run 'bit templates' outside of a workspace to get a list of available workspace templates)"
32
32
  }, {
33
33
  name: 'workspace-name',
34
- description: 'the name for the new workspace and workspace directory'
34
+ description: 'the name for the new workspace and workspace directory that will be created'
35
35
  }]);
36
36
  (0, _defineProperty2().default)(this, "alias", '');
37
37
  (0, _defineProperty2().default)(this, "loader", true);
38
38
  (0, _defineProperty2().default)(this, "group", 'start');
39
- (0, _defineProperty2().default)(this, "options", [['a', 'aspect <aspect-id>', 'aspect-id of the template. mandatory for non-core aspects. helpful for core aspects in case of a name collision'], ['t', 'template <env-id>', 'env-id of the template. alias for --env.'], ['', 'env <env-id>', 'env-id of the template'], ['d', 'default-scope <scope-name>', `set defaultScope in the new workspace.jsonc`], ['', 'standalone', 'DEPRECATED. use --skip-git instead'], ['s', 'skip-git', 'skip generation of Git repository'], ['e', 'empty', 'empty workspace with no components (relevant for templates that add components by default)'], ['', 'load-from <path-to-template>', 'path to the workspace containing the template. helpful during a development of a workspace-template']]);
39
+ (0, _defineProperty2().default)(this, "options", [['a', 'aspect <aspect-id>', 'id of the aspect that registered the template, mandatory for non-core aspects. helpful for core aspects in case of a name collision'], ['t', 'template <env-id>', "env-id of the template's owner. Alias for --env."], ['', 'env <env-id>', 'env-id of the template. Alias -t'], ['d', 'default-scope <scope-name>', `set defaultScope in the new workspace's workspace.jsonc`], ['', 'standalone', 'DEPRECATED. use --skip-git instead'], ['s', 'skip-git', 'skip generation of Git repository in the new workspace'], ['e', 'empty', "skip template's default component creation (relevant for templates that add components by default)"], ['', 'load-from <path-to-template>', 'local path to the workspace containing the template. Helpful during a development of a workspace-template']]);
40
40
  }
41
41
  async report([templateName, workspaceName], options) {
42
42
  var _options$skipGit, _ref, _options$aspect;
@@ -53,7 +53,7 @@ Congrats! A new workspace has been created successfully at '${workspacePath}'`)}
53
53
  Inside the directory '${workspaceName}' you can run various commands including:
54
54
 
55
55
  ${_chalk().default.yellow('bit start')}
56
- Starts the workspace in development mode
56
+ Starts the local dev server
57
57
 
58
58
  ${_chalk().default.yellow('bit install')}
59
59
  Installs any missing dependencies
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","NewCmd","constructor","generator","_defineProperty2","default","name","description","report","templateName","workspaceName","options","_options$skipGit","_ref","_options$aspect","skipGit","standalone","aspect","env","template","workspacePath","appName","generateWorkspaceTemplate","chalk","white","green","yellow","bold","getBottomSection","exports","cdLine","parts","push","join"],"sources":["new.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { GeneratorMain } from './generator.main.runtime';\n\nexport type NewOptions = {\n aspect?: string;\n defaultScope?: string;\n skipGit?: boolean;\n loadFrom?: string;\n empty?: boolean;\n};\n\nexport class NewCmd implements Command {\n name = 'new <template-name> <workspace-name>';\n description = 'create a new workspace from a template';\n arguments = [\n {\n name: 'template-name',\n description:\n \"the name of the workspace template (run 'bit templates', outside of a workspace, to get a list of available templates)\",\n },\n { name: 'workspace-name', description: 'the name for the new workspace and workspace directory' },\n ];\n alias = '';\n loader = true;\n group = 'start';\n options = [\n [\n 'a',\n 'aspect <aspect-id>',\n 'aspect-id of the template. mandatory for non-core aspects. helpful for core aspects in case of a name collision',\n ],\n ['t', 'template <env-id>', 'env-id of the template. alias for --env.'],\n ['', 'env <env-id>', 'env-id of the template'],\n ['d', 'default-scope <scope-name>', `set defaultScope in the new workspace.jsonc`],\n ['', 'standalone', 'DEPRECATED. use --skip-git instead'],\n ['s', 'skip-git', 'skip generation of Git repository'],\n ['e', 'empty', 'empty workspace with no components (relevant for templates that add components by default)'],\n [\n '',\n 'load-from <path-to-template>',\n 'path to the workspace containing the template. helpful during a development of a workspace-template',\n ],\n ] as CommandOptions;\n\n constructor(private generator: GeneratorMain) {}\n\n async report(\n [templateName, workspaceName]: [string, string],\n options: NewOptions & {\n standalone: boolean;\n env?: string;\n template?: string;\n }\n ) {\n options.skipGit = options.skipGit ?? options.standalone;\n options.aspect = options.aspect ?? options.env ?? options.template;\n const { workspacePath, appName } = await this.generator.generateWorkspaceTemplate(\n workspaceName,\n templateName,\n options\n );\n return chalk.white(\n `${chalk.green(`\n\nCongrats! A new workspace has been created successfully at '${workspacePath}'`)}\n\nInside the directory '${workspaceName}' you can run various commands including:\n\n ${chalk.yellow('bit start')}\n Starts the workspace in development mode\n\n ${chalk.yellow('bit install')}\n Installs any missing dependencies\n\n ${chalk.yellow('bit status')}\n Shows the status of the components\n\n ${chalk.yellow('bit compile')}\n Compiles the components\n\n ${chalk.yellow('bit test')}\n Runs the tests on all your components\n\n ${chalk.yellow('bit templates')}\n Shows all available component templates\n\n ${chalk.yellow('bit help')}\n Shows all available commands\n\n\n${chalk.green.bold(\"Let's get started!\")}\n\n ${getBottomSection(workspaceName, appName)}\n `\n );\n }\n}\n\nfunction getBottomSection(workspaceName: string, appName: string | undefined) {\n const cdLine = chalk.yellow(`cd ${workspaceName}`);\n const parts = [cdLine];\n if (appName) {\n parts.push(chalk.yellow(` bit run ${appName}`));\n }\n parts.push(chalk.yellow(` bit start`));\n return parts.join('\\n');\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAWO,MAAMG,MAAM,CAAoB;EAiCrCC,WAAWA,CAASC,SAAwB,EAAE;IAAA,KAA1BA,S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AM,CAAE,iBAAgBL,OAAQ,EAAC,CAAC,CAAC;EACtD;EACAU,KAAK,CAACC,IAAI,CAACT,gBAAK,CAACG,MAAM,CAAE,iBAAgB,CAAC,CAAC;EAC3C,OAAOK,KAAK,CAACE,IAAI,CAAC,IAAI,CAAC;AACzB"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","NewCmd","constructor","generator","_defineProperty2","default","name","description","report","templateName","workspaceName","options","_options$skipGit","_ref","_options$aspect","skipGit","standalone","aspect","env","template","workspacePath","appName","generateWorkspaceTemplate","chalk","white","green","yellow","bold","getBottomSection","exports","cdLine","parts","push","join"],"sources":["new.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { GeneratorMain } from './generator.main.runtime';\n\nexport type NewOptions = {\n aspect?: string;\n defaultScope?: string;\n skipGit?: boolean;\n loadFrom?: string;\n empty?: boolean;\n};\n\nexport class NewCmd implements Command {\n name = 'new <template-name> <workspace-name>';\n description = 'create a new workspace from a template';\n arguments = [\n {\n name: 'template-name',\n description:\n \"the name of the workspace template (run 'bit templates' outside of a workspace to get a list of available workspace templates)\",\n },\n {\n name: 'workspace-name',\n description: 'the name for the new workspace and workspace directory that will be created',\n },\n ];\n alias = '';\n loader = true;\n group = 'start';\n options = [\n [\n 'a',\n 'aspect <aspect-id>',\n 'id of the aspect that registered the template, mandatory for non-core aspects. helpful for core aspects in case of a name collision',\n ],\n ['t', 'template <env-id>', \"env-id of the template's owner. Alias for --env.\"],\n ['', 'env <env-id>', 'env-id of the template. Alias -t'],\n ['d', 'default-scope <scope-name>', `set defaultScope in the new workspace's workspace.jsonc`],\n ['', 'standalone', 'DEPRECATED. use --skip-git instead'],\n ['s', 'skip-git', 'skip generation of Git repository in the new workspace'],\n [\n 'e',\n 'empty',\n \"skip template's default component creation (relevant for templates that add components by default)\",\n ],\n [\n '',\n 'load-from <path-to-template>',\n 'local path to the workspace containing the template. Helpful during a development of a workspace-template',\n ],\n ] as CommandOptions;\n\n constructor(private generator: GeneratorMain) {}\n\n async report(\n [templateName, workspaceName]: [string, string],\n options: NewOptions & {\n standalone: boolean;\n env?: string;\n template?: string;\n }\n ) {\n options.skipGit = options.skipGit ?? options.standalone;\n options.aspect = options.aspect ?? options.env ?? options.template;\n const { workspacePath, appName } = await this.generator.generateWorkspaceTemplate(\n workspaceName,\n templateName,\n options\n );\n return chalk.white(\n `${chalk.green(`\n\nCongrats! A new workspace has been created successfully at '${workspacePath}'`)}\n\nInside the directory '${workspaceName}' you can run various commands including:\n\n ${chalk.yellow('bit start')}\n Starts the local dev server\n\n ${chalk.yellow('bit install')}\n Installs any missing dependencies\n\n ${chalk.yellow('bit status')}\n Shows the status of the components\n\n ${chalk.yellow('bit compile')}\n Compiles the components\n\n ${chalk.yellow('bit test')}\n Runs the tests on all your components\n\n ${chalk.yellow('bit templates')}\n Shows all available component templates\n\n ${chalk.yellow('bit help')}\n Shows all available commands\n\n\n${chalk.green.bold(\"Let's get started!\")}\n\n ${getBottomSection(workspaceName, appName)}\n `\n );\n }\n}\n\nfunction getBottomSection(workspaceName: string, appName: string | undefined) {\n const cdLine = chalk.yellow(`cd ${workspaceName}`);\n const parts = [cdLine];\n if (appName) {\n parts.push(chalk.yellow(` bit run ${appName}`));\n }\n parts.push(chalk.yellow(` bit start`));\n return parts.join('\\n');\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAWO,MAAMG,MAAM,CAAoB;EAwCrCC,WAAWA,CAASC,SAAwB,EAAE;IAAA,KAA1BA,SAAwB,GAAxBA,SAAwB;IAAA,IAAAC,gBAAA,GAAAC,OAAA,gBAvCrC,sCAAsC;IAAA,IAAAD,gBAAA,GAAAC,OAAA,uBAC/B,wCAAwC;IAAA,IAAAD,gBAA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ACE,IAAI,CAAC,IAAI,CAAC;AACzB"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1133/dist/generator.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1133/dist/generator.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1134/dist/generator.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@0.0.1134/dist/generator.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -32,7 +32,7 @@ class TemplatesCmd {
32
32
  constructor(generator) {
33
33
  this.generator = generator;
34
34
  (0, _defineProperty2().default)(this, "name", 'templates');
35
- (0, _defineProperty2().default)(this, "description", 'list templates for "bit create" and "bit new"');
35
+ (0, _defineProperty2().default)(this, "description", 'list available templates for "bit create" and "bit new"');
36
36
  (0, _defineProperty2().default)(this, "extendedDescription", 'list components templates when inside bit-workspace (for bit-create), otherwise, list workspace templates (for bit-new)');
37
37
  (0, _defineProperty2().default)(this, "alias", '');
38
38
  (0, _defineProperty2().default)(this, "loader", true);
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","TemplatesCmd","constructor","generator","_defineProperty2","default","report","args","templatesOptions","results","listTemplates","showAll","filter","template","hidden","grouped","groupBy","titleStr","isRunningInsideWorkspace","title","chalk","green","templateOutput","desc","description","name","dim","output","Object","keys","map","aspectId","names","join","groupTitle","titlePrefix","blue","bold","exports"],"sources":["templates.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { groupBy } from 'lodash';\nimport { GeneratorMain, TemplateDescriptor } from './generator.main.runtime';\n\nexport type TemplatesOptions = {\n showAll?: boolean;\n aspect?: string;\n};\n\nexport class TemplatesCmd implements Command {\n name = 'templates';\n description = 'list templates for \"bit create\" and \"bit new\"';\n extendedDescription =\n 'list components templates when inside bit-workspace (for bit-create), otherwise, list workspace templates (for bit-new)';\n alias = '';\n loader = true;\n group = 'development';\n options = [\n ['s', 'show-all', 'show hidden templates'],\n ['a', 'aspect <aspect-id>', 'show templates provided by the aspect-id'],\n ] as CommandOptions;\n\n constructor(private generator: GeneratorMain) {}\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async report(args: [], templatesOptions: TemplatesOptions) {\n let results = await this.generator.listTemplates(templatesOptions);\n\n // Make sure that we don't list hidden templates\n if (!templatesOptions.showAll) {\n results = results.filter((template) => !template.hidden);\n }\n\n const grouped = groupBy(results, 'aspectId');\n const titleStr = this.generator.isRunningInsideWorkspace()\n ? `The following template(s) are available with the command bit create: \\nExample - bit create <template-name> <component-name>`\n : `The following template(s) are available with the command bit new: \\nExample - bit new <template-name> <workspace-name>`;\n const title = chalk.green(`\\n${titleStr}\\n`);\n const templateOutput = (template: TemplateDescriptor) => {\n const desc = template.description ? ` (${template.description})` : '';\n return ` ${template.name}${chalk.dim(desc)}`;\n };\n const output = Object.keys(grouped)\n .map((aspectId) => {\n const names = grouped[aspectId].map(templateOutput).join('\\n');\n const groupTitle = grouped[aspectId][0].titlePrefix\n ? `${grouped[aspectId][0].titlePrefix} (${aspectId})`\n : aspectId;\n return `${chalk.blue.bold(groupTitle)}\\n${names}\\n`;\n })\n .join('\\n');\n return title + output;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,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AA4B,IAAK;MACvD,MAAMU,IAAI,GAAGV,QAAQ,CAACW,WAAW,GAAI,KAAIX,QAAQ,CAACW,WAAY,GAAE,GAAG,EAAE;MACrE,OAAQ,OAAMX,QAAQ,CAACY,IAAK,GAAEL,gBAAK,CAACM,GAAG,CAACH,IAAI,CAAE,EAAC;IACjD,CAAC;IACD,MAAMI,MAAM,GAAGC,MAAM,CAACC,IAAI,CAACd,OAAO,CAAC,CAChCe,GAAG,CAAEC,QAAQ,IAAK;MACjB,MAAMC,KAAK,GAAGjB,OAAO,CAACgB,QAAQ,CAAC,CAACD,GAAG,CAACR,cAAc,CAAC,CAACW,IAAI,CAAC,IAAI,CAAC;MAC9D,MAAMC,UAAU,GAAGnB,OAAO,CAACgB,QAAQ,CAAC,CAAC,CAAC,CAAC,CAACI,WAAW,GAC9C,GAAEpB,OAAO,CAACgB,QAAQ,CAAC,CAAC,CAAC,CAAC,CAACI,WAAY,KAAIJ,QAAS,GAAE,GACnDA,QAAQ;MACZ,OAAQ,GAAEX,gBAAK,CAACgB,IAAI,CAACC,IAAI,CAACH,UAAU,CAAE,KAAIF,KAAM,IAAG;IACrD,CAAC,CAAC,CACDC,IAAI,CAAC,IAAI,CAAC;IACb,OAAOd,KAAK,GAAGQ,MAAM;EACvB;AACF;AAACW,OAAA,CAAArC,YAAA,GAAAA,YAAA"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","TemplatesCmd","constructor","generator","_defineProperty2","default","report","args","templatesOptions","results","listTemplates","showAll","filter","template","hidden","grouped","groupBy","titleStr","isRunningInsideWorkspace","title","chalk","green","templateOutput","desc","description","name","dim","output","Object","keys","map","aspectId","names","join","groupTitle","titlePrefix","blue","bold","exports"],"sources":["templates.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { groupBy } from 'lodash';\nimport { GeneratorMain, TemplateDescriptor } from './generator.main.runtime';\n\nexport type TemplatesOptions = {\n showAll?: boolean;\n aspect?: string;\n};\n\nexport class TemplatesCmd implements Command {\n name = 'templates';\n description = 'list available templates for \"bit create\" and \"bit new\"';\n extendedDescription =\n 'list components templates when inside bit-workspace (for bit-create), otherwise, list workspace templates (for bit-new)';\n alias = '';\n loader = true;\n group = 'development';\n options = [\n ['s', 'show-all', 'show hidden templates'],\n ['a', 'aspect <aspect-id>', 'show templates provided by the aspect-id'],\n ] as CommandOptions;\n\n constructor(private generator: GeneratorMain) {}\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async report(args: [], templatesOptions: TemplatesOptions) {\n let results = await this.generator.listTemplates(templatesOptions);\n\n // Make sure that we don't list hidden templates\n if (!templatesOptions.showAll) {\n results = results.filter((template) => !template.hidden);\n }\n\n const grouped = groupBy(results, 'aspectId');\n const titleStr = this.generator.isRunningInsideWorkspace()\n ? `The following template(s) are available with the command bit create: \\nExample - bit create <template-name> <component-name>`\n : `The following template(s) are available with the command bit new: \\nExample - bit new <template-name> <workspace-name>`;\n const title = chalk.green(`\\n${titleStr}\\n`);\n const templateOutput = (template: TemplateDescriptor) => {\n const desc = template.description ? ` (${template.description})` : '';\n return ` ${template.name}${chalk.dim(desc)}`;\n };\n const output = Object.keys(grouped)\n .map((aspectId) => {\n const names = grouped[aspectId].map(templateOutput).join('\\n');\n const groupTitle = grouped[aspectId][0].titlePrefix\n ? `${grouped[aspectId][0].titlePrefix} (${aspectId})`\n : aspectId;\n return `${chalk.blue.bold(groupTitle)}\\n${names}\\n`;\n })\n .join('\\n');\n return title + output;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAA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EAAE;MACrE,OAAQ,OAAMX,QAAQ,CAACY,IAAK,GAAEL,gBAAK,CAACM,GAAG,CAACH,IAAI,CAAE,EAAC;IACjD,CAAC;IACD,MAAMI,MAAM,GAAGC,MAAM,CAACC,IAAI,CAACd,OAAO,CAAC,CAChCe,GAAG,CAAEC,QAAQ,IAAK;MACjB,MAAMC,KAAK,GAAGjB,OAAO,CAACgB,QAAQ,CAAC,CAACD,GAAG,CAACR,cAAc,CAAC,CAACW,IAAI,CAAC,IAAI,CAAC;MAC9D,MAAMC,UAAU,GAAGnB,OAAO,CAACgB,QAAQ,CAAC,CAAC,CAAC,CAAC,CAACI,WAAW,GAC9C,GAAEpB,OAAO,CAACgB,QAAQ,CAAC,CAAC,CAAC,CAAC,CAACI,WAAY,KAAIJ,QAAS,GAAE,GACnDA,QAAQ;MACZ,OAAQ,GAAEX,gBAAK,CAACgB,IAAI,CAACC,IAAI,CAACH,UAAU,CAAE,KAAIF,KAAM,IAAG;IACrD,CAAC,CAAC,CACDC,IAAI,CAAC,IAAI,CAAC;IACb,OAAOd,KAAK,GAAGQ,MAAM;EACvB;AACF;AAACW,OAAA,CAAArC,YAAA,GAAAA,YAAA"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/generator",
3
- "version": "0.0.1133",
3
+ "version": "0.0.1134",
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": "0.0.1133"
9
+ "version": "0.0.1134"
10
10
  },
11
11
  "dependencies": {
12
12
  "camelcase": "6.2.0",
@@ -22,25 +22,25 @@
22
22
  "@teambit/component-id": "0.0.427",
23
23
  "@teambit/harmony": "0.4.6",
24
24
  "@teambit/bit-error": "0.0.402",
25
- "@teambit/envs": "0.0.1133",
26
- "@teambit/logger": "0.0.852",
27
- "@teambit/new-component-helper": "0.0.537",
28
- "@teambit/tracker": "0.0.164",
29
- "@teambit/workspace.modules.node-modules-linker": "0.0.101",
30
- "@teambit/workspace": "0.0.1133",
31
- "@teambit/cli": "0.0.759",
32
- "@teambit/graphql": "0.0.1133",
33
- "@teambit/aspect-loader": "0.0.1133",
34
- "@teambit/bit": "0.2.26",
35
- "@teambit/community": "0.0.307",
36
- "@teambit/component": "0.0.1133",
37
- "@teambit/git": "0.0.38",
38
- "@teambit/compiler": "0.0.1133",
39
- "@teambit/forking": "0.0.537",
40
- "@teambit/importer": "0.0.562",
41
- "@teambit/install": "0.0.217",
42
- "@teambit/ui": "0.0.1133",
43
- "@teambit/workspace-config-files": "0.0.113"
25
+ "@teambit/envs": "0.0.1134",
26
+ "@teambit/logger": "0.0.853",
27
+ "@teambit/new-component-helper": "0.0.538",
28
+ "@teambit/tracker": "0.0.165",
29
+ "@teambit/workspace.modules.node-modules-linker": "0.0.102",
30
+ "@teambit/workspace": "0.0.1134",
31
+ "@teambit/cli": "0.0.760",
32
+ "@teambit/graphql": "0.0.1134",
33
+ "@teambit/aspect-loader": "0.0.1134",
34
+ "@teambit/bit": "0.2.27",
35
+ "@teambit/community": "0.0.308",
36
+ "@teambit/component": "0.0.1134",
37
+ "@teambit/git": "0.0.39",
38
+ "@teambit/compiler": "0.0.1134",
39
+ "@teambit/forking": "0.0.538",
40
+ "@teambit/importer": "0.0.563",
41
+ "@teambit/install": "0.0.218",
42
+ "@teambit/ui": "0.0.1134",
43
+ "@teambit/workspace-config-files": "0.0.114"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/fs-extra": "9.0.7",
@@ -54,7 +54,7 @@
54
54
  "@teambit/generator.aspect-docs.generator": "0.0.160"
55
55
  },
56
56
  "peerDependencies": {
57
- "@teambit/legacy": "1.0.542",
57
+ "@teambit/legacy": "1.0.544",
58
58
  "react": "^16.8.0 || ^17.0.0",
59
59
  "react-dom": "^16.8.0 || ^17.0.0"
60
60
  },