@abaplint/transpiler-cli 2.11.46 → 2.11.48

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 (2) hide show
  1. package/build/bundle.js +126 -31
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -6514,7 +6514,7 @@ class Select extends combi_1.Expression {
6514
6514
  const where = (0, combi_1.seq)("WHERE", _1.SQLCond);
6515
6515
  const offset = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("OFFSET", _1.SQLSource));
6516
6516
  const bypass = (0, combi_1.str)("BYPASSING BUFFER");
6517
- const fields = (0, combi_1.ver)(version_1.Version.v750, _1.SQLFields);
6517
+ const fields = (0, combi_1.ver)(version_1.Version.v750, _1.SQLFields, version_1.Version.OpenABAP);
6518
6518
  // todo, HINTS cannot be anywhere, need an expression dedicated for strict sql
6519
6519
  const perm = (0, combi_1.per)(_1.SQLFrom, into, _1.SQLForAllEntries, where, _1.SQLOrderBy, sql_up_to_1.SQLUpTo, offset, _1.SQLClient, _1.SQLHaving, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection, _1.SQLHints);
6520
6520
  const permSingle = (0, combi_1.per)(_1.SQLFrom, (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList), where, _1.SQLClient, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection, _1.SQLHints);
@@ -53845,7 +53845,7 @@ class Registry {
53845
53845
  }
53846
53846
  static abaplintVersion() {
53847
53847
  // magic, see build script "version.sh"
53848
- return "2.113.184";
53848
+ return "2.113.185";
53849
53849
  }
53850
53850
  getDDICReferences() {
53851
53851
  return this.ddicReferences;
@@ -74863,7 +74863,9 @@ ENDFORM.`,
74863
74863
  continue;
74864
74864
  }
74865
74865
  const prev = statements[i - 1];
74866
- if (prev && prev.get() instanceof Statements.Return) {
74866
+ if (prev
74867
+ && prev.get() instanceof Statements.Return
74868
+ && prev.getChildren().length === 2) {
74867
74869
  if (this.conf.allowEmpty === true && statementCounter === 2) {
74868
74870
  continue;
74869
74871
  }
@@ -74874,6 +74876,7 @@ ENDFORM.`,
74874
74876
  const prevprev = statements[i - 2];
74875
74877
  if (prev && prevprev
74876
74878
  && prevprev.get() instanceof Statements.Return
74879
+ && prevprev.getChildren().length === 2
74877
74880
  && prev.get() instanceof Statements.EndIf) {
74878
74881
  const fix = edit_helper_1.EditHelper.deleteStatement(file, prevprev);
74879
74882
  issues.push(issue_1.Issue.atStatement(file, prevprev, message, this.getMetadata().key, this.getConfig().severity, fix));
@@ -77744,6 +77747,7 @@ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abap
77744
77747
  const sqlite_database_schema_1 = __webpack_require__(/*! ./schema_generation/sqlite_database_schema */ "./node_modules/@abaplint/transpiler/build/src/db/schema_generation/sqlite_database_schema.js");
77745
77748
  const pg_database_schema_1 = __webpack_require__(/*! ./schema_generation/pg_database_schema */ "./node_modules/@abaplint/transpiler/build/src/db/schema_generation/pg_database_schema.js");
77746
77749
  const snowflake_database_schema_1 = __webpack_require__(/*! ./schema_generation/snowflake_database_schema */ "./node_modules/@abaplint/transpiler/build/src/db/schema_generation/snowflake_database_schema.js");
77750
+ const populate_tables_1 = __webpack_require__(/*! ./populate_tables */ "./node_modules/@abaplint/transpiler/build/src/db/populate_tables.js");
77747
77751
  /////////////////////////
77748
77752
  // NOTES
77749
77753
  /////////////////////////
@@ -77787,23 +77791,64 @@ class DatabaseSetup {
77787
77791
  buildInsert(options) {
77788
77792
  // note: avoid hitting maximum statement size by splitting into multiple statements
77789
77793
  const insert = [];
77794
+ const populateTables = new populate_tables_1.PopulateTables(this.reg);
77790
77795
  // INSERT data
77791
77796
  for (const obj of this.reg.getObjects()) {
77792
77797
  if (obj instanceof abaplint.Objects.MessageClass) {
77793
- insert.push(...this.insertT100(obj));
77798
+ insert.push(...populateTables.insertT100(obj));
77794
77799
  }
77795
77800
  else if (obj instanceof abaplint.Objects.Class
77796
77801
  || obj instanceof abaplint.Objects.Interface) {
77797
- if (options?.skipReposrc !== true) {
77798
- insert.push(this.insertREPOSRC(obj));
77802
+ if (options?.populateTables?.reposrc !== false) {
77803
+ insert.push(populateTables.insertREPOSRC(obj));
77804
+ }
77805
+ if (options?.populateTables?.seosubco !== false) {
77806
+ insert.push(...populateTables.insertSEOSUBCO(obj));
77807
+ }
77808
+ if (options?.populateTables?.seosubcodf !== false) {
77809
+ insert.push(...populateTables.insertSEOSUBCODF(obj));
77810
+ }
77811
+ if (options?.populateTables?.seosubcotx !== false) {
77812
+ insert.push(...populateTables.insertSEOSUBCOTX(obj));
77799
77813
  }
77800
77814
  }
77801
77815
  }
77802
- insert.push(this.insertT000());
77816
+ insert.push(populateTables.insertT000());
77803
77817
  return insert;
77804
77818
  }
77819
+ }
77820
+ exports.DatabaseSetup = DatabaseSetup;
77821
+ //# sourceMappingURL=index.js.map
77822
+
77823
+ /***/ }),
77824
+
77825
+ /***/ "./node_modules/@abaplint/transpiler/build/src/db/populate_tables.js":
77826
+ /*!***************************************************************************!*\
77827
+ !*** ./node_modules/@abaplint/transpiler/build/src/db/populate_tables.js ***!
77828
+ \***************************************************************************/
77829
+ /***/ ((__unused_webpack_module, exports) => {
77830
+
77831
+ "use strict";
77832
+
77833
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
77834
+ exports.PopulateTables = void 0;
77835
+ class PopulateTables {
77836
+ hasREPOSRC;
77837
+ hasSEOSUBCO;
77838
+ hasSEOSUBCODF;
77839
+ hasSEOSUBCOTX;
77840
+ hasT000;
77841
+ hasT100;
77842
+ constructor(reg) {
77843
+ this.hasREPOSRC = reg.getObject("TABL", "REPOSRC") !== undefined;
77844
+ this.hasSEOSUBCO = reg.getObject("TABL", "SEOSUBCO") !== undefined;
77845
+ this.hasSEOSUBCODF = reg.getObject("TABL", "SEOSUBCODF") !== undefined;
77846
+ this.hasSEOSUBCOTX = reg.getObject("TABL", "SEOSUBCOTX") !== undefined;
77847
+ this.hasT000 = reg.getObject("TABL", "T000") !== undefined;
77848
+ this.hasT100 = reg.getObject("TABL", "T100") !== undefined;
77849
+ }
77805
77850
  insertREPOSRC(obj) {
77806
- if (this.reg.getObject("TABL", "REPOSRC") === undefined) {
77851
+ if (!this.hasREPOSRC) {
77807
77852
  return "";
77808
77853
  }
77809
77854
  const name = obj.getName().toUpperCase();
@@ -77813,24 +77858,9 @@ class DatabaseSetup {
77813
77858
  }
77814
77859
  return `INSERT INTO reposrc ('PROGNAME', 'DATA') VALUES ('${name.padEnd(40, " ")}', '${this.escape(raw)}');`;
77815
77860
  }
77816
- insertT000() {
77817
- const tabl = this.reg.getObject("TABL", "T000");
77818
- if (tabl === undefined) {
77819
- return "";
77820
- }
77821
- const type = tabl.parseType(this.reg);
77822
- if (type instanceof abaplint.BasicTypes.StructureType && type.getComponents().length >= 3) {
77823
- // todo, this should take the client number from the settings
77824
- return `INSERT INTO t000 ('mandt', 'cccategory', 'ccnocliind') VALUES ('123', '', '');`;
77825
- }
77826
- else {
77827
- return "";
77828
- }
77829
- }
77830
77861
  insertT100(msag) {
77831
77862
  // ignore if T100 is unknown
77832
- const obj = this.reg.getObject("TABL", "T100");
77833
- if (obj === undefined) {
77863
+ if (!this.hasT100) {
77834
77864
  return [];
77835
77865
  }
77836
77866
  const ret = [];
@@ -77839,6 +77869,67 @@ class DatabaseSetup {
77839
77869
  }
77840
77870
  return ret;
77841
77871
  }
77872
+ insertSEOSUBCO(obj) {
77873
+ const def = obj.getDefinition();
77874
+ const ret = [];
77875
+ if (def === undefined || !this.hasSEOSUBCO) {
77876
+ return [];
77877
+ }
77878
+ for (const method of def.getMethodDefinitions().getAll()) {
77879
+ for (const parameter of method.getParameters().getAll()) {
77880
+ ret.push(`INSERT INTO "seosubco" ("clsname", "cmpname", "sconame") VALUES ('${obj.getName()}', '${method.getName()}', '${parameter.getName()}');`);
77881
+ }
77882
+ }
77883
+ return ret;
77884
+ }
77885
+ insertSEOSUBCODF(obj) {
77886
+ const def = obj.getDefinition();
77887
+ const ret = [];
77888
+ if (def === undefined || !this.hasSEOSUBCODF) {
77889
+ return [];
77890
+ }
77891
+ for (const method of def.getMethodDefinitions().getAll()) {
77892
+ let editorder = 0;
77893
+ const optionalParameters = method.getParameters().getOptional();
77894
+ for (const parameter of method.getParameters().getAll()) {
77895
+ editorder++;
77896
+ let pardecltyp = "";
77897
+ if (parameter.getMeta().includes("importing" /* abaplint.IdentifierMeta.MethodImporting */)) {
77898
+ pardecltyp = "0";
77899
+ }
77900
+ else if (parameter.getMeta().includes("changing" /* abaplint.IdentifierMeta.MethodChanging */)) {
77901
+ pardecltyp = "2";
77902
+ }
77903
+ else if (parameter.getMeta().includes("returning" /* abaplint.IdentifierMeta.MethodReturning */)) {
77904
+ pardecltyp = "3";
77905
+ }
77906
+ else if (parameter.getMeta().includes("exporting" /* abaplint.IdentifierMeta.MethodExporting */)) {
77907
+ pardecltyp = "1";
77908
+ }
77909
+ const paroptionl = optionalParameters.includes(parameter.getName()) ? "X" : " ";
77910
+ ret.push(`INSERT INTO "seosubcodf" ("clsname", "cmpname", "sconame", "version", "editorder", "pardecltyp", "type", "paroptionl") VALUES ('${obj.getName()}', '${method.getName()}', '${parameter.getName()}', 'A', ${editorder}, '${pardecltyp}', '${parameter.getType().getQualifiedName()}', '${paroptionl}');`);
77911
+ }
77912
+ }
77913
+ return ret;
77914
+ }
77915
+ insertSEOSUBCOTX(obj) {
77916
+ const def = obj.getDefinition();
77917
+ const ret = [];
77918
+ if (def === undefined || !this.hasSEOSUBCOTX) {
77919
+ return [];
77920
+ }
77921
+ for (const method of def.getMethodDefinitions().getAll()) {
77922
+ ret.push(`INSERT INTO "seosubcotx" ("clsname", "cmpname", "langu", "descript") VALUES ('${obj.getName()}', '${method.getName()}', 'E', 'todo');`);
77923
+ }
77924
+ return ret;
77925
+ }
77926
+ insertT000() {
77927
+ if (!this.hasT000) {
77928
+ return "";
77929
+ }
77930
+ // todo, this should take the client number from the settings
77931
+ return `INSERT INTO t000 ('mandt', 'cccategory', 'ccnocliind') VALUES ('123', '', '');`;
77932
+ }
77842
77933
  escape(value) {
77843
77934
  let ret = value.replace(/\'/g, "''");
77844
77935
  // statements are inside a javascript string stemplate
@@ -77848,8 +77939,8 @@ class DatabaseSetup {
77848
77939
  return ret;
77849
77940
  }
77850
77941
  }
77851
- exports.DatabaseSetup = DatabaseSetup;
77852
- //# sourceMappingURL=index.js.map
77942
+ exports.PopulateTables = PopulateTables;
77943
+ //# sourceMappingURL=populate_tables.js.map
77853
77944
 
77854
77945
  /***/ }),
77855
77946
 
@@ -103024,12 +103115,8 @@ function writeObjects(outputFiles, config, outputFolder, files) {
103024
103115
  fs.writeFileSync(outputFolder + path.sep + output.filename, contents);
103025
103116
  }
103026
103117
  }
103027
- async function run() {
103028
- console.log("Transpiler CLI");
103029
- const config = config_1.TranspilerConfig.find(process.argv[2]);
103118
+ async function build(config, files) {
103030
103119
  const libFiles = await loadLib(config);
103031
- const files = await file_operations_1.FileOperations.loadFiles(config);
103032
- console.log("\nBuilding");
103033
103120
  const t = new Transpiler.Transpiler(config.options);
103034
103121
  const reg = new abaplint.Registry();
103035
103122
  for (const f of files) {
@@ -103040,6 +103127,14 @@ async function run() {
103040
103127
  }
103041
103128
  reg.parse();
103042
103129
  const output = await t.run(reg, new Progress());
103130
+ return output;
103131
+ }
103132
+ async function run() {
103133
+ console.log("Transpiler CLI");
103134
+ const config = config_1.TranspilerConfig.find(process.argv[2]);
103135
+ const files = await file_operations_1.FileOperations.loadFiles(config);
103136
+ console.log("\nBuilding");
103137
+ const output = await build(config, files);
103043
103138
  console.log("\nOutput");
103044
103139
  const outputFolder = config.output_folder;
103045
103140
  if (!fs.existsSync(outputFolder)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.11.46",
3
+ "version": "2.11.48",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -27,8 +27,8 @@
27
27
  "author": "abaplint",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@abaplint/core": "^2.113.184",
31
- "@abaplint/transpiler": "^2.11.46",
30
+ "@abaplint/core": "^2.113.185",
31
+ "@abaplint/transpiler": "^2.11.48",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.3.0",
34
34
  "@types/progress": "^2.0.7",