Skip to content

Commit 97d94fe

Browse files
committed
Initial npm library configuration.
0 parents  commit 97d94fe

27 files changed

+7647
-0
lines changed

.babelrc

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"presets": [
3+
["env", { "targets": { "node": true } }],
4+
"stage-3"
5+
],
6+
"plugins": [
7+
"syntax-flow",
8+
"transform-flow-strip-types"
9+
],
10+
"env": {
11+
"commonjs": {
12+
"presets": [
13+
"latest",
14+
"stage-3"
15+
],
16+
},
17+
"umd": {
18+
"presets": [
19+
["latest", { "es2015": { "modules": false } }],
20+
"stage-3"
21+
],
22+
}
23+
}
24+
}

.eslintignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
flow-typed/
2+
tools/flow/
3+
node_modules/
4+
commonjs/
5+
coverage/
6+
umd/

.eslintrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"root": true,
3+
"parser": "babel-eslint",
4+
"extends": "airbnb-base",
5+
"plugins": [
6+
"flowtype"
7+
],
8+
"env": {
9+
"browser": true,
10+
"es6": true,
11+
"node": true,
12+
"jest": true,
13+
},
14+
"ecmaFeatures": {
15+
"defaultParams": true
16+
},
17+
"rules": {}
18+
}

.flowconfig

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[include]
2+
3+
[ignore]
4+
5+
# Including these files causes issues.
6+
.*/node_modules/config-chain/.*
7+
.*/node_modules/fbjs/.*
8+
.*/node_modules/findup/.*
9+
.*/node_modules/flow-coverage-report/.*
10+
.*/node_modules/npmconf/.*
11+
12+
[libs]
13+
14+
# Official "flow-typed" repository definitions.
15+
flow-typed/npm
16+
17+
# Custom definitions.
18+
tools/flow/definitions/
19+
20+
# Note: the following definitions come bundled with flow. It can be handy
21+
# to reference them.
22+
# React: https://github.com/facebook/flow/blob/master/lib/react.js
23+
# Javascript: https://github.com/facebook/flow/blob/master/lib/core.js
24+
# Node: https://github.com/facebook/flow/blob/master/lib/node.js
25+
# DOM: https://github.com/facebook/flow/blob/master/lib/dom.js
26+
# BOM: https://github.com/facebook/flow/blob/master/lib/bom.js
27+
# CSSOM: https://github.com/facebook/flow/blob/master/lib/cssom.js
28+
# IndexDB: https://github.com/facebook/flow/blob/master/lib/indexeddb.js
29+
30+
[options]
31+
32+
# This is so that we can import static files in our webpack supported components
33+
# and not have flow throw a hissy fit.
34+
module.name_mapper='^\(.*\)\.\(css\|eot\|gif\|ico\|jpg\|jpeg\|less\|otf\|mp3\|mp4\|ogg\|png\|sass\|scss\|sss\|svg\|swf\|ttf\|webp\|woff\|woff2\)$' -> '<PROJECT_ROOT>/tools/flow/stubs/WebpackAsset.js.flow'
35+
36+
[version]
37+
0.37.4

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Dependencies
6+
node_modules
7+
8+
# Debug log from npm
9+
npm-debug.log
10+
11+
# Jest
12+
coverage
13+
14+
# Build output
15+
umd
16+
commonjs
17+
18+
# Flow
19+
flow-coverage
20+
flow-typed

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.3.0

.travis.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
sudo: false
2+
language: node_js
3+
cache:
4+
yarn: true
5+
directories:
6+
- node_modules
7+
branches:
8+
only:
9+
- master
10+
- /^greenkeeper-/
11+
node_js:
12+
- '7'
13+
script:
14+
- yarn run check
15+
after_success:
16+
- yarn run test:coverage:deploy
17+
- yarn run publish

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Sean Matheson
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
> This is a starter kit for an npm library. See the [STARTER](/docs/STARTER.md) docs for more information on how it is configured and how you should use it. Delete this message and customise the readme below to your own needs.
2+
3+
# Your Library Name
4+
5+
A one liner description of your library.
6+
7+
___BADGES: EDIT THESE TO USE THE URLS FOR EACH SERVICE CONFIGURED FOR YOUR OWN LIBRARY, THEN REMOVE THIS MESSAGE___
8+
9+
[![npm](https://img.shields.io/npm/v/npm-library-starter.svg?style=flat-square)](http://npm.im/npm-library-starter)
10+
[![MIT License](https://img.shields.io/npm/l/npm-library-starter.svg?style=flat-square)](http://opensource.org/licenses/MIT)
11+
[![Travis](https://img.shields.io/travis/ctrlplusb/npm-library-starter.svg?style=flat-square)](https://travis-ci.org/ctrlplusb/npm-library-starter)
12+
[![Codecov](https://img.shields.io/codecov/c/github/ctrlplusb/npm-library-starter.svg?style=flat-square)](https://codecov.io/github/ctrlplusb/npm-library-starter)
13+
14+
## TOCs
15+
16+
- [Introduction](#introduction)
17+
- [FAQs](#faqs)
18+
19+
## Introduction
20+
21+
An introduction to your library...
22+
23+
## FAQs
24+
25+
___A common question around your library?___
26+
27+
The answer to the question.
28+
29+
___A common question around your library?___
30+
31+
The answer to the question.

docs/STARTER.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Starter Kit
2+
3+
This is a starter kit for creating npm libraries.
4+
5+
## TOCS
6+
7+
- [Commands](#commands)
8+
- [Output Types](#output-types)
9+
- [Workflow](#workflow)
10+
- [Integrations](#integrations)
11+
- [FAQs](#faqs)
12+
13+
### Commands
14+
15+
TODO
16+
17+
### Output Types
18+
19+
TODO
20+
21+
### Workflow
22+
23+
TODO
24+
25+
#### Gitflow
26+
27+
TODO
28+
29+
### Integrations
30+
31+
TODO
32+
33+
#### Travis
34+
35+
TODO
36+
37+
#### codecov.io
38+
39+
TODO
40+
41+
## FAQs
42+
43+
___How do I deploy a `codecov` report locally?___
44+
45+
Get the upload token from codecov.io and then set the environment var before executing the respective npm task.
46+
47+
e.g.
48+
49+
```bash
50+
CODECOV_TOKEN=0f24e004-ba1d-4cac-9a4e-23310ef221c2 npm run coverage:report
51+
```

examples/web/package.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "my-library-example",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "MIT",
11+
"devDependencies": {
12+
"babel-core": "6.21.0",
13+
"babel-loader": "6.2.10",
14+
"babel-preset-latest": "6.16.0",
15+
"babel-preset-stage-3": "6.17.0",
16+
"express": "4.14.0",
17+
"webpack": "2.2.0-rc.3",
18+
"webpack-dev-middleware": "1.9.0",
19+
"webpack-hot-middleware": "2.14.0"
20+
}
21+
}

examples/web/src/index.js

Whitespace-only changes.

0 commit comments

Comments
 (0)