Skip to content

Commit 8f0dd84

Browse files
committed
[Release] v1.0.20210329
1 parent 6284eb8 commit 8f0dd84

16 files changed

Lines changed: 279 additions & 82 deletions

.eslintrc.json renamed to .eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
module.exports = {
22
"env": {
33
"es6": true,
44
"node": true,

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# v1.0.20210327 (March 27, 2021)
1+
# v1.0.20210329 (March 29, 2021)
22

33
- First release
44

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 🚀 node-cli-boilerplate
22

33
<!-- all-shields/header-badges:START -->
4-
[![v1.0.20210326](https://img.shields.io/badge/version-v1.0.20210326-lightgray.svg?style=flat&logo=)](https://github.com/ptkdev-boilerplate/node-cli-boilerplate/blob/main/CHANGELOG.md) [![](https://img.shields.io/npm/v/@ptkdev-boilerplate/node-cli-boilerplate?color=CC3534&logo=npm)](https://www.npmjs.com/package/@ptkdev-boilerplate/node-cli-boilerplate) [![License: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat&logo=license)](https://github.com/ptkdev-boilerplate/node-cli-boilerplate/blob/main/LICENSE.md) [![Language: TypeScript](https://img.shields.io/badge/language-typescript-blue.svg?style=flat&logo=typescript)](https://www.typescriptlang.org/) [![ECMAScript: 2019](https://img.shields.io/badge/ES-9-F7DF1E.svg?style=flat&logo=javascript)](https://github.com/tc39/ecma262) [![Discord Server](https://discordapp.com/api/guilds/383373985666301975/embed.png)](https://discord.ptkdev.io)
4+
[![v1.0.20210329](https://img.shields.io/badge/version-v1.0.20210329-lightgray.svg?style=flat&logo=)](https://github.com/ptkdev-boilerplate/node-cli-boilerplate/blob/main/CHANGELOG.md) [![](https://img.shields.io/npm/v/@ptkdev-boilerplate/node-cli-boilerplate?color=CC3534&logo=npm)](https://www.npmjs.com/package/@ptkdev-boilerplate/node-cli-boilerplate) [![License: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat&logo=license)](https://github.com/ptkdev-boilerplate/node-cli-boilerplate/blob/main/LICENSE.md) [![Language: TypeScript](https://img.shields.io/badge/language-typescript-blue.svg?style=flat&logo=typescript)](https://www.typescriptlang.org/) [![ECMAScript: 2019](https://img.shields.io/badge/ES-9-F7DF1E.svg?style=flat&logo=javascript)](https://github.com/tc39/ecma262) [![Discord Server](https://discordapp.com/api/guilds/383373985666301975/embed.png)](https://discord.ptkdev.io)
55
<!-- all-shields/header-badges:END -->
66

77
Create your node module (library) with this friendly boilerplate.

app/cli/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
* @license: MIT License
1010
*
1111
*/
12-
import m from "./module";
12+
import m from "../functions/module";
1313

1414
(async () => {
1515
const { app } = await m({ text: "hello-world" });
1616

17-
await console.log(app());
17+
console.log(app());
1818
})();

app/cli/module.d.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,18 @@
88
* @license: MIT License
99
*
1010
*/
11-
import "./module.d";
11+
import type { ModuleInterface, ModuleResponseInterface } from "../types/module.type";
1212

13+
/**
14+
* Hello World
15+
* =====================
16+
* Print hello-world
17+
*
18+
* @param {string} text - input string
19+
*
20+
* @return {Promise<ModuleResponseInterface>} fn - output string (async), run app()
21+
22+
*/
1323
export default async ({ text }: ModuleInterface): Promise<ModuleResponseInterface> => {
1424
const app = () => text;
1525

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @license: MIT License
88
*
99
*/
10-
import m from "./module";
10+
import m from "../functions/module";
1111

1212
test("show hello world", async () => {
1313
const { app } = await m({ text: "hello-world" });

app/types/global.d.ts

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

app/types/module.type.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Interfaces
3+
* =====================
4+
*
5+
* @contributors: Patryk Rzucidło [@ptkdev] <support@ptkdev.io> (https://ptk.dev)
6+
*
7+
* @license: MIT License
8+
*
9+
*/
10+
11+
export interface ModuleInterface {
12+
/**
13+
*
14+
* @param { String } text - input text
15+
*
16+
*/
17+
text: string
18+
}
19+
20+
21+
export interface ModuleResponseInterface {
22+
/**
23+
*
24+
* @return {fn} string - run app() for output text
25+
*
26+
*/
27+
app(): string
28+
}

jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
module.exports = {
22
preset: "ts-jest",
33
testEnvironment: "node",
4+
globals: {
5+
"ts-jest": {
6+
"tsconfig": "jest.tsconfig.json"
7+
}
8+
},
49
};

0 commit comments

Comments
 (0)