@platforma-sdk/tengo-builder 2.1.14 → 2.1.16
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/bin/run.js +6 -0
- package/dist/commands/build.cjs +172 -0
- package/dist/commands/build.cjs.map +1 -0
- package/dist/commands/build.d.ts +4 -5
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +149 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/check.cjs +39 -0
- package/dist/commands/check.cjs.map +1 -0
- package/dist/commands/check.d.ts +1 -2
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +37 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/dump/all.cjs +20 -0
- package/dist/commands/dump/all.cjs.map +1 -0
- package/dist/commands/dump/all.js +18 -0
- package/dist/commands/dump/all.js.map +1 -0
- package/dist/commands/dump/assets.cjs +20 -0
- package/dist/commands/dump/assets.cjs.map +1 -0
- package/dist/commands/dump/assets.js +18 -0
- package/dist/commands/dump/assets.js.map +1 -0
- package/dist/commands/dump/libs.cjs +24 -0
- package/dist/commands/dump/libs.cjs.map +1 -0
- package/dist/commands/dump/libs.d.ts +1 -2
- package/dist/commands/dump/libs.d.ts.map +1 -1
- package/dist/commands/dump/libs.js +22 -0
- package/dist/commands/dump/libs.js.map +1 -0
- package/dist/commands/dump/software.cjs +20 -0
- package/dist/commands/dump/software.cjs.map +1 -0
- package/dist/commands/dump/software.js +18 -0
- package/dist/commands/dump/software.js.map +1 -0
- package/dist/commands/dump/templates.cjs +20 -0
- package/dist/commands/dump/templates.cjs.map +1 -0
- package/dist/commands/dump/templates.js +18 -0
- package/dist/commands/dump/templates.js.map +1 -0
- package/dist/commands/dump/tests.cjs +20 -0
- package/dist/commands/dump/tests.cjs.map +1 -0
- package/dist/commands/dump/tests.js +18 -0
- package/dist/commands/dump/tests.js.map +1 -0
- package/dist/commands/test.cjs +36 -0
- package/dist/commands/test.cjs.map +1 -0
- package/dist/commands/test.d.ts +1 -2
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +34 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/compiler/artifactset.cjs +75 -0
- package/dist/compiler/artifactset.cjs.map +1 -0
- package/dist/compiler/artifactset.d.ts +1 -1
- package/dist/compiler/artifactset.js +71 -0
- package/dist/compiler/artifactset.js.map +1 -0
- package/dist/compiler/compiler.cjs +314 -0
- package/dist/compiler/compiler.cjs.map +1 -0
- package/dist/compiler/compiler.d.ts +3 -3
- package/dist/compiler/compiler.js +312 -0
- package/dist/compiler/compiler.js.map +1 -0
- package/dist/compiler/compileroptions.cjs +45 -0
- package/dist/compiler/compileroptions.cjs.map +1 -0
- package/dist/compiler/compileroptions.d.ts +2 -2
- package/dist/compiler/compileroptions.js +41 -0
- package/dist/compiler/compileroptions.js.map +1 -0
- package/dist/compiler/main.cjs +387 -0
- package/dist/compiler/main.cjs.map +1 -0
- package/dist/compiler/main.d.ts +5 -3
- package/dist/compiler/main.js +359 -0
- package/dist/compiler/main.js.map +1 -0
- package/dist/compiler/package.cjs +65 -0
- package/dist/compiler/package.cjs.map +1 -0
- package/dist/compiler/package.js +55 -0
- package/dist/compiler/package.js.map +1 -0
- package/dist/compiler/source.cjs +292 -0
- package/dist/compiler/source.cjs.map +1 -0
- package/dist/compiler/source.d.ts +2 -2
- package/dist/compiler/source.js +285 -0
- package/dist/compiler/source.js.map +1 -0
- package/dist/compiler/template.cjs +48 -0
- package/dist/compiler/template.cjs.map +1 -0
- package/dist/compiler/template.d.ts +2 -2
- package/dist/compiler/template.js +44 -0
- package/dist/compiler/template.js.map +1 -0
- package/dist/compiler/test.artifacts.d.ts +1 -1
- package/dist/compiler/util.cjs +75 -0
- package/dist/compiler/util.cjs.map +1 -0
- package/dist/compiler/util.js +50 -0
- package/dist/compiler/util.js.map +1 -0
- package/dist/index.cjs +28 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.js +23 -41
- package/dist/index.js.map +1 -1
- package/dist/shared/basecmd.cjs +31 -0
- package/dist/shared/basecmd.cjs.map +1 -0
- package/dist/shared/basecmd.d.ts +4 -5
- package/dist/shared/basecmd.d.ts.map +1 -1
- package/dist/shared/basecmd.js +28 -0
- package/dist/shared/basecmd.js.map +1 -0
- package/dist/shared/dump.cjs +117 -0
- package/dist/shared/dump.cjs.map +1 -0
- package/dist/shared/dump.d.ts +1 -1
- package/dist/shared/dump.js +110 -0
- package/dist/shared/dump.js.map +1 -0
- package/dist/shared/proc.cjs +26 -0
- package/dist/shared/proc.cjs.map +1 -0
- package/dist/shared/proc.d.ts +2 -2
- package/dist/shared/proc.js +23 -0
- package/dist/shared/proc.js.map +1 -0
- package/package.json +13 -10
- package/dist/index.mjs +0 -1198
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { getPackageInfo, parseSources, newCompiler } from '../compiler/main.js';
|
|
2
|
+
import { typedArtifactNameToString } from '../compiler/package.js';
|
|
3
|
+
|
|
4
|
+
function dumpAll(logger, stream) {
|
|
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
|
+
for (const lib of compiler.allLibs()) {
|
|
16
|
+
logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(lib.fullName)}`);
|
|
17
|
+
stream.write(JSON.stringify(lib) + '\n');
|
|
18
|
+
}
|
|
19
|
+
for (const src of sources) {
|
|
20
|
+
if (src.fullName.type === 'library') {
|
|
21
|
+
logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);
|
|
22
|
+
stream.write(JSON.stringify(src) + '\n');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// Templates
|
|
26
|
+
for (const tpl of compiler.allTemplates()) {
|
|
27
|
+
logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(tpl.fullName)}`);
|
|
28
|
+
stream.write(JSON.stringify(tpl) + '\n');
|
|
29
|
+
}
|
|
30
|
+
for (const src of sources) {
|
|
31
|
+
if (src.fullName.type === 'template') {
|
|
32
|
+
logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)} ${src.srcName}`);
|
|
33
|
+
stream.write(JSON.stringify(src) + '\n');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Software
|
|
37
|
+
for (const sw of compiler.allSoftware()) {
|
|
38
|
+
logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(sw.fullName)}`);
|
|
39
|
+
stream.write(JSON.stringify(sw) + '\n');
|
|
40
|
+
}
|
|
41
|
+
for (const src of sources) {
|
|
42
|
+
if (src.fullName.type === 'software') {
|
|
43
|
+
logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);
|
|
44
|
+
stream.write(JSON.stringify(src) + '\n');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Assets
|
|
48
|
+
for (const asset of compiler.allAssets()) {
|
|
49
|
+
logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(asset.fullName)}`);
|
|
50
|
+
stream.write(JSON.stringify(asset) + '\n');
|
|
51
|
+
}
|
|
52
|
+
for (const src of sources) {
|
|
53
|
+
if (src.fullName.type === 'asset') {
|
|
54
|
+
logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`);
|
|
55
|
+
stream.write(JSON.stringify(src) + '\n');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Tests
|
|
59
|
+
for (const src of sources) {
|
|
60
|
+
if (src.fullName.type === 'test') {
|
|
61
|
+
logger.debug(`Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)} ${src.srcName}`);
|
|
62
|
+
stream.write(JSON.stringify(src) + '\n');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function dumpLibs(logger, dumpDeps, stream) {
|
|
67
|
+
const packageInfo = getPackageInfo(process.cwd(), logger);
|
|
68
|
+
const sources = parseSources(logger, packageInfo, 'dist', 'src', '');
|
|
69
|
+
if (!dumpDeps) {
|
|
70
|
+
for (const src of sources) {
|
|
71
|
+
if (src.fullName.type === 'library') {
|
|
72
|
+
stream.write(JSON.stringify(src) + '\n');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const compiler = newCompiler(logger, packageInfo, 'dist');
|
|
78
|
+
for (const src of sources) {
|
|
79
|
+
if (src.fullName.type === 'library') {
|
|
80
|
+
compiler.addLib(src);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
for (const lib of compiler.allLibs()) {
|
|
84
|
+
stream.write(JSON.stringify(lib) + '\n');
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function dumpArtifacts(logger, stream, aType) {
|
|
88
|
+
const packageInfo = getPackageInfo(process.cwd(), logger);
|
|
89
|
+
const sources = parseSources(logger, packageInfo, 'dist', 'src', '');
|
|
90
|
+
for (const src of sources) {
|
|
91
|
+
if (src.fullName.type === aType) {
|
|
92
|
+
stream.write(JSON.stringify(src) + '\n');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function dumpTemplates(logger, stream) {
|
|
97
|
+
dumpArtifacts(logger, stream, 'template');
|
|
98
|
+
}
|
|
99
|
+
function dumpSoftware(logger, stream) {
|
|
100
|
+
dumpArtifacts(logger, stream, 'software');
|
|
101
|
+
}
|
|
102
|
+
function dumpAssets(logger, stream) {
|
|
103
|
+
dumpArtifacts(logger, stream, 'asset');
|
|
104
|
+
}
|
|
105
|
+
function dumpTests(logger, stream) {
|
|
106
|
+
dumpArtifacts(logger, stream, 'test');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { dumpAll, dumpAssets, dumpLibs, dumpSoftware, dumpTemplates, dumpTests };
|
|
110
|
+
//# sourceMappingURL=dump.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dump.js","sources":["../../src/shared/dump.ts"],"sourcesContent":["import type winston from 'winston';\nimport { getPackageInfo, newCompiler, parseSources } from '../compiler/main';\nimport type { ArtifactType } from '../compiler/package';\nimport { typedArtifactNameToString } from '../compiler/package';\n\nexport function dumpAll(\n logger: winston.Logger,\n stream: NodeJS.WritableStream,\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 for (const lib of compiler.allLibs()) {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(lib.fullName)}`,\n );\n stream.write(JSON.stringify(lib) + '\\n');\n }\n\n for (const src of sources) {\n if (src.fullName.type === 'library') {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`,\n );\n stream.write(JSON.stringify(src) + '\\n');\n }\n }\n\n // Templates\n\n for (const tpl of compiler.allTemplates()) {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(tpl.fullName)}`,\n );\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)} ${\n src.srcName\n }`,\n );\n stream.write(JSON.stringify(src) + '\\n');\n }\n }\n\n // Software\n\n for (const sw of compiler.allSoftware()) {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(sw.fullName)}`,\n );\n stream.write(JSON.stringify(sw) + '\\n');\n }\n\n for (const src of sources) {\n if (src.fullName.type === 'software') {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`,\n );\n stream.write(JSON.stringify(src) + '\\n');\n }\n }\n\n // Assets\n\n for (const asset of compiler.allAssets()) {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(asset.fullName)}`,\n );\n stream.write(JSON.stringify(asset) + '\\n');\n }\n\n for (const src of sources) {\n if (src.fullName.type === 'asset') {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)}`,\n );\n stream.write(JSON.stringify(src) + '\\n');\n }\n }\n\n // Tests\n\n for (const src of sources) {\n if (src.fullName.type === 'test') {\n logger.debug(\n `Dumping to pl-tester: ${typedArtifactNameToString(src.fullName)} ${\n src.srcName\n }`,\n );\n stream.write(JSON.stringify(src) + '\\n');\n }\n }\n}\n\nexport function dumpLibs(\n logger: winston.Logger,\n dumpDeps: boolean,\n stream: NodeJS.WritableStream,\n): void {\n const packageInfo = getPackageInfo(process.cwd(), logger);\n\n const sources = parseSources(logger, packageInfo, 'dist', 'src', '');\n\n if (!dumpDeps) {\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\nfunction 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 for (const src of sources) {\n if (src.fullName.type === aType) {\n stream.write(JSON.stringify(src) + '\\n');\n }\n }\n}\n\nexport function dumpTemplates(\n logger: winston.Logger,\n stream: NodeJS.WritableStream,\n): void {\n dumpArtifacts(logger, stream, 'template');\n}\n\nexport function dumpSoftware(\n logger: winston.Logger,\n stream: NodeJS.WritableStream,\n): void {\n dumpArtifacts(logger, stream, 'software');\n}\n\nexport function dumpAssets(\n logger: winston.Logger,\n stream: NodeJS.WritableStream,\n): void {\n dumpArtifacts(logger, stream, 'asset');\n}\n\nexport function dumpTests(\n logger: winston.Logger,\n stream: NodeJS.WritableStream,\n): void {\n dumpArtifacts(logger, stream, 'test');\n}\n"],"names":[],"mappings":";;;AAKM,SAAU,OAAO,CACrB,MAAsB,EACtB,MAA6B,EAAA;IAE7B,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;;;;;;;;IAWzD,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE;AACpC,QAAA,MAAM,CAAC,KAAK,CACV,CAAA,sBAAA,EAAyB,yBAAyB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA,CAAE,CACnE;AACD,QAAA,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAC1C;AAEA,IAAA,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;QACzB,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE;AACnC,YAAA,MAAM,CAAC,KAAK,CACV,CAAA,sBAAA,EAAyB,yBAAyB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA,CAAE,CACnE;AACD,YAAA,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QAC1C;IACF;;IAIA,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,YAAY,EAAE,EAAE;AACzC,Q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AAC3C;AAEM,SAAU,UAAU,CACxB,MAAsB,EACtB,MAA6B,EAAA;AAE7B,IAAA,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AACxC;AAEM,SAAU,SAAS,CACvB,MAAsB,EACtB,MAA6B,EAAA;AAE7B,IAAA,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;AACvC;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var node_child_process = require('node:child_process');
|
|
4
|
+
|
|
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;
|
|
12
|
+
}
|
|
13
|
+
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
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.spawnEmbed = spawnEmbed;
|
|
25
|
+
exports.waitFor = waitFor;
|
|
26
|
+
//# sourceMappingURL=proc.cjs.map
|
|
@@ -0,0 +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;;;;;"}
|
package/dist/shared/proc.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChildProcess, ChildProcessByStdio } from 'node:child_process';
|
|
2
|
-
import { Writable } from 'node:stream';
|
|
1
|
+
import type { ChildProcess, ChildProcessByStdio } from 'node:child_process';
|
|
2
|
+
import type { Writable } from 'node:stream';
|
|
3
3
|
export declare function spawnEmbed(cmd: string, ...args: string[]): ChildProcessByStdio<Writable, null, null>;
|
|
4
4
|
export declare function waitFor(p: ChildProcess): Promise<number>;
|
|
5
5
|
//# sourceMappingURL=proc.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
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;
|
|
10
|
+
}
|
|
11
|
+
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
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { spawnEmbed, waitFor };
|
|
23
|
+
//# sourceMappingURL=proc.js.map
|
|
@@ -0,0 +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;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/tengo-builder",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.16",
|
|
4
4
|
"description": "Pl Tengo Template Builder",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"bin": {
|
|
6
7
|
"pl-tengo": "./bin/run.js"
|
|
7
8
|
},
|
|
@@ -15,22 +16,23 @@
|
|
|
15
16
|
"node": ">=20"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
|
-
"@milaboratories/tengo-tester": "^1.6.
|
|
19
|
+
"@milaboratories/tengo-tester": "^1.6.3",
|
|
19
20
|
"@oclif/core": "^4.0.37",
|
|
20
21
|
"canonicalize": "~2.1.0",
|
|
21
22
|
"winston": "^3.17.0",
|
|
22
|
-
"@milaboratories/
|
|
23
|
-
"@milaboratories/
|
|
24
|
-
"@milaboratories/pl-model-backend": "^1.1.
|
|
23
|
+
"@milaboratories/ts-helpers": "1.4.5",
|
|
24
|
+
"@milaboratories/resolve-helper": "1.1.1",
|
|
25
|
+
"@milaboratories/pl-model-backend": "^1.1.4"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"typescript": "~5.6.3",
|
|
28
|
-
"vite": "^6.3.5",
|
|
29
29
|
"vitest": "^2.1.9",
|
|
30
30
|
"@types/node": "~20.16.15",
|
|
31
|
-
"@milaboratories/oclif-index": "1.1.1",
|
|
32
31
|
"@milaboratories/eslint-config": "^1.0.4",
|
|
33
|
-
"@milaboratories/build-configs": "1.0.
|
|
32
|
+
"@milaboratories/build-configs": "1.0.8",
|
|
33
|
+
"@milaboratories/oclif-index": "1.1.1",
|
|
34
|
+
"@milaboratories/ts-builder": "1.0.4",
|
|
35
|
+
"@milaboratories/ts-configs": "1.0.6"
|
|
34
36
|
},
|
|
35
37
|
"oclif": {
|
|
36
38
|
"bin": "pl-tengo",
|
|
@@ -44,8 +46,9 @@
|
|
|
44
46
|
},
|
|
45
47
|
"scripts": {
|
|
46
48
|
"lint": "eslint .",
|
|
47
|
-
"type-check": "
|
|
48
|
-
"build": "oclif-index &&
|
|
49
|
+
"type-check": "ts-builder types --target node",
|
|
50
|
+
"build": "oclif-index && ts-builder build --target node",
|
|
51
|
+
"watch": "ts-builder build --target node --watch",
|
|
49
52
|
"test": "vitest",
|
|
50
53
|
"do-pack": "rm -f *.tgz && pnpm pack && mv *.tgz package.tgz"
|
|
51
54
|
}
|