vmware / build-tools-for-vmware-aria

Build Tools for VMware Aria provides development and release management tools for implementing automation solutions based on the VMware Aria Suite and VMware Cloud Director. The solution enables Virtual Infrastructure Administrators and Automation Developers to use standard DevOps practices for managing and deploying content.
Other
48 stars 24 forks source link

Issue executing package vrealize:push vrotsc cannot transpile module names with dash separators #89

Closed veselinss closed 1 year ago

veselinss commented 1 year ago

Description

If the "vrotsc-annotations" module, or any other that does not have a "." or "/", is in use in a project, once compiled to js the variable name for the module contains a "-". This renders any classes that use such annotations useless.

Steps to Reproduce

  1. Create a VRO-typescript project or mixed project
  2. Import the "vrotsc-annotations" module in a class
  3. Execute a maven build with compile stage active or vrealize:push

Expected behavior:
Successful build with no errors and only working .js files in target

Actual behavior: Some classes are rendered unusable, hence once pushed the package does not fully work.

Reproduces how often: 100%

Component/s: vrotsc

Affects Build/s: 2.31.0

Server

Failure Logs

[INFO] info: Parsing vro javascript project folder path "/home/xxxxxxxx/vro/target/vro-sources/js"... [ERROR] (node:11131) UnhandledPromiseRejectionWarning: Error: /home/xxxxxxxx/vro/target/vro-sources/js/src/main/resources/xxxxxxxx/vro/elements/config/SmtpConfiguration.js [10:15]: Unexpected token: '-' [ERROR] SyntaxError: [10:15]: Unexpected token: '-' [ERROR] at report (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:186:11) [ERROR] at matchOrInsertSemicolon (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:4368:9) [ERROR] at parseVariableStatement (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:5365:5) [ERROR] at parseStatement (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:4906:20) [ERROR] at parseStatementListItem (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:4900:20) [ERROR] at parseFunctionBody (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:6106:19) [ERROR] at parseFunctionExpression (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:6703:18) [ERROR] at parsePrimaryExpression (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:6381:20) [ERROR] at parseParenthesizedExpression (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:7681:20) [ERROR] at parsePrimaryExpression (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:6387:20) [ERROR] at parseExpressionOrLabelledStatement (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:4965:20) [ERROR] at parseStatement (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:4950:20) [ERROR] at parseStatementListItem (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:4900:20) [ERROR] at parseModuleItem (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:4864:26) [ERROR] at parseModuleItemList (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:4849:25) [ERROR] at parseSource (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/node_modules/meriyah/dist/meriyah.cjs:4793:16) [ERROR] at Function.getSourceTreeFromSource (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/dist/parse/js.js:210:19) [ERROR] at VroJsProjParser. (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/dist/parse/js.js:50:50) [ERROR] at Array.forEach () [ERROR] at VroJsProjParser. (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/dist/parse/js.js:32:69) [ERROR] at Generator.next () [ERROR] at /home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/dist/parse/js.js:8:71 [ERROR] at new Promise () [ERROR] at awaiter (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/dist/parse/js.js:4:12) [ERROR] at VroJsProjParser.parse (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/dist/parse/js.js:27:16) [ERROR] at /home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/dist/cli.js:112:57 [ERROR] at Generator.next () [ERROR] at /home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/dist/cli.js:8:71 [ERROR] at new Promise () [ERROR] at awaiter (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/dist/cli.js:4:12) [ERROR] at run (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/dist/cli.js:54:12) [ERROR] at Object. (/home/xxxxxxxx/vro/node_modules/@vmware-pscoe/vropkg/dist/cli.js:151:1) [ERROR] (Use node --trace-warnings ... to show where the warning was created) [ERROR] (node:11131) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) [ERROR] (node:11131) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Michaelpalacce commented 1 year ago

Are you sure? Seems to me like you are trying to compile a configurationElement and you've forgotten to name it configName.conf.ts?

Also, or any other that does not have a "." or "/", is hard to understand... What do you mean?

Michaelpalacce commented 1 year ago

Just to note:

Config elements follow the schema:

configName.conf.ts

Workflows:

wfName.wf.ts The error you are seeing happens if these are normally miss-named

Michaelpalacce commented 1 year ago

Closing as resolved