From 99b8279f8268d710d5b75d2dce30c3970b44cd8c Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Tue, 26 Jan 2021 16:30:44 +0100 Subject: [PATCH] =?UTF-8?q?:bug:=20Enl=C3=A8ve=20dagres=20du=20build=20de?= =?UTF-8?q?=20publicodes=20suite=20=C3=A0=20un=20bug=20sur=20node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit De toute façon, cette api n'était pas documentée, et elle ne devrait pas être disponible, mais plutôt intervenir comme une étape de vérification du parsing --- mon-entreprise/test/cycles.test.js | 4 ++-- publicodes/core/package.json | 6 +++--- publicodes/core/source/index.ts | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mon-entreprise/test/cycles.test.js b/mon-entreprise/test/cycles.test.js index 960fbdcbd..9f85b62e9 100644 --- a/mon-entreprise/test/cycles.test.js +++ b/mon-entreprise/test/cycles.test.js @@ -1,10 +1,10 @@ import { expect } from 'chai' -import { cyclesLib } from 'publicodes' import rules from 'modele-social' +import { cyclicDependencies } from '../../publicodes/core/source/AST/graph' describe('DottedNames graph', () => { it("shouldn't have cycles", () => { - let cyclesDependencies = cyclesLib.cyclicDependencies(rules) + let cyclesDependencies = cyclicDependencies(rules) expect( cyclesDependencies, diff --git a/publicodes/core/package.json b/publicodes/core/package.json index d423cd951..82527d96a 100644 --- a/publicodes/core/package.json +++ b/publicodes/core/package.json @@ -26,11 +26,11 @@ ], "private": false, "devDependencies": { - "@dagrejs/graphlib": "^2.1.4", "chai": "^4.2.0", "intl": "^1.2.5", "typescript": "3.4.3", - "dedent-js":"1.0.1" + "dedent-js":"1.0.1", + "@dagrejs/graphlib": "^2.1.4" }, "dependencies": { "moo": "^0.5.1", @@ -38,7 +38,7 @@ "yaml": "^1.9.2" }, "scripts": { - "prepublishOnly": "yarn test && yarn run build", + "prepublishOnly": "yarn test && NODE_ENV=production yarn run build", "clean": "rimraf dist node_modules", "prepare": "yarn run rimraf dist && yarn run build", "build": "yarn run webpack --config webpack.config.js && yarn run tsc", diff --git a/publicodes/core/source/index.ts b/publicodes/core/source/index.ts index 2e6086ac7..b90a4bc3f 100644 --- a/publicodes/core/source/index.ts +++ b/publicodes/core/source/index.ts @@ -39,15 +39,14 @@ export type EvaluationOptions = Partial<{ }> export { default as mecanismsDoc } from '../../docs/mecanisms.yaml' -export * as cyclesLib from './AST/graph' export { reduceAST, transformAST } from './AST/index' export { Evaluation, Unit } from './AST/types' export { capitalise0, formatValue } from './format' export { simplifyNodeUnit } from './nodeUnits' +export { default as serializeEvaluation } from './serializeEvaluation' export { parseUnit, serializeUnit } from './units' export { parsePublicodes, utils } export { Rule, RuleNode, ASTNode, EvaluatedNode } -export { default as serializeEvaluation } from './serializeEvaluation' type PublicodesExpression = string | Record | number