Skip to content

Commit

Permalink
Rebuild from scratch as V3 with breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaNarie committed Nov 28, 2018
0 parents commit cb58269
Show file tree
Hide file tree
Showing 34 changed files with 5,650 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"presets": [
["@babel/env", {
"targets": {
"browsers": ["last 2 versions"],
"node": "6"
},
"loose": true,
"useBuiltIns": false
}],
"@babel/preset-stage-3",
"@babel/typescript"
],
"plugins": [
["@babel/plugin-transform-runtime", {
"helpers": true,
"polyfill": false,
"regenerator": false,
"moduleName": "@babel/runtime"
}]
],
"env": {
"test": {
"plugins": [
"./test/_setup/arrow-function-coverage-fix.js",
"istanbul"
]
}
},
"ignore": [
"src/lib/vendor/**/*.*",
"./test/_setup/arrow-function-coverage-fix.js"
]
}
18 changes: 18 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
engines:
tslint:
enabled: true
duplication:
enabled: true
config:
languages:
- javascript
fixme:
enabled: true
ratings:
paths:
- src/**
exclude_paths:
- doc/**/*
- dist/**/*
- test/**/*
- vendor/**/*
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# see editorconfig.org

root = true

[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lib/**/*
src/lib/vendor/**/*
*.ts
42 changes: 42 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// http://eslint.org/docs/user-guide/configuring

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
},
env: {
browser: true,
},
extends: ['airbnb-base', 'prettier'],
plugins: ['import', 'prettier'],
settings: {
"import/resolver": {
"node": true,
"typescript": true
},
},
rules: {
'import/extensions': [
'error',
'always',
// hide known extensions that are resolved by webpack
{
js: 'never',
ts: 'never',
},
],
// prettier compatibility
'max-len': 0,
'prettier/prettier': [
'error',
{ singleQuote: true, trailingComma: 'all', printWidth: 100, tabWidth: 2 },
],
// only for use with getter-setters
'no-underscore-dangle': 0,
// to correctly work on windows with some tools that create windows line-endings
// this will be correct by git when committed
'linebreak-style': 0
},
};
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## copy to .npmignore
.DS_Store
.idea
npm-debug.log*
yarn-debug.log*
yarn-error.log*
node_modules/
.npm
.eslintcache
/coverage/
/.nyc_output/
/tmp/

## only ignore in git
/lib
/index.js
/index.d.ts
32 changes: 32 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## copy from .gitignore
.DS_Store
.idea
npm-debug.log*
yarn-debug.log*
yarn-error.log*
node_modules/
.npm
.eslintcache
/coverage/
/.nyc_output/
/tmp/

# .npmignore
.babelrc
.editorconfig
.eslintignore
.eslintrc.js
.gitignore
.nvmrc
.nycrc
.prettierignore
.prettierrc
.travis.yml
AUTHORS.md
CONTRIBUTING.md
tsconfig.json
tslint.json
/docs
/example
/src
/test
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8
28 changes: 28 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"sourceMap": false,
"instrument": false,
"check-coverage": true,
"per-file": true,
"lines": 90,
"statements": 90,
"functions": 100,
"branches": 80,
"include": [
"src/**/*.{js,ts}"
],
"exclude": [
"test/**/*.spec.{js,ts}",
"src/lib/vendor/**/*.*"
],
"reporter": [
"lcov",
"text-summary"
],
"extension": [
".js",
".ts"
],
"cache": true,
"all": true,
"report-dir": "./coverage"
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# for potential vendor files in src
lib/**/*
src/lib/vendor/**/*
14 changes: 14 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all",
"overrides": [
{
"files": "*.json",
"options": {
"printWidth": 999999
}
}
]
}
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: node_js

cache: yarn

node_js:
- 'stable'
- '6'
- '8'
- '10'

sudo: false

script:
- yarn test

deploy:
- provider: npm
email: '[email protected]'
api_key:
secure: Pu74+OVhLBIwgB8i2/k46XpSdYbtFccRdkZvSMTP3sbHgJvvlq/8KN9iWgnqi6kXE1e9vWM5Ru0oSS1+qtGPrHWy2f4ZRml+RJ1G0vVvRBAO9U7XsKiOVtRTJaTNQnCZONnDSCV3Q853T8mEYC/g3PcEGbfmsMhz21Dr0iNQBLA=
on:
tags: true
node: 'stable'
skip_cleanup: true
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [Arjan van Wijk](https://github.com/thanarie)
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Contributing

## Adding docs

Documentation is important, so any additions or improvements are welcomed!

## Adding features

Wanting to add a feature? Awesome!

If you're not sure the feature will be accepted, you can first open an issue to
see what others think.

Otherwise, just open a PR and describe what the feature is for; what problem it
solves, why it should be added.

You should also provide tests for the new feature, so we know it's working and
to show of the usage.

At last, please update the docs, describing how this new feature can be used.

## Fixing bugs

You found a bug? How embarrassing!

If you don't know how to fix it yourself, you can open an issue describing the
bug; how to reproduce, desired behavior, actual behavior.

Otherwise, you can open a PR. Please add a test first to show the incorrect
behavior, and then add the fix so the test passes.

## Code style

Please keep the code style consistent, defined by .editorconfig and the linters
in place.
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2018 Tha Narie

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.
Loading

0 comments on commit cb58269

Please sign in to comment.