Skip to content

Commit 0e3de5f

Browse files
committed
dependency update and sms server added
1 parent 0e9e5d6 commit 0e3de5f

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

docs/OUTDATED.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ Open Template Hub - Server Generator v4
1313

1414
Following packages are not updated in the develop branch yet. So, if you want to update outdated packages on your own risk, update the package.json and install dependencies.
1515

16-
| Package | Current | Wanted | Latest | Location |
17-
| --- | --- | --- | --- | --- |
18-
| @types/node | 16.11.21 | 16.11.21 | 17.0.10 | @open-template-hub/server-generator |
1916

2017
<table align="right"><tr><td><a href="https://opentemplatehub.com"><img src="https://raw.githubusercontent.com/open-template-hub/open-template-hub.github.io/master/assets/logo/brand-logo.png" width="50px" alt="oth"/></a></td><td><b>Open Template Hub © 2021</b></td></tr></table>
2118

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
"inquirer": "^8.2.0",
2121
"ncp": "^2.0.0",
2222
"rimraf": "^3.0.2",
23-
"shelljs": "^0.8.2",
24-
"yargs": "^17.3.0"
23+
"shelljs": "^0.8.5",
24+
"yargs": "^17.3.1"
2525
},
2626
"devDependencies": {
27-
"@types/inquirer": "^8.1.3",
28-
"@types/node": "^16.11.12",
29-
"@types/shelljs": "^0.8.9",
30-
"@types/yargs": "^17.0.4",
27+
"@types/inquirer": "^8.2.0",
28+
"@types/node": "^17.0.13",
29+
"@types/shelljs": "^0.8.11",
30+
"@types/yargs": "^17.0.8",
3131
"ts-node": "^10.3.0",
32-
"typescript": "^4.5.3"
32+
"typescript": "^4.5.5"
3333
},
3434
"git repository": "https://github.com/open-template-hub/open-template-hub-server-generator",
3535
"repository": {

src/constant.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const TemplateType = {
55
FileStorageServer: '4',
66
AnalyticsServer: '5',
77
MailServer: '6',
8+
SmsServer: '7'
89
};
910

1011
export const TEMPLATE_HUB_URL = 'https://github.com/open-template-hub';
@@ -18,6 +19,7 @@ export const ProjectName = {
1819
FileStorageServer: 'file-storage-server-template',
1920
AnalyticsServer: 'analytics-server-template',
2021
MailServer: 'mail-server-template',
22+
SmsServer: 'sms-server-template',
2123
};
2224

2325
export const PackageName = {
@@ -27,4 +29,5 @@ export const PackageName = {
2729
FileStorageServer: 'file-storage-server-template',
2830
AnalyticsServer: 'analytics-server-template',
2931
MailServer: 'mail-server-template',
32+
SmsServer: 'sms-server-template',
3033
};

src/index.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ const QUESTIONS = [
2828
' 4) File Storage Server \n' +
2929
' 5) Analytics Server \n' +
3030
' 6) Mail Server \n' +
31+
' 7) Sms Server \n' +
3132
' Please enter a server type you want to generate: ',
3233
when: () => yargs().argv,
3334
validate: (input: string) => {
34-
if (/^[1 | 2 | 3 | 4 | 5 | 6]$/.test(input)) return true;
35+
if (/^[1 | 2 | 3 | 4 | 5 | 6 | 7]$/.test(input)) return true;
3536
else
36-
return 'Please enter correct server type. Server type can be 1, 2, 3, 4, 5 and 6.';
37+
return 'Please enter correct server type. Server type can be 1, 2, 3, 4, 5, 6 and 7.';
3738
},
3839
},
3940
{
@@ -142,6 +143,10 @@ const updateProjectName = (
142143
repoConfig.projectName = ProjectName.MailServer;
143144
repoConfig.packageName = PackageName.MailServer;
144145
break;
146+
case TemplateType.SmsServer:
147+
repoConfig.projectName = ProjectName.SmsServer;
148+
repoConfig.packageName = PackageName.SmsServer;
149+
break;
145150
}
146151

147152
let oldPath = path.join(targetPath, repoConfig.projectName);
@@ -231,6 +236,15 @@ const cloneTemplate = (targetPath: string, templateType: string) => {
231236
'/' +
232237
ProjectName.MailServer;
233238
break;
239+
case TemplateType.SmsServer:
240+
cmd =
241+
clone +
242+
BRANCH_NAME +
243+
' ' +
244+
TEMPLATE_HUB_URL +
245+
'/' +
246+
ProjectName.SmsServer;
247+
break;
234248
}
235249
console.log('command: ', cmd);
236250
const result = shell.exec(cmd);

0 commit comments

Comments
 (0)