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

v4.3.0 #1244

Merged
merged 16 commits into from
Apr 16, 2024
Merged

v4.3.0 #1244

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
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:

mysql:
image: "mysql:5.7.30"
# For MacBook with Apple chips, use the following platform instead.
# platform: linux/amd64
ports:
# Another version of MySQL is installed on the vm and already uses the port 3306.
- "3308:3306"
Expand Down
58 changes: 58 additions & 0 deletions docs/blog/2024-04-16-version-4.3-release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Version 4.3 release notes
author: Loïc Poullain
author_title: Creator of FoalTS. Software engineer.
author_url: https://loicpoullain.com
author_image_url: https://avatars1.githubusercontent.com/u/13604533?v=4
image: blog/twitter-banners/version-4.3-release-notes.png
tags: [release]
---

![Banner](./assets/version-4.3-is-here/banner.png)

Version 4.3 of [Foal](https://foalts.org/) is out!

<!--truncate-->

## Better CLI ouput when script arguments are invalid

Previously, when executing `foal run my-script` with invalid arguments, the CLI would only display one error at a time.

For example, with the following schema and arguments, we would only get this error message:

```typescript
export const schema = {
type: 'object',
properties: {
email: { type: 'string', format: 'email', maxLength: 2 },
password: { type: 'string' },
n: { type: 'number', maximum: 10 }
},
required: ['password']
};
```

```bash
foal run my-script email=bar n=11
```

```
Error: The command line arguments must match format "email".
```

From version 4.3 onwards, the CLI logs all validation errors and with a more meaningful description.

```
Script error: arguments must have required property 'password'.
Script error: the value of "email" must NOT have more than 2 characters.
Script error: the value of "email" must match format "email".
Script error: the value of "n" must be <= 10.
```

## [Fix] the logger no longer throws an error in development when the client request is interrupted

Using the logger's `dev` format, Foal would occasionally throw the error `TypeError: Cannot read properties of null`.

This would occur when the connection with the client was lost, which happens, for example, when the React client server hotly reloads.

This version fixes this error.
Binary file added docs/blog/assets/version-4.3-is-here/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ foal run create-todo text="Write tests"

> Note that if you try to create a new to-do without specifying the text argument, you'll get the error below.
>
> `Error: The command line arguments should have required property 'text'.`
> `Script error: arguments must have required property 'text'.`
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ foal run create-todo text="Write tests"

> Observe que si intenta crear una nueva tarea sin especificar el argumento del texto, obtendrá el siguiente error.
>
> `Error: The command line arguments should have required property 'text'.`
> `Script error: arguments must have required property 'text'.`
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ foal run create-todo text="Write tests"

> Notez que si vous essayez de créer une nouvelle tâche sans spécifier l'argument texte, vous obtiendrez l'erreur ci-dessous.
>
> `Error: The command line arguments should have required property 'text'.`
> `Script error: arguments must have required property 'text'.`
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ foal run create-todo text="Write tests"

> Note that if you try to create a new to-do without specifying the text argument, you'll get the error below.
>
> `Error: The command line arguments should have required property 'text'.`
> `Script error: arguments must have required property 'text'.`
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"packages": [
"packages/*"
],
"version": "4.2.0"
"version": "4.3.0"
}
88 changes: 48 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
},
"homepage": "https://github.com/FoalTS/foal#readme",
"devDependencies": {
"@types/mocha": "10.0.1",
"mocha": "~10.2.0",
"@types/mocha": "10.0.6",
"mocha": "~10.3.0",
"tslint": "~6.1.3",
"typescript": "~4.9.5",
"lerna": "~6.0.1"
Expand Down
Loading
Loading