@teambit/generator 1.0.9 → 1.0.11

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 (46) hide show
  1. package/dist/generator.composition.d.ts +2 -2
  2. package/dist/generator.main.runtime.js +2 -3
  3. package/dist/generator.main.runtime.js.map +1 -1
  4. package/dist/preview-1695901055662.js +7 -0
  5. package/dist/templates/basic/basic.starter.js +4 -8
  6. package/dist/templates/basic/basic.starter.js.map +1 -1
  7. package/dist/templates/basic/template/files/workspace-config.js +2 -2
  8. package/dist/templates/basic/template/files/workspace-config.js.map +1 -1
  9. package/dist/templates/starter/files/starter.js +0 -4
  10. package/dist/templates/starter/files/starter.js.map +1 -1
  11. package/dist/templates/starter/files/workspace-config-tpl.js +9 -19
  12. package/dist/templates/starter/files/workspace-config-tpl.js.map +1 -1
  13. package/dist/templates/starter-standalone/files/starter.js +0 -9
  14. package/dist/templates/starter-standalone/files/starter.js.map +1 -1
  15. package/dist/templates/starter-standalone/files/workspace-config-tpl.js +8 -19
  16. package/dist/templates/starter-standalone/files/workspace-config-tpl.js.map +1 -1
  17. package/package.json +24 -23
  18. package/templates/basic/basic.starter.ts +5 -10
  19. package/templates/basic/template/files/workspace-config.ts +2 -2
  20. package/templates/starter/files/starter.ts +1 -5
  21. package/templates/starter/files/workspace-config-tpl.ts +10 -20
  22. package/templates/starter-standalone/files/starter.ts +1 -10
  23. package/templates/starter-standalone/files/workspace-config-tpl.ts +9 -20
  24. package/tsconfig.json +40 -0
  25. package/types/asset.d.ts +29 -0
  26. package/types/style.d.ts +42 -0
  27. package/.bit-capsule-ready +0 -0
  28. package/component-generator.ts +0 -271
  29. package/component-template.ts +0 -122
  30. package/create.cmd.ts +0 -88
  31. package/generator-env-type.ts +0 -14
  32. package/generator.aspect.ts +0 -5
  33. package/generator.graphql.ts +0 -62
  34. package/generator.main.runtime.ts +0 -577
  35. package/index.ts +0 -14
  36. package/new.cmd.ts +0 -114
  37. package/package-tar/teambit-generator-1.0.9.tgz +0 -0
  38. package/schema.json +0 -10304
  39. package/starter-list.ts +0 -21
  40. package/starter.plugin.ts +0 -16
  41. package/teambit_generator_generator-preview.js +0 -11
  42. package/template-list.ts +0 -21
  43. package/templates.cmd.ts +0 -55
  44. package/types.ts +0 -3
  45. package/workspace-generator.ts +0 -205
  46. package/workspace-template.ts +0 -145
@@ -25,10 +25,6 @@ export function starterFile({ namePascalCase, name }: ComponentContext) {
25
25
  },
26
26
  ];
27
27
  }
28
-
29
- // import: () => [
30
- // { id: 'teambit.community/component-showcase' },
31
- // ]
32
28
 
33
29
  static from(options: Partial<${namePascalCase}StarterOptions>) {
34
30
  return () =>
@@ -41,4 +37,4 @@ export function starterFile({ namePascalCase, name }: ComponentContext) {
41
37
  }
42
38
 
43
39
  `;
44
- }
40
+ }
@@ -3,30 +3,20 @@ export function workspaceConfigTemplate() {
3
3
  import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';
4
4
 
5
5
  export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
6
+ const scope = defaultScope || 'org.scope';
6
7
  const configParsed = await getWorkspaceConfigTemplateParsed();
7
- const packageManagerDefaultConfig = configParsed['teambit.dependencies/dependency-resolver'];
8
8
  configParsed['teambit.workspace/workspace'].name = name;
9
- configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';
10
- configParsed['teambit.dependencies/dependency-resolver'] = {
11
- ...packageManagerDefaultConfig,
12
- policy: {
13
- dependencies: {
14
- '@teambit/node.node': 'latest',
15
- '@types/node': '16.18.44',
16
- '@types/jest': '29.5.4',
17
- eslint: '7.32.0',
18
- '@typescript-eslint/eslint-plugin': '5.62.0',
19
- 'eslint-import-resolver-node': '0.3.6',
20
- 'eslint-plugin-import': '2.22.1',
21
- 'eslint-plugin-jest': '24.1.5',
22
- 'eslint-plugin-jsx-a11y': '6.4.1',
23
- 'eslint-plugin-mdx': '1.17.1',
24
- 'eslint-plugin-react': '7.22.0',
25
- },
26
- },
9
+ configParsed['teambit.workspace/workspace'].defaultScope = scope;
10
+ configParsed['teambit.generator/generator'] = {
11
+ envs: [
12
+ scope + '/react/react-env',
13
+ ],
14
+ };
15
+ configParsed['teambit.workspace/variants'] = {
16
+ '*': {},
27
17
  };
28
18
 
29
19
  return stringifyWorkspaceConfig(configParsed);
30
20
  }
31
21
  `;
32
- }
22
+ }
@@ -28,17 +28,8 @@ export function starterFile({ namePascalCase, name }: ComponentContext) {
28
28
  import: () => [
29
29
  { id: 'teambit.community/component-showcase' },
30
30
  ]
31
- // you can also fork components
32
- // fork: () => [
33
- // {
34
- // id: 'teambit.react/react-env-extension',
35
- // targetName: 'envs/my-react-env',
36
- // },
37
- // ]
38
-
39
-
40
31
  };
41
32
 
42
33
  export default ${namePascalCase}WorkspaceStarter;
43
34
  `;
44
- }
35
+ }
@@ -4,30 +4,19 @@ import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@tea
4
4
 
5
5
  export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
6
6
  const configParsed = await getWorkspaceConfigTemplateParsed();
7
- const packageManagerDefaultConfig = configParsed['teambit.dependencies/dependency-resolver'];
8
7
  configParsed['teambit.workspace/workspace'].name = name;
9
8
  configParsed['teambit.workspace/workspace'].defaultScope = defaultScope || 'org.scope';
10
- configParsed['teambit.dependencies/dependency-resolver'] = {
11
- ...packageManagerDefaultConfig,
12
- policy: {
13
- dependencies: {
14
- '@teambit/node.node': 'latest',
15
- '@types/node': '16.18.44',
16
- '@types/jest': '29.5.4',
17
- eslint: '7.32.0',
18
- '@typescript-eslint/eslint-plugin': '5.62.0',
19
- 'eslint-import-resolver-node': '0.3.6',
20
- 'eslint-plugin-import': '2.22.1',
21
- 'eslint-plugin-jest': '24.1.5',
22
- 'eslint-plugin-jsx-a11y': '6.4.1',
23
- 'eslint-plugin-mdx': '1.17.1',
24
- 'eslint-plugin-react': '7.22.0',
25
- },
26
- },
9
+ configParsed['teambit.generator/generator'] = {
10
+ envs: [
11
+ 'teambit.react/react-env',
12
+ 'teambit.node/node',
13
+ ],
14
+ };
15
+ configParsed['teambit.workspace/variants'] = {
16
+ '*': {},
27
17
  };
28
-
29
18
 
30
19
  return stringifyWorkspaceConfig(configParsed);
31
20
  }
32
21
  `;
33
- }
22
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": [
4
+ "es2019",
5
+ "DOM",
6
+ "ES6",
7
+ "DOM.Iterable",
8
+ "ScriptHost"
9
+ ],
10
+ "target": "es2015",
11
+ "module": "CommonJS",
12
+ "jsx": "react",
13
+ "allowJs": true,
14
+ "composite": true,
15
+ "declaration": true,
16
+ "sourceMap": true,
17
+ "skipLibCheck": true,
18
+ "experimentalDecorators": true,
19
+ "outDir": "dist",
20
+ "moduleResolution": "node",
21
+ "esModuleInterop": true,
22
+ "rootDir": ".",
23
+ "resolveJsonModule": true,
24
+ "emitDeclarationOnly": true,
25
+ "emitDecoratorMetadata": true,
26
+ "allowSyntheticDefaultImports": true,
27
+ "strictPropertyInitialization": false,
28
+ "strict": true,
29
+ "noImplicitAny": false,
30
+ "preserveConstEnums": true
31
+ },
32
+ "exclude": [
33
+ "dist",
34
+ "package.json"
35
+ ],
36
+ "include": [
37
+ "**/*",
38
+ "**/*.json"
39
+ ]
40
+ }
@@ -0,0 +1,29 @@
1
+ declare module '*.png' {
2
+ const value: any;
3
+ export = value;
4
+ }
5
+ declare module '*.svg' {
6
+ import type { FunctionComponent, SVGProps } from 'react';
7
+
8
+ export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
9
+ const src: string;
10
+ export default src;
11
+ }
12
+
13
+ // @TODO Gilad
14
+ declare module '*.jpg' {
15
+ const value: any;
16
+ export = value;
17
+ }
18
+ declare module '*.jpeg' {
19
+ const value: any;
20
+ export = value;
21
+ }
22
+ declare module '*.gif' {
23
+ const value: any;
24
+ export = value;
25
+ }
26
+ declare module '*.bmp' {
27
+ const value: any;
28
+ export = value;
29
+ }
@@ -0,0 +1,42 @@
1
+ declare module '*.module.css' {
2
+ const classes: { readonly [key: string]: string };
3
+ export default classes;
4
+ }
5
+ declare module '*.module.scss' {
6
+ const classes: { readonly [key: string]: string };
7
+ export default classes;
8
+ }
9
+ declare module '*.module.sass' {
10
+ const classes: { readonly [key: string]: string };
11
+ export default classes;
12
+ }
13
+
14
+ declare module '*.module.less' {
15
+ const classes: { readonly [key: string]: string };
16
+ export default classes;
17
+ }
18
+
19
+ declare module '*.less' {
20
+ const classes: { readonly [key: string]: string };
21
+ export default classes;
22
+ }
23
+
24
+ declare module '*.css' {
25
+ const classes: { readonly [key: string]: string };
26
+ export default classes;
27
+ }
28
+
29
+ declare module '*.sass' {
30
+ const classes: { readonly [key: string]: string };
31
+ export default classes;
32
+ }
33
+
34
+ declare module '*.scss' {
35
+ const classes: { readonly [key: string]: string };
36
+ export default classes;
37
+ }
38
+
39
+ declare module '*.mdx' {
40
+ const component: any;
41
+ export default component;
42
+ }
File without changes
@@ -1,271 +0,0 @@
1
- import Vinyl from 'vinyl';
2
- import fs from 'fs-extra';
3
- import pMapSeries from 'p-map-series';
4
- import path from 'path';
5
- import { Workspace } from '@teambit/workspace';
6
- import EnvsAspect, { EnvsMain } from '@teambit/envs';
7
- import camelcase from 'camelcase';
8
- import { BitError } from '@teambit/bit-error';
9
- import { Logger } from '@teambit/logger';
10
- import { TrackerMain } from '@teambit/tracker';
11
- import { linkToNodeModulesByIds } from '@teambit/workspace.modules.node-modules-linker';
12
- import { PathOsBasedRelative } from '@teambit/legacy/dist/utils/path';
13
- import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';
14
- import componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';
15
- import DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';
16
- import { NewComponentHelperMain } from '@teambit/new-component-helper';
17
- import { ComponentID } from '@teambit/component-id';
18
- import { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';
19
-
20
- import { ComponentTemplate, ComponentFile, ComponentConfig } from './component-template';
21
- import { CreateOptions } from './create.cmd';
22
- import { OnComponentCreateSlot } from './generator.main.runtime';
23
-
24
- export type GenerateResult = {
25
- id: ComponentID;
26
- dir: string;
27
- files: string[];
28
- envId: string;
29
- envSetBy: string;
30
- packageName: string;
31
- };
32
-
33
- export type OnComponentCreateFn = (generateResults: GenerateResult[]) => Promise<void>;
34
-
35
- export class ComponentGenerator {
36
- constructor(
37
- private workspace: Workspace,
38
- private componentIds: ComponentID[],
39
- private options: Partial<CreateOptions>,
40
- private template: ComponentTemplate,
41
- private envs: EnvsMain,
42
- private newComponentHelper: NewComponentHelperMain,
43
- private tracker: TrackerMain,
44
- private wsConfigFiles: WorkspaceConfigFilesMain,
45
- private logger: Logger,
46
- private onComponentCreateSlot: OnComponentCreateSlot,
47
- private aspectId: string,
48
- private envId?: ComponentID
49
- ) {}
50
-
51
- async generate(): Promise<GenerateResult[]> {
52
- const dirsToDeleteIfFailed: string[] = [];
53
- const generateResults = await pMapSeries(this.componentIds, async (componentId) => {
54
- try {
55
- const componentPath = this.newComponentHelper.getNewComponentPath(
56
- componentId,
57
- this.options.path,
58
- this.componentIds.length
59
- );
60
- if (fs.existsSync(path.join(this.workspace.path, componentPath))) {
61
- throw new BitError(`unable to create a component at "${componentPath}", this path already exist`);
62
- }
63
- if (await this.workspace.hasName(componentId.fullName)) {
64
- throw new BitError(
65
- `unable to create a component "${componentId.fullName}", a component with the same name already exist`
66
- );
67
- }
68
- dirsToDeleteIfFailed.push(componentPath);
69
- return await this.generateOneComponent(componentId, componentPath);
70
- } catch (err: any) {
71
- await this.deleteGeneratedComponents(dirsToDeleteIfFailed);
72
- throw err;
73
- }
74
- });
75
-
76
- await this.workspace.bitMap.write();
77
-
78
- const ids = generateResults.map((r) => r.id);
79
- await this.tryLinkToNodeModules(ids);
80
- await this.runOnComponentCreateHook(generateResults);
81
- // We are running this after the runOnComponentCreateHook as it require
82
- // the env to be installed to work properly, and the hook might install
83
- // the env.
84
- await this.tryWriteConfigFiles(ids);
85
-
86
- return generateResults;
87
- }
88
-
89
- private async tryLinkToNodeModules(ids: ComponentID[]) {
90
- try {
91
- await linkToNodeModulesByIds(
92
- this.workspace,
93
- ids.map((id) => id._legacy)
94
- );
95
- } catch (err: any) {
96
- this.logger.consoleFailure(
97
- `failed linking the new components to node_modules, please run "bit link" manually. error: ${err.message}`
98
- );
99
- }
100
- }
101
-
102
- private async runOnComponentCreateHook(generateResults: GenerateResult[]) {
103
- const fns = this.onComponentCreateSlot.values();
104
- if (!fns.length) return;
105
- await Promise.all(fns.map((fn) => fn(generateResults)));
106
- }
107
-
108
- /**
109
- * The function `tryWriteConfigFiles` attempts to write workspace config files, and if it fails, it logs an error
110
- * message.
111
- * @returns If the condition `!shouldWrite` is true, then nothing is being returned. Otherwise, if the `writeConfigFiles`
112
- * function is successfully executed, nothing is being returned. If an error occurs during the execution of
113
- * `writeConfigFiles`, an error message is being returned.
114
- */
115
- private async tryWriteConfigFiles(ids: ComponentID[]) {
116
- try {
117
- const shouldWrite = this.wsConfigFiles.isWorkspaceConfigWriteEnabled();
118
- if (!shouldWrite) return;
119
- ids.map((id) => this.workspace.clearComponentCache(id));
120
- await this.wsConfigFiles.writeConfigFiles({
121
- clean: true,
122
- silent: true,
123
- dedupe: true,
124
- });
125
- } catch (err: any) {
126
- this.logger.consoleFailure(
127
- `failed generating workspace config files, please run "bit ws-config write" manually. error: ${err.message}`
128
- );
129
- }
130
- }
131
-
132
- private async deleteGeneratedComponents(dirs: string[]) {
133
- await Promise.all(
134
- dirs.map(async (dir) => {
135
- const absoluteDir = path.join(this.workspace.path, dir);
136
- try {
137
- await fs.remove(absoluteDir);
138
- } catch (err: any) {
139
- if (err.code !== 'ENOENT') {
140
- // if not exist, it's fine
141
- throw err;
142
- }
143
- }
144
- })
145
- );
146
- }
147
-
148
- private async generateOneComponent(componentId: ComponentID, componentPath: string): Promise<GenerateResult> {
149
- const name = componentId.name;
150
- const namePascalCase = camelcase(name, { pascalCase: true });
151
- const nameCamelCase = camelcase(name);
152
- const aspectId = ComponentID.fromString(this.aspectId);
153
-
154
- const files = await this.template.generateFiles({
155
- name,
156
- namePascalCase,
157
- nameCamelCase,
158
- componentId,
159
- aspectId,
160
- envId: this.envId,
161
- });
162
- const mainFile = files.find((file) => file.isMain);
163
- await this.writeComponentFiles(componentPath, files);
164
- const addResults = await this.tracker.track({
165
- rootDir: componentPath,
166
- mainFile: mainFile?.relativePath,
167
- componentName: componentId.fullName,
168
- defaultScope: this.options.scope,
169
- });
170
- const component = await this.workspace.get(componentId);
171
- const hasEnvConfiguredOriginally = this.envs.hasEnvConfigured(component);
172
- const envBeforeConfigChanges = this.envs.getEnv(component);
173
- let config = this.template.config;
174
- if (config && typeof config === 'function') {
175
- const boundConfig = this.template.config?.bind(this.template);
176
- config = boundConfig({ aspectId: this.aspectId });
177
- }
178
-
179
- if (!config && this.envId) {
180
- const isInWorkspace = this.workspace.exists(this.envId);
181
- config = {
182
- [isInWorkspace ? this.envId.toStringWithoutVersion() : this.envId.toString()]: {},
183
- 'teambit.envs/envs': {
184
- env: this.envId.toStringWithoutVersion(),
185
- },
186
- };
187
- }
188
-
189
- const templateEnv = config?.[EnvsAspect.id]?.env;
190
-
191
- if (config && templateEnv && hasEnvConfiguredOriginally) {
192
- // remove the env we got from the template.
193
- delete config[templateEnv];
194
- delete config[EnvsAspect.id].env;
195
- if (Object.keys(config[EnvsAspect.id]).length === 0) delete config[EnvsAspect.id];
196
- if (Object.keys(config).length === 0) config = undefined;
197
- }
198
-
199
- const configWithEnv = await this.addEnvIfProvidedByFlag(config);
200
- if (configWithEnv) this.workspace.bitMap.setEntireConfig(component.id, configWithEnv);
201
-
202
- const getEnvData = () => {
203
- const envFromFlag = this.options.env; // env entered by the user when running `bit create --env`
204
- const envFromTemplate = config?.[EnvsAspect.id]?.env;
205
- if (envFromFlag) {
206
- return {
207
- envId: envFromFlag,
208
- setBy: '--env flag',
209
- };
210
- }
211
- if (envFromTemplate) {
212
- return {
213
- envId: envFromTemplate,
214
- setBy: 'template',
215
- };
216
- }
217
- return {
218
- envId: envBeforeConfigChanges.id,
219
- setBy: hasEnvConfiguredOriginally ? 'workspace variants' : '<default>',
220
- };
221
- };
222
- const { envId, setBy } = getEnvData();
223
- return {
224
- id: componentId,
225
- dir: componentPath,
226
- files: addResults.files,
227
- packageName: componentIdToPackageName(component.state._consumer),
228
- envId,
229
- envSetBy: setBy,
230
- };
231
- }
232
-
233
- private async addEnvIfProvidedByFlag(config?: ComponentConfig): Promise<ComponentConfig | undefined> {
234
- const userEnv = this.options.env; // env entered by the user when running `bit create --env`
235
- const templateEnv = config?.[EnvsAspect.id]?.env;
236
- if (!userEnv || userEnv === templateEnv) {
237
- return config;
238
- }
239
- config = config || {};
240
- if (templateEnv) {
241
- // the component template has an env and the user wants a different env.
242
- delete config[templateEnv];
243
- }
244
- await this.tracker.addEnvToConfig(userEnv, config);
245
-
246
- return config;
247
- }
248
-
249
- /**
250
- * writes the generated template files to the default directory set in the workspace config
251
- */
252
- private async writeComponentFiles(
253
- componentPath: string,
254
- templateFiles: ComponentFile[]
255
- ): Promise<PathOsBasedRelative[]> {
256
- const dataToPersist = new DataToPersist();
257
- const vinylFiles = templateFiles.map((templateFile) => {
258
- const templateFileVinyl = new Vinyl({
259
- base: componentPath,
260
- path: path.join(componentPath, templateFile.relativePath),
261
- contents: Buffer.from(templateFile.content),
262
- });
263
- return AbstractVinyl.fromVinyl(templateFileVinyl);
264
- });
265
- const results = vinylFiles.map((v) => v.path);
266
- dataToPersist.addManyFiles(vinylFiles);
267
- dataToPersist.addBasePath(this.workspace.path);
268
- await dataToPersist.persistAllToFS();
269
- return results;
270
- }
271
- }
@@ -1,122 +0,0 @@
1
- import { ComponentID } from '@teambit/component';
2
-
3
- /**
4
- * BaseComponentTemplateOptions describes the foundational properties for components.
5
- */
6
- export interface BaseComponentTemplateOptions {
7
- /**
8
- * component-name as entered by the user, e.g. `use-date`.
9
- * without the scope and the namespace.
10
- */
11
- name: string;
12
-
13
- /**
14
- * component-name as upper camel case, e.g. `use-date` becomes `UseDate`.
15
- * useful when generating the file content, for example for a class name.
16
- */
17
- namePascalCase: string;
18
-
19
- /**
20
- * component-name as lower camel case, e.g. `use-date` becomes `useDate`.
21
- * useful when generating the file content, for example for a function/variable name.
22
- */
23
- nameCamelCase: string;
24
-
25
- /**
26
- * component id.
27
- * the name is the name+namespace. the scope is the scope entered by --scope flag or the defaultScope
28
- */
29
- componentId: ComponentID;
30
-
31
- /**
32
- * aspect id of the aspect that register the template itself
33
- */
34
- aspectId: ComponentID | string;
35
-
36
- /**
37
- * env id of the env that register the template itself.
38
- * This will be usually identical to the aspectId but aspectId will always exist,
39
- * while envId will be undefined if the template is not registered by an env.
40
- */
41
- envId?: ComponentID;
42
-
43
- /**
44
- * path of the component.
45
- */
46
- path?: string;
47
- /**
48
- * scope of the component.
49
- */
50
- scope?: string;
51
- /**
52
- * namespace of the component.
53
- */
54
- namespace?: string;
55
- }
56
-
57
- /**
58
- * ComponentContext represents foundational properties for a component context.
59
- */
60
- export type ComponentContext = BaseComponentTemplateOptions;
61
-
62
- export interface ComponentFile {
63
- /**
64
- * relative path of the file within the component.
65
- */
66
- relativePath: string;
67
-
68
- /**
69
- * file content
70
- */
71
- content: string;
72
-
73
- /**
74
- * whether this file will be tracked as the main file
75
- */
76
- isMain?: boolean;
77
- }
78
-
79
- export interface ConfigContext {
80
- /**
81
- * Aspect id of the aspect that register the template itself
82
- */
83
- aspectId: string;
84
- }
85
-
86
- export type ComponentConfig = { [aspectName: string]: any };
87
-
88
- export interface ComponentTemplate {
89
- /**
90
- * name of the component template. for example: `hook`, `react-component` or `module`.
91
- */
92
- name: string;
93
-
94
- /**
95
- * short description of the template. shown in the `bit templates` command.
96
- */
97
- description?: string;
98
-
99
- /**
100
- * hide this template so that it is not listed with `bit templates`
101
- */
102
- hidden?: boolean;
103
-
104
- /**
105
- * env to use for the component.
106
- */
107
- env?: string;
108
-
109
- /**
110
- * template function for generating the file of a certain component.,
111
- */
112
- generateFiles(context: ComponentContext): Promise<ComponentFile[]> | ComponentFile[];
113
-
114
- /**
115
- * component config. gets saved in the .bitmap file and it overrides the workspace.jsonc config.
116
- * for example, you can set the env that will be used for this component as follows:
117
- * "teambit.envs/envs": {
118
- * "env": "teambit.harmony/aspect"
119
- * },
120
- */
121
- config?: ComponentConfig | ((context: ConfigContext) => ComponentConfig);
122
- }