@teambit/generator 1.0.226 → 1.0.228

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 (55) hide show
  1. package/artifacts/__bit_junit.xml +1 -1
  2. package/artifacts/preview/teambit_generator_generator-preview.js +1 -1
  3. package/artifacts/schema.json +118 -501
  4. package/dist/{preview-1712546198033.js → preview-1712719054377.js} +2 -2
  5. package/package.json +22 -22
  6. package/tsconfig.json +58 -1
  7. package/dist/component-generator.d.ts +0 -56
  8. package/dist/component-template.d.ts +0 -130
  9. package/dist/create.cmd.d.ts +0 -35
  10. package/dist/exceptions/workspace-path-exists.d.ts +0 -5
  11. package/dist/generator-env-type.d.ts +0 -13
  12. package/dist/generator.aspect.d.ts +0 -2
  13. package/dist/generator.composition.d.ts +0 -1
  14. package/dist/generator.graphql.d.ts +0 -7
  15. package/dist/generator.main.runtime.d.ts +0 -173
  16. package/dist/generator.service.d.ts +0 -12
  17. package/dist/index.d.ts +0 -8
  18. package/dist/new.cmd.d.ts +0 -28
  19. package/dist/starter-list.d.ts +0 -13
  20. package/dist/starter.plugin.d.ts +0 -9
  21. package/dist/template-list.d.ts +0 -13
  22. package/dist/templates/basic/basic.starter.d.ts +0 -3
  23. package/dist/templates/basic/index.d.ts +0 -1
  24. package/dist/templates/basic/template/files/package-json.d.ts +0 -1
  25. package/dist/templates/basic/template/files/workspace-config.d.ts +0 -2
  26. package/dist/templates/component-generator/files/component-template-files/component.d.ts +0 -1
  27. package/dist/templates/component-generator/files/component-template-files/composition.d.ts +0 -1
  28. package/dist/templates/component-generator/files/component-template-files/index-file.d.ts +0 -1
  29. package/dist/templates/component-generator/files/component-template-files/test.d.ts +0 -1
  30. package/dist/templates/component-generator/files/component-template.d.ts +0 -2
  31. package/dist/templates/component-generator/files/index.d.ts +0 -2
  32. package/dist/templates/component-generator/index.d.ts +0 -2
  33. package/dist/templates/component-generator-standalone/files/aspect-file.d.ts +0 -2
  34. package/dist/templates/component-generator-standalone/files/docs-file.d.ts +0 -1
  35. package/dist/templates/component-generator-standalone/files/index.d.ts +0 -2
  36. package/dist/templates/component-generator-standalone/files/main-runtime.d.ts +0 -2
  37. package/dist/templates/component-generator-standalone/index.d.ts +0 -2
  38. package/dist/templates/index.d.ts +0 -4
  39. package/dist/templates/starter/files/doc-file.d.ts +0 -2
  40. package/dist/templates/starter/files/generate-files.d.ts +0 -1
  41. package/dist/templates/starter/files/git-ignore-tpl.d.ts +0 -1
  42. package/dist/templates/starter/files/index.d.ts +0 -2
  43. package/dist/templates/starter/files/starter.d.ts +0 -2
  44. package/dist/templates/starter/files/workspace-config-tpl.d.ts +0 -1
  45. package/dist/templates/starter/index.d.ts +0 -2
  46. package/dist/templates/starter-standalone/files/doc-file.d.ts +0 -2
  47. package/dist/templates/starter-standalone/files/git-ignore-tpl.d.ts +0 -1
  48. package/dist/templates/starter-standalone/files/index.d.ts +0 -2
  49. package/dist/templates/starter-standalone/files/starter.d.ts +0 -2
  50. package/dist/templates/starter-standalone/files/workspace-config-tpl.d.ts +0 -1
  51. package/dist/templates/starter-standalone/index.d.ts +0 -2
  52. package/dist/templates.cmd.d.ts +0 -18
  53. package/dist/types.d.ts +0 -3
  54. package/dist/workspace-generator.d.ts +0 -43
  55. package/dist/workspace-template.d.ts +0 -156
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@1.0.226/dist/generator.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@1.0.226/dist/generator.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@1.0.228/dist/generator.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@1.0.228/dist/generator.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/generator",
3
- "version": "1.0.226",
3
+ "version": "1.0.228",
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.226"
9
+ "version": "1.0.228"
10
10
  },
11
11
  "dependencies": {
12
12
  "camelcase": "6.2.0",
@@ -21,32 +21,32 @@
21
21
  "@teambit/component-id": "1.2.0",
22
22
  "@teambit/harmony": "0.4.6",
23
23
  "@teambit/git.modules.git-ignore": "1.0.2",
24
- "@teambit/envs": "1.0.225",
25
- "@teambit/logger": "0.0.952",
26
- "@teambit/new-component-helper": "1.0.225",
27
- "@teambit/tracker": "1.0.225",
28
- "@teambit/workspace-config-files": "1.0.225",
29
- "@teambit/workspace.modules.node-modules-linker": "0.0.166",
30
- "@teambit/workspace": "1.0.225",
31
- "@teambit/component": "1.0.225",
32
- "@teambit/cli": "0.0.859",
33
- "@teambit/graphql": "1.0.225",
34
- "@teambit/aspect-loader": "1.0.225",
35
- "@teambit/bit": "1.6.118",
36
- "@teambit/git": "1.0.225",
37
- "@teambit/compiler": "1.0.225",
38
- "@teambit/forking": "1.0.225",
39
- "@teambit/importer": "1.0.225",
40
- "@teambit/install": "1.0.225",
41
- "@teambit/ui": "1.0.225",
42
- "@teambit/config": "0.0.976"
24
+ "@teambit/envs": "1.0.227",
25
+ "@teambit/logger": "0.0.953",
26
+ "@teambit/new-component-helper": "1.0.227",
27
+ "@teambit/tracker": "1.0.227",
28
+ "@teambit/workspace-config-files": "1.0.227",
29
+ "@teambit/workspace.modules.node-modules-linker": "0.0.167",
30
+ "@teambit/workspace": "1.0.227",
31
+ "@teambit/component": "1.0.227",
32
+ "@teambit/cli": "0.0.860",
33
+ "@teambit/graphql": "1.0.227",
34
+ "@teambit/aspect-loader": "1.0.227",
35
+ "@teambit/bit": "1.6.120",
36
+ "@teambit/git": "1.0.227",
37
+ "@teambit/compiler": "1.0.227",
38
+ "@teambit/forking": "1.0.227",
39
+ "@teambit/importer": "1.0.227",
40
+ "@teambit/install": "1.0.227",
41
+ "@teambit/ui": "1.0.227",
42
+ "@teambit/config": "0.0.978"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/fs-extra": "9.0.7",
46
46
  "@types/lodash": "4.14.165",
47
47
  "@types/mocha": "9.1.0",
48
48
  "chai": "4.3.0",
49
- "@teambit/harmony.envs.core-aspect-env": "0.0.27",
49
+ "@teambit/harmony.envs.core-aspect-env": "0.0.30",
50
50
  "@teambit/generator.aspect-docs.generator": "0.0.171"
51
51
  },
52
52
  "peerDependencies": {
package/tsconfig.json CHANGED
@@ -20,7 +20,8 @@
20
20
  "emitDeclarationOnly": true,
21
21
  "strict": true,
22
22
  "strictPropertyInitialization": false,
23
- "noImplicitAny": false
23
+ "noImplicitAny": false,
24
+ "composite": true
24
25
  },
25
26
  "exclude": [
26
27
  "artifacts",
@@ -35,5 +36,61 @@
35
36
  "include": [
36
37
  "**/*",
37
38
  "**/*.json"
39
+ ],
40
+ "references": [
41
+ {
42
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@1.0.227"
43
+ },
44
+ {
45
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_logger@0.0.953"
46
+ },
47
+ {
48
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_new-component-helper@1.0.227"
49
+ },
50
+ {
51
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_tracker@1.0.227"
52
+ },
53
+ {
54
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace-config-files@1.0.227"
55
+ },
56
+ {
57
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@1.0.227"
58
+ },
59
+ {
60
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@1.0.227"
61
+ },
62
+ {
63
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_cli@0.0.860"
64
+ },
65
+ {
66
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_graphql@1.0.227"
67
+ },
68
+ {
69
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_aspect-loader@1.0.227"
70
+ },
71
+ {
72
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_bit@1.6.120"
73
+ },
74
+ {
75
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.git_git@1.0.227"
76
+ },
77
+ {
78
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@1.0.227"
79
+ },
80
+ {
81
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_forking@1.0.227"
82
+ },
83
+ {
84
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_importer@1.0.227"
85
+ },
86
+ {
87
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_install@1.0.227"
88
+ },
89
+ {
90
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@1.0.227"
91
+ },
92
+ {
93
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_config@0.0.978"
94
+ }
38
95
  ]
39
96
  }
@@ -1,56 +0,0 @@
1
- import { Workspace } from '@teambit/workspace';
2
- import { EnvsMain } from '@teambit/envs';
3
- import { Logger } from '@teambit/logger';
4
- import { TrackerMain } from '@teambit/tracker';
5
- import { NewComponentHelperMain } from '@teambit/new-component-helper';
6
- import { ComponentID } from '@teambit/component-id';
7
- import { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';
8
- import { ComponentTemplate } from './component-template';
9
- import { CreateOptions } from './create.cmd';
10
- import { OnComponentCreateSlot } from './generator.main.runtime';
11
- export type GenerateResult = {
12
- id: ComponentID;
13
- dir: string;
14
- files: string[];
15
- envId: string;
16
- envSetBy: string;
17
- packageName: string;
18
- isApp?: boolean;
19
- isEnv?: boolean;
20
- dependencies?: string[];
21
- installMissingDependencies?: boolean;
22
- };
23
- export type OnComponentCreateFn = (generateResults: GenerateResult[]) => Promise<void>;
24
- export declare class ComponentGenerator {
25
- private workspace;
26
- private componentIds;
27
- private options;
28
- private template;
29
- private envs;
30
- private newComponentHelper;
31
- private tracker;
32
- private wsConfigFiles;
33
- private logger;
34
- private onComponentCreateSlot;
35
- private aspectId;
36
- private envId?;
37
- constructor(workspace: Workspace, componentIds: ComponentID[], options: Partial<CreateOptions>, template: ComponentTemplate, envs: EnvsMain, newComponentHelper: NewComponentHelperMain, tracker: TrackerMain, wsConfigFiles: WorkspaceConfigFilesMain, logger: Logger, onComponentCreateSlot: OnComponentCreateSlot, aspectId: string, envId?: ComponentID | undefined);
38
- generate(force?: boolean): Promise<GenerateResult[]>;
39
- private tryLinkToNodeModules;
40
- private runOnComponentCreateHook;
41
- /**
42
- * The function `tryWriteConfigFiles` attempts to write workspace config files, and if it fails, it logs an error
43
- * message.
44
- * @returns If the condition `!shouldWrite` is true, then nothing is being returned. Otherwise, if the `writeConfigFiles`
45
- * function is successfully executed, nothing is being returned. If an error occurs during the execution of
46
- * `writeConfigFiles`, an error message is being returned.
47
- */
48
- private tryWriteConfigFiles;
49
- private deleteGeneratedComponents;
50
- private generateOneComponent;
51
- private addEnvIfProvidedByFlag;
52
- /**
53
- * writes the generated template files to the default directory set in the workspace config
54
- */
55
- private writeComponentFiles;
56
- }
@@ -1,130 +0,0 @@
1
- import { ComponentID } from '@teambit/component';
2
- /**
3
- * BaseComponentTemplateOptions describes the foundational properties for components.
4
- */
5
- export interface BaseComponentTemplateOptions {
6
- /**
7
- * component-name as entered by the user, e.g. `use-date`.
8
- * without the scope and the namespace.
9
- */
10
- name: string;
11
- /**
12
- * component-name as upper camel case, e.g. `use-date` becomes `UseDate`.
13
- * useful when generating the file content, for example for a class name.
14
- */
15
- namePascalCase: string;
16
- /**
17
- * component-name as lower camel case, e.g. `use-date` becomes `useDate`.
18
- * useful when generating the file content, for example for a function/variable name.
19
- */
20
- nameCamelCase: string;
21
- /**
22
- * component id.
23
- * the name is the name+namespace. the scope is the scope entered by --scope flag or the defaultScope
24
- */
25
- componentId: ComponentID;
26
- /**
27
- * aspect id of the aspect that register the template itself
28
- */
29
- aspectId: ComponentID | string;
30
- /**
31
- * env id of the env that register the template itself.
32
- * This will be usually identical to the aspectId but aspectId will always exist,
33
- * while envId will be undefined if the template is not registered by an env.
34
- */
35
- envId?: ComponentID;
36
- /**
37
- * path of the component.
38
- */
39
- path?: string;
40
- /**
41
- * scope of the component.
42
- */
43
- scope?: string;
44
- /**
45
- * namespace of the component.
46
- */
47
- namespace?: string;
48
- }
49
- /**
50
- * ComponentContext represents foundational properties for a component context.
51
- */
52
- export type ComponentContext = BaseComponentTemplateOptions;
53
- export interface ComponentFile {
54
- /**
55
- * relative path of the file within the component.
56
- */
57
- relativePath: string;
58
- /**
59
- * file content
60
- */
61
- content: string;
62
- /**
63
- * whether this file will be tracked as the main file
64
- */
65
- isMain?: boolean;
66
- }
67
- export interface ConfigContext {
68
- /**
69
- * Aspect id of the aspect that register the template itself
70
- */
71
- aspectId: string;
72
- }
73
- export type ComponentConfig = {
74
- [aspectName: string]: any;
75
- };
76
- export interface ComponentTemplateOptions {
77
- /**
78
- * name of the component template. for example: `hook`, `react-component` or `module`.
79
- */
80
- name?: string;
81
- /**
82
- * short description of the template. shown in the `bit templates` command.
83
- */
84
- description?: string;
85
- /**
86
- * hide this template so that it is not listed with `bit templates`
87
- */
88
- hidden?: boolean;
89
- /**
90
- * env to use for the generated component.
91
- */
92
- env?: string;
93
- /**
94
- * adds a metadata that the component that this template creates is of type env.
95
- * This will be used later to do further configuration for example:
96
- * - ensure to create the .bit_root for it
97
- */
98
- isEnv?: boolean;
99
- /**
100
- * adds a metadata that the component that this template creates is of type app.
101
- * This will be used later to do further configuration for example:
102
- * - add it to the workspace.jsonc as app
103
- * - ensure to create the .bit_root for it
104
- */
105
- isApp?: boolean;
106
- /**
107
- * list of dependencies to install when the component is created.
108
- */
109
- dependencies?: string[];
110
- /**
111
- * Perform installation of missing dependencies after component generation.
112
- * This is the same as of running `bit install --add-missing-deps` after component generation.
113
- */
114
- installMissingDependencies?: boolean;
115
- }
116
- export interface ComponentTemplate extends ComponentTemplateOptions {
117
- name: string;
118
- /**
119
- * template function for generating the file of a certain component.,
120
- */
121
- generateFiles(context: ComponentContext): Promise<ComponentFile[]> | ComponentFile[];
122
- /**
123
- * component config. gets saved in the .bitmap file and it overrides the workspace.jsonc config.
124
- * for example, you can set the env that will be used for this component as follows:
125
- * "teambit.envs/envs": {
126
- * "env": "teambit.harmony/aspect"
127
- * },
128
- */
129
- config?: ComponentConfig | ((context: ConfigContext) => ComponentConfig);
130
- }
@@ -1,35 +0,0 @@
1
- import { Command, CommandOptions } from '@teambit/cli';
2
- import { ComponentID } from '@teambit/component';
3
- import { GeneratorMain } from './generator.main.runtime';
4
- import type { BaseComponentTemplateOptions } from './component-template';
5
- /**
6
- * CreateOptions combines foundational properties with additional options for creating a component.
7
- */
8
- export type CreateOptions = BaseComponentTemplateOptions & {
9
- env?: string;
10
- aspect?: string;
11
- force?: boolean;
12
- };
13
- export declare class CreateCmd implements Command {
14
- private generator;
15
- name: string;
16
- description: string;
17
- alias: string;
18
- loader: boolean;
19
- helpUrl: string;
20
- arguments: {
21
- name: string;
22
- description: string;
23
- }[];
24
- examples: {
25
- cmd: string;
26
- description: string;
27
- }[];
28
- group: string;
29
- options: CommandOptions;
30
- constructor(generator: GeneratorMain);
31
- report([templateName, componentNames]: [string, string[]], options: Partial<CreateOptions> & {
32
- template?: string | ComponentID;
33
- force?: boolean;
34
- }): Promise<string>;
35
- }
@@ -1,5 +0,0 @@
1
- import { BitError } from '@teambit/bit-error';
2
- export declare class WorkspacePathExists extends BitError {
3
- readonly path: string;
4
- constructor(path: string);
5
- }
@@ -1,13 +0,0 @@
1
- import { EnvHandler } from '@teambit/envs';
2
- import { TemplateList } from './template-list';
3
- import { StarterList } from './starter-list';
4
- export interface GeneratorEnv {
5
- /**
6
- * return a template list instance.
7
- */
8
- generators(): EnvHandler<TemplateList>;
9
- /**
10
- * return a starter list instance.
11
- */
12
- starters(): EnvHandler<StarterList>;
13
- }
@@ -1,2 +0,0 @@
1
- import { Aspect } from '@teambit/harmony';
2
- export declare const GeneratorAspect: Aspect;
@@ -1 +0,0 @@
1
- export declare const Logo: () => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { Schema } from '@teambit/graphql';
2
- import { GeneratorMain } from './generator.main.runtime';
3
- import { CreateOptions } from './create.cmd';
4
- export type CreateQueryOptions = CreateOptions & {
5
- templateName: string;
6
- };
7
- export declare function generatorSchema(generator: GeneratorMain): Schema;
@@ -1,173 +0,0 @@
1
- import { GraphqlMain } from '@teambit/graphql';
2
- import { CLIMain } from '@teambit/cli';
3
- import { Workspace } from '@teambit/workspace';
4
- import { EnvDefinition, EnvsMain } from '@teambit/envs';
5
- import { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';
6
- import type { ComponentMain, Component } from '@teambit/component';
7
- import { SlotRegistry } from '@teambit/harmony';
8
- import { GitMain } from '@teambit/git';
9
- import { AspectLoaderMain } from '@teambit/aspect-loader';
10
- import { TrackerMain } from '@teambit/tracker';
11
- import { NewComponentHelperMain } from '@teambit/new-component-helper';
12
- import { Logger, LoggerMain } from '@teambit/logger';
13
- import { ComponentTemplate } from './component-template';
14
- import { CreateOptions } from './create.cmd';
15
- import { GenerateResult, OnComponentCreateFn } from './component-generator';
16
- import { WorkspaceTemplate } from './workspace-template';
17
- import { NewOptions } from './new.cmd';
18
- export type ComponentTemplateSlot = SlotRegistry<ComponentTemplate[]>;
19
- export type WorkspaceTemplateSlot = SlotRegistry<WorkspaceTemplate[]>;
20
- export type OnComponentCreateSlot = SlotRegistry<OnComponentCreateFn>;
21
- export type TemplateDescriptor = {
22
- aspectId: string;
23
- titlePrefix?: string;
24
- name: string;
25
- description?: string;
26
- hidden?: boolean;
27
- };
28
- type TemplateWithId = {
29
- id: string;
30
- envName?: string;
31
- };
32
- type WorkspaceTemplateWithId = TemplateWithId & {
33
- template: WorkspaceTemplate;
34
- };
35
- type ComponentTemplateWithId = TemplateWithId & {
36
- template: ComponentTemplate;
37
- };
38
- export type GenerateWorkspaceTemplateResult = {
39
- workspacePath: string;
40
- appName?: string;
41
- };
42
- export type GeneratorConfig = {
43
- /**
44
- * array of aspects to include in the list of templates.
45
- */
46
- aspects: string[];
47
- /**
48
- * by default core templates are shown.
49
- * use this to hide them unless `--show-all` flag of `bit templates` was used
50
- */
51
- hideCoreTemplates: boolean;
52
- /**
53
- * default envs.
54
- */
55
- envs?: string[];
56
- };
57
- export declare class GeneratorMain {
58
- private componentTemplateSlot;
59
- private workspaceTemplateSlot;
60
- private onComponentCreateSlot;
61
- private config;
62
- private workspace;
63
- private envs;
64
- private aspectLoader;
65
- private newComponentHelper;
66
- private componentAspect;
67
- private tracker;
68
- private logger;
69
- private git;
70
- private wsConfigFiles;
71
- private aspectLoaded;
72
- constructor(componentTemplateSlot: ComponentTemplateSlot, workspaceTemplateSlot: WorkspaceTemplateSlot, onComponentCreateSlot: OnComponentCreateSlot, config: GeneratorConfig, workspace: Workspace, envs: EnvsMain, aspectLoader: AspectLoaderMain, newComponentHelper: NewComponentHelperMain, componentAspect: ComponentMain, tracker: TrackerMain, logger: Logger, git: GitMain, wsConfigFiles: WorkspaceConfigFilesMain);
73
- /**
74
- * register a new component template.
75
- */
76
- registerComponentTemplate(templates: ComponentTemplate[]): this;
77
- /**
78
- * register a new workspace starter.
79
- */
80
- registerWorkspaceTemplate(templates: WorkspaceTemplate[]): this;
81
- registerOnComponentCreate(fn: OnComponentCreateFn): this;
82
- /**
83
- * list all component templates registered in the workspace or workspace templates in case the
84
- * workspace is not available
85
- */
86
- listTemplates({ aspect }?: {
87
- aspect?: string;
88
- }): Promise<TemplateDescriptor[]>;
89
- private getTemplateDescriptor;
90
- /**
91
- * @deprecated use this.listTemplates()
92
- */
93
- listComponentTemplates(opts: {
94
- aspect?: string;
95
- }): Promise<TemplateDescriptor[]>;
96
- isRunningInsideWorkspace(): boolean;
97
- /**
98
- * get all component templates registered by a specific aspect ID.
99
- */
100
- getComponentTemplateByAspect(aspectId: string): ComponentTemplate[];
101
- /**
102
- * returns a specific component template.
103
- */
104
- getComponentTemplate(name: string, aspectId?: string): Promise<ComponentTemplateWithId | undefined>;
105
- private findTemplateByAspectIdAndName;
106
- /**
107
- * Get the generator aspect and the envs aspect from an harmony instance of the global scope
108
- */
109
- private getGlobalGeneratorEnvs;
110
- /**
111
- * in the case the aspect-id is given and this aspect doesn't exist locally, import it to the
112
- * global scope and load it from the capsule
113
- */
114
- findWorkspaceTemplateInGlobalScope(aspectId: string, name?: string): Promise<{
115
- workspaceTemplate?: WorkspaceTemplate;
116
- aspect?: Component;
117
- }>;
118
- findTemplateInOtherWorkspace(workspacePath: string, name: string, aspectId?: string): Promise<{
119
- workspaceTemplate: WorkspaceTemplate | undefined;
120
- aspect: Component;
121
- }>;
122
- /**
123
- * returns a specific workspace template.
124
- */
125
- getWorkspaceTemplate(name: string, aspectId?: string): Promise<{
126
- workspaceTemplate: WorkspaceTemplate;
127
- aspect?: Component;
128
- }>;
129
- searchRegisteredWorkspaceTemplate(name?: string, aspectId?: string, remoteEnvsAspect?: EnvsMain): Promise<WorkspaceTemplate | undefined>;
130
- generateComponentTemplate(componentNames: string[], templateName: string, options: Partial<CreateOptions>): Promise<GenerateResult[]>;
131
- private getEnvIdFromTemplateWithId;
132
- generateWorkspaceTemplate(workspaceName: string, templateName: string, options: NewOptions & {
133
- aspect?: string;
134
- currentDir?: boolean;
135
- }): Promise<GenerateWorkspaceTemplateResult>;
136
- private getAllComponentTemplatesDescriptorsFlattened;
137
- private getAllComponentTemplatesFlattened;
138
- private getAllWorkspaceTemplatesDescriptorFlattened;
139
- private getAllWorkspaceTemplatesFlattened;
140
- /**
141
- * list all starter templates registered by an env.
142
- */
143
- listEnvWorkspaceTemplates(envId: string, remoteEnvsAspect?: EnvsMain): Promise<Array<WorkspaceTemplateWithId>>;
144
- /**
145
- * list all component templates registered by an env.
146
- */
147
- listEnvComponentTemplateDescriptors(ids?: string[], aspectId?: string): Promise<TemplateDescriptor[]>;
148
- getConfiguredEnvs(): string[];
149
- listEnvComponentTemplates(ids?: string[], aspectId?: string): Promise<Array<ComponentTemplateWithId>>;
150
- loadEnvs(ids?: string[], remoteEnvsAspect?: EnvsMain): Promise<EnvDefinition[]>;
151
- loadAspects(): Promise<void>;
152
- static slots: (((registerFn: () => string) => SlotRegistry<ComponentTemplate[]>) | ((registerFn: () => string) => SlotRegistry<WorkspaceTemplate[]>) | ((registerFn: () => string) => SlotRegistry<OnComponentCreateFn>))[];
153
- static dependencies: import("@teambit/bit").Aspect[];
154
- static runtime: import("@teambit/bit").RuntimeDefinition;
155
- static provider([workspace, cli, graphql, envs, aspectLoader, newComponentHelper, componentAspect, tracker, loggerMain, git, wsConfigFiles,]: [
156
- Workspace,
157
- CLIMain,
158
- GraphqlMain,
159
- EnvsMain,
160
- AspectLoaderMain,
161
- NewComponentHelperMain,
162
- ComponentMain,
163
- TrackerMain,
164
- LoggerMain,
165
- GitMain,
166
- WorkspaceConfigFilesMain
167
- ], config: GeneratorConfig, [componentTemplateSlot, workspaceTemplateSlot, onComponentCreateSlot]: [
168
- ComponentTemplateSlot,
169
- WorkspaceTemplateSlot,
170
- OnComponentCreateSlot
171
- ]): Promise<GeneratorMain>;
172
- }
173
- export {};
@@ -1,12 +0,0 @@
1
- import { EnvService, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';
2
- import { ComponentTemplate } from './component-template';
3
- import { WorkspaceTemplate } from './workspace-template';
4
- type GeneratorTransformationMap = ServiceTransformationMap & {
5
- getGeneratorTemplates: () => ComponentTemplate;
6
- getGeneratorStarters: () => WorkspaceTemplate;
7
- };
8
- export declare class GeneratorService implements EnvService<any> {
9
- name: string;
10
- transform(env: Env, context: EnvContext): GeneratorTransformationMap | undefined;
11
- }
12
- export {};
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export type { GeneratorMain } from './generator.main.runtime';
2
- export type { ComponentContext, ComponentTemplate, ComponentTemplateOptions, ComponentFile, ComponentConfig, ConfigContext, } from './component-template';
3
- export type { WorkspaceContext, WorkspaceTemplate, WorkspaceTemplate as Starter, WorkspaceFile, ForkComponentInfo, ImportComponentInfo, CreateComponentInfo, } from './workspace-template';
4
- export type { GeneratorEnv } from './generator-env-type';
5
- export { GeneratorAspect } from './generator.aspect';
6
- export { TemplateList } from './template-list';
7
- export { StarterList } from './starter-list';
8
- export type { GenerateResult } from './component-generator';
package/dist/new.cmd.d.ts DELETED
@@ -1,28 +0,0 @@
1
- import { Command, CommandOptions } from '@teambit/cli';
2
- import { GeneratorMain } from './generator.main.runtime';
3
- import { BaseWorkspaceOptions } from './workspace-template';
4
- /**
5
- * NewOptions combines foundational properties with additional options for creating a workspace.
6
- */
7
- export type NewOptions = BaseWorkspaceOptions;
8
- export declare class NewCmd implements Command {
9
- private generator;
10
- name: string;
11
- description: string;
12
- arguments: {
13
- name: string;
14
- description: string;
15
- }[];
16
- alias: string;
17
- loader: boolean;
18
- group: string;
19
- options: CommandOptions;
20
- constructor(generator: GeneratorMain);
21
- report([templateName, workspaceName]: [string, string], options: NewOptions & {
22
- standalone: boolean;
23
- env?: string;
24
- template?: string;
25
- aspect?: string;
26
- currentDir?: boolean;
27
- }): Promise<string>;
28
- }
@@ -1,13 +0,0 @@
1
- import { EnvContext, EnvHandler } from '@teambit/envs';
2
- import { WorkspaceTemplate } from './workspace-template';
3
- export type StarterListOptions = {
4
- name?: string;
5
- };
6
- export declare class StarterList {
7
- readonly name: string;
8
- private starters;
9
- private context;
10
- constructor(name: string, starters: EnvHandler<WorkspaceTemplate>[], context: EnvContext);
11
- compute(): WorkspaceTemplate[];
12
- static from(starters: EnvHandler<WorkspaceTemplate>[], options?: StarterListOptions): (context: EnvContext) => StarterList;
13
- }
@@ -1,9 +0,0 @@
1
- import { PluginDefinition } from '@teambit/aspect-loader';
2
- import { GeneratorMain } from './generator.main.runtime';
3
- export declare class StarterPlugin implements PluginDefinition {
4
- private generator;
5
- constructor(generator: GeneratorMain);
6
- pattern: string;
7
- runtimes: string[];
8
- register(object: any): GeneratorMain;
9
- }