Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release for Adonis 6 #6

Merged
merged 24 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .bin/test.js

This file was deleted.

22 changes: 0 additions & 22 deletions .editorconfig

This file was deleted.

93 changes: 93 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 21

- name: Install pnpm
run: |
corepack enable
corepack prepare pnpm@latest --activate

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint

typecheck:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 21

- name: Install pnpm
run: |
corepack enable
corepack prepare pnpm@latest --activate

- name: Install dependencies
run: pnpm install

- name: Typecheck
run: pnpm typecheck

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 21

- name: Install pnpm
run: |
corepack enable
corepack prepare pnpm@latest --activate

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

tests:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21

- name: Install pnpm
run: |
corepack enable
corepack prepare pnpm@latest --activate

- name: Install dependencies
run: pnpm install

- name: Run tests
run: FORCE_COLOR=1 pnpm test
8 changes: 0 additions & 8 deletions .prettierignore

This file was deleted.

14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
## Installation

```
npm i --save-dev adonis-sail
pnpm i --save-dev adonis-sail
node ace configure adonis-sail
node ace sail:install
```

## Available services
Expand All @@ -30,12 +31,12 @@ Make sure to install needed Adonis Package, and follow instructions before runni

Now you can set your environment variables. Many of these will also be used in the generated docker-compose (look inside once created to know which ones). Especially the *_PORT or *_PASSWORD.

Once this is done you can run the command `node ace sail:install` and select the services you want. A `docker-compose.yml` file will be created at the root of your project, you now just have to launch it by doing `docker-compose up -d`.
Once this is done you can run the command `node ace sail:install` and select the services you want. A `compose.yml` file will be created at the root of your project, you now just have to launch it by doing `docker compose up -d`.

You can launch again the `node ace sail:install` command at any time to add new services.

## MinIO
If you plan to use Amazon S3 to store files while running your application in its production environment, you may wish to install the MinIO service when installing Sail. MinIO provides an S3 compatible API that you may use to develop locally using Adonis's s3 storage driver without creating "test" storage buckets in your production S3 environment. If you choose to install MinIO while installing Sail, a MinIO configuration section will be added to your application's docker-compose.yml file.
If you plan to use Amazon S3 to store files while running your application in its production environment, you may wish to install the MinIO service when installing Sail. MinIO provides an S3 compatible API that you may use to develop locally using Adonis's s3 storage driver without creating "test" storage buckets in your production S3 environment. If you choose to install MinIO while installing Sail, a MinIO configuration section will be added to your application's compose.yml file.

You will need to [install the official Adonis drive-s3](https://docs.adonisjs.com/guides/drive#s3-driver) package to use MinIO locally. So install the package by following the documentation correctly, then in your .env file, use these variables :

Expand Down Expand Up @@ -92,6 +93,11 @@ In `config/mail.ts`, remove the `auth` part in the smtp configuration object.

You can now access the MailHog dashboard at http://localhost:8025/ to preview emails.

## Mailpit
Mailpit is an alternative to MailHog. It's a service that allows you to preview emails sent by your application during local development.

You can follow the same steps as for MailHog, and also access the Mailpit dashboard at http://localhost:8025/

## Known issues
### MySQL 8
If you are using MySQL 8 (the default image), and you encounter the following error:
Expand Down Expand Up @@ -120,5 +126,3 @@ mysql: {
## Details
Currently, the Adonis application is not dockerised. I rarely encountered problems on my applications depending on the version of Node.JS I use (it happens, but with a tool like `nvm` it's usually fixed pretty quickly).
And it's obviously easier to handle your Adonis application when it's running outside a docker container. That's why I decided not to dockerise the Adonis app.

If you think it's really necessary to dockerise the Adonis application in local development, let me know and we'll see what we can do !
43 changes: 43 additions & 0 deletions bin/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { join } from 'node:path'
import { assert } from '@japa/assert'
import { snapshot } from '@japa/snapshot'
import { getDirname } from '@poppinss/utils'
import { fileSystem } from '@japa/file-system'
import { expectTypeOf } from '@japa/expect-type'
import { processCLIArgs, configure, run } from '@japa/runner'

/*
|--------------------------------------------------------------------------
| Configure tests
|--------------------------------------------------------------------------
|
| The configure method accepts the configuration to configure the Japa
| tests runner.
|
| The first method call "processCliArgs" process the command line arguments
| and turns them into a config object. Using this method is not mandatory.
|
| Please consult japa.dev/runner-config for the config docs.
*/
processCLIArgs(process.argv.slice(2))
configure({
files: ['tests/**/*.spec.ts'],
plugins: [
assert(),
fileSystem({
basePath: join(getDirname(import.meta.url), '..', 'tests', '__app'),
}),
expectTypeOf(),
snapshot(),
],
})

/*
|--------------------------------------------------------------------------
| Run tests
|--------------------------------------------------------------------------
|
| The following "run" method is required to execute all the tests.
|
*/
run()
115 changes: 0 additions & 115 deletions commands/InstallSail.ts

This file was deleted.

1 change: 0 additions & 1 deletion commands/index.ts

This file was deleted.

Loading