File tree Expand file tree Collapse file tree 6 files changed +12
-14
lines changed Expand file tree Collapse file tree 6 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 11
11
- uses : actions/checkout@main
12
12
- uses : actions/setup-node@main
13
13
with :
14
- node-version : 20
14
+ node-version : 22
15
15
- name : ' Install packages'
16
16
run : yarn
17
17
Original file line number Diff line number Diff line change 14
14
- name : Setup Node.js
15
15
uses : actions/setup-node@v3
16
16
with :
17
- node-version : 18.x
17
+ node-version : 22
18
18
19
19
- name : Install dependencies with Yarn
20
20
uses : borales/actions-yarn@v4
Original file line number Diff line number Diff line change 1
- 20
1
+ 22
Original file line number Diff line number Diff line change 4
4
"description" : " The server part of the website nosgestesclimat.fr" ,
5
5
"main" : " ./dist/index.js" ,
6
6
"engines" : {
7
- "node" : " 20 "
7
+ "node" : " >=22 "
8
8
},
9
9
"scripts" : {
10
10
"prebuild" : " yarn clean" ,
27
27
"author" : " " ,
28
28
"license" : " MIT" ,
29
29
"dependencies" : {
30
- "@incubateur-ademe/nosgestesclimat" : " ^3.3.4 " ,
30
+ "@incubateur-ademe/nosgestesclimat" : " ^3.4.3 " ,
31
31
"@prisma/client" : " ^6.0.0" ,
32
32
"@publicodes/tools" : " ^1.2.5" ,
33
33
"@sentry/node" : " ^8.26.0" ,
Original file line number Diff line number Diff line change 1
1
import type { DottedName } from '@incubateur-ademe/nosgestesclimat'
2
2
import rules from '@incubateur-ademe/nosgestesclimat/public/co2-model.FR-lang.fr.json'
3
- import type { ParsedRules } from 'publicodes'
4
3
import { carbonMetric , waterMetric } from '../../constants/ngc'
5
4
import { engine } from '../../constants/publicode'
6
5
import type { Metric , Situation } from '../../types/types'
7
6
import { getSubcategories } from '../publicodes/getSubcategories'
8
7
import { safeEvaluate } from '../publicodes/safeEvaluate'
9
8
import { safeGetSituation } from '../situation/safeGetSituation'
10
9
10
+ type ParsedRules = ReturnType < ( typeof engine ) [ 'getParsedRules' ] >
11
+
11
12
const everyRules = new Set < DottedName > ( Object . keys ( rules ) as DottedName [ ] )
12
13
13
14
const categories = [
@@ -18,10 +19,7 @@ const categories = [
18
19
'services sociétaux' ,
19
20
] as const
20
21
21
- const computeMetricResults = (
22
- metric : Metric ,
23
- parsedRules : ParsedRules < DottedName >
24
- ) => ( {
22
+ const computeMetricResults = ( metric : Metric , parsedRules : ParsedRules ) => ( {
25
23
bilan : Number (
26
24
safeEvaluate ( { engine, expr : 'bilan' , metric } ) ?. nodeValue ?? 0
27
25
) ,
Original file line number Diff line number Diff line change 972
972
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3"
973
973
integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==
974
974
975
- " @incubateur-ademe/nosgestesclimat@^3.3.4 " :
976
- version "3.3.4 "
977
- resolved "https://registry.yarnpkg.com/@incubateur-ademe/nosgestesclimat/-/nosgestesclimat-3.3.4. tgz#16b93cb534407ef510d48120791fd0a2cc2d9ae5 "
978
- integrity sha512-VdQuG+TP9D0cZVipPHgW/J7boa36rFad62fzgSdMBz5895O9kWlNtmlEGHcQOv2joIDxUZxWWDSlJp73/m+JfQ ==
975
+ " @incubateur-ademe/nosgestesclimat@^3.4.3 " :
976
+ version "3.4.3 "
977
+ resolved "https://registry.yarnpkg.com/@incubateur-ademe/nosgestesclimat/-/nosgestesclimat-3.4.3. tgz#5046ea33495b0c916873c5e5a21bb3f85cde9ca1 "
978
+ integrity sha512-G7PNzDKqGFFR2//trr5P1Zw1UPue3rOJSkBLNdcJTIpjQIMt7fsntny8fleqv/d3cznBeJ3hQjM4qVZxZXU8lA ==
979
979
980
980
" @isaacs/cliui@^8.0.2 " :
981
981
version "8.0.2"
You can’t perform that action at this time.
0 commit comments