From af220eb91957fa1d215b93af3e6882bd194157b6 Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Mon, 18 Nov 2024 17:50:18 +0100 Subject: [PATCH] refactor(command/compile)!: serialized parsed rules instead of raw rules This is useful to resolves "avec" mechansims. --- src/commands/compile.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/commands/compile.ts b/src/commands/compile.ts index 7e19e24..59a6a71 100644 --- a/src/commands/compile.ts +++ b/src/commands/compile.ts @@ -5,6 +5,7 @@ import path from 'path' import fs from 'fs' import { getModelFromSource, GetModelFromSourceOptions } from '../compilation' import { RawRules } from '../commons' +import { serializeParsedRules } from '../serializeParsedRules' import { exitWithError, runWithSpinner } from '../utils/cli' import { resolveRuleTypes, RuleType } from '../compilation/ruleTypes' import Engine from 'publicodes' @@ -87,7 +88,11 @@ the package.json file under the \`publicodes\` key. For example: await this.generateDTS(engine, outputDir) - await generateBaseFiles(rawRules, outputDir, pkgName) + await generateBaseFiles( + serializeParsedRules(engine.getParsedRules()), + outputDir, + pkgName, + ) p.outro('Compilation done.') }