@abaplint/transpiler 1.8.9 → 1.8.10
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/src/expressions/index.js +5 -1
- package/build/src/index.js +2 -2
- package/build/src/statements/index.js +5 -1
- package/build/src/structures/index.js +5 -1
- package/build/src/types.d.ts +2 -0
- package/build/src/unit_test.d.ts +1 -1
- package/build/src/unit_test.js +10 -3
- package/package.json +4 -4
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/build/src/index.js
CHANGED
|
@@ -28,7 +28,7 @@ class Transpiler {
|
|
|
28
28
|
return new Transpiler().run(reg);
|
|
29
29
|
}
|
|
30
30
|
async run(reg, progress) {
|
|
31
|
-
var _a, _b, _c, _d;
|
|
31
|
+
var _a, _b, _c, _d, _e;
|
|
32
32
|
reg.parse();
|
|
33
33
|
new keywords_1.Keywords().handle(reg);
|
|
34
34
|
this.validate(reg);
|
|
@@ -37,7 +37,7 @@ class Transpiler {
|
|
|
37
37
|
objects: [],
|
|
38
38
|
unitTestScript: new unit_test_1.UnitTest().unitTestScript(reg, (_a = this.options) === null || _a === void 0 ? void 0 : _a.skip, (_b = this.options) === null || _b === void 0 ? void 0 : _b.only),
|
|
39
39
|
unitTestScriptOpen: new unit_test_1.UnitTest().unitTestScriptOpen(reg, (_c = this.options) === null || _c === void 0 ? void 0 : _c.skip, (_d = this.options) === null || _d === void 0 ? void 0 : _d.only),
|
|
40
|
-
initializationScript: new unit_test_1.UnitTest().initializationScript(reg, dbSetup),
|
|
40
|
+
initializationScript: new unit_test_1.UnitTest().initializationScript(reg, dbSetup, (_e = this.options) === null || _e === void 0 ? void 0 : _e.extraSetup),
|
|
41
41
|
databaseSetup: dbSetup,
|
|
42
42
|
reg: reg,
|
|
43
43
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/build/src/types.d.ts
CHANGED
package/build/src/unit_test.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare type TestMethodList = {
|
|
|
5
5
|
method: string;
|
|
6
6
|
}[];
|
|
7
7
|
export declare class UnitTest {
|
|
8
|
-
initializationScript(reg: abaplint.IRegistry, dbSetup: string): string;
|
|
8
|
+
initializationScript(reg: abaplint.IRegistry, dbSetup: string, extraSetup?: string): string;
|
|
9
9
|
unitTestScriptOpen(reg: abaplint.IRegistry, _skip?: TestMethodList, _only?: TestMethodList): string;
|
|
10
10
|
unitTestScript(reg: abaplint.IRegistry, skip?: TestMethodList, _only?: TestMethodList): string;
|
|
11
11
|
private buildImports;
|
package/build/src/unit_test.js
CHANGED
|
@@ -5,17 +5,24 @@ exports.UnitTest = void 0;
|
|
|
5
5
|
const abaplint = require("@abaplint/core");
|
|
6
6
|
class UnitTest {
|
|
7
7
|
// todo, move this somewhere else, its much more than just unit test relevant
|
|
8
|
-
initializationScript(reg, dbSetup) {
|
|
9
|
-
let ret =
|
|
8
|
+
initializationScript(reg, dbSetup, extraSetup) {
|
|
9
|
+
let ret = `/* eslint-disable import/newline-after-import */
|
|
10
|
+
import runtime from "@abaplint/runtime";
|
|
10
11
|
global.abap = new runtime.ABAP();
|
|
11
12
|
${this.buildImports(reg)}
|
|
12
|
-
export async function initializeABAP(
|
|
13
|
+
export async function initializeABAP() {\n`;
|
|
13
14
|
if (dbSetup === "") {
|
|
14
15
|
ret += `// no database artifacts, skip DB initialization\n`;
|
|
15
16
|
}
|
|
16
17
|
else {
|
|
17
18
|
ret += ` await global.abap.initDB(\`${dbSetup}\`);\n`;
|
|
18
19
|
}
|
|
20
|
+
if (extraSetup === undefined) {
|
|
21
|
+
ret += `// no extra setup\n`;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
ret += ` await import("../test/extra.mjs");\n`;
|
|
25
|
+
}
|
|
19
26
|
ret += `}`;
|
|
20
27
|
return ret;
|
|
21
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.10",
|
|
4
4
|
"description": "Transpiler",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"author": "abaplint",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abaplint/core": "^2.85.
|
|
30
|
+
"@abaplint/core": "^2.85.32",
|
|
31
31
|
"source-map": "^0.7.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/chai": "^4.3.0",
|
|
35
35
|
"@types/mocha": "^9.1.0",
|
|
36
36
|
"chai": "^4.3.6",
|
|
37
|
-
"mocha": "^9.2.
|
|
37
|
+
"mocha": "^9.2.1",
|
|
38
38
|
"source-map-support": "^0.5.21",
|
|
39
|
-
"typescript": "^4.
|
|
39
|
+
"typescript": "^4.6.2"
|
|
40
40
|
}
|
|
41
41
|
}
|