Skip to content

Commit

Permalink
feat: add author prompt to remaining generators
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbutt committed Feb 24, 2024
1 parent 212083f commit 53501b7
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 18 deletions.
11 changes: 8 additions & 3 deletions src/generators/ClangGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import {
} from "../@types/index.js";
import AppGenerator from "../app.js";
import {
ProjectName,
ProjectId,
ProjectDescription,
Author,
Git,
PackageManager,
ProjectDescription,
ProjectId,
ProjectName,
} from "../questions/index.js";
import { ConfigHelper } from "../helpers/index.js";
import { NodeEnvironment } from "../environments/index.js";
Expand All @@ -39,6 +40,7 @@ export class ClangGenerator implements GeneratorInterface {
new ProjectName(this.generator).getQuestion(),
new ProjectId(this.generator).getQuestion(),
new ProjectDescription(this.generator).getQuestion(),
new Author(this.generator).getQuestion(),
new Git(this.generator).getQuestion(),
new PackageManager(this.generator).getQuestion(),
);
Expand Down Expand Up @@ -81,6 +83,9 @@ export class ClangGenerator implements GeneratorInterface {
this.generator.options.id = this.generator.options.id || answers.id;
this.generator.options.pkg = this.generator.options.pkg || answers.pkg;

this.generator.options.author =
this.generator.options.author || answers.author;

// @ts-expect-error This is necessary as the env 'options' property doesn't seem to be correctly typed on the Environment.
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
this.generator.env.options.nodePackageManager =
Expand Down
11 changes: 8 additions & 3 deletions src/generators/CrestronSimplGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import {
} from "../@types/index.js";
import AppGenerator from "../app.js";
import {
ProjectName,
ProjectId,
ProjectDescription,
Author,
Git,
PackageManager,
ProjectDescription,
ProjectId,
ProjectName,
} from "../questions/index.js";
import { ConfigHelper } from "../helpers/index.js";
import { NodeEnvironment } from "../environments/index.js";
Expand All @@ -40,6 +41,7 @@ export class CrestronSimplGenerator implements GeneratorInterface {
new ProjectName(this.generator).getQuestion(),
new ProjectId(this.generator).getQuestion(),
new ProjectDescription(this.generator).getQuestion(),
new Author(this.generator).getQuestion(),
new Git(this.generator).getQuestion(),
new PackageManager(this.generator).getQuestion(),
);
Expand Down Expand Up @@ -82,6 +84,9 @@ export class CrestronSimplGenerator implements GeneratorInterface {
this.generator.options.id = this.generator.options.id || answers.id;
this.generator.options.pkg = this.generator.options.pkg || answers.pkg;

this.generator.options.author =
this.generator.options.author || answers.author;

// @ts-expect-error This is necessary as the env 'options' property doesn't seem to be correctly typed on the Environment.
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
this.generator.env.options.nodePackageManager =
Expand Down
11 changes: 8 additions & 3 deletions src/generators/HtmlGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import {
} from "../@types/index.js";
import AppGenerator from "../app.js";
import {
ProjectName,
ProjectId,
ProjectDescription,
Author,
Git,
PackageManager,
ProjectDescription,
ProjectId,
ProjectName,
} from "../questions/index.js";
import { ConfigHelper } from "../helpers/index.js";
import { NodeEnvironment } from "../environments/index.js";
Expand All @@ -39,6 +40,7 @@ export class HtmlGenerator implements GeneratorInterface {
new ProjectName(this.generator).getQuestion(),
new ProjectId(this.generator).getQuestion(),
new ProjectDescription(this.generator).getQuestion(),
new Author(this.generator).getQuestion(),
new Git(this.generator).getQuestion(),
new PackageManager(this.generator).getQuestion(),
);
Expand Down Expand Up @@ -81,6 +83,9 @@ export class HtmlGenerator implements GeneratorInterface {
this.generator.options.id = this.generator.options.id || answers.id;
this.generator.options.pkg = this.generator.options.pkg || answers.pkg;

this.generator.options.author =
this.generator.options.author || answers.author;

// @ts-expect-error This is necessary as the env 'options' property doesn't seem to be correctly typed on the Environment.
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
this.generator.env.options.nodePackageManager =
Expand Down
11 changes: 8 additions & 3 deletions src/generators/JavascriptGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import {
} from "../@types/index.js";
import AppGenerator from "../app.js";
import {
ProjectName,
ProjectId,
ProjectDescription,
Author,
Git,
PackageManager,
ProjectDescription,
ProjectId,
ProjectName,
} from "../questions/index.js";
import { ConfigHelper } from "../helpers/index.js";
import { NodeEnvironment } from "../environments/index.js";
Expand All @@ -39,6 +40,7 @@ export class JavascriptGenerator implements GeneratorInterface {
new ProjectName(this.generator).getQuestion(),
new ProjectId(this.generator).getQuestion(),
new ProjectDescription(this.generator).getQuestion(),
new Author(this.generator).getQuestion(),
new Git(this.generator).getQuestion(),
new PackageManager(this.generator).getQuestion(),
);
Expand Down Expand Up @@ -81,6 +83,9 @@ export class JavascriptGenerator implements GeneratorInterface {
this.generator.options.id = this.generator.options.id || answers.id;
this.generator.options.pkg = this.generator.options.pkg || answers.pkg;

this.generator.options.author =
this.generator.options.author || answers.author;

// @ts-expect-error This is necessary as the env 'options' property doesn't seem to be correctly typed on the Environment.
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
this.generator.env.options.nodePackageManager =
Expand Down
11 changes: 8 additions & 3 deletions src/generators/NodeCliGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import {
} from "../@types/index.js";
import AppGenerator from "../app.js";
import {
ProjectName,
ProjectId,
ProjectDescription,
Author,
Git,
PackageManager,
ProjectDescription,
ProjectId,
ProjectName,
} from "../questions/index.js";
import { ConfigHelper } from "../helpers/index.js";
import { NodeEnvironment } from "../environments/index.js";
Expand All @@ -39,6 +40,7 @@ export class NodeCliGenerator implements GeneratorInterface {
new ProjectName(this.generator).getQuestion(),
new ProjectId(this.generator).getQuestion(),
new ProjectDescription(this.generator).getQuestion(),
new Author(this.generator).getQuestion(),
new Git(this.generator).getQuestion(),
new PackageManager(this.generator).getQuestion(),
);
Expand Down Expand Up @@ -81,6 +83,9 @@ export class NodeCliGenerator implements GeneratorInterface {
this.generator.options.id = this.generator.options.id || answers.id;
this.generator.options.pkg = this.generator.options.pkg || answers.pkg;

this.generator.options.author =
this.generator.options.author || answers.author;

// @ts-expect-error This is necessary as the env 'options' property doesn't seem to be correctly typed on the Environment.
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
this.generator.env.options.nodePackageManager =
Expand Down
11 changes: 8 additions & 3 deletions src/generators/PythonGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import {
} from "../@types/index.js";
import AppGenerator from "../app.js";
import {
ProjectName,
ProjectId,
ProjectDescription,
Author,
Git,
ProjectDescription,
ProjectId,
ProjectName,
} from "../questions/index.js";
import { ConfigHelper } from "../helpers/index.js";

Expand All @@ -36,6 +37,7 @@ export class PythonGenerator implements GeneratorInterface {
new ProjectName(this.generator).getQuestion(),
new ProjectId(this.generator).getQuestion(),
new ProjectDescription(this.generator).getQuestion(),
new Author(this.generator).getQuestion(),
new Git(this.generator).getQuestion(),
);
}
Expand Down Expand Up @@ -76,6 +78,9 @@ export class PythonGenerator implements GeneratorInterface {

this.generator.options.id = this.generator.options.id || answers.id;

this.generator.options.author =
this.generator.options.author || answers.author;

this.generator.options.description = this.generator.options.skipPrompts
? this.generator.options.description
: answers.description;
Expand Down
1 change: 1 addition & 0 deletions src/generators/TypescriptGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class TypescriptGenerator implements GeneratorInterface {

this.generator.options.id = this.generator.options.id || answers.id;
this.generator.options.pkg = this.generator.options.pkg || answers.pkg;

this.generator.options.author =
this.generator.options.author || answers.author;

Expand Down

0 comments on commit 53501b7

Please sign in to comment.