Skip to content

Commit

Permalink
feat: Basic Project Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Undistraction committed Nov 10, 2017
0 parents commit ecf3368
Show file tree
Hide file tree
Showing 15 changed files with 3,824 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .babelrc
@@ -0,0 +1,20 @@
{
"env": {
// Don't disable modules when testing as they are needed
"test": {
"presets": ["env"]
},
// Configuration for rollup (needs modules disabled).
"development": {
"presets": [
[
"env",
{
"modules": false
}
]
],
"plugins": ["external-helpers"]
}
}
}
12 changes: 12 additions & 0 deletions .codeclimate.yml
@@ -0,0 +1,12 @@
engines:
eslint:
enabled: true
channel: "eslint-4"

ratings:
paths:
- "src/"

exclude_paths:
- "lib/"
- "**.test.js"
29 changes: 29 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,29 @@
module.exports = {
extends: ['eslint-config-airbnb-base', 'prettier'],
plugins: ['prettier', 'lodash'],
env: {
browser: true,
jest: true,
},
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
globals: {
l: true,
},
rules: {
'func-names': ['error', 'never'],
'no-param-reassign': 'off',
'import/no-extraneous-dependencies': 'off',
'no-confusing-arrow': 'off',
quotes: ['error', 'single', { avoidEscape: true }],
'jsx-quotes': ['error', 'prefer-double'],
'comma-dangle': ['error', 'always-multiline'],
'valid-jsdoc': ['error'],
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
'import/extensions': ['off', 'never'],
},
};
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
node_modules
yarn-error.log
coverage
out
1 change: 1 addition & 0 deletions .prettierignore
@@ -0,0 +1 @@
/Users/pedr/Library/Application\ Support/Code/User/snippets/javascript.json
17 changes: 17 additions & 0 deletions .prettierrc
@@ -0,0 +1,17 @@
{
"printWidth": 80,
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
},
{
"files": ".babelrc",
"options": { "parser": "json" }
}
]
}
21 changes: 21 additions & 0 deletions LICENSE.md
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [year] [fullname]

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.
Empty file added README.md
Empty file.
8 changes: 8 additions & 0 deletions jest.config.js
@@ -0,0 +1,8 @@
module.exports = {
bail: true,
verbose: true,
collectCoverage: true,
collectCoverageFrom: ['src/**/*.js'],
coveragePathIgnorePatterns: ['src/index.js'],
setupFiles: [],
};
9 changes: 9 additions & 0 deletions lib/index.js
@@ -0,0 +1,9 @@
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var test = function test(value) {
return 'Working';
};

exports.test = test;
20 changes: 20 additions & 0 deletions package.json
@@ -0,0 +1,20 @@
{
"devDependencies": {
"babel": "^6.23.0",
"babel-env": "^2.4.1",
"eslint": "^4.10.0",
"jest": "^21.2.1",
"prettier": "^1.8.2"
},
"dependencies": {
"babel-plugin-external-helpers": "^6.22.0",
"rollup": "^0.51.3",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-node-resolve": "^3.0.0"
},
"scripts": {
"build": "NODE_ENV=development rollup --config",
"test": "NODE_ENV=test jest --config jest.config.js --watch",
"test:cov": "NODE_ENV=test jest --config jest.config.js --watch --coverage"
}
}
18 changes: 18 additions & 0 deletions rollup.config.js
@@ -0,0 +1,18 @@
import nodeResolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';

// Trasnpiled using Babel
export default {
input: 'src/index.js',
output: {
file: 'lib/index.js',
format: 'cjs', // Use Common JS Modules in transpiled code
},
plugins: [
nodeResolve(),

babel({
exclude: 'node_modules/**', // only transpile project source
}),
],
};
7 changes: 7 additions & 0 deletions src/__tests__/index.js
@@ -0,0 +1,7 @@
import { test } from '../index';

describe('test', () => {
it('returns', () => {
expect(test(44)).toBe('Working');
});
});
1 change: 1 addition & 0 deletions src/index.js
@@ -0,0 +1 @@
export const test = value => 'Working';

0 comments on commit ecf3368

Please sign in to comment.