Skip to content

Commit

Permalink
feat(typescript): add author prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbutt committed Feb 23, 2024
1 parent ea47cc5 commit 6e3db94
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/generators/TypescriptGenerator.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 TypescriptGenerator 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 @@ -80,6 +82,8 @@ 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;

// @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
Expand Down
2 changes: 1 addition & 1 deletion templates/typescript/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) <%- new Date().getFullYear() %> Norgate AV Services Limited
Copyright (c) <%- new Date().getFullYear() %> <%- author %>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion templates/typescript/all-contributorsrc.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projectName": <%- JSON.stringify(id) %>,
"projectOwner": "",
"projectOwner": <%- JSON.stringify(author) %>,
"repoType": "github",
"repoHost": "https://github.com",
"files": [
Expand Down
1 change: 1 addition & 0 deletions templates/typescript/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": <%- JSON.stringify(description) %>,
"version": "0.0.0",
"license": "MIT",
"author": <%- JSON.stringify(author) %>,
"main": "./dist/app.js",
"types": "./dist/app.d.ts",
"type": "module",
Expand Down

0 comments on commit 6e3db94

Please sign in to comment.