@teambit/generator 1.0.226 → 1.0.228

Sign up to get free protection for your applications and to get access to all the features.
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,13 +0,0 @@
1
- import { EnvContext, EnvHandler } from '@teambit/envs';
2
- import { ComponentTemplate } from './component-template';
3
- export type TemplateListOptions = {
4
- name?: string;
5
- };
6
- export declare class TemplateList {
7
- readonly name: string;
8
- private templates;
9
- private context;
10
- constructor(name: string, templates: EnvHandler<ComponentTemplate>[], context: EnvContext);
11
- compute(): ComponentTemplate[];
12
- static from(templates: EnvHandler<ComponentTemplate>[], options?: TemplateListOptions): (context: EnvContext) => TemplateList;
13
- }
@@ -1,3 +0,0 @@
1
- import { Starter } from '../..';
2
- export declare const BasicWorkspaceStarter: Starter;
3
- export default BasicWorkspaceStarter;
@@ -1 +0,0 @@
1
- export { BasicWorkspaceStarter } from './basic.starter';
@@ -1 +0,0 @@
1
- export declare function packageJson(): string;
@@ -1,2 +0,0 @@
1
- import { WorkspaceContext } from '../../../..';
2
- export declare function workspaceConfig({ name, defaultScope }: WorkspaceContext): Promise<string>;
@@ -1 +0,0 @@
1
- export declare const generateComponentFileContent: () => string;
@@ -1 +0,0 @@
1
- export declare const generateCompositionFileContent: () => string;
@@ -1 +0,0 @@
1
- export declare const generateIndexFileContent: () => string;
@@ -1 +0,0 @@
1
- export declare const generateTestFileContent: () => string;
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '../../../component-template';
2
- export declare function componentTemplate({ namePascalCase, name }: ComponentContext): string;
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '../../..';
2
- export declare function indexFile({ namePascalCase, name }: ComponentContext): string;
@@ -1,2 +0,0 @@
1
- import { ComponentTemplate } from '../..';
2
- export declare const componentGeneratorTemplate: ComponentTemplate;
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '../../..';
2
- export declare function aspectFile({ namePascalCase, componentId }: ComponentContext): string;
@@ -1 +0,0 @@
1
- export declare function docsFile(): string;
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '../../../component-template';
2
- export declare function indexFile({ namePascalCase, name }: ComponentContext): string;
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '../../..';
2
- export declare function mainRuntime({ name, namePascalCase }: ComponentContext): string;
@@ -1,2 +0,0 @@
1
- import { ComponentTemplate } from '../../component-template';
2
- export declare const componentGeneratorTemplate: ComponentTemplate;
@@ -1,4 +0,0 @@
1
- export { starterTemplate as starterTemplateStandalone } from './starter-standalone';
2
- export { starterTemplate } from './starter';
3
- export { componentGeneratorTemplate as componentGeneratorTemplateStandalone } from './component-generator-standalone';
4
- export { componentGeneratorTemplate } from './component-generator';
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '../../../component-template';
2
- export declare function docFile(context: ComponentContext): string;
@@ -1 +0,0 @@
1
- export declare function generateFiles(): string;
@@ -1 +0,0 @@
1
- export declare function gitIgnoreTemplate(): string;
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '../../..';
2
- export declare function indexFile({ namePascalCase, name }: ComponentContext): string;
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '../../../component-template';
2
- export declare function starterFile({ namePascalCase, name }: ComponentContext): string;
@@ -1 +0,0 @@
1
- export declare function workspaceConfigTemplate(): string;
@@ -1,2 +0,0 @@
1
- import { ComponentTemplate } from '../../';
2
- export declare const starterTemplate: ComponentTemplate;
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '../../../component-template';
2
- export declare function docFile(context: ComponentContext): string;
@@ -1 +0,0 @@
1
- export declare function gitIgnoreTemplate(): string;
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '../../../component-template';
2
- export declare function indexFile({ namePascalCase, name }: ComponentContext): string;
@@ -1,2 +0,0 @@
1
- import { ComponentContext } from '../../../component-template';
2
- export declare function starterFile({ namePascalCase, name }: ComponentContext): string;
@@ -1 +0,0 @@
1
- export declare function workspaceConfigTemplate(): string;
@@ -1,2 +0,0 @@
1
- import { ComponentTemplate } from '../../component-template';
2
- export declare const starterTemplate: ComponentTemplate;
@@ -1,18 +0,0 @@
1
- import { Command, CommandOptions } from '@teambit/cli';
2
- import { GeneratorMain } from './generator.main.runtime';
3
- export type TemplatesOptions = {
4
- showAll?: boolean;
5
- aspect?: string;
6
- };
7
- export declare class TemplatesCmd implements Command {
8
- private generator;
9
- name: string;
10
- description: string;
11
- extendedDescription: string;
12
- alias: string;
13
- loader: boolean;
14
- group: string;
15
- options: CommandOptions;
16
- constructor(generator: GeneratorMain);
17
- report(args: [], templatesOptions: TemplatesOptions): Promise<string>;
18
- }
package/dist/types.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export interface CreateExtConfig {
2
- template: string;
3
- }
@@ -1,43 +0,0 @@
1
- import { Component } from '@teambit/component';
2
- import { ComponentID } from '@teambit/component-id';
3
- import { WorkspaceTemplate } from './workspace-template';
4
- import { NewOptions } from './new.cmd';
5
- export type GenerateResult = {
6
- id: ComponentID;
7
- dir: string;
8
- files: string[];
9
- envId: string;
10
- };
11
- export declare class WorkspaceGenerator {
12
- private workspaceName;
13
- private workspacePath;
14
- private options;
15
- private template;
16
- private aspectComponent?;
17
- private harmony;
18
- private workspace;
19
- private install;
20
- private importer;
21
- private logger?;
22
- private forking;
23
- private git;
24
- private wsConfigFiles;
25
- private generator;
26
- constructor(workspaceName: string, workspacePath: string, options: NewOptions & {
27
- currentDir?: boolean;
28
- }, template: WorkspaceTemplate, aspectComponent?: Component | undefined);
29
- generate(): Promise<string>;
30
- private initGit;
31
- private setupGitBitmapMergeDriver;
32
- private buildUI;
33
- private getWorkspaceContext;
34
- /**
35
- * writes the generated template files to the default directory set in the workspace config
36
- */
37
- private writeWorkspaceFiles;
38
- private reloadBitInWorkspaceDir;
39
- private createComponentsFromRemote;
40
- private forkComponentsFromRemote;
41
- private importComponentsFromRemote;
42
- private compileComponents;
43
- }
@@ -1,156 +0,0 @@
1
- import type { Component } from '@teambit/component';
2
- import { ComponentConfig } from './component-template';
3
- /**
4
- * BaseWorkspaceOptions describes the foundational properties for workspaces.
5
- */
6
- export interface BaseWorkspaceOptions {
7
- /**
8
- * The name of the workspace as provided by the user (e.g., `react-app`).
9
- * This is also used as the directory name for the workspace.
10
- */
11
- name: string;
12
- /**
13
- * The default scope provided by the user.
14
- * This is set in the workspace.jsonc and is utilized for components within the workspace.
15
- */
16
- defaultScope?: string;
17
- /**
18
- * Indicates whether the user has opted to avoid creating components (typically with a `--empty` flag).
19
- */
20
- empty?: boolean;
21
- /**
22
- * Represents the aspect in the context where a remote aspect is imported (often via the `--aspect` flag).
23
- * This is useful for obtaining the aspect-id and other related information.
24
- */
25
- aspectComponent?: Component;
26
- /**
27
- * Represents the selected template to initialize or create the workspace.
28
- */
29
- template: WorkspaceTemplate;
30
- /**
31
- * Flag to check if Git repository generation should be skipped.
32
- */
33
- skipGit?: boolean;
34
- /**
35
- * Local path to the workspace template.
36
- * Useful during the development of a workspace-template.
37
- */
38
- loadFrom?: string;
39
- }
40
- /**
41
- * WorkspaceContext represents foundational properties for a workspace context.
42
- */
43
- export type WorkspaceContext = BaseWorkspaceOptions;
44
- export interface WorkspaceFile {
45
- /**
46
- * relative path of the file within the workspace.
47
- */
48
- relativePath: string;
49
- /**
50
- * file content
51
- */
52
- content: string;
53
- }
54
- export interface CreateComponentInfo {
55
- /**
56
- * the template for generating the component
57
- */
58
- templateName: string;
59
- /**
60
- * component name to generate
61
- */
62
- componentName: string;
63
- /**
64
- * sets the component's scope-name. if not entered, the default-scope will be used
65
- */
66
- scope?: string;
67
- /**
68
- * relative path in the workspace. by default the path is `<scope>/<namespace>/<name>`
69
- */
70
- path?: string;
71
- /**
72
- * set the component's environment. (overrides the env from variants and the template)
73
- */
74
- env?: string;
75
- /**
76
- * aspect-id of the template.
77
- */
78
- aspect?: string;
79
- }
80
- export interface ForkComponentInfo extends ImportComponentInfo {
81
- /**
82
- * a new component name. if not specified, use the original id (without the scope)
83
- */
84
- targetName?: string;
85
- /**
86
- * a new scope for the component. if not specified, use the original scope
87
- */
88
- targetScope?: string;
89
- /**
90
- * env to use for the component.
91
- */
92
- env?: string;
93
- /**
94
- * component config. gets saved in the .bitmap file and overrides the workspace.jsonc config.
95
- * for example, you can set the env that will be used for this component as follows:
96
- * "teambit.envs/envs": {
97
- * "env": "teambit.harmony/aspect"
98
- * },
99
- */
100
- config?: ComponentConfig;
101
- }
102
- /**
103
- * @deprecated use ForkComponentInfo instead.
104
- */
105
- export type ComponentToImport = ForkComponentInfo;
106
- export interface ImportComponentInfo {
107
- /**
108
- * full component id
109
- */
110
- id: string;
111
- /**
112
- * path where to write the component
113
- */
114
- path?: string;
115
- }
116
- export interface WorkspaceTemplate {
117
- /**
118
- * name of the workspace starter. for example: `react-workspace`.
119
- */
120
- name: string;
121
- /**
122
- * name of an app created in the workspace. for example: `my-app`.
123
- * This will be used to instruct the user to run `bit run <appName>` in the new workspace.
124
- */
125
- appName?: string;
126
- /**
127
- * short description of the starter. shown in the `bit starter` command when outside of bit-workspace.
128
- */
129
- description?: string;
130
- /**
131
- * hide this starter so that it is not listed with `bit starter`
132
- */
133
- hidden?: boolean;
134
- /**
135
- * starter function for generating the template files,
136
- */
137
- generateFiles(context: WorkspaceContext): Promise<WorkspaceFile[]>;
138
- /**
139
- * @deprecated use `fork()` or `import()` instead
140
- * this is working similarly to `fork()`
141
- */
142
- importComponents?: (context: WorkspaceContext) => ForkComponentInfo[];
143
- /**
144
- * import components into the new workspace, don't change their source code.
145
- */
146
- import?: (context: WorkspaceContext) => ImportComponentInfo[];
147
- /**
148
- * populate existing components into the new workspace and add them as new components.
149
- * change their source code and update the dependency names according to the new component names.
150
- */
151
- fork?: (context: WorkspaceContext) => ForkComponentInfo[];
152
- /**
153
- * populate new components into the new workspace and add them as new components.
154
- */
155
- create?: (context: WorkspaceContext) => CreateComponentInfo[];
156
- }