Ideas for Arc XP

Remove autogenerate/rewriting of the eventsHandler module in IFX Node SDK

Is there a reason why the IFX Node SDK auto-writes the eventsHandler module? This functionality has proven to be a bit of a thorn in my side for the following reasons...

  1. It generates code that breaks linting rules I have established. The module.exports object does not end with a semicolon, and the file does not end with a new line. I have to either exclude the file from linting checks, or continually git restore it during development.

  2. It is not compatible with same-folder testing architecture. If I have a defaultHandler.test.js file in the eventsHandlers folder, the eventsHandler.js file is generated with malformed javascript:

const defaultHandler = require('./eventsHandlers/defaultHandler');

const defaultHandler.test = require('./eventsHandlers/defaultHandler.test');
module.exports = { defaultHandler, defaultHandler.test }

In addition, the autogeneration of this particular file is not immediately obvious, so I spent quite some time confused why it kept changing on me. The generated code seems quite simple, so I don't understand what purpose autogenerating it really serves.

  • Lowell Kissling
  • Jul 4 2024
  • Future consideration
IFX
  • Attach files