ondc-code-generator 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -39
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { ConfigCompiler } from "./generator/config-compiler.js";
|
|
2
|
+
export { ConfigCompiler };
|
package/dist/index.js
CHANGED
|
@@ -1,40 +1,2 @@
|
|
|
1
|
-
import { readFileSync } from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
import { SupportedLanguages } from "./types/compiler-types.js";
|
|
5
1
|
import { ConfigCompiler } from "./generator/config-compiler.js";
|
|
6
|
-
|
|
7
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
-
const __dirname = path.dirname(__filename);
|
|
9
|
-
const main = async () => {
|
|
10
|
-
const compiler = new ConfigCompiler(SupportedLanguages.Typescript);
|
|
11
|
-
const buildPath = path.resolve(__dirname, "../samples/build.yaml");
|
|
12
|
-
const valConfigPath = path.resolve(__dirname, "../samples/validation-config.json");
|
|
13
|
-
const buildYaml = readFileSync(buildPath, "utf-8");
|
|
14
|
-
const valConfig = JSON.parse(readFileSync(valConfigPath, "utf-8"));
|
|
15
|
-
await compiler.initialize(buildYaml);
|
|
16
|
-
await compiler.generateCode(valConfig);
|
|
17
|
-
// await compiler.generateL0Schema();
|
|
18
|
-
// await compiler.performValidations(valConfig);
|
|
19
|
-
// const inputs = [
|
|
20
|
-
// "a are unique && b are unique",
|
|
21
|
-
// "a are unique",
|
|
22
|
-
// "(a are unique && b are unique) || c are unique",
|
|
23
|
-
// "a are unique && b are unique || c are unique",
|
|
24
|
-
// "a are unique && (b are unique || c are unique)",
|
|
25
|
-
// "a are unique && b are unique && c are unique && d are unique",
|
|
26
|
-
// "a are unique && !(b are unique || !(c are unique))",
|
|
27
|
-
// "a are unique && (b are unique || !(!(c are unique))) && !(d are unique)",
|
|
28
|
-
// ];
|
|
29
|
-
// let output = "";
|
|
30
|
-
// for (const input of inputs) {
|
|
31
|
-
// const cst = parseReturnInput(input);
|
|
32
|
-
// const ast = buildAst(cst);
|
|
33
|
-
// const out = CompileToMarkdown(ast, "A", 0, false);
|
|
34
|
-
// output += `\n## ${input}\n\n${out}\n`;
|
|
35
|
-
// }
|
|
36
|
-
// writeFileSync(path.resolve(__dirname, "../samples/output.md"), output);
|
|
37
|
-
};
|
|
38
|
-
(async () => {
|
|
39
|
-
await main();
|
|
40
|
-
})();
|
|
2
|
+
export { ConfigCompiler };
|