@teambit/generator 1.0.9 → 1.0.10
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.
- package/dist/generator.composition.d.ts +2 -2
- package/dist/preview-1695807370382.js +7 -0
- package/package.json +24 -23
- package/tsconfig.json +40 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
- package/.bit-capsule-ready +0 -0
- package/component-generator.ts +0 -271
- package/component-template.ts +0 -122
- package/create.cmd.ts +0 -88
- package/generator-env-type.ts +0 -14
- package/generator.aspect.ts +0 -5
- package/generator.graphql.ts +0 -62
- package/generator.main.runtime.ts +0 -577
- package/index.ts +0 -14
- package/new.cmd.ts +0 -114
- package/package-tar/teambit-generator-1.0.9.tgz +0 -0
- package/schema.json +0 -10304
- package/starter-list.ts +0 -21
- package/starter.plugin.ts +0 -16
- package/teambit_generator_generator-preview.js +0 -11
- package/template-list.ts +0 -21
- package/templates.cmd.ts +0 -55
- package/types.ts +0 -3
- package/workspace-generator.ts +0 -205
- package/workspace-template.ts +0 -145
package/new.cmd.ts
DELETED
@@ -1,114 +0,0 @@
|
|
1
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
2
|
-
import chalk from 'chalk';
|
3
|
-
import { GeneratorMain } from './generator.main.runtime';
|
4
|
-
import { BaseWorkspaceOptions } from './workspace-template';
|
5
|
-
|
6
|
-
/**
|
7
|
-
* NewOptions combines foundational properties with additional options for creating a workspace.
|
8
|
-
*/
|
9
|
-
export type NewOptions = BaseWorkspaceOptions;
|
10
|
-
|
11
|
-
export class NewCmd implements Command {
|
12
|
-
name = 'new <template-name> <workspace-name>';
|
13
|
-
description = 'create a new workspace from a template';
|
14
|
-
arguments = [
|
15
|
-
{
|
16
|
-
name: 'template-name',
|
17
|
-
description:
|
18
|
-
"the name of the workspace template (run 'bit templates' outside of a workspace to get a list of available workspace templates)",
|
19
|
-
},
|
20
|
-
{
|
21
|
-
name: 'workspace-name',
|
22
|
-
description: 'the name for the new workspace and workspace directory that will be created',
|
23
|
-
},
|
24
|
-
];
|
25
|
-
alias = '';
|
26
|
-
loader = true;
|
27
|
-
group = 'start';
|
28
|
-
options = [
|
29
|
-
[
|
30
|
-
'a',
|
31
|
-
'aspect <aspect-id>',
|
32
|
-
'id of the aspect that registered the template, mandatory for non-core aspects. helpful for core aspects in case of a name collision',
|
33
|
-
],
|
34
|
-
['t', 'template <env-id>', "env-id of the template's owner. Alias for --env."],
|
35
|
-
['', 'env <env-id>', 'env-id of the template. Alias -t'],
|
36
|
-
['d', 'default-scope <scope-name>', `set defaultScope in the new workspace's workspace.jsonc`],
|
37
|
-
['', 'standalone', 'DEPRECATED. use --skip-git instead'],
|
38
|
-
['s', 'skip-git', 'skip generation of Git repository in the new workspace'],
|
39
|
-
[
|
40
|
-
'e',
|
41
|
-
'empty',
|
42
|
-
"skip template's default component creation (relevant for templates that add components by default)",
|
43
|
-
],
|
44
|
-
[
|
45
|
-
'',
|
46
|
-
'load-from <path-to-template>',
|
47
|
-
'local path to the workspace containing the template. Helpful during a development of a workspace-template',
|
48
|
-
],
|
49
|
-
] as CommandOptions;
|
50
|
-
|
51
|
-
constructor(private generator: GeneratorMain) {}
|
52
|
-
|
53
|
-
async report(
|
54
|
-
[templateName, workspaceName]: [string, string],
|
55
|
-
options: NewOptions & {
|
56
|
-
standalone: boolean;
|
57
|
-
env?: string;
|
58
|
-
template?: string;
|
59
|
-
aspect?: string;
|
60
|
-
}
|
61
|
-
) {
|
62
|
-
options.skipGit = options.skipGit ?? options.standalone;
|
63
|
-
options.aspect = options.aspect ?? options.env ?? options.template;
|
64
|
-
const { workspacePath, appName } = await this.generator.generateWorkspaceTemplate(
|
65
|
-
workspaceName,
|
66
|
-
templateName,
|
67
|
-
options
|
68
|
-
);
|
69
|
-
return chalk.white(
|
70
|
-
`${chalk.green(`
|
71
|
-
|
72
|
-
Congrats! A new workspace has been created successfully at '${workspacePath}'`)}
|
73
|
-
|
74
|
-
Inside the directory '${workspaceName}' you can run various commands including:
|
75
|
-
|
76
|
-
${chalk.yellow('bit start')}
|
77
|
-
Starts the local dev server
|
78
|
-
|
79
|
-
${chalk.yellow('bit install')}
|
80
|
-
Installs any missing dependencies
|
81
|
-
|
82
|
-
${chalk.yellow('bit status')}
|
83
|
-
Shows the status of the components
|
84
|
-
|
85
|
-
${chalk.yellow('bit compile')}
|
86
|
-
Compiles the components
|
87
|
-
|
88
|
-
${chalk.yellow('bit test')}
|
89
|
-
Runs the tests on all your components
|
90
|
-
|
91
|
-
${chalk.yellow('bit templates')}
|
92
|
-
Shows all available component templates
|
93
|
-
|
94
|
-
${chalk.yellow('bit help')}
|
95
|
-
Shows all available commands
|
96
|
-
|
97
|
-
|
98
|
-
${chalk.green.bold("Let's get started!")}
|
99
|
-
|
100
|
-
${getBottomSection(workspaceName, appName)}
|
101
|
-
`
|
102
|
-
);
|
103
|
-
}
|
104
|
-
}
|
105
|
-
|
106
|
-
function getBottomSection(workspaceName: string, appName: string | undefined) {
|
107
|
-
const cdLine = chalk.yellow(`cd ${workspaceName}`);
|
108
|
-
const parts = [cdLine];
|
109
|
-
if (appName) {
|
110
|
-
parts.push(chalk.yellow(` bit run ${appName}`));
|
111
|
-
}
|
112
|
-
parts.push(chalk.yellow(` bit start`));
|
113
|
-
return parts.join('\n');
|
114
|
-
}
|
Binary file
|