Skip to content

Commit

Permalink
fix: remove "-" from generator configs
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbutt committed Feb 8, 2024
1 parent 75120c5 commit 9115b41
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 25 deletions.
14 changes: 7 additions & 7 deletions config/default.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"generators": {
"template-c": {
"c": {
"signature": {
"name": "C",
"id": "template-c",
Expand Down Expand Up @@ -69,7 +69,7 @@
}
]
},
"template-ts": {
"ts": {
"signature": {
"name": "Node.js (TypeScript)",
"id": "template-ts",
Expand Down Expand Up @@ -171,7 +171,7 @@
}
]
},
"template-js": {
"js": {
"signature": {
"name": "Node.js (Javascript)",
"id": "template-js",
Expand Down Expand Up @@ -237,7 +237,7 @@
}
]
},
"template-node-cli": {
"nodecli": {
"signature": {
"name": "Node.js (CLI)",
"id": "template-node-cli",
Expand Down Expand Up @@ -303,7 +303,7 @@
}
]
},
"template-py": {
"py": {
"signature": {
"name": "Python",
"id": "template-py",
Expand Down Expand Up @@ -339,7 +339,7 @@
}
]
},
"template-html": {
"html": {
"signature": {
"name": "HTML, CSS & JS",
"id": "template-html",
Expand Down Expand Up @@ -408,7 +408,7 @@
}
]
},
"template-simpl": {
"simpl": {
"signature": {
"name": "Crestron SIMPL",
"id": "template-simpl",
Expand Down
4 changes: 1 addition & 3 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import path from "node:path";
import Generator from "yeoman-generator";
import chalk from "chalk";
import yosay from "yosay";

process.env["SUPPRESS_NO_CONFIG_WARNING"] = "y";
import config from "config";

import {
Answers,
AppOptions,
Expand All @@ -18,6 +15,7 @@ import { CliHelper, CodeHelper, GitHelper } from "./helpers/index.js";
import { ProjectType } from "./questions/index.js";
import appConfig from "../config/default.json";

process.env["SUPPRESS_NO_CONFIG_WARNING"] = "y";
config.util.setModuleDefaults("config", appConfig);

class AppGenerator extends Generator<AppOptions> {
Expand Down
4 changes: 1 addition & 3 deletions src/generators/ClangGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export class ClangGenerator implements GeneratorInterface {
}

public static getSignature(): GeneratorSignature {
return config.get<GeneratorSignature>(
"config.generators.template-c.signature",
);
return config.get<GeneratorSignature>("config.generators.c.signature");
}

public getSourceRoot(): string {
Expand Down
2 changes: 1 addition & 1 deletion src/generators/CrestronSimplGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class CrestronSimplGenerator implements GeneratorInterface {

public static getSignature(): GeneratorSignature {
return config.get<GeneratorSignature>(
"config.generators.template-simpl.signature",
"config.generators.simpl.signature",
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/generators/HtmlGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class HtmlGenerator implements GeneratorInterface {

public static getSignature(): GeneratorSignature {
return config.get<GeneratorSignature>(
"config.generators.template-html.signature",
"config.generators.html.signature",
);
}

Expand Down
4 changes: 1 addition & 3 deletions src/generators/JavascriptGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export class JavascriptGenerator implements GeneratorInterface {
}

public static getSignature(): GeneratorSignature {
return config.get<GeneratorSignature>(
"config.generators.template-js.signature",
);
return config.get<GeneratorSignature>("config.generators.js.signature");
}

public getSourceRoot(): string {
Expand Down
2 changes: 1 addition & 1 deletion src/generators/NodeCliGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class NodeCliGenerator implements GeneratorInterface {

public static getSignature(): GeneratorSignature {
return config.get<GeneratorSignature>(
"config.generators.template-node-cli.signature",
"config.generators.nodecli.signature",
);
}

Expand Down
4 changes: 1 addition & 3 deletions src/generators/PythonGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export class PythonGenerator implements GeneratorInterface {
}

public static getSignature(): GeneratorSignature {
return config.get<GeneratorSignature>(
"config.generators.template-py.signature",
);
return config.get<GeneratorSignature>("config.generators.py.signature");
}

public getSourceRoot(): string {
Expand Down
4 changes: 1 addition & 3 deletions src/generators/TypescriptGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export class TypescriptGenerator implements GeneratorInterface {
}

public static getSignature(): GeneratorSignature {
return config.get<GeneratorSignature>(
"config.generators.template-ts.signature",
);
return config.get<GeneratorSignature>("config.generators.ts.signature");
}

public getSourceRoot(): string {
Expand Down

0 comments on commit 9115b41

Please sign in to comment.