Skip to content

Commit ad333f9

Browse files
committed
Merge branch 'development'
2 parents 8de9e79 + 7f7b38c commit ad333f9

File tree

8 files changed

+36
-50
lines changed

8 files changed

+36
-50
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: npm publish
22

33
on:
4-
push:
5-
branches:
6-
- master
4+
release:
5+
types:
6+
- created
77

88
jobs:
99
build:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,6 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
# Package-lock json file
107+
package-lock.json

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,5 @@ $ cd "project name" && npm run start
119119
## Contributors
120120

121121
* Jeongwon Kim [https://github.com/swtpumpkin](https://github.com/swtpumpkin)
122+
123+
* Lloyd Park [https://github.com/yeondam88](https://github.com/yeondam88)

typescript-express-starter/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Choose the template you want. We will create more templates later.
4141
### 2. Select a templates
4242

4343
```bash
44-
? Select a templates (Use arraw keys)
44+
? Select a templates (Use arrow keys)
4545
> default
4646
mongoose
4747
--------------------
@@ -119,3 +119,5 @@ $ cd "project name" && npm run start
119119
## Contributors
120120

121121
* Jeongwon Kim [https://github.com/swtpumpkin](https://github.com/swtpumpkin)
122+
123+
* Lloyd Park [https://github.com/yeondam88](https://github.com/yeondam88)

typescript-express-starter/bin/cli.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ const path = require('path');
99
const tsExpressStarter = require('../lib/typescript-express-starter');
1010
const destination = getDest(process.argv[2]);
1111

12-
console.log('Setting up new TypeScript-Express-Starter Project');
13-
14-
tsExpressStarter(destination).then(() => {
15-
console.log('Project setup complete!');
16-
});
17-
1812
function getDest(destFolder) {
1913
destFolder = destFolder || 'typescript-express-starter';
2014
return path.join(process.cwd(), destFolder);
2115
};
16+
17+
tsExpressStarter(destination);

typescript-express-starter/lib/cli.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

typescript-express-starter/lib/typescript-express-starter.js

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
const path = require('path');
77
const fs = require('fs');
8+
const log = require('signale');
89
const editJsonFile = require('edit-json-file');
910
const childProcess = require('child_process');
1011
const inquirer = require('inquirer');
@@ -17,25 +18,12 @@ async function tsExpressStarter(destination) {
1718
updatePackageJson(destination);
1819
const dep = getDepStrings(directory);
1920
downloadNodeModules(destination, dep);
21+
log.success('Project setup complete!');
2022
} catch (err) {
21-
console.error(err);
23+
log.error(err);
2224
}
2325
};
2426

25-
function getDirectorys() {
26-
let directorys = [];
27-
28-
fs.readdirSync(__dirname, { withFileTypes: true })
29-
.forEach(p => {
30-
const dir = p.name;
31-
if (p.isDirectory()) {
32-
directorys.push(dir);
33-
}
34-
});
35-
36-
return directorys;
37-
};
38-
3927
async function fetchDirectory() {
4028
const directorys = getDirectorys();
4129
const directoryChoices = [...directorys, new inquirer.Separator()];
@@ -48,9 +36,24 @@ async function fetchDirectory() {
4836
}
4937
]);
5038

39+
log.start('Setting up new TypeScript-Express-Starter Project');
5140
return selectedTemplates;
5241
};
5342

43+
function getDirectorys() {
44+
let directorys = [];
45+
46+
fs.readdirSync(__dirname, { withFileTypes: true })
47+
.forEach(p => {
48+
const dir = p.name;
49+
if (p.isDirectory()) {
50+
directorys.push(dir);
51+
}
52+
});
53+
54+
return directorys;
55+
};
56+
5457
function copyProjectFiles(destination, directory) {
5558
const prjFolder = `./${directory}`;
5659
const source = path.join(__dirname, prjFolder);

typescript-express-starter/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "typescript-express-starter",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"description": "Quick and easy TypeScript Express Starter package",
55
"author": "AGUMON [email protected]",
66
"license": "MIT",
7-
"main": "lib/cli.js",
7+
"main": "bin/cli.js",
88
"keywords": [
99
"typescript",
1010
"express",
@@ -22,9 +22,10 @@
2222
},
2323
"dependencies": {
2424
"edit-json-file": "^1.3.2",
25-
"recursive-readdir": "^2.2.2",
2625
"inquirer": "^6.2.2",
27-
"ncp": "^2.0.0"
26+
"ncp": "^2.0.0",
27+
"recursive-readdir": "^2.2.2",
28+
"signale": "^1.4.0"
2829
},
2930
"repository": {
3031
"type": "git",

0 commit comments

Comments
 (0)