-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ec0c7b
commit a222842
Showing
8 changed files
with
523 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
|
||
 | ||
|
||
Adonis application | ||
================== | ||
|
||
[](https://circleci.com/gh/poppinss/application "circleci") [](https://npmjs.org/package/@poppinss/application "npm")  | ||
|
||
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) | ||
|
||
--- | ||
|
Oops, something went wrong.