@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
package/dist/index.cjs CHANGED
@@ -1,19 +1,19 @@
1
- 'use strict';
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_build = require('./commands/build.cjs');
3
+ const require_check = require('./commands/check.cjs');
4
+ const require_test = require('./commands/test.cjs');
5
+ const require_artifacts = require('./commands/dump/artifacts.cjs');
6
+ const require_software = require('./commands/dump/software.cjs');
2
7
 
3
- var build = require('./commands/build.cjs');
4
- var check = require('./commands/check.cjs');
5
- var test = require('./commands/test.cjs');
6
- var artifacts = require('./commands/dump/artifacts.cjs');
7
- var software = require('./commands/dump/software.cjs');
8
-
9
- // DO NOT EDIT. This file was generated by oclif-index utility.
8
+ //#region src/index.ts
10
9
  const COMMANDS = {
11
- build: build,
12
- check: check,
13
- test: test,
14
- "dump:artifacts": artifacts,
15
- "dump:software": software,
10
+ build: require_build.default,
11
+ check: require_check.default,
12
+ test: require_test.default,
13
+ "dump:artifacts": require_artifacts.default,
14
+ "dump:software": require_software.default
16
15
  };
17
16
 
17
+ //#endregion
18
18
  exports.COMMANDS = COMMANDS;
19
- //# sourceMappingURL=index.cjs.map
19
+ //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["// DO NOT EDIT. This file was generated by oclif-index utility.\n\nimport Cmd0 from \"./commands/build\";\nimport Cmd1 from \"./commands/check\";\nimport Cmd2 from \"./commands/test\";\nimport Cmd3 from \"./commands/dump/artifacts\";\nimport Cmd4 from \"./commands/dump/software\";\n\nexport const COMMANDS = {\n build: Cmd0,\n check: Cmd1,\n test: Cmd2,\n \"dump:artifacts\": Cmd3,\n \"dump:software\": Cmd4,\n};\n"],"names":["Cmd0","Cmd1","Cmd2","Cmd3","Cmd4"],"mappings":";;;;;;;;AAAA;AAQO,MAAM,QAAQ,GAAG;AACtB,IAAA,KAAK,EAAEA,KAAI;AACX,IAAA,KAAK,EAAEC,KAAI;AACX,IAAA,IAAI,EAAEC,IAAI;AACV,IAAA,gBAAgB,EAAEC,SAAI;AACtB,IAAA,eAAe,EAAEC,QAAI;;;;;"}
1
+ {"version":3,"file":"index.cjs","names":["Cmd0","Cmd1","Cmd2","Cmd3","Cmd4"],"sources":["../src/index.ts"],"sourcesContent":["// DO NOT EDIT. This file was generated by oclif-index utility.\n\nimport Cmd0 from \"./commands/build\";\nimport Cmd1 from \"./commands/check\";\nimport Cmd2 from \"./commands/test\";\nimport Cmd3 from \"./commands/dump/artifacts\";\nimport Cmd4 from \"./commands/dump/software\";\n\nexport const COMMANDS = {\n build: Cmd0,\n check: Cmd1,\n test: Cmd2,\n \"dump:artifacts\": Cmd3,\n \"dump:software\": Cmd4,\n};\n"],"mappings":";;;;;;;;AAQA,MAAa,WAAW;CACtB,OAAOA;CACP,OAAOC;CACP,MAAMC;CACN,kBAAkBC;CAClB,iBAAiBC;CAClB"}
package/dist/index.d.ts CHANGED
@@ -1,13 +1,17 @@
1
- import Cmd0 from "./commands/build";
2
- import Cmd1 from "./commands/check";
3
- import Cmd2 from "./commands/test";
4
- import Cmd3 from "./commands/dump/artifacts";
5
- import Cmd4 from "./commands/dump/software";
6
- export declare const COMMANDS: {
7
- build: typeof Cmd0;
8
- check: typeof Cmd1;
9
- test: typeof Cmd2;
10
- "dump:artifacts": typeof Cmd3;
11
- "dump:software": typeof Cmd4;
1
+ import { Build } from "./commands/build.js";
2
+ import { Check } from "./commands/check.js";
3
+ import { Test } from "./commands/test.js";
4
+ import { DumpArtifacts } from "./commands/dump/artifacts.js";
5
+ import { DumpSoftware } from "./commands/dump/software.js";
6
+
7
+ //#region src/index.d.ts
8
+ declare const COMMANDS: {
9
+ build: typeof Build;
10
+ check: typeof Check;
11
+ test: typeof Test;
12
+ "dump:artifacts": typeof DumpArtifacts;
13
+ "dump:software": typeof DumpSoftware;
12
14
  };
15
+ //#endregion
16
+ export { COMMANDS };
13
17
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,17 +1,18 @@
1
- import Build from './commands/build.js';
2
- import Check from './commands/check.js';
3
- import Test from './commands/test.js';
4
- import DumpArtifacts from './commands/dump/artifacts.js';
5
- import DumpSoftware from './commands/dump/software.js';
1
+ import Build from "./commands/build.js";
2
+ import Check from "./commands/check.js";
3
+ import Test from "./commands/test.js";
4
+ import DumpArtifacts from "./commands/dump/artifacts.js";
5
+ import DumpSoftware from "./commands/dump/software.js";
6
6
 
7
- // DO NOT EDIT. This file was generated by oclif-index utility.
7
+ //#region src/index.ts
8
8
  const COMMANDS = {
9
- build: Build,
10
- check: Check,
11
- test: Test,
12
- "dump:artifacts": DumpArtifacts,
13
- "dump:software": DumpSoftware,
9
+ build: Build,
10
+ check: Check,
11
+ test: Test,
12
+ "dump:artifacts": DumpArtifacts,
13
+ "dump:software": DumpSoftware
14
14
  };
15
15
 
16
+ //#endregion
16
17
  export { COMMANDS };
17
- //# sourceMappingURL=index.js.map
18
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// DO NOT EDIT. This file was generated by oclif-index utility.\n\nimport Cmd0 from \"./commands/build\";\nimport Cmd1 from \"./commands/check\";\nimport Cmd2 from \"./commands/test\";\nimport Cmd3 from \"./commands/dump/artifacts\";\nimport Cmd4 from \"./commands/dump/software\";\n\nexport const COMMANDS = {\n build: Cmd0,\n check: Cmd1,\n test: Cmd2,\n \"dump:artifacts\": Cmd3,\n \"dump:software\": Cmd4,\n};\n"],"names":["Cmd0","Cmd1","Cmd2","Cmd3","Cmd4"],"mappings":";;;;;;AAAA;AAQO,MAAM,QAAQ,GAAG;AACtB,IAAA,KAAK,EAAEA,KAAI;AACX,IAAA,KAAK,EAAEC,KAAI;AACX,IAAA,IAAI,EAAEC,IAAI;AACV,IAAA,gBAAgB,EAAEC,aAAI;AACtB,IAAA,eAAe,EAAEC,YAAI;;;;;"}
1
+ {"version":3,"file":"index.js","names":["Cmd0","Cmd1","Cmd2","Cmd3","Cmd4"],"sources":["../src/index.ts"],"sourcesContent":["// DO NOT EDIT. This file was generated by oclif-index utility.\n\nimport Cmd0 from \"./commands/build\";\nimport Cmd1 from \"./commands/check\";\nimport Cmd2 from \"./commands/test\";\nimport Cmd3 from \"./commands/dump/artifacts\";\nimport Cmd4 from \"./commands/dump/software\";\n\nexport const COMMANDS = {\n build: Cmd0,\n check: Cmd1,\n test: Cmd2,\n \"dump:artifacts\": Cmd3,\n \"dump:software\": Cmd4,\n};\n"],"mappings":";;;;;;;AAQA,MAAa,WAAW;CACtB,OAAOA;CACP,OAAOC;CACP,MAAMC;CACN,kBAAkBC;CAClB,iBAAiBC;CAClB"}
@@ -1,40 +1,49 @@
1
- 'use strict';
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ let _oclif_core = require("@oclif/core");
2
3
 
3
- var core = require('@oclif/core');
4
-
5
- const GlobalFlags = {
6
- "log-level": core.Flags.string({
7
- description: "logging level",
8
- default: "info",
9
- options: ["error", "warn", "info", "debug"],
10
- }),
11
- };
4
+ //#region src/shared/basecmd.ts
5
+ const GlobalFlags = { "log-level": _oclif_core.Flags.string({
6
+ description: "logging level",
7
+ default: "info",
8
+ options: [
9
+ "error",
10
+ "warn",
11
+ "info",
12
+ "debug"
13
+ ]
14
+ }) };
12
15
  const CtagsFlags = {
13
- "generate-tags": core.Flags.boolean({
14
- description: "generate tags, default false",
15
- default: false,
16
- }),
17
- "tags-file": core.Flags.file({
18
- description: 'where to put ".tags" file, it should be a root of VS Code project',
19
- default: "../../.tags", // usually a user opens a directory with all blocks
20
- }),
21
- "tags-additional-args": core.Flags.string({
22
- description: "additional flags for universal-ctags command: e.g. -e for emacs",
23
- default: [],
24
- multiple: true,
25
- delimiter: ",",
26
- }),
27
- };
28
- const ArtifactTypeFlag = {
29
- type: core.Flags.string({
30
- aliases: ["t"],
31
- description: "artifact type",
32
- options: ["all", "library", "template", "test", "software", "asset"],
33
- default: "all",
34
- }),
16
+ "generate-tags": _oclif_core.Flags.boolean({
17
+ description: "generate tags, default false",
18
+ default: false
19
+ }),
20
+ "tags-file": _oclif_core.Flags.file({
21
+ description: "where to put \".tags\" file, it should be a root of VS Code project",
22
+ default: "../../.tags"
23
+ }),
24
+ "tags-additional-args": _oclif_core.Flags.string({
25
+ description: "additional flags for universal-ctags command: e.g. -e for emacs",
26
+ default: [],
27
+ multiple: true,
28
+ delimiter: ","
29
+ })
35
30
  };
31
+ const ArtifactTypeFlag = { type: _oclif_core.Flags.string({
32
+ aliases: ["t"],
33
+ description: "artifact type",
34
+ options: [
35
+ "all",
36
+ "library",
37
+ "template",
38
+ "test",
39
+ "software",
40
+ "asset"
41
+ ],
42
+ default: "all"
43
+ }) };
36
44
 
45
+ //#endregion
37
46
  exports.ArtifactTypeFlag = ArtifactTypeFlag;
38
47
  exports.CtagsFlags = CtagsFlags;
39
48
  exports.GlobalFlags = GlobalFlags;
40
- //# sourceMappingURL=basecmd.cjs.map
49
+ //# sourceMappingURL=basecmd.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"basecmd.cjs","sources":["../../src/shared/basecmd.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\n\nexport const GlobalFlags = {\n \"log-level\": Flags.string({\n description: \"logging level\",\n default: \"info\",\n options: [\"error\", \"warn\", \"info\", \"debug\"],\n }),\n};\n\nexport const CtagsFlags = {\n \"generate-tags\": Flags.boolean({\n description: \"generate tags, default false\",\n default: false,\n }),\n\n \"tags-file\": Flags.file({\n description: 'where to put \".tags\" file, it should be a root of VS Code project',\n default: \"../../.tags\", // usually a user opens a directory with all blocks\n }),\n\n \"tags-additional-args\": Flags.string({\n description: \"additional flags for universal-ctags command: e.g. -e for emacs\",\n default: [],\n multiple: true,\n delimiter: \",\",\n }),\n};\n\nexport const ArtifactTypeFlag = {\n type: Flags.string({\n aliases: [\"t\"],\n description: \"artifact type\",\n options: [\"all\", \"library\", \"template\", \"test\", \"software\", \"asset\"],\n default: \"all\",\n }),\n};\n"],"names":["Flags"],"mappings":";;;;AAEO,MAAM,WAAW,GAAG;AACzB,IAAA,WAAW,EAAEA,UAAK,CAAC,MAAM,CAAC;AACxB,QAAA,WAAW,EAAE,eAAe;AAC5B,QAAA,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;KAC5C,CAAC;;AAGG,MAAM,UAAU,GAAG;AACxB,IAAA,eAAe,EAAEA,UAAK,CAAC,OAAO,CAAC;AAC7B,QAAA,WAAW,EAAE,8BAA8B;AAC3C,QAAA,OAAO,EAAE,KAAK;KACf,CAAC;AAEF,IAAA,WAAW,EAAEA,UAAK,CAAC,IAAI,CAAC;AACtB,QAAA,WAAW,EAAE,mEAAmE;QAChF,OAAO,EAAE,aAAa;KACvB,CAAC;AAEF,IAAA,sBAAsB,EAAEA,UAAK,CAAC,MAAM,CAAC;AACnC,QAAA,WAAW,EAAE,iEAAiE;AAC9E,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,SAAS,EAAE,GAAG;KACf,CAAC;;AAGG,MAAM,gBAAgB,GAAG;AAC9B,IAAA,IAAI,EAAEA,UAAK,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,CAAC,GAAG,CAAC;AACd,QAAA,WAAW,EAAE,eAAe;AAC5B,QAAA,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC;AACpE,QAAA,OAAO,EAAE,KAAK;KACf,CAAC;;;;;;;"}
1
+ {"version":3,"file":"basecmd.cjs","names":["Flags"],"sources":["../../src/shared/basecmd.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\n\nexport const GlobalFlags = {\n \"log-level\": Flags.string({\n description: \"logging level\",\n default: \"info\",\n options: [\"error\", \"warn\", \"info\", \"debug\"],\n }),\n};\n\nexport const CtagsFlags = {\n \"generate-tags\": Flags.boolean({\n description: \"generate tags, default false\",\n default: false,\n }),\n\n \"tags-file\": Flags.file({\n description: 'where to put \".tags\" file, it should be a root of VS Code project',\n default: \"../../.tags\", // usually a user opens a directory with all blocks\n }),\n\n \"tags-additional-args\": Flags.string({\n description: \"additional flags for universal-ctags command: e.g. -e for emacs\",\n default: [],\n multiple: true,\n delimiter: \",\",\n }),\n};\n\nexport const ArtifactTypeFlag = {\n type: Flags.string({\n aliases: [\"t\"],\n description: \"artifact type\",\n options: [\"all\", \"library\", \"template\", \"test\", \"software\", \"asset\"],\n default: \"all\",\n }),\n};\n"],"mappings":";;;;AAEA,MAAa,cAAc,EACzB,aAAaA,kBAAM,OAAO;CACxB,aAAa;CACb,SAAS;CACT,SAAS;EAAC;EAAS;EAAQ;EAAQ;EAAQ;CAC5C,CAAC,EACH;AAED,MAAa,aAAa;CACxB,iBAAiBA,kBAAM,QAAQ;EAC7B,aAAa;EACb,SAAS;EACV,CAAC;CAEF,aAAaA,kBAAM,KAAK;EACtB,aAAa;EACb,SAAS;EACV,CAAC;CAEF,wBAAwBA,kBAAM,OAAO;EACnC,aAAa;EACb,SAAS,EAAE;EACX,UAAU;EACV,WAAW;EACZ,CAAC;CACH;AAED,MAAa,mBAAmB,EAC9B,MAAMA,kBAAM,OAAO;CACjB,SAAS,CAAC,IAAI;CACd,aAAa;CACb,SAAS;EAAC;EAAO;EAAW;EAAY;EAAQ;EAAY;EAAQ;CACpE,SAAS;CACV,CAAC,EACH"}
@@ -1,36 +1,46 @@
1
- import { Flags } from '@oclif/core';
1
+ import { Flags } from "@oclif/core";
2
2
 
3
- const GlobalFlags = {
4
- "log-level": Flags.string({
5
- description: "logging level",
6
- default: "info",
7
- options: ["error", "warn", "info", "debug"],
8
- }),
9
- };
3
+ //#region src/shared/basecmd.ts
4
+ const GlobalFlags = { "log-level": Flags.string({
5
+ description: "logging level",
6
+ default: "info",
7
+ options: [
8
+ "error",
9
+ "warn",
10
+ "info",
11
+ "debug"
12
+ ]
13
+ }) };
10
14
  const CtagsFlags = {
11
- "generate-tags": Flags.boolean({
12
- description: "generate tags, default false",
13
- default: false,
14
- }),
15
- "tags-file": Flags.file({
16
- description: 'where to put ".tags" file, it should be a root of VS Code project',
17
- default: "../../.tags", // usually a user opens a directory with all blocks
18
- }),
19
- "tags-additional-args": Flags.string({
20
- description: "additional flags for universal-ctags command: e.g. -e for emacs",
21
- default: [],
22
- multiple: true,
23
- delimiter: ",",
24
- }),
25
- };
26
- const ArtifactTypeFlag = {
27
- type: Flags.string({
28
- aliases: ["t"],
29
- description: "artifact type",
30
- options: ["all", "library", "template", "test", "software", "asset"],
31
- default: "all",
32
- }),
15
+ "generate-tags": Flags.boolean({
16
+ description: "generate tags, default false",
17
+ default: false
18
+ }),
19
+ "tags-file": Flags.file({
20
+ description: "where to put \".tags\" file, it should be a root of VS Code project",
21
+ default: "../../.tags"
22
+ }),
23
+ "tags-additional-args": Flags.string({
24
+ description: "additional flags for universal-ctags command: e.g. -e for emacs",
25
+ default: [],
26
+ multiple: true,
27
+ delimiter: ","
28
+ })
33
29
  };
30
+ const ArtifactTypeFlag = { type: Flags.string({
31
+ aliases: ["t"],
32
+ description: "artifact type",
33
+ options: [
34
+ "all",
35
+ "library",
36
+ "template",
37
+ "test",
38
+ "software",
39
+ "asset"
40
+ ],
41
+ default: "all"
42
+ }) };
34
43
 
44
+ //#endregion
35
45
  export { ArtifactTypeFlag, CtagsFlags, GlobalFlags };
36
- //# sourceMappingURL=basecmd.js.map
46
+ //# sourceMappingURL=basecmd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"basecmd.js","sources":["../../src/shared/basecmd.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\n\nexport const GlobalFlags = {\n \"log-level\": Flags.string({\n description: \"logging level\",\n default: \"info\",\n options: [\"error\", \"warn\", \"info\", \"debug\"],\n }),\n};\n\nexport const CtagsFlags = {\n \"generate-tags\": Flags.boolean({\n description: \"generate tags, default false\",\n default: false,\n }),\n\n \"tags-file\": Flags.file({\n description: 'where to put \".tags\" file, it should be a root of VS Code project',\n default: \"../../.tags\", // usually a user opens a directory with all blocks\n }),\n\n \"tags-additional-args\": Flags.string({\n description: \"additional flags for universal-ctags command: e.g. -e for emacs\",\n default: [],\n multiple: true,\n delimiter: \",\",\n }),\n};\n\nexport const ArtifactTypeFlag = {\n type: Flags.string({\n aliases: [\"t\"],\n description: \"artifact type\",\n options: [\"all\", \"library\", \"template\", \"test\", \"software\", \"asset\"],\n default: \"all\",\n }),\n};\n"],"names":[],"mappings":";;AAEO,MAAM,WAAW,GAAG;AACzB,IAAA,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;AACxB,QAAA,WAAW,EAAE,eAAe;AAC5B,QAAA,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;KAC5C,CAAC;;AAGG,MAAM,UAAU,GAAG;AACxB,IAAA,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC;AAC7B,QAAA,WAAW,EAAE,8BAA8B;AAC3C,QAAA,OAAO,EAAE,KAAK;KACf,CAAC;AAEF,IAAA,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC;AACtB,QAAA,WAAW,EAAE,mEAAmE;QAChF,OAAO,EAAE,aAAa;KACvB,CAAC;AAEF,IAAA,sBAAsB,EAAE,KAAK,CAAC,MAAM,CAAC;AACnC,QAAA,WAAW,EAAE,iEAAiE;AAC9E,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,SAAS,EAAE,GAAG;KACf,CAAC;;AAGG,MAAM,gBAAgB,GAAG;AAC9B,IAAA,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,CAAC,GAAG,CAAC;AACd,QAAA,WAAW,EAAE,eAAe;AAC5B,QAAA,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC;AACpE,QAAA,OAAO,EAAE,KAAK;KACf,CAAC;;;;;"}
1
+ {"version":3,"file":"basecmd.js","names":[],"sources":["../../src/shared/basecmd.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\n\nexport const GlobalFlags = {\n \"log-level\": Flags.string({\n description: \"logging level\",\n default: \"info\",\n options: [\"error\", \"warn\", \"info\", \"debug\"],\n }),\n};\n\nexport const CtagsFlags = {\n \"generate-tags\": Flags.boolean({\n description: \"generate tags, default false\",\n default: false,\n }),\n\n \"tags-file\": Flags.file({\n description: 'where to put \".tags\" file, it should be a root of VS Code project',\n default: \"../../.tags\", // usually a user opens a directory with all blocks\n }),\n\n \"tags-additional-args\": Flags.string({\n description: \"additional flags for universal-ctags command: e.g. -e for emacs\",\n default: [],\n multiple: true,\n delimiter: \",\",\n }),\n};\n\nexport const ArtifactTypeFlag = {\n type: Flags.string({\n aliases: [\"t\"],\n description: \"artifact type\",\n options: [\"all\", \"library\", \"template\", \"test\", \"software\", \"asset\"],\n default: \"all\",\n }),\n};\n"],"mappings":";;;AAEA,MAAa,cAAc,EACzB,aAAa,MAAM,OAAO;CACxB,aAAa;CACb,SAAS;CACT,SAAS;EAAC;EAAS;EAAQ;EAAQ;EAAQ;CAC5C,CAAC,EACH;AAED,MAAa,aAAa;CACxB,iBAAiB,MAAM,QAAQ;EAC7B,aAAa;EACb,SAAS;EACV,CAAC;CAEF,aAAa,MAAM,KAAK;EACtB,aAAa;EACb,SAAS;EACV,CAAC;CAEF,wBAAwB,MAAM,OAAO;EACnC,aAAa;EACb,SAAS,EAAE;EACX,UAAU;EACV,WAAW;EACZ,CAAC;CACH;AAED,MAAa,mBAAmB,EAC9B,MAAM,MAAM,OAAO;CACjB,SAAS,CAAC,IAAI;CACd,aAAa;CACb,SAAS;EAAC;EAAO;EAAW;EAAY;EAAQ;EAAY;EAAQ;CACpE,SAAS;CACV,CAAC,EACH"}
@@ -1,117 +1,83 @@
1
- 'use strict';
2
-
3
- var main = require('../compiler/main.cjs');
4
- var _package = require('../compiler/package.cjs');
1
+ const require_package = require('../compiler/package.cjs');
2
+ const require_main = require('../compiler/main.cjs');
5
3
 
4
+ //#region src/shared/dump.ts
6
5
  function dumpArtifacts(logger, stream, aType) {
7
- const packageInfo = main.getPackageInfo(process.cwd(), logger);
8
- const sources = main.parseSources(logger, packageInfo, "dist", "src", "");
9
- const compiler = main.newCompiler(logger, packageInfo, "dist");
10
- // group output by type:
11
- // - all libs
12
- // - all templates
13
- // - all software
14
- // - all assets
15
- // - all tests
16
- // Libs
17
- if (!aType || aType === "library") {
18
- for (const lib of compiler.allLibs()) {
19
- logger.debug(`Dumping to pl-tester: ${_package.typedArtifactNameToString(lib.fullName)}`);
20
- stream.write(JSON.stringify(lib) + "\n");
21
- }
22
- for (const src of sources) {
23
- if (src.fullName.type === "library") {
24
- logger.debug(`Dumping to pl-tester: ${_package.typedArtifactNameToString(src.fullName)}`);
25
- stream.write(JSON.stringify(src) + "\n");
26
- }
27
- }
28
- }
29
- // Templates
30
- if (!aType || aType === "template") {
31
- for (const tpl of compiler.allTemplates()) {
32
- logger.debug(`Dumping to pl-tester: ${_package.typedArtifactNameToString(tpl.fullName)}`);
33
- stream.write(JSON.stringify(tpl) + "\n");
34
- }
35
- for (const src of sources) {
36
- if (src.fullName.type === "template") {
37
- logger.debug(`Dumping to pl-tester: ${_package.typedArtifactNameToString(src.fullName)} ${src.srcName}`);
38
- stream.write(JSON.stringify(src) + "\n");
39
- }
40
- }
41
- }
42
- // Software
43
- if (!aType || aType === "software") {
44
- for (const sw of compiler.allSoftware()) {
45
- logger.debug(`Dumping to pl-tester: ${_package.typedArtifactNameToString(sw.fullName)}`);
46
- stream.write(JSON.stringify(sw) + "\n");
47
- }
48
- for (const src of sources) {
49
- if (src.fullName.type === "software") {
50
- logger.debug(`Dumping to pl-tester: ${_package.typedArtifactNameToString(src.fullName)}`);
51
- stream.write(JSON.stringify(src) + "\n");
52
- }
53
- }
54
- }
55
- // Assets
56
- if (!aType || aType === "asset") {
57
- for (const asset of compiler.allAssets()) {
58
- logger.debug(`Dumping to pl-tester: ${_package.typedArtifactNameToString(asset.fullName)}`);
59
- stream.write(JSON.stringify(asset) + "\n");
60
- }
61
- for (const src of sources) {
62
- if (src.fullName.type === "asset") {
63
- logger.debug(`Dumping to pl-tester: ${_package.typedArtifactNameToString(src.fullName)}`);
64
- stream.write(JSON.stringify(src) + "\n");
65
- }
66
- }
67
- }
68
- // Tests
69
- if (!aType || aType === "test") {
70
- for (const src of sources) {
71
- if (src.fullName.type === "test") {
72
- logger.debug(`Dumping to pl-tester: ${_package.typedArtifactNameToString(src.fullName)} ${src.srcName}`);
73
- stream.write(JSON.stringify(src) + "\n");
74
- }
75
- }
76
- }
6
+ const packageInfo = require_main.getPackageInfo(process.cwd(), logger);
7
+ const sources = require_main.parseSources(logger, packageInfo, "dist", "src", "");
8
+ const compiler = require_main.newCompiler(logger, packageInfo, "dist");
9
+ if (!aType || aType === "library") {
10
+ for (const lib of compiler.allLibs()) {
11
+ logger.debug(`Dumping to pl-tester: ${require_package.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: ${require_package.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: ${require_package.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: ${require_package.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: ${require_package.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: ${require_package.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: ${require_package.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: ${require_package.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: ${require_package.typedArtifactNameToString(src.fullName)} ${src.srcName}`);
52
+ stream.write(JSON.stringify(src) + "\n");
53
+ }
54
+ }
77
55
  }
78
56
  function dumpSoftware(logger, stream) {
79
- const packageInfo = main.getPackageInfo(process.cwd(), logger);
80
- const compiled = main.compile(logger, packageInfo, "dist");
81
- const hashes = new Set();
82
- const sourceMap = new Map();
83
- for (const tpl of compiled.templates) {
84
- Object.entries(tpl.data.hashToSource).forEach(([hash, src]) => sourceMap.set(hash, src));
85
- getTemplateSoftware(tpl.data.template).forEach((hash) => hashes.add(hash));
86
- }
87
- for (const hash of hashes) {
88
- const src = sourceMap.get(hash);
89
- if (src) {
90
- if (Object.hasOwn(JSON.parse(src), "asset")) {
91
- // Skip assets. They are kept in templates software because of backward compatibility with backend.
92
- continue;
93
- }
94
- stream.write(src);
95
- if (!src.endsWith("\n")) {
96
- stream.write("\n");
97
- }
98
- }
99
- else {
100
- throw new Error(`Source not found for hash: ${hash}`);
101
- }
102
- }
57
+ const compiled = require_main.compile(logger, require_main.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
+ }
103
72
  }
104
73
  function getTemplateSoftware(tpl) {
105
- const hashes = new Set();
106
- for (const sw of Object.values(tpl.software)) {
107
- hashes.add(sw.sourceHash);
108
- }
109
- for (const subTpl of Object.values(tpl.templates)) {
110
- getTemplateSoftware(subTpl).forEach((hash) => hashes.add(hash));
111
- }
112
- 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);
113
78
  }
114
79
 
80
+ //#endregion
115
81
  exports.dumpArtifacts = dumpArtifacts;
116
82
  exports.dumpSoftware = dumpSoftware;
117
- //# sourceMappingURL=dump.cjs.map
83
+ //# sourceMappingURL=dump.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dump.cjs","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":["getPackageInfo","parseSources","newCompiler","typedArtifactNameToString","compile"],"mappings":";;;;;SAMgB,aAAa,CAC3B,MAAsB,EACtB,MAA6B,EAC7B,KAAoB,EAAA;IAEpB,MAAM,WAAW,GAAGA,mBAAc,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC;AAEzD,IAAA,MAAM,OAAO,GAAGC,iBAAY,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;IAEpE,MAAM,QAAQ,GAAGC,gBAAW,CAAC,MAAM,EAAE,WAAW,EAAE,MAA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NameToString","compile"],"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,cAAcA,4BAAe,QAAQ,KAAK,EAAE,OAAO;CAEzD,MAAM,UAAUC,0BAAa,QAAQ,aAAa,QAAQ,OAAO,GAAG;CAEpE,MAAM,WAAWC,yBAAY,QAAQ,aAAa,OAAO;AAWzD,KAAI,CAAC,SAAS,UAAU,WAAW;AACjC,OAAK,MAAM,OAAO,SAAS,SAAS,EAAE;AACpC,UAAO,MAAM,yBAAyBC,0CAA0B,IAAI,SAAS,GAAG;AAChF,UAAO,MAAM,KAAK,UAAU,IAAI,GAAG,KAAK;;AAG1C,OAAK,MAAM,OAAO,QAChB,KAAI,IAAI,SAAS,SAAS,WAAW;AACnC,UAAO,MAAM,yBAAyBA,0CAA0B,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,yBAAyBA,0CAA0B,IAAI,SAAS,GAAG;AAChF,UAAO,MAAM,KAAK,UAAU,IAAI,GAAG,KAAK;;AAG1C,OAAK,MAAM,OAAO,QAChB,KAAI,IAAI,SAAS,SAAS,YAAY;AACpC,UAAO,MACL,yBAAyBA,0CAA0B,IAAI,SAAS,CAAC,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