From 50df2b3f342950f77ef3d5273cca8406fc319462 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Tue, 15 Dec 2020 12:46:57 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B4=20Regroupe=20les=20paquets=20core?= =?UTF-8?q?=20et=20react=20dans=20un=20dossier=20publicodes/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/netlify.yaml | 2 +- mon-entreprise/test/real-rules.test.js | 2 +- mon-entreprise/test/unit-translations.test.js | 2 +- package.json | 4 +- publicodes-react/source/mecanisms/Somme.js | 147 ------------------ publicodes/{ => core}/esm/index.js | 0 publicodes/{ => core}/esm/package.json | 0 publicodes/{ => core}/package.json | 0 publicodes/{ => core}/source/AST/graph.ts | 0 publicodes/{ => core}/source/AST/index.ts | 0 publicodes/{ => core}/source/AST/types.ts | 0 publicodes/{ => core}/source/date.ts | 0 publicodes/{ => core}/source/error.ts | 0 publicodes/{ => core}/source/evaluation.ts | 0 .../{ => core}/source/evaluationFunctions.ts | 0 publicodes/{ => core}/source/format.ts | 0 publicodes/{ => core}/source/grammar.ne | 0 .../{ => core}/source/grammarFunctions.js | 0 publicodes/{ => core}/source/i18n.ts | 0 publicodes/{ => core}/source/index.ts | 2 +- .../{ => core}/source/locales/units.yaml | 0 .../{ => core}/source/mecanisms/applicable.ts | 0 .../{ => core}/source/mecanisms/arrondi.ts | 0 .../{ => core}/source/mecanisms/barème.ts | 0 .../source/mecanisms/composantes.ts | 0 .../source/mecanisms/condition-allof.ts | 0 .../source/mecanisms/condition-oneof.ts | 0 .../{ => core}/source/mecanisms/durée.ts | 0 .../{ => core}/source/mecanisms/grille.ts | 0 .../{ => core}/source/mecanisms/inversion.ts | 0 publicodes/{ => core}/source/mecanisms/max.ts | 0 publicodes/{ => core}/source/mecanisms/min.ts | 0 .../source/mecanisms/nonApplicable.ts | 0 .../source/mecanisms/one-possibility.ts | 0 .../{ => core}/source/mecanisms/operation.ts | 0 .../{ => core}/source/mecanisms/parDéfaut.ts | 0 .../{ => core}/source/mecanisms/plafond.ts | 0 .../{ => core}/source/mecanisms/plancher.ts | 0 .../{ => core}/source/mecanisms/product.ts | 0 .../{ => core}/source/mecanisms/recalcul.ts | 0 .../{ => core}/source/mecanisms/reduction.ts | 0 .../{ => core}/source/mecanisms/situation.ts | 0 .../{ => core}/source/mecanisms/sum.tsx | 0 .../source/mecanisms/synchronisation.ts | 0 .../source/mecanisms/tauxProgressif.ts | 0 .../source/mecanisms/trancheUtils.ts | 0 .../{ => core}/source/mecanisms/unité.ts | 0 .../source/mecanisms/variableTemporelle.ts | 0 .../{ => core}/source/mecanisms/variations.ts | 2 +- publicodes/{ => core}/source/nodeUnits.ts | 0 publicodes/{ => core}/source/parse.ts | 0 .../{ => core}/source/parsePublicodes.ts | 0 publicodes/{ => core}/source/reference.ts | 0 publicodes/{ => core}/source/replacement.tsx | 0 publicodes/{ => core}/source/rule.ts | 0 publicodes/{ => core}/source/ruleUtils.ts | 0 publicodes/{ => core}/source/temporal.ts | 0 .../{ => core}/source/translateRules.ts | 0 .../{ => core}/source/types/dagres.d.ts | 0 .../source/types/import-markdown.d.ts | 0 .../core}/source/types/import-nearley.d.ts | 0 .../core}/source/types/import-yaml.d.ts | 0 publicodes/{ => core}/source/uniroot.ts | 0 publicodes/{ => core}/source/units.ts | 0 publicodes/{ => core}/test/.eslintrc.yaml | 0 publicodes/{ => core}/test/cycles.test.js | 0 publicodes/{ => core}/test/date.test.js | 0 publicodes/{ => core}/test/format.test.js | 0 publicodes/{ => core}/test/inversion.test.js | 0 publicodes/{ => core}/test/library.test.js | 0 .../{ => core}/test/load-mecanism-tests.js | 0 publicodes/{ => core}/test/mecanisms.test.js | 0 .../{ => core}/test/missingVariables.test.js | 0 .../test/mécanismes/allègement.yaml | 0 .../test/mécanismes/applicable.yaml | 0 .../{ => core}/test/mécanismes/arrondi.yaml | 0 .../{ => core}/test/mécanismes/barème.yaml | 0 .../test/mécanismes/composantes.yaml | 0 .../test/mécanismes/conversion-unité.yaml | 0 .../{ => core}/test/mécanismes/date.yaml | 0 .../{ => core}/test/mécanismes/durée.yaml | 0 .../test/mécanismes/encadrement.yaml | 0 .../test/mécanismes/expressions.yaml | 0 .../{ => core}/test/mécanismes/grille.yaml | 0 .../test/mécanismes/le-maximum-de.yaml | 0 .../test/mécanismes/le-minimum-de.yaml | 0 .../test/mécanismes/multiplication.yaml | 0 .../test/mécanismes/paramètres-nommés.yaml | 0 .../mécanismes/question-conditionelle.yaml | 0 .../{ => core}/test/mécanismes/recalcul.yaml | 0 .../{ => core}/test/mécanismes/remplace.yaml | 0 .../test/mécanismes/rend-non-applicable.yaml | 0 .../{ => core}/test/mécanismes/somme.yaml | 0 .../test/mécanismes/synchronisation.yaml | 0 .../test/mécanismes/taux-progressif.yaml | 0 .../mécanismes/toutes-ces-conditions.yaml | 0 .../mécanismes/une-de-ces-conditions.yaml | 0 .../{ => core}/test/mécanismes/unité.yaml | 0 .../test/mécanismes/variations.yaml | 0 publicodes/{ => core}/test/period.test.js | 0 publicodes/{ => core}/test/ruleUtils.test.js | 0 publicodes/{ => core}/test/rules/co2.yaml | 0 publicodes/{ => core}/test/rules/sasu.yaml | 0 publicodes/{ => core}/test/setupIntl.js | 0 publicodes/{ => core}/test/temporal.test.js | 0 publicodes/{ => core}/test/units.test.js | 0 publicodes/{ => core}/tsconfig.json | 2 +- publicodes/{ => core}/webpack.config.js | 2 +- publicodes/{ => core}/webpack.test.js | 2 +- .../react}/package.json | 0 .../react}/source/Explanation.tsx | 0 .../react}/source/Markdown.tsx | 0 .../react}/source/Overlay.tsx | 0 .../react}/source/PublicodesBlock.tsx | 0 .../react}/source/RuleLink.tsx | 0 .../react}/source/contexts.tsx | 0 .../react}/source/index.tsx | 0 .../react}/source/mecanisms/Allègement.js | 0 .../react}/source/mecanisms/Applicable.tsx | 0 .../react}/source/mecanisms/Arrondi.tsx | 0 .../react}/source/mecanisms/Barème.tsx | 0 .../react}/source/mecanisms/Composantes.tsx | 0 .../react}/source/mecanisms/Durée.tsx | 0 .../react}/source/mecanisms/Grille.tsx | 0 .../source/mecanisms/InversionNumérique.js | 0 .../react}/source/mecanisms/Maximum.tsx | 0 .../react}/source/mecanisms/Minimum.tsx | 0 .../react}/source/mecanisms/NonApplicable.tsx | 0 .../react}/source/mecanisms/Operation.tsx | 0 .../react}/source/mecanisms/ParDéfaut.tsx | 0 .../react}/source/mecanisms/Plafond.tsx | 0 .../react}/source/mecanisms/Plancher.tsx | 0 .../react}/source/mecanisms/Product.tsx | 0 .../react}/source/mecanisms/Recalcul.tsx | 0 .../react}/source/mecanisms/Replacement.tsx | 0 .../source/mecanisms/ReplacementRule.tsx | 0 .../react}/source/mecanisms/Rule.tsx | 0 .../react}/source/mecanisms/Situation.tsx | 0 .../source}/mecanisms/Somme.tsx | 4 +- .../source/mecanisms/Synchronisation.tsx | 0 .../source/mecanisms/TauxProgressif.tsx | 0 .../source/mecanisms/ToutesCesConditions.tsx | 0 .../source/mecanisms/UneDeCesConditions.tsx | 0 .../source/mecanisms/UnePossibilité.tsx | 0 .../react}/source/mecanisms/Unité.tsx | 0 .../react}/source/mecanisms/Variations.js | 0 .../react}/source/mecanisms/colors.ts | 0 .../react}/source/mecanisms/common.tsx | 0 .../react}/source/rule/Examples.js | 0 .../react}/source/rule/Header.tsx | 0 .../react}/source/rule/References.tsx | 0 .../react}/source/rule/RulePage.tsx | 0 .../react}/source/rule/RuleSource.tsx | 0 .../react}/source/types/css-prop.d.ts | 0 .../source/types/import-nearley.d.ts | 0 .../{ => react}/source/types/import-yaml.d.ts | 0 .../react}/source/writtenNumbers.ts | 0 .../react}/tsconfig.json | 2 +- 158 files changed, 13 insertions(+), 160 deletions(-) delete mode 100644 publicodes-react/source/mecanisms/Somme.js rename publicodes/{ => core}/esm/index.js (100%) rename publicodes/{ => core}/esm/package.json (100%) rename publicodes/{ => core}/package.json (100%) rename publicodes/{ => core}/source/AST/graph.ts (100%) rename publicodes/{ => core}/source/AST/index.ts (100%) rename publicodes/{ => core}/source/AST/types.ts (100%) rename publicodes/{ => core}/source/date.ts (100%) rename publicodes/{ => core}/source/error.ts (100%) rename publicodes/{ => core}/source/evaluation.ts (100%) rename publicodes/{ => core}/source/evaluationFunctions.ts (100%) rename publicodes/{ => core}/source/format.ts (100%) rename publicodes/{ => core}/source/grammar.ne (100%) rename publicodes/{ => core}/source/grammarFunctions.js (100%) rename publicodes/{ => core}/source/i18n.ts (100%) rename publicodes/{ => core}/source/index.ts (99%) rename publicodes/{ => core}/source/locales/units.yaml (100%) rename publicodes/{ => core}/source/mecanisms/applicable.ts (100%) rename publicodes/{ => core}/source/mecanisms/arrondi.ts (100%) rename publicodes/{ => core}/source/mecanisms/barème.ts (100%) rename publicodes/{ => core}/source/mecanisms/composantes.ts (100%) rename publicodes/{ => core}/source/mecanisms/condition-allof.ts (100%) rename publicodes/{ => core}/source/mecanisms/condition-oneof.ts (100%) rename publicodes/{ => core}/source/mecanisms/durée.ts (100%) rename publicodes/{ => core}/source/mecanisms/grille.ts (100%) rename publicodes/{ => core}/source/mecanisms/inversion.ts (100%) rename publicodes/{ => core}/source/mecanisms/max.ts (100%) rename publicodes/{ => core}/source/mecanisms/min.ts (100%) rename publicodes/{ => core}/source/mecanisms/nonApplicable.ts (100%) rename publicodes/{ => core}/source/mecanisms/one-possibility.ts (100%) rename publicodes/{ => core}/source/mecanisms/operation.ts (100%) rename publicodes/{ => core}/source/mecanisms/parDéfaut.ts (100%) rename publicodes/{ => core}/source/mecanisms/plafond.ts (100%) rename publicodes/{ => core}/source/mecanisms/plancher.ts (100%) rename publicodes/{ => core}/source/mecanisms/product.ts (100%) rename publicodes/{ => core}/source/mecanisms/recalcul.ts (100%) rename publicodes/{ => core}/source/mecanisms/reduction.ts (100%) rename publicodes/{ => core}/source/mecanisms/situation.ts (100%) rename publicodes/{ => core}/source/mecanisms/sum.tsx (100%) rename publicodes/{ => core}/source/mecanisms/synchronisation.ts (100%) rename publicodes/{ => core}/source/mecanisms/tauxProgressif.ts (100%) rename publicodes/{ => core}/source/mecanisms/trancheUtils.ts (100%) rename publicodes/{ => core}/source/mecanisms/unité.ts (100%) rename publicodes/{ => core}/source/mecanisms/variableTemporelle.ts (100%) rename publicodes/{ => core}/source/mecanisms/variations.ts (98%) rename publicodes/{ => core}/source/nodeUnits.ts (100%) rename publicodes/{ => core}/source/parse.ts (100%) rename publicodes/{ => core}/source/parsePublicodes.ts (100%) rename publicodes/{ => core}/source/reference.ts (100%) rename publicodes/{ => core}/source/replacement.tsx (100%) rename publicodes/{ => core}/source/rule.ts (100%) rename publicodes/{ => core}/source/ruleUtils.ts (100%) rename publicodes/{ => core}/source/temporal.ts (100%) rename publicodes/{ => core}/source/translateRules.ts (100%) rename publicodes/{ => core}/source/types/dagres.d.ts (100%) rename publicodes/{ => core}/source/types/import-markdown.d.ts (100%) rename {publicodes-react => publicodes/core}/source/types/import-nearley.d.ts (100%) rename {publicodes-react => publicodes/core}/source/types/import-yaml.d.ts (100%) rename publicodes/{ => core}/source/uniroot.ts (100%) rename publicodes/{ => core}/source/units.ts (100%) rename publicodes/{ => core}/test/.eslintrc.yaml (100%) rename publicodes/{ => core}/test/cycles.test.js (100%) rename publicodes/{ => core}/test/date.test.js (100%) rename publicodes/{ => core}/test/format.test.js (100%) rename publicodes/{ => core}/test/inversion.test.js (100%) rename publicodes/{ => core}/test/library.test.js (100%) rename publicodes/{ => core}/test/load-mecanism-tests.js (100%) rename publicodes/{ => core}/test/mecanisms.test.js (100%) rename publicodes/{ => core}/test/missingVariables.test.js (100%) rename publicodes/{ => core}/test/mécanismes/allègement.yaml (100%) rename publicodes/{ => core}/test/mécanismes/applicable.yaml (100%) rename publicodes/{ => core}/test/mécanismes/arrondi.yaml (100%) rename publicodes/{ => core}/test/mécanismes/barème.yaml (100%) rename publicodes/{ => core}/test/mécanismes/composantes.yaml (100%) rename publicodes/{ => core}/test/mécanismes/conversion-unité.yaml (100%) rename publicodes/{ => core}/test/mécanismes/date.yaml (100%) rename publicodes/{ => core}/test/mécanismes/durée.yaml (100%) rename publicodes/{ => core}/test/mécanismes/encadrement.yaml (100%) rename publicodes/{ => core}/test/mécanismes/expressions.yaml (100%) rename publicodes/{ => core}/test/mécanismes/grille.yaml (100%) rename publicodes/{ => core}/test/mécanismes/le-maximum-de.yaml (100%) rename publicodes/{ => core}/test/mécanismes/le-minimum-de.yaml (100%) rename publicodes/{ => core}/test/mécanismes/multiplication.yaml (100%) rename publicodes/{ => core}/test/mécanismes/paramètres-nommés.yaml (100%) rename publicodes/{ => core}/test/mécanismes/question-conditionelle.yaml (100%) rename publicodes/{ => core}/test/mécanismes/recalcul.yaml (100%) rename publicodes/{ => core}/test/mécanismes/remplace.yaml (100%) rename publicodes/{ => core}/test/mécanismes/rend-non-applicable.yaml (100%) rename publicodes/{ => core}/test/mécanismes/somme.yaml (100%) rename publicodes/{ => core}/test/mécanismes/synchronisation.yaml (100%) rename publicodes/{ => core}/test/mécanismes/taux-progressif.yaml (100%) rename publicodes/{ => core}/test/mécanismes/toutes-ces-conditions.yaml (100%) rename publicodes/{ => core}/test/mécanismes/une-de-ces-conditions.yaml (100%) rename publicodes/{ => core}/test/mécanismes/unité.yaml (100%) rename publicodes/{ => core}/test/mécanismes/variations.yaml (100%) rename publicodes/{ => core}/test/period.test.js (100%) rename publicodes/{ => core}/test/ruleUtils.test.js (100%) rename publicodes/{ => core}/test/rules/co2.yaml (100%) rename publicodes/{ => core}/test/rules/sasu.yaml (100%) rename publicodes/{ => core}/test/setupIntl.js (100%) rename publicodes/{ => core}/test/temporal.test.js (100%) rename publicodes/{ => core}/test/units.test.js (100%) rename publicodes/{ => core}/tsconfig.json (81%) rename publicodes/{ => core}/webpack.config.js (92%) rename publicodes/{ => core}/webpack.test.js (89%) rename {publicodes-react => publicodes/react}/package.json (100%) rename {publicodes-react => publicodes/react}/source/Explanation.tsx (100%) rename {publicodes-react => publicodes/react}/source/Markdown.tsx (100%) rename {publicodes-react => publicodes/react}/source/Overlay.tsx (100%) rename {publicodes-react => publicodes/react}/source/PublicodesBlock.tsx (100%) rename {publicodes-react => publicodes/react}/source/RuleLink.tsx (100%) rename {publicodes-react => publicodes/react}/source/contexts.tsx (100%) rename {publicodes-react => publicodes/react}/source/index.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Allègement.js (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Applicable.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Arrondi.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Barème.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Composantes.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Durée.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Grille.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/InversionNumérique.js (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Maximum.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Minimum.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/NonApplicable.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Operation.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/ParDéfaut.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Plafond.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Plancher.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Product.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Recalcul.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Replacement.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/ReplacementRule.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Rule.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Situation.tsx (100%) rename publicodes/{source/components => react/source}/mecanisms/Somme.tsx (94%) rename {publicodes-react => publicodes/react}/source/mecanisms/Synchronisation.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/TauxProgressif.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/ToutesCesConditions.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/UneDeCesConditions.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/UnePossibilité.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Unité.tsx (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/Variations.js (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/colors.ts (100%) rename {publicodes-react => publicodes/react}/source/mecanisms/common.tsx (100%) rename {publicodes-react => publicodes/react}/source/rule/Examples.js (100%) rename {publicodes-react => publicodes/react}/source/rule/Header.tsx (100%) rename {publicodes-react => publicodes/react}/source/rule/References.tsx (100%) rename {publicodes-react => publicodes/react}/source/rule/RulePage.tsx (100%) rename {publicodes-react => publicodes/react}/source/rule/RuleSource.tsx (100%) rename {publicodes-react => publicodes/react}/source/types/css-prop.d.ts (100%) rename publicodes/{ => react}/source/types/import-nearley.d.ts (100%) rename publicodes/{ => react}/source/types/import-yaml.d.ts (100%) rename {publicodes-react => publicodes/react}/source/writtenNumbers.ts (100%) rename {publicodes-react => publicodes/react}/tsconfig.json (84%) diff --git a/.github/workflows/netlify.yaml b/.github/workflows/netlify.yaml index f1297c51d..dd1a2f0d4 100644 --- a/.github/workflows/netlify.yaml +++ b/.github/workflows/netlify.yaml @@ -19,7 +19,7 @@ jobs: - uses: actions/cache@v2 with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v2 - run: npm install yarn - run: yarn install - run: yarn workspace mon-entreprise build diff --git a/mon-entreprise/test/real-rules.test.js b/mon-entreprise/test/real-rules.test.js index 926d2023a..dad097818 100644 --- a/mon-entreprise/test/real-rules.test.js +++ b/mon-entreprise/test/real-rules.test.js @@ -1,6 +1,6 @@ import { AssertionError } from 'chai' import Engine, { parsePublicodes } from 'publicodes' -import { disambiguateRuleReference } from '../../publicodes/source/ruleUtils' +import { disambiguateRuleReference } from '../../publicodes/core/source/ruleUtils' import rules from 'modele-social' // les variables dans les tests peuvent être exprimées relativement à l'espace de nom de la règle, diff --git a/mon-entreprise/test/unit-translations.test.js b/mon-entreprise/test/unit-translations.test.js index 64bb90e9f..c30328ac5 100644 --- a/mon-entreprise/test/unit-translations.test.js +++ b/mon-entreprise/test/unit-translations.test.js @@ -2,7 +2,7 @@ import { expect } from 'chai' import { parsePublicodes } from 'publicodes' import { uniq } from 'ramda' import rawRules from 'modele-social' -import unitsTranslations from '../../publicodes/source/locales/units.yaml' +import unitsTranslations from '../../publicodes/core/source/locales/units.yaml' it('use unit that exists in publicode', () => { const rules = parsePublicodes(rawRules) diff --git a/package.json b/package.json index 7d3c1f059..794880c57 100644 --- a/package.json +++ b/package.json @@ -122,8 +122,8 @@ "moso:up": "yarn workspace modele-social run up" }, "workspaces": [ - "publicodes", - "publicodes-react", + "publicodes/core", + "publicodes/react", "modele-social", "mon-entreprise" ] diff --git a/publicodes-react/source/mecanisms/Somme.js b/publicodes-react/source/mecanisms/Somme.js deleted file mode 100644 index fc315b52d..000000000 --- a/publicodes-react/source/mecanisms/Somme.js +++ /dev/null @@ -1,147 +0,0 @@ -import { path } from 'ramda' -import { useState } from 'react' -import Explanation from '../Explanation' -import { Mecanism, NodeValuePointer } from './common' -import styled from 'styled-components' - -const SommeNode = ({ explanation, nodeValue, unit }) => ( - - - - - -) -export default SommeNode - -// We want to put non applicable rules a the bottom of list #1055 -function sortByApplicability(a, b) { - const isApplicable = (x) => x.nodeValue === false - if (isApplicable(a) === isApplicable(b)) { - return 0 - } - return isApplicable(a) ? 1 : -1 -} - -let Table = ({ explanation, unit }) => ( -
-
- {explanation.sort(sortByApplicability).map((v, i) => ( - - ))} -
-
-) - -/* La colonne peut au clic afficher une nouvelle colonne qui sera une autre somme imbriquée */ -function Row({ v, i, unit }) { - let [folded, setFolded] = useState(true), - rowFormula = path(['explanation', 'formule', 'explanation'], v), - isSomme = rowFormula && rowFormula.name == 'somme' - - return [ - setFolded(!folded)} - > -
- - {isSomme && ( - - )} -
- {v.nodeValue != null && ( -
- -
- )} -
, - ...(isSomme && !folded - ? [ -
-
- , - ] - : []), - ] -} - -const StyledSomme = styled.div` - /* mécanisme somme */ - table { - width: 100%; - border-collapse: collapse; - } - tr .element { - text-align: left; - padding: 0.2rem 0.4rem; - } - tr .value span { - text-align: right; - } - .nested { - padding: 0; - } -` -const StyledRow = styled.div` - display: flex; - align-items: center; - flex-flow: row nowrap; - :nth-child(2n) { - background-color: var(--lightestColor); - } - - &.notApplicable { - opacity: 0.6; - } - - .element .result, - .element > .variable > .nodeHead > .nodeValue { - display: none; - } - :first-child { - border-top: none; - } - - .element { - flex: 1; - max-width: 100%; - display: flex; - align-items: baseline; - padding: 0.1em 0.4em; - padding-top: 0.2em; - overflow: hidden; - } - .element .unfoldIndication { - text-transform: capitalize; - flex: 1; - margin-left: 0.6rem; - text-align: left; - } - - .element .variable, - .element .nodeHead { - overflow: hidden; - text-overflow: ellipsis; - max-width: 100%; - } - - .element .situationValue { - display: none !important; - } - - /* Nested Mecanism */ - + .nested { - padding-left: 2em; - border-top: 1px dashed rgba(51, 51, 80, 0.15); - } -` diff --git a/publicodes/esm/index.js b/publicodes/core/esm/index.js similarity index 100% rename from publicodes/esm/index.js rename to publicodes/core/esm/index.js diff --git a/publicodes/esm/package.json b/publicodes/core/esm/package.json similarity index 100% rename from publicodes/esm/package.json rename to publicodes/core/esm/package.json diff --git a/publicodes/package.json b/publicodes/core/package.json similarity index 100% rename from publicodes/package.json rename to publicodes/core/package.json diff --git a/publicodes/source/AST/graph.ts b/publicodes/core/source/AST/graph.ts similarity index 100% rename from publicodes/source/AST/graph.ts rename to publicodes/core/source/AST/graph.ts diff --git a/publicodes/source/AST/index.ts b/publicodes/core/source/AST/index.ts similarity index 100% rename from publicodes/source/AST/index.ts rename to publicodes/core/source/AST/index.ts diff --git a/publicodes/source/AST/types.ts b/publicodes/core/source/AST/types.ts similarity index 100% rename from publicodes/source/AST/types.ts rename to publicodes/core/source/AST/types.ts diff --git a/publicodes/source/date.ts b/publicodes/core/source/date.ts similarity index 100% rename from publicodes/source/date.ts rename to publicodes/core/source/date.ts diff --git a/publicodes/source/error.ts b/publicodes/core/source/error.ts similarity index 100% rename from publicodes/source/error.ts rename to publicodes/core/source/error.ts diff --git a/publicodes/source/evaluation.ts b/publicodes/core/source/evaluation.ts similarity index 100% rename from publicodes/source/evaluation.ts rename to publicodes/core/source/evaluation.ts diff --git a/publicodes/source/evaluationFunctions.ts b/publicodes/core/source/evaluationFunctions.ts similarity index 100% rename from publicodes/source/evaluationFunctions.ts rename to publicodes/core/source/evaluationFunctions.ts diff --git a/publicodes/source/format.ts b/publicodes/core/source/format.ts similarity index 100% rename from publicodes/source/format.ts rename to publicodes/core/source/format.ts diff --git a/publicodes/source/grammar.ne b/publicodes/core/source/grammar.ne similarity index 100% rename from publicodes/source/grammar.ne rename to publicodes/core/source/grammar.ne diff --git a/publicodes/source/grammarFunctions.js b/publicodes/core/source/grammarFunctions.js similarity index 100% rename from publicodes/source/grammarFunctions.js rename to publicodes/core/source/grammarFunctions.js diff --git a/publicodes/source/i18n.ts b/publicodes/core/source/i18n.ts similarity index 100% rename from publicodes/source/i18n.ts rename to publicodes/core/source/i18n.ts diff --git a/publicodes/source/index.ts b/publicodes/core/source/index.ts similarity index 99% rename from publicodes/source/index.ts rename to publicodes/core/source/index.ts index b015d6f8d..217ef5a62 100644 --- a/publicodes/source/index.ts +++ b/publicodes/core/source/index.ts @@ -13,7 +13,7 @@ import { import { Rule, RuleNode } from './rule' import * as utils from './ruleUtils' import { reduceAST } from './AST' -import mecanismsDoc from '../docs/mecanisms.yaml' +import mecanismsDoc from '../../docs/mecanisms.yaml' const emptyCache = () => ({ _meta: { contextRule: [] }, diff --git a/publicodes/source/locales/units.yaml b/publicodes/core/source/locales/units.yaml similarity index 100% rename from publicodes/source/locales/units.yaml rename to publicodes/core/source/locales/units.yaml diff --git a/publicodes/source/mecanisms/applicable.ts b/publicodes/core/source/mecanisms/applicable.ts similarity index 100% rename from publicodes/source/mecanisms/applicable.ts rename to publicodes/core/source/mecanisms/applicable.ts diff --git a/publicodes/source/mecanisms/arrondi.ts b/publicodes/core/source/mecanisms/arrondi.ts similarity index 100% rename from publicodes/source/mecanisms/arrondi.ts rename to publicodes/core/source/mecanisms/arrondi.ts diff --git a/publicodes/source/mecanisms/barème.ts b/publicodes/core/source/mecanisms/barème.ts similarity index 100% rename from publicodes/source/mecanisms/barème.ts rename to publicodes/core/source/mecanisms/barème.ts diff --git a/publicodes/source/mecanisms/composantes.ts b/publicodes/core/source/mecanisms/composantes.ts similarity index 100% rename from publicodes/source/mecanisms/composantes.ts rename to publicodes/core/source/mecanisms/composantes.ts diff --git a/publicodes/source/mecanisms/condition-allof.ts b/publicodes/core/source/mecanisms/condition-allof.ts similarity index 100% rename from publicodes/source/mecanisms/condition-allof.ts rename to publicodes/core/source/mecanisms/condition-allof.ts diff --git a/publicodes/source/mecanisms/condition-oneof.ts b/publicodes/core/source/mecanisms/condition-oneof.ts similarity index 100% rename from publicodes/source/mecanisms/condition-oneof.ts rename to publicodes/core/source/mecanisms/condition-oneof.ts diff --git a/publicodes/source/mecanisms/durée.ts b/publicodes/core/source/mecanisms/durée.ts similarity index 100% rename from publicodes/source/mecanisms/durée.ts rename to publicodes/core/source/mecanisms/durée.ts diff --git a/publicodes/source/mecanisms/grille.ts b/publicodes/core/source/mecanisms/grille.ts similarity index 100% rename from publicodes/source/mecanisms/grille.ts rename to publicodes/core/source/mecanisms/grille.ts diff --git a/publicodes/source/mecanisms/inversion.ts b/publicodes/core/source/mecanisms/inversion.ts similarity index 100% rename from publicodes/source/mecanisms/inversion.ts rename to publicodes/core/source/mecanisms/inversion.ts diff --git a/publicodes/source/mecanisms/max.ts b/publicodes/core/source/mecanisms/max.ts similarity index 100% rename from publicodes/source/mecanisms/max.ts rename to publicodes/core/source/mecanisms/max.ts diff --git a/publicodes/source/mecanisms/min.ts b/publicodes/core/source/mecanisms/min.ts similarity index 100% rename from publicodes/source/mecanisms/min.ts rename to publicodes/core/source/mecanisms/min.ts diff --git a/publicodes/source/mecanisms/nonApplicable.ts b/publicodes/core/source/mecanisms/nonApplicable.ts similarity index 100% rename from publicodes/source/mecanisms/nonApplicable.ts rename to publicodes/core/source/mecanisms/nonApplicable.ts diff --git a/publicodes/source/mecanisms/one-possibility.ts b/publicodes/core/source/mecanisms/one-possibility.ts similarity index 100% rename from publicodes/source/mecanisms/one-possibility.ts rename to publicodes/core/source/mecanisms/one-possibility.ts diff --git a/publicodes/source/mecanisms/operation.ts b/publicodes/core/source/mecanisms/operation.ts similarity index 100% rename from publicodes/source/mecanisms/operation.ts rename to publicodes/core/source/mecanisms/operation.ts diff --git a/publicodes/source/mecanisms/parDéfaut.ts b/publicodes/core/source/mecanisms/parDéfaut.ts similarity index 100% rename from publicodes/source/mecanisms/parDéfaut.ts rename to publicodes/core/source/mecanisms/parDéfaut.ts diff --git a/publicodes/source/mecanisms/plafond.ts b/publicodes/core/source/mecanisms/plafond.ts similarity index 100% rename from publicodes/source/mecanisms/plafond.ts rename to publicodes/core/source/mecanisms/plafond.ts diff --git a/publicodes/source/mecanisms/plancher.ts b/publicodes/core/source/mecanisms/plancher.ts similarity index 100% rename from publicodes/source/mecanisms/plancher.ts rename to publicodes/core/source/mecanisms/plancher.ts diff --git a/publicodes/source/mecanisms/product.ts b/publicodes/core/source/mecanisms/product.ts similarity index 100% rename from publicodes/source/mecanisms/product.ts rename to publicodes/core/source/mecanisms/product.ts diff --git a/publicodes/source/mecanisms/recalcul.ts b/publicodes/core/source/mecanisms/recalcul.ts similarity index 100% rename from publicodes/source/mecanisms/recalcul.ts rename to publicodes/core/source/mecanisms/recalcul.ts diff --git a/publicodes/source/mecanisms/reduction.ts b/publicodes/core/source/mecanisms/reduction.ts similarity index 100% rename from publicodes/source/mecanisms/reduction.ts rename to publicodes/core/source/mecanisms/reduction.ts diff --git a/publicodes/source/mecanisms/situation.ts b/publicodes/core/source/mecanisms/situation.ts similarity index 100% rename from publicodes/source/mecanisms/situation.ts rename to publicodes/core/source/mecanisms/situation.ts diff --git a/publicodes/source/mecanisms/sum.tsx b/publicodes/core/source/mecanisms/sum.tsx similarity index 100% rename from publicodes/source/mecanisms/sum.tsx rename to publicodes/core/source/mecanisms/sum.tsx diff --git a/publicodes/source/mecanisms/synchronisation.ts b/publicodes/core/source/mecanisms/synchronisation.ts similarity index 100% rename from publicodes/source/mecanisms/synchronisation.ts rename to publicodes/core/source/mecanisms/synchronisation.ts diff --git a/publicodes/source/mecanisms/tauxProgressif.ts b/publicodes/core/source/mecanisms/tauxProgressif.ts similarity index 100% rename from publicodes/source/mecanisms/tauxProgressif.ts rename to publicodes/core/source/mecanisms/tauxProgressif.ts diff --git a/publicodes/source/mecanisms/trancheUtils.ts b/publicodes/core/source/mecanisms/trancheUtils.ts similarity index 100% rename from publicodes/source/mecanisms/trancheUtils.ts rename to publicodes/core/source/mecanisms/trancheUtils.ts diff --git a/publicodes/source/mecanisms/unité.ts b/publicodes/core/source/mecanisms/unité.ts similarity index 100% rename from publicodes/source/mecanisms/unité.ts rename to publicodes/core/source/mecanisms/unité.ts diff --git a/publicodes/source/mecanisms/variableTemporelle.ts b/publicodes/core/source/mecanisms/variableTemporelle.ts similarity index 100% rename from publicodes/source/mecanisms/variableTemporelle.ts rename to publicodes/core/source/mecanisms/variableTemporelle.ts diff --git a/publicodes/source/mecanisms/variations.ts b/publicodes/core/source/mecanisms/variations.ts similarity index 98% rename from publicodes/source/mecanisms/variations.ts rename to publicodes/core/source/mecanisms/variations.ts index 193d89c76..cb281ed43 100644 --- a/publicodes/source/mecanisms/variations.ts +++ b/publicodes/core/source/mecanisms/variations.ts @@ -13,7 +13,7 @@ import { Temporal, temporalAverage, } from '../temporal' -import { mergeAllMissing } from './../evaluation' +import { mergeAllMissing } from '../evaluation' export type VariationNode = { explanation: Array<{ diff --git a/publicodes/source/nodeUnits.ts b/publicodes/core/source/nodeUnits.ts similarity index 100% rename from publicodes/source/nodeUnits.ts rename to publicodes/core/source/nodeUnits.ts diff --git a/publicodes/source/parse.ts b/publicodes/core/source/parse.ts similarity index 100% rename from publicodes/source/parse.ts rename to publicodes/core/source/parse.ts diff --git a/publicodes/source/parsePublicodes.ts b/publicodes/core/source/parsePublicodes.ts similarity index 100% rename from publicodes/source/parsePublicodes.ts rename to publicodes/core/source/parsePublicodes.ts diff --git a/publicodes/source/reference.ts b/publicodes/core/source/reference.ts similarity index 100% rename from publicodes/source/reference.ts rename to publicodes/core/source/reference.ts diff --git a/publicodes/source/replacement.tsx b/publicodes/core/source/replacement.tsx similarity index 100% rename from publicodes/source/replacement.tsx rename to publicodes/core/source/replacement.tsx diff --git a/publicodes/source/rule.ts b/publicodes/core/source/rule.ts similarity index 100% rename from publicodes/source/rule.ts rename to publicodes/core/source/rule.ts diff --git a/publicodes/source/ruleUtils.ts b/publicodes/core/source/ruleUtils.ts similarity index 100% rename from publicodes/source/ruleUtils.ts rename to publicodes/core/source/ruleUtils.ts diff --git a/publicodes/source/temporal.ts b/publicodes/core/source/temporal.ts similarity index 100% rename from publicodes/source/temporal.ts rename to publicodes/core/source/temporal.ts diff --git a/publicodes/source/translateRules.ts b/publicodes/core/source/translateRules.ts similarity index 100% rename from publicodes/source/translateRules.ts rename to publicodes/core/source/translateRules.ts diff --git a/publicodes/source/types/dagres.d.ts b/publicodes/core/source/types/dagres.d.ts similarity index 100% rename from publicodes/source/types/dagres.d.ts rename to publicodes/core/source/types/dagres.d.ts diff --git a/publicodes/source/types/import-markdown.d.ts b/publicodes/core/source/types/import-markdown.d.ts similarity index 100% rename from publicodes/source/types/import-markdown.d.ts rename to publicodes/core/source/types/import-markdown.d.ts diff --git a/publicodes-react/source/types/import-nearley.d.ts b/publicodes/core/source/types/import-nearley.d.ts similarity index 100% rename from publicodes-react/source/types/import-nearley.d.ts rename to publicodes/core/source/types/import-nearley.d.ts diff --git a/publicodes-react/source/types/import-yaml.d.ts b/publicodes/core/source/types/import-yaml.d.ts similarity index 100% rename from publicodes-react/source/types/import-yaml.d.ts rename to publicodes/core/source/types/import-yaml.d.ts diff --git a/publicodes/source/uniroot.ts b/publicodes/core/source/uniroot.ts similarity index 100% rename from publicodes/source/uniroot.ts rename to publicodes/core/source/uniroot.ts diff --git a/publicodes/source/units.ts b/publicodes/core/source/units.ts similarity index 100% rename from publicodes/source/units.ts rename to publicodes/core/source/units.ts diff --git a/publicodes/test/.eslintrc.yaml b/publicodes/core/test/.eslintrc.yaml similarity index 100% rename from publicodes/test/.eslintrc.yaml rename to publicodes/core/test/.eslintrc.yaml diff --git a/publicodes/test/cycles.test.js b/publicodes/core/test/cycles.test.js similarity index 100% rename from publicodes/test/cycles.test.js rename to publicodes/core/test/cycles.test.js diff --git a/publicodes/test/date.test.js b/publicodes/core/test/date.test.js similarity index 100% rename from publicodes/test/date.test.js rename to publicodes/core/test/date.test.js diff --git a/publicodes/test/format.test.js b/publicodes/core/test/format.test.js similarity index 100% rename from publicodes/test/format.test.js rename to publicodes/core/test/format.test.js diff --git a/publicodes/test/inversion.test.js b/publicodes/core/test/inversion.test.js similarity index 100% rename from publicodes/test/inversion.test.js rename to publicodes/core/test/inversion.test.js diff --git a/publicodes/test/library.test.js b/publicodes/core/test/library.test.js similarity index 100% rename from publicodes/test/library.test.js rename to publicodes/core/test/library.test.js diff --git a/publicodes/test/load-mecanism-tests.js b/publicodes/core/test/load-mecanism-tests.js similarity index 100% rename from publicodes/test/load-mecanism-tests.js rename to publicodes/core/test/load-mecanism-tests.js diff --git a/publicodes/test/mecanisms.test.js b/publicodes/core/test/mecanisms.test.js similarity index 100% rename from publicodes/test/mecanisms.test.js rename to publicodes/core/test/mecanisms.test.js diff --git a/publicodes/test/missingVariables.test.js b/publicodes/core/test/missingVariables.test.js similarity index 100% rename from publicodes/test/missingVariables.test.js rename to publicodes/core/test/missingVariables.test.js diff --git a/publicodes/test/mécanismes/allègement.yaml b/publicodes/core/test/mécanismes/allègement.yaml similarity index 100% rename from publicodes/test/mécanismes/allègement.yaml rename to publicodes/core/test/mécanismes/allègement.yaml diff --git a/publicodes/test/mécanismes/applicable.yaml b/publicodes/core/test/mécanismes/applicable.yaml similarity index 100% rename from publicodes/test/mécanismes/applicable.yaml rename to publicodes/core/test/mécanismes/applicable.yaml diff --git a/publicodes/test/mécanismes/arrondi.yaml b/publicodes/core/test/mécanismes/arrondi.yaml similarity index 100% rename from publicodes/test/mécanismes/arrondi.yaml rename to publicodes/core/test/mécanismes/arrondi.yaml diff --git a/publicodes/test/mécanismes/barème.yaml b/publicodes/core/test/mécanismes/barème.yaml similarity index 100% rename from publicodes/test/mécanismes/barème.yaml rename to publicodes/core/test/mécanismes/barème.yaml diff --git a/publicodes/test/mécanismes/composantes.yaml b/publicodes/core/test/mécanismes/composantes.yaml similarity index 100% rename from publicodes/test/mécanismes/composantes.yaml rename to publicodes/core/test/mécanismes/composantes.yaml diff --git a/publicodes/test/mécanismes/conversion-unité.yaml b/publicodes/core/test/mécanismes/conversion-unité.yaml similarity index 100% rename from publicodes/test/mécanismes/conversion-unité.yaml rename to publicodes/core/test/mécanismes/conversion-unité.yaml diff --git a/publicodes/test/mécanismes/date.yaml b/publicodes/core/test/mécanismes/date.yaml similarity index 100% rename from publicodes/test/mécanismes/date.yaml rename to publicodes/core/test/mécanismes/date.yaml diff --git a/publicodes/test/mécanismes/durée.yaml b/publicodes/core/test/mécanismes/durée.yaml similarity index 100% rename from publicodes/test/mécanismes/durée.yaml rename to publicodes/core/test/mécanismes/durée.yaml diff --git a/publicodes/test/mécanismes/encadrement.yaml b/publicodes/core/test/mécanismes/encadrement.yaml similarity index 100% rename from publicodes/test/mécanismes/encadrement.yaml rename to publicodes/core/test/mécanismes/encadrement.yaml diff --git a/publicodes/test/mécanismes/expressions.yaml b/publicodes/core/test/mécanismes/expressions.yaml similarity index 100% rename from publicodes/test/mécanismes/expressions.yaml rename to publicodes/core/test/mécanismes/expressions.yaml diff --git a/publicodes/test/mécanismes/grille.yaml b/publicodes/core/test/mécanismes/grille.yaml similarity index 100% rename from publicodes/test/mécanismes/grille.yaml rename to publicodes/core/test/mécanismes/grille.yaml diff --git a/publicodes/test/mécanismes/le-maximum-de.yaml b/publicodes/core/test/mécanismes/le-maximum-de.yaml similarity index 100% rename from publicodes/test/mécanismes/le-maximum-de.yaml rename to publicodes/core/test/mécanismes/le-maximum-de.yaml diff --git a/publicodes/test/mécanismes/le-minimum-de.yaml b/publicodes/core/test/mécanismes/le-minimum-de.yaml similarity index 100% rename from publicodes/test/mécanismes/le-minimum-de.yaml rename to publicodes/core/test/mécanismes/le-minimum-de.yaml diff --git a/publicodes/test/mécanismes/multiplication.yaml b/publicodes/core/test/mécanismes/multiplication.yaml similarity index 100% rename from publicodes/test/mécanismes/multiplication.yaml rename to publicodes/core/test/mécanismes/multiplication.yaml diff --git a/publicodes/test/mécanismes/paramètres-nommés.yaml b/publicodes/core/test/mécanismes/paramètres-nommés.yaml similarity index 100% rename from publicodes/test/mécanismes/paramètres-nommés.yaml rename to publicodes/core/test/mécanismes/paramètres-nommés.yaml diff --git a/publicodes/test/mécanismes/question-conditionelle.yaml b/publicodes/core/test/mécanismes/question-conditionelle.yaml similarity index 100% rename from publicodes/test/mécanismes/question-conditionelle.yaml rename to publicodes/core/test/mécanismes/question-conditionelle.yaml diff --git a/publicodes/test/mécanismes/recalcul.yaml b/publicodes/core/test/mécanismes/recalcul.yaml similarity index 100% rename from publicodes/test/mécanismes/recalcul.yaml rename to publicodes/core/test/mécanismes/recalcul.yaml diff --git a/publicodes/test/mécanismes/remplace.yaml b/publicodes/core/test/mécanismes/remplace.yaml similarity index 100% rename from publicodes/test/mécanismes/remplace.yaml rename to publicodes/core/test/mécanismes/remplace.yaml diff --git a/publicodes/test/mécanismes/rend-non-applicable.yaml b/publicodes/core/test/mécanismes/rend-non-applicable.yaml similarity index 100% rename from publicodes/test/mécanismes/rend-non-applicable.yaml rename to publicodes/core/test/mécanismes/rend-non-applicable.yaml diff --git a/publicodes/test/mécanismes/somme.yaml b/publicodes/core/test/mécanismes/somme.yaml similarity index 100% rename from publicodes/test/mécanismes/somme.yaml rename to publicodes/core/test/mécanismes/somme.yaml diff --git a/publicodes/test/mécanismes/synchronisation.yaml b/publicodes/core/test/mécanismes/synchronisation.yaml similarity index 100% rename from publicodes/test/mécanismes/synchronisation.yaml rename to publicodes/core/test/mécanismes/synchronisation.yaml diff --git a/publicodes/test/mécanismes/taux-progressif.yaml b/publicodes/core/test/mécanismes/taux-progressif.yaml similarity index 100% rename from publicodes/test/mécanismes/taux-progressif.yaml rename to publicodes/core/test/mécanismes/taux-progressif.yaml diff --git a/publicodes/test/mécanismes/toutes-ces-conditions.yaml b/publicodes/core/test/mécanismes/toutes-ces-conditions.yaml similarity index 100% rename from publicodes/test/mécanismes/toutes-ces-conditions.yaml rename to publicodes/core/test/mécanismes/toutes-ces-conditions.yaml diff --git a/publicodes/test/mécanismes/une-de-ces-conditions.yaml b/publicodes/core/test/mécanismes/une-de-ces-conditions.yaml similarity index 100% rename from publicodes/test/mécanismes/une-de-ces-conditions.yaml rename to publicodes/core/test/mécanismes/une-de-ces-conditions.yaml diff --git a/publicodes/test/mécanismes/unité.yaml b/publicodes/core/test/mécanismes/unité.yaml similarity index 100% rename from publicodes/test/mécanismes/unité.yaml rename to publicodes/core/test/mécanismes/unité.yaml diff --git a/publicodes/test/mécanismes/variations.yaml b/publicodes/core/test/mécanismes/variations.yaml similarity index 100% rename from publicodes/test/mécanismes/variations.yaml rename to publicodes/core/test/mécanismes/variations.yaml diff --git a/publicodes/test/period.test.js b/publicodes/core/test/period.test.js similarity index 100% rename from publicodes/test/period.test.js rename to publicodes/core/test/period.test.js diff --git a/publicodes/test/ruleUtils.test.js b/publicodes/core/test/ruleUtils.test.js similarity index 100% rename from publicodes/test/ruleUtils.test.js rename to publicodes/core/test/ruleUtils.test.js diff --git a/publicodes/test/rules/co2.yaml b/publicodes/core/test/rules/co2.yaml similarity index 100% rename from publicodes/test/rules/co2.yaml rename to publicodes/core/test/rules/co2.yaml diff --git a/publicodes/test/rules/sasu.yaml b/publicodes/core/test/rules/sasu.yaml similarity index 100% rename from publicodes/test/rules/sasu.yaml rename to publicodes/core/test/rules/sasu.yaml diff --git a/publicodes/test/setupIntl.js b/publicodes/core/test/setupIntl.js similarity index 100% rename from publicodes/test/setupIntl.js rename to publicodes/core/test/setupIntl.js diff --git a/publicodes/test/temporal.test.js b/publicodes/core/test/temporal.test.js similarity index 100% rename from publicodes/test/temporal.test.js rename to publicodes/core/test/temporal.test.js diff --git a/publicodes/test/units.test.js b/publicodes/core/test/units.test.js similarity index 100% rename from publicodes/test/units.test.js rename to publicodes/core/test/units.test.js diff --git a/publicodes/tsconfig.json b/publicodes/core/tsconfig.json similarity index 81% rename from publicodes/tsconfig.json rename to publicodes/core/tsconfig.json index 2d0178676..7c81df221 100644 --- a/publicodes/tsconfig.json +++ b/publicodes/core/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "./dist/types", "declaration": true, diff --git a/publicodes/webpack.config.js b/publicodes/core/webpack.config.js similarity index 92% rename from publicodes/webpack.config.js rename to publicodes/core/webpack.config.js index 4d3cfb2a4..dda43c054 100644 --- a/publicodes/webpack.config.js +++ b/publicodes/core/webpack.config.js @@ -1,7 +1,7 @@ /* eslint-env node */ const path = require('path') -const { commonLoaders } = require('../webpack/common') +const { commonLoaders } = require('../../webpack/common') const common = { resolve: { diff --git a/publicodes/webpack.test.js b/publicodes/core/webpack.test.js similarity index 89% rename from publicodes/webpack.test.js rename to publicodes/core/webpack.test.js index faf5d3781..92723c822 100644 --- a/publicodes/webpack.test.js +++ b/publicodes/core/webpack.test.js @@ -1,4 +1,4 @@ -const { commonLoaders } = require('../webpack/common') +const { commonLoaders } = require('../../webpack/common') const { EnvironmentPlugin } = require('webpack') module.exports = { diff --git a/publicodes-react/package.json b/publicodes/react/package.json similarity index 100% rename from publicodes-react/package.json rename to publicodes/react/package.json diff --git a/publicodes-react/source/Explanation.tsx b/publicodes/react/source/Explanation.tsx similarity index 100% rename from publicodes-react/source/Explanation.tsx rename to publicodes/react/source/Explanation.tsx diff --git a/publicodes-react/source/Markdown.tsx b/publicodes/react/source/Markdown.tsx similarity index 100% rename from publicodes-react/source/Markdown.tsx rename to publicodes/react/source/Markdown.tsx diff --git a/publicodes-react/source/Overlay.tsx b/publicodes/react/source/Overlay.tsx similarity index 100% rename from publicodes-react/source/Overlay.tsx rename to publicodes/react/source/Overlay.tsx diff --git a/publicodes-react/source/PublicodesBlock.tsx b/publicodes/react/source/PublicodesBlock.tsx similarity index 100% rename from publicodes-react/source/PublicodesBlock.tsx rename to publicodes/react/source/PublicodesBlock.tsx diff --git a/publicodes-react/source/RuleLink.tsx b/publicodes/react/source/RuleLink.tsx similarity index 100% rename from publicodes-react/source/RuleLink.tsx rename to publicodes/react/source/RuleLink.tsx diff --git a/publicodes-react/source/contexts.tsx b/publicodes/react/source/contexts.tsx similarity index 100% rename from publicodes-react/source/contexts.tsx rename to publicodes/react/source/contexts.tsx diff --git a/publicodes-react/source/index.tsx b/publicodes/react/source/index.tsx similarity index 100% rename from publicodes-react/source/index.tsx rename to publicodes/react/source/index.tsx diff --git a/publicodes-react/source/mecanisms/Allègement.js b/publicodes/react/source/mecanisms/Allègement.js similarity index 100% rename from publicodes-react/source/mecanisms/Allègement.js rename to publicodes/react/source/mecanisms/Allègement.js diff --git a/publicodes-react/source/mecanisms/Applicable.tsx b/publicodes/react/source/mecanisms/Applicable.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Applicable.tsx rename to publicodes/react/source/mecanisms/Applicable.tsx diff --git a/publicodes-react/source/mecanisms/Arrondi.tsx b/publicodes/react/source/mecanisms/Arrondi.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Arrondi.tsx rename to publicodes/react/source/mecanisms/Arrondi.tsx diff --git a/publicodes-react/source/mecanisms/Barème.tsx b/publicodes/react/source/mecanisms/Barème.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Barème.tsx rename to publicodes/react/source/mecanisms/Barème.tsx diff --git a/publicodes-react/source/mecanisms/Composantes.tsx b/publicodes/react/source/mecanisms/Composantes.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Composantes.tsx rename to publicodes/react/source/mecanisms/Composantes.tsx diff --git a/publicodes-react/source/mecanisms/Durée.tsx b/publicodes/react/source/mecanisms/Durée.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Durée.tsx rename to publicodes/react/source/mecanisms/Durée.tsx diff --git a/publicodes-react/source/mecanisms/Grille.tsx b/publicodes/react/source/mecanisms/Grille.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Grille.tsx rename to publicodes/react/source/mecanisms/Grille.tsx diff --git a/publicodes-react/source/mecanisms/InversionNumérique.js b/publicodes/react/source/mecanisms/InversionNumérique.js similarity index 100% rename from publicodes-react/source/mecanisms/InversionNumérique.js rename to publicodes/react/source/mecanisms/InversionNumérique.js diff --git a/publicodes-react/source/mecanisms/Maximum.tsx b/publicodes/react/source/mecanisms/Maximum.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Maximum.tsx rename to publicodes/react/source/mecanisms/Maximum.tsx diff --git a/publicodes-react/source/mecanisms/Minimum.tsx b/publicodes/react/source/mecanisms/Minimum.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Minimum.tsx rename to publicodes/react/source/mecanisms/Minimum.tsx diff --git a/publicodes-react/source/mecanisms/NonApplicable.tsx b/publicodes/react/source/mecanisms/NonApplicable.tsx similarity index 100% rename from publicodes-react/source/mecanisms/NonApplicable.tsx rename to publicodes/react/source/mecanisms/NonApplicable.tsx diff --git a/publicodes-react/source/mecanisms/Operation.tsx b/publicodes/react/source/mecanisms/Operation.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Operation.tsx rename to publicodes/react/source/mecanisms/Operation.tsx diff --git a/publicodes-react/source/mecanisms/ParDéfaut.tsx b/publicodes/react/source/mecanisms/ParDéfaut.tsx similarity index 100% rename from publicodes-react/source/mecanisms/ParDéfaut.tsx rename to publicodes/react/source/mecanisms/ParDéfaut.tsx diff --git a/publicodes-react/source/mecanisms/Plafond.tsx b/publicodes/react/source/mecanisms/Plafond.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Plafond.tsx rename to publicodes/react/source/mecanisms/Plafond.tsx diff --git a/publicodes-react/source/mecanisms/Plancher.tsx b/publicodes/react/source/mecanisms/Plancher.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Plancher.tsx rename to publicodes/react/source/mecanisms/Plancher.tsx diff --git a/publicodes-react/source/mecanisms/Product.tsx b/publicodes/react/source/mecanisms/Product.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Product.tsx rename to publicodes/react/source/mecanisms/Product.tsx diff --git a/publicodes-react/source/mecanisms/Recalcul.tsx b/publicodes/react/source/mecanisms/Recalcul.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Recalcul.tsx rename to publicodes/react/source/mecanisms/Recalcul.tsx diff --git a/publicodes-react/source/mecanisms/Replacement.tsx b/publicodes/react/source/mecanisms/Replacement.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Replacement.tsx rename to publicodes/react/source/mecanisms/Replacement.tsx diff --git a/publicodes-react/source/mecanisms/ReplacementRule.tsx b/publicodes/react/source/mecanisms/ReplacementRule.tsx similarity index 100% rename from publicodes-react/source/mecanisms/ReplacementRule.tsx rename to publicodes/react/source/mecanisms/ReplacementRule.tsx diff --git a/publicodes-react/source/mecanisms/Rule.tsx b/publicodes/react/source/mecanisms/Rule.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Rule.tsx rename to publicodes/react/source/mecanisms/Rule.tsx diff --git a/publicodes-react/source/mecanisms/Situation.tsx b/publicodes/react/source/mecanisms/Situation.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Situation.tsx rename to publicodes/react/source/mecanisms/Situation.tsx diff --git a/publicodes/source/components/mecanisms/Somme.tsx b/publicodes/react/source/mecanisms/Somme.tsx similarity index 94% rename from publicodes/source/components/mecanisms/Somme.tsx rename to publicodes/react/source/mecanisms/Somme.tsx index 72b9ea781..341d0ca58 100644 --- a/publicodes/source/components/mecanisms/Somme.tsx +++ b/publicodes/react/source/mecanisms/Somme.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components' -import { EvaluatedNode } from '../..' +import { EvaluatedNode } from 'publicodes/source/AST/types' import Explanation from '../Explanation' -import { Mecanism, NodeValuePointer, UnfoldIsEnabledContext } from './common' +import { Mecanism, UnfoldIsEnabledContext } from './common' const SommeNode = ({ explanation, nodeValue, unit }) => ( diff --git a/publicodes-react/source/mecanisms/Synchronisation.tsx b/publicodes/react/source/mecanisms/Synchronisation.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Synchronisation.tsx rename to publicodes/react/source/mecanisms/Synchronisation.tsx diff --git a/publicodes-react/source/mecanisms/TauxProgressif.tsx b/publicodes/react/source/mecanisms/TauxProgressif.tsx similarity index 100% rename from publicodes-react/source/mecanisms/TauxProgressif.tsx rename to publicodes/react/source/mecanisms/TauxProgressif.tsx diff --git a/publicodes-react/source/mecanisms/ToutesCesConditions.tsx b/publicodes/react/source/mecanisms/ToutesCesConditions.tsx similarity index 100% rename from publicodes-react/source/mecanisms/ToutesCesConditions.tsx rename to publicodes/react/source/mecanisms/ToutesCesConditions.tsx diff --git a/publicodes-react/source/mecanisms/UneDeCesConditions.tsx b/publicodes/react/source/mecanisms/UneDeCesConditions.tsx similarity index 100% rename from publicodes-react/source/mecanisms/UneDeCesConditions.tsx rename to publicodes/react/source/mecanisms/UneDeCesConditions.tsx diff --git a/publicodes-react/source/mecanisms/UnePossibilité.tsx b/publicodes/react/source/mecanisms/UnePossibilité.tsx similarity index 100% rename from publicodes-react/source/mecanisms/UnePossibilité.tsx rename to publicodes/react/source/mecanisms/UnePossibilité.tsx diff --git a/publicodes-react/source/mecanisms/Unité.tsx b/publicodes/react/source/mecanisms/Unité.tsx similarity index 100% rename from publicodes-react/source/mecanisms/Unité.tsx rename to publicodes/react/source/mecanisms/Unité.tsx diff --git a/publicodes-react/source/mecanisms/Variations.js b/publicodes/react/source/mecanisms/Variations.js similarity index 100% rename from publicodes-react/source/mecanisms/Variations.js rename to publicodes/react/source/mecanisms/Variations.js diff --git a/publicodes-react/source/mecanisms/colors.ts b/publicodes/react/source/mecanisms/colors.ts similarity index 100% rename from publicodes-react/source/mecanisms/colors.ts rename to publicodes/react/source/mecanisms/colors.ts diff --git a/publicodes-react/source/mecanisms/common.tsx b/publicodes/react/source/mecanisms/common.tsx similarity index 100% rename from publicodes-react/source/mecanisms/common.tsx rename to publicodes/react/source/mecanisms/common.tsx diff --git a/publicodes-react/source/rule/Examples.js b/publicodes/react/source/rule/Examples.js similarity index 100% rename from publicodes-react/source/rule/Examples.js rename to publicodes/react/source/rule/Examples.js diff --git a/publicodes-react/source/rule/Header.tsx b/publicodes/react/source/rule/Header.tsx similarity index 100% rename from publicodes-react/source/rule/Header.tsx rename to publicodes/react/source/rule/Header.tsx diff --git a/publicodes-react/source/rule/References.tsx b/publicodes/react/source/rule/References.tsx similarity index 100% rename from publicodes-react/source/rule/References.tsx rename to publicodes/react/source/rule/References.tsx diff --git a/publicodes-react/source/rule/RulePage.tsx b/publicodes/react/source/rule/RulePage.tsx similarity index 100% rename from publicodes-react/source/rule/RulePage.tsx rename to publicodes/react/source/rule/RulePage.tsx diff --git a/publicodes-react/source/rule/RuleSource.tsx b/publicodes/react/source/rule/RuleSource.tsx similarity index 100% rename from publicodes-react/source/rule/RuleSource.tsx rename to publicodes/react/source/rule/RuleSource.tsx diff --git a/publicodes-react/source/types/css-prop.d.ts b/publicodes/react/source/types/css-prop.d.ts similarity index 100% rename from publicodes-react/source/types/css-prop.d.ts rename to publicodes/react/source/types/css-prop.d.ts diff --git a/publicodes/source/types/import-nearley.d.ts b/publicodes/react/source/types/import-nearley.d.ts similarity index 100% rename from publicodes/source/types/import-nearley.d.ts rename to publicodes/react/source/types/import-nearley.d.ts diff --git a/publicodes/source/types/import-yaml.d.ts b/publicodes/react/source/types/import-yaml.d.ts similarity index 100% rename from publicodes/source/types/import-yaml.d.ts rename to publicodes/react/source/types/import-yaml.d.ts diff --git a/publicodes-react/source/writtenNumbers.ts b/publicodes/react/source/writtenNumbers.ts similarity index 100% rename from publicodes-react/source/writtenNumbers.ts rename to publicodes/react/source/writtenNumbers.ts diff --git a/publicodes-react/tsconfig.json b/publicodes/react/tsconfig.json similarity index 84% rename from publicodes-react/tsconfig.json rename to publicodes/react/tsconfig.json index a1a9693bd..05026a1d1 100644 --- a/publicodes-react/tsconfig.json +++ b/publicodes/react/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../../tsconfig.json", "compilerOptions": { "module": "CommonJS", "target": "es2015",