@ferrflow/doc 7.21.9 → 7.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/benchmarks.json +687 -687
- package/docs-en/ci/gitlab-ci.md +22 -4
- package/docs-en/configuration/config-file.md +8 -0
- package/docs-fr/ci/github-actions.md +4 -4
- package/docs-fr/ci/gitlab-ci.md +25 -7
- package/docs-fr/configuration/config-file.md +24 -16
- package/docs-fr/reference/errors.md +73 -73
- package/docs-fr-v4/ci/github-actions.md +4 -4
- package/docs-fr-v4/ci/gitlab-ci.md +3 -3
- package/docs-fr-v4/configuration/config-file.md +17 -17
- package/docs-fr-v4/reference/errors.md +73 -73
- package/docs-fr-v5/ci/github-actions.md +4 -4
- package/docs-fr-v5/ci/gitlab-ci.md +3 -3
- package/docs-fr-v5/configuration/config-file.md +16 -16
- package/docs-fr-v5/reference/errors.md +73 -73
- package/docs-fr-v6/ci/github-actions.md +4 -4
- package/docs-fr-v6/ci/gitlab-ci.md +3 -3
- package/docs-fr-v6/configuration/config-file.md +16 -16
- package/docs-fr-v6/reference/errors.md +73 -73
- package/package.json +1 -1
package/docs-en/ci/gitlab-ci.md
CHANGED
|
@@ -9,7 +9,9 @@ The official FerrFlow Docker image ships the binary and can be used directly as
|
|
|
9
9
|
|
|
10
10
|
```yaml title=".gitlab-ci.yml"
|
|
11
11
|
release:
|
|
12
|
-
image:
|
|
12
|
+
image:
|
|
13
|
+
name: ghcr.io/ferrlabs/ferrflow:latest
|
|
14
|
+
entrypoint: [""]
|
|
13
15
|
stage: release
|
|
14
16
|
script:
|
|
15
17
|
- ferrflow release
|
|
@@ -20,6 +22,10 @@ release:
|
|
|
20
22
|
when: on_success
|
|
21
23
|
```
|
|
22
24
|
|
|
25
|
+
The image's entrypoint is `ferrflow`, so `docker run ghcr.io/ferrlabs/ferrflow:latest check` works as is. GitLab runs a job's `script` through a shell instead, which is why every example here resets it with `entrypoint: [""]`. Without that line the job fails with `unrecognized subcommand 'sh'`.
|
|
26
|
+
|
|
27
|
+
The image ships `git`, trusts the checkout whatever user cloned it, and signs release commits as `FerrFlow <bot@ferrflow.com>`. To sign them as the person who triggered the pipeline instead, set `GIT_AUTHOR_NAME: $GITLAB_USER_NAME` and `GIT_AUTHOR_EMAIL: $GITLAB_USER_EMAIL` in the job variables.
|
|
28
|
+
|
|
23
29
|
<aside class="ferr-aside ferr-aside--warning"><div class="ferr-aside__body"><p>Make sure your CI runner clones with full history. Add <code>GIT_DEPTH: 0</code> to the job variables to disable shallow cloning.</p>
|
|
24
30
|
</div></aside>
|
|
25
31
|
|
|
@@ -27,7 +33,9 @@ release:
|
|
|
27
33
|
|
|
28
34
|
```yaml title=".gitlab-ci.yml"
|
|
29
35
|
release:
|
|
30
|
-
image:
|
|
36
|
+
image:
|
|
37
|
+
name: ghcr.io/ferrlabs/ferrflow:latest
|
|
38
|
+
entrypoint: [""]
|
|
31
39
|
variables:
|
|
32
40
|
GIT_DEPTH: 0 # full history: required for tag scanning
|
|
33
41
|
GITLAB_TOKEN: $CI_JOB_TOKEN
|
|
@@ -37,13 +45,21 @@ release:
|
|
|
37
45
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
38
46
|
```
|
|
39
47
|
|
|
48
|
+
## Using `CI_JOB_TOKEN`
|
|
49
|
+
|
|
50
|
+
The examples above pass the job token as `GITLAB_TOKEN: $CI_JOB_TOKEN`. FerrFlow recognises it because its value equals `CI_JOB_TOKEN`, and authenticates the way GitLab expects for a job token: API calls carry a `JOB-TOKEN` header and git pushes as `gitlab-ci-token`. The same applies when the job token is passed as `FERRFLOW_TOKEN`. Any other token (project, group or personal access token) is sent as `PRIVATE-TOKEN` and pushes as `oauth2`.
|
|
51
|
+
|
|
52
|
+
What a job token may do is set per project under **Settings > CI/CD > Job token permissions**. Pushing the release commit and tags needs **Allow Git push requests to the repository**. When GitLab refuses one of the API calls FerrFlow makes with a job token, use a project access token with the `api` scope instead.
|
|
53
|
+
|
|
40
54
|
## Using a deploy token
|
|
41
55
|
|
|
42
56
|
If `CI_JOB_TOKEN` doesn't have permission to push tags, create a project deploy token with `write_repository` access and store it as a CI variable:
|
|
43
57
|
|
|
44
58
|
```yaml title=".gitlab-ci.yml"
|
|
45
59
|
release:
|
|
46
|
-
image:
|
|
60
|
+
image:
|
|
61
|
+
name: ghcr.io/ferrlabs/ferrflow:latest
|
|
62
|
+
entrypoint: [""]
|
|
47
63
|
variables:
|
|
48
64
|
GIT_DEPTH: 0
|
|
49
65
|
GITLAB_TOKEN: $FERRFLOW_DEPLOY_TOKEN # CI variable with write_repository access
|
|
@@ -59,7 +75,9 @@ FerrFlow can post a comment on every merge request showing what versions will be
|
|
|
59
75
|
|
|
60
76
|
```yaml title=".gitlab-ci.yml"
|
|
61
77
|
ferrflow-preview:
|
|
62
|
-
image:
|
|
78
|
+
image:
|
|
79
|
+
name: ghcr.io/ferrlabs/ferrflow:latest
|
|
80
|
+
entrypoint: [""]
|
|
63
81
|
stage: test
|
|
64
82
|
variables:
|
|
65
83
|
GIT_DEPTH: 0
|
|
@@ -17,6 +17,14 @@ If no config file is found, FerrFlow auto-detects common version files in the cu
|
|
|
17
17
|
<aside class="ferr-aside ferr-aside--tip"><div class="ferr-aside__body"><p>Add <code>"$schema": "https://ferrflow.com/schema/ferrflow.json"</code> to your JSON config for editor autocompletion and validation.</p>
|
|
18
18
|
</div></aside>
|
|
19
19
|
|
|
20
|
+
FerrFlow warns about any key it does not recognise, in every config format and in included files, and suggests the closest valid key when there is one. The key is ignored and the command carries on:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Warning: unknown key `workspace.hooks.post-bump` in ferrflow.json, ignored. Did you mean `postBump`?
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
A misspelled option otherwise looks exactly like one left at its default, so treat these warnings as errors in your config.
|
|
27
|
+
|
|
20
28
|
## Config formats
|
|
21
29
|
|
|
22
30
|
<div class="ferr-tabs">
|
|
@@ -69,7 +69,7 @@ FerrFlow ajoute `[skip ci]` dans le message des commits de version par défaut p
|
|
|
69
69
|
|
|
70
70
|
## Commentaires de preview sur les PR
|
|
71
71
|
|
|
72
|
-
FerrFlow peut poster un commentaire sur chaque pull request montrant quelles versions seront
|
|
72
|
+
FerrFlow peut poster un commentaire sur chaque pull request montrant quelles versions seront bumpées au merge. Le commentaire est mis à jour automatiquement à chaque push.
|
|
73
73
|
|
|
74
74
|
```yaml title=".github/workflows/preview.yml"
|
|
75
75
|
name: FerrFlow Preview
|
|
@@ -95,15 +95,15 @@ jobs:
|
|
|
95
95
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
Si aucun changement publiable n'est
|
|
98
|
+
Si aucun changement publiable n'est détecté, le commentaire l'indique.
|
|
99
99
|
|
|
100
100
|
## Exemple monorepo
|
|
101
101
|
|
|
102
|
-
Dans un monorepo, FerrFlow publie chaque package
|
|
102
|
+
Dans un monorepo, FerrFlow publie chaque package modifié en une seule exécution :
|
|
103
103
|
|
|
104
104
|
```yaml
|
|
105
105
|
- uses: FerrLabs/ferrflow@v5
|
|
106
106
|
env:
|
|
107
107
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
108
|
-
#
|
|
108
|
+
# Crée api@v1.3.0 et site@v0.5.1 en une seule étape si les deux ont changé
|
|
109
109
|
```
|
package/docs-fr/ci/gitlab-ci.md
CHANGED
|
@@ -9,7 +9,9 @@ L'image Docker officielle FerrFlow embarque le binaire et peut être utilisée d
|
|
|
9
9
|
|
|
10
10
|
```yaml
|
|
11
11
|
release:
|
|
12
|
-
image:
|
|
12
|
+
image:
|
|
13
|
+
name: ghcr.io/ferrlabs/ferrflow:latest
|
|
14
|
+
entrypoint: [""]
|
|
13
15
|
stage: release
|
|
14
16
|
script:
|
|
15
17
|
- ferrflow release
|
|
@@ -20,6 +22,10 @@ release:
|
|
|
20
22
|
when: on_success
|
|
21
23
|
```
|
|
22
24
|
|
|
25
|
+
Le point d'entrée de l'image est `ferrflow`, donc `docker run ghcr.io/ferrlabs/ferrflow:latest check` fonctionne tel quel. GitLab, lui, exécute le `script` d'un job dans un shell : c'est pourquoi chaque exemple ici le réinitialise avec `entrypoint: [""]`. Sans cette ligne, le job échoue avec `unrecognized subcommand 'sh'`.
|
|
26
|
+
|
|
27
|
+
L'image embarque `git`, fait confiance au dépôt quel que soit l'utilisateur qui l'a cloné, et signe les commits de release `FerrFlow <bot@ferrflow.com>`. Pour les signer au nom de la personne qui a déclenché le pipeline, définissez `GIT_AUTHOR_NAME: $GITLAB_USER_NAME` et `GIT_AUTHOR_EMAIL: $GITLAB_USER_EMAIL` dans les variables du job.
|
|
28
|
+
|
|
23
29
|
<aside class="ferr-aside ferr-aside--warning"><div class="ferr-aside__body"><p>Assurez-vous que votre runner CI clone avec l'historique complet. Ajoutez <code>GIT_DEPTH: 0</code> aux variables du job pour désactiver le clonage superficiel.</p>
|
|
24
30
|
</div></aside>
|
|
25
31
|
|
|
@@ -27,7 +33,9 @@ release:
|
|
|
27
33
|
|
|
28
34
|
```yaml
|
|
29
35
|
release:
|
|
30
|
-
image:
|
|
36
|
+
image:
|
|
37
|
+
name: ghcr.io/ferrlabs/ferrflow:latest
|
|
38
|
+
entrypoint: [""]
|
|
31
39
|
variables:
|
|
32
40
|
GIT_DEPTH: 0 # historique complet : requis pour le scan des tags
|
|
33
41
|
GITLAB_TOKEN: $CI_JOB_TOKEN
|
|
@@ -37,13 +45,21 @@ release:
|
|
|
37
45
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
38
46
|
```
|
|
39
47
|
|
|
48
|
+
## Utiliser `CI_JOB_TOKEN`
|
|
49
|
+
|
|
50
|
+
Les exemples ci-dessus passent le token du job via `GITLAB_TOKEN: $CI_JOB_TOKEN`. FerrFlow le reconnaît parce que sa valeur est égale à `CI_JOB_TOKEN`, et s'authentifie comme GitLab l'attend pour un token de job : les appels d'API portent un en-tête `JOB-TOKEN` et git pousse en tant que `gitlab-ci-token`. C'est aussi le cas quand le token du job est passé dans `FERRFLOW_TOKEN`. Tout autre token (token d'accès de projet, de groupe ou personnel) est envoyé en `PRIVATE-TOKEN` et pousse en tant que `oauth2`.
|
|
51
|
+
|
|
52
|
+
Ce qu'un token de job a le droit de faire se règle par projet dans **Settings > CI/CD > Job token permissions**. Pousser le commit et les tags de release nécessite **Allow Git push requests to the repository**. Quand GitLab refuse un des appels d'API que FerrFlow fait avec un token de job, utilisez plutôt un token d'accès de projet avec le scope `api`.
|
|
53
|
+
|
|
40
54
|
## Utiliser un deploy token
|
|
41
55
|
|
|
42
56
|
Si `CI_JOB_TOKEN` n'a pas les permissions pour pousser des tags, créez un deploy token de projet avec l'accès `write_repository` et stockez-le comme variable CI :
|
|
43
57
|
|
|
44
58
|
```yaml
|
|
45
59
|
release:
|
|
46
|
-
image:
|
|
60
|
+
image:
|
|
61
|
+
name: ghcr.io/ferrlabs/ferrflow:latest
|
|
62
|
+
entrypoint: [""]
|
|
47
63
|
variables:
|
|
48
64
|
GIT_DEPTH: 0
|
|
49
65
|
GITLAB_TOKEN: $FERRFLOW_DEPLOY_TOKEN # variable CI avec accès write_repository
|
|
@@ -55,11 +71,13 @@ release:
|
|
|
55
71
|
|
|
56
72
|
## Commentaires de preview sur les MR
|
|
57
73
|
|
|
58
|
-
FerrFlow peut poster un commentaire sur chaque merge request montrant quelles versions seront
|
|
74
|
+
FerrFlow peut poster un commentaire sur chaque merge request montrant quelles versions seront bumpées au merge. Le commentaire est mis à jour automatiquement à chaque push.
|
|
59
75
|
|
|
60
76
|
```yaml title=".gitlab-ci.yml"
|
|
61
77
|
ferrflow-preview:
|
|
62
|
-
image:
|
|
78
|
+
image:
|
|
79
|
+
name: ghcr.io/ferrlabs/ferrflow:latest
|
|
80
|
+
entrypoint: [""]
|
|
63
81
|
stage: test
|
|
64
82
|
variables:
|
|
65
83
|
GIT_DEPTH: 0
|
|
@@ -70,10 +88,10 @@ ferrflow-preview:
|
|
|
70
88
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
71
89
|
```
|
|
72
90
|
|
|
73
|
-
Si aucun changement publiable n'est
|
|
91
|
+
Si aucun changement publiable n'est détecté, le commentaire l'indique.
|
|
74
92
|
|
|
75
93
|
Si vous stockez ce token dans une variable **protégée**, GitLab ne l'expose qu'aux pipelines des branches et tags protégés, et le pipeline d'une merge request venant d'une branche ordinaire tourne sans lui. FerrFlow affiche alors `Warning: preview comment not posted: no Gitlab token found in FERRFLOW_TOKEN or GITLAB_TOKEN` et le job réussit quand même. Retirez la protection de la variable, ou utilisez `CI_JOB_TOKEN`, que chaque job reçoit.
|
|
76
94
|
|
|
77
95
|
## GitLab Releases
|
|
78
96
|
|
|
79
|
-
Lorsque `GITLAB_TOKEN` est
|
|
97
|
+
Lorsque `GITLAB_TOKEN` est défini, FerrFlow crée une GitLab Release avec le changelog généré comme notes de release, de la même manière que l'intégration GitHub.
|
|
@@ -3,20 +3,28 @@ title: Configuration
|
|
|
3
3
|
description: Référence complète du fichier de configuration FerrFlow.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
FerrFlow supporte six formats de fichier de configuration,
|
|
6
|
+
FerrFlow supporte six formats de fichier de configuration, recherchés dans cet ordre :
|
|
7
7
|
|
|
8
8
|
1. `ferrflow.json`
|
|
9
9
|
2. `ferrflow.json5`
|
|
10
10
|
3. `ferrflow.toml`
|
|
11
|
-
4. `ferrflow.ts` (
|
|
12
|
-
5. `ferrflow.js` (
|
|
11
|
+
4. `ferrflow.ts` (nécessite `tsx`)
|
|
12
|
+
5. `ferrflow.js` (nécessite `node`)
|
|
13
13
|
6. `.ferrflow` (JSON)
|
|
14
14
|
|
|
15
|
-
Si aucun fichier de configuration n'est trouv
|
|
15
|
+
Si aucun fichier de configuration n'est trouvé, FerrFlow détecte automatiquement les fichiers de version courants dans le répertoire actuel.
|
|
16
16
|
|
|
17
17
|
<aside class="ferr-aside ferr-aside--tip"><div class="ferr-aside__body"><p>Ajoutez <code>"$schema": "https://ferrflow.com/schema/ferrflow.json"</code> à votre configuration JSON pour l'autocomplétion et la validation dans votre éditeur.</p>
|
|
18
18
|
</div></aside>
|
|
19
19
|
|
|
20
|
+
FerrFlow signale toute clé qu'il ne reconnaît pas, quel que soit le format de configuration et y compris dans les fichiers inclus, et propose la clé valide la plus proche quand il y en a une. La clé est ignorée et la commande continue :
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Warning: unknown key `workspace.hooks.post-bump` in ferrflow.json, ignored. Did you mean `postBump`?
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Sans cet avertissement, une option mal orthographiée ressemble en tout point à une option laissée à sa valeur par défaut : traitez-le comme une erreur dans votre configuration.
|
|
27
|
+
|
|
20
28
|
## Formats de configuration
|
|
21
29
|
|
|
22
30
|
<div class="ferr-tabs">
|
|
@@ -88,19 +96,19 @@ format = "toml"
|
|
|
88
96
|
</div></div>
|
|
89
97
|
</div>
|
|
90
98
|
|
|
91
|
-
<aside class="ferr-aside ferr-aside--note"><div class="ferr-aside__body"><p>Les configurations JSON, JSON5, et TypeScript/JavaScript utilisent des
|
|
92
|
-
La configuration TOML utilise des
|
|
93
|
-
Toutes les formes sont
|
|
99
|
+
<aside class="ferr-aside ferr-aside--note"><div class="ferr-aside__body"><p>Les configurations JSON, JSON5, et TypeScript/JavaScript utilisent des clés en <strong>camelCase</strong> (<code>tagTemplate</code>, <code>versionedFiles</code>).
|
|
100
|
+
La configuration TOML utilise des clés en <strong>snake_case</strong> (<code>tag_template</code>, <code>versioned_files</code>).
|
|
101
|
+
Toutes les formes sont équivalentes.</p>
|
|
94
102
|
</div></aside>
|
|
95
103
|
|
|
96
104
|
### Configurations TypeScript et JavaScript
|
|
97
105
|
|
|
98
|
-
Les fichiers de config TypeScript (`.ts`) et JavaScript (`.js`) utilisent un export ESM par
|
|
106
|
+
Les fichiers de config TypeScript (`.ts`) et JavaScript (`.js`) utilisent un export ESM par défaut. L'export peut être un objet ou une fonction asynchrone.
|
|
99
107
|
|
|
100
|
-
<aside class="ferr-aside ferr-aside--warning"><div class="ferr-aside__body"><p>Les configs TypeScript
|
|
108
|
+
<aside class="ferr-aside ferr-aside--warning"><div class="ferr-aside__body"><p>Les configs TypeScript nécessitent <code>tsx</code> (<code>npm install -g tsx</code>). Les configs JavaScript nécessitent <code>node</code> (v18+).</p>
|
|
101
109
|
</div></aside>
|
|
102
110
|
|
|
103
|
-
L'avantage principal des configs TS/JS : les **hooks sous forme de fonctions**. Au lieu de commandes shell, vous pouvez
|
|
111
|
+
L'avantage principal des configs TS/JS : les **hooks sous forme de fonctions**. Au lieu de commandes shell, vous pouvez écrire des hooks natifs avec accès complet au contexte :
|
|
104
112
|
|
|
105
113
|
```ts title="ferrflow.ts"
|
|
106
114
|
export default {
|
|
@@ -129,19 +137,19 @@ export default {
|
|
|
129
137
|
|
|
130
138
|
#### Objet de contexte des hooks
|
|
131
139
|
|
|
132
|
-
Les hooks en fonction
|
|
140
|
+
Les hooks en fonction reçoivent un objet de contexte avec ces champs :
|
|
133
141
|
|
|
134
142
|
| Champ | Type | Description |
|
|
135
143
|
| -------------- | -------------- | ---------------------------------------------------------------------------- |
|
|
136
144
|
| `package` | string | Nom du package |
|
|
137
|
-
| `oldVersion` | string | Version avant le bump (vide pour la
|
|
138
|
-
| `newVersion` | string | Version
|
|
145
|
+
| `oldVersion` | string | Version avant le bump (vide pour la première release) |
|
|
146
|
+
| `newVersion` | string | Version après le bump |
|
|
139
147
|
| `bumpType` | string | `major`, `minor`, `patch`, ou `none` |
|
|
140
148
|
| `tag` | string | Nom complet du tag git |
|
|
141
149
|
| `dryRun` | boolean | Vrai si `--dry-run` est actif |
|
|
142
150
|
| `packagePath` | string | Chemin absolu vers la racine du package |
|
|
143
|
-
| `channel` | string ou null | Nom du channel de pr
|
|
144
|
-
| `isPrerelease` | boolean | Vrai si c'est une pr
|
|
151
|
+
| `channel` | string ou null | Nom du channel de pré-release |
|
|
152
|
+
| `isPrerelease` | boolean | Vrai si c'est une pré-release |
|
|
145
153
|
| `monorepo` | boolean | Vrai si c'est une release monorepo |
|
|
146
154
|
| `changelog` | string | Section de changelog rendue pour ce bump (markdown) |
|
|
147
155
|
| `commits` | array | `{ hash, message, type?, scope?, breaking }` par commit du bump |
|
|
@@ -165,7 +173,7 @@ export default {
|
|
|
165
173
|
};
|
|
166
174
|
```
|
|
167
175
|
|
|
168
|
-
Les hooks sous forme de commandes shell et de fonctions peuvent
|
|
176
|
+
Les hooks sous forme de commandes shell et de fonctions peuvent être mélangés dans la même config.
|
|
169
177
|
|
|
170
178
|
## `workspace`
|
|
171
179
|
|