Skip to content

Commit

Permalink
everything
Browse files Browse the repository at this point in the history
  • Loading branch information
svozza committed Mar 14, 2017
1 parent 412b225 commit 7a1748c
Show file tree
Hide file tree
Showing 14 changed files with 2,072 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.gitignore
coverage
.idea
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing

Note: __README.md__ is generated from comments in __index.js__. Do not modify
__README.md__ directly.

1. Update local master branch:

$ git checkout master
$ git pull upstream master

2. Create feature branch:

$ git checkout -b feature-x

3. Make one or more atomic commits, and ensure that each commit has a
descriptive commit message. Commit messages should be line wrapped
at 72 characters.

4. Run `make test lint`, and address any errors. Preferably, fix commits
in place using `git rebase` or `git commit --amend` to make the changes
easier to review.

5. Push:

$ git push origin feature-x

6. Open a pull request.
25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
The MIT License (MIT)

Copyright (c) 2017 Sanctuary
Copyright (c) 2016 Plaid Technologies, Inc.

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:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
80 changes: 80 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
DOCTEST = node_modules/.bin/doctest --module commonjs --prefix .
ESLINT = node_modules/.bin/eslint --config node_modules/sanctuary-style/eslint-es3.json --env es3
ISTANBUL = node_modules/.bin/istanbul
REMEMBER_BOWER = node_modules/.bin/remember-bower
TRANSCRIBE = node_modules/.bin/transcribe
XYZ = node_modules/.bin/xyz --repo [email protected]:sanctuary-js/sanctuary-maybe.git --script scripts/prepublish
YARN = yarn


.PHONY: all
all: LICENSE README.md

.PHONY: LICENSE
LICENSE:
cp -- '$@' '[email protected]'
sed 's/Copyright (c) .* Sanctuary/Copyright (c) $(shell git log --date=format:%Y --pretty=format:%ad | sort -r | head -n 1) Sanctuary/' '[email protected]' >'$@'
rm -- '[email protected]'

README.md: README.md.tmp package.json scripts/version-urls
scripts/version-urls '$<' >'$@'

.INTERMEDIATE: README.md.tmp
README.md.tmp: index.js
$(TRANSCRIBE) \
--heading-level 4 \
--url 'https://github.com/sanctuary-js/sanctuary-maybe/blob/v$(VERSION)/{filename}#L{line}' \
-- $^ \
| LC_ALL=C sed 's/<h4 name="\(.*\)#\(.*\)">\(.*\)\1#\2/<h4 name="\1.prototype.\2">\3\1#\2/' >'$@'


.PHONY: lint
lint:
$(ESLINT) \
--global define \
--global module \
--global require \
--global self \
-- index.js
$(ESLINT) \
--env node \
$(ESLINT) \
--env node \
--global suite \
--global test \
--rule 'dot-notation: [error, {allowKeywords: true}]' \
--rule 'max-len: [off]' \
-- test
$(YARN) check
$(REMEMBER_BOWER) $(shell pwd)
@echo 'Checking for missing link definitions...'
grep -o '\[[^]]*\]\[[^]]*\]' index.js \
| sort -u \
| sed -e 's:\[\(.*\)\]\[\]:\1:' \
-e 's:\[.*\]\[\(.*\)\]:\1:' \
-e '/0-9/d' \
| xargs -I '{}' sh -c "grep '^//[.] \[{}\]: ' index.js"


.PHONY: release-major release-minor release-patch
release-major release-minor release-patch:
@$(XYZ) --increment $(@:release-%=%)


.PHONY: setup
setup:
$(YARN)

yarn.lock: package.json
$(YARN)


.PHONY: test
test:
$(ISTANBUL) cover node_modules/.bin/_mocha -- --recursive --ui tdd
# $(ISTANBUL) check-coverage --branches 100
ifeq ($(shell node --version | cut -d . -f 1),v6)
$(DOCTEST) -- index.js
else
@echo '[WARN] Doctests are only run in Node v6.x.x (current version is $(shell node --version))' >&2
endif
41 changes: 41 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "sanctuary-maybe",
"description": "Refuge from null reference errors in JavaScript",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/sanctuary-js/sanctuary-maybe.git"
},
"main": "index.js",
"moduleType": [
"amd",
"globals",
"node"
],
"keywords": [
"adt",
"functional",
"maybe",
"safe",
"safety",
"types"
],
"dependencies": {
"sanctuary-def": "0.9.0",
"sanctuary-type-classes": "3.0.1",
"sanctuary-type-identifiers": "1.0.0"
},
"ignore": [
"/.git/",
"/bower_components/",
"/coverage/",
"/node_modules/",
"/scripts/",
"/test/",
"/.*",
"/CONTRIBUTING.md",
"/Makefile",
"/circle.yml",
"/package.json"
]
}
20 changes: 20 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
dependencies:
pre:
- curl https://yarnpkg.com/install.sh | bash
override:
- case $CIRCLE_NODE_INDEX in 0) make setup ;; 1) nvm install 6 && nvm exec 6 make setup ;; 2) nvm install 7 && nvm exec 7 make setup ;; esac:
parallel: true
cache_directories:
- ~/.cache/yarn

machine:
node:
version: 4
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"

test:
override:
- make lint
- case $CIRCLE_NODE_INDEX in 0) make test ;; 1) nvm exec 6 make test ;; 2) nvm exec 7 make test ;; esac:
parallel: true
Loading

0 comments on commit 7a1748c

Please sign in to comment.