Skip to content

Commit

Permalink
Merge pull request #75 from AthennaIO/develop
Browse files Browse the repository at this point in the history
Update to v4
  • Loading branch information
jlenon7 authored Aug 10, 2023
2 parents e4d4fba + d68afeb commit 1e9e946
Show file tree
Hide file tree
Showing 16 changed files with 106 additions and 116 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ on:
- develop

jobs:
qodana:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@main
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

linux:
runs-on: ubuntu-latest
strategy:
Expand Down
10 changes: 5 additions & 5 deletions docs/architecture-concepts/application-lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class CustomKernel extends HttpKernel {
:::note

You can check all the methods available for you to override in your
custom kernel implementation taking a look at [HttpKernel](https://github.com/AthennaIO/Http/blob/develop/src/Kernels/HttpKernel.ts)
custom kernel implementation taking a look at [HttpKernel](https://github.com/AthennaIO/Http/blob/develop/src/kernels/HttpKernel.ts)
implementation code.

:::
Expand All @@ -177,7 +177,7 @@ import { Ignite } from '@athenna/core'

const ignite = await new Ignite().load(import.meta.url)

await ignite.httpServer({ kernelPath: '#app/Http/CustomKernel' })'
await ignite.httpServer({ kernelPath: '#app/http/CustomKernel' })'
```

### Routes
Expand Down Expand Up @@ -272,7 +272,7 @@ export class CustomKernel extends ConsoleKernel {
:::note

You can check all the methods available for you to override in your custom
kernel implementation taking a look at [ConsoleKernel](https://github.com/AthennaIO/Artisan/blob/develop/src/Kernels/ConsoleKernel.ts) implementation code.
kernel implementation taking a look at [ConsoleKernel](https://github.com/AthennaIO/Artisan/blob/develop/src/kernels/ConsoleKernel.ts) implementation code.

:::

Expand All @@ -286,7 +286,7 @@ const ignite = await new Ignite().load(import.meta.url, {
bootLogs: false
})

await ignite.artisan({ kernelPath: '#app/Http/CustomKernel' })
await ignite.artisan({ kernelPath: '#app/http/CustomKernel' })
```

### Execution
Expand All @@ -303,7 +303,7 @@ executed the `hello` command defined in our `.athennarc.json` file:
{
"commands": {
"hello": {
"path": "#app/Console/Commands/HelloCommand",
"path": "#app/console/commands/HelloCommand",
"loadApp": false,
"stayAlive": false,
"loadAllCommands": false,
Expand Down
22 changes: 11 additions & 11 deletions docs/architecture-concepts/facades.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ registered inside the service container:

```typescript
import { Facade } from '@athenna/ioc'
import { Logger } from '#src/Logger/Logger'
import { Logger } from '#src/logger/Logger'

export const Log = Facade.createFor<Logger>('Athenna/Core/Logger')
```
Expand All @@ -123,13 +123,13 @@ The service container binding key is also included where applicable.

| Facade | Reference class | Binding alias |
|:----------|:-------:|-------------:|
| [Log](https://github.com/AthennaIO/Logger/blob/develop/src/Facades/Log.ts) | [Logger](https://github.com/AthennaIO/Logger/blob/develop/src/Logger/Logger.ts) | Athenna/Core/Logger |
| [Route](https://github.com/AthennaIO/Http/blob/develop/src/Facades/Route.ts) | [Router](https://github.com/AthennaIO/Http/blob/develop/src/Router/Router.ts) | Athenna/Core/HttpRoute |
| [Server](https://github.com/AthennaIO/Http/blob/develop/src/Facades/Server.ts) | [ServerImpl](https://github.com/AthennaIO/Http/blob/develop/src/Server/ServerImpl.ts) | Athenna/Core/HttpServer |
| [Mail](https://github.com/AthennaIO/Mail/blob/develop/src/Facades/Mail.ts) | [MailImpl](https://github.com/AthennaIO/Mail/blob/develop/src/Mail/MailImpl.ts) | Athenna/Core/Mail |
| [View](https://github.com/AthennaIO/View/blob/develop/src/Facades/View.ts) | [ViewImpl](https://github.com/AthennaIO/View/blob/develop/src/Views/ViewImpl.ts) | Athenna/Core/View |
| [Artisan](https://github.com/AthennaIO/Artisan/blob/develop/src/Facades/Artisan.ts) | [ArtisanImpl](https://github.com/AthennaIO/Artisan/blob/develop/src/Artisan/ArtisanImpl.ts) | Athenna/Core/Artisan |
| [Database](https://github.com/AthennaIO/Artisan/blob/develop/src/Facades/Artisan.ts) | [DatabaseImpl](https://github.com/AthennaIO/Database/blob/develop/src/Database/DatabaseImpl.ts) | Athenna/Core/Database |
| [Log](https://github.com/AthennaIO/Logger/blob/develop/src/facades/Log.ts) | [Logger](https://github.com/AthennaIO/Logger/blob/develop/src/logger/Logger.ts) | Athenna/Core/Logger |
| [Route](https://github.com/AthennaIO/Http/blob/develop/src/facades/Route.ts) | [Router](https://github.com/AthennaIO/Http/blob/develop/src/router/Router.ts) | Athenna/Core/HttpRoute |
| [Server](https://github.com/AthennaIO/Http/blob/develop/src/facades/Server.ts) | [ServerImpl](https://github.com/AthennaIO/Http/blob/develop/src/server/ServerImpl.ts) | Athenna/Core/HttpServer |
| [Mail](https://github.com/AthennaIO/Mail/blob/develop/src/facades/Mail.ts) | [MailImpl](https://github.com/AthennaIO/Mail/blob/develop/src/mail/MailImpl.ts) | Athenna/Core/Mail |
| [View](https://github.com/AthennaIO/View/blob/develop/src/facades/View.ts) | [ViewImpl](https://github.com/AthennaIO/View/blob/develop/src/views/ViewImpl.ts) | Athenna/Core/View |
| [Artisan](https://github.com/AthennaIO/Artisan/blob/develop/src/facades/Artisan.ts) | [ArtisanImpl](https://github.com/AthennaIO/Artisan/blob/develop/src/artisan/ArtisanImpl.ts) | Athenna/Core/Artisan |
| [Database](https://github.com/AthennaIO/Artisan/blob/develop/src/facades/Artisan.ts) | [DatabaseImpl](https://github.com/AthennaIO/Database/blob/develop/src/database/DatabaseImpl.ts) | Athenna/Core/Database |

## Writing facades

Expand All @@ -143,8 +143,8 @@ to resolve our dependency inside the [service container](/docs/architecture-conc
Now let's register all of our helpers inside the `register()` method:

```typescript
import { File } from '#app/Helpers/File'
import { String } from '#app/Helpers/String'
import { File } from '#app/helpers/File'
import { String } from '#app/helpers/String'
import { ServiceProvider } from '@athenna/ioc'

export class HelperProvider extends ServiceProvider {
Expand Down Expand Up @@ -175,7 +175,7 @@ generic type:

```typescript
import { Facade } from '@athenna/ioc'
import { String as StringImpl } from '#app/Helpers/String'
import { String as StringImpl } from '#app/helpers/String'

export const String = Facade.createFor<StringImpl>('App/Helpers/String')
```
Expand Down
34 changes: 17 additions & 17 deletions docs/architecture-concepts/service-container.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ constructor or, in some cases, "setter" methods.
Let's look at a simple example:

```typescript
import { Context, Controller } from '@athenna/http'
import { WelcomeService } from '#app/Services/WelcomeService'
import { Controller, type Context } from '@athenna/http'
import { WelcomeService } from '#app/services/WelcomeService'

@Controller()
export class WelcomeController {
Expand Down Expand Up @@ -60,7 +60,7 @@ annotation. For example, you may place the following code in your

```typescript
import { Route } from '@athenna/http'
import { Service } from '@athenna/core'
import { Service } from '@athenna/ioc'

@Service()
export class AppService {
Expand Down Expand Up @@ -96,7 +96,7 @@ The example above is just to show that we can place our services anywhere in our
application, without depending on configuration files or any other kind of
setup. We recommend you placing your services in a specifics directory to save
only your service classes and not inside your route file. A good place to put
your services is `app/Services` directory, since `make:service` command will
your services is `app/services` directory, since `make:service` command will
save your services there. But of course you can do whatever you want with
Athenna 😎.

Expand All @@ -113,8 +113,8 @@ the container to write this code, it is managing the injection of their
dependencies behind the scenes.

```typescript
import { Context, Controller } from '@athenna/http'
import { AppService } from '#app/Services/AppService'
import { AppService } from '#app/services/AppService'
import { Controller, type Context } from '@athenna/http'

@Controller()
export class AppController {
Expand Down Expand Up @@ -147,7 +147,7 @@ global property. We can register a binding using the `bind` method, passing the
alias name that we wish to register along with our dependency:

```typescript
import { StringNormalizer } from '#app/Helpers/StringNormalizer'
import { StringNormalizer } from '#app/helpers/StringNormalizer'

ioc.bind('App/Helpers/StringNormalizer', StringNormalizer)
```
Expand All @@ -160,7 +160,7 @@ resolved, a new object instance will be returned on subsequent calls into the
container:

```typescript
import { StringNormalizer } from '#app/Helpers/StringNormalizer'
import { StringNormalizer } from '#app/helpers/StringNormalizer'

ioc.transient('App/Helpers/StringNormalizer', StringNormalizer)
```
Expand All @@ -179,7 +179,7 @@ resolved one time. Once a singleton binding is resolved, the same object
instance will be returned on subsequent calls into the container:

```typescript
import { StringNormalizer } from '#app/Helpers/StringNormalizer'
import { StringNormalizer } from '#app/helpers/StringNormalizer'

ioc.singleton('App/Helpers/StringNormalizer', StringNormalizer)
```
Expand All @@ -191,7 +191,7 @@ You may also bind an existing object instance into the container using the
calls into the container:

```typescript
import { StringNormalizer } from '#app/Helpers/StringNormalizer'
import { StringNormalizer } from '#app/helpers/StringNormalizer'

ioc.instance('App/Helpers/StringNormalizer', new StringNormalizer())
```
Expand All @@ -203,7 +203,7 @@ resolve a class instance from the container. The use method accepts the alias
of the dependency you wish to resolve:

```typescript
import { StringNormalizer } from '#app/Helpers/StringNormalizer'
import { StringNormalizer } from '#app/helpers/StringNormalizer'

const sn = ioc.use<StringNormalizer>('App/Helpers/StringNormalizer')
```
Expand All @@ -224,8 +224,8 @@ constructor. The service will automatically be resolved and injected into the
class:

```typescript
import { Context, Controller } from '@athenna/http'
import { AppService } from '#app/Services/AppService'
import { AppService } from '#app/services/AppService'
import { Controller, type Context } from '@athenna/http'

@Controller()
export class AppController {
Expand All @@ -247,8 +247,8 @@ camelCase name of your dependency as the property name to be resolved properly:

```typescript
import { Inject } from '@athenna/ioc'
import { Context, Controller } from '@athenna/http'
import { AppService } from '#app/Services/AppService'
import { AppService } from '#app/services/AppService'
import { Controller, type Context } from '@athenna/http'

@Controller()
export class AppController {
Expand All @@ -268,8 +268,8 @@ specific alias to be resolved in the container:

```typescript
import { Inject } from '@athenna/ioc'
import { Context, Controller } from '@athenna/http'
import { AppService } from '#app/Services/AppService'
import { AppService } from '#app/services/AppService'
import { Controller, type Context } from '@athenna/http'

@Controller()
export class AppController {
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture-concepts/service-providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ which provides access to the service container:

```typescript
import { ServiceProvider } from '@athenna/ioc'
import { AppHelper } from '#app/Helpers/AppHelper'
import { AppHelper } from '#app/helpers/AppHelper'

export default class AppProvider extends ServiceProvider {
public register() {
Expand All @@ -86,7 +86,7 @@ the framework:

```typescript
import { ServiceProvider } from '@athenna/ioc'
import { AppHelper } from '#app/Helpers/AppHelper'
import { AppHelper } from '#app/helpers/AppHelper'

export default class AppProvider extends ServiceProvider {
public boot() {
Expand Down
18 changes: 9 additions & 9 deletions docs/cli-application/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ creating your own commands by extending the abstract class

In addition to the commands provided with Artisan, you may
build your own custom commands. Commands are typically stored
in the `app/Console/Commands` directory; however, you are
in the `app/console/commands` directory; however, you are
free to choose your own storage location as long as your
commands can be imported.

### Generating commands

To create a new command, you may use the `make:command`
Artisan command. This command will create a new command
class in the `app/Console/Commands` directory and register
class in the `app/console/commands` directory and register
it inside `commands` object of `.athennarc.json` file.
Don't worry if this directory does not exist in your
applicationβ€”it will be created the first time you run the
Expand Down Expand Up @@ -61,7 +61,7 @@ already define `"loadApp": true` for you:
{
"commands": {
"sendEmails": {
"path": "#app/Console/Commands/SendEmails",
"path": "#app/console/commands/SendEmails",
"loadApp": true
}
}
Expand All @@ -74,7 +74,7 @@ the `@Inject()` annotation:
```typescript
import { Inject } from '@athenna/ioc'
import { BaseCommand } from '@athenna/artisan'
import { MailgunService } from '#app/Services/MailgunService'
import { MailgunService } from '#app/services/MailgunService'

export class SendEmails extends BaseCommand {
public static signature(): string {
Expand Down Expand Up @@ -123,7 +123,7 @@ annotations on your commands. See the example:

```typescript
import { Inject } from '@athenna/ioc'
import { MailgunService } from '#app/Services/MailgunService'
import { MailgunService } from '#app/services/MailgunService'
import { Option, Argument, BaseCommand } from '@athenna/artisan'

export class SendEmails extends BaseCommand {
Expand Down Expand Up @@ -177,7 +177,7 @@ commands in `commands` object:
{
"commands": {
"send:email": { πŸ‘ˆ
"path": "#app/Console/Commands/SendEmails",
"path": "#app/console/commands/SendEmails",
"loadApp": true
}
}
Expand All @@ -202,7 +202,7 @@ object:
{
"commands": {
"sendEmails": { πŸ‘ˆ // All commands will be loaded
"path": "#app/Console/Commands/SendEmails",
"path": "#app/console/commands/SendEmails",
"loadApp": true
}
}
Expand All @@ -215,7 +215,7 @@ inside your command:

```typescript
import { Inject } from '@athenna/ioc'
import { MailgunService } from '#app/Services/MailgunService'
import { MailgunService } from '#app/services/MailgunService'
import { Option, Artisan, Argument, BaseCommand } from '@athenna/artisan'

export class SendEmails extends BaseCommand {
Expand Down Expand Up @@ -264,7 +264,7 @@ setting in your command:
{
"commands": {
"send:email": {
"path": "#app/Console/Commands/SendEmails",
"path": "#app/console/commands/SendEmails",
"loadApp": true,
"loadAllCommands": true πŸ‘ˆ // All commands will be loaded
}
Expand Down
Loading

0 comments on commit 1e9e946

Please sign in to comment.