@platforma-sdk/tengo-builder 2.4.24 → 2.4.26

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.
Files changed (106) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/commands/build.cjs +106 -150
  3. package/dist/commands/build.cjs.map +1 -1
  4. package/dist/commands/build.d.ts +15 -10
  5. package/dist/commands/build.js +101 -126
  6. package/dist/commands/build.js.map +1 -1
  7. package/dist/commands/check.cjs +32 -36
  8. package/dist/commands/check.cjs.map +1 -1
  9. package/dist/commands/check.d.ts +13 -8
  10. package/dist/commands/check.js +30 -33
  11. package/dist/commands/check.js.map +1 -1
  12. package/dist/commands/dump/artifacts.cjs +22 -22
  13. package/dist/commands/dump/artifacts.cjs.map +1 -1
  14. package/dist/commands/dump/artifacts.d.ts +13 -8
  15. package/dist/commands/dump/artifacts.js +20 -19
  16. package/dist/commands/dump/artifacts.js.map +1 -1
  17. package/dist/commands/dump/software.cjs +19 -21
  18. package/dist/commands/dump/software.cjs.map +1 -1
  19. package/dist/commands/dump/software.d.ts +12 -7
  20. package/dist/commands/dump/software.js +17 -18
  21. package/dist/commands/dump/software.js.map +1 -1
  22. package/dist/commands/test.cjs +32 -33
  23. package/dist/commands/test.cjs.map +1 -1
  24. package/dist/commands/test.d.ts +13 -8
  25. package/dist/commands/test.js +30 -30
  26. package/dist/commands/test.js.map +1 -1
  27. package/dist/compiler/artifactset.cjs +59 -68
  28. package/dist/compiler/artifactset.cjs.map +1 -1
  29. package/dist/compiler/artifactset.js +60 -66
  30. package/dist/compiler/artifactset.js.map +1 -1
  31. package/dist/compiler/compiler.cjs +241 -314
  32. package/dist/compiler/compiler.cjs.map +1 -1
  33. package/dist/compiler/compiler.js +241 -312
  34. package/dist/compiler/compiler.js.map +1 -1
  35. package/dist/compiler/compileroptions.cjs +16 -35
  36. package/dist/compiler/compileroptions.cjs.map +1 -1
  37. package/dist/compiler/compileroptions.js +17 -33
  38. package/dist/compiler/compileroptions.js.map +1 -1
  39. package/dist/compiler/main.cjs +258 -334
  40. package/dist/compiler/main.cjs.map +1 -1
  41. package/dist/compiler/main.js +256 -311
  42. package/dist/compiler/main.js.map +1 -1
  43. package/dist/compiler/package.cjs +21 -35
  44. package/dist/compiler/package.cjs.map +1 -1
  45. package/dist/compiler/package.js +21 -34
  46. package/dist/compiler/package.js.map +1 -1
  47. package/dist/compiler/source.cjs +239 -308
  48. package/dist/compiler/source.cjs.map +1 -1
  49. package/dist/compiler/source.js +239 -304
  50. package/dist/compiler/source.js.map +1 -1
  51. package/dist/compiler/template.cjs +30 -35
  52. package/dist/compiler/template.cjs.map +1 -1
  53. package/dist/compiler/template.js +29 -33
  54. package/dist/compiler/template.js.map +1 -1
  55. package/dist/compiler/util.cjs +40 -61
  56. package/dist/compiler/util.cjs.map +1 -1
  57. package/dist/compiler/util.js +36 -39
  58. package/dist/compiler/util.js.map +1 -1
  59. package/dist/index.cjs +14 -14
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.ts +15 -11
  62. package/dist/index.js +13 -12
  63. package/dist/index.js.map +1 -1
  64. package/dist/shared/basecmd.cjs +42 -33
  65. package/dist/shared/basecmd.cjs.map +1 -1
  66. package/dist/shared/basecmd.js +41 -31
  67. package/dist/shared/basecmd.js.map +1 -1
  68. package/dist/shared/dump.cjs +73 -107
  69. package/dist/shared/dump.cjs.map +1 -1
  70. package/dist/shared/dump.js +73 -105
  71. package/dist/shared/dump.js.map +1 -1
  72. package/dist/shared/proc.cjs +22 -18
  73. package/dist/shared/proc.cjs.map +1 -1
  74. package/dist/shared/proc.js +21 -16
  75. package/dist/shared/proc.js.map +1 -1
  76. package/package.json +10 -10
  77. package/dist/commands/build.d.ts.map +0 -1
  78. package/dist/commands/check.d.ts.map +0 -1
  79. package/dist/commands/dump/artifacts.d.ts.map +0 -1
  80. package/dist/commands/dump/software.d.ts.map +0 -1
  81. package/dist/commands/test.d.ts.map +0 -1
  82. package/dist/compiler/artifactset.d.ts +0 -24
  83. package/dist/compiler/artifactset.d.ts.map +0 -1
  84. package/dist/compiler/compiler.d.ts +0 -42
  85. package/dist/compiler/compiler.d.ts.map +0 -1
  86. package/dist/compiler/compileroptions.d.ts +0 -6
  87. package/dist/compiler/compileroptions.d.ts.map +0 -1
  88. package/dist/compiler/main.d.ts +0 -35
  89. package/dist/compiler/main.d.ts.map +0 -1
  90. package/dist/compiler/package.d.ts +0 -44
  91. package/dist/compiler/package.d.ts.map +0 -1
  92. package/dist/compiler/source.d.ts +0 -54
  93. package/dist/compiler/source.d.ts.map +0 -1
  94. package/dist/compiler/template.d.ts +0 -22
  95. package/dist/compiler/template.d.ts.map +0 -1
  96. package/dist/compiler/test.artifacts.d.ts +0 -47
  97. package/dist/compiler/test.artifacts.d.ts.map +0 -1
  98. package/dist/compiler/util.d.ts +0 -8
  99. package/dist/compiler/util.d.ts.map +0 -1
  100. package/dist/index.d.ts.map +0 -1
  101. package/dist/shared/basecmd.d.ts +0 -12
  102. package/dist/shared/basecmd.d.ts.map +0 -1
  103. package/dist/shared/dump.d.ts +0 -6
  104. package/dist/shared/dump.d.ts.map +0 -1
  105. package/dist/shared/proc.d.ts +0 -5
  106. package/dist/shared/proc.d.ts.map +0 -1
@@ -1,114 +1,82 @@
1
- import { getPackageInfo, compile, parseSources, newCompiler } from '../compiler/main.js';
2
- import { typedArtifactNameToString } from '../compiler/package.js';
1
+ import { typedArtifactNameToString } from "../compiler/package.js";
2
+ import { compile, getPackageInfo, newCompiler, parseSources } from "../compiler/main.js";
3
3
 
4
+ //#region src/shared/dump.ts
4
5
  function dumpArtifacts(logger, stream, aType) {
5
- const packageInfo = getPackageInfo(process.cwd(), logger);
6
- const sources = parseSources(logger, packageInfo, "dist", "src", "");
7
- const compiler = newCompiler(logger, packageInfo, "dist");
8
- // group output by type:
9
- // - all libs
10
- // - all templates
11
- // - all software
12
- // - all assets
13
- // - all tests
14
- // Libs
15
- if (!aType || aType === "library") {
16
- for (const lib of compiler.allLibs()) {
17
- logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(lib.fullName)}`);
18
- stream.write(JSON.stringify(lib) + "\n");
19
- }
20
- for (const src of sources) {
21
- if (src.fullName.type === "library") {
22
- logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);
23
- stream.write(JSON.stringify(src) + "\n");
24
- }
25
- }
26
- }
27
- // Templates
28
- if (!aType || aType === "template") {
29
- for (const tpl of compiler.allTemplates()) {
30
- logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(tpl.fullName)}`);
31
- stream.write(JSON.stringify(tpl) + "\n");
32
- }
33
- for (const src of sources) {
34
- if (src.fullName.type === "template") {
35
- logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)} ${src.srcName}`);
36
- stream.write(JSON.stringify(src) + "\n");
37
- }
38
- }
39
- }
40
- // Software
41
- if (!aType || aType === "software") {
42
- for (const sw of compiler.allSoftware()) {
43
- logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(sw.fullName)}`);
44
- stream.write(JSON.stringify(sw) + "\n");
45
- }
46
- for (const src of sources) {
47
- if (src.fullName.type === "software") {
48
- logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);
49
- stream.write(JSON.stringify(src) + "\n");
50
- }
51
- }
52
- }
53
- // Assets
54
- if (!aType || aType === "asset") {
55
- for (const asset of compiler.allAssets()) {
56
- logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(asset.fullName)}`);
57
- stream.write(JSON.stringify(asset) + "\n");
58
- }
59
- for (const src of sources) {
60
- if (src.fullName.type === "asset") {
61
- logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);
62
- stream.write(JSON.stringify(src) + "\n");
63
- }
64
- }
65
- }
66
- // Tests
67
- if (!aType || aType === "test") {
68
- for (const src of sources) {
69
- if (src.fullName.type === "test") {
70
- logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)} ${src.srcName}`);
71
- stream.write(JSON.stringify(src) + "\n");
72
- }
73
- }
74
- }
6
+ const packageInfo = getPackageInfo(process.cwd(), logger);
7
+ const sources = parseSources(logger, packageInfo, "dist", "src", "");
8
+ const compiler = newCompiler(logger, packageInfo, "dist");
9
+ if (!aType || aType === "library") {
10
+ for (const lib of compiler.allLibs()) {
11
+ logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(lib.fullName)}`);
12
+ stream.write(JSON.stringify(lib) + "\n");
13
+ }
14
+ for (const src of sources) if (src.fullName.type === "library") {
15
+ logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);
16
+ stream.write(JSON.stringify(src) + "\n");
17
+ }
18
+ }
19
+ if (!aType || aType === "template") {
20
+ for (const tpl of compiler.allTemplates()) {
21
+ logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(tpl.fullName)}`);
22
+ stream.write(JSON.stringify(tpl) + "\n");
23
+ }
24
+ for (const src of sources) if (src.fullName.type === "template") {
25
+ logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)} ${src.srcName}`);
26
+ stream.write(JSON.stringify(src) + "\n");
27
+ }
28
+ }
29
+ if (!aType || aType === "software") {
30
+ for (const sw of compiler.allSoftware()) {
31
+ logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(sw.fullName)}`);
32
+ stream.write(JSON.stringify(sw) + "\n");
33
+ }
34
+ for (const src of sources) if (src.fullName.type === "software") {
35
+ logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);
36
+ stream.write(JSON.stringify(src) + "\n");
37
+ }
38
+ }
39
+ if (!aType || aType === "asset") {
40
+ for (const asset of compiler.allAssets()) {
41
+ logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(asset.fullName)}`);
42
+ stream.write(JSON.stringify(asset) + "\n");
43
+ }
44
+ for (const src of sources) if (src.fullName.type === "asset") {
45
+ logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);
46
+ stream.write(JSON.stringify(src) + "\n");
47
+ }
48
+ }
49
+ if (!aType || aType === "test") {
50
+ for (const src of sources) if (src.fullName.type === "test") {
51
+ logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)} ${src.srcName}`);
52
+ stream.write(JSON.stringify(src) + "\n");
53
+ }
54
+ }
75
55
  }
76
56
  function dumpSoftware(logger, stream) {
77
- const packageInfo = getPackageInfo(process.cwd(), logger);
78
- const compiled = compile(logger, packageInfo, "dist");
79
- const hashes = new Set();
80
- const sourceMap = new Map();
81
- for (const tpl of compiled.templates) {
82
- Object.entries(tpl.data.hashToSource).forEach(([hash, src]) => sourceMap.set(hash, src));
83
- getTemplateSoftware(tpl.data.template).forEach((hash) => hashes.add(hash));
84
- }
85
- for (const hash of hashes) {
86
- const src = sourceMap.get(hash);
87
- if (src) {
88
- if (Object.hasOwn(JSON.parse(src), "asset")) {
89
- // Skip assets. They are kept in templates software because of backward compatibility with backend.
90
- continue;
91
- }
92
- stream.write(src);
93
- if (!src.endsWith("\n")) {
94
- stream.write("\n");
95
- }
96
- }
97
- else {
98
- throw new Error(`Source not found for hash: ${hash}`);
99
- }
100
- }
57
+ const compiled = compile(logger, getPackageInfo(process.cwd(), logger), "dist");
58
+ const hashes = /* @__PURE__ */ new Set();
59
+ const sourceMap = /* @__PURE__ */ new Map();
60
+ for (const tpl of compiled.templates) {
61
+ Object.entries(tpl.data.hashToSource).forEach(([hash, src]) => sourceMap.set(hash, src));
62
+ getTemplateSoftware(tpl.data.template).forEach((hash) => hashes.add(hash));
63
+ }
64
+ for (const hash of hashes) {
65
+ const src = sourceMap.get(hash);
66
+ if (src) {
67
+ if (Object.hasOwn(JSON.parse(src), "asset")) continue;
68
+ stream.write(src);
69
+ if (!src.endsWith("\n")) stream.write("\n");
70
+ } else throw new Error(`Source not found for hash: ${hash}`);
71
+ }
101
72
  }
102
73
  function getTemplateSoftware(tpl) {
103
- const hashes = new Set();
104
- for (const sw of Object.values(tpl.software)) {
105
- hashes.add(sw.sourceHash);
106
- }
107
- for (const subTpl of Object.values(tpl.templates)) {
108
- getTemplateSoftware(subTpl).forEach((hash) => hashes.add(hash));
109
- }
110
- return new Set(hashes);
74
+ const hashes = /* @__PURE__ */ new Set();
75
+ for (const sw of Object.values(tpl.software)) hashes.add(sw.sourceHash);
76
+ for (const subTpl of Object.values(tpl.templates)) getTemplateSoftware(subTpl).forEach((hash) => hashes.add(hash));
77
+ return new Set(hashes);
111
78
  }
112
79
 
80
+ //#endregion
113
81
  export { dumpArtifacts, dumpSoftware };
114
- //# sourceMappingURL=dump.js.map
82
+ //# sourceMappingURL=dump.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dump.js","sources":["../../src/shared/dump.ts"],"sourcesContent":["import type winston from \"winston\";\nimport { getPackageInfo, newCompiler, compile, parseSources } from \"../compiler/main\";\nimport type { ArtifactType } from \"../compiler/package\";\nimport { typedArtifactNameToString } from \"../compiler/package\";\nimport type { TemplateDataV3 } from \"@milaboratories/pl-model-backend\";\n\nexport function dumpArtifacts(\n logger: winston.Logger,\n stream: NodeJS.WritableStream,\n aType?: ArtifactType,\n): void {\n const packageInfo = getPackageInfo(process.cwd(), logger);\n\n const sources = parseSources(logger, packageInfo, \"dist\", \"src\", \"\");\n\n const compiler = newCompiler(logger, packageInfo, \"dist\");\n\n // group output by type:\n // - all libs\n // - all templates\n // - all software\n // - all assets\n // - all tests\n\n // Libs\n\n if (!aType || aType === \"library\") {\n for (const lib of compiler.allLibs()) {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(lib.fullName)}`);\n stream.write(JSON.stringify(lib) + \"\\n\");\n }\n\n for (const src of sources) {\n if (src.fullName.type === \"library\") {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n }\n\n // Templates\n\n if (!aType || aType === \"template\") {\n for (const tpl of compiler.allTemplates()) {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(tpl.fullName)}`);\n stream.write(JSON.stringify(tpl) + \"\\n\");\n }\n\n for (const src of sources) {\n if (src.fullName.type === \"template\") {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)} ${src.srcName}`,\n );\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n }\n\n // Software\n\n if (!aType || aType === \"software\") {\n for (const sw of compiler.allSoftware()) {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(sw.fullName)}`);\n stream.write(JSON.stringify(sw) + \"\\n\");\n }\n\n for (const src of sources) {\n if (src.fullName.type === \"software\") {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n }\n\n // Assets\n\n if (!aType || aType === \"asset\") {\n for (const asset of compiler.allAssets()) {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(asset.fullName)}`);\n stream.write(JSON.stringify(asset) + \"\\n\");\n }\n\n for (const src of sources) {\n if (src.fullName.type === \"asset\") {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n }\n\n // Tests\n\n if (!aType || aType === \"test\") {\n for (const src of sources) {\n if (src.fullName.type === \"test\") {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)} ${src.srcName}`,\n );\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n }\n}\n\nexport function dumpLibs(\n logger: winston.Logger,\n stream: NodeJS.WritableStream,\n recursive: boolean,\n): void {\n const packageInfo = getPackageInfo(process.cwd(), logger);\n\n const sources = parseSources(logger, packageInfo, \"dist\", \"src\", \"\");\n\n if (!recursive) {\n for (const src of sources) {\n if (src.fullName.type === \"library\") {\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n\n return;\n }\n\n const compiler = newCompiler(logger, packageInfo, \"dist\");\n for (const src of sources) {\n if (src.fullName.type === \"library\") {\n compiler.addLib(src);\n }\n }\n\n for (const lib of compiler.allLibs()) {\n stream.write(JSON.stringify(lib) + \"\\n\");\n }\n}\n\nexport function dumpSoftware(logger: winston.Logger, stream: NodeJS.WritableStream): void {\n const packageInfo = getPackageInfo(process.cwd(), logger);\n const compiled = compile(logger, packageInfo, \"dist\");\n\n const hashes = new Set<string>();\n const sourceMap = new Map<string, string>();\n for (const tpl of compiled.templates) {\n Object.entries(tpl.data.hashToSource).forEach(([hash, src]) => sourceMap.set(hash, src));\n getTemplateSoftware(tpl.data.template).forEach((hash) => hashes.add(hash));\n }\n\n for (const hash of hashes) {\n const src = sourceMap.get(hash);\n if (src) {\n if (Object.hasOwn(JSON.parse(src) as object, \"asset\")) {\n // Skip assets. They are kept in templates software because of backward compatibility with backend.\n continue;\n }\n stream.write(src);\n if (!src.endsWith(\"\\n\")) {\n stream.write(\"\\n\");\n }\n } else {\n throw new Error(`Source not found for hash: ${hash}`);\n }\n }\n}\n\nfunction getTemplateSoftware(tpl: TemplateDataV3): Set<string> {\n const hashes = new Set<string>();\n for (const sw of Object.values(tpl.software)) {\n hashes.add(sw.sourceHash);\n }\n for (const subTpl of Object.values(tpl.templates)) {\n getTemplateSoftware(subTpl).forEach((hash) => hashes.add(hash));\n }\n\n return new Set(hashes);\n}\n"],"names":[],"mappings":";;;SAMgB,aAAa,CAC3B,MAAsB,EACtB,MAA6B,EAC7B,KAAoB,EAAA;IAEpB,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC;AAEzD,IAAA,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;IAEpE,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC;;;;;;;;AAWzD,IAAA,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,SAAS,EAAE;QACjC,KAAK,MAAM,GAAG,I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,IAAI,CAAC,CAAC;IAC5E;AAEA,IAAA,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE;QACzB,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC;QAC/B,IAAI,GAAG,EAAE;AACP,YAAA,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAW,EAAE,OAAO,CAAC,EAAE;;gBAErD;YACF;AACA,YAAA,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AACvB,gBAAA,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;YACpB;QACF;aAAO;AACL,YAAA,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,CAAA,CAAE,CAAC;QACvD;IACF;AACF;AAEA,SAAS,mBAAmB,CAAC,GAAmB,EAAA;AAC9C,IAAA,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU;AAChC,IAAA,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;AAC5C,QAAA,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC;IAC3B;AACA,IAAA,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;AACjD,QAAA,mBAAmB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjE;AAEA,IAAA,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC;AACxB;;;;"}
1
+ {"version":3,"file":"dump.js","names":[],"sources":["../../src/shared/dump.ts"],"sourcesContent":["import type winston from \"winston\";\nimport { getPackageInfo, newCompiler, compile, parseSources } from \"../compiler/main\";\nimport type { ArtifactType } from \"../compiler/package\";\nimport { typedArtifactNameToString } from \"../compiler/package\";\nimport type { TemplateDataV3 } from \"@milaboratories/pl-model-backend\";\n\nexport function dumpArtifacts(\n logger: winston.Logger,\n stream: NodeJS.WritableStream,\n aType?: ArtifactType,\n): void {\n const packageInfo = getPackageInfo(process.cwd(), logger);\n\n const sources = parseSources(logger, packageInfo, \"dist\", \"src\", \"\");\n\n const compiler = newCompiler(logger, packageInfo, \"dist\");\n\n // group output by type:\n // - all libs\n // - all templates\n // - all software\n // - all assets\n // - all tests\n\n // Libs\n\n if (!aType || aType === \"library\") {\n for (const lib of compiler.allLibs()) {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(lib.fullName)}`);\n stream.write(JSON.stringify(lib) + \"\\n\");\n }\n\n for (const src of sources) {\n if (src.fullName.type === \"library\") {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n }\n\n // Templates\n\n if (!aType || aType === \"template\") {\n for (const tpl of compiler.allTemplates()) {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(tpl.fullName)}`);\n stream.write(JSON.stringify(tpl) + \"\\n\");\n }\n\n for (const src of sources) {\n if (src.fullName.type === \"template\") {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)} ${src.srcName}`,\n );\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n }\n\n // Software\n\n if (!aType || aType === \"software\") {\n for (const sw of compiler.allSoftware()) {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(sw.fullName)}`);\n stream.write(JSON.stringify(sw) + \"\\n\");\n }\n\n for (const src of sources) {\n if (src.fullName.type === \"software\") {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n }\n\n // Assets\n\n if (!aType || aType === \"asset\") {\n for (const asset of compiler.allAssets()) {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(asset.fullName)}`);\n stream.write(JSON.stringify(asset) + \"\\n\");\n }\n\n for (const src of sources) {\n if (src.fullName.type === \"asset\") {\n logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n }\n\n // Tests\n\n if (!aType || aType === \"test\") {\n for (const src of sources) {\n if (src.fullName.type === \"test\") {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)} ${src.srcName}`,\n );\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n }\n}\n\nexport function dumpLibs(\n logger: winston.Logger,\n stream: NodeJS.WritableStream,\n recursive: boolean,\n): void {\n const packageInfo = getPackageInfo(process.cwd(), logger);\n\n const sources = parseSources(logger, packageInfo, \"dist\", \"src\", \"\");\n\n if (!recursive) {\n for (const src of sources) {\n if (src.fullName.type === \"library\") {\n stream.write(JSON.stringify(src) + \"\\n\");\n }\n }\n\n return;\n }\n\n const compiler = newCompiler(logger, packageInfo, \"dist\");\n for (const src of sources) {\n if (src.fullName.type === \"library\") {\n compiler.addLib(src);\n }\n }\n\n for (const lib of compiler.allLibs()) {\n stream.write(JSON.stringify(lib) + \"\\n\");\n }\n}\n\nexport function dumpSoftware(logger: winston.Logger, stream: NodeJS.WritableStream): void {\n const packageInfo = getPackageInfo(process.cwd(), logger);\n const compiled = compile(logger, packageInfo, \"dist\");\n\n const hashes = new Set<string>();\n const sourceMap = new Map<string, string>();\n for (const tpl of compiled.templates) {\n Object.entries(tpl.data.hashToSource).forEach(([hash, src]) => sourceMap.set(hash, src));\n getTemplateSoftware(tpl.data.template).forEach((hash) => hashes.add(hash));\n }\n\n for (const hash of hashes) {\n const src = sourceMap.get(hash);\n if (src) {\n if (Object.hasOwn(JSON.parse(src) as object, \"asset\")) {\n // Skip assets. They are kept in templates software because of backward compatibility with backend.\n continue;\n }\n stream.write(src);\n if (!src.endsWith(\"\\n\")) {\n stream.write(\"\\n\");\n }\n } else {\n throw new Error(`Source not found for hash: ${hash}`);\n }\n }\n}\n\nfunction getTemplateSoftware(tpl: TemplateDataV3): Set<string> {\n const hashes = new Set<string>();\n for (const sw of Object.values(tpl.software)) {\n hashes.add(sw.sourceHash);\n }\n for (const subTpl of Object.values(tpl.templates)) {\n getTemplateSoftware(subTpl).forEach((hash) => hashes.add(hash));\n }\n\n return new Set(hashes);\n}\n"],"mappings":";;;;AAMA,SAAgB,cACd,QACA,QACA,OACM;CACN,MAAM,cAAc,eAAe,QAAQ,KAAK,EAAE,OAAO;CAEzD,MAAM,UAAU,aAAa,QAAQ,aAAa,QAAQ,OAAO,GAAG;CAEpE,MAAM,WAAW,YAAY,QAAQ,aAAa,OAAO;AAWzD,KAAI,CAAC,SAAS,UAAU,WAAW;AACjC,OAAK,MAAM,OAAO,SAAS,SAAS,EAAE;AACpC,UAAO,MAAM,yBAAyB,0BAA0B,IAAI,SAAS,GAAG;AAChF,UAAO,MAAM,KAAK,UAAU,IAAI,GAAG,KAAK;;AAG1C,OAAK,MAAM,OAAO,QAChB,KAAI,IAAI,SAAS,SAAS,WAAW;AACnC,UAAO,MAAM,yBAAyB,0BAA0B,IAAI,SAAS,GAAG;AAChF,UAAO,MAAM,KAAK,UAAU,IAAI,GAAG,KAAK;;;AAO9C,KAAI,CAAC,SAAS,UAAU,YAAY;AAClC,OAAK,MAAM,OAAO,SAAS,cAAc,EAAE;AACzC,UAAO,MAAM,yBAAyB,0BAA0B,IAAI,SAAS,GAAG;AAChF,UAAO,MAAM,KAAK,UAAU,IAAI,GAAG,KAAK;;AAG1C,OAAK,MAAM,OAAO,QAChB,KAAI,IAAI,SAAS,SAAS,YAAY;AACpC,UAAO,MACL,yBAAyB,0BAA0B,IAAI,SAAS,CAAC,GAAG,IAAI,UACzE;AACD,UAAO,MAAM,KAAK,UAAU,IAAI,GAAG,KAAK;;;AAO9C,KAAI,CAAC,SAAS,UAAU,YAAY;AAClC,OAAK,MAAM,MAAM,SAAS,aAAa,EAAE;AACvC,UAAO,MAAM,yBAAyB,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AM,UAAU,IAAI,KAAK;AAC/B,MAAI,KAAK;AACP,OAAI,OAAO,OAAO,KAAK,MAAM,IAAI,EAAY,QAAQ,CAEnD;AAEF,UAAO,MAAM,IAAI;AACjB,OAAI,CAAC,IAAI,SAAS,KAAK,CACrB,QAAO,MAAM,KAAK;QAGpB,OAAM,IAAI,MAAM,8BAA8B,OAAO;;;AAK3D,SAAS,oBAAoB,KAAkC;CAC7D,MAAM,yBAAS,IAAI,KAAa;AAChC,MAAK,MAAM,MAAM,OAAO,OAAO,IAAI,SAAS,CAC1C,QAAO,IAAI,GAAG,WAAW;AAE3B,MAAK,MAAM,UAAU,OAAO,OAAO,IAAI,UAAU,CAC/C,qBAAoB,OAAO,CAAC,SAAS,SAAS,OAAO,IAAI,KAAK,CAAC;AAGjE,QAAO,IAAI,IAAI,OAAO"}
@@ -1,26 +1,30 @@
1
- 'use strict';
2
-
3
- var node_child_process = require('node:child_process');
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ let node_child_process = require("node:child_process");
4
3
 
4
+ //#region src/shared/proc.ts
5
5
  function spawnEmbed(cmd, ...args) {
6
- const p = node_child_process.spawn(cmd, args, { stdio: ["pipe", "inherit", "inherit"] });
7
- p.stdin.on("error", (err) => {
8
- const systemError = err;
9
- if (systemError.code === "EPIPE") ;
10
- });
11
- return p;
6
+ const p = (0, node_child_process.spawn)(cmd, args, { stdio: [
7
+ "pipe",
8
+ "inherit",
9
+ "inherit"
10
+ ] });
11
+ p.stdin.on("error", (err) => {
12
+ if (err.code === "EPIPE") {}
13
+ });
14
+ return p;
12
15
  }
13
16
  function waitFor(p) {
14
- return new Promise((resolve, reject) => {
15
- p.on("close", (code) => {
16
- resolve(code);
17
- });
18
- p.on("error", (err) => {
19
- reject(err);
20
- });
21
- });
17
+ return new Promise((resolve, reject) => {
18
+ p.on("close", (code) => {
19
+ resolve(code);
20
+ });
21
+ p.on("error", (err) => {
22
+ reject(err);
23
+ });
24
+ });
22
25
  }
23
26
 
27
+ //#endregion
24
28
  exports.spawnEmbed = spawnEmbed;
25
29
  exports.waitFor = waitFor;
26
- //# sourceMappingURL=proc.cjs.map
30
+ //# sourceMappingURL=proc.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"proc.cjs","sources":["../../src/shared/proc.ts"],"sourcesContent":["import type { ChildProcess, ChildProcessByStdio } from \"node:child_process\";\nimport { spawn } from \"node:child_process\";\nimport type { Writable } from \"node:stream\";\n\nexport function spawnEmbed(\n cmd: string,\n ...args: string[]\n): ChildProcessByStdio<Writable, null, null> {\n const p = spawn(cmd, args, { stdio: [\"pipe\", \"inherit\", \"inherit\"] });\n\n p.stdin.on(\"error\", (err: Error) => {\n const systemError = err as NodeJS.ErrnoException;\n if (systemError.code === \"EPIPE\") {\n // ignore EPIPE error as it stands for broken command run.\n // The command will write normal problem description by itself.\n }\n });\n\n return p;\n}\n\nexport function waitFor(p: ChildProcess): Promise<number> {\n return new Promise((resolve, reject) => {\n p.on(\"close\", (code: number) => {\n resolve(code);\n });\n p.on(\"error\", (err) => {\n reject(err);\n });\n });\n}\n"],"names":["spawn"],"mappings":";;;;SAIgB,UAAU,CACxB,GAAW,EACX,GAAG,IAAc,EAAA;IAEjB,MAAM,CAAC,GAAGA,wBAAK,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;IAErE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAU,KAAI;QACjC,MAAM,WAAW,GAAG,GAA4B;AAChD,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,OAAO,EAAE;AAIpC,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,CAAC;AACV;AAEM,SAAU,OAAO,CAAC,CAAe,EAAA;IACrC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;QACrC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAY,KAAI;YAC7B,OAAO,CAAC,IAAI,CAAC;AACf,QAAA,CAAC,CAAC;QACF,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,KAAI;YACpB,MAAM,CAAC,GAAG,CAAC;AACb,QAAA,CAAC,CAAC;AACJ,IAAA,CAAC,CAAC;AACJ;;;;;"}
1
+ {"version":3,"file":"proc.cjs","names":[],"sources":["../../src/shared/proc.ts"],"sourcesContent":["import type { ChildProcess, ChildProcessByStdio } from \"node:child_process\";\nimport { spawn } from \"node:child_process\";\nimport type { Writable } from \"node:stream\";\n\nexport function spawnEmbed(\n cmd: string,\n ...args: string[]\n): ChildProcessByStdio<Writable, null, null> {\n const p = spawn(cmd, args, { stdio: [\"pipe\", \"inherit\", \"inherit\"] });\n\n p.stdin.on(\"error\", (err: Error) => {\n const systemError = err as NodeJS.ErrnoException;\n if (systemError.code === \"EPIPE\") {\n // ignore EPIPE error as it stands for broken command run.\n // The command will write normal problem description by itself.\n }\n });\n\n return p;\n}\n\nexport function waitFor(p: ChildProcess): Promise<number> {\n return new Promise((resolve, reject) => {\n p.on(\"close\", (code: number) => {\n resolve(code);\n });\n p.on(\"error\", (err) => {\n reject(err);\n });\n });\n}\n"],"mappings":";;;;AAIA,SAAgB,WACd,KACA,GAAG,MACwC;CAC3C,MAAM,kCAAU,KAAK,MAAM,EAAE,OAAO;EAAC;EAAQ;EAAW;EAAU,EAAE,CAAC;AAErE,GAAE,MAAM,GAAG,UAAU,QAAe;AAElC,MADoB,IACJ,SAAS,SAAS;GAIlC;AAEF,QAAO;;AAGT,SAAgB,QAAQ,GAAkC;AACxD,QAAO,IAAI,SAAS,SAAS,WAAW;AACtC,IAAE,GAAG,UAAU,SAAiB;AAC9B,WAAQ,KAAK;IACb;AACF,IAAE,GAAG,UAAU,QAAQ;AACrB,UAAO,IAAI;IACX;GACF"}
@@ -1,23 +1,28 @@
1
- import { spawn } from 'node:child_process';
1
+ import { spawn } from "node:child_process";
2
2
 
3
+ //#region src/shared/proc.ts
3
4
  function spawnEmbed(cmd, ...args) {
4
- const p = spawn(cmd, args, { stdio: ["pipe", "inherit", "inherit"] });
5
- p.stdin.on("error", (err) => {
6
- const systemError = err;
7
- if (systemError.code === "EPIPE") ;
8
- });
9
- return p;
5
+ const p = spawn(cmd, args, { stdio: [
6
+ "pipe",
7
+ "inherit",
8
+ "inherit"
9
+ ] });
10
+ p.stdin.on("error", (err) => {
11
+ if (err.code === "EPIPE") {}
12
+ });
13
+ return p;
10
14
  }
11
15
  function waitFor(p) {
12
- return new Promise((resolve, reject) => {
13
- p.on("close", (code) => {
14
- resolve(code);
15
- });
16
- p.on("error", (err) => {
17
- reject(err);
18
- });
19
- });
16
+ return new Promise((resolve, reject) => {
17
+ p.on("close", (code) => {
18
+ resolve(code);
19
+ });
20
+ p.on("error", (err) => {
21
+ reject(err);
22
+ });
23
+ });
20
24
  }
21
25
 
26
+ //#endregion
22
27
  export { spawnEmbed, waitFor };
23
- //# sourceMappingURL=proc.js.map
28
+ //# sourceMappingURL=proc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"proc.js","sources":["../../src/shared/proc.ts"],"sourcesContent":["import type { ChildProcess, ChildProcessByStdio } from \"node:child_process\";\nimport { spawn } from \"node:child_process\";\nimport type { Writable } from \"node:stream\";\n\nexport function spawnEmbed(\n cmd: string,\n ...args: string[]\n): ChildProcessByStdio<Writable, null, null> {\n const p = spawn(cmd, args, { stdio: [\"pipe\", \"inherit\", \"inherit\"] });\n\n p.stdin.on(\"error\", (err: Error) => {\n const systemError = err as NodeJS.ErrnoException;\n if (systemError.code === \"EPIPE\") {\n // ignore EPIPE error as it stands for broken command run.\n // The command will write normal problem description by itself.\n }\n });\n\n return p;\n}\n\nexport function waitFor(p: ChildProcess): Promise<number> {\n return new Promise((resolve, reject) => {\n p.on(\"close\", (code: number) => {\n resolve(code);\n });\n p.on(\"error\", (err) => {\n reject(err);\n });\n });\n}\n"],"names":[],"mappings":";;SAIgB,UAAU,CACxB,GAAW,EACX,GAAG,IAAc,EAAA;IAEjB,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;IAErE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAU,KAAI;QACjC,MAAM,WAAW,GAAG,GAA4B;AAChD,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,OAAO,EAAE;AAIpC,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,CAAC;AACV;AAEM,SAAU,OAAO,CAAC,CAAe,EAAA;IACrC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;QACrC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAY,KAAI;YAC7B,OAAO,CAAC,IAAI,CAAC;AACf,QAAA,CAAC,CAAC;QACF,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,KAAI;YACpB,MAAM,CAAC,GAAG,CAAC;AACb,QAAA,CAAC,CAAC;AACJ,IAAA,CAAC,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"proc.js","names":[],"sources":["../../src/shared/proc.ts"],"sourcesContent":["import type { ChildProcess, ChildProcessByStdio } from \"node:child_process\";\nimport { spawn } from \"node:child_process\";\nimport type { Writable } from \"node:stream\";\n\nexport function spawnEmbed(\n cmd: string,\n ...args: string[]\n): ChildProcessByStdio<Writable, null, null> {\n const p = spawn(cmd, args, { stdio: [\"pipe\", \"inherit\", \"inherit\"] });\n\n p.stdin.on(\"error\", (err: Error) => {\n const systemError = err as NodeJS.ErrnoException;\n if (systemError.code === \"EPIPE\") {\n // ignore EPIPE error as it stands for broken command run.\n // The command will write normal problem description by itself.\n }\n });\n\n return p;\n}\n\nexport function waitFor(p: ChildProcess): Promise<number> {\n return new Promise((resolve, reject) => {\n p.on(\"close\", (code: number) => {\n resolve(code);\n });\n p.on(\"error\", (err) => {\n reject(err);\n });\n });\n}\n"],"mappings":";;;AAIA,SAAgB,WACd,KACA,GAAG,MACwC;CAC3C,MAAM,IAAI,MAAM,KAAK,MAAM,EAAE,OAAO;EAAC;EAAQ;EAAW;EAAU,EAAE,CAAC;AAErE,GAAE,MAAM,GAAG,UAAU,QAAe;AAElC,MADoB,IACJ,SAAS,SAAS;GAIlC;AAEF,QAAO;;AAGT,SAAgB,QAAQ,GAAkC;AACxD,QAAO,IAAI,SAAS,SAAS,WAAW;AACtC,IAAE,GAAG,UAAU,SAAiB;AAC9B,WAAQ,KAAK;IACb;AACF,IAAE,GAAG,UAAU,QAAQ;AACrB,UAAO,IAAI;IACX;GACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/tengo-builder",
3
- "version": "2.4.24",
3
+ "version": "2.4.26",
4
4
  "description": "Pl Tengo Template Builder",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -16,19 +16,19 @@
16
16
  "@milaboratories/tengo-tester": "^1.6.4",
17
17
  "@oclif/core": "^4.0.37",
18
18
  "winston": "^3.17.0",
19
- "@milaboratories/ts-helpers": "1.7.2",
20
- "@milaboratories/pl-model-backend": "1.1.53",
21
- "@milaboratories/resolve-helper": "1.1.2"
19
+ "@milaboratories/ts-helpers": "1.7.3",
20
+ "@milaboratories/resolve-helper": "1.1.3",
21
+ "@milaboratories/pl-model-backend": "1.1.55"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/node": "~24.5.2",
25
- "@vitest/coverage-istanbul": "^4.0.16",
26
- "typescript": "~5.6.3",
27
- "vitest": "^4.0.16",
28
- "@milaboratories/build-configs": "1.4.4",
25
+ "@vitest/coverage-istanbul": "^4.0.18",
26
+ "typescript": "~5.9.3",
27
+ "vitest": "^4.0.18",
28
+ "@milaboratories/ts-builder": "1.2.13",
29
+ "@milaboratories/ts-configs": "1.2.2",
29
30
  "@milaboratories/oclif-index": "1.1.1",
30
- "@milaboratories/ts-configs": "1.2.1",
31
- "@milaboratories/ts-builder": "1.2.10"
31
+ "@milaboratories/build-configs": "1.5.1"
32
32
  },
33
33
  "oclif": {
34
34
  "bin": "pl-tengo",
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAUtC,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,OAAO;IACxC,OAAgB,WAAW,SAA6D;IAExF,OAAgB,QAAQ,WAA2C;IAEnE,OAAgB,KAAK;;;;;MAGnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyBlC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAOtC,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,OAAO;IACxC,OAAgB,WAAW,SAAmD;IAM9E,MAAM,CAAC,MAAM,UAAS;IAEtB,OAAgB,KAAK;;MAAsB;IAE3C,OAAgB,QAAQ,WAA2C;IAEtD,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0BlC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/commands/dump/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAOtC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,OAAO;IAChD,OAAgB,WAAW,SACiD;IAE5E,OAAgB,QAAQ,WAA2C;IAEnE,OAAgB,KAAK;;;MAGnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAKlC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"software.d.ts","sourceRoot":"","sources":["../../../src/commands/dump/software.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAMtC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,OAAO;IAC/C,OAAgB,WAAW,SAC8D;IAEzF,OAAgB,QAAQ,WAA2C;IAEnE,OAAgB,KAAK;;MAEnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAKlC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/commands/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAOtC,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACvC,OAAgB,WAAW,SAAwC;IAEnE,MAAM,CAAC,MAAM,UAAS;IAEtB,OAAgB,KAAK;;MAAsB;IAE3C,OAAgB,QAAQ,WAA2C;IAEtD,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0BlC"}
@@ -1,24 +0,0 @@
1
- import type { CompileMode, TypedArtifactName } from "./package";
2
- export declare class ArtifactMap<T> {
3
- private readonly nameExtractor;
4
- private readonly map;
5
- constructor(nameExtractor: (obj: T) => TypedArtifactName);
6
- add(obj: T, replace?: boolean): T | undefined;
7
- get(name: TypedArtifactName): T | undefined;
8
- get array(): T[];
9
- forEach(callback: (value: T, key: TypedArtifactName) => void): void;
10
- }
11
- export declare function createArtifactNameSet(): ArtifactMap<TypedArtifactName>;
12
- /**
13
- * ArtifactStore is a store for artifacts that are compiled for different modes.
14
- * It is used to collect all artifacts from the dependency tree and compile them for different modes.
15
- */
16
- export declare class ArtifactStore<T> {
17
- private readonly dist;
18
- constructor(nameExtractor: (obj: T) => TypedArtifactName);
19
- add(mode: CompileMode, obj: T, replace?: boolean): T | undefined;
20
- get(mode: CompileMode, name: TypedArtifactName): T | undefined;
21
- array(mode: CompileMode): T[];
22
- forEach(mode: CompileMode, callback: (value: T, key: TypedArtifactName) => void): void;
23
- }
24
- //# sourceMappingURL=artif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@@ -1,42 +0,0 @@
1
- import type { ArtifactSource } from "./source";
2
- import type { TemplateWithSource } from "./template";
3
- import type { TypedArtifactName, CompileMode } from "./package";
4
- /** A compilation result. */
5
- export interface TemplatesAndLibs {
6
- templates: TemplateWithSource[];
7
- libs: ArtifactSource[];
8
- software: ArtifactSource[];
9
- assets: ArtifactSource[];
10
- }
11
- export declare class TengoTemplateCompiler {
12
- private readonly compileMode;
13
- private readonly libs;
14
- private readonly software;
15
- private readonly assets;
16
- private readonly templates;
17
- constructor(compileMode: CompileMode);
18
- /** Recursively add dependencies to the template. */
19
- private populateTemplateDataFromDependencies;
20
- /** This method assumes that all dependencies are already added to the compiler's context */
21
- private compileAndAddTemplate;
22
- addLib(lib: ArtifactSource): void;
23
- allLibs(): ArtifactSource[];
24
- getLib(name: TypedArtifactName): ArtifactSource | undefined;
25
- getLibOrError(name: TypedArtifactName): ArtifactSource;
26
- checkLibs(): void;
27
- addSoftware(software: ArtifactSource): void;
28
- allSoftware(): ArtifactSource[];
29
- getSoftware(name: TypedArtifactName): ArtifactSource | undefined;
30
- getSoftwareOrError(name: TypedArtifactName): ArtifactSource;
31
- addAsset(asset: ArtifactSource): void;
32
- allAssets(): ArtifactSource[];
33
- getAsset(name: TypedArtifactName): ArtifactSource | undefined;
34
- getAssetOrError(name: TypedArtifactName): ArtifactSource;
35
- addTemplate(tpl: TemplateWithSource): void;
36
- allTemplates(): TemplateWithSource[];
37
- getTemplate(name: TypedArtifactName): TemplateWithSource | undefined;
38
- getTemplateOrError(name: TypedArtifactName): TemplateWithSource;
39
- getArtefact(name: TypedArtifactName): ArtifactSource | TemplateWithSource | undefined;
40
- compileAndAdd(sources: ArtifactSource[]): TemplatesAndLibs;
41
- }
42
- //# sourceMappingURL=compiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/compiler/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAA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I,EAAE,iBAAiB,GAAG,cAAc;IAMxD,WAAW,CAAC,GAAG,EAAE,kBAAkB;IAQnC,YAAY,IAAI,kBAAkB,EAAE;IAIpC,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,SAAS;IAMpE,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,kBAAkB;IAM/D,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,cAAc,GAAG,kBAAkB,GAAG,SAAS;IAmBrF,aAAa,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,gBAAgB;CA+G3D"}
@@ -1,6 +0,0 @@
1
- import type { TemplateDataV3, TemplateLibDataV3 } from "@milaboratories/pl-model-backend";
2
- import type { CompilerOption } from "./package";
3
- export declare function applyTemplateCompilerOptions(opts: CompilerOption[], tpl: TemplateDataV3): void;
4
- export declare function applyLibraryCompilerOptions(opts: CompilerOption[], _lib: TemplateLibDataV3): void;
5
- export declare function hashOverride(args: string[]): string;
6
- //# sourceMappingURL=compileroptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compileroptions.d.ts","sourceRoot":"","sources":["../../src/compiler/compileroptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,GAAG,EAAE,cAAc,QASvF;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,iBAAiB,QAa1F;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAoBnD"}
@@ -1,35 +0,0 @@
1
- #!/usr/bin/env node
2
- import type { TemplatesAndLibs } from "./compiler";
3
- import { TengoTemplateCompiler } from "./compiler";
4
- import type { CompileMode, FullArtifactName } from "./package";
5
- import { ArtifactSource } from "./source";
6
- import type winston from "winston";
7
- interface PackageId {
8
- /** Package name from package.json */
9
- readonly name: string;
10
- /** Package version from package.json */
11
- readonly version: string;
12
- }
13
- interface PackageInfo extends PackageId {
14
- /** Package type from package.json */
15
- readonly type: string | undefined;
16
- /** Path to package root */
17
- readonly root: string;
18
- /** Context of package info */
19
- readonly context: PackageInfoContext;
20
- /** Dependencies */
21
- readonly dependencies: PackageInfo[];
22
- }
23
- export declare function resolvePackageJsonRoot(root: string): string;
24
- type PackageInfoContext = "root" | "dependency" | "devDependency";
25
- /**
26
- * Get package info from package.json and all dependencies.
27
- */
28
- export declare function getPackageInfo(root: string, logger: winston.Logger, context?: PackageInfoContext): PackageInfo;
29
- export declare function parseSources(logger: winston.Logger, packageId: PackageId, mode: CompileMode, root: string, subdir: string): ArtifactSource[];
30
- export declare function newCompiler(logger: winston.Logger, packageInfo: PackageInfo, mode: CompileMode): TengoTemplateCompiler;
31
- export declare function fullNameFromFileName(packageId: PackageId, artifactName: string): FullArtifactName | null;
32
- export declare function compile(logger: winston.Logger, packageInfo: PackageInfo, mode: CompileMode): TemplatesAndLibs;
33
- export declare function savePacks(logger: winston.Logger, compiled: TemplatesAndLibs, mode: CompileMode): void;
34
- export {};
35
- //# sourceMappingURL=main.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/compiler/main.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAmB,MAAM,UAAU,CAAC;AAE3D,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAInC,UAAU,SAAS;IACjB,qCAAqC;IACrC,QAAQ,CAAC,IAAI,EAAE,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,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,QA4C9F"}
@@ -1,44 +0,0 @@
1
- export type CompileMode = "dist";
2
- export type CompilerOption = {
3
- /** Option name, like 'hash_override' */
4
- name: string;
5
- /** Arguments of the option. Everything that follows option name */
6
- args: string[];
7
- };
8
- export type ArtifactType = "library" | "template" | "test" | "software" | "asset";
9
- /** Artifact Name including package version */
10
- export interface FullArtifactName {
11
- /** Dependency type */
12
- type: ArtifactType;
13
- /** Fully qualified package */
14
- pkg: string;
15
- /** Id of the artifact inside the package */
16
- id: string;
17
- /** Package version */
18
- version: string;
19
- }
20
- export type FullArtifactNameWithoutType = Omit<FullArtifactName, "type">;
21
- export type TypedArtifactName = Pick<FullArtifactName, "type" | "pkg" | "id">;
22
- export type PackageName = Pick<FullArtifactName, "pkg" | "version">;
23
- export type ArtifactName = Pick<FullArtifactName, "pkg" | "id">;
24
- export declare function artifactKey(name: TypedArtifactName): string;
25
- export declare function fullNameToString(name: FullArtifactName): string;
26
- /** used for exceptions */
27
- export declare function typedArtifactNameToString(name: TypedArtifactName): string;
28
- export declare function typedArtifactNamesEquals(name1: TypedArtifactName, name2: TypedArtifactName): boolean;
29
- export declare function fullNameEquals(name1: FullArtifactName, name2: FullArtifactName): boolean;
30
- /** used to format artefact name while generating output files */
31
- export declare function artifactNameToString(name: ArtifactName): string;
32
- /** used to format artefact name and version while generating output files */
33
- export declare function formatArtefactNameAndVersion(name: FullArtifactName): {
34
- name: string;
35
- version: string;
36
- };
37
- /** used to format artefact name and version while generating output files */
38
- export declare function parseArtefactNameAndVersion(nameAndVersion: {
39
- name: string;
40
- version: string;
41
- }): FullArtifactNameWithoutType;
42
- export declare function fullNameWithoutTypeToString(name: FullArtifactNameWithoutType): string;
43
- export declare function fullNameWithoutType(name: FullArtifactName): FullArtifactNameWithoutType;
44
- //# sourceMappingURL=package.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../src/compiler/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