Déplace les règles vers source/rules

pull/960/head
Maxime Quandalle 2020-04-05 23:27:31 +02:00
parent 0a03b7550c
commit 6424f2e197
No known key found for this signature in database
GPG Key ID: 428641C03D29CA10
61 changed files with 130 additions and 8769 deletions

View File

@ -99,7 +99,7 @@ Le site est disponible en français, et en anglais sur https://mycompanyinfrance
Les traductions se trouvent dans le répertoire `source/locales`.
La librairie utilisée pour la traduction de l'Ui est
La librairie utilisée pour la traduction de l'UI est
[react-i18next](https://react.i18next.com/).
Lorsque l'on introduit une nouvelle chaîne de caractère dans l'UI il faut
@ -114,7 +114,7 @@ $ yarn run i18n:rules:check
$ yarn run i18n:ui:check
```
Pour traduire automatiquement les chaînes manquantes via l'api deepl :
Pour traduire automatiquement les chaînes manquantes via l'api Deepl :
```sh
$ yarn run i18n:rules:translate
@ -126,17 +126,25 @@ N'oubliez pas de vérifier le diff que rien n'est choquant.
### CI/CD
- [CircleCI](https://circleci.com/) s'occupe de faire tourner les builds et
tests.
tests.
- [Netlify](https://www.netlify.com/), s'occupe de lhébergement du site sur Internet
sur internet avec gestion des DNS.
sur internet avec gestion des DNS.
## Documentation
### Publicodes
Le code publicodes, relatif aux règles, est dans le dossier `publicodes`. Vous y trouverez notamment un README qui vous initiera au langage.
Un tutoriel sur publicode est disponible sur https://publi.codes.
Pour information, un wiki contenant des informations intéressantes sur publicodes et le raisonnement ayant abouti à ce langage sont dispos sur le repository [betagouv/publicodes](https://github.com/betagouv/publicodes/wiki), qui est par ailleurs inutilisé.
Un wiki contenant des informations intéressantes sur publicode et le
raisonnement ayant abouti à ce langage sont dispos sur le repository
[betagouv/publicodes](https://github.com/betagouv/publicodes/wiki), qui est par
ailleurs inutilisé.
Pour se familiariser avec les règles, vous pouvez jeter un oeil aux fichiers contenant les règles elles-mêmes (dans le dossier `publicodes/rules`) mais cela peut s'avérer assez abrupt.
Essayez plutôt de jeter un oeil [aux tests](./test/mécanismes/expressions.yaml) dans un premier temps, puis au [mécanismes en place](./source/engine/mecanisms.yaml).
Pour se familiariser avec les règles, vous pouvez jeter un œil aux fichiers
contenant les règles elles-mêmes (dans le dossier `source/rules`) mais cela peut
s'avérer assez abrupt.
Essayez plutôt de jeter un oeil [aux tests](./test/mécanismes/expressions.yaml)
dans un premier temps, puis au [mécanismes en
place](./source/engine/mecanisms.yaml).

View File

@ -2,7 +2,7 @@
This repository powers [mycompanyinfrance.fr](https://mycompanyinfrance.fr) and [mon-entreprise.fr](https://mon-entreprise.fr) and [publi.codes](https://publi.codes).
The hiring simulator, available on both websites, embeds a [model](https://github.com/betagouv/mon-entreprise/blob/master/publicode/rules) of the french tax system as a YAML domain specific language. It enables displaying the computing rules on the Web and having a single source of logic for both the computation engine (a JS library) and the generated end-user conversation-like form.
The hiring simulator, available on both websites, embeds a [model](https://github.com/betagouv/mon-entreprise/blob/master/source/rules) of the french tax system as a YAML domain specific language. It enables displaying the computing rules on the Web and having a single source of logic for both the computation engine (a JS library) and the generated end-user conversation-like form.
The engine with the French tax law is available as a NPM module and explained [on the wiki](https://github.com/betagouv/mon-entreprise/wiki/Librairie-de-calcul).

View File

@ -1,45 +0,0 @@
// Currenty we systematically bundle all the rules even if we only need a
// sub-section of them. We might support "code-splitting" the rules in the
// future.
import { Rules as GenericRules } from 'Engine/types'
import jsonRules from './dottednames.json'
import artisteAuteur from './rules/artiste-auteur.yaml'
import base from './rules/base.yaml'
import chômagePartiel from './rules/chômage-partiel.yaml'
import CCBatiment from './rules/conventions-collectives/bâtiment.yaml'
import CCHotels from './rules/conventions-collectives/hôtels-cafés-restaurants.yaml'
import CCOptique from './rules/conventions-collectives/optique.yaml'
import CCSpectacleVivant from './rules/conventions-collectives/spectacle-vivant.yaml'
import CCSport from './rules/conventions-collectives/sport.yaml'
import dirigeant from './rules/dirigeant.yaml'
import déclarationIndépendant from './rules/déclaration-revenu-indépendant.yaml'
import entrepriseEtablissement from './rules/entreprise-établissement.yaml'
import impot from './rules/impôt.yaml'
import protectionSociale from './rules/protection-sociale.yaml'
import salarié from './rules/salarié.yaml'
import situationPersonnelle from './rules/situation-personnelle.yaml'
export type DottedName = keyof typeof jsonRules
export type Rules = GenericRules<DottedName>
const rules: Rules = {
...base,
// TODO: rule order shouldn't matter but there is a bug if "impot" is after
// "dirigeant".
...impot,
...déclarationIndépendant,
...artisteAuteur,
...dirigeant,
...entrepriseEtablissement,
...protectionSociale,
...salarié,
...CCBatiment,
...CCHotels,
...CCOptique,
...CCSpectacleVivant,
...CCSport,
...situationPersonnelle,
...chômagePartiel
}
export default rules

View File

@ -1,8 +1,8 @@
import { SitePaths } from 'Components/utils/withSitePaths'
import { History } from 'history'
import { DottedName } from 'Publicode/rules'
import { RootState, SimulationConfig } from 'Reducers/rootReducer'
import { ThunkAction } from 'redux-thunk'
import { DottedName } from 'Rules'
import { deletePersistedSimulation } from '../storage/persistSimulation'
export type Action =

View File

@ -1,11 +1,11 @@
import { ThemeColorsContext } from 'Components/utils/colors'
import useDisplayOnIntersecting from 'Components/utils/useDisplayOnIntersecting'
import Value from 'Components/Value'
import { DottedName } from 'Publicode/rules'
import React, { useContext } from 'react'
import emoji from 'react-easy-emoji'
import { useSelector } from 'react-redux'
import { animated, config, useSpring } from 'react-spring'
import { DottedName } from 'Rules'
import { parsedRulesSelector } from 'Selectors/analyseSelectors'
import répartitionSelector from 'Selectors/repartitionSelectors'
import { isIE } from '../utils'

View File

@ -1,9 +1,9 @@
import Value from 'Components/Value'
import { EvaluatedRule } from 'Engine/types'
import { DottedName } from 'Publicode/rules'
import React from 'react'
import { Trans } from 'react-i18next'
import { useSelector } from 'react-redux'
import { DottedName } from 'Rules'
import { defaultUnitSelector } from 'Selectors/analyseSelectors'
import RuleLink from './RuleLink'

View File

@ -1,10 +1,10 @@
import { goToQuestion } from 'Actions/actions'
import { DottedName } from 'Publicode/rules'
import { contains, filter, pipe, reject, toPairs } from 'ramda'
import React from 'react'
import { Trans } from 'react-i18next'
import { useDispatch, useSelector } from 'react-redux'
import { RootState } from 'Reducers/rootReducer'
import { DottedName } from 'Rules'
import {
currentQuestionSelector,
nextStepsSelector

View File

@ -2,9 +2,9 @@ import { ThemeColorsContext } from 'Components/utils/colors'
import { SitePathsContext } from 'Components/utils/withSitePaths'
import { nameLeaf } from 'Engine/ruleUtils'
import { ParsedRule } from 'Engine/types'
import { DottedName } from 'Publicode/rules'
import React, { useContext } from 'react'
import { Link } from 'react-router-dom'
import { DottedName } from 'Rules'
import './RuleLink.css'
type RuleLinkProps = {

View File

@ -1,11 +1,11 @@
import { goBackToSimulation } from 'Actions/actions'
import { ScrollToTop } from 'Components/utils/Scroll'
import { decodeRuleName } from 'Engine/ruleUtils'
import { DottedName } from 'Publicode/rules'
import React from 'react'
import { Trans } from 'react-i18next'
import { connect, useSelector } from 'react-redux'
import { Redirect, useParams } from 'react-router-dom'
import { DottedName } from 'Rules'
import {
noUserInputSelector,
parsedRulesSelector,

View File

@ -12,13 +12,13 @@ import { SitePathsContext } from 'Components/utils/withSitePaths'
import Value from 'Components/Value'
import { getRuleFromAnalysis } from 'Engine/ruleUtils'
import revenusSVG from 'Images/revenus.svg'
import { DottedName } from 'Publicode/rules'
import { default as React, useCallback, useContext, useState } from 'react'
import emoji from 'react-easy-emoji'
import { Trans } from 'react-i18next'
import { useDispatch, useSelector } from 'react-redux'
import { Link } from 'react-router-dom'
import { RootState } from 'Reducers/rootReducer'
import { DottedName } from 'Rules'
import {
analysisWithDefaultsSelector,
branchAnalyseSelector

View File

@ -1,12 +1,12 @@
import { SitePathsContext } from 'Components/utils/withSitePaths'
import { parentName } from 'Engine/ruleUtils'
import { ParsedRule, ParsedRules } from 'Engine/types'
import { DottedName } from 'Publicode/rules'
import { pick, sortBy, take } from 'ramda'
import React, { useContext, useEffect, useState } from 'react'
import FuzzyHighlighter, { Highlighter } from 'react-fuzzy-highlighter'
import { useTranslation } from 'react-i18next'
import { Link, Redirect, useHistory } from 'react-router-dom'
import { DottedName } from 'Rules'
import Worker from 'worker-loader!./SearchBar.worker.js'
import { capitalise0 } from '../utils'
import './SearchBar.css'

View File

@ -1,9 +1,9 @@
import RuleLink from 'Components/RuleLink'
import useDisplayOnIntersecting from 'Components/utils/useDisplayOnIntersecting'
import { EvaluatedRule } from 'Engine/types'
import { DottedName } from 'Publicode/rules'
import React from 'react'
import { animated, useSpring } from 'react-spring'
import { DottedName } from 'Rules'
import styled from 'styled-components'
import { capitalise0 } from '../utils'

View File

@ -6,7 +6,6 @@ import { ThemeColorsContext } from 'Components/utils/colors'
import { SitePathsContext } from 'Components/utils/withSitePaths'
import { formatCurrency } from 'Engine/format'
import { ParsedRule } from 'Engine/types'
import { DottedName } from 'Publicode/rules'
import { isEmpty, isNil } from 'ramda'
import React, { useContext, useEffect, useState } from 'react'
import emoji from 'react-easy-emoji'
@ -14,6 +13,7 @@ import { Trans, useTranslation } from 'react-i18next'
import { useDispatch, useSelector } from 'react-redux'
import { Link, useLocation } from 'react-router-dom'
import { RootState } from 'Reducers/rootReducer'
import { DottedName } from 'Rules'
import {
analysisWithDefaultsSelector,
situationSelector,

View File

@ -1,9 +1,9 @@
import { explainVariable } from 'Actions/actions'
import { DottedName } from 'Publicode/rules'
import React, { useContext } from 'react'
import emoji from 'react-easy-emoji'
import { useDispatch, useSelector } from 'react-redux'
import { RootState } from 'Reducers/rootReducer'
import { DottedName } from 'Rules'
import { parsedRulesSelector } from 'Selectors/analyseSelectors'
import { TrackerContext } from '../utils/withTracker'
import './Explicable.css'

View File

@ -1,10 +1,10 @@
import { ThemeColorsContext } from 'Components/utils/colors'
import { SitePathsContext } from 'Components/utils/withSitePaths'
import { DottedName } from 'Publicode/rules'
import React, { useContext } from 'react'
import emoji from 'react-easy-emoji'
import { useSelector } from 'react-redux'
import { Link } from 'react-router-dom'
import { DottedName } from 'Rules'
import { parsedRulesSelector } from 'Selectors/analyseSelectors'
import { capitalise0 } from '../../utils'
import './Namespace.css'

View File

@ -1,8 +1,8 @@
import { ParsedRule } from 'Engine/types'
import { safeDump } from 'js-yaml'
import rules from 'Publicode/rules'
import React from 'react'
import emoji from 'react-easy-emoji'
import rules from 'Rules'
import PublicodeHighlighter from '../ui/PublicodeHighlighter'
type RuleSourceProps = Pick<ParsedRule, 'dottedName'>

View File

@ -7,9 +7,9 @@ import CurrencyInput from 'Components/CurrencyInput/CurrencyInput'
import PercentageField from 'Components/PercentageField'
import ToggleSwitch from 'Components/ui/ToggleSwitch'
import { ParsedRules } from 'Engine/types'
import { DottedName } from 'Publicode/rules'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { DottedName } from 'Rules'
import DateInput from '../components/conversation/DateInput'
export const binaryOptionChoices = [

View File

@ -1,4 +1,3 @@
import { DottedName } from 'Publicode/rules'
import {
add,
countBy,
@ -15,6 +14,7 @@ import {
toPairs,
values
} from 'ramda'
import { DottedName } from 'Rules'
/*
COLLECTE DES VARIABLES MANQUANTES

View File

@ -1,8 +1,8 @@
import RuleLink from 'Components/RuleLink'
import { makeJsx } from 'Engine/evaluation'
import { DottedName } from 'Publicode/rules'
import React from 'react'
import { Trans } from 'react-i18next'
import { DottedName } from 'Rules'
import { Node } from './common'
export default function Recalcul(nodeValue, explanation) {

View File

@ -2,12 +2,12 @@ import { default as classNames, default as classnames } from 'classnames'
import { SitePathsContext } from 'Components/utils/withSitePaths'
import Value, { ValueProps } from 'Components/Value'
import { ParsedRule } from 'Engine/types'
import { DottedName } from 'Publicode/rules'
import { contains, isNil, pipe, sort, toPairs } from 'ramda'
import React, { useContext } from 'react'
import { Trans } from 'react-i18next'
import { useSelector } from 'react-redux'
import { Link } from 'react-router-dom'
import { DottedName } from 'Rules'
import { parsedRulesSelector } from 'Selectors/analyseSelectors'
import { LinkButton } from 'Ui/Button'
import { capitalise0 } from '../../utils'

View File

@ -12,7 +12,7 @@ import {
temporalCumul
} from 'Engine/temporal'
import { Unit } from 'Engine/units'
import { DottedName } from 'Publicode/rules'
import { DottedName } from 'Rules'
import { coerceArray } from '../../utils'
export default function parse(parse, k, v) {

View File

@ -1,6 +1,6 @@
import Value from 'Components/Value'
import rules, { DottedName } from 'Publicode/rules'
import React, { createContext, useContext, useMemo } from 'react'
import rules, { DottedName } from 'Rules'
import Engine from '.'
export const EngineContext = createContext<{
engine: Engine<DottedName> | null

View File

@ -1,9 +1,9 @@
import { Action } from 'Actions/actions'
import { Unit } from 'Engine/units'
import originRules, { DottedName, Rules } from 'Publicode/rules'
import { defaultTo, identity, omit, without } from 'ramda'
import reduceReducers from 'reduce-reducers'
import { combineReducers, Reducer } from 'redux'
import originRules, { DottedName, Rules } from 'Rules'
import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors'
import { SavedSimulation } from 'Selectors/storageSelectors'
import i18n, { AvailableLangs } from '../i18n'

File diff suppressed because it is too large Load Diff

45
source/rules/index.ts Normal file
View File

@ -0,0 +1,45 @@
// Currenty we systematically bundle all the rules even if we only need a
// sub-section of them. We might support "code-splitting" the rules in the
// future.
import { Rules as GenericRules } from 'Engine/types'
import artisteAuteur from './artiste-auteur.yaml'
import base from './base.yaml'
import chômagePartiel from './chômage-partiel.yaml'
import CCBatiment from './conventions-collectives/bâtiment.yaml'
import CCHotels from './conventions-collectives/hôtels-cafés-restaurants.yaml'
import CCOptique from './conventions-collectives/optique.yaml'
import CCSpectacleVivant from './conventions-collectives/spectacle-vivant.yaml'
import CCSport from './conventions-collectives/sport.yaml'
import dirigeant from './dirigeant.yaml'
import jsonRules from './dottednames.json'
import déclarationIndépendant from './déclaration-revenu-indépendant.yaml'
import entrepriseEtablissement from './entreprise-établissement.yaml'
import impot from './impôt.yaml'
import protectionSociale from './protection-sociale.yaml'
import salarié from './salarié.yaml'
import situationPersonnelle from './situation-personnelle.yaml'
export type DottedName = keyof typeof jsonRules
export type Rules = GenericRules<DottedName>
const rules: Rules = {
...base,
// TODO: rule order shouldn't matter but there is a bug if "impot" is after
// "dirigeant".
...impot,
...déclarationIndépendant,
...artisteAuteur,
...dirigeant,
...entrepriseEtablissement,
...protectionSociale,
...salarié,
...CCBatiment,
...CCHotels,
...CCOptique,
...CCSpectacleVivant,
...CCSport,
...situationPersonnelle,
...chômagePartiel
}
export default rules

View File

@ -10,8 +10,8 @@ const fs = require('fs')
const path = require('path')
const { readRules } = require('./rules')
const sourceDirPath = path.resolve(__dirname, '../../publicode/rules')
const outPath = path.resolve(__dirname, '../../publicode/dottednames.json')
const sourceDirPath = path.resolve(__dirname, '../rules')
const outPath = path.resolve(__dirname, '../rules/dottednames.json')
function persistJsonFileFromYaml() {
const rules = readRules()

View File

@ -5,7 +5,7 @@ const fs = require('fs')
const path = require('path')
const yaml = require('js-yaml')
const publicodesDir = path.resolve(__dirname, '../../publicode/rules')
const publicodesDir = path.resolve(__dirname, '../rules')
function concatenateFilesInDir(dirPath = publicodesDir) {
return fs
@ -15,7 +15,7 @@ function concatenateFilesInDir(dirPath = publicodesDir) {
if (fs.statSync(fullpath).isDirectory()) {
return concatenateFilesInDir(fullpath)
} else {
return fs.readFileSync(fullpath)
return filename.endsWith('.yaml') ? fs.readFileSync(fullpath) : ''
}
})
.reduce((acc, cur) => acc + '\n' + cur, '')

View File

@ -1,12 +1,35 @@
import Engine, { parseRules } from 'Engine'
import { getNextSteps } from 'Engine/generateQuestions'
import { collectDefaults, disambiguateRuleReference, splitName } from 'Engine/ruleUtils'
import {
collectDefaults,
disambiguateRuleReference,
splitName
} from 'Engine/ruleUtils'
import { ParsedRules } from 'Engine/types'
import { DottedName } from 'Publicode/rules'
import { add, difference, equals, fromPairs, head, intersection, isNil, last, length, map, mergeDeepWith, negate, pick, pipe, sortBy, takeWhile, toPairs, zipWith } from 'ramda'
import {
add,
difference,
equals,
fromPairs,
head,
intersection,
isNil,
last,
length,
map,
mergeDeepWith,
negate,
pick,
pipe,
sortBy,
takeWhile,
toPairs,
zipWith
} from 'ramda'
import { useSelector } from 'react-redux'
import { RootState, Simulation } from 'Reducers/rootReducer'
import { createSelector, createSelectorCreator, defaultMemoize } from 'reselect'
import { DottedName } from 'Rules'
import { mapOrApply } from '../utils'
// les variables dans les tests peuvent être exprimées relativement à l'espace de nom de la règle,
// comme dans sa formule

View File

@ -1,5 +1,5 @@
import { DottedName } from 'Publicode/rules'
import { RootState, Simulation } from 'Reducers/rootReducer'
import { DottedName } from 'Rules'
// Note: it is currently not possible to define SavedSimulation as the return
// type of the currentSimulationSelector function because the type would then

View File

@ -1,9 +1,9 @@
import 'core-js/stable'
import { translateRules } from 'Engine'
import rules from 'Publicode/rules'
import React from 'react'
import { render } from 'react-dom'
import 'regenerator-runtime/runtime'
import rules from 'Rules'
import translations from '../../locales/rules-en.yaml'
import App from './App'

View File

@ -1,8 +1,8 @@
import 'core-js/stable'
import rules from 'Publicode/rules'
import React from 'react'
import { render } from 'react-dom'
import 'regenerator-runtime/runtime'
import rules from 'Rules'
import App from './App'
let anchor = document.querySelector('#js')

View File

@ -9,12 +9,12 @@ import { ScrollToTop } from 'Components/utils/Scroll'
import { formatValue } from 'Engine/format'
import { getRuleFromAnalysis } from 'Engine/ruleUtils'
import { EvaluatedRule } from 'Engine/types'
import { DottedName } from 'Publicode/rules'
import React, { useContext, useEffect, useState } from 'react'
import { Helmet } from 'react-helmet'
import { Trans, useTranslation } from 'react-i18next'
import { useDispatch, useSelector } from 'react-redux'
import { useLocation } from 'react-router'
import { DottedName } from 'Rules'
import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors'
import styled from 'styled-components'
import Animate from 'Ui/animate'

View File

@ -1,10 +1,10 @@
import CompanyDetails from 'Components/CompanyDetails'
import { formatValue } from 'Engine/format'
import { DottedName } from 'Publicode/rules'
import React, { useRef } from 'react'
import { Trans } from 'react-i18next'
import { useSelector } from 'react-redux'
import { RootState } from 'Reducers/rootReducer'
import { DottedName } from 'Rules'
import { situationSelector } from 'Selectors/analyseSelectors'
import { Results } from './Result'

View File

@ -7,11 +7,11 @@ import { ScrollToTop } from 'Components/utils/Scroll'
import useDisplayOnIntersecting from 'Components/utils/useDisplayOnIntersecting'
import RuleInput from 'Engine/RuleInput'
import { ParsedRule } from 'Engine/types'
import { DottedName } from 'Publicode/rules'
import React, { useCallback, useEffect, useRef, useState } from 'react'
import { Trans } from 'react-i18next'
import { useDispatch, useSelector } from 'react-redux'
import { RootState } from 'Reducers/rootReducer'
import { DottedName } from 'Rules'
import {
nextStepsSelector,
parsedRulesSelector,

View File

@ -8,11 +8,11 @@ import { IsEmbeddedContext } from 'Components/utils/embeddedContext'
import { formatValue } from 'Engine/format'
import RuleInput from 'Engine/RuleInput'
import { getRuleFromAnalysis } from 'Engine/ruleUtils'
import { DottedName } from 'Publicode/rules'
import React, { createContext, useContext, useEffect, useState } from 'react'
import { Trans, useTranslation } from 'react-i18next'
import { useDispatch, useSelector } from 'react-redux'
import { RootState } from 'Reducers/rootReducer'
import { DottedName } from 'Rules'
import {
analysisWithDefaultsSelector,
parsedRulesSelector,

View File

@ -1,6 +1,6 @@
import { encodeRuleName } from 'Engine/ruleUtils'
import { DottedName } from 'Publicode/rules'
import { map, reduce, toPairs, zipObj } from 'ramda'
import { DottedName } from 'Rules'
import { LegalStatus } from 'Selectors/companyStatusSelectors'
import i18n from '../../i18n'

View File

@ -14,7 +14,7 @@ module.exports.default = {
Selectors: path.resolve('source/selectors/'),
Reducers: path.resolve('source/reducers/'),
Types: path.resolve('source/types/'),
Publicode: path.resolve('publicode/'),
Rules: path.resolve('source/rules/'),
Images: path.resolve('source/images/')
},
extensions: ['.js', '.ts', '.tsx']

View File

@ -1,7 +1,7 @@
import { expect } from 'chai'
import rules from 'Publicode/rules'
import { assocPath, merge } from 'ramda'
import reducers from 'Reducers/rootReducer'
import rules from 'Rules'
import salariéConfig from '../source/components/simulationConfigs/salarié.yaml'
import {
currentQuestionSelector,

View File

@ -1,7 +1,7 @@
import { expect } from 'chai'
import salariéConfig from 'Components/simulationConfigs/salarié.yaml'
import { getRuleFromAnalysis } from 'Engine/ruleUtils'
import rules from 'Publicode/rules'
import rules from 'Rules'
import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors'
import {
analysisToCotisationsSelector,

View File

@ -1,6 +1,6 @@
import { expect } from 'chai'
import Engine from 'Engine'
import rules from 'Publicode/rules'
import rules from 'Rules'
import { getNextSteps } from '../source/engine/generateQuestions'
describe('Missing variables', function() {

View File

@ -1,5 +1,5 @@
import { expect } from 'chai'
import rules from 'Publicode/rules'
import rules from 'Rules'
import Engine from '../source/engine/index'
import co2 from './rules/co2.yaml'
import sasuRules from './rules/sasu.yaml'

View File

@ -1,7 +1,7 @@
import { AssertionError } from 'chai'
import Engine, { parseRules } from 'Engine'
import { disambiguateRuleReference } from 'Engine/ruleUtils'
import rules from 'Publicode/rules'
import rules from 'Rules'
// les variables dans les tests peuvent être exprimées relativement à l'espace de nom de la règle,
// comme dans sa formule

View File

@ -6,7 +6,7 @@
// renamed the test configuration may be adapted but the persisted snapshot will remain unchanged).
/* eslint-disable no-undef */
import rules from 'Publicode/rules'
import rules from 'Rules'
import artisteAuteurConfig from '../../source/components/simulationConfigs/artiste-auteur.yaml'
import autoentrepreneurConfig from '../../source/components/simulationConfigs/auto-entrepreneur.yaml'
import independantConfig from '../../source/components/simulationConfigs/indépendant.yaml'

View File

@ -1,7 +1,7 @@
import { expect } from 'chai'
import { parseRules } from 'Engine'
import rawRules from 'Publicode/rules'
import { uniq } from 'ramda'
import rawRules from 'Rules'
import unitsTranslations from '../source/locales/units.yaml'
it('has translation for all base units', () => {

View File

@ -32,7 +32,8 @@
"Engine/*": ["engine/*"],
"Images/*": ["images/*"],
"Reducers/*": ["reducers/*"],
"Publicode/*": ["../publicode/*"],
"Rules/*": ["rules/*"],
"Rules": ["rules"],
"Selectors/*": ["selectors/*"],
"Types/*": ["types/*"]
}