Skip to content

Commit

Permalink
Merge pull request #27 from jh3y/develop
Browse files Browse the repository at this point in the history
Rework v5.0.0
  • Loading branch information
jh3y committed Aug 7, 2017
2 parents 8d7a894 + 32be610 commit 1fff080
Show file tree
Hide file tree
Showing 26 changed files with 11,784 additions and 698 deletions.
4 changes: 3 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"presets": [
"es2015"
"es2015",
"stage-2",
"flow"
]
}
97 changes: 20 additions & 77 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,85 +1,28 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true
},
"parserOptions": {
"sourceType": "script",
},
"plugins": [
"prettier"
],
"rules": {
# Possible errors
comma-dangle: 2,
no-console: 2,
no-cond-assign: 2,
no-control-regex: 2,
no-debugger: 2,
no-dupe-args: 2,
no-dupe-keys: 2,
no-duplicate-case: 2,
no-empty: 2,
no-empty-character-class: 2,
no-ex-assign: 2,
no-extra-boolean-cast: 2,
no-extra-semi: 2,
no-func-assign: 2,
no-invalid-regexp: 2,
no-irregular-whitespace: 2,
no-negated-in-lhs: 2,
no-obj-calls: 2,
no-proto: 2,
no-unexpected-multiline: 2,
no-unreachable: 2,
use-isnan: 2,
valid-typeof: 2,
valid-jsdoc: 2,
# Best practices
curly: [2, "multi"],
eqeqeq: 2,
no-fallthrough: 2,
no-param-reassign: 2,
no-octal: 2,
no-redeclare: 2,
# strict mode
strict: [2, "global"],
# variables
no-delete-var: 2,
no-undef: 2,
no-unused-vars: 2,
# node
no-mixed-requires: 2,
no-new-require: 2,
# stylistic
brace-style: 2,
camelcase: 2,
comma-style: 2,
comma-spacing: 2,
eol-last: 2,
indent: [2, 2, {SwitchCase: 1}],
keyword-spacing: 2,
max-len: [2, 80, 2],
max-depth: [2, 4],
new-cap: 2,
new-parens: 2,
no-mixed-spaces-and-tabs: 2,
no-multiple-empty-lines: [2, {max: 2}],
no-trailing-spaces: 2,
quotes: [2, "single"],
semi: 2,
space-before-blocks: [2, "always"],
space-before-function-paren: [2, "never"],
space-in-parens: [2, "never"],
space-infix-ops: 2,
space-unary-ops: 2,
# es6
arrow-parens: [2, "always"],
arrow-spacing: [2, {"before": true, "after": true}],
constructor-super: 2,
no-class-assign: 2,
no-confusing-arrow: 2,
no-const-assign: 2,
no-dupe-class-members: 2,
no-this-before-super: 2,
no-var: 2,
prefer-const: 2,
prefer-rest-params: 2,
template-curly-spacing: 2
}
"prettier/prettier": ["error", {
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"parser": "flow"
}],
"no-console": 2,
},
"extends": [
"prettier",
"prettier/flowtype"
]
}
9 changes: 9 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[ignore]

[include]

[libs]

[lints]

[options]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
public
.deploy
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js
node_js:
- "6"
sudo: false
install:
- yarn
script:
- yarn run flow
- make lint-scripts
9 changes: 9 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Issue summary

### Expected behavior

### Actual behavior

### Browser used

### Steps to reproduce
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
doormat - http://jh3y.github.io/doormat
Licensed under the MIT license

jh3y (c) 2016
jh3y (c) 2017

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,35 @@ CLEANCSS = $(MODULES)/cleancss
PUG = $(MODULES)/pug
GHPAGES = $(MODULES)/gh-pages
BS = $(MODULES)/browser-sync
PRETTIER = $(MODULES)/prettier

FILE_NAME = doormat
OUTPUT_DIR = public
DIST_DIR = dist
SCRIPT_SRC = src/js/$(FILE_NAME).js
SCRIPT_SRC = src/js
SCRIPT_DEST = $(OUTPUT_DIR)/js
STYLE_SRC = src/stylus
STYLE_DEST = $(OUTPUT_DIR)/css
MARKUP_SRC = src/pug
MARKUP_DEST = $(OUTPUT_DIR)
DEPLOY_DEST = .deploy/



UGLIFY_OPTS = --compress --comments --mangle -o $(DIST_DIR)/$(FILE_NAME).min.js $(DIST_DIR)/$(FILE_NAME).js
UGLIFY_OPTS = $(DIST_DIR)/$(FILE_NAME).js --compress --mangle --comments -o $(DIST_DIR)/$(FILE_NAME).min.js
CLEANCSS_OPTS = --s1 -o $(DIST_DIR)/$(FILE_NAME).min.css $(DIST_DIR)/$(FILE_NAME).css
POSTCSS_OPTS = --use autoprefixer -d $(STYLE_DEST)/ $(STYLE_DEST)/*.css
PRETTIER_OPTS = --trailing-comma all --single-quote --no-semi --write

help:
@grep -E '^[a-zA-Z\._-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

compile-scripts: ## compiles scripts
$(BABEL) $(SCRIPT_SRC) -o $(SCRIPT_DEST)/$(FILE_NAME).js
$(BABEL) $(SCRIPT_SRC) --out-dir $(SCRIPT_DEST)

lint-scripts: ## lints JS files
$(ESLINT) $(SCRIPT_SRC)/$(FILE_NAME).js

watch-scripts: compile-scripts ## watch for script changes and compile
$(BABEL) $(SCRIPT_SRC) --watch -o $(SCRIPT_DEST)/$(FILE_NAME).js --source-maps
$(BABEL) $(SCRIPT_SRC) --watch --out-dir $(SCRIPT_DEST) --source-maps

publish-scripts: compile-scripts ## publish scripts to dist
mkdir -pv $(DIST_DIR) && cp $(SCRIPT_DEST)/$(FILE_NAME).js $(DIST_DIR)/$(FILE_NAME).js && $(UGLIFY) $(UGLIFY_OPTS)
Expand Down Expand Up @@ -75,5 +79,8 @@ develop: ## run development task
publish: ## publish files
mkdir -pv $(DIST_DIR) && make publish-scripts && make publish-styles

deploy:
rm -rf $(OUTPUT_DIR) && mkdir $(OUTPUT_DIR) $(SCRIPT_DEST) $(STYLE_DEST) && make compile-scripts && make compile-styles && make publish-markup && $(GHPAGES) -d $(OUTPUT_DIR) && make run publish
prettify: ## prettify scripts
$(PRETTIER) $(PRETTIER_OPTS) $(SCRIPT_SRC)/*

deploy: ## deploys demo to github-pages
rm -rf $(DEPLOY_DEST) && mkdir -pv $(DEPLOY_DEST) $(DEPLOY_DEST)/js $(DEPLOY_DEST)/css && make publish-markup && make publish && cp $(MARKUP_DEST)/index.html $(DEPLOY_DEST)/index.html && cp $(DIST_DIR)/doormat.min.js $(DEPLOY_DEST)/js/doormat.js && cp $(DIST_DIR)/doormat.min.css $(DEPLOY_DEST)/css/doormat.css && make build && cp $(SCRIPT_DEST)/dev.js $(DEPLOY_DEST)/js && cp $(STYLE_DEST)/dev.css $(DEPLOY_DEST)/css && $(GHPAGES) -d $(DEPLOY_DEST) && make publish
9 changes: 9 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Fixes # || Adds new feature X

Changes include;
* a
* b
* c

* [ ] Passes tests (`linting`, `flow`)
* [ ] Code is `prettier`
Loading

0 comments on commit 1fff080

Please sign in to comment.