@teambit/generator 1.0.668 → 1.0.669

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.
Files changed (82) hide show
  1. package/dist/component-generator.d.ts +9 -9
  2. package/dist/component-generator.js.map +1 -1
  3. package/dist/component-template.d.ts +1 -1
  4. package/dist/component-template.js.map +1 -1
  5. package/dist/create.cmd.d.ts +3 -3
  6. package/dist/create.cmd.js.map +1 -1
  7. package/dist/generator-env-type.d.ts +3 -3
  8. package/dist/generator-env-type.js.map +1 -1
  9. package/dist/generator.graphql.d.ts +3 -3
  10. package/dist/generator.graphql.js.map +1 -1
  11. package/dist/generator.main.runtime.d.ts +17 -17
  12. package/dist/generator.main.runtime.js.map +1 -1
  13. package/dist/generator.service.d.ts +3 -3
  14. package/dist/generator.service.js.map +1 -1
  15. package/dist/new.cmd.d.ts +3 -3
  16. package/dist/new.cmd.js.map +1 -1
  17. package/dist/{preview-1753809186996.js → preview-1753833698619.js} +2 -2
  18. package/dist/starter-list.d.ts +2 -2
  19. package/dist/starter-list.js.map +1 -1
  20. package/dist/starter.plugin.d.ts +2 -2
  21. package/dist/starter.plugin.js.map +1 -1
  22. package/dist/template-list.d.ts +2 -2
  23. package/dist/template-list.js.map +1 -1
  24. package/dist/templates/basic/basic.starter.d.ts +1 -1
  25. package/dist/templates/basic/basic.starter.js.map +1 -1
  26. package/dist/templates/basic/template/files/workspace-config.d.ts +1 -1
  27. package/dist/templates/basic/template/files/workspace-config.js.map +1 -1
  28. package/dist/templates/component-generator/files/component-template.d.ts +1 -1
  29. package/dist/templates/component-generator/files/component-template.js.map +1 -1
  30. package/dist/templates/component-generator/files/index.d.ts +1 -1
  31. package/dist/templates/component-generator/files/index.js.map +1 -1
  32. package/dist/templates/component-generator/index.d.ts +1 -1
  33. package/dist/templates/component-generator/index.js.map +1 -1
  34. package/dist/templates/component-generator-standalone/files/aspect-file.d.ts +1 -1
  35. package/dist/templates/component-generator-standalone/files/aspect-file.js.map +1 -1
  36. package/dist/templates/component-generator-standalone/files/index.d.ts +1 -1
  37. package/dist/templates/component-generator-standalone/files/index.js.map +1 -1
  38. package/dist/templates/component-generator-standalone/files/main-runtime.d.ts +1 -1
  39. package/dist/templates/component-generator-standalone/files/main-runtime.js.map +1 -1
  40. package/dist/templates/component-generator-standalone/index.d.ts +1 -1
  41. package/dist/templates/component-generator-standalone/index.js.map +1 -1
  42. package/dist/templates/starter/files/doc-file.d.ts +1 -1
  43. package/dist/templates/starter/files/doc-file.js.map +1 -1
  44. package/dist/templates/starter/files/index.d.ts +1 -1
  45. package/dist/templates/starter/files/index.js.map +1 -1
  46. package/dist/templates/starter/files/starter.d.ts +1 -1
  47. package/dist/templates/starter/files/starter.js.map +1 -1
  48. package/dist/templates/starter/index.d.ts +1 -1
  49. package/dist/templates/starter/index.js.map +1 -1
  50. package/dist/templates/starter-standalone/files/doc-file.d.ts +1 -1
  51. package/dist/templates/starter-standalone/files/doc-file.js.map +1 -1
  52. package/dist/templates/starter-standalone/files/index.d.ts +1 -1
  53. package/dist/templates/starter-standalone/files/index.js.map +1 -1
  54. package/dist/templates/starter-standalone/files/starter.d.ts +1 -1
  55. package/dist/templates/starter-standalone/files/starter.js.map +1 -1
  56. package/dist/templates/starter-standalone/index.d.ts +1 -1
  57. package/dist/templates/starter-standalone/index.js.map +1 -1
  58. package/dist/templates.cmd.d.ts +2 -2
  59. package/dist/templates.cmd.js.map +1 -1
  60. package/dist/workspace-generator.d.ts +5 -5
  61. package/dist/workspace-generator.js.map +1 -1
  62. package/dist/workspace-template.d.ts +1 -1
  63. package/dist/workspace-template.js.map +1 -1
  64. package/generator.service.tsx +3 -3
  65. package/package.json +26 -26
  66. package/templates/basic/basic.starter.ts +1 -1
  67. package/templates/basic/template/files/workspace-config.ts +1 -1
  68. package/templates/component-generator/files/component-template.ts +1 -1
  69. package/templates/component-generator/files/index.ts +1 -1
  70. package/templates/component-generator/index.ts +1 -1
  71. package/templates/component-generator-standalone/files/aspect-file.ts +1 -1
  72. package/templates/component-generator-standalone/files/index.ts +1 -1
  73. package/templates/component-generator-standalone/files/main-runtime.ts +1 -1
  74. package/templates/component-generator-standalone/index.ts +1 -1
  75. package/templates/starter/files/doc-file.ts +1 -1
  76. package/templates/starter/files/index.ts +1 -1
  77. package/templates/starter/files/starter.ts +1 -1
  78. package/templates/starter/index.ts +1 -1
  79. package/templates/starter-standalone/files/doc-file.ts +1 -1
  80. package/templates/starter-standalone/files/index.ts +1 -1
  81. package/templates/starter-standalone/files/starter.ts +1 -1
  82. package/templates/starter-standalone/index.ts +1 -1
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
  export declare function aspectFile({ namePascalCase, componentId }: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["aspectFile","namePascalCase","componentId"],"sources":["aspect-file.ts"],"sourcesContent":["import { ComponentContext } from '../../../component-template';\n\nexport function aspectFile({ namePascalCase, componentId }: ComponentContext) {\n return `import { Aspect } from '@teambit/harmony';\n\nexport const ${namePascalCase}Aspect = Aspect.create({\n id: '${componentId}',\n});\n `;\n}\n"],"mappings":";;;;;;AAEO,SAASA,UAAUA,CAAC;EAAEC,cAAc;EAAEC;AAA8B,CAAC,EAAE;EAC5E,OAAO;AACT;AACA,eAAeD,cAAc;AAC7B,SAASC,WAAW;AACpB;AACA,GAAG;AACH","ignoreList":[]}
1
+ {"version":3,"names":["aspectFile","namePascalCase","componentId"],"sources":["aspect-file.ts"],"sourcesContent":["import type { ComponentContext } from '../../../component-template';\n\nexport function aspectFile({ namePascalCase, componentId }: ComponentContext) {\n return `import { Aspect } from '@teambit/harmony';\n\nexport const ${namePascalCase}Aspect = Aspect.create({\n id: '${componentId}',\n});\n `;\n}\n"],"mappings":";;;;;;AAEO,SAASA,UAAUA,CAAC;EAAEC,cAAc;EAAEC;AAA8B,CAAC,EAAE;EAC5E,OAAO;AACT;AACA,eAAeD,cAAc;AAC7B,SAASC,WAAW;AACpB;AACA,GAAG;AACH","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
  export declare function indexFile({ namePascalCase, name }: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '../../../component-template';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `import { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport type { ${namePascalCase}Main } from './${name}.main.runtime';\nexport default ${namePascalCase}Aspect;\nexport { ${namePascalCase}Aspect };\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAO,YAAYD,cAAc,oBAAoBC,IAAI;AAC3D;AACA,gBAAgBD,cAAc,kBAAkBC,IAAI;AACpD,iBAAiBD,cAAc;AAC/B,WAAWA,cAAc;AACzB,CAAC;AACD","ignoreList":[]}
1
+ {"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index.ts"],"sourcesContent":["import type { ComponentContext } from '../../../component-template';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `import { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport type { ${namePascalCase}Main } from './${name}.main.runtime';\nexport default ${namePascalCase}Aspect;\nexport { ${namePascalCase}Aspect };\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAO,YAAYD,cAAc,oBAAoBC,IAAI;AAC3D;AACA,gBAAgBD,cAAc,kBAAkBC,IAAI;AACpD,iBAAiBD,cAAc;AAC/B,WAAWA,cAAc;AACzB,CAAC;AACD","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
  export declare function mainRuntime({ name, namePascalCase }: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["mainRuntime","name","namePascalCase"],"sources":["main-runtime.ts"],"sourcesContent":["import { ComponentContext } from '../../../component-template';\n\nexport function mainRuntime({ name, namePascalCase }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { GeneratorMain, GeneratorAspect, ComponentContext } from '@teambit/generator';\nimport { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport class ${namePascalCase}Main {\n static slots = [];\n static dependencies = [GeneratorAspect];\n static runtime = MainRuntime;\n static async provider([generator]: [GeneratorMain]) {\n /**\n * Array of templates. Add as many templates as you want\n * Separate the templates to multiple files if you prefer\n * Modify, add or remove files as needed\n * See the docs file of this component for more info\n */\n\n if (generator) generator.registerComponentTemplate([\n {\n name: 'component1',\n description: 'description for component1',\n generateFiles: (context: ComponentContext) => {\n return [\n\n // index file\n {\n relativePath: 'index.ts',\n isMain: true,\n content: \\`export { \\${context.namePascalCase} } from './\\${context.name}';\nexport type { \\${context.namePascalCase}Props } from './\\${context.name}';\n\\`,\n },\n\n // component file\n {\n relativePath: \\`\\${context.name}.tsx\\`,\n content: \\`import React from 'react';\n\nexport type \\${context.namePascalCase}Props = {\n /**\n * a text to be rendered in the component.\n */\n text: string\n};\n\nexport function \\${context.namePascalCase}({ text }: \\${context.namePascalCase}Props) {\n return (\n <div>\n {text}\n </div>\n );\n}\\`,\n },\n\n // docs file\n {\n relativePath: \\`\\${context.name}.docs.mdx\\`,\n content: \\`---\ndescription: 'A React Component for rendering text.'\nlabels: ['text', 'ui']\n---\n\nimport { \\${context.namePascalCase} } from './\\${context.name}';\n\\`\n },\n\n // composition file\n {\n relativePath: \\`\\${context.name}.composition.tsx\\`,\n content: \\`import React from 'react';\nimport { \\${context.namePascalCase} } from './\\${context.name}';\n\nexport const Basic\\${context.namePascalCase} = () => (\n <\\${context.namePascalCase} text=\"hello from \\${context.namePascalCase} \" />\n);\n\\`\n },\n\n // test file\n {\n relativePath: \\`\\${context.name}.spec.tsx\\`,\n content: \\`import React from 'react';\nimport { render } from '@testing-library/react';\nimport { Basic\\${context.namePascalCase} } from './\\${context.name}.composition';\n\nit('should render with the correct text', () => {\n const { getByText } = render(<Basic\\${context.namePascalCase} />);\n const rendered = getByText('hello from \\${context.namePascalCase}');\n expect(rendered).toBeTruthy();\n});\n\\`\n },\n // add more files here such as css/sass\n ];\n },\n },\n\n // component 2\n {\n name: 'component2',\n description: 'description for component2',\n generateFiles: (context: ComponentContext) => {\n return [\n\n // index file\n {\n relativePath: 'index.ts',\n isMain: true,\n content: \\`export {} from '';\n\\`,\n },\n ]\n }\n }\n ]);\n\n return new ${namePascalCase}Main();\n }\n}\n\n${namePascalCase}Aspect.addRuntime(${namePascalCase}Main);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,WAAWA,CAAC;EAAEC,IAAI;EAAEC;AAAiC,CAAC,EAAE;EACtE,OAAO;AACT;AACA,WAAWA,cAAc,oBAAoBD,IAAI;AACjD;AACA,eAAeC,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiBA,cAAc;AAC/B;AACA;AACA;AACA,EAAEA,cAAc,qBAAqBA,cAAc;AACnD,CAAC;AACD","ignoreList":[]}
1
+ {"version":3,"names":["mainRuntime","name","namePascalCase"],"sources":["main-runtime.ts"],"sourcesContent":["import type { ComponentContext } from '../../../component-template';\n\nexport function mainRuntime({ name, namePascalCase }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { GeneratorMain, GeneratorAspect, ComponentContext } from '@teambit/generator';\nimport { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport class ${namePascalCase}Main {\n static slots = [];\n static dependencies = [GeneratorAspect];\n static runtime = MainRuntime;\n static async provider([generator]: [GeneratorMain]) {\n /**\n * Array of templates. Add as many templates as you want\n * Separate the templates to multiple files if you prefer\n * Modify, add or remove files as needed\n * See the docs file of this component for more info\n */\n\n if (generator) generator.registerComponentTemplate([\n {\n name: 'component1',\n description: 'description for component1',\n generateFiles: (context: ComponentContext) => {\n return [\n\n // index file\n {\n relativePath: 'index.ts',\n isMain: true,\n content: \\`export { \\${context.namePascalCase} } from './\\${context.name}';\nexport type { \\${context.namePascalCase}Props } from './\\${context.name}';\n\\`,\n },\n\n // component file\n {\n relativePath: \\`\\${context.name}.tsx\\`,\n content: \\`import React from 'react';\n\nexport type \\${context.namePascalCase}Props = {\n /**\n * a text to be rendered in the component.\n */\n text: string\n};\n\nexport function \\${context.namePascalCase}({ text }: \\${context.namePascalCase}Props) {\n return (\n <div>\n {text}\n </div>\n );\n}\\`,\n },\n\n // docs file\n {\n relativePath: \\`\\${context.name}.docs.mdx\\`,\n content: \\`---\ndescription: 'A React Component for rendering text.'\nlabels: ['text', 'ui']\n---\n\nimport { \\${context.namePascalCase} } from './\\${context.name}';\n\\`\n },\n\n // composition file\n {\n relativePath: \\`\\${context.name}.composition.tsx\\`,\n content: \\`import React from 'react';\nimport { \\${context.namePascalCase} } from './\\${context.name}';\n\nexport const Basic\\${context.namePascalCase} = () => (\n <\\${context.namePascalCase} text=\"hello from \\${context.namePascalCase} \" />\n);\n\\`\n },\n\n // test file\n {\n relativePath: \\`\\${context.name}.spec.tsx\\`,\n content: \\`import React from 'react';\nimport { render } from '@testing-library/react';\nimport { Basic\\${context.namePascalCase} } from './\\${context.name}.composition';\n\nit('should render with the correct text', () => {\n const { getByText } = render(<Basic\\${context.namePascalCase} />);\n const rendered = getByText('hello from \\${context.namePascalCase}');\n expect(rendered).toBeTruthy();\n});\n\\`\n },\n // add more files here such as css/sass\n ];\n },\n },\n\n // component 2\n {\n name: 'component2',\n description: 'description for component2',\n generateFiles: (context: ComponentContext) => {\n return [\n\n // index file\n {\n relativePath: 'index.ts',\n isMain: true,\n content: \\`export {} from '';\n\\`,\n },\n ]\n }\n }\n ]);\n\n return new ${namePascalCase}Main();\n }\n}\n\n${namePascalCase}Aspect.addRuntime(${namePascalCase}Main);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,WAAWA,CAAC;EAAEC,IAAI;EAAEC;AAAiC,CAAC,EAAE;EACtE,OAAO;AACT;AACA,WAAWA,cAAc,oBAAoBD,IAAI;AACjD;AACA,eAAeC,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiBA,cAAc;AAC/B;AACA;AACA;AACA,EAAEA,cAAc,qBAAqBA,cAAc;AACnD,CAAC;AACD","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentTemplate } from '../../component-template';
1
+ import type { ComponentTemplate } from '../../component-template';
2
2
  export declare const componentGeneratorTemplate: ComponentTemplate;
@@ -1 +1 @@
1
- {"version":3,"names":["_index","data","require","_aspectFile","_docsFile","_mainRuntime","componentGeneratorTemplate","exports","name","description","hidden","generateFiles","context","relativePath","content","indexFile","isMain","aspectFile","docsFile","mainRuntime","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '../../component-template';\nimport { indexFile } from './files/index';\nimport { aspectFile } from './files/aspect-file';\nimport { docsFile } from './files/docs-file';\nimport { mainRuntime } from './files/main-runtime';\n\nexport const componentGeneratorTemplate: ComponentTemplate = {\n name: 'component-generator',\n description:\n 'create your own component generator \\nDocs: https://bit.dev/docs/dev-services/generator/generate-component',\n hidden: true,\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docsFile(),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntime(context),\n },\n ];\n },\n config: {\n 'teambit.harmony/aspect': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/aspect',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMK,0BAA6C,GAAAC,OAAA,CAAAD,0BAAA,GAAG;EAC3DE,IAAI,EAAE,qBAAqB;EAC3BC,WAAW,EACT,4GAA4G;EAC9GC,MAAM,EAAE,IAAI;EACZC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL;MACEC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAE,IAAAC,kBAAS,EAACH,OAAO,CAAC;MAC3BI,MAAM,EAAE;IACV,CAAC,EACD;MACEH,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,YAAY;MACzCM,OAAO,EAAE,IAAAG,wBAAU,EAACL,OAAO;IAC7B,CAAC,EACD;MACEC,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,WAAW;MACxCM,OAAO,EAAE,IAAAI,oBAAQ,EAAC;IACpB,CAAC,EACD;MACEL,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,kBAAkB;MAC/CM,OAAO,EAAE,IAAAK,0BAAW,EAACP,OAAO;IAC9B,CAAC,CACF;EACH,CAAC;EACDQ,MAAM,EAAE;IACN,wBAAwB,EAAE,CAAC,CAAC;IAC5B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_index","data","require","_aspectFile","_docsFile","_mainRuntime","componentGeneratorTemplate","exports","name","description","hidden","generateFiles","context","relativePath","content","indexFile","isMain","aspectFile","docsFile","mainRuntime","config","env"],"sources":["index.ts"],"sourcesContent":["import type { ComponentContext, ComponentTemplate } from '../../component-template';\nimport { indexFile } from './files/index';\nimport { aspectFile } from './files/aspect-file';\nimport { docsFile } from './files/docs-file';\nimport { mainRuntime } from './files/main-runtime';\n\nexport const componentGeneratorTemplate: ComponentTemplate = {\n name: 'component-generator',\n description:\n 'create your own component generator \\nDocs: https://bit.dev/docs/dev-services/generator/generate-component',\n hidden: true,\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docsFile(),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntime(context),\n },\n ];\n },\n config: {\n 'teambit.harmony/aspect': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/aspect',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMK,0BAA6C,GAAAC,OAAA,CAAAD,0BAAA,GAAG;EAC3DE,IAAI,EAAE,qBAAqB;EAC3BC,WAAW,EACT,4GAA4G;EAC9GC,MAAM,EAAE,IAAI;EACZC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL;MACEC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAE,IAAAC,kBAAS,EAACH,OAAO,CAAC;MAC3BI,MAAM,EAAE;IACV,CAAC,EACD;MACEH,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,YAAY;MACzCM,OAAO,EAAE,IAAAG,wBAAU,EAACL,OAAO;IAC7B,CAAC,EACD;MACEC,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,WAAW;MACxCM,OAAO,EAAE,IAAAI,oBAAQ,EAAC;IACpB,CAAC,EACD;MACEL,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,kBAAkB;MAC/CM,OAAO,EAAE,IAAAK,0BAAW,EAACP,OAAO;IAC9B,CAAC,CACF;EACH,CAAC;EACDQ,MAAM,EAAE;IACN,wBAAwB,EAAE,CAAC,CAAC;IAC5B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
  export declare function docFile(context: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["docFile","context","name","componentId","toString"],"sources":["doc-file.ts"],"sourcesContent":["import { ComponentContext } from '../../../component-template';\n\nexport function docFile(context: ComponentContext) {\n const { name, componentId } = context;\n return `---\ndescription: Starter for generating a ${name} workspace\nlabels: ['generator', 'templates', '${name}-workspace']\n---\n\n## Using the ${name} Workspace Starter\n\nHow to use this generator locally, essentially for development purposes:\n\n\\`\\`\\`js\nbit new ${name} my-${name}-workspace --load-from /Users/me/path/to/this/dir --aspect ${componentId.toString()}\n\\`\\`\\`\n\nHow to use this generator after exporting to a remote scope:\n\n\\`\\`\\`js\nbit new ${name} my-${name}-workspace --aspect ${componentId.toString()}\n\\`\\`\\`\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAOA,CAACC,OAAyB,EAAE;EACjD,MAAM;IAAEC,IAAI;IAAEC;EAAY,CAAC,GAAGF,OAAO;EACrC,OAAO;AACT,wCAAwCC,IAAI;AAC5C,sCAAsCA,IAAI;AAC1C;AACA;AACA,eAAeA,IAAI;AACnB;AACA;AACA;AACA;AACA,UAAUA,IAAI,OAAOA,IAAI,8DAA8DC,WAAW,CAACC,QAAQ,CAAC,CAAC;AAC7G;AACA;AACA;AACA;AACA;AACA,UAAUF,IAAI,OAAOA,IAAI,uBAAuBC,WAAW,CAACC,QAAQ,CAAC,CAAC;AACtE;AACA,CAAC;AACD","ignoreList":[]}
1
+ {"version":3,"names":["docFile","context","name","componentId","toString"],"sources":["doc-file.ts"],"sourcesContent":["import type { ComponentContext } from '../../../component-template';\n\nexport function docFile(context: ComponentContext) {\n const { name, componentId } = context;\n return `---\ndescription: Starter for generating a ${name} workspace\nlabels: ['generator', 'templates', '${name}-workspace']\n---\n\n## Using the ${name} Workspace Starter\n\nHow to use this generator locally, essentially for development purposes:\n\n\\`\\`\\`js\nbit new ${name} my-${name}-workspace --load-from /Users/me/path/to/this/dir --aspect ${componentId.toString()}\n\\`\\`\\`\n\nHow to use this generator after exporting to a remote scope:\n\n\\`\\`\\`js\nbit new ${name} my-${name}-workspace --aspect ${componentId.toString()}\n\\`\\`\\`\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAOA,CAACC,OAAyB,EAAE;EACjD,MAAM;IAAEC,IAAI;IAAEC;EAAY,CAAC,GAAGF,OAAO;EACrC,OAAO;AACT,wCAAwCC,IAAI;AAC5C,sCAAsCA,IAAI;AAC1C;AACA;AACA,eAAeA,IAAI;AACnB;AACA;AACA;AACA;AACA,UAAUA,IAAI,OAAOA,IAAI,8DAA8DC,WAAW,CAACC,QAAQ,CAAC,CAAC;AAC7G;AACA;AACA;AACA;AACA;AACA,UAAUF,IAAI,OAAOA,IAAI,uBAAuBC,WAAW,CAACC,QAAQ,CAAC,CAAC;AACtE;AACA,CAAC;AACD","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
  export declare function indexFile({ namePascalCase, name }: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '../../../component-template';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `export { ${namePascalCase}WorkspaceStarter } from './${name}.starter';\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAO,YAAYD,cAAc,8BAA8BC,IAAI;AACrE,CAAC;AACD","ignoreList":[]}
1
+ {"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index.ts"],"sourcesContent":["import type { ComponentContext } from '../../../component-template';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `export { ${namePascalCase}WorkspaceStarter } from './${name}.starter';\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAO,YAAYD,cAAc,8BAA8BC,IAAI;AACrE,CAAC;AACD","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
  export declare function starterFile({ namePascalCase, name }: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["starterFile","namePascalCase","name"],"sources":["starter.ts"],"sourcesContent":["import { ComponentContext } from '../../../component-template';\n\nexport function starterFile({ namePascalCase, name }: ComponentContext) {\n return `import { WorkspaceContext, WorkspaceTemplate } from '@teambit/generator';\n import { generateFiles as generateCommonFiles } from './template/files/generate-files';\n\n export type ${namePascalCase}StarterOptions = Pick<WorkspaceTemplate, 'name' | 'description' | 'hidden'>;\n\n export class ${namePascalCase}WorkspaceStarter implements WorkspaceTemplate {\n constructor(\n readonly name = '${name}-workspace',\n readonly description = '${namePascalCase} workspace with a custom react env',\n readonly hidden = false\n ) {}\n\n async generateFiles(context: WorkspaceContext) {\n return generateCommonFiles(context);\n }\n\n fork() {\n return [\n {\n id: 'teambit.react/react-env-extension',\n targetName: 'envs/my-react-env',\n },\n ];\n }\n\n static from(options: Partial<${namePascalCase}StarterOptions>) {\n return () =>\n new ${namePascalCase}WorkspaceStarter(\n options.name,\n options.description,\n options.hidden\n );\n }\n }\n\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,WAAWA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACtE,OAAO;AACT;AACA;AACA,gBAAgBD,cAAc;AAC9B;AACA,iBAAiBA,cAAc;AAC/B;AACA,yBAAyBC,IAAI;AAC7B,gCAAgCD,cAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmCA,cAAc;AACjD;AACA,cAAcA,cAAc;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD","ignoreList":[]}
1
+ {"version":3,"names":["starterFile","namePascalCase","name"],"sources":["starter.ts"],"sourcesContent":["import type { ComponentContext } from '../../../component-template';\n\nexport function starterFile({ namePascalCase, name }: ComponentContext) {\n return `import { WorkspaceContext, WorkspaceTemplate } from '@teambit/generator';\n import { generateFiles as generateCommonFiles } from './template/files/generate-files';\n\n export type ${namePascalCase}StarterOptions = Pick<WorkspaceTemplate, 'name' | 'description' | 'hidden'>;\n\n export class ${namePascalCase}WorkspaceStarter implements WorkspaceTemplate {\n constructor(\n readonly name = '${name}-workspace',\n readonly description = '${namePascalCase} workspace with a custom react env',\n readonly hidden = false\n ) {}\n\n async generateFiles(context: WorkspaceContext) {\n return generateCommonFiles(context);\n }\n\n fork() {\n return [\n {\n id: 'teambit.react/react-env-extension',\n targetName: 'envs/my-react-env',\n },\n ];\n }\n\n static from(options: Partial<${namePascalCase}StarterOptions>) {\n return () =>\n new ${namePascalCase}WorkspaceStarter(\n options.name,\n options.description,\n options.hidden\n );\n }\n }\n\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,WAAWA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACtE,OAAO;AACT;AACA;AACA,gBAAgBD,cAAc;AAC9B;AACA,iBAAiBA,cAAc;AAC/B;AACA,yBAAyBC,IAAI;AAC7B,gCAAgCD,cAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmCA,cAAc;AACjD;AACA,cAAcA,cAAc;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentTemplate } from '../../';
1
+ import type { ComponentTemplate } from '../../';
2
2
  export declare const starterTemplate: ComponentTemplate;
@@ -1 +1 @@
1
- {"version":3,"names":["_index","data","require","_starter","_docFile","_gitIgnoreTpl","_workspaceConfigTpl","_generateFiles","starterTemplate","exports","name","description","hidden","generateFiles","context","relativePath","content","indexFile","isMain","starterFile","docFile","gitIgnoreTemplate","workspaceConfigTemplate","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '../../';\nimport { indexFile } from './files/index';\nimport { starterFile } from './files/starter';\nimport { docFile } from './files/doc-file';\nimport { gitIgnoreTemplate } from './files/git-ignore-tpl';\nimport { workspaceConfigTemplate } from './files/workspace-config-tpl';\nimport { generateFiles } from './files/generate-files';\n\nexport const starterTemplate: ComponentTemplate = {\n name: 'starter',\n description:\n 'create your own workspace starter (env integrated) - \\nDocs: https://bit.dev/reference/starters/create-starter',\n hidden: true,\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.starter.ts`,\n content: starterFile(context),\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docFile(context),\n },\n {\n relativePath: 'template/files/git-ignore.ts',\n content: gitIgnoreTemplate(),\n },\n\n {\n relativePath: 'template/files/workspace-config.ts',\n content: workspaceConfigTemplate(),\n },\n {\n relativePath: 'template/files/generate-files.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a;MAC1CM,OAAO,EAAE,IAAAG,sBAAW,EAACL,OAAO;IAC9B,CAAC,EACD;MACEC,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,WAAW;MACxCM,OAAO,EAAE,IAAAI,kBAAO,EAACN,OAAO;IAC1B,CAAC,EACD;MACEC,YAAY,EAAE,8BAA8B;MAC5CC,OAAO,EAAE,IAAAK,iCAAiB,EAAC;IAC7B,CAAC,EAED;MACEN,YAAY,EAAE,oCAAoC;MAClDC,OAAO,EAAE,IAAAM,6CAAuB,EAAC;IACnC,CAAC,EACD;MACEP,YAAY,EAAE,kCAAkC;MAChDC,OAAO,EAAE,IAAAH,8BAAa,EAAC;IACzB,CAAC,CACF;EACH,CAAC;EACDU,MAAM,EAAE;IACN,wBAAwB,EAAE,CAAC,CAAC;IAC5B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_index","data","require","_starter","_docFile","_gitIgnoreTpl","_workspaceConfigTpl","_generateFiles","starterTemplate","exports","name","description","hidden","generateFiles","context","relativePath","content","indexFile","isMain","starterFile","docFile","gitIgnoreTemplate","workspaceConfigTemplate","config","env"],"sources":["index.ts"],"sourcesContent":["import type { ComponentContext, ComponentTemplate } from '../../';\nimport { indexFile } from './files/index';\nimport { starterFile } from './files/starter';\nimport { docFile } from './files/doc-file';\nimport { gitIgnoreTemplate } from './files/git-ignore-tpl';\nimport { workspaceConfigTemplate } from './files/workspace-config-tpl';\nimport { generateFiles } from './files/generate-files';\n\nexport const starterTemplate: ComponentTemplate = {\n name: 'starter',\n description:\n 'create your own workspace starter (env integrated) - \\nDocs: https://bit.dev/reference/starters/create-starter',\n hidden: true,\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.starter.ts`,\n content: starterFile(context),\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docFile(context),\n },\n {\n relativePath: 'template/files/git-ignore.ts',\n content: gitIgnoreTemplate(),\n },\n\n {\n relativePath: 'template/files/workspace-config.ts',\n content: workspaceConfigTemplate(),\n },\n {\n relativePath: 'template/files/generate-files.ts',\n content: generateFiles(),\n },\n ];\n },\n config: {\n 'teambit.harmony/aspect': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/node',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,cAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,oBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,mBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,eAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,cAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMO,eAAkC,GAAAC,OAAA,CAAAD,eAAA,GAAG;EAChDE,IAAI,EAAE,SAAS;EACfC,WAAW,EACT,gHAAgH;EAClHC,MAAM,EAAE,IAAI;EACZC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL;MACEC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAE,IAAAC,kBAAS,EAACH,OAAO,CAAC;MAC3BI,MAAM,EAAE;IACV,CAAC,EACD;MACEH,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,aAAa;MAC1CM,OAAO,EAAE,IAAAG,sBAAW,EAACL,OAAO;IAC9B,CAAC,EACD;MACEC,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,WAAW;MACxCM,OAAO,EAAE,IAAAI,kBAAO,EAACN,OAAO;IAC1B,CAAC,EACD;MACEC,YAAY,EAAE,8BAA8B;MAC5CC,OAAO,EAAE,IAAAK,iCAAiB,EAAC;IAC7B,CAAC,EAED;MACEN,YAAY,EAAE,oCAAoC;MAClDC,OAAO,EAAE,IAAAM,6CAAuB,EAAC;IACnC,CAAC,EACD;MACEP,YAAY,EAAE,kCAAkC;MAChDC,OAAO,EAAE,IAAAH,8BAAa,EAAC;IACzB,CAAC,CACF;EACH,CAAC;EACDU,MAAM,EAAE;IACN,wBAAwB,EAAE,CAAC,CAAC;IAC5B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
  export declare function docFile(context: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["docFile","context","name","componentId","toString"],"sources":["doc-file.ts"],"sourcesContent":["import { ComponentContext } from '../../../component-template';\n\nexport function docFile(context: ComponentContext) {\n const { name, componentId } = context;\n return `---\ndescription: Starter for generating a ${name} workspace\nlabels: ['generator', 'templates', '${name}-workspace']\n---\n\n## Using the ${name} Workspace Starter\n\nHow to use this generator locally, essentially for development purposes:\n\n\\`\\`\\`js\nbit new ${name} my-${name}-workspace --load-from /Users/me/path/to/this/dir --aspect ${componentId.toString()}\n\\`\\`\\`\n\nHow to use this generator after exporting to a remote scope:\n\n\\`\\`\\`js\nbit new ${name} my-${name}-workspace --aspect ${componentId.toString()}\n\\`\\`\\`\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAOA,CAACC,OAAyB,EAAE;EACjD,MAAM;IAAEC,IAAI;IAAEC;EAAY,CAAC,GAAGF,OAAO;EACrC,OAAO;AACT,wCAAwCC,IAAI;AAC5C,sCAAsCA,IAAI;AAC1C;AACA;AACA,eAAeA,IAAI;AACnB;AACA;AACA;AACA;AACA,UAAUA,IAAI,OAAOA,IAAI,8DAA8DC,WAAW,CAACC,QAAQ,CAAC,CAAC;AAC7G;AACA;AACA;AACA;AACA;AACA,UAAUF,IAAI,OAAOA,IAAI,uBAAuBC,WAAW,CAACC,QAAQ,CAAC,CAAC;AACtE;AACA,CAAC;AACD","ignoreList":[]}
1
+ {"version":3,"names":["docFile","context","name","componentId","toString"],"sources":["doc-file.ts"],"sourcesContent":["import type { ComponentContext } from '../../../component-template';\n\nexport function docFile(context: ComponentContext) {\n const { name, componentId } = context;\n return `---\ndescription: Starter for generating a ${name} workspace\nlabels: ['generator', 'templates', '${name}-workspace']\n---\n\n## Using the ${name} Workspace Starter\n\nHow to use this generator locally, essentially for development purposes:\n\n\\`\\`\\`js\nbit new ${name} my-${name}-workspace --load-from /Users/me/path/to/this/dir --aspect ${componentId.toString()}\n\\`\\`\\`\n\nHow to use this generator after exporting to a remote scope:\n\n\\`\\`\\`js\nbit new ${name} my-${name}-workspace --aspect ${componentId.toString()}\n\\`\\`\\`\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAOA,CAACC,OAAyB,EAAE;EACjD,MAAM;IAAEC,IAAI;IAAEC;EAAY,CAAC,GAAGF,OAAO;EACrC,OAAO;AACT,wCAAwCC,IAAI;AAC5C,sCAAsCA,IAAI;AAC1C;AACA;AACA,eAAeA,IAAI;AACnB;AACA;AACA;AACA;AACA,UAAUA,IAAI,OAAOA,IAAI,8DAA8DC,WAAW,CAACC,QAAQ,CAAC,CAAC;AAC7G;AACA;AACA;AACA;AACA;AACA,UAAUF,IAAI,OAAOA,IAAI,uBAAuBC,WAAW,CAACC,QAAQ,CAAC,CAAC;AACtE;AACA,CAAC;AACD","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
  export declare function indexFile({ namePascalCase, name }: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '../../../component-template';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `export { ${namePascalCase}WorkspaceStarter } from './${name}.starter';\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAO,YAAYD,cAAc,8BAA8BC,IAAI;AACrE,CAAC;AACD","ignoreList":[]}
1
+ {"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index.ts"],"sourcesContent":["import type { ComponentContext } from '../../../component-template';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `export { ${namePascalCase}WorkspaceStarter } from './${name}.starter';\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAO,YAAYD,cAAc,8BAA8BC,IAAI;AACrE,CAAC;AACD","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
  export declare function starterFile({ namePascalCase, name }: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["starterFile","namePascalCase","name"],"sources":["starter.ts"],"sourcesContent":["import { ComponentContext } from '../../../component-template';\n\nexport function starterFile({ namePascalCase, name }: ComponentContext) {\n return `import { WorkspaceContext, Starter } from '@teambit/generator';\n import { workspaceConfig } from './template/files/workspace-config';\n import { gitIgnore } from './template/files/git-ignore';\n\n export const ${namePascalCase}WorkspaceStarter: Starter = {\n name: '${name}-workspace',\n description: 'a ${name} workspace',\n generateFiles: async (context: WorkspaceContext) => {\n const files = [\n {\n relativePath: 'workspace.jsonc',\n content: await workspaceConfig(context),\n },\n ];\n\n if (!context.skipGit) {\n files.push({\n relativePath: '.gitignore',\n content: gitIgnore(),\n });\n }\n\n return files;\n },\n import: () => [\n { id: 'teambit.community/component-showcase' },\n ]\n };\n\n export default ${namePascalCase}WorkspaceStarter;\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,WAAWA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACtE,OAAO;AACT;AACA;AACA;AACA,iBAAiBD,cAAc;AAC/B,aAAaC,IAAI;AACjB,sBAAsBA,IAAI;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmBD,cAAc;AACjC,CAAC;AACD","ignoreList":[]}
1
+ {"version":3,"names":["starterFile","namePascalCase","name"],"sources":["starter.ts"],"sourcesContent":["import type { ComponentContext } from '../../../component-template';\n\nexport function starterFile({ namePascalCase, name }: ComponentContext) {\n return `import { WorkspaceContext, Starter } from '@teambit/generator';\n import { workspaceConfig } from './template/files/workspace-config';\n import { gitIgnore } from './template/files/git-ignore';\n\n export const ${namePascalCase}WorkspaceStarter: Starter = {\n name: '${name}-workspace',\n description: 'a ${name} workspace',\n generateFiles: async (context: WorkspaceContext) => {\n const files = [\n {\n relativePath: 'workspace.jsonc',\n content: await workspaceConfig(context),\n },\n ];\n\n if (!context.skipGit) {\n files.push({\n relativePath: '.gitignore',\n content: gitIgnore(),\n });\n }\n\n return files;\n },\n import: () => [\n { id: 'teambit.community/component-showcase' },\n ]\n };\n\n export default ${namePascalCase}WorkspaceStarter;\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,WAAWA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACtE,OAAO;AACT;AACA;AACA;AACA,iBAAiBD,cAAc;AAC/B,aAAaC,IAAI;AACjB,sBAAsBA,IAAI;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmBD,cAAc;AACjC,CAAC;AACD","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentTemplate } from '../../component-template';
1
+ import type { ComponentTemplate } from '../../component-template';
2
2
  export declare const starterTemplate: ComponentTemplate;
@@ -1 +1 @@
1
- {"version":3,"names":["_index","data","require","_starter","_docFile","_gitIgnoreTpl","_workspaceConfigTpl","starterTemplate","exports","name","hidden","description","generateFiles","context","relativePath","content","indexFile","isMain","starterFile","docFile","gitIgnoreTemplate","workspaceConfigTemplate","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '../../component-template';\nimport { indexFile } from './files/index';\nimport { starterFile } from './files/starter';\nimport { docFile } from './files/doc-file';\nimport { gitIgnoreTemplate } from './files/git-ignore-tpl';\nimport { workspaceConfigTemplate } from './files/workspace-config-tpl';\n\nexport const starterTemplate: ComponentTemplate = {\n name: 'standalone-starter',\n hidden: true,\n description:\n 'create your own workspace starter (standalone) - \\nDocs: https://bit.dev/reference/starters/create-starter',\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.starter.ts`,\n content: starterFile(context),\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docFile(context),\n },\n {\n relativePath: 'template/files/git-ignore.ts',\n content: gitIgnoreTemplate(),\n },\n\n {\n relativePath: 'template/files/workspace-config.ts',\n content: workspaceConfigTemplate(),\n },\n ];\n },\n config: {\n 'teambit.harmony/aspect': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/aspect',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;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MAClDC,OAAO,EAAE,IAAAM,6CAAuB,EAAC;IACnC,CAAC,CACF;EACH,CAAC;EACDC,MAAM,EAAE;IACN,wBAAwB,EAAE,CAAC,CAAC;IAC5B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_index","data","require","_starter","_docFile","_gitIgnoreTpl","_workspaceConfigTpl","starterTemplate","exports","name","hidden","description","generateFiles","context","relativePath","content","indexFile","isMain","starterFile","docFile","gitIgnoreTemplate","workspaceConfigTemplate","config","env"],"sources":["index.ts"],"sourcesContent":["import type { ComponentContext, ComponentTemplate } from '../../component-template';\nimport { indexFile } from './files/index';\nimport { starterFile } from './files/starter';\nimport { docFile } from './files/doc-file';\nimport { gitIgnoreTemplate } from './files/git-ignore-tpl';\nimport { workspaceConfigTemplate } from './files/workspace-config-tpl';\n\nexport const starterTemplate: ComponentTemplate = {\n name: 'standalone-starter',\n hidden: true,\n description:\n 'create your own workspace starter (standalone) - \\nDocs: https://bit.dev/reference/starters/create-starter',\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.starter.ts`,\n content: starterFile(context),\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docFile(context),\n },\n {\n relativePath: 'template/files/git-ignore.ts',\n content: gitIgnoreTemplate(),\n },\n\n {\n relativePath: 'template/files/workspace-config.ts',\n content: workspaceConfigTemplate(),\n },\n ];\n },\n config: {\n 'teambit.harmony/aspect': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/aspect',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,Y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nBC,GAAG,EAAE;IACP;EACF;AACF,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { Command, CommandOptions } from '@teambit/cli';
2
- import { GeneratorMain, TemplateDescriptor } from './generator.main.runtime';
1
+ import type { Command, CommandOptions } from '@teambit/cli';
2
+ import type { GeneratorMain, TemplateDescriptor } from './generator.main.runtime';
3
3
  export type TemplatesOptions = {
4
4
  showAll?: boolean;
5
5
  aspect?: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","TemplatesCmd","constructor","generator","report","args","templatesOptions","results","listTemplates","showAll","filter","template","hidden","grouped","groupBy","titleStr","isRunningInsideWorkspace","title","chalk","green","templateOutput","desc","description","name","dim","output","keys","map","aspectId","names","join","groupTitle","titlePrefix","blue","bold","learnMore","json","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 json?: boolean;\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 = 'component-development';\n options = [\n ['s', 'show-all', 'show hidden templates'],\n ['a', 'aspect <aspect-id>', 'show templates provided by the aspect-id'],\n ['j', 'json', 'return templates in json format'],\n ] as CommandOptions;\n\n constructor(private generator: GeneratorMain) {}\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async report(args: [], templatesOptions: TemplatesOptions) {\n let results = await this.generator.listTemplates(templatesOptions);\n\n // Make sure that we don't list hidden templates\n if (!templatesOptions.showAll) {\n results = results.filter((template) => !template.hidden);\n }\n\n const grouped = groupBy(results, 'aspectId');\n const titleStr = this.generator.isRunningInsideWorkspace()\n ? `The following template(s) are available with the command bit create: \\nExample - bit create <template-name> <component-name>`\n : `The following template(s) are available with the command bit new: \\nExample - bit new <template-name> <workspace-name>`;\n const title = chalk.green(`\\n${titleStr}\\n`);\n const templateOutput = (template: TemplateDescriptor) => {\n const desc = template.description ? ` (${template.description})` : '';\n return ` ${template.name}${chalk.dim(desc)}`;\n };\n const output = Object.keys(grouped)\n .map((aspectId) => {\n const names = grouped[aspectId].map(templateOutput).join('\\n');\n const groupTitle = grouped[aspectId][0].titlePrefix\n ? `${grouped[aspectId][0].titlePrefix} (${aspectId})`\n : aspectId;\n return `${chalk.blue.bold(groupTitle)}\\n${names}\\n`;\n })\n .join('\\n');\n\n const learnMore = `\\nfind and add templates in https://bit.dev/reference/generator/use-component-generator`;\n return title + output + learnMore;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async json(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 return results;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiC,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAA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OlB,KAAK,GAAGQ,MAAM,GAAGU,SAAS;EACnC;;EAEA;EACA,MAAMC,IAAIA,CAAC/B,IAAQ,EAAEC,gBAAkC,EAAE;IACvD,IAAIC,OAAO,GAAG,MAAM,IAAI,CAACJ,SAAS,CAACK,aAAa,CAACF,gBAAgB,CAAC;;IAElE;IACA,IAAI,CAACA,gBAAgB,CAACG,OAAO,EAAE;MAC7BF,OAAO,GAAGA,OAAO,CAACG,MAAM,CAAEC,QAAQ,IAAK,CAACA,QAAQ,CAACC,MAAM,CAAC;IAC1D;IAEA,OAAOL,OAAO;EAChB;AACF;AAAC8B,OAAA,CAAApC,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","TemplatesCmd","constructor","generator","report","args","templatesOptions","results","listTemplates","showAll","filter","template","hidden","grouped","groupBy","titleStr","isRunningInsideWorkspace","title","chalk","green","templateOutput","desc","description","name","dim","output","keys","map","aspectId","names","join","groupTitle","titlePrefix","blue","bold","learnMore","json","exports"],"sources":["templates.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { groupBy } from 'lodash';\nimport type { GeneratorMain, TemplateDescriptor } from './generator.main.runtime';\n\nexport type TemplatesOptions = {\n showAll?: boolean;\n aspect?: string;\n json?: boolean;\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 = 'component-development';\n options = [\n ['s', 'show-all', 'show hidden templates'],\n ['a', 'aspect <aspect-id>', 'show templates provided by the aspect-id'],\n ['j', 'json', 'return templates in json format'],\n ] as CommandOptions;\n\n constructor(private generator: GeneratorMain) {}\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async report(args: [], templatesOptions: TemplatesOptions) {\n let results = await this.generator.listTemplates(templatesOptions);\n\n // Make sure that we don't list hidden templates\n if (!templatesOptions.showAll) {\n results = results.filter((template) => !template.hidden);\n }\n\n const grouped = groupBy(results, 'aspectId');\n const titleStr = this.generator.isRunningInsideWorkspace()\n ? `The following template(s) are available with the command bit create: \\nExample - bit create <template-name> <component-name>`\n : `The following template(s) are available with the command bit new: \\nExample - bit new <template-name> <workspace-name>`;\n const title = chalk.green(`\\n${titleStr}\\n`);\n const templateOutput = (template: TemplateDescriptor) => {\n const desc = template.description ? ` (${template.description})` : '';\n return ` ${template.name}${chalk.dim(desc)}`;\n };\n const output = Object.keys(grouped)\n .map((aspectId) => {\n const names = grouped[aspectId].map(templateOutput).join('\\n');\n const groupTitle = grouped[aspectId][0].titlePrefix\n ? `${grouped[aspectId][0].titlePrefix} (${aspectId})`\n : aspectId;\n return `${chalk.blue.bold(groupTitle)}\\n${names}\\n`;\n })\n .join('\\n');\n\n const learnMore = `\\nfind and add templates in https://bit.dev/reference/generator/use-component-generator`;\n return title + output + learnMore;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async json(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 return results;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiC,SAAAC,uBAAAG,CAAA,WAAAA,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,IAAI,CAACH,UAAU,CAAC,KAAKF,KAAK,IAAI;IACrD,CAAC,CAAC,CACDC,IAAI,CAAC,IAAI,CAAC;IAEb,MAAMK,SAAS,GAAG,yFAAyF;IAC3G,OAAOlB,KAAK,GAAGQ,MAAM,GAAGU,SAAS;EACnC;;EAEA;EACA,MAAMC,IAAIA,CAAC/B,IAAQ,EAAEC,gBAAkC,EAAE;IACvD,IAAIC,OAAO,GAAG,MAAM,IAAI,CAACJ,SAAS,CAACK,aAAa,CAACF,gBAAgB,CAAC;;IAElE;IACA,IAAI,CAACA,gBAAgB,CAACG,OAAO,EAAE;MAC7BF,OAAO,GAAGA,OAAO,CAACG,MAAM,CAAEC,QAAQ,IAAK,CAACA,QAAQ,CAACC,MAAM,CAAC;IAC1D;IAEA,OAAOL,OAAO;EAChB;AACF;AAAC8B,OAAA,CAAApC,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { Component } from '@teambit/component';
2
- import { ComponentID } from '@teambit/component-id';
3
- import { WorkspaceTemplate } from './workspace-template';
4
- import { NewOptions } from './new.cmd';
5
- import { BitApi } from './generator.main.runtime';
1
+ import type { Component } from '@teambit/component';
2
+ import type { ComponentID } from '@teambit/component-id';
3
+ import type { WorkspaceTemplate } from './workspace-template';
4
+ import type { NewOptions } from './new.cmd';
5
+ import type { BitApi } from './generator.main.runtime';
6
6
  export type GenerateResult = {
7
7
  id: ComponentID;
8
8
  dir: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_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","bitApi","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","compile","componentsToImport","componentToImport","ids","installNpmPackages","writeToPath","bitMap","write","compiler","CompilerAspect","compileOnWorkspace","exports"],"sources":["workspace-generator.ts"],"sourcesContent":["import fs from 'fs-extra';\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 { BitApi, 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 bitApi: BitApi,\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 this.bitApi.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 compile: 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;AAGA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,IAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,GAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,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AE,KAAK;QACvBsF,WAAW,EAAEH,iBAAiB,CAACf;MACjC,CAAC,EACD,EACF,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,IAAI,CAACrF,SAAS,CAACwG,MAAM,CAACC,KAAK,CAAC,KAAK,CAAC;EAC1C;EAEA,MAAc1F,iBAAiBA,CAACR,UAAU,GAAG,IAAI,EAAE;IACjD,IAAIA,UAAU,EAAE;MACd,MAAM,IAAI,CAACP,SAAS,CAACO,UAAU,CAAC,CAAC;IACnC;IACA,MAAMmG,QAAQ,GAAG,IAAI,CAACzE,OAAO,CAACC,GAAG,CAAeyE,0BAAc,CAACvE,EAAE,CAAC;IAClE,MAAMsE,QAAQ,CAACE,kBAAkB,CAAC,CAAC;EACrC;AACF;AAACC,OAAA,CAAAhI,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_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","bitApi","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","compile","componentsToImport","componentToImport","ids","installNpmPackages","writeToPath","bitMap","write","compiler","CompilerAspect","compileOnWorkspace","exports"],"sources":["workspace-generator.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport type { Harmony } from '@teambit/harmony';\nimport type { Component } from '@teambit/component';\nimport execa from 'execa';\nimport pMapSeries from 'p-map-series';\nimport type { UiMain } from '@teambit/ui';\nimport { UIAspect } from '@teambit/ui';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { ForkingMain } from '@teambit/forking';\nimport { ForkingAspect } from '@teambit/forking';\nimport type { ImporterMain } from '@teambit/importer';\nimport { ImporterAspect } from '@teambit/importer';\nimport type { CompilerMain } from '@teambit/compiler';\nimport { CompilerAspect } from '@teambit/compiler';\nimport { getGitExecutablePath, GitNotFound } from '@teambit/git.modules.git-executable';\nimport { join } from 'path';\nimport { compact, some } from 'lodash';\nimport type { ComponentID } from '@teambit/component-id';\nimport type { GitMain } from '@teambit/git';\nimport { GitAspect } from '@teambit/git';\nimport type { InstallMain } from '@teambit/install';\nimport { InstallAspect } from '@teambit/install';\nimport { HostInitializerMain } from '@teambit/host-initializer';\nimport type { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\nimport { WorkspaceConfigFilesAspect } from '@teambit/workspace-config-files';\n// import { ComponentGenerator } from './component-generator';\nimport type { WorkspaceTemplate, WorkspaceContext } from './workspace-template';\nimport type { NewOptions } from './new.cmd';\nimport { GeneratorAspect } from './generator.aspect';\nimport type { BitApi, 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 bitApi: BitApi,\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 this.bitApi.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 compile: 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;AAGA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,IAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,GAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAS,UAAA;EAAA,MAAAT,I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UAAU,GAAG,IAAI,EAAE;IACjD,IAAIA,UAAU,EAAE;MACd,MAAM,IAAI,CAACP,SAAS,CAACO,UAAU,CAAC,CAAC;IACnC;IACA,MAAMmG,QAAQ,GAAG,IAAI,CAACzE,OAAO,CAACC,GAAG,CAAeyE,0BAAc,CAACvE,EAAE,CAAC;IAClE,MAAMsE,QAAQ,CAACE,kBAAkB,CAAC,CAAC;EACrC;AACF;AAACC,OAAA,CAAAhI,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import type { Component } from '@teambit/component';
2
- import { ComponentConfig } from './component-template';
2
+ import type { ComponentConfig } from './component-template';
3
3
  /**
4
4
  * BaseWorkspaceOptions describes the foundational properties for workspaces.
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["workspace-template.ts"],"sourcesContent":["import type { Component } from '@teambit/component';\nimport { ComponentConfig } from './component-template';\n\n/**\n * BaseWorkspaceOptions describes the foundational properties for workspaces.\n */\nexport interface BaseWorkspaceOptions {\n /**\n * The name of the workspace as provided by the user (e.g., `react-app`).\n * This is also used as the directory name for the workspace.\n */\n name: string;\n\n /**\n * The default scope provided by the user.\n * This is set in the workspace.jsonc and is utilized for components within the workspace.\n */\n defaultScope?: string;\n\n /**\n * Indicates whether the user has opted to avoid creating components (typically with a `--empty` flag).\n */\n empty?: boolean;\n\n /**\n * Represents the aspect in the context where a remote aspect is imported (often via the `--aspect` flag).\n * This is useful for obtaining the aspect-id and other related information.\n */\n aspectComponent?: Component;\n\n /**\n * Represents the selected template to initialize or create the workspace.\n */\n template: WorkspaceTemplate;\n\n /**\n * Flag to check if Git repository generation should be skipped.\n */\n skipGit?: boolean;\n\n /**\n * Local path to the workspace template.\n * Useful during the development of a workspace-template.\n */\n loadFrom?: string;\n}\n\n/**\n * WorkspaceContext represents foundational properties for a workspace context.\n */\nexport type WorkspaceContext = BaseWorkspaceOptions;\n\nexport interface WorkspaceFile {\n /**\n * relative path of the file within the workspace.\n */\n relativePath: string;\n\n /**\n * file content\n */\n content: string;\n}\n\nexport interface CreateComponentInfo {\n /**\n * the template for generating the component\n */\n templateName: string;\n /**\n * component name to generate\n */\n componentName: string;\n /**\n * sets the component's scope-name. if not entered, the default-scope will be used\n */\n scope?: string;\n /**\n * relative path in the workspace. by default the path is `<scope>/<namespace>/<name>`\n */\n path?: string;\n /**\n * set the component's environment. (overrides the env from variants and the template)\n */\n env?: string;\n /**\n * aspect-id of the template.\n */\n aspect?: string;\n}\n\nexport interface ForkComponentInfo extends ImportComponentInfo {\n /**\n * a new component name. if not specified, use the original id (without the scope)\n */\n targetName?: string;\n\n /**\n * a new scope for the component. if not specified, use the original scope\n */\n targetScope?: string;\n\n /**\n * env to use for the component.\n */\n env?: string;\n\n /**\n * component config. gets saved in the .bitmap file and overrides the workspace.jsonc config.\n * for example, you can set the env that will be used for this component as follows:\n * \"teambit.envs/envs\": {\n * \"env\": \"teambit.harmony/aspect\"\n * },\n */\n config?: ComponentConfig;\n}\n\n/**\n * @deprecated use ForkComponentInfo instead.\n */\nexport type ComponentToImport = ForkComponentInfo;\n\nexport interface ImportComponentInfo {\n /**\n * full component id\n */\n id: string;\n\n /**\n * path where to write the component\n */\n path?: string;\n}\n\nexport interface WorkspaceTemplateOptions {\n /**\n * name of the workspace starter. for example: `react-workspace`.\n */\n name: string;\n\n /**\n * name of an app created in the workspace. for example: `my-app`.\n * This will be used to instruct the user to run `bit run <appName>` in the new workspace.\n */\n appName?: string;\n\n /**\n * short description of the starter. shown in the `bit starter` command when outside of bit-workspace.\n */\n description?: string;\n\n /**\n * hide this starter so that it is not listed with `bit starter`\n */\n hidden?: boolean;\n}\n\nexport interface WorkspaceTemplate extends WorkspaceTemplateOptions {\n /**\n * starter function for generating the template files,\n */\n generateFiles(context: WorkspaceContext): Promise<WorkspaceFile[]>;\n\n /**\n * @deprecated use `fork()` or `import()` instead\n * this is working similarly to `fork()`\n */\n importComponents?: (context: WorkspaceContext) => ForkComponentInfo[];\n\n /**\n * import components into the new workspace, don't change their source code.\n */\n import?: (context: WorkspaceContext) => ImportComponentInfo[];\n\n /**\n * populate existing components into the new workspace and add them as new components.\n * change their source code and update the dependency names according to the new component names.\n */\n fork?: (context: WorkspaceContext) => ForkComponentInfo[];\n\n /**\n * populate new components into the new workspace and add them as new components.\n */\n create?: (context: WorkspaceContext) => CreateComponentInfo[];\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["workspace-template.ts"],"sourcesContent":["import type { Component } from '@teambit/component';\nimport type { ComponentConfig } from './component-template';\n\n/**\n * BaseWorkspaceOptions describes the foundational properties for workspaces.\n */\nexport interface BaseWorkspaceOptions {\n /**\n * The name of the workspace as provided by the user (e.g., `react-app`).\n * This is also used as the directory name for the workspace.\n */\n name: string;\n\n /**\n * The default scope provided by the user.\n * This is set in the workspace.jsonc and is utilized for components within the workspace.\n */\n defaultScope?: string;\n\n /**\n * Indicates whether the user has opted to avoid creating components (typically with a `--empty` flag).\n */\n empty?: boolean;\n\n /**\n * Represents the aspect in the context where a remote aspect is imported (often via the `--aspect` flag).\n * This is useful for obtaining the aspect-id and other related information.\n */\n aspectComponent?: Component;\n\n /**\n * Represents the selected template to initialize or create the workspace.\n */\n template: WorkspaceTemplate;\n\n /**\n * Flag to check if Git repository generation should be skipped.\n */\n skipGit?: boolean;\n\n /**\n * Local path to the workspace template.\n * Useful during the development of a workspace-template.\n */\n loadFrom?: string;\n}\n\n/**\n * WorkspaceContext represents foundational properties for a workspace context.\n */\nexport type WorkspaceContext = BaseWorkspaceOptions;\n\nexport interface WorkspaceFile {\n /**\n * relative path of the file within the workspace.\n */\n relativePath: string;\n\n /**\n * file content\n */\n content: string;\n}\n\nexport interface CreateComponentInfo {\n /**\n * the template for generating the component\n */\n templateName: string;\n /**\n * component name to generate\n */\n componentName: string;\n /**\n * sets the component's scope-name. if not entered, the default-scope will be used\n */\n scope?: string;\n /**\n * relative path in the workspace. by default the path is `<scope>/<namespace>/<name>`\n */\n path?: string;\n /**\n * set the component's environment. (overrides the env from variants and the template)\n */\n env?: string;\n /**\n * aspect-id of the template.\n */\n aspect?: string;\n}\n\nexport interface ForkComponentInfo extends ImportComponentInfo {\n /**\n * a new component name. if not specified, use the original id (without the scope)\n */\n targetName?: string;\n\n /**\n * a new scope for the component. if not specified, use the original scope\n */\n targetScope?: string;\n\n /**\n * env to use for the component.\n */\n env?: string;\n\n /**\n * component config. gets saved in the .bitmap file and overrides the workspace.jsonc config.\n * for example, you can set the env that will be used for this component as follows:\n * \"teambit.envs/envs\": {\n * \"env\": \"teambit.harmony/aspect\"\n * },\n */\n config?: ComponentConfig;\n}\n\n/**\n * @deprecated use ForkComponentInfo instead.\n */\nexport type ComponentToImport = ForkComponentInfo;\n\nexport interface ImportComponentInfo {\n /**\n * full component id\n */\n id: string;\n\n /**\n * path where to write the component\n */\n path?: string;\n}\n\nexport interface WorkspaceTemplateOptions {\n /**\n * name of the workspace starter. for example: `react-workspace`.\n */\n name: string;\n\n /**\n * name of an app created in the workspace. for example: `my-app`.\n * This will be used to instruct the user to run `bit run <appName>` in the new workspace.\n */\n appName?: string;\n\n /**\n * short description of the starter. shown in the `bit starter` command when outside of bit-workspace.\n */\n description?: string;\n\n /**\n * hide this starter so that it is not listed with `bit starter`\n */\n hidden?: boolean;\n}\n\nexport interface WorkspaceTemplate extends WorkspaceTemplateOptions {\n /**\n * starter function for generating the template files,\n */\n generateFiles(context: WorkspaceContext): Promise<WorkspaceFile[]>;\n\n /**\n * @deprecated use `fork()` or `import()` instead\n * this is working similarly to `fork()`\n */\n importComponents?: (context: WorkspaceContext) => ForkComponentInfo[];\n\n /**\n * import components into the new workspace, don't change their source code.\n */\n import?: (context: WorkspaceContext) => ImportComponentInfo[];\n\n /**\n * populate existing components into the new workspace and add them as new components.\n * change their source code and update the dependency names according to the new component names.\n */\n fork?: (context: WorkspaceContext) => ForkComponentInfo[];\n\n /**\n * populate new components into the new workspace and add them as new components.\n */\n create?: (context: WorkspaceContext) => CreateComponentInfo[];\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,8 +1,8 @@
1
1
  import chalk from 'chalk';
2
- import { EnvService, Env, EnvContext, ServiceTransformationMap, EnvDefinition } from '@teambit/envs';
2
+ import type { EnvService, Env, EnvContext, ServiceTransformationMap, EnvDefinition } from '@teambit/envs';
3
3
  import { pick } from 'lodash';
4
- import { ComponentTemplate, ComponentTemplateOptions } from './component-template';
5
- import { WorkspaceTemplate, WorkspaceTemplateOptions } from './workspace-template';
4
+ import type { ComponentTemplate, ComponentTemplateOptions } from './component-template';
5
+ import type { WorkspaceTemplate, WorkspaceTemplateOptions } from './workspace-template';
6
6
 
7
7
  type GeneratorTransformationMap = ServiceTransformationMap & {
8
8
  getGeneratorTemplates: () => ComponentTemplate[];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/generator",
3
- "version": "1.0.668",
3
+ "version": "1.0.669",
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.668"
9
+ "version": "1.0.669"
10
10
  },
11
11
  "dependencies": {
12
12
  "camelcase": "6.2.0",
@@ -19,34 +19,34 @@
19
19
  "execa": "2.1.0",
20
20
  "@teambit/bit-error": "0.0.404",
21
21
  "@teambit/component-id": "1.2.4",
22
- "@teambit/pkg.modules.component-package-name": "0.0.64",
23
- "@teambit/workspace.modules.node-modules-linker": "0.0.285",
24
22
  "@teambit/harmony": "0.4.7",
25
23
  "@teambit/legacy.constants": "0.0.13",
26
- "@teambit/legacy.consumer-config": "0.0.57",
27
- "@teambit/legacy.scope": "0.0.57",
28
24
  "@teambit/git.modules.git-executable": "0.0.14",
29
25
  "@teambit/git.modules.git-ignore": "1.0.2",
30
- "@teambit/envs": "1.0.667",
31
- "@teambit/logger": "0.0.1337",
32
- "@teambit/new-component-helper": "1.0.667",
33
- "@teambit/tracker": "1.0.667",
34
- "@teambit/workspace-config-files": "1.0.667",
35
- "@teambit/workspace": "1.0.667",
36
- "@teambit/component": "1.0.667",
37
- "@teambit/cli": "0.0.1244",
38
- "@teambit/graphql": "1.0.667",
39
- "@teambit/aspect-loader": "1.0.667",
40
- "@teambit/deprecation": "1.0.667",
41
- "@teambit/git": "1.0.667",
42
- "@teambit/scope": "1.0.667",
43
- "@teambit/compiler": "1.0.667",
44
- "@teambit/forking": "1.0.667",
45
- "@teambit/host-initializer": "0.0.380",
46
- "@teambit/importer": "1.0.667",
47
- "@teambit/install": "1.0.667",
48
- "@teambit/ui": "1.0.667",
49
- "@teambit/config": "0.0.1418"
26
+ "@teambit/envs": "1.0.668",
27
+ "@teambit/logger": "0.0.1338",
28
+ "@teambit/new-component-helper": "1.0.668",
29
+ "@teambit/pkg.modules.component-package-name": "0.0.65",
30
+ "@teambit/tracker": "1.0.668",
31
+ "@teambit/workspace-config-files": "1.0.668",
32
+ "@teambit/workspace.modules.node-modules-linker": "0.0.286",
33
+ "@teambit/workspace": "1.0.668",
34
+ "@teambit/component": "1.0.668",
35
+ "@teambit/cli": "0.0.1245",
36
+ "@teambit/graphql": "1.0.668",
37
+ "@teambit/aspect-loader": "1.0.668",
38
+ "@teambit/deprecation": "1.0.668",
39
+ "@teambit/git": "1.0.668",
40
+ "@teambit/legacy.consumer-config": "0.0.58",
41
+ "@teambit/legacy.scope": "0.0.58",
42
+ "@teambit/scope": "1.0.668",
43
+ "@teambit/compiler": "1.0.668",
44
+ "@teambit/forking": "1.0.668",
45
+ "@teambit/host-initializer": "0.0.381",
46
+ "@teambit/importer": "1.0.668",
47
+ "@teambit/install": "1.0.668",
48
+ "@teambit/ui": "1.0.668",
49
+ "@teambit/config": "0.0.1419"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/fs-extra": "9.0.7",
@@ -1,5 +1,5 @@
1
1
  import { gitIgnoreTemplate } from '@teambit/git.modules.git-ignore';
2
- import { WorkspaceContext, WorkspaceTemplate as Starter } from '../../workspace-template';
2
+ import type { WorkspaceContext, WorkspaceTemplate as Starter } from '../../workspace-template';
3
3
  import { workspaceConfig } from './template/files/workspace-config';
4
4
  import { packageJson } from './template/files/package-json';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';
2
- import { WorkspaceContext } from '../../../../workspace-template';
2
+ import type { WorkspaceContext } from '../../../../workspace-template';
3
3
 
4
4
  export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
5
5
  const configParsed = await getWorkspaceConfigTemplateParsed();
@@ -1,4 +1,4 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
 
3
3
  export function componentTemplate({ namePascalCase, name }: ComponentContext) {
4
4
  return `import {
@@ -1,4 +1,4 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
 
3
3
  export function indexFile({ namePascalCase, name }: ComponentContext) {
4
4
  return `export { ${namePascalCase}ComponentTemplate } from './${name}';
@@ -1,4 +1,4 @@
1
- import { ComponentContext, ComponentTemplate } from '../../component-template';
1
+ import type { ComponentContext, ComponentTemplate } from '../../component-template';
2
2
  import { indexFile } from './files/index';
3
3
  import { generateTestFileContent } from './files/component-template-files/test';
4
4
  import { generateComponentFileContent } from './files/component-template-files/component';
@@ -1,4 +1,4 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
 
3
3
  export function aspectFile({ namePascalCase, componentId }: ComponentContext) {
4
4
  return `import { Aspect } from '@teambit/harmony';
@@ -1,4 +1,4 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
 
3
3
  export function indexFile({ namePascalCase, name }: ComponentContext) {
4
4
  return `import { ${namePascalCase}Aspect } from './${name}.aspect';
@@ -1,4 +1,4 @@
1
- import { ComponentContext } from '../../../component-template';
1
+ import type { ComponentContext } from '../../../component-template';
2
2
 
3
3
  export function mainRuntime({ name, namePascalCase }: ComponentContext) {
4
4
  return `import { MainRuntime } from '@teambit/cli';