-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d2ba09
commit f6a920b
Showing
9 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
charset = utf-8 | ||
root = true | ||
|
||
[**/*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_style = space | ||
|
||
[**/*] | ||
indent_size = 4 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
src/ | ||
.editorconfig | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const gulp = require("gulp"); | ||
const typescript = require("gulp-typescript"); | ||
|
||
gulp.task("build", function () { | ||
const ts_project = typescript.createProject("tsconfig.json"); | ||
|
||
return gulp.src("src/**/*.ts") | ||
.pipe(ts_project()) | ||
.pipe(gulp.dest("dist/")); | ||
}); | ||
|
||
gulp.task("default", ["build"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "well-done", | ||
"version": "1.0.0", | ||
"description": "Generate random congratulations", | ||
"author": "George Thomas", | ||
"license": "MIT", | ||
"homepage": "https://github.com/mgthomas99/well-done#readme", | ||
"main": "dist/index.js", | ||
"devDependencies": { | ||
"gulp": "^3.9.1", | ||
"gulp-typescript": "^4.0.2", | ||
"npm-run-all": "^4.1.2", | ||
"typescript": "^2.8.1" | ||
}, | ||
"dependencies": { | ||
"random-item": "^1.0.0" | ||
}, | ||
"scripts": { | ||
"build": "gulp build", | ||
"clean:dist": "rimraf \"dist/\"", | ||
"clean": "npm-run-all -s \"clean:dist\"", | ||
"test": "echo \"Error: no test specified\"", | ||
"prepublish": "npm-run-all -s \"clean\" \"build\" \"test\"" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/mgthomas99/well-done.git" | ||
}, | ||
"keywords": [ | ||
"good", | ||
"random", | ||
"string" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/mgthomas99/well-done/issues" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { wellDone } from "./well-done"; | ||
|
||
export * from "./well-done"; | ||
export default wellDone; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import * as randomItem from "random-item"; | ||
|
||
/** | ||
* An array of strings whose content is a common congratulation. Each string | ||
* begins with a capital letter followed by all other characters being | ||
* lower-case (sentence case). Some strings contain punctuation, but none of | ||
* them end with conclusive punctuation (i.e., none of the strings end with a | ||
* full-stop). | ||
*/ | ||
export const CONGRATULATIONS = [ | ||
"Beautiful", | ||
"Congratulations", | ||
"Excellent", | ||
"Good going", | ||
"Good job", | ||
"Good work", | ||
"Great", | ||
"Keep it up", | ||
"Muy bien", | ||
"Neat", | ||
"Nice going", | ||
"Outstanding", | ||
"Right on", | ||
"Super", | ||
"Terrific", | ||
"That's it", | ||
"Way to go", | ||
"Well done", | ||
"You've got it" | ||
]; | ||
|
||
/** | ||
* Returns a random congratulation from the `CONGRATULATIONS` array. | ||
* | ||
* @return {string} | ||
* A random congratulative string. | ||
*/ | ||
export function wellDone(): string { | ||
return randomItem(CONGRATULATIONS); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"moduleResolution": "node", | ||
"module": "commonjs", | ||
"target": "es2015", | ||
|
||
"declaration": true | ||
} | ||
} |