Skip to content

Commit

Permalink
refactor(command/compile)!: serialized parsed rules instead of raw rules
Browse files Browse the repository at this point in the history
This is useful to resolves "avec" mechansims.
  • Loading branch information
EmileRolley committed Nov 18, 2024
1 parent 7f15aa0 commit af220eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/commands/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.')
}
Expand Down

0 comments on commit af220eb

Please sign in to comment.