Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 37 additions & 20 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
{
"parser" : "babel-eslint",
"extends" : [
"standard"
],
"plugins": [
"babel"
],
"env" : {
"browser" : true
},
"globals" : {
"expect": false,
"should": false,
},
"rules": {
"semi" : [2, "never"],
"no-console": "error"
}
}
root: true

parser: babel-eslint
plugins: [babel]

extends: standard

env:
es6: true
node: true

ecmaFeatures:
modules: true

globals:
sinon: true
describe: true
before: true
beforeEach: true
after: true
afterEach: true
it: true

rules:
max-len: 0
no-else-return: 2
arrow-body-style: ['error', 'as-needed']
curly: "error"
no-use-before-define: 2

settings:
import/resolver:
node:
moduleDirectory:
- node_modules
# this sets the path the root since we have a `test` folder that will need to be included going forward.
- '/'
6 changes: 6 additions & 0 deletions examples/some-library/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": ["es2015"],
"plugins": [
"add-module-exports"
]
}
37 changes: 37 additions & 0 deletions examples/some-library/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
root: true

parser: babel-eslint
plugins: [babel]

extends: standard

env:
es6: true
node: true

ecmaFeatures:
modules: true

globals:
sinon: true
describe: true
before: true
beforeEach: true
after: true
afterEach: true
it: true

rules:
max-len: 0
no-else-return: 2
arrow-body-style: ['error', 'as-needed']
curly: "error"
no-use-before-define: 2

settings:
import/resolver:
node:
moduleDirectory:
- node_modules
# this sets the path the root since we have a `test` folder that will need to be included going forward.
- '/'
12 changes: 12 additions & 0 deletions examples/some-library/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Dependency directory
node_modules
examples/**/node_modules
dist
coverage
_book
es
lib
# Logs
*.log

.DS_Store
2 changes: 2 additions & 0 deletions examples/some-library/.istanbul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
instrumentation:
root: src
4 changes: 4 additions & 0 deletions examples/some-library/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
DS_Store
**/.DS_Store
env.json
41 changes: 41 additions & 0 deletions examples/some-library/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
language: node_js

node_js:
- "6"

branches:
only:
- master
- release

sudo: false

cache:
yarn: true
directories:
- node_modules

# before_install:
# - npm install # Install peer deps

script:
- npm run test:cov
- npm run build

# Publish To NPM if push to release branch
deploy:
skip_cleanup: true
provider: npm
email: $NPM_EMAIL
api_key: $NPM_TOKEN
on:
branch: release

addons:
code_climate:
repo_token: $CODE_CLIMATE

after_success:
- npm install -g codeclimate-test-reporter
- codeclimate-test-reporter < coverage/lcov.info

60 changes: 60 additions & 0 deletions examples/some-library/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Contributing Guidelines

Some basic conventions for contributing to this project.

### General

Please make sure that there aren't existing pull requests attempting to address the issue mentioned. Likewise, please check for issues related to update, as someone else may be working on the issue in a branch or fork.

* Non-trivial changes should be discussed in an issue first
* Develop in a topic branch, not master
* Squash your commits

### Linting

Please check your code using `npm run lint` or `npm run lint:fix` before submitting your pull requests, as the CI build will fail if `eslint` fails.

### Commit Message Format

Each commit message should include a **type**, a **scope** and a **subject**:

```
<type>(<scope>): <subject>
```

Lines should not exceed 100 characters. This allows the message to be easier to read on github as well as in various git tools and produces a nice, neat commit log ie:

```
#218 docs(example): allow user to configure webpack stats output
#271 feat(standard): add style config and refactor to match
#270 fix(config): only override publicPath when served by webpack
#269 feat(eslint-config-defaults): replace eslint-config-airbnb
#268 feat(config): allow user to configure webpack stats output
```

#### Type

Must be one of the following:

* **feat**: A new feature
* **fix**: A bug fix
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
semi-colons, etc)
* **refactor**: A code change that neither fixes a bug or adds a feature
* **test**: Adding missing tests
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
generation

#### Scope

The scope could be anything specifying place of the commit change. For example `webpack`,
`babel`, `redux` etc...

#### Subject

The subject contains succinct description of the change:

* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize first letter
* no dot (.) at the end
21 changes: 21 additions & 0 deletions examples/some-library/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017-present kypertech

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.
76 changes: 76 additions & 0 deletions examples/some-library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# some-library

[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Dependency Status][daviddm-image]][daviddm-url]
[![Code Climate][climate-image]][climate-url]
[![License][license-image]][license-url]
[![Code Style][code-style-image]][code-style-url]

## Getting Started

some-library is universal, so it can be used client-side or server-side.

1. Install through: `npm install --save some-library`

2. Include and use `some-library`:

```javascript
import Somelibrary from 'some-library';
let some-library = new Somelibrary();
```
## Testing/Coverage

`npm run test` - Run unit tests
`npm run test:cov` - Run unit tests and report coverage

## Building Bundle

Build code before deployment by running `npm run build`. There are multiple options below for types of deployment, if you are unsure, checkout the Firebase section.



### Tests

`npm run test` - run tests
`npm run test:cov` - run tests and generate coverage


### Travis
Visit [travis](travis-ci.org) to enable your gihub repo. Builds settings can be changed in `.travis.yml`

### Deployment

#### AWS S3

Selecting AWS S3 from the deploy options when running the generator adds deploy configs in `.travis.yml`.

1. Get your AWS Key and Secret from the AWS Console Credentials page
2. Set the following environment vars within the Travis-CI repo settings page:
* `AWS_KEY` - Your AWS key
* `AWS_SECRET` - Your AWS secret
* `S3_BUCKET` - Your S3 Bucket

### Code Climate

Visit [code climate dashboard](https://codeclimate.com/dashboard) to enable codeclimate for your repo on Github. Coverage will be sent automatically by Travis.

Get the key from the settings->coverage page and place it in Travis environment variable as `CODE_CLIMATE`


## [Documentation](https://kypertech.github.com/some-library)

[npm-image]: https://img.shields.io/npm/v/some-library.svg?style=flat-square
[npm-url]: https://npmjs.org/package/some-library
[travis-image]: https://img.shields.io/travis/kypertech/some-library/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/kypertech/some-library
[daviddm-image]: https://img.shields.io/david/kypertech/some-library.svg?style=flat-square
[daviddm-url]: https://david-dm.org/kypertech/some-library
[climate-image]: https://img.shields.io/codeclimate/github/kypertech/some-library.svg?style=flat-square
[climate-url]: https://codeclimate.com/github/kypertech/some-library
[coverage-image]: https://img.shields.io/codeclimate/coverage/github/kypertech/some-library.svg?style=flat-square
[coverage-url]: https://codeclimate.com/github/kypertech/some-library
[license-image]: https://img.shields.io/npm/l/some-library.svg?style=flat-square
[license-url]: https://github.com/kypertech/some-library/blob/master/LICENSE
[code-style-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[code-style-url]: http://standardjs.com/
Loading