@abaplint/transpiler-cli 2.11.6 → 2.11.8

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 +17 -21
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -53606,7 +53606,7 @@ class Registry {
53606
53606
  }
53607
53607
  static abaplintVersion() {
53608
53608
  // magic, see build script "version.sh"
53609
- return "2.113.152";
53609
+ return "2.113.153";
53610
53610
  }
53611
53611
  getDDICReferences() {
53612
53612
  return this.ddicReferences;
@@ -77445,9 +77445,9 @@ class Chunk {
77445
77445
  return this;
77446
77446
  }
77447
77447
  getMap(generatedFilename) {
77448
- const generator = new sourceMap.SourceMapGenerator();
77449
- this.mappings.forEach(m => generator.addMapping(m));
77450
- const json = generator.toJSON();
77448
+ const sourceMapGenerator = new sourceMap.SourceMapGenerator();
77449
+ this.mappings.forEach(m => sourceMapGenerator.addMapping(m));
77450
+ const json = sourceMapGenerator.toJSON();
77451
77451
  json.file = generatedFilename;
77452
77452
  json.sourceRoot = "";
77453
77453
  return JSON.stringify(json, null, 2);
@@ -81877,7 +81877,7 @@ exports.Initialization = Initialization;
81877
81877
  Object.defineProperty(exports, "__esModule", ({ value: true }));
81878
81878
  exports.DEFAULT_KEYWORDS = void 0;
81879
81879
  // https://www.w3schools.com/js/js_reserved.asp
81880
- exports.DEFAULT_KEYWORDS = [
81880
+ exports.DEFAULT_KEYWORDS = new Set([
81881
81881
  "abstract", "arguments", "await",
81882
81882
  "break", "byte", "catch",
81883
81883
  // "char",
@@ -81896,7 +81896,7 @@ exports.DEFAULT_KEYWORDS = [
81896
81896
  "try", "typeof", "var", "void",
81897
81897
  "delete",
81898
81898
  "volatile", "while", "yield"
81899
- ];
81899
+ ]);
81900
81900
  // "with"
81901
81901
  //# sourceMappingURL=keywords.js.map
81902
81902
 
@@ -89544,8 +89544,7 @@ class Traversal {
89544
89544
  return name?.replace(/\//g, "$");
89545
89545
  }
89546
89546
  static prefixVariable(name) {
89547
- // TODO: performace, make this a hash lookup?,
89548
- if (keywords_1.DEFAULT_KEYWORDS.some(k => k === name)) {
89547
+ if (name && keywords_1.DEFAULT_KEYWORDS.has(name)) {
89549
89548
  return "$" + name;
89550
89549
  }
89551
89550
  return name + "";
@@ -101690,21 +101689,18 @@ async function loadLib(config) {
101690
101689
  }
101691
101690
  return files;
101692
101691
  }
101693
- function writeObjects(objects, config, outputFolder, files) {
101692
+ function writeObjects(outputFiles, config, outputFolder, files) {
101694
101693
  const writeSourceMaps = config.write_source_map || false;
101695
- for (const o of objects) {
101696
- let contents = o.chunk.getCode();
101694
+ for (const output of outputFiles) {
101695
+ let contents = output.chunk.getCode();
101697
101696
  if (writeSourceMaps === true
101698
- && o.object.type.toUpperCase() !== "TABL"
101699
- && o.object.type.toUpperCase() !== "DTEL"
101700
- && o.object.type.toUpperCase() !== "W3MI"
101701
- && o.object.type.toUpperCase() !== "SMIM"
101702
- && o.object.type.toUpperCase() !== "ENQU"
101703
- && o.object.type.toUpperCase() !== "TTYP") {
101704
- const name = o.filename + ".map";
101697
+ && output.object.type.toUpperCase() === "PROG"
101698
+ && output.object.type.toUpperCase() === "FUGR"
101699
+ && output.object.type.toUpperCase() === "CLAS") {
101700
+ const name = output.filename + ".map";
101705
101701
  // SourceMappingUrl needs to be percent-encoded, ref https://github.com/microsoft/TypeScript/issues/40951
101706
101702
  contents = contents + `\n//# sourceMappingURL=` + name.replace(/#/g, "%23");
101707
- let map = o.chunk.getMap(o.filename);
101703
+ let map = output.chunk.getMap(output.filename);
101708
101704
  for (const f of files) { // hack the paths to the original files
101709
101705
  if (f.relative === undefined) {
101710
101706
  continue;
@@ -101717,11 +101713,11 @@ function writeObjects(objects, config, outputFolder, files) {
101717
101713
  }
101718
101714
  fs.writeFileSync(outputFolder + path.sep + name, map);
101719
101715
  }
101720
- if (o.object.type.toUpperCase() === "PROG") {
101716
+ if (output.object.type.toUpperCase() === "PROG") {
101721
101717
  // hmm, will this work for INCLUDEs ?
101722
101718
  contents = `if (!globalThis.abap) await import("./_init.mjs");\n` + contents;
101723
101719
  }
101724
- fs.writeFileSync(outputFolder + path.sep + o.filename, contents);
101720
+ fs.writeFileSync(outputFolder + path.sep + output.filename, contents);
101725
101721
  }
101726
101722
  }
101727
101723
  async function run() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.11.6",
3
+ "version": "2.11.8",
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.152",
31
- "@abaplint/transpiler": "^2.11.6",
30
+ "@abaplint/core": "^2.113.153",
31
+ "@abaplint/transpiler": "^2.11.8",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.2.0",
34
34
  "@types/progress": "^2.0.7",