Skip to content

fix: upgrade pkgs + fix some bugs in scripts - [NGC-261] #2180

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

9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/réflexion.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
---
name: Réflexion ou contribution
name: Réflexion ou contribution
about: Apportez votre contribution à nosgestesclimat
title: ''
labels: contribution
assignees: ''

---

## Votre idée ou question n'exite-t-elle pas déjà ?
## Votre idée ou question n'exite-t-elle pas déjà ?

Il y a presque 200 issues sur [nosgestesclimat](https://github.com/datagir/nosgestesclimat/issues) et 200 autres sur [nosgestesclimat-site](https://github.com/datagir/nosgestesclimat-site/issues). Prenez un peu de temps pour chercher avec quelques mots clefs si votre réflexion n'existe pas déjà.

## C'est parti !
## C'est parti !

Si vous n'avez rien trouvé, c'est parti :)
Si vous n'avez rien trouvé, c'est parti :)
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"bracketSpacing": true,
"semi": false,
"singleQuote": true
"singleQuote": true,
"trailingComma": "none"
}
24 changes: 12 additions & 12 deletions PRIORISATION.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# 🎨 Méthodologie de priorisation des sujets modèle

*Une façon d’objectiver l’intérêt d’implémenter tel ou tel sujet manquant sur le modèle (ou présent uniquement en macro)*
_Une façon d’objectiver l’intérêt d’implémenter tel ou tel sujet manquant sur le modèle (ou présent uniquement en macro)_

Quels critères pouvons-nous utiliser pour objectiver l’intéret d’un nouveau sujet :

- **Quantité de la population concernée** : note sur 4
1. Moins de 1% population
2. Plus de 1% de la population
3. Plus de 5% de la population
4. Plus de 20% de la population
1. Moins de 1% population
2. Plus de 1% de la population
3. Plus de 5% de la population
4. Plus de 20% de la population
- **Poids carbone** : note sur 4 (en ordre de grandeur)
1. Quelques kilos
2. Quelques dizaines de kilos
3. Quelques centaines de kilos
4. Quelques tonnes
1. Quelques kilos
2. Quelques dizaines de kilos
3. Quelques centaines de kilos
4. Quelques tonnes
- **Disponibilité de la donnée** : note de 0 (0 : on n’a rien trouvé) à 2
1. Données dispos en partie / sources non ADEME
2. Données toutes disponibles et sources au top
1. Données dispos en partie / sources non ADEME
2. Données toutes disponibles et sources au top

La somme de ces 3 facteurs donne une note sur 10.

> 🚬 Exemple pour [le tabac](https://github.com/incubateur-ademe/nosgestesclimat/issues/135) : **7/10**
>
>
> - 25% de la population : 4
> - Sup 50 kg : 2
> - Dispo de la donnée : 1 (oui mais pas ADEME)
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<div align="center">
<h3 align="center">
<big>Nos Gestes Climat</big>
Expand All @@ -12,6 +11,7 @@
</p>

<!-- ![CI][ci-link] ![NPM][npm-link] -->

Modèle de calcul de l'empreinte climat personnelle.

</div>
Expand All @@ -27,11 +27,11 @@ yarn add @incubateur-ademe/nosgestesclimat
```

```ts
import { rules } from "@incubateur-ademe/nosgestesclimat";
import Engine from "publicodes";
import { rules } from '@incubateur-ademe/nosgestesclimat'
import Engine from 'publicodes'

const engine = new Engine(rules);
console.log(engine.evaluate("bilan"))
const engine = new Engine(rules)
console.log(engine.evaluate('bilan'))
```

## Écriture des modèles du simulateur
Expand Down Expand Up @@ -84,15 +84,15 @@ développement.
Pour chaque _pull request_, les actions suivantes sont exécutées :

- `upload-compilation-result.yaml` : compile les modèles et les personas (`yarn compile`) et exécute
les tests (`yarn test:personas` et `yarn test:optim`)
les tests (`yarn test:personas` et `yarn test:optim`)
- `pr-updater.yaml` : utilise l'artifact généré par
`upload-compilation-result.yaml` pour mettre à jour la PR avec les résultats
de la compilation et des tests

Pour chaque _push_ sur la branche `master`, le workflow `packaging.yaml` est exécuté.
Si la version du paquet npm est incrémentée, alors :

- une nouvelle _release_ GitHub est créée
- une nouvelle _release_ GitHub est créée
- la version française du modèle (le résultat de `yarn build`) est publiée dans
une nouvelle version du paquet npm
[`@incubateur-ademe/nosgestesclimat`](https://www.npmjs.com/package/@incubateur-ademe/nosgestesclimat)
Expand Down
2 changes: 1 addition & 1 deletion build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const destPath = 'nosgestesclimat.model.json'

const model = getModelFromSource('data', {
ignore: ['data/i18n/**'],
verbose: true,
verbose: true
})

try {
Expand Down
14 changes: 9 additions & 5 deletions docs/_Sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@

1. [**Home**](https://github.com/datagir/nosgestesclimat/wiki)
2. [**Documentation**](https://github.com/datagir/nosgestesclimat/wiki/Documentation)
- [Online rules documentation](https://github.com/datagir/nosgestesclimat/wiki/Documentation#online-rules-documentation)
- [_Guide Services Sociétaux_ (French)](https://github.com/datagir/nosgestesclimat/wiki/Guide-technique-services-sociétaux)

- [Online rules documentation](https://github.com/datagir/nosgestesclimat/wiki/Documentation#online-rules-documentation)
- [_Guide Services Sociétaux_ (French)](https://github.com/datagir/nosgestesclimat/wiki/Guide-technique-services-sociétaux)

3. [**Publicodes**](https://github.com/datagir/nosgestesclimat/wiki/Publicodes)
- [Packaging](https://github.com/datagir/nosgestesclimat/wiki/Publicodes#packaging)
- [Custom mechanisms](https://github.com/datagir/nosgestesclimat/wiki/Publicodes#custom-mechanisms)
- [`mosaic`](https://github.com/datagir/nosgestesclimat/wiki/mosaic)

- [Packaging](https://github.com/datagir/nosgestesclimat/wiki/Publicodes#packaging)
- [Custom mechanisms](https://github.com/datagir/nosgestesclimat/wiki/Publicodes#custom-mechanisms)
- [`mosaic`](https://github.com/datagir/nosgestesclimat/wiki/mosaic)

4. [**Translation**](https://github.com/datagir/nosgestesclimat/wiki/Translation)
- [Configuration](https://github.com/datagir/nosgestesclimat/wiki/Translation#configuration)
- [Available languages](https://github.com/datagir/nosgestesclimat/wiki/Translation#available-languages)
Expand Down
150 changes: 75 additions & 75 deletions docs/translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@

<!-- vim-markdown-toc GitLab -->

* [Configuration](#configuration)
* [DeepL API key](#deepl-api-key)
* [Dev dependencies](#dev-dependencies)
* [Available languages](#available-languages)
* [Architecture](#architecture)
* [Workflow](#workflow)
* [Modification of the `./data` files](#modification-of-the-data-files)
* [Modification of the `./personas` files](#modification-of-the-personas-files)
* [Improving an existing translation](#improving-an-existing-translation)
* [Contribution guide for translation from GitHub](#contribution-guide-for-translation-from-github)
* [Translating region models](#translating-region-models)
* [Available scripts](#available-scripts)
* [`translate-rules.js`](#translate-rulesjs)
* [`check-translation.js`](#check-translationjs)
* [`rulesToJSON.js`](#rulestojsonjs)
* [`translate-personas.js`](#translate-personasjs)
* [`personasToJSON.js`](#personastojsonjs)
* [`check-personas.js`](#check-personasjs)
* [`translateRegionModel.js`](#translateregionmodeljs)
- [Configuration](#configuration)
- [DeepL API key](#deepl-api-key)
- [Dev dependencies](#dev-dependencies)
- [Available languages](#available-languages)
- [Architecture](#architecture)
- [Workflow](#workflow)
- [Modification of the `./data` files](#modification-of-the-data-files)
- [Modification of the `./personas` files](#modification-of-the-personas-files)
- [Improving an existing translation](#improving-an-existing-translation)
- [Contribution guide for translation from GitHub](#contribution-guide-for-translation-from-github)
- [Translating region models](#translating-region-models)
- [Available scripts](#available-scripts)
- [`translate-rules.js`](#translate-rulesjs)
- [`check-translation.js`](#check-translationjs)
- [`rulesToJSON.js`](#rulestojsonjs)
- [`translate-personas.js`](#translate-personasjs)
- [`personasToJSON.js`](#personastojsonjs)
- [`check-personas.js`](#check-personasjs)
- [`translateRegionModel.js`](#translateregionmodeljs)

<!-- vim-markdown-toc -->

Expand Down Expand Up @@ -58,14 +58,15 @@ running:
```
yarn install
```

## Available languages

Currently, the model and the website UI are available in:

* `fr` -- is the reference language.
* `en-us` -- has been review by hand.
* `es` -- automatically generated.
* `it` -- automatically generated.
- `fr` -- is the reference language.
- `en-us` -- has been review by hand.
- `es` -- automatically generated.
- `it` -- automatically generated.

## Architecture

Expand Down Expand Up @@ -130,26 +131,25 @@ simply send your suggestion in a mail to: [email protected].
1. The first step consists of finding the file where is stored the targeted
translation. You can refer to the [dedicated section](#architecture) or
search for it from with the GitHub search bar:
1. Press `/` and paste the searched text.
2. Choose the `In this repository` choice.
3. Look at `code results` and click on the corresponding file name.
1. Press `/` and paste the searched text.
2. Choose the `In this repository` choice.
3. Look at `code results` and click on the corresponding file name.
2. Once you've found the file, you need to edit it.
1. Select the `master` branch on the button -- at the left of the file
path.
2. Then, press `E` to edit the file -- or click in the pencil button. By
pressing `.` you can open the file in the GitHub online editor.
3. Click on the text, and press `Ctrl-F` to search for the specific
translation.
4. Now, you can edit the translation text.
> Make sure to not edit `.lock` attributes, its corresponds to reference
> value to translate from.
5. When all changes have been made, go to the bottom of the page under the `Commit
changes` section. Enter in the first text field:
```
fix(t9n): update translation in the <edited_filename>.
```
1. Select the `master` branch on the button -- at the left of the file
path.
2. Then, press `E` to edit the file -- or click in the pencil button. By
pressing `.` you can open the file in the GitHub online editor.
3. Click on the text, and press `Ctrl-F` to search for the specific
translation.
4. Now, you can edit the translation text.
> Make sure to not edit `.lock` attributes, its corresponds to reference
> value to translate from.
5. When all changes have been made, go to the bottom of the page under the `Commit
changes` section. Enter in the first text field:
` fix(t9n): update translation in the <edited_filename>.
`
3. Finally, select the `Create a new branch for this commit and start a pull
request.` option. You can add more information if you want about your
request.` option. You can add more information if you want about your
translation before clicking on the `Create pull request` button to open the
pull request.

Expand Down Expand Up @@ -178,19 +178,19 @@ This script allows to automatically translate the model's rules by using the Dee

The translated [_mécanismes_](https://publi.codes/docs/m%C3%A9canismes) are:

* `titre`
* `description`
* `question`
* `résumé`
* `note`
* `suggestions`
* `mosaique`
- `titre`
- `description`
- `question`
- `résumé`
- `note`
- `suggestions`
- `mosaique`

> To run with `yarn`:
> To run with `yarn`:
>
> ```
> yarn translate:rules -h
> ```
> ```
> yarn translate:rules -h
> ```

**The method**

Expand Down Expand Up @@ -219,11 +219,11 @@ by the ones present in the corresponding `translated-rules-<lang>.yaml` file.

This script allows to get missing model's rules translations.

> To run with `yarn`:
> To run with `yarn`:
>
> ```
> yarn check:rules -h
> ```
> ```
> yarn check:rules -h
> ```

### `rulesToJSON.js`

Expand All @@ -233,27 +233,27 @@ engine.

It generates `public/co2-<lang>.json` files.

> To run with `yarn`:
> To run with `yarn`:
>
> ```
> yarn compile:rules -h
> ```
> ```
> yarn compile:rules -h
> ```

### `translate-personas.js`

This script allows to automatically translate the personas by using the DeepL API.

The translated [_mécanismes_](https://publi.codes/docs/m%C3%A9canismes) are:

* `nom`
* `description`
* `résumé`
- `nom`
- `description`
- `résumé`

> To run with `yarn`:
> To run with `yarn`:
>
> ```
> yarn translate:personas -h
> ```
> ```
> yarn translate:personas -h
> ```

**The method**

Expand Down Expand Up @@ -289,21 +289,21 @@ each [supported language](#available-languages).

It generates `public/personas-<lang>.json` files.

> To run with `yarn`:
> To run with `yarn`:
>
> ```
> yarn compile:personas -h
> ```
> ```
> yarn compile:personas -h
> ```

### `check-personas.js`

This script allows to get missing personas translations.

> To run with `yarn`:
> To run with `yarn`:
>
> ```
> yarn check:personas -h
> ```
> ```
> yarn check:personas -h
> ```

### `translateRegionModel.js`

Expand Down
Loading