Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaq committed Mar 8, 2020
0 parents commit 0b3fcf5
Show file tree
Hide file tree
Showing 16 changed files with 219 additions and 0 deletions.
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": {"shared-node-browser": true, "es6": true},
"overrides": [
{
"files": ["README.md"],
"rules": {"no-undef": ["off"]}
}
]
}
39 changes: 39 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/initial-pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
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

- [ ] Update `author-name` and `repo-owner` in `.config` and
ensure the tests pass.

- [ ] 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`.
- Add additional `tags` in `package.json`.

- [ ] 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`.
- Change `shared-node-browser` to `node` in `.eslintrc.json`.

- [ ] Set up integration with Codecov:
- Find the Codecov token in the Codecov settings for your new repository:
https://codecov.io/gh/{owner}/{repository}/settings.
- Save it as `CODECOV_TOKEN` in the secrets for your new repository:
https://github.com/{owner}/{repository}/settings/secrets.

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

- [ ] Write the code.
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
pull_request:
push:
branches:
- master

jobs:
test:
name: Automated Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Install NodeJS
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install Dependencies
run: npm install
- name: Execute Tests
run: npm test
- name: Upload Coverage Report
run: npm run codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
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
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.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 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
39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "fluture-project",
"version": "0.0.0",
"description": "Hopefully something related to Fluture",
"tags": ["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": "^7.1.0",
"codecov": "^3.2.0",
"oletus": "^3.0.0",
"rollup": "^2.0.0",
"sanctuary-scripts": "^4.0.0"
}
}
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 "$@"
14 changes: 14 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eufo pipefail

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

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

c8 --check-coverage \
--branches "$branches" \
--reporter lcov \
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 0b3fcf5

Please sign in to comment.