Skip to content

Commit

Permalink
Add project boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaq committed Oct 18, 2019
1 parent fbaea61 commit ae632d6
Show file tree
Hide file tree
Showing 16 changed files with 186 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
author-name = Aldwin Vlasblom
repo-owner = fluture-js
repo-name = fluture-project
source-files = index.js
module-type = esm
opening-delimiter = ```js
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"root": true,
"extends": ["./node_modules/sanctuary-style/eslint-es3.json"],
"parserOptions": {"sourceType": "module"},
"env": {"node": true, "es6": true},
"overrides": [
{
"files": ["README.md"],
"rules": {"no-undef": ["off"]}
}
]
}
28 changes: 28 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/initial-pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Initial pull request
about: When you've just generated this repository and you want to get to work.
---

# Everything

This pull request adds everything the project needs to be at its first release.

# TODO

- [ ] Name the project:
- Change `repo-name` in `.config` and ensure the tests pass.
- Change the header of the documentation in `index.js`.
- Change the module name in `rollup.config.js`.

- [ ] Describe the project:
- Change `description` in `package.json`
- Update the GitHub repo description.
- Add the description to the documentation in `index.js`.

- [ ] If this is a node-only module, remove browser support:
- Change `umd` to `cjs` in `rollup.config.js` and remove `output.name`.
- Change `eslint-es3` to `eslint-es6` in `.eslintrc.json`.

- [ ] Remove the `initial-pr.md` pull-request template.

- [ ] Write the code.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/coverage/
/index.cjs
/node_modules/
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: node_js
node_js:
- "12"
after_success: npm run codecov
branches:
only:
- master
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Contribution Guideline

## Making a contribution

1. Fork the repo if you do not have write access
1. Clone the remote (fork) from GitHub
1. Create a branch named `<yourgithubusername>/<yourfeature>`
1. Make one or more atomic commits
1. Make sure the tests pass locally
1. Create a pull-request on GitHub

## Publishing a new version

1. Make sure you have write access to the module on npm
1. Make sure you have write access to the master branch on GitHub
1. Checkout `master` and make sure it's up to date with the remote
1. Run `npm run release <level>`, where `<level>` can be any of: 'major',
'minor', 'patch', 'premajor', 'preminor', 'prepatch', or 'prerelease'.
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2019 Aldwin Vlasblom

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.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Fluture Project
# Under Construction

This project is still under construction. If all went well, you should be
able to learn about it in the [initial pull request](./pull/1).
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//. # Fluture Project
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "fluture-project",
"version": "0.0.0",
"description": "Hopefully something related to Fluture",
"type": "module",
"main": "index.cjs",
"module": "index.js",
"scripts": {
"build": "rollup -c rollup.config.js",
"codecov": "codecov",
"doctest": "sanctuary-doctest",
"lint": "sanctuary-lint",
"release": "sanctuary-release",
"test": "npm run lint && sanctuary-test && npm run doctest"
},
"repository": {
"type": "git",
"url": "git://github.com/fluture-js/fluture-project.git"
},
"files": [
"/index.cjs",
"/index.js",
"/LICENSE",
"/package.json",
"/README.md"
],
"author": "Aldwin Vlasblom <[email protected]> (https://github.com/Avaq)",
"license": "MIT",
"dependencies": {},
"peerDependencies": {},
"devDependencies": {
"c8": "^5.0.4",
"codecov": "^3.2.0",
"oletus": "^2.0.0",
"rollup": "^1.21.4",
"sanctuary-scripts": "^3.1.1"
}
}
9 changes: 9 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
input: 'index.js',
output: {
format: 'umd',
file: 'index.cjs',
name: 'flutureProject',
interop: false
}
};
16 changes: 16 additions & 0 deletions scripts/prepublish
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -eufo pipefail

echo "Publishing as $(npm whoami)."

if ! npm outdated --long; then
read -rp "Continue? [y/N] " choice
if [[ "${choice-n}" != 'y' ]]; then
echo 'Package distribution aborted.'
exit 2
fi
fi

npm run build

sanctuary-prepublish "$@"
13 changes: 13 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eufo pipefail

# shellcheck source=/dev/null
source "${BASH_SOURCE%/*}/../node_modules/sanctuary-scripts/functions"

branches="$(get min-branch-coverage)"

c8 --check-coverage \
--branches "$branches" \
node --experimental-modules \
--no-warnings \
./node_modules/.bin/oletus
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '../index.js';

0 comments on commit ae632d6

Please sign in to comment.