Giter Site home page Giter Site logo

zhoudaqing / adonis-framework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adonisjs/core

0.0 2.0 0.0 1.12 MB

NodeJs Web Application Framework. Makes it easy for you to write webapps with less code :smiley:

Home Page: http://adonisjs.com

License: MIT License

JavaScript 99.99% CSS 0.01%

adonis-framework's Introduction

Adonis Framework ๐Ÿ“

This repo contains the core modules for the AdonisJs framework. You must checkout the source code or the API docs on official website to learn more.




NPM Version Build Status Appveyor Coveralls

What's in the box?

This repo contains following providers.

  1. Router
  2. Request & Response
  3. Http Server
  4. Config
  5. Env
  6. Views
  7. Static Files Middleware
  8. Hashing Module
  9. Encrypter
  10. Logger
  11. Exceptions Handler

Node/OS Target

This repo/branch is supposed to run fine on all major OS platforms and targets Node.js >=7.0

Development

Great! If you are planning to contribute to the framework, make sure to adhere to following conventions, since a consistent code-base is always joy to work with.

Run the following command to see list of available npm scripts.

npm run

Tests & Linting

  1. Lint your code using standardJs. Run npm run lint command to check if there are any linting errors.
  2. Make sure you write tests for all the changes/bug fixes.
  3. Also you can write regression tests, which shows that something is failing but doesn't breaks the build. Which is actually a nice way to show that something fails. Regression tests are written using test.failing() method.
  4. Make sure all the tests are passing on travis and appveyor.

General Practices

Since Es6 is in, you should strive to use latest features. For example:

  1. Use Spread over arguments keyword.
  2. Never use bind or call. After calling these methods, we cannot guarantee the scope of any methods and in AdonisJs codebase we do not override the methods scope.
  3. Make sure to write proper docblock.

Issues & PR

It is always helpful if we try to follow certain practices when creating issues or PR's, since it will save everyone's time.

  1. Always try creating regression tests when you find a bug (if possible).
  2. Share some context on what you are trying to do, with enough code to reproduce the issue.
  3. For general questions, please create a forum thread.
  4. When creating a PR for a feature, make sure to create a parallel PR for docs too.

Regression Tests

Regression tests are tests, which shows how a piece of code fails under certain circumstance, but the beauty is even after the failure, the test suite will never fail. Actually is a nice way to notify about bugs, but making sure everything is green.

The regression tests are created using

test.failing('2 + 2 is always 4, but add method returns 6', (assert) => {
 assert.true(add(2, 2), 4)
})

Now since the add method has a bug, it will return 6 instead of 4. But the build will pass.

adonis-framework's People

Contributors

allanfreitas avatar atinux avatar chukitow avatar goschevski avatar grantcopley avatar greenkeeper[bot] avatar greenkeeperio-bot avatar marcbachmann avatar mastito03 avatar nrempel avatar ntvsx193 avatar r15ch13 avatar radmen avatar romainlanz avatar shreeve avatar thetutlage avatar yariksav avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.