Skip to content

Commit

Permalink
docs: add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed May 22, 2019
1 parent 0ec0c7b commit a222842
Show file tree
Hide file tree
Showing 8 changed files with 523 additions and 11 deletions.
67 changes: 59 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,70 @@
<div align="center">
<img src="https://res.cloudinary.com/adonisjs/image/upload/q_100/v1557762307/poppinss_iftxlt.jpg" width="600px">
</div>

# Adonis application
[![circleci-image]][circleci-url] [![npm-image]][npm-url] ![](https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript)

The application class for AdonisJs to know more about the environment and project structure of your AdonisJs applications.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of contents

- [@poppinss/application](#poppinssapplication)
- [Change log](#change-log)
- [Contributing](#contributing)
- [Authors & License](#authors--license)
- [Usage](#usage)
- [rcParser](#rcparser)
- [API Docs](#api-docs)
- [Change log](#change-log)
- [Contributing](#contributing)
- [Authors & License](#authors--license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# @poppinss/application
## Usage
Ideally you shouldn't be installing this module directly, hence it is part of AdonisJs by default. However, installing module directly is helpful when testing AdonisJs specific addons.

```sh
npm i @poppinss/application

# Yarn
yarn add @poppinss/application
```

and then use it as follows:

```ts
import { Application } from '@poppinss/application'
import { Ioc } from '@adonisjs/fold'

const app = new Application(
'1.0.0',
__dirname,
new Ioc(),
require('./adonisrc.json'),
)
```

The constructor takes 4 arguments, which you fake during testings.

| Argument position | Description |
|------------------|------------------|
| `0 (version)` | The version of `@adonisjs/core` package |
| `1 (appRoot)` | The application root |
| `3 (ioc)` | Instance of IoC container |
| `4 (rcContents)` | Contents of `.adonisrc.json` file. You can also provide an empty object |

## rcParser
The application instance will parse the contents of `.adonisrc.json` file. However, if you need the parser, you can access and use it as follows.

```ts
import { rcParser } from '@poppinss/application'
rcParser.parse(require('.adonisrc.json'))
```

## API Docs
Following are the autogenerated files via Typedoc

[![circleci-image]][circleci-url]
[![npm-image]][npm-url]
![](https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript)
* [API](docs/README.md)

## Change log

Expand Down
113 changes: 113 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@

![](https://res.cloudinary.com/adonisjs/image/upload/q_100/v1557762307/poppinss_iftxlt.jpg)

Adonis application
==================

[![circleci-image](https://img.shields.io/circleci/project/github/poppinss/application/master.svg?style=for-the-badge&logo=circleci)](https://circleci.com/gh/poppinss/application "circleci") [![npm-image](https://img.shields.io/npm/v/@poppinss/application.svg?style=for-the-badge&logo=npm)](https://npmjs.org/package/@poppinss/application "npm") ![](https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript)

The application class for AdonisJs to know more about the environment and project structure of your AdonisJs applications.

Table of contents
-----------------

* [@poppinss/application](#poppinssapplication)
* [Change log](#change-log)
* [Contributing](#contributing)
* [Authors & License](#authors--license)

Usage
-----

Ideally you shouldn't be installing this module directly, hence it is part of AdonisJs by default. However, installing module directly is helpful when testing AdonisJs specific addons.

```sh
npm i @poppinss/application

# Yarn
yarn add @poppinss/application
```

and then use it as follows:

```ts
import { Application } from '@poppinss/application'
import { Ioc } from '@adonisjs/fold'

const app = new Application(
'1.0.0',
__dirname,
new Ioc(),
require('./adonisrc.json'),
)
```

The constructor takes 4 arguments, which you fake during testings.

Argument position

Description

`0 (version)`

The version of `@adonisjs/core` package

`1 (appRoot)`

The application root

`3 (ioc)`

Instance of IoC container

`4 (rcContents)`

Contents of `.adonisrc.json` file. You can also provide an empty object

rcParser
--------

The application instance will parse the contents of `.adonisrc.json` file. However, if you need the parser, you can access and use it as follows.

```ts
import { rcParser } from '@poppinss/application'
rcParser.parse(require('.adonisrc.json'))
```

API Docs
--------

Following are the autogenerated files via Typedoc

* [API](docs/README.md)

Change log
----------

The change log can be found in the [CHANGELOG.md](CHANGELOG.md) file.

Contributing
------------

Everyone is welcome to contribute. Please go through the following guides, before getting started.

1. [Contributing](https://adonisjs.com/contributing)
2. [Code of conduct](https://adonisjs.com/code-of-conduct)

Authors & License
-----------------

\[Harminder virk\]([https://github.com/Harminder](https://github.com/Harminder) virk) and [contributors](https://github.com/poppinss/application/graphs/contributors).

MIT License, see the included [MIT](LICENSE.md) file.

## Index

### External modules

* ["Application"](modules/_application_.md)
* ["contracts"](modules/_contracts_.md)
* ["rcParser"](modules/_rcparser_.md)

---

Loading

0 comments on commit a222842

Please sign in to comment.