Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonpereyra committed Aug 21, 2020
0 parents commit 8171af3
Show file tree
Hide file tree
Showing 15 changed files with 520 additions and 0 deletions.
118 changes: 118 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
'use strict';

module.exports = {
extends: 'airbnb-base',

env: {
node: true,
es6: true,
mocha: true
},

globals: {
__rootpath: true,
coreRequire: true,
mainRequire: true,
JANIS_CORE: true,
JANIS_ENV: true,
JANIS_ENV_ALIAS: true
},

parserOptions: {
sourceType: 'script'
},

rules: {
'operator-linebreak': 0,
'no-continue': 0,
'no-plusplus': 0,
'prefer-spread': 0,
'prefer-rest-params': 0,
'class-methods-use-this': 0,
'consistent-return': 0,
'prefer-template': 0,
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/tests/**/*.js'] }],
'no-console': 0,
'no-bitwise': 0,

curly: ['error', 'multi-or-nest'],

'no-underscore-dangle': ['warn', {
allowAfterThis: true,
allowAfterSuper: true,
allow: ['_call', '__rootpath', '_where', '_id']
}],

'no-tabs': 0,

'no-new': 0,

'func-names': 0,

'space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always'
}],

'arrow-parens': ['error', 'as-needed'],
'arrow-body-style': 0,

indent: ['error', 'tab', {
SwitchCase: 1
}],

'comma-dangle': ['error', 'never'],

'padded-blocks': 0,

'max-len': ['error', {
code: 150,
tabWidth: 1,
comments: 200
}],

'spaced-comment': ['error', 'always', {
exceptions: ['*']
}],

'newline-per-chained-call': ['error', {
ignoreChainWithDepth: 2
}],

'no-param-reassign': 0,

'no-prototype-builtins': 0,

'keyword-spacing': ['error', {
overrides: {
if: {
after: false
},
for: {
after: false
},
while: {
after: false
},
switch: {
after: false
},
catch: {
after: false
}
}
}],

'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
'function-paren-newline': 0,
'no-await-in-loop': 0,

'object-curly-newline': ['error', {
ObjectExpression: { minProperties: 5, multiline: true, consistent: true },
ObjectPattern: { minProperties: 5, multiline: true, consistent: true }
}],
'nonblock-statement-body-position': ['error', 'below', { overrides: { else: 'any' } }]
}
};
23 changes: 23 additions & 0 deletions .github/workflows/build-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build Status

on:
push:
branches: [ '*' ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
27 changes: 27 additions & 0 deletions .github/workflows/coverage-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Coverage Status

on: ["push", "pull_request"]

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v1

- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: npm install, make test-coverage
run: |
npm install
npm run test-ci
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/linter-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Linter Status

on: ["push", "pull_request"]

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hallee/eslint-action@1.0.3
# GITHUB_TOKEN in forked repositories is read-only
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
with:
repo-token: ${{secrets.GITHUB_TOKEN}}
30 changes: 30 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: NPM Publish

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
104 changes: 104 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
19 changes: 19 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"exclude": [
"tests/",
"coverage/",
".eslintrc.js",
"actions/"
],
"extension": [
".js"
],
"cache": true,
"all": true,
"default-excludes": true,
"check-coverage": true,
"statements": 95,
"branches": 95,
"functions": 95,
"lines": 95
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Ricardo Gastón Pereyra

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.

0 comments on commit 8171af3

Please sign in to comment.