yeoman-based (sub-)generator for a UI5 custom control, prepped for npm distribution as ui5-cc-*
Scaffold a UI5 custom control that is structured in such a way that it can also distributed as a node module via npm.
Mainly intended for re-use via easy-ui5, but also suitable to run standalone.
easy-ui5do yo easy-ui5 and select this generator when prompted

$> npm i -g yo$> yo ./path-to-this-repo/app_-----_ ╭──────────────────────────╮| | │ Welcome to the amazing │|--(o)--| │ UI5 custom control │`---------´ │ generator! │( _´U`_ ) ╰──────────────────────────╯/___A___\ /| ~ |__'.___.'__´ ` |° ´ Y `? What's the name space your custom control(s) should live in? (my.ui5.cc)
$> yo ./path-to-this-repo/app --controlNamespace=bla.fasel --buildDir=../some/dir# will make the control live in namespace 'bla.fasel"# and put the built control in directory `cwd` + '../some/dir'
the generator also provides a full dev- and test-environment for your new and shiny custom control 😱 !
$> cd path/to/generator/result$> npm run test:manual# ...info normalizer:translators:ui5Framework Using OpenUI5 version: 1.86.3info server:custommiddleware:livereload Livereload server started!Server startedURL: http://localhost:8081
As obvious from the above, the manual test command boots up a barebones UI5 app using your new custom control, inclusing live reload capabilites. So once you edit the control, the app auto-reloads and changes are visible immediately.
$> npm run test# ...PASS test/ui5-app/basic.test.jsmy.ui5.cc.Control✓ should find the my.ui5.cc.Control in index.html (36 ms)Test Suites: 1 passed, 1 totalTests: 1 passed, 1 totalSnapshots: 0 totalTime: 1.103 sRan all test suites.
all tests are located in __tests__.jest is used as test framework and runner.
yo v3 (not 5) and yeoman-generator v4.x (not 5) due to incompatability issuesprettier config in .prettierrc in this repo