Skip to content

Commit

Permalink
feat: Add generate command
Browse files Browse the repository at this point in the history
Generated files for all frameworks are ready now.
  • Loading branch information
wnvko committed Feb 19, 2018
1 parent 20c7210 commit 88c8f82
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 34 deletions.
7 changes: 3 additions & 4 deletions .vscode/launch.json
Expand Up @@ -216,15 +216,14 @@
{
"type": "node",
"request": "launch",
"name": "Launch Generate Template with aliases g t -g",
"name": "Launch Generate Template with aliases g t",
"cwd": "${workspaceRoot}/output",
"program": "${workspaceRoot}/bin/execute.js",
"console": "externalTerminal",
"preLaunchTask": "build",
"args": [
"g",
"t",
"-g"
"t"
],
},
{
Expand All @@ -238,7 +237,7 @@
"args": [
"g",
"t",
"-n=alianato",
"-n=angular",
"-f=angular",
"-t=igx-ts",
"-s=false",
Expand Down
12 changes: 11 additions & 1 deletion lib/commands/generate.ts
Expand Up @@ -79,9 +79,19 @@ const command = {
}

let templatesFolder = path.join(__dirname, "..", "..", "templates", argv.framework, argv.type, "generate");
argv.className = Util.className(argv.name);

Util.log(`Project Name: ${argv.name}, framework ${argv.framework}, type ${argv.type}`);
const promise = Util.processTemplates(templatesFolder, outDir, { "$(name)": argv.name, "$(framework)": argv.framework, "$(type)": argv.type, __name__: argv.name }, null);
const promise = Util.processTemplates(
templatesFolder,
outDir,
{
"$(name)": argv.name,
"$(framework)": argv.framework,
"$(type)": argv.type, __name__: argv.name,
"$(ClassName)": argv.className
},
null);
promise.then((res) => {
if (res) {
if (argv.skipConfig == false) {
Expand Down
9 changes: 7 additions & 2 deletions templates/angular/ig-ts/generate/files/__name__.json
@@ -1,6 +1,11 @@
{
"id": "$(name)",
"name": "$(name)",
"description": "$(name) template",
"framework": "$(framework)",
"projectType": "$(type)",
"components": "<add your components here>"
}
"components": "<add your components here>",
"controlGroup": "<add your control group name here>",
"listInComponentTemplates": true,
"dependencies": "[<list your component dependencies here>]"
}
Binary file not shown.
14 changes: 7 additions & 7 deletions templates/angular/ig-ts/generate/files/index.html
Expand Up @@ -2,13 +2,13 @@
<html>
<head>
<title>$(name)</title>
<!-- TODO: add necessary links to css style files -->

<script type="text/javascript">
// TODO: add necessary script to load your template
</script>
</head>
<body>
<h1>Ignite UI CLI Project: $(name)</h1>
<h2>Ignite UI CLI Framework: $(framework)</h2>
<h2>Ignite UI CLI Type: $(type)</h2>
<h3>Thank you for using the Ignite UI CLI!</h3>
<img src="assets/Ignite-header-apps-960.png" alt="Ignite UI" height="602" width="602" />

<div id="$(name)"></div>
</body>
</html>
</html>
17 changes: 10 additions & 7 deletions templates/angular/igx-ts/generate/files/index.html
@@ -1,14 +1,17 @@
<!DOCTYPE html>
<html>

<head>
<title>$(name)</title>
<title>$(name)</title>
<!-- TODO: add necessary links to css style files -->

<script type="text/javascript">
// TODO: add necessary script to load your template
</script>
</head>
<body>
<h1>Ignite UI CLI Project: $(name)</h1>
<h2>Ignite UI CLI Framework: $(framework)</h2>
<h2>Ignite UI CLI Type: $(type)</h2>
<h3>Thank you for using the Ignite UI CLI!</h3>
<img src="assets/Ignite-header-apps-960.png" alt="Ignite UI" height="602" width="602" />

<body>
<div id="$(name)"></div>
</body>

</html>
6 changes: 2 additions & 4 deletions templates/jquery/js/generate/files/index.html
@@ -1,10 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<title>$(description)</title>

$(cssBlock)
$(scriptBlock)
<title>$(name)</title>
<!-- TODO: add necessary links to css style files -->

<script type="text/javascript">
// TODO: add necessary script to load your template
Expand Down
9 changes: 7 additions & 2 deletions templates/react/es6/generate/files/__name__.json
@@ -1,6 +1,11 @@
{
"id": "$(name)",
"name": "$(name)",
"description": "$(name) template",
"framework": "$(framework)",
"projectType": "$(type)",
"components": "<add your components here>"
}
"components": "<add your components here>",
"controlGroup": "<add your control group name here>",
"listInComponentTemplates": true,
"dependencies": "[<list your component dependencies here>]"
}
Binary file not shown.
14 changes: 7 additions & 7 deletions templates/react/es6/generate/files/index.html
Expand Up @@ -2,13 +2,13 @@
<html>
<head>
<title>$(name)</title>
<!-- TODO: add necessary links to css style files -->

<script type="text/javascript">
// TODO: add necessary script to load your template
</script>
</head>
<body>
<h1>Ignite UI CLI Project: $(name)</h1>
<h2>Ignite UI CLI Framework: $(framework)</h2>
<h2>Ignite UI CLI Type: $(type)</h2>
<h3>Thank you for using the Ignite UI CLI!</h3>
<img src="assets/Ignite-header-apps-960.png" alt="Ignite UI" height="602" width="602" />

<div id="$(name)"></div>
</body>
</html>
</html>

0 comments on commit 88c8f82

Please sign in to comment.