@abaplint/transpiler-cli 2.10.57 → 2.10.59
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/build/bundle.js +262 -37
- package/package.json +5 -4
package/build/bundle.js
CHANGED
|
@@ -71,6 +71,9 @@ exports.FileOperations = void 0;
|
|
|
71
71
|
const fs = __webpack_require__(/*! fs */ "fs");
|
|
72
72
|
const path = __webpack_require__(/*! path */ "path");
|
|
73
73
|
const glob = __webpack_require__(/*! glob */ "./node_modules/glob/glob.js");
|
|
74
|
+
const pLimit = __webpack_require__(/*! p-limit */ "./node_modules/p-limit/index.js");
|
|
75
|
+
const os = __webpack_require__(/*! node:os */ "node:os");
|
|
76
|
+
const fsPromises = __webpack_require__(/*! node:fs/promises */ "node:fs/promises");
|
|
74
77
|
class FileOperations {
|
|
75
78
|
static deleteFolderRecursive(p) {
|
|
76
79
|
if (fs.existsSync(p) === false) {
|
|
@@ -78,26 +81,46 @@ class FileOperations {
|
|
|
78
81
|
}
|
|
79
82
|
fs.rmSync(p, { recursive: true });
|
|
80
83
|
}
|
|
81
|
-
static
|
|
82
|
-
|
|
84
|
+
static setupPLimit() {
|
|
85
|
+
let concurrency = os.cpus().length;
|
|
86
|
+
if (concurrency > 8) {
|
|
87
|
+
concurrency = 8;
|
|
88
|
+
}
|
|
89
|
+
else if (concurrency < 1) {
|
|
90
|
+
concurrency = 1;
|
|
91
|
+
}
|
|
92
|
+
return pLimit(concurrency);
|
|
93
|
+
}
|
|
94
|
+
static async readAllFiles(filesToRead, outputFolder) {
|
|
95
|
+
const limit = this.setupPLimit();
|
|
96
|
+
const promises = filesToRead.map((filename) => {
|
|
97
|
+
return limit(async () => {
|
|
98
|
+
return {
|
|
99
|
+
filename: path.basename(filename),
|
|
100
|
+
relative: path.relative(outputFolder, path.dirname(filename)),
|
|
101
|
+
contents: await fsPromises.readFile(filename, "utf8"),
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
return Promise.all(promises);
|
|
106
|
+
}
|
|
107
|
+
static async loadFiles(config) {
|
|
83
108
|
const filter = (config.input_filter ?? []).map(pattern => new RegExp(pattern, "i"));
|
|
84
109
|
let skipped = 0;
|
|
85
110
|
let added = 0;
|
|
86
111
|
const folders = Array.isArray(config.input_folder) ? config.input_folder : [config.input_folder];
|
|
112
|
+
const filesToRead = [];
|
|
87
113
|
for (const folder of folders) {
|
|
88
114
|
for (const filename of glob.sync(folder + "/**", { nosort: true, nodir: true })) {
|
|
89
115
|
if (filter.length > 0 && filter.some(a => a.test(filename)) === false) {
|
|
90
116
|
skipped++;
|
|
91
117
|
continue;
|
|
92
118
|
}
|
|
93
|
-
|
|
94
|
-
filename: path.basename(filename),
|
|
95
|
-
relative: path.relative(config.output_folder, path.dirname(filename)),
|
|
96
|
-
contents: fs.readFileSync(filename, "utf8"),
|
|
97
|
-
});
|
|
119
|
+
filesToRead.push(filename);
|
|
98
120
|
added++;
|
|
99
121
|
}
|
|
100
122
|
}
|
|
123
|
+
const files = await this.readAllFiles(filesToRead, config.output_folder);
|
|
101
124
|
console.log(added + " files added from source");
|
|
102
125
|
console.log(skipped + " files skipped in source");
|
|
103
126
|
return files;
|
|
@@ -3291,6 +3314,8 @@ class Compare extends combi_1.Expression {
|
|
|
3291
3314
|
const inn = (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), "IN", (0, combi_1.altPrio)(_1.Source, list));
|
|
3292
3315
|
const sopt = (0, combi_1.seq)("IS", (0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)("SUPPLIED", "BOUND", (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("INSTANCE OF", _1.ClassName), version_1.Version.OpenABAP), "REQUESTED", "INITIAL"));
|
|
3293
3316
|
const between = (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), "BETWEEN", _1.Source, "AND", _1.Source);
|
|
3317
|
+
// https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abennews-740_sp08-expressions.htm
|
|
3318
|
+
// but also seems to work in v740sp05, blah
|
|
3294
3319
|
const predicate = (0, combi_1.ver)(version_1.Version.v740sp08, _1.MethodCallChain);
|
|
3295
3320
|
const rett = (0, combi_1.seq)(_1.Source, (0, combi_1.altPrio)((0, combi_1.seq)(_1.CompareOperator, _1.Source), inn, between, sopt));
|
|
3296
3321
|
const fsassign = (0, combi_1.seq)(_1.SourceFieldSymbolChain, "IS", (0, combi_1.optPrio)("NOT"), "ASSIGNED");
|
|
@@ -6842,10 +6867,11 @@ exports.SQLAggregation = SQLAggregation;
|
|
|
6842
6867
|
|
|
6843
6868
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6844
6869
|
exports.SQLAliasField = void 0;
|
|
6870
|
+
const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
6845
6871
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
6846
6872
|
class SQLAliasField extends combi_1.Expression {
|
|
6847
6873
|
getRunnable() {
|
|
6848
|
-
return (0, combi_1.regex)(/^(\/\w+\/)?\w+~(\/\w+\/)?\w+$/);
|
|
6874
|
+
return (0, combi_1.seq)((0, combi_1.regex)(/^(\/\w+\/)?\w+~(\/\w+\/)?\w+$/), (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.regex)(/^\w+$/))));
|
|
6849
6875
|
}
|
|
6850
6876
|
}
|
|
6851
6877
|
exports.SQLAliasField = SQLAliasField;
|
|
@@ -7703,7 +7729,7 @@ class SQLSource extends combi_1.Expression {
|
|
|
7703
7729
|
getRunnable() {
|
|
7704
7730
|
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), _1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
7705
7731
|
const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(_1.SimpleSource3, paren)));
|
|
7706
|
-
return (0, combi_1.
|
|
7732
|
+
return (0, combi_1.altPrio)(_1.SQLAliasField, _1.SimpleSource3, at);
|
|
7707
7733
|
}
|
|
7708
7734
|
}
|
|
7709
7735
|
exports.SQLSource = SQLSource;
|
|
@@ -18245,9 +18271,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
18245
18271
|
exports.DynproLoop = void 0;
|
|
18246
18272
|
const Statements = __webpack_require__(/*! ../../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
18247
18273
|
const _combi_1 = __webpack_require__(/*! ./_combi */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/_combi.js");
|
|
18274
|
+
const chain_1 = __webpack_require__(/*! ./chain */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/chain.js");
|
|
18248
18275
|
class DynproLoop {
|
|
18249
18276
|
getMatcher() {
|
|
18250
|
-
return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.DynproLoop), (0, _combi_1.star)((0, _combi_1.sta)(Statements.Module)), (0, _combi_1.sta)(Statements.EndLoop));
|
|
18277
|
+
return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.DynproLoop), (0, _combi_1.star)((0, _combi_1.alt)((0, _combi_1.sta)(Statements.Module), (0, _combi_1.sub)(chain_1.Chain))), (0, _combi_1.sta)(Statements.EndLoop));
|
|
18251
18278
|
}
|
|
18252
18279
|
}
|
|
18253
18280
|
exports.DynproLoop = DynproLoop;
|
|
@@ -18760,9 +18787,10 @@ const Statements = __webpack_require__(/*! ../../2_statements/statements */ "./n
|
|
|
18760
18787
|
const _combi_1 = __webpack_require__(/*! ./_combi */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/_combi.js");
|
|
18761
18788
|
const chain_1 = __webpack_require__(/*! ./chain */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/chain.js");
|
|
18762
18789
|
const loop_1 = __webpack_require__(/*! ./loop */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/loop.js");
|
|
18790
|
+
const dynpro_loop_1 = __webpack_require__(/*! ./dynpro_loop */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/dynpro_loop.js");
|
|
18763
18791
|
class ProcessAfterInput {
|
|
18764
18792
|
getMatcher() {
|
|
18765
|
-
const pai = (0, _combi_1.star)((0, _combi_1.alt)((0, _combi_1.sta)(Statements.Module), (0, _combi_1.sta)(Statements.Field), (0, _combi_1.sta)(Statements.CallSubscreen), (0, _combi_1.sub)(chain_1.Chain), (0, _combi_1.sub)(loop_1.Loop)));
|
|
18793
|
+
const pai = (0, _combi_1.star)((0, _combi_1.alt)((0, _combi_1.sta)(Statements.Module), (0, _combi_1.sta)(Statements.Field), (0, _combi_1.sta)(Statements.CallSubscreen), (0, _combi_1.sub)(chain_1.Chain), (0, _combi_1.sub)(dynpro_loop_1.DynproLoop), (0, _combi_1.sub)(loop_1.Loop)));
|
|
18766
18794
|
return (0, _combi_1.seq)((0, _combi_1.sta)(Statements.ProcessAfterInput), pai);
|
|
18767
18795
|
}
|
|
18768
18796
|
}
|
|
@@ -22069,6 +22097,7 @@ exports.TypeUtils = void 0;
|
|
|
22069
22097
|
const types_1 = __webpack_require__(/*! ../types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
|
|
22070
22098
|
const basic_1 = __webpack_require__(/*! ../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
22071
22099
|
const cgeneric_type_1 = __webpack_require__(/*! ../types/basic/cgeneric_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js");
|
|
22100
|
+
const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
22072
22101
|
// todo: refactor to static? for performance
|
|
22073
22102
|
class TypeUtils {
|
|
22074
22103
|
constructor(scope) {
|
|
@@ -22287,8 +22316,22 @@ class TypeUtils {
|
|
|
22287
22316
|
}
|
|
22288
22317
|
return false;
|
|
22289
22318
|
}
|
|
22290
|
-
|
|
22319
|
+
isCalculated(node) {
|
|
22320
|
+
/*
|
|
22321
|
+
if (node.getChildren().length === 1
|
|
22322
|
+
&& node.get() instanceof Expressions.Source
|
|
22323
|
+
&& node.getFirstChild()?.get() instanceof Expressions.MethodCallChain) {
|
|
22324
|
+
return false;
|
|
22325
|
+
}
|
|
22326
|
+
*/
|
|
22327
|
+
const calculated = node.findFirstExpression(Expressions.MethodCallChain) !== undefined
|
|
22328
|
+
|| node.findFirstExpression(Expressions.StringTemplate) !== undefined
|
|
22329
|
+
|| node.findFirstExpression(Expressions.ArithOperator) !== undefined;
|
|
22330
|
+
return calculated;
|
|
22331
|
+
}
|
|
22332
|
+
isAssignableStrict(source, target, node) {
|
|
22291
22333
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
22334
|
+
const calculated = node ? this.isCalculated(node) : false;
|
|
22292
22335
|
/*
|
|
22293
22336
|
console.dir(source);
|
|
22294
22337
|
console.dir(target);
|
|
@@ -22340,6 +22383,13 @@ class TypeUtils {
|
|
|
22340
22383
|
else if (source instanceof basic_1.StringType) {
|
|
22341
22384
|
if (target instanceof basic_1.StructureType && this.structureContainsString(target)) {
|
|
22342
22385
|
return false;
|
|
22386
|
+
/*
|
|
22387
|
+
} else if (target instanceof CharacterType) {
|
|
22388
|
+
if (source.getAbstractTypeData()?.derivedFromConstant === true) {
|
|
22389
|
+
return true;
|
|
22390
|
+
}
|
|
22391
|
+
return false;
|
|
22392
|
+
*/
|
|
22343
22393
|
}
|
|
22344
22394
|
else if (target instanceof basic_1.IntegerType) {
|
|
22345
22395
|
if (((_f = source.getAbstractTypeData()) === null || _f === void 0 ? void 0 : _f.derivedFromConstant) === true) {
|
|
@@ -25568,15 +25618,12 @@ class MethodCallParam {
|
|
|
25568
25618
|
if (child.get() instanceof Expressions.Source) {
|
|
25569
25619
|
sourceType = new source_1.Source().runSyntax(child, input, targetType);
|
|
25570
25620
|
}
|
|
25571
|
-
const calculated = child.findFirstExpression(Expressions.MethodCallChain) !== undefined
|
|
25572
|
-
|| child.findFirstExpression(Expressions.StringTemplate) !== undefined
|
|
25573
|
-
|| child.findFirstExpression(Expressions.ArithOperator) !== undefined;
|
|
25574
25621
|
if (sourceType === undefined) {
|
|
25575
25622
|
const message = "No source type determined, method source";
|
|
25576
25623
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
25577
25624
|
return;
|
|
25578
25625
|
}
|
|
25579
|
-
else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(sourceType, targetType,
|
|
25626
|
+
else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(sourceType, targetType, child) === false) {
|
|
25580
25627
|
const message = "Method parameter type not compatible";
|
|
25581
25628
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
25582
25629
|
return;
|
|
@@ -25867,15 +25914,12 @@ class MethodParameters {
|
|
|
25867
25914
|
}
|
|
25868
25915
|
for (const item of items) {
|
|
25869
25916
|
const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);
|
|
25870
|
-
const calculated = item.source.findFirstExpression(Expressions.MethodCallChain) !== undefined
|
|
25871
|
-
|| item.source.findFirstExpression(Expressions.StringTemplate) !== undefined
|
|
25872
|
-
|| item.source.findFirstExpression(Expressions.ArithOperator) !== undefined;
|
|
25873
25917
|
if (parameter === undefined) {
|
|
25874
25918
|
const message = "Method importing parameter \"" + item.name + "\" does not exist";
|
|
25875
25919
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
25876
25920
|
continue;
|
|
25877
25921
|
}
|
|
25878
|
-
else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(item.sourceType, parameter.getType(),
|
|
25922
|
+
else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(item.sourceType, parameter.getType(), item.source) === false) {
|
|
25879
25923
|
const message = "Method parameter type not compatible, " + item.name;
|
|
25880
25924
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
25881
25925
|
return;
|
|
@@ -29787,16 +29831,13 @@ class CreateObject {
|
|
|
29787
29831
|
}
|
|
29788
29832
|
const source = p.findDirectExpression(Expressions.Source);
|
|
29789
29833
|
const sourceType = new source_1.Source().runSyntax(source, input);
|
|
29790
|
-
const calculated = (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.MethodCallChain)) !== undefined
|
|
29791
|
-
|| (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.StringTemplate)) !== undefined
|
|
29792
|
-
|| (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.ArithOperator)) !== undefined;
|
|
29793
29834
|
const found = allImporting === null || allImporting === void 0 ? void 0 : allImporting.find(p => p.getName().toUpperCase() === name);
|
|
29794
29835
|
if (found === undefined) {
|
|
29795
29836
|
const message = `constructor parameter "${name}" does not exist`;
|
|
29796
29837
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
29797
29838
|
return;
|
|
29798
29839
|
}
|
|
29799
|
-
else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(sourceType, found.getType(),
|
|
29840
|
+
else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(sourceType, found.getType(), source) === false) {
|
|
29800
29841
|
const message = `constructor parameter "${name}" type not compatible`;
|
|
29801
29842
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
29802
29843
|
return;
|
|
@@ -53098,7 +53139,7 @@ class Registry {
|
|
|
53098
53139
|
}
|
|
53099
53140
|
static abaplintVersion() {
|
|
53100
53141
|
// magic, see build script "version.sh"
|
|
53101
|
-
return "2.113.
|
|
53142
|
+
return "2.113.125";
|
|
53102
53143
|
}
|
|
53103
53144
|
getDDICReferences() {
|
|
53104
53145
|
return this.ddicReferences;
|
|
@@ -61840,6 +61881,7 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-re
|
|
|
61840
61881
|
else if (this.conf.allowCheck === false && get instanceof Statements.Check && stack.length === 0) {
|
|
61841
61882
|
const message = "CHECK is not allowed outside of loops";
|
|
61842
61883
|
let tokensString = statement.concatTokens();
|
|
61884
|
+
tokensString = tokensString.replace(/^check /i, "CHECK ");
|
|
61843
61885
|
tokensString = tokensString.split("CHECK")[1].trim();
|
|
61844
61886
|
const replacement = "IF NOT " + tokensString + "\n RETURN.\nENDIF.";
|
|
61845
61887
|
const fix = edit_helper_1.EditHelper.replaceRange(file, statement.getFirstToken().getStart(), statement.getLastToken().getEnd(), replacement);
|
|
@@ -75368,8 +75410,9 @@ ENDINTERFACE.`,
|
|
|
75368
75410
|
var _a;
|
|
75369
75411
|
const issues = [];
|
|
75370
75412
|
for (const s of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.MethodDef)) || []) {
|
|
75371
|
-
|
|
75372
|
-
|
|
75413
|
+
const expr = s.findDirectExpression(Expressions.MethodDefExceptions);
|
|
75414
|
+
if (expr) {
|
|
75415
|
+
issues.push(issue_1.Issue.atToken(file, expr.getFirstToken(), this.getMessage(), this.getMetadata().key));
|
|
75373
75416
|
}
|
|
75374
75417
|
}
|
|
75375
75418
|
return issues;
|
|
@@ -76769,14 +76812,6 @@ class Chunk {
|
|
|
76769
76812
|
this.appendString(str);
|
|
76770
76813
|
}
|
|
76771
76814
|
}
|
|
76772
|
-
/*
|
|
76773
|
-
public copy(): Chunk {
|
|
76774
|
-
const ret = new Chunk();
|
|
76775
|
-
ret.raw = this.raw;
|
|
76776
|
-
ret.mappings = [...this.mappings];
|
|
76777
|
-
return ret;
|
|
76778
|
-
}
|
|
76779
|
-
*/
|
|
76780
76815
|
join(chunks, str = ", ") {
|
|
76781
76816
|
for (let i = 0; i < chunks.length; i++) {
|
|
76782
76817
|
this.appendChunk(chunks[i]);
|
|
@@ -82398,8 +82433,16 @@ class ClearTranspiler {
|
|
|
82398
82433
|
transpile(node, traversal) {
|
|
82399
82434
|
const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Target));
|
|
82400
82435
|
const ret = new chunk_1.Chunk();
|
|
82436
|
+
/*
|
|
82401
82437
|
ret.appendChunk(target);
|
|
82402
|
-
ret.append(".clear();", node.getLastToken(), traversal);
|
|
82438
|
+
ret.append(".clear();", node.getLastToken().getEnd(), traversal);
|
|
82439
|
+
*/
|
|
82440
|
+
ret.append(target.getCode() + ".clear();", node.getLastToken().getEnd(), traversal);
|
|
82441
|
+
// ret.append(target.getCode() + ".clear();", node, traversal);
|
|
82442
|
+
/*
|
|
82443
|
+
ret.append(target.getCode(), node.getFirstToken().getStart(), traversal);
|
|
82444
|
+
ret.append(".clear();", node.getLastToken().getEnd(), traversal);
|
|
82445
|
+
*/
|
|
82403
82446
|
return ret;
|
|
82404
82447
|
}
|
|
82405
82448
|
}
|
|
@@ -94650,6 +94693,88 @@ function onceStrict (fn) {
|
|
|
94650
94693
|
}
|
|
94651
94694
|
|
|
94652
94695
|
|
|
94696
|
+
/***/ }),
|
|
94697
|
+
|
|
94698
|
+
/***/ "./node_modules/p-limit/index.js":
|
|
94699
|
+
/*!***************************************!*\
|
|
94700
|
+
!*** ./node_modules/p-limit/index.js ***!
|
|
94701
|
+
\***************************************/
|
|
94702
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
94703
|
+
|
|
94704
|
+
"use strict";
|
|
94705
|
+
|
|
94706
|
+
const Queue = __webpack_require__(/*! yocto-queue */ "./node_modules/yocto-queue/index.js");
|
|
94707
|
+
|
|
94708
|
+
const pLimit = concurrency => {
|
|
94709
|
+
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
94710
|
+
throw new TypeError('Expected `concurrency` to be a number from 1 and up');
|
|
94711
|
+
}
|
|
94712
|
+
|
|
94713
|
+
const queue = new Queue();
|
|
94714
|
+
let activeCount = 0;
|
|
94715
|
+
|
|
94716
|
+
const next = () => {
|
|
94717
|
+
activeCount--;
|
|
94718
|
+
|
|
94719
|
+
if (queue.size > 0) {
|
|
94720
|
+
queue.dequeue()();
|
|
94721
|
+
}
|
|
94722
|
+
};
|
|
94723
|
+
|
|
94724
|
+
const run = async (fn, resolve, ...args) => {
|
|
94725
|
+
activeCount++;
|
|
94726
|
+
|
|
94727
|
+
const result = (async () => fn(...args))();
|
|
94728
|
+
|
|
94729
|
+
resolve(result);
|
|
94730
|
+
|
|
94731
|
+
try {
|
|
94732
|
+
await result;
|
|
94733
|
+
} catch {}
|
|
94734
|
+
|
|
94735
|
+
next();
|
|
94736
|
+
};
|
|
94737
|
+
|
|
94738
|
+
const enqueue = (fn, resolve, ...args) => {
|
|
94739
|
+
queue.enqueue(run.bind(null, fn, resolve, ...args));
|
|
94740
|
+
|
|
94741
|
+
(async () => {
|
|
94742
|
+
// This function needs to wait until the next microtask before comparing
|
|
94743
|
+
// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
|
|
94744
|
+
// when the run function is dequeued and called. The comparison in the if-statement
|
|
94745
|
+
// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
|
|
94746
|
+
await Promise.resolve();
|
|
94747
|
+
|
|
94748
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
94749
|
+
queue.dequeue()();
|
|
94750
|
+
}
|
|
94751
|
+
})();
|
|
94752
|
+
};
|
|
94753
|
+
|
|
94754
|
+
const generator = (fn, ...args) => new Promise(resolve => {
|
|
94755
|
+
enqueue(fn, resolve, ...args);
|
|
94756
|
+
});
|
|
94757
|
+
|
|
94758
|
+
Object.defineProperties(generator, {
|
|
94759
|
+
activeCount: {
|
|
94760
|
+
get: () => activeCount
|
|
94761
|
+
},
|
|
94762
|
+
pendingCount: {
|
|
94763
|
+
get: () => queue.size
|
|
94764
|
+
},
|
|
94765
|
+
clearQueue: {
|
|
94766
|
+
value: () => {
|
|
94767
|
+
queue.clear();
|
|
94768
|
+
}
|
|
94769
|
+
}
|
|
94770
|
+
});
|
|
94771
|
+
|
|
94772
|
+
return generator;
|
|
94773
|
+
};
|
|
94774
|
+
|
|
94775
|
+
module.exports = pLimit;
|
|
94776
|
+
|
|
94777
|
+
|
|
94653
94778
|
/***/ }),
|
|
94654
94779
|
|
|
94655
94780
|
/***/ "./node_modules/path-is-absolute/index.js":
|
|
@@ -100584,6 +100709,84 @@ function wrappy (fn, cb) {
|
|
|
100584
100709
|
}
|
|
100585
100710
|
|
|
100586
100711
|
|
|
100712
|
+
/***/ }),
|
|
100713
|
+
|
|
100714
|
+
/***/ "./node_modules/yocto-queue/index.js":
|
|
100715
|
+
/*!*******************************************!*\
|
|
100716
|
+
!*** ./node_modules/yocto-queue/index.js ***!
|
|
100717
|
+
\*******************************************/
|
|
100718
|
+
/***/ ((module) => {
|
|
100719
|
+
|
|
100720
|
+
class Node {
|
|
100721
|
+
/// value;
|
|
100722
|
+
/// next;
|
|
100723
|
+
|
|
100724
|
+
constructor(value) {
|
|
100725
|
+
this.value = value;
|
|
100726
|
+
|
|
100727
|
+
// TODO: Remove this when targeting Node.js 12.
|
|
100728
|
+
this.next = undefined;
|
|
100729
|
+
}
|
|
100730
|
+
}
|
|
100731
|
+
|
|
100732
|
+
class Queue {
|
|
100733
|
+
// TODO: Use private class fields when targeting Node.js 12.
|
|
100734
|
+
// #_head;
|
|
100735
|
+
// #_tail;
|
|
100736
|
+
// #_size;
|
|
100737
|
+
|
|
100738
|
+
constructor() {
|
|
100739
|
+
this.clear();
|
|
100740
|
+
}
|
|
100741
|
+
|
|
100742
|
+
enqueue(value) {
|
|
100743
|
+
const node = new Node(value);
|
|
100744
|
+
|
|
100745
|
+
if (this._head) {
|
|
100746
|
+
this._tail.next = node;
|
|
100747
|
+
this._tail = node;
|
|
100748
|
+
} else {
|
|
100749
|
+
this._head = node;
|
|
100750
|
+
this._tail = node;
|
|
100751
|
+
}
|
|
100752
|
+
|
|
100753
|
+
this._size++;
|
|
100754
|
+
}
|
|
100755
|
+
|
|
100756
|
+
dequeue() {
|
|
100757
|
+
const current = this._head;
|
|
100758
|
+
if (!current) {
|
|
100759
|
+
return;
|
|
100760
|
+
}
|
|
100761
|
+
|
|
100762
|
+
this._head = this._head.next;
|
|
100763
|
+
this._size--;
|
|
100764
|
+
return current.value;
|
|
100765
|
+
}
|
|
100766
|
+
|
|
100767
|
+
clear() {
|
|
100768
|
+
this._head = undefined;
|
|
100769
|
+
this._tail = undefined;
|
|
100770
|
+
this._size = 0;
|
|
100771
|
+
}
|
|
100772
|
+
|
|
100773
|
+
get size() {
|
|
100774
|
+
return this._size;
|
|
100775
|
+
}
|
|
100776
|
+
|
|
100777
|
+
* [Symbol.iterator]() {
|
|
100778
|
+
let current = this._head;
|
|
100779
|
+
|
|
100780
|
+
while (current) {
|
|
100781
|
+
yield current.value;
|
|
100782
|
+
current = current.next;
|
|
100783
|
+
}
|
|
100784
|
+
}
|
|
100785
|
+
}
|
|
100786
|
+
|
|
100787
|
+
module.exports = Queue;
|
|
100788
|
+
|
|
100789
|
+
|
|
100587
100790
|
/***/ }),
|
|
100588
100791
|
|
|
100589
100792
|
/***/ "assert":
|
|
@@ -100641,6 +100844,28 @@ module.exports = require("fs");
|
|
|
100641
100844
|
|
|
100642
100845
|
/***/ }),
|
|
100643
100846
|
|
|
100847
|
+
/***/ "node:fs/promises":
|
|
100848
|
+
/*!***********************************!*\
|
|
100849
|
+
!*** external "node:fs/promises" ***!
|
|
100850
|
+
\***********************************/
|
|
100851
|
+
/***/ ((module) => {
|
|
100852
|
+
|
|
100853
|
+
"use strict";
|
|
100854
|
+
module.exports = require("node:fs/promises");
|
|
100855
|
+
|
|
100856
|
+
/***/ }),
|
|
100857
|
+
|
|
100858
|
+
/***/ "node:os":
|
|
100859
|
+
/*!**************************!*\
|
|
100860
|
+
!*** external "node:os" ***!
|
|
100861
|
+
\**************************/
|
|
100862
|
+
/***/ ((module) => {
|
|
100863
|
+
|
|
100864
|
+
"use strict";
|
|
100865
|
+
module.exports = require("node:os");
|
|
100866
|
+
|
|
100867
|
+
/***/ }),
|
|
100868
|
+
|
|
100644
100869
|
/***/ "os":
|
|
100645
100870
|
/*!*********************!*\
|
|
100646
100871
|
!*** external "os" ***!
|
|
@@ -100841,7 +101066,7 @@ async function run() {
|
|
|
100841
101066
|
console.log("Transpiler CLI");
|
|
100842
101067
|
const config = config_1.TranspilerConfig.find(process.argv[2]);
|
|
100843
101068
|
const libFiles = loadLib(config);
|
|
100844
|
-
const files = file_operations_1.FileOperations.loadFiles(config);
|
|
101069
|
+
const files = await file_operations_1.FileOperations.loadFiles(config);
|
|
100845
101070
|
console.log("\nBuilding");
|
|
100846
101071
|
const t = new Transpiler.Transpiler(config.options);
|
|
100847
101072
|
const reg = new abaplint.Registry();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.59",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -27,15 +27,16 @@
|
|
|
27
27
|
"author": "abaplint",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@abaplint/core": "^2.113.
|
|
31
|
-
"@abaplint/transpiler": "^2.10.
|
|
30
|
+
"@abaplint/core": "^2.113.125",
|
|
31
|
+
"@abaplint/transpiler": "^2.10.59",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
|
-
"@types/node": "^22.15.
|
|
33
|
+
"@types/node": "^22.15.29",
|
|
34
34
|
"@types/progress": "^2.0.7",
|
|
35
35
|
"glob": "=7.2.0",
|
|
36
36
|
"progress": "^2.0.3",
|
|
37
37
|
"ts-json-schema-generator": "^2.4.0",
|
|
38
38
|
"typescript": "^5.8.3",
|
|
39
|
+
"p-limit": "^3.1.0",
|
|
39
40
|
"webpack-cli": "^6.0.1",
|
|
40
41
|
"webpack": "^5.99.9"
|
|
41
42
|
}
|