Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
build(build): add all the things
Browse files Browse the repository at this point in the history
add semantic-release, add commitizen, add cz-conventional-changelog, add babel-register
babel-polyfill

BREAKING CHANGE: closes #35

#35
  • Loading branch information
spences10 committed Apr 10, 2017
1 parent e31d4a8 commit c63eafa
Show file tree
Hide file tree
Showing 6 changed files with 755 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ node_js:
- '4'
before_script:
- npm prune
script:
- npm run test
after_success:
- npm run semantic-release
branches:
Expand Down
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require('babel-register')
require('babel-polyfill')
require('./src/bot')
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@
"main": "index.js",
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.24.1",
"commitizen": "^2.9.6",
"cz-conventional-changelog": "^2.0.0",
"nodemon": "^1.11.0",
"semantic-release": "^6.3.2"
},
"scripts": {
"start": "node src/index.js",
"start": "nodemon index.js",
"test": "standard && node index.js",
"snyk-protect": "snyk protect",
"prepublish": "npm run snyk-protect",
"dev": "nodemon --exec babel-node src/index.js",
"build": "babel src --out-dir dist",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"commit": "git-cz"
},
"author": "",
"author": "Scott Spence <spences10apps@gmail.com> (https://spences10.github.io/)",
"license": "MIT",
"dependencies": {
"dotenv": "^4.0.0",
Expand All @@ -31,5 +36,8 @@
"repository": {
"type": "git",
"url": "https://github.com/spences10/twitter-bot-bootstrap.git"
},
"czConfig":{
"path": "node_modules/cz-conventional-changelog"
}
}
3 changes: 2 additions & 1 deletion src/bot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Twit from 'twit'
import config from './config'
import { getFunName } from './helpers/helpers'

let Twitter = new Twit(config.twitter)

Expand All @@ -12,4 +13,4 @@ export const tweetNow = (text) => {
})
}

tweetNow('hello')
tweetNow(getFunName())
11 changes: 11 additions & 0 deletions src/helpers/helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export function rando(arr) {
return arr[Math.floor(Math.random() * arr.length)];
}

export function getFunName() {
const adjectives = ['adorable', 'beautiful', 'clean', 'drab', 'elegant', 'fancy', 'glamorous', 'handsome', 'long', 'magnificent', 'old-fashioned', 'plain', 'quaint', 'sparkling', 'ugliest', 'unsightly', 'angry', 'bewildered', 'clumsy', 'defeated', 'embarrassed', 'fierce', 'grumpy', 'helpless', 'itchy', 'jealous', 'lazy', 'mysterious', 'nervous', 'obnoxious', 'panicky', 'repulsive', 'scary', 'thoughtless', 'uptight', 'worried'];

const nouns = ['women', 'men', 'children', 'teeth', 'feet', 'people', 'leaves', 'mice', 'geese', 'halves', 'knives', 'wives', 'lives', 'elves', 'loaves', 'potatoes', 'tomatoes', 'cacti', 'foci', 'fungi', 'nuclei', 'syllabuses', 'analyses', 'diagnoses', 'oases', 'theses', 'crises', 'phenomena', 'criteria', 'data'];

return `${rando(adjectives)}-${rando(adjectives)}-${rando(nouns)}`;
}
Loading

0 comments on commit c63eafa

Please sign in to comment.