Skip to content

Commit

Permalink
chore(setup ⚙️ ): eslint, babel, yarn flow & jest (#2) (#4) (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayusharma authored and sergiohgz committed Jul 31, 2019
1 parent 4d54680 commit b0e68c3
Show file tree
Hide file tree
Showing 20 changed files with 5,783 additions and 170 deletions.
13 changes: 13 additions & 0 deletions plugins/auth-memory/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
[
"env",
{
"targets": {
"node": "6"
}
}
],
"flow"
]
}
49 changes: 49 additions & 0 deletions plugins/auth-memory/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: 2
jobs:
lint:
docker:
- image: circleci/node:9
steps:
- checkout
- run: yarn install --no-progress
- run: yarn run lint

test_6:
docker:
- image: circleci/node:6
steps:
- checkout
- run: yarn install --no-progress
- run: yarn run test

test_8:
docker:
- image: circleci/node:8
steps:
- checkout
- run: yarn install --no-progress
- run: yarn run test

test_9:
docker:
- image: circleci/node:9
steps:
- checkout
- run: yarn install --no-progress
- run: yarn run test
- run: yarn run coverage

workflows:
version: 2
build_and_test:
jobs:
- lint
- test_6:
requires:
- lint
- test_8:
requires:
- lint
- test_9:
requires:
- lint
7 changes: 7 additions & 0 deletions plugins/auth-memory/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
coverage/
lib/
.nyc_output
tests-report/
flow-typed/
fixtures/
83 changes: 83 additions & 0 deletions plugins/auth-memory/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
extends: ['plugin:prettier/recommended']
parser: 'babel-eslint'
parserOptions:
ecmaVersion: 2018
sourceType: module
env:
node: true
browser: true
es6: true
mocha: true
jest: true
rules:
prettier/prettier: ['error', { 'singleQuote': true }]
strict: 0
# useful to have in node.js,
# if you're sure you don't need to handle error, rename it to "_err"
handle-callback-err: 2

padded-blocks: 0
switch-colon-spacing: 0

# just to make sure we don't forget to remove them when releasing
no-debugger: 2

# add "falls through" for those
no-fallthrough: 2

# enforce use curly always
# curly: 1

# just warnings about whitespace weirdness here
eol-last: 1
no-irregular-whitespace: 1
no-mixed-spaces-and-tabs: [1, smart-tabs]
no-trailing-spaces: 1

# probably always an error, tell me if it's not
no-new-require: 2

# single most important rule here, without it linting won't even
# make any sense
no-undef: 2

# in practice, those are always errors
no-unreachable: 2

# useful for code clean-up
no-unused-vars: [2, {"vars": "all", "args": "none"}]

max-len: [1, 120]

# camelcase is standard, but this should be 1 and then 2 soon
camelcase: 0

# jsdoc is mandatory
require-jsdoc: 0
valid-jsdoc: 0

# this feature is cool but not supported by Node 4, disable via comments
prefer-spread: 1
prefer-rest-params: 1

# encorage use es6
no-var: 2

# configuration that should be upgraded progresivelly
no-constant-condition: 2
no-empty: 2

# loop over objects http://eslint.org/docs/rules/guard-for-in
guard-for-in: 2

# this must be used within classes
no-invalid-this: 2

# All object must be uppercase
new-cap: 2

# readbility is important, no multiple inline declarations
one-var: 0

# console not allowed unless for testing
no-console: [2, {"allow": ["log", "warn"]}]
11 changes: 11 additions & 0 deletions plugins/auth-memory/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[ignore]
.*/node_modules/.*
lib/.*

[libs]
node_modules/@verdaccio/types/lib/

[lints]

[options]
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
21 changes: 20 additions & 1 deletion plugins/auth-memory/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
.npmrc
npm-debug.log
.DS_Store
package-lock.json
_storage/
lib/
node_modules/
coverage/

# Istanbul
.nyc*
tests-report

# IDE
.vscode/*
.idea/
*.log
*.tar
*.gz
*.tmp-*
coverage/
24 changes: 24 additions & 0 deletions plugins/auth-memory/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
tests-report/
.nyc_output
.editorconfig
.gitignore
yarn-error.log
yarn.lock
.idea/
.flowconfig
flow-typed/
.eslintrc
.babelrc
test/
.eslintignore
.eslintrc.yml
.npmignore
.travis.yml
*.tmp-*
_storage/
circle.yml
travis.yml
*.md
coverage/
jest.config.js
jestEnvironment.js
2 changes: 2 additions & 0 deletions plugins/auth-memory/.yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
save-prefix ""
registry "http://registry.npmjs.org/"
46 changes: 46 additions & 0 deletions plugins/auth-memory/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at verdaccio.npm@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
101 changes: 101 additions & 0 deletions plugins/auth-memory/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Contributing

We are happy you wish to contribute this plugin, for that reason we want to board you with this guide.

## Reporting a Bug

We welcome clear bug reports. If you've found a bug in Verdaccio that isn't a security risk, please file a report in our [issue tracker](https://github.com/verdaccio/verdaccio-auth-memory/issues). Before you file your issue, search to see if it has already been reported. If so, up-vote (using GitHub reactions) or add additional helpful details to the existing issue to show that it's affecting multiple people.

### Check if there's a simple solution in the website.

Some of the most popular topics can be found in our website(http://www.verdaccio.org/docs/en/installation.html)

### Questions & Chat

We have a chat as **#questions/#development** channels at [Discord](https://discord.gg/AwXRqPD).

### Using the issue tracker

The issue tracker is a channel were mostly users/developers post.

#### I want to report a bug

We considere a bug a feature that is not working as is described in the documentation. Before reporting a bug follow the next steps:

1. Use the GitHub issue search — check if the issue has already been reported.

2. Check if the issue has been fixed — try to reproduce it using the latest master or development branch in the repository.

Verdaccio still does not support all npm commands due either in the initial design were not considered important or nobody has request it yet.

## Request Features

A new feature is always welcome, thus, analyse whether your idea fits in the scope of the project and elaborate your request providing enough context, for instance:

* A wide description the advantages of your request.
* It's compatible with `npm` and `yarn`?
* You might implement your feature and provide a forked repository as example.
* Whatever you have on mind 🤓.

### Submitting a Pull Request
The following are the general steps you should follow in creating a pull request. Subsequent pull requests only need
to follow step 3 and beyond:

1. Fork the repository on GitHub
2. Clone the forked repository to your machine
3. Make your changes and commit them to your local repository
4. Rebase and push your commits to your GitHub remote fork/repository
5. Issue a Pull Request to the official repository
6. Your Pull Request is reviewed by a committer and merged into the repository

*Note*: While there are other ways to accomplish the steps using other tools, the examples here will assume the most
actions will be performed via the `git` command line.

For more information on maintaining a fork, please see the GitHub Help article [Fork a Repo](https://help.github.com/articles/fork-a-repo/) and information on
[rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) from git.

### Make Changes and Commit

#### Before commit

At this point you have ready your changes, your new feature it's ready to be shipped, but, to avoid delays to merge, please be aware the build must past.

Before commit, run the test command:

```bash
yarn test
```
It won't have **eslint** errors and **all test must past**. Then, and only then, you should push and ship your **PR**.

#### Git Commit Guidelines

We follow the [conventional commit messages](https://conventionalcommits.org/) convention in order to automate Changelog generation and auto semantic versioning based on commit messages.

* feat: A new feature
* fix: A bug fix

A commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in semantic versioning).

eg:
```
feat: xxxxxxxxxx
````

A commit of the type fix patches a bug in your codebase (this correlates with PATCH in semantic versioning).

eg:
```
fix: xxxxxxxxxx
````

Commits types as `docs:`,`style:`,`refactor:`,`perf:`,`test:` and `chore:` are valid but has no effect on versioning, but, it would be great if you use them.

Use `npm run commitmsg` to check your commit message.

> All PR that does not follow the commit guidelines will be hold until messages are fixed.
## Update Test

Any change in the sour code **must to include test update**, if you need support about how test works, please [refers to the following guide](https://github.com/verdaccio/verdaccio/wiki/Running-and-Debugging-tests). Please include test whether is a new feature, otherwise will be hold and never be merged.

> Documentation, website, build, deployment, assets or flow types are excluded in this section
2 changes: 2 additions & 0 deletions plugins/auth-memory/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# verdaccio-auth-memory
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fverdaccio%2Fverdaccio-auth-memory.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fverdaccio%2Fverdaccio-auth-memory?ref=badge_shield)
[![CircleCI](https://circleci.com/gh/verdaccio/verdaccio-auth-memory.svg?style=svg)](https://circleci.com/gh/ayusharma/verdaccio-auth-memory)
[![codecov](https://codecov.io/gh/verdaccio/verdaccio-auth-memory/branch/master/graph/badge.svg)](https://codecov.io/gh/verdaccio/verdaccio-auth-memory)


This verdaccio auth plugin keeps the users in a memory plain object.
Expand Down
Loading

0 comments on commit b0e68c3

Please sign in to comment.