Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Dec 9, 2018
0 parents commit c11c37a
Show file tree
Hide file tree
Showing 16 changed files with 299 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": [
"posva"
],
"env": {
"jest": true
}
}
13 changes: 13 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.

Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
27 changes: 27 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing

Contributions are welcome and will be fully credited!

We accept contributions via Pull Requests on [Github](https://github.com/{{ githubAccount }}/{{ name }}).

## Pull Requests

Here are some guidelines to make the process smoother:

- **Add a test** - New features and bugfixes need tests. If you find it difficult to test, please tell us in the pull request and we will try to help you!
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
- **Run `npm test` locally** - This will allow you to go faster
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
- **Send coherent history** - Make sure your commits message means something
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.

## Creating issues

### Bug reports

Always try to provide as much information as possible. If you are reporting a bug, try to provide a repro on jsfiddle.net (or anything else) or a stacktrace at the very least. This will help us check the problem quicker.

### Feature requests

Lay out the reasoning behind it and propose an API for it. Ideally, you should have a practical example to prove the utility of the feature you're requesting.

8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!--
IMPORTANT: Please provide as much information as possible:
- Reporting a bug: if possible provide a repro on jsfiddle.net or a stacktrace at the very least
- Feature request: lay out the reasoning behind it and propose an API for it
-->
34 changes: 34 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
Please make sure to read the Pull Request Guidelines:
https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#Pull-Request
-->

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->

**What kind of change does this PR introduce?** (check at least one)

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:

**Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [ ] No

If yes, please describe the impact and migration path for existing applications:

**The PR fulfills these requirements:**

- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
- [ ] All tests are passing
- [ ] New/updated tests are included

If adding a **new feature**, the PR's description includes:
- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

**Other information:**
25 changes: 25 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
labels:
- name: bug
color: ee0701
- name: contribution welcome
color: 0e8a16
- name: discussion
color: 4935ad
- name: docs
color: 8be281
- name: enhancement
color: a2eeef
- name: good first issue
color: 7057ff
- name: help wanted
color: 008672
- name: question
color: d876e3
- name: wontfix
color: ffffff
- name: WIP
color: ffffff
- name: need repro
color: c9581c
- name: feature request
color: fbca04
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
coverage
npm-debug.log
yarn-error.log
.nyc_output
coverage.lcov
dist
package-lock.json
yarn.lock
.DS_Store
15 changes: 15 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"src": {
"tagName": "v%s",
"commitMessage": "chore(release): %s"
},
"github": {
"release": true,
"releaseName": "🚀 Release %s",
"tokenRef": "GITHUB_TOKEN"
},
"npm": {
"publish": true
},
"changelogCommand": "git log --pretty=format:'* %s (%h)' [REV_RANGE]"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 Eduardo San Martin Morote

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.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# lib-boilerplate [![Build Status](https://badgen.net/circleci/github/posva/lib-boilerplate)](https://circleci.com/gh/posva/lib-boilerplate) [![npm package](https://badgen.net/npm/v/lib-boilerplate)](https://www.npmjs.com/package/lib-boilerplate) [![coverage](https://badgen.net/codecov/c/github/posva/lib-boilerplate)](https://codecov.io/github/posva/lib-boilerplate) [![thanks](https://badgen.net/badge/thanks/♥/pink)](https://github.com/posva/thanks)

> Some awesome description
Demo (TODO link)

## Installation

```sh
npm install lib-boilerplate
```

## Usage

## API

## Related

## License

[MIT](http://opensource.org/licenses/MIT)
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict'

module.exports = {
presets: ['@babel/preset-env'],
}
37 changes: 37 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2


jobs:
build:
docker:
- image: circleci/node:10

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- dependencies-cache-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- dependencies-cache-

- run: yarn install

- save_cache:
paths:
- node_modules
key: dependencies-cache-{{ checksum "yarn.lock" }}

# run tests!
- run: npm test

- run:
name: Send code coverage
command: './node_modules/.bin/codecov'
20 changes: 20 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/src/*.js',
],
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
transform: {
'^.+\\.jsx?$': 'babel-jest',
// ".*\\.(vue)$": "vue-jest",
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
coveragePathIgnorePatterns: [
'<rootDir>/test/*.js',
'<rootDir>/test/.*.js',
'<rootDir>/test/*/*.js',
],
testURL: 'http://localhost/',
}
45 changes: 45 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "lib-boilerplate",
"version": "0.0.0",
"description": "Some awesome description",
"main": "dist/lib-boilerplate.js",
"author": {
"name": "Eduardo San Martin Morote",
"email": "posva13@gmail.com"
},
"scripts": {
"lint": "eslint --fix --color --ext=js,html src tests *.js",
"lint:fix": "npm run lint -- --fix",
"unit": "jest",
"dev": "npm run unit -- --watchAll",
"test": "npm run lint && npm run unit",
"prepublishOnly": "rollit"
},
"files": [
"src",
"dist",
"types/*.d.ts",
"LICENSE",
"README.md"
],
"keywords": [],
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"codecov": "^3.1.0",
"eslint": "^5.10.0",
"eslint-config-posva": "^2.0.3",
"jest": "^23.6.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/posva/lib-boilerplate.git"
},
"bugs": {
"url": "https://github.com/posva/lib-boilerplate/issues"
},
"homepage": "https://github.com/posva/lib-boilerplate#readme"
}
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function mylib () {
return true
}
7 changes: 7 additions & 0 deletions tests/index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { mylib } from '../src'

describe('mylib', () => {
it('works', () => {
expect(mylib()).toBe(true)
})
})

0 comments on commit c11c37a

Please sign in to comment.