diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..77f5470 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: testing +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + unit_test: + name: Run unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v3 + with: + node-version: '20' + - uses: actions/checkout@v3 + - name: Prepare env + run: | + rm -Rf transpiled + rm package*.json + npm -g install @abaplint/transpiler-cli + npm install @abaplint/runtime + - name: Build unit tests + run: | + echo "Building ..." + abap_transpile abap_transpile.json + - name: Run unit tests + run: | + echo "Running unit tests ..." + node transpiled/index.mjs diff --git a/.gitignore b/.gitignore index 24b688f..476b65a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ abaplint-deps transpiled node_modules +# package.json +# package-lock.json diff --git a/abap_transpile.json b/abap_transpile.json new file mode 100644 index 0000000..436564c --- /dev/null +++ b/abap_transpile.json @@ -0,0 +1,30 @@ +{ + "input_folder": "{src,deps}", + "input_filter": [ + "deps/", + "src/zcl*", + "src/zif*", + "src/zcx*" + ], + "output_folder": "transpiled", + "libs": [ + { + "url": "https://github.com/open-abap/open-abap-core" + } + ], + "write_unit_tests": true, + "write_source_map": true, + "options": { + "ignoreSyntaxCheck": false, + "addFilenames": true, + "addCommonJS": true, + "unknownTypes": "runtimeError", + "keywords": ["return", "in", "class"], + "skip": [ + { "object": "ZCL_TEXT2TAB_SERIALIZER", "class": "ltcl_text2tab_serializer_test", "method": "serialize_field_cunit", "note": "CUNIT issue" }, + { "object": "ZCL_TEXT2TAB_PARSER", "class": "ltcl_text2tab_parser_test", "method": "parse_field_special", "note": "CUNIT issue" }, + { "object": "ZCL_TEXT2TAB_PARSER", "class": "ltcl_text2tab_parser_test", "method": "parse_df16", "note": "TypeError: abap.types.typeTodoDecFloat16Type is not a constructor" }, + { "object": "ZCL_TEXT2TAB_PARSER", "class": "ltcl_text2tab_parser_test", "method": "parse_ignore_convexit", "note": "CUNIT issue" } + ] + } +} diff --git a/deps/veri_alpha.doma.xml b/deps/veri_alpha.doma.xml new file mode 100644 index 0000000..4ad269b --- /dev/null +++ b/deps/veri_alpha.doma.xml @@ -0,0 +1,16 @@ + + + + + + VERI_ALPHA + E + CHAR + 000010 + 000010 + ALPHA + VERI_ALPHA + + + + diff --git a/deps/veri_alpha.dtel.xml b/deps/veri_alpha.dtel.xml new file mode 100644 index 0000000..c2b287d --- /dev/null +++ b/deps/veri_alpha.dtel.xml @@ -0,0 +1,21 @@ + + + + + + VERI_ALPHA + E + VERI_ALPHA + 10 + 15 + 20 + VERI_ALPHA + ALPHA + ALPHA + ALPHA + D + D + + + + diff --git a/package-lock.json b/package-lock.json index 0eb1032..dcd28a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,53 +1,72 @@ { "name": "text2tab", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "@abaplint/cli": { - "version": "2.79.29", - "resolved": "https://registry.npmjs.org/@abaplint/cli/-/cli-2.79.29.tgz", - "integrity": "sha512-irRY2YXeEp4OMfqDaErckNTjls+i0f6xEqnLQMsSc2Dx8Yshdfk60RbxATjg6dfJYa0p3tT3zjGoFxmmlkotXQ==" - }, - "@abaplint/runtime": { - "version": "1.6.47", - "resolved": "https://registry.npmjs.org/@abaplint/runtime/-/runtime-1.6.47.tgz", - "integrity": "sha512-0kYnwMi2nbGBdIROfwdfR6Y0BtTmXTCJgO4nrCADvno9XkfY+SXshncOZqm3NDDE9pC0kJ3hXABoXWsv4jIvLA==", - "requires": { - "hdb": "^0.18.3", - "sql.js": "^1.6.2" + "packages": { + "": { + "name": "text2tab", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@abaplint/cli": "^2.113.63", + "@abaplint/runtime": "^2.10.20", + "@abaplint/transpiler-cli": "^2.10.20" } }, - "@abaplint/transpiler-cli": { - "version": "1.6.47", - "resolved": "https://registry.npmjs.org/@abaplint/transpiler-cli/-/transpiler-cli-1.6.47.tgz", - "integrity": "sha512-FSghTSkdJPzee5hJm3o2/xsjshJLswyJiPNEDG0wLW3oLOwzOmcvyW8bL0z49BjLrnom5xIqRRqUrZBxRRSuwQ==" + "node_modules/@abaplint/cli": { + "version": "2.113.63", + "resolved": "https://registry.npmjs.org/@abaplint/cli/-/cli-2.113.63.tgz", + "integrity": "sha512-CTUv+cDRNCzE4ddzcXeNi8vsHyNM6iW7hSlo6OWVsfNGQtpPhsnavOVjKh+V/OXMWNMndq1dvfR60atBqsseKw==", + "license": "MIT", + "bin": { + "abaplint": "abaplint" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/larshp" + } }, - "hdb": { - "version": "0.18.3", - "resolved": "https://registry.npmjs.org/hdb/-/hdb-0.18.3.tgz", - "integrity": "sha512-VH65JBxILtRDFpWsl74sl12rzVVDgEgjmey8b+CyhzZgm2XwuLh20p99uce32s8om7rFFdOC6b/hwt8VHmU8iQ==", - "requires": { - "iconv-lite": "^0.4.18" + "node_modules/@abaplint/runtime": { + "version": "2.10.20", + "resolved": "https://registry.npmjs.org/@abaplint/runtime/-/runtime-2.10.20.tgz", + "integrity": "sha512-eSBMH77HGCzmftzHnzJk2DQiqq5PdxEkDXOIN+5J5I/OF6DPDJnOTQETLMFOpOYV/uUyhZG2qePAVvLnBE2vNQ==", + "license": "MIT", + "dependencies": { + "temporal-polyfill": "^0.2.5" + }, + "funding": { + "url": "https://github.com/sponsors/larshp" } }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "node_modules/@abaplint/transpiler-cli": { + "version": "2.10.20", + "resolved": "https://registry.npmjs.org/@abaplint/transpiler-cli/-/transpiler-cli-2.10.20.tgz", + "integrity": "sha512-1LQ6cRgHS9uixf+AAErtNW+aWcRrYlHFVnpzWlhaZloA9uyra0B9dhylPDaQKoMkmwJXsMq1Em3zlbYWCFK43g==", + "license": "MIT", + "bin": { + "abap_transpile": "abap_transpile" + }, + "funding": { + "url": "https://github.com/sponsors/larshp" } }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "node_modules/temporal-polyfill": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-0.2.5.tgz", + "integrity": "sha512-ye47xp8Cb0nDguAhrrDS1JT1SzwEV9e26sSsrWzVu+yPZ7LzceEcH0i2gci9jWfOfSCCgM3Qv5nOYShVUUFUXA==", + "license": "MIT", + "dependencies": { + "temporal-spec": "^0.2.4" + } }, - "sql.js": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/sql.js/-/sql.js-1.6.2.tgz", - "integrity": "sha512-9iucI5fXQa+Gspeqf/BNB20PxJIn5LhXDt4mjXoFPqXdR+NqtFs15SdKpSIJ6s529aGL9zFR9p2eSCIEiMsNGA==" + "node_modules/temporal-spec": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-0.2.4.tgz", + "integrity": "sha512-lDMFv4nKQrSjlkHKAlHVqKrBG4DyFfa9F74cmBZ3Iy3ed8yvWnlWSIdi4IKfSqwmazAohBNwiN64qGx4y5Q3IQ==", + "license": "ISC" } } } diff --git a/package.json b/package.json index 56acdc3..f6eadfe 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,10 @@ "name": "text2tab", "version": "1.0.0", "private": true, - "description": "abap tab-delimited tax parser/serializer", - "main": "js-transpiled/index.mjs", "scripts": { - "test": "node js-transpiled/index.mjs", - "transpile": "abap_transpile abap_transpile.json" + "test": "npm run build && npm run run_ut", + "run_ut": "node transpiled/index.mjs", + "build": "abap_transpile abap_transpile.json" }, "repository": { "type": "git", @@ -19,8 +18,8 @@ }, "homepage": "https://github.com/sbcgua/text2tab#readme", "dependencies": { - "@abaplint/cli": "^2.79.29", - "@abaplint/runtime": "^1.6.47", - "@abaplint/transpiler-cli": "^1.6.47" + "@abaplint/cli": "^2.113.63", + "@abaplint/runtime": "^2.10.20", + "@abaplint/transpiler-cli": "^2.10.20" } }