@abaplint/transpiler 2.4.22 → 2.5.0

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.
@@ -0,0 +1,5 @@
1
+ import * as abaplint from "@abaplint/core";
2
+ import { IOutputFile } from "../types";
3
+ export declare class HandleSMIM {
4
+ runObject(obj: abaplint.Objects.MIMEObject, _reg: abaplint.IRegistry): IOutputFile[];
5
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HandleSMIM = void 0;
4
+ const chunk_1 = require("../chunk");
5
+ class HandleSMIM {
6
+ runObject(obj, _reg) {
7
+ var _a, _b;
8
+ const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(".xml", ".mjs").toLowerCase();
9
+ if (filename === undefined) {
10
+ return [];
11
+ }
12
+ obj.parse();
13
+ const chunk = new chunk_1.Chunk().appendString(`abap.SMIM["${obj.getName().toUpperCase()}"] = {
14
+ "objectType": "SMIM",
15
+ "filename": ${JSON.stringify((_b = obj.getDataFile()) === null || _b === void 0 ? void 0 : _b.getFilename())},
16
+ "url": ${JSON.stringify(obj.getURL())},
17
+ "class": ${JSON.stringify(obj.getClass())},
18
+ };`);
19
+ const output = {
20
+ object: {
21
+ name: obj.getName(),
22
+ type: obj.getType(),
23
+ },
24
+ filename: filename,
25
+ chunk: chunk,
26
+ requires: [],
27
+ exports: [],
28
+ };
29
+ return [output];
30
+ }
31
+ }
32
+ exports.HandleSMIM = HandleSMIM;
33
+ //# sourceMappingURL=handle_smim.js.map
@@ -0,0 +1,5 @@
1
+ import * as abaplint from "@abaplint/core";
2
+ import { IOutputFile } from "../types";
3
+ export declare class HandleW3MI {
4
+ runObject(obj: abaplint.Objects.WebMIME, _reg: abaplint.IRegistry): IOutputFile[];
5
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HandleW3MI = void 0;
4
+ const chunk_1 = require("../chunk");
5
+ class HandleW3MI {
6
+ runObject(obj, _reg) {
7
+ var _a, _b;
8
+ const filename = (_a = obj.getXMLFile()) === null || _a === void 0 ? void 0 : _a.getFilename().replace(".xml", ".mjs").toLowerCase();
9
+ if (filename === undefined) {
10
+ return [];
11
+ }
12
+ obj.parse();
13
+ const chunk = new chunk_1.Chunk().appendString(`abap.W3MI["${obj.getName().toUpperCase()}"] = {
14
+ "objectType": "W3MI",
15
+ "filename": ${JSON.stringify((_b = obj.getDataFile()) === null || _b === void 0 ? void 0 : _b.getFilename())},
16
+ };`);
17
+ const output = {
18
+ object: {
19
+ name: obj.getName(),
20
+ type: obj.getType(),
21
+ },
22
+ filename: filename,
23
+ chunk: chunk,
24
+ requires: [],
25
+ exports: [],
26
+ };
27
+ return [output];
28
+ }
29
+ }
30
+ exports.HandleW3MI = HandleW3MI;
31
+ //# sourceMappingURL=handle_w3mi.js.map
@@ -14,6 +14,8 @@ const handle_table_type_1 = require("./handlers/handle_table_type");
14
14
  const handle_view_1 = require("./handlers/handle_view");
15
15
  const handle_enqu_1 = require("./handlers/handle_enqu");
16
16
  const handle_type_pool_1 = require("./handlers/handle_type_pool");
17
+ const handle_w3mi_1 = require("./handlers/handle_w3mi");
18
+ const handle_smim_1 = require("./handlers/handle_smim");
17
19
  class Transpiler {
18
20
  constructor(options) {
19
21
  this.options = options;
@@ -77,6 +79,12 @@ class Transpiler {
77
79
  else if (obj instanceof abaplint.Objects.TableType) {
78
80
  output.objects.push(...new handle_table_type_1.HandleTableType().runObject(obj, reg));
79
81
  }
82
+ else if (obj instanceof abaplint.Objects.MIMEObject) {
83
+ output.objects.push(...new handle_smim_1.HandleSMIM().runObject(obj, reg));
84
+ }
85
+ else if (obj instanceof abaplint.Objects.WebMIME) {
86
+ output.objects.push(...new handle_w3mi_1.HandleW3MI().runObject(obj, reg));
87
+ }
80
88
  }
81
89
  return output;
82
90
  }
@@ -124,7 +124,10 @@ async function run() {
124
124
  ret += ` clas = unit.addObject("${obj.getName()}");\n`;
125
125
  for (const file of obj.getABAPFiles()) {
126
126
  for (const def of file.getInfo().listClassDefinitions()) {
127
- if (def.isForTesting === false || def.isGlobal === true || def.methods.length === 0) {
127
+ if (def.isForTesting === false
128
+ || def.isGlobal === true
129
+ || def.methods.length === 0
130
+ || def.isAbstract === true) {
128
131
  // todo, fix, there might be global test methods
129
132
  continue;
130
133
  }
@@ -199,6 +202,8 @@ run().then(() => {
199
202
  if (obj instanceof abaplint.Objects.Table
200
203
  || obj instanceof abaplint.Objects.DataElement
201
204
  || obj instanceof abaplint.Objects.LockObject
205
+ || obj instanceof abaplint.Objects.MIMEObject
206
+ || obj instanceof abaplint.Objects.WebMIME
202
207
  || obj instanceof abaplint.Objects.TypePool
203
208
  || obj instanceof abaplint.Objects.TableType) {
204
209
  list.push(imp(`${this.escapeNamespace(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.4.22",
3
+ "version": "2.5.0",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "author": "abaplint",
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
- "@abaplint/core": "^2.95.18",
31
+ "@abaplint/core": "^2.95.19",
32
32
  "source-map": "^0.7.4"
33
33
  },
34
34
  "devDependencies": {