@teambit/generator 0.0.1144 → 0.0.1146

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 (148) hide show
  1. package/dist/component-template.d.ts +39 -22
  2. package/dist/component-template.js.map +1 -1
  3. package/dist/create.cmd.d.ts +10 -9
  4. package/dist/create.cmd.js +15 -12
  5. package/dist/create.cmd.js.map +1 -1
  6. package/dist/generator.graphql.d.ts +4 -0
  7. package/dist/generator.graphql.js +12 -1
  8. package/dist/generator.graphql.js.map +1 -1
  9. package/dist/generator.main.runtime.d.ts +5 -5
  10. package/dist/generator.main.runtime.js +16 -29
  11. package/dist/generator.main.runtime.js.map +1 -1
  12. package/dist/new.cmd.d.ts +6 -7
  13. package/dist/new.cmd.js +4 -0
  14. package/dist/new.cmd.js.map +1 -1
  15. package/dist/{preview-1693279117198.js → preview-1693538278577.js} +2 -2
  16. package/dist/templates/basic/basic.starter.d.ts +3 -0
  17. package/dist/templates/basic/basic.starter.js +39 -0
  18. package/dist/templates/basic/basic.starter.js.map +1 -0
  19. package/dist/templates/basic/index.d.ts +1 -0
  20. package/dist/templates/basic/index.js +20 -0
  21. package/dist/templates/basic/index.js.map +1 -0
  22. package/dist/templates/basic/template/files/git-ignore.d.ts +1 -0
  23. package/dist/templates/basic/template/files/git-ignore.js +118 -0
  24. package/dist/templates/basic/template/files/git-ignore.js.map +1 -0
  25. package/dist/templates/basic/template/files/workspace-config.d.ts +2 -0
  26. package/dist/templates/{workspace-generator/index.js → basic/template/files/workspace-config.js} +35 -11
  27. package/dist/templates/basic/template/files/workspace-config.js.map +1 -0
  28. package/dist/templates/component-generator/files/component-template-files/component.d.ts +1 -0
  29. package/dist/templates/component-generator/files/component-template-files/component.js +35 -0
  30. package/dist/templates/component-generator/files/component-template-files/component.js.map +1 -0
  31. package/dist/templates/component-generator/files/component-template-files/composition.d.ts +1 -0
  32. package/dist/templates/component-generator/files/component-template-files/composition.js +29 -0
  33. package/dist/templates/component-generator/files/component-template-files/composition.js.map +1 -0
  34. package/dist/templates/component-generator/files/component-template-files/index-file.d.ts +1 -0
  35. package/dist/templates/component-generator/files/component-template-files/index-file.js +24 -0
  36. package/dist/templates/component-generator/files/component-template-files/index-file.js.map +1 -0
  37. package/dist/templates/component-generator/files/component-template-files/test.d.ts +1 -0
  38. package/dist/templates/component-generator/files/component-template-files/test.js +31 -0
  39. package/dist/templates/component-generator/files/component-template-files/test.js.map +1 -0
  40. package/dist/templates/component-generator/files/component-template.d.ts +2 -0
  41. package/dist/templates/component-generator/files/component-template.js +67 -0
  42. package/dist/templates/component-generator/files/component-template.js.map +1 -0
  43. package/dist/templates/component-generator/files/index.d.ts +1 -1
  44. package/dist/templates/component-generator/files/index.js +1 -5
  45. package/dist/templates/component-generator/files/index.js.map +1 -1
  46. package/dist/templates/component-generator/index.d.ts +1 -1
  47. package/dist/templates/component-generator/index.js +36 -16
  48. package/dist/templates/component-generator/index.js.map +1 -1
  49. package/dist/templates/{component-generator → component-generator-standalone}/files/aspect-file.d.ts +1 -1
  50. package/dist/templates/component-generator-standalone/files/aspect-file.js.map +1 -0
  51. package/dist/templates/component-generator-standalone/files/index.d.ts +2 -0
  52. package/dist/templates/component-generator-standalone/files/index.js +19 -0
  53. package/dist/templates/component-generator-standalone/files/index.js.map +1 -0
  54. package/dist/templates/{component-generator → component-generator-standalone}/files/main-runtime.d.ts +1 -1
  55. package/dist/templates/component-generator-standalone/files/main-runtime.js.map +1 -0
  56. package/dist/templates/component-generator-standalone/index.d.ts +2 -0
  57. package/dist/templates/component-generator-standalone/index.js +64 -0
  58. package/dist/templates/component-generator-standalone/index.js.map +1 -0
  59. package/dist/templates/index.d.ts +4 -0
  60. package/dist/templates/index.js +59 -0
  61. package/dist/templates/index.js.map +1 -0
  62. package/dist/templates/starter/files/doc-file.d.ts +2 -0
  63. package/dist/templates/starter/files/doc-file.js +33 -0
  64. package/dist/templates/starter/files/doc-file.js.map +1 -0
  65. package/dist/templates/starter/files/generate-files.d.ts +1 -0
  66. package/dist/templates/starter/files/generate-files.js +35 -0
  67. package/dist/templates/starter/files/generate-files.js.map +1 -0
  68. package/dist/templates/starter/files/index.d.ts +1 -1
  69. package/dist/templates/starter/files/index.js +1 -1
  70. package/dist/templates/starter/files/index.js.map +1 -1
  71. package/dist/templates/starter/files/starter.d.ts +2 -1
  72. package/dist/templates/starter/files/starter.js +39 -29
  73. package/dist/templates/starter/files/starter.js.map +1 -1
  74. package/dist/templates/starter/files/workspace-config-tpl.js +7 -1
  75. package/dist/templates/starter/files/workspace-config-tpl.js.map +1 -1
  76. package/dist/templates/starter/index.d.ts +1 -1
  77. package/dist/templates/starter/index.js +16 -16
  78. package/dist/templates/starter/index.js.map +1 -1
  79. package/dist/templates/starter-standalone/files/doc-file.d.ts +2 -0
  80. package/dist/templates/starter-standalone/files/doc-file.js +33 -0
  81. package/dist/templates/starter-standalone/files/doc-file.js.map +1 -0
  82. package/dist/templates/starter-standalone/files/git-ignore-tpl.d.ts +1 -0
  83. package/dist/templates/starter-standalone/files/git-ignore-tpl.js +121 -0
  84. package/dist/templates/starter-standalone/files/git-ignore-tpl.js.map +1 -0
  85. package/dist/templates/starter-standalone/files/index.d.ts +2 -0
  86. package/dist/templates/starter-standalone/files/index.js +15 -0
  87. package/dist/templates/starter-standalone/files/index.js.map +1 -0
  88. package/dist/templates/starter-standalone/files/starter.d.ts +2 -0
  89. package/dist/templates/starter-standalone/files/starter.js +44 -0
  90. package/dist/templates/starter-standalone/files/starter.js.map +1 -0
  91. package/dist/templates/starter-standalone/files/workspace-config-tpl.d.ts +1 -0
  92. package/dist/templates/starter-standalone/files/workspace-config-tpl.js +30 -0
  93. package/dist/templates/starter-standalone/files/workspace-config-tpl.js.map +1 -0
  94. package/dist/templates/starter-standalone/index.d.ts +2 -0
  95. package/dist/templates/starter-standalone/index.js +73 -0
  96. package/dist/templates/starter-standalone/index.js.map +1 -0
  97. package/dist/workspace-generator.js +17 -1
  98. package/dist/workspace-generator.js.map +1 -1
  99. package/dist/workspace-template.d.ts +37 -29
  100. package/dist/workspace-template.js.map +1 -1
  101. package/package.json +22 -22
  102. package/templates/basic/basic.starter.ts +22 -0
  103. package/templates/basic/index.ts +1 -0
  104. package/templates/basic/template/files/git-ignore.ts +110 -0
  105. package/templates/basic/template/files/workspace-config.ts +33 -0
  106. package/templates/component-generator/files/component-template-files/component.ts +26 -0
  107. package/templates/component-generator/files/component-template-files/composition.ts +20 -0
  108. package/templates/component-generator/files/component-template-files/index-file.ts +15 -0
  109. package/templates/component-generator/files/component-template-files/test.ts +22 -0
  110. package/templates/component-generator/files/component-template.ts +58 -0
  111. package/templates/component-generator/files/index.ts +2 -6
  112. package/templates/component-generator/index.ts +22 -12
  113. package/templates/{component-generator → component-generator-standalone}/files/aspect-file.ts +1 -1
  114. package/templates/component-generator-standalone/files/index.ts +10 -0
  115. package/templates/{component-generator → component-generator-standalone}/files/main-runtime.ts +1 -1
  116. package/templates/component-generator-standalone/index.ts +39 -0
  117. package/templates/index.ts +4 -0
  118. package/templates/starter/files/doc-file.ts +24 -0
  119. package/templates/starter/files/generate-files.ts +27 -0
  120. package/templates/starter/files/index.ts +2 -2
  121. package/templates/starter/files/starter.ts +37 -28
  122. package/templates/starter/files/workspace-config-tpl.ts +7 -1
  123. package/templates/starter/index.ts +13 -11
  124. package/templates/starter-standalone/files/doc-file.ts +24 -0
  125. package/templates/starter-standalone/files/git-ignore-tpl.ts +113 -0
  126. package/templates/starter-standalone/files/index.ts +6 -0
  127. package/templates/starter-standalone/files/starter.ts +35 -0
  128. package/templates/starter-standalone/files/workspace-config-tpl.ts +22 -0
  129. package/templates/starter-standalone/index.ts +44 -0
  130. package/dist/templates/component-generator/files/aspect-file.js.map +0 -1
  131. package/dist/templates/component-generator/files/main-runtime.js.map +0 -1
  132. package/dist/templates/starter/files/docs-file.d.ts +0 -1
  133. package/dist/templates/starter/files/docs-file.js +0 -45
  134. package/dist/templates/starter/files/docs-file.js.map +0 -1
  135. package/dist/templates/starter/files/readme-tpl.d.ts +0 -1
  136. package/dist/templates/starter/files/readme-tpl.js +0 -47
  137. package/dist/templates/starter/files/readme-tpl.js.map +0 -1
  138. package/dist/templates/workspace-generator/index.d.ts +0 -2
  139. package/dist/templates/workspace-generator/index.js.map +0 -1
  140. package/templates/starter/files/docs-file.ts +0 -37
  141. package/templates/starter/files/readme-tpl.ts +0 -39
  142. package/templates/workspace-generator/index.ts +0 -10
  143. /package/dist/templates/{component-generator → component-generator-standalone}/files/aspect-file.js +0 -0
  144. /package/dist/templates/{component-generator → component-generator-standalone}/files/docs-file.d.ts +0 -0
  145. /package/dist/templates/{component-generator → component-generator-standalone}/files/docs-file.js +0 -0
  146. /package/dist/templates/{component-generator → component-generator-standalone}/files/docs-file.js.map +0 -0
  147. /package/dist/templates/{component-generator → component-generator-standalone}/files/main-runtime.js +0 -0
  148. /package/templates/{component-generator → component-generator-standalone}/files/docs-file.ts +0 -0
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.generateFiles = generateFiles;
7
+ function generateFiles() {
8
+ return `import { WorkspaceContext, WorkspaceFile } from '@teambit/generator';
9
+ import { workspaceConfig } from './workspace-config';
10
+ import { gitIgnore } from './git-ignore';
11
+
12
+ export async function generateFiles(
13
+ context: WorkspaceContext,
14
+ ): Promise<WorkspaceFile[]> {
15
+ const files: WorkspaceFile[] = [
16
+ {
17
+ relativePath: 'workspace.jsonc',
18
+ content: await workspaceConfig(context),
19
+ },
20
+ ];
21
+
22
+ if (!context.skipGit) {
23
+ files.push({
24
+ relativePath: '.gitignore',
25
+ content: gitIgnore(),
26
+ });
27
+ }
28
+
29
+ return files;
30
+ }
31
+
32
+ `;
33
+ }
34
+
35
+ //# sourceMappingURL=generate-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["generateFiles"],"sources":["generate-files.ts"],"sourcesContent":["export function generateFiles() {\n return `import { WorkspaceContext, WorkspaceFile } from '@teambit/generator';\n import { workspaceConfig } from './workspace-config';\n import { gitIgnore } from './git-ignore';\n \n export async function generateFiles(\n context: WorkspaceContext,\n ): Promise<WorkspaceFile[]> {\n const files: WorkspaceFile[] = [\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 \n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,aAAaA,CAAA,EAAG;EAC9B,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '@teambit/generator';
1
+ import { ComponentContext } from '../../..';
2
2
  export declare function indexFile({ namePascalCase, name }: ComponentContext): string;
@@ -8,7 +8,7 @@ function indexFile({
8
8
  namePascalCase,
9
9
  name
10
10
  }) {
11
- return `export { starter as ${namePascalCase}Starter } from './${name}.starter';
11
+ return `export { ${namePascalCase}WorkspaceStarter } from './${name}.starter';
12
12
  `;
13
13
  }
14
14
 
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `export { starter as ${namePascalCase}Starter } from './${name}.starter';\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAQ,uBAAsBD,cAAe,qBAAoBC,IAAK;AACxE,CAAC;AACD"}
1
+ {"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '../../..';\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,OAAQ,YAAWD,cAAe,8BAA6BC,IAAK;AACtE,CAAC;AACD"}
@@ -1 +1,2 @@
1
- export declare function starterFile(): string;
1
+ import { ComponentContext } from '@teambit/generator';
2
+ export declare function starterFile({ namePascalCase, name }: ComponentContext): string;
@@ -4,35 +4,45 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.starterFile = starterFile;
7
- function starterFile() {
8
- return `import { WorkspaceContext, Starter } from '@teambit/generator';
9
- import { workspaceConfig } from './template/files/workspace-config';
10
- import { readme } from './template/files/readme-file';
11
- import { gitIgnore } from './template/files/git-ignore';
12
-
13
- export const starter: Starter = {
14
- name: 'template-example',
15
- description: 'demonstration of a workspace template',
16
- generateFiles: async (context: WorkspaceContext) => [
17
- {
18
- relativePath: 'workspace.jsonc',
19
- content: await workspaceConfig(context),
20
- },
21
- {
22
- relativePath: '.gitignore',
23
- content: gitIgnore(),
24
- },
25
- {
26
- relativePath: 'README.md',
27
- content: readme(),
28
- },
29
- ],
30
- importComponents: () => [
31
- { id: 'teambit.react/templates/ui/text', path: 'ui/text' },
32
- ],
33
- };
34
-
35
- export default starter;
7
+ function starterFile({
8
+ namePascalCase,
9
+ name
10
+ }) {
11
+ return `import { WorkspaceContext, WorkspaceTemplate } from '@teambit/generator';
12
+ import { generateFiles as generateCommonFiles } from './template/files/generate-files';
13
+
14
+ export type ${namePascalCase}StarterOptions = Pick<WorkspaceTemplate, 'name' | 'description' | 'hidden'>;
15
+
16
+ export class ${namePascalCase}WorkspaceStarter implements WorkspaceTemplate {
17
+ constructor(
18
+ readonly name = '${name}-workspace',
19
+ readonly description = '${namePascalCase} workspace with a custom react env',
20
+ readonly hidden = false
21
+ ) {}
22
+
23
+ async generateFiles(context: WorkspaceContext) {
24
+ return generateCommonFiles(context);
25
+ }
26
+
27
+ fork() {
28
+ return [
29
+ {
30
+ id: 'teambit.react/react-env-extension',
31
+ targetName: 'envs/my-react-env',
32
+ },
33
+ ];
34
+ }
35
+
36
+ static from(options: Partial<${namePascalCase}StarterOptions>) {
37
+ return () =>
38
+ new ${namePascalCase}WorkspaceStarter(
39
+ options.name,
40
+ options.description,
41
+ options.hidden
42
+ );
43
+ }
44
+ }
45
+
36
46
  `;
37
47
  }
38
48
 
@@ -1 +1 @@
1
- {"version":3,"names":["starterFile"],"sources":["starter.ts"],"sourcesContent":["export function starterFile() {\n return `import { WorkspaceContext, Starter } from '@teambit/generator';\nimport { workspaceConfig } from './template/files/workspace-config';\nimport { readme } from './template/files/readme-file';\nimport { gitIgnore } from './template/files/git-ignore';\n\nexport const starter: Starter = {\n name: 'template-example',\n description: 'demonstration of a workspace template',\n generateFiles: async (context: WorkspaceContext) => [\n {\n relativePath: 'workspace.jsonc',\n content: await workspaceConfig(context),\n },\n {\n relativePath: '.gitignore',\n content: gitIgnore(),\n },\n {\n relativePath: 'README.md',\n content: readme(),\n },\n ],\n importComponents: () => [\n { id: 'teambit.react/templates/ui/text', path: 'ui/text' },\n ],\n};\n\nexport default starter;\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,WAAWA,CAAA,EAAG;EAC5B,OAAQ;AACV;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,CAAC;AACD"}
1
+ {"version":3,"names":["starterFile","namePascalCase","name"],"sources":["starter.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\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,OAAQ;AACV;AACA;AACA,gBAAgBD,cAAe;AAC/B;AACA,iBAAiBA,cAAe;AAChC;AACA,yBAAyBC,IAAK;AAC9B,gCAAgCD,cAAe;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmCA,cAAe;AAClD;AACA,cAAcA,cAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -9,9 +9,15 @@ function workspaceConfigTemplate() {
9
9
  import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';
10
10
 
11
11
  export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
12
+ const scope = defaultScope || 'org.scope';
12
13
  const configParsed = await getWorkspaceConfigTemplateParsed();
13
14
  configParsed['teambit.workspace/workspace'].name = name;
14
- configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'company.scope';
15
+ configParsed['teambit.workspace/workspace'].defaultScope = scope;
16
+ configParsed['teambit.generator/generator'] = {
17
+ envs: [
18
+ scope + '/react/react-env',
19
+ ],
20
+ };
15
21
  configParsed['teambit.workspace/variants'] = {
16
22
  '*': {},
17
23
  };
@@ -1 +1 @@
1
- {"version":3,"names":["workspaceConfigTemplate"],"sources":["workspace-config-tpl.ts"],"sourcesContent":["export function workspaceConfigTemplate() {\n return `import { WorkspaceContext } from '@teambit/generator';\nimport { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';\n\nexport async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {\n const configParsed = await getWorkspaceConfigTemplateParsed();\n configParsed['teambit.workspace/workspace'].name = name;\n configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'company.scope';\n configParsed['teambit.workspace/variants'] = {\n '*': {},\n };\n\n return stringifyWorkspaceConfig(configParsed);\n}\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,uBAAuBA,CAAA,EAAG;EACxC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
1
+ {"version":3,"names":["workspaceConfigTemplate"],"sources":["workspace-config-tpl.ts"],"sourcesContent":["export function workspaceConfigTemplate() {\n return `import { WorkspaceContext } from '@teambit/generator';\nimport { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';\n\nexport async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {\n const scope = defaultScope || 'org.scope';\n const configParsed = await getWorkspaceConfigTemplateParsed();\n configParsed['teambit.workspace/workspace'].name = name;\n configParsed['teambit.workspace/workspace'].defaultScope = scope;\n configParsed['teambit.generator/generator'] = {\n envs: [\n scope + '/react/react-env',\n ],\n };\n configParsed['teambit.workspace/variants'] = {\n '*': {},\n };\n\n return stringifyWorkspaceConfig(configParsed);\n}\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,uBAAuBA,CAAA,EAAG;EACxC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -1,2 +1,2 @@
1
- import { ComponentTemplate } from '@teambit/generator';
1
+ import { ComponentTemplate } from '../../';
2
2
  export declare const starterTemplate: ComponentTemplate;
@@ -18,9 +18,9 @@ function _starter() {
18
18
  };
19
19
  return data;
20
20
  }
21
- function _docsFile() {
22
- const data = require("./files/docs-file");
23
- _docsFile = function () {
21
+ function _docFile() {
22
+ const data = require("./files/doc-file");
23
+ _docFile = function () {
24
24
  return data;
25
25
  };
26
26
  return data;
@@ -32,23 +32,23 @@ function _gitIgnoreTpl() {
32
32
  };
33
33
  return data;
34
34
  }
35
- function _readmeTpl() {
36
- const data = require("./files/readme-tpl");
37
- _readmeTpl = function () {
35
+ function _workspaceConfigTpl() {
36
+ const data = require("./files/workspace-config-tpl");
37
+ _workspaceConfigTpl = function () {
38
38
  return data;
39
39
  };
40
40
  return data;
41
41
  }
42
- function _workspaceConfigTpl() {
43
- const data = require("./files/workspace-config-tpl");
44
- _workspaceConfigTpl = function () {
42
+ function _generateFiles() {
43
+ const data = require("./files/generate-files");
44
+ _generateFiles = function () {
45
45
  return data;
46
46
  };
47
47
  return data;
48
48
  }
49
49
  const starterTemplate = {
50
50
  name: 'starter',
51
- description: 'create your own starter - \nDocs: https://bit.dev/docs/dev-services/generator/generate-workspace',
51
+ description: 'create your own workspace starter (env integrated) - \nDocs: https://bit.dev/reference/starters/create-starter',
52
52
  generateFiles: context => {
53
53
  return [{
54
54
  relativePath: 'index.ts',
@@ -56,25 +56,25 @@ const starterTemplate = {
56
56
  isMain: true
57
57
  }, {
58
58
  relativePath: `${context.name}.starter.ts`,
59
- content: (0, _starter().starterFile)()
59
+ content: (0, _starter().starterFile)(context)
60
60
  }, {
61
61
  relativePath: `${context.name}.docs.mdx`,
62
- content: (0, _docsFile().docsFile)()
62
+ content: (0, _docFile().docFile)(context)
63
63
  }, {
64
64
  relativePath: 'template/files/git-ignore.ts',
65
65
  content: (0, _gitIgnoreTpl().gitIgnoreTemplate)()
66
- }, {
67
- relativePath: 'template/files/readme-file.ts',
68
- content: (0, _readmeTpl().readmeTemplate)()
69
66
  }, {
70
67
  relativePath: 'template/files/workspace-config.ts',
71
68
  content: (0, _workspaceConfigTpl().workspaceConfigTemplate)()
69
+ }, {
70
+ relativePath: 'template/files/generate-files.ts',
71
+ content: (0, _generateFiles().generateFiles)()
72
72
  }];
73
73
  },
74
74
  config: {
75
75
  'teambit.harmony/aspect': {},
76
76
  'teambit.envs/envs': {
77
- env: 'teambit.harmony/aspect'
77
+ env: 'teambit.harmony/node'
78
78
  }
79
79
  }
80
80
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_index","data","require","_starter","_docsFile","_gitIgnoreTpl","_readmeTpl","_workspaceConfigTpl","starterTemplate","name","description","generateFiles","context","relativePath","content","indexFile","isMain","starterFile","docsFile","gitIgnoreTemplate","readmeTemplate","workspaceConfigTemplate","config","env","exports"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { starterFile } from './files/starter';\nimport { docsFile } from './files/docs-file';\nimport { gitIgnoreTemplate } from './files/git-ignore-tpl';\nimport { readmeTemplate } from './files/readme-tpl';\nimport { workspaceConfigTemplate } from './files/workspace-config-tpl';\n\nexport const starterTemplate: ComponentTemplate = {\n name: 'starter',\n description: 'create your own starter - \\nDocs: https://bit.dev/docs/dev-services/generator/generate-workspace',\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(),\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docsFile(),\n },\n {\n relativePath: 'template/files/git-ignore.ts',\n content: gitIgnoreTemplate(),\n },\n {\n relativePath: 'template/files/readme-file.ts',\n content: readmeTemplate(),\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,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,cAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,oBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,mBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMO,eAAkC,GAAG;EAChDC,IAAI,EAAE,SAAS;EACfC,WAAW,EAAE,kGAAkG;EAC/GC,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,EAAG,GAAED,OAAO,CAACH,IAAK,aAAY;MAC1CK,OAAO,EAAE,IAAAG,sBAAW,EAAC;IACvB,CAAC,EACD;MACEJ,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,WAAU;MACxCK,OAAO,EAAE,IAAAI,oBAAQ,EAAC;IACpB,CAAC,EACD;MACEL,YAAY,EAAE,8BAA8B;MAC5CC,OAAO,EAAE,IAAAK,iCAAiB,EAAC;IAC7B,CAAC,EACD;MACEN,YAAY,EAAE,+BAA+B;MAC7CC,OAAO,EAAE,IAAAM,2BAAc,EAAC;IAC1B,CAAC,EACD;MACEP,YAAY,EAAE,oCAAoC;MAClDC,OAAO,EAAE,IAAAO,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;AAACC,OAAA,CAAAhB,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["_index","data","require","_starter","_docFile","_gitIgnoreTpl","_workspaceConfigTpl","_generateFiles","starterTemplate","name","description","generateFiles","context","relativePath","content","indexFile","isMain","starterFile","docFile","gitIgnoreTemplate","workspaceConfigTemplate","config","env","exports"],"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 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,GAAG;EAChDC,IAAI,EAAE,SAAS;EACfC,WAAW,EACT,gHAAgH;EAClHC,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,EAAG,GAAED,OAAO,CAACH,IAAK,aAAY;MAC1CK,OAAO,EAAE,IAAAG,sBAAW,EAACL,OAAO;IAC9B,CAAC,EACD;MACEC,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,WAAU;MACxCK,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;AAACC,OAAA,CAAAf,eAAA,GAAAA,eAAA"}
@@ -0,0 +1,2 @@
1
+ import { ComponentContext } from '@teambit/generator';
2
+ export declare function docFile(context: ComponentContext): string;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.docFile = docFile;
7
+ function docFile(context) {
8
+ const {
9
+ name,
10
+ componentId
11
+ } = context;
12
+ return `---
13
+ description: Starter for generating a ${name} workspace
14
+ labels: ['generator', 'templates', '${name}-workspace']
15
+ ---
16
+
17
+ ## Using the ${name} Workspace Starter
18
+
19
+ How to use this generator locally, essentially for development purposes:
20
+
21
+ \`\`\`js
22
+ bit new ${name} my-${name}-workspace --load-from /Users/me/path/to/this/dir --aspect ${componentId.toString()}
23
+ \`\`\`
24
+
25
+ How to use this generator after exporting to a remote scope:
26
+
27
+ \`\`\`js
28
+ bit new ${name} my-${name}-workspace --aspect ${componentId.toString()}
29
+ \`\`\`
30
+ `;
31
+ }
32
+
33
+ //# sourceMappingURL=doc-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["docFile","context","name","componentId","toString"],"sources":["doc-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\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,OAAQ;AACV,wCAAwCC,IAAK;AAC7C,sCAAsCA,IAAK;AAC3C;AACA;AACA,eAAeA,IAAK;AACpB;AACA;AACA;AACA;AACA,UAAUA,IAAK,OAAMA,IAAK,8DAA6DC,WAAW,CAACC,QAAQ,CAAC,CAAE;AAC9G;AACA;AACA;AACA;AACA;AACA,UAAUF,IAAK,OAAMA,IAAK,uBAAsBC,WAAW,CAACC,QAAQ,CAAC,CAAE;AACvE;AACA,CAAC;AACD"}
@@ -0,0 +1 @@
1
+ export declare function gitIgnoreTemplate(): string;
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.gitIgnoreTemplate = gitIgnoreTemplate;
7
+ function gitIgnoreTemplate() {
8
+ return `export function gitIgnore() {
9
+ return \`# Bit
10
+ .bit
11
+ public
12
+
13
+ # Logs
14
+ logs
15
+ *.log
16
+ npm-debug.log*
17
+ yarn-debug.log*
18
+ yarn-error.log*
19
+ lerna-debug.log*
20
+
21
+ # Diagnostic reports (https://nodejs.org/api/report.html)
22
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
23
+
24
+ # Runtime data
25
+ pids
26
+ *.pid
27
+ *.seed
28
+ *.pid.lock
29
+
30
+ # Directory for instrumented libs generated by jscoverage/JSCover
31
+ lib-cov
32
+
33
+ # Coverage directory used by tools like istanbul
34
+ coverage
35
+ *.lcov
36
+
37
+ # nyc test coverage
38
+ .nyc_output
39
+
40
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
41
+ .grunt
42
+
43
+ # Bower dependency directory (https://bower.io/)
44
+ bower_components
45
+
46
+ # node-waf configuration
47
+ .lock-wscript
48
+
49
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
50
+ build/Release
51
+
52
+ # Dependency directories
53
+ node_modules/
54
+ jspm_packages/
55
+
56
+ # TypeScript v1 declaration files
57
+ typings/
58
+
59
+ # TypeScript cache
60
+ *.tsbuildinfo
61
+
62
+ # Optional npm cache directory
63
+ .npm
64
+
65
+ # Optional eslint cache
66
+ .eslintcache
67
+
68
+ # Microbundle cache
69
+ .rpt2_cache/
70
+ .rts2_cache_cjs/
71
+ .rts2_cache_es/
72
+ .rts2_cache_umd/
73
+
74
+ # Optional REPL history
75
+ .node_repl_history
76
+
77
+ # Output of 'npm pack'
78
+ *.tgz
79
+
80
+ # Yarn Integrity file
81
+ .yarn-integrity
82
+
83
+ # dotenv environment variables file
84
+ .env
85
+ .env.test
86
+
87
+ # parcel-bundler cache (https://parceljs.org/)
88
+ .cache
89
+
90
+ # Next.js build output
91
+ .next
92
+
93
+ # Nuxt.js build / generate output
94
+ .nuxt
95
+ dist
96
+
97
+ # Gatsby files
98
+ .cache/
99
+
100
+ # vuepress build output
101
+ .vuepress/dist
102
+
103
+ # Serverless directories
104
+ .serverless/
105
+
106
+ # FuseBox cache
107
+ .fusebox/
108
+
109
+ # DynamoDB Local files
110
+ .dynamodb/
111
+
112
+ # TernJS port file
113
+ .tern-port
114
+
115
+ .history
116
+ \`;
117
+ }
118
+ `;
119
+ }
120
+
121
+ //# sourceMappingURL=git-ignore-tpl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["gitIgnoreTemplate"],"sources":["git-ignore-tpl.ts"],"sourcesContent":["export function gitIgnoreTemplate() {\n return `export function gitIgnore() {\n return \\`# Bit\n.bit\npublic\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n\n# Diagnostic reports (https://nodejs.org/api/report.html)\nreport.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n*.lcov\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# Bower dependency directory (https://bower.io/)\nbower_components\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (https://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules/\njspm_packages/\n\n# TypeScript v1 declaration files\ntypings/\n\n# TypeScript cache\n*.tsbuildinfo\n\n# Optional npm cache directory\n.npm\n\n# Optional eslint cache\n.eslintcache\n\n# Microbundle cache\n.rpt2_cache/\n.rts2_cache_cjs/\n.rts2_cache_es/\n.rts2_cache_umd/\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn Integrity file\n.yarn-integrity\n\n# dotenv environment variables file\n.env\n.env.test\n\n# parcel-bundler cache (https://parceljs.org/)\n.cache\n\n# Next.js build output\n.next\n\n# Nuxt.js build / generate output\n.nuxt\ndist\n\n# Gatsby files\n.cache/\n\n# vuepress build output\n.vuepress/dist\n\n# Serverless directories\n.serverless/\n\n# FuseBox cache\n.fusebox/\n\n# DynamoDB Local files\n.dynamodb/\n\n# TernJS port file\n.tern-port\n\n.history\n\\`;\n}\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,iBAAiBA,CAAA,EAAG;EAClC,OAAQ;AACV;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,CAAC;AACD"}
@@ -0,0 +1,2 @@
1
+ import { ComponentContext } from '@teambit/generator';
2
+ export declare function indexFile({ namePascalCase, name }: ComponentContext): string;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.indexFile = indexFile;
7
+ function indexFile({
8
+ namePascalCase,
9
+ name
10
+ }) {
11
+ return `export { ${namePascalCase}WorkspaceStarter } from './${name}.starter';
12
+ `;
13
+ }
14
+
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\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,OAAQ,YAAWD,cAAe,8BAA6BC,IAAK;AACtE,CAAC;AACD"}
@@ -0,0 +1,2 @@
1
+ import { ComponentContext } from '@teambit/generator';
2
+ export declare function starterFile({ namePascalCase, name }: ComponentContext): string;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.starterFile = starterFile;
7
+ function starterFile({
8
+ namePascalCase,
9
+ name
10
+ }) {
11
+ return `import { WorkspaceContext, Starter } from '@teambit/generator';
12
+ import { workspaceConfig } from './template/files/workspace-config';
13
+ import { gitIgnore } from './template/files/git-ignore';
14
+
15
+ export const ${namePascalCase}WorkspaceStarter: Starter = {
16
+ name: '${name}-workspace',
17
+ description: 'a ${name} workspace',
18
+ generateFiles: async (context: WorkspaceContext) => {
19
+ const files = [
20
+ {
21
+ relativePath: 'workspace.jsonc',
22
+ content: await workspaceConfig(context),
23
+ },
24
+ ];
25
+
26
+ if (!context.skipGit) {
27
+ files.push({
28
+ relativePath: '.gitignore',
29
+ content: gitIgnore(),
30
+ });
31
+ }
32
+
33
+ return files;
34
+ },
35
+ import: () => [
36
+ { id: 'teambit.community/component-showcase' },
37
+ ]
38
+ };
39
+
40
+ export default ${namePascalCase}WorkspaceStarter;
41
+ `;
42
+ }
43
+
44
+ //# sourceMappingURL=starter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["starterFile","namePascalCase","name"],"sources":["starter.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\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,OAAQ;AACV;AACA;AACA;AACA,iBAAiBD,cAAe;AAChC,aAAaC,IAAK;AAClB,sBAAsBA,IAAK;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmBD,cAAe;AAClC,CAAC;AACD"}
@@ -0,0 +1 @@
1
+ export declare function workspaceConfigTemplate(): string;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.workspaceConfigTemplate = workspaceConfigTemplate;
7
+ function workspaceConfigTemplate() {
8
+ return `import { WorkspaceContext } from '@teambit/generator';
9
+ import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';
10
+
11
+ export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
12
+ const configParsed = await getWorkspaceConfigTemplateParsed();
13
+ configParsed['teambit.workspace/workspace'].name = name;
14
+ configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';
15
+ configParsed['teambit.generator/generator'] = {
16
+ envs: [
17
+ 'teambit.react/react-env',
18
+ 'teambit.node/node',
19
+ ],
20
+ };
21
+ configParsed['teambit.workspace/variants'] = {
22
+ '*': {},
23
+ };
24
+
25
+ return stringifyWorkspaceConfig(configParsed);
26
+ }
27
+ `;
28
+ }
29
+
30
+ //# sourceMappingURL=workspace-config-tpl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["workspaceConfigTemplate"],"sources":["workspace-config-tpl.ts"],"sourcesContent":["export function workspaceConfigTemplate() {\n return `import { WorkspaceContext } from '@teambit/generator';\nimport { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';\n\nexport async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {\n const configParsed = await getWorkspaceConfigTemplateParsed();\n configParsed['teambit.workspace/workspace'].name = name;\n configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';\n configParsed['teambit.generator/generator'] = {\n envs: [\n 'teambit.react/react-env',\n 'teambit.node/node',\n ],\n };\n configParsed['teambit.workspace/variants'] = {\n '*': {},\n };\n\n return stringifyWorkspaceConfig(configParsed);\n}\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,uBAAuBA,CAAA,EAAG;EACxC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -0,0 +1,2 @@
1
+ import { ComponentTemplate } from '@teambit/generator';
2
+ export declare const starterTemplate: ComponentTemplate;