generator-ui5-project
generator-ui5-project copied to clipboard
Feat add specific unit and opa5 test templates
In case the project is a TypeScript project the generator should generate .ts files for opa5 and unit tests
Out of scope for this PR: In case the project is a Fiori Elements (fpmpage) project the generator should make use of sap.fe.test in the generated opa5 tests
Depends on https://github.com/SAP/open-ux-tools/pull/2164
Looks good!
Does this mean we should merge this and https://github.com/SAP/open-ux-tools/pull/2164 at the same time? Or merge the open-ux-tools first and make sure this generator uses the latest version after its release?
Looks good!
Does this mean we should merge this and SAP/open-ux-tools#2164 at the same time? Or merge the open-ux-tools first and make sure this generator uses the latest version after its release?
I would wait till the preview-middleware fix is in. Won't take that long 🤞🏻
Thanks for the newest commits. Just waiting for https://github.com/SAP/open-ux-tools/pull/2164 and will merge after that.
@nicoschoenteich luckily we waited. I'll adjust the templates according to what @petermuessig just implemented 🐱
UPDATE: now that I had a look at it it's not relevant for the templates because everything that changed is served via preview-middleware 🥳
@nicoschoenteich I just merged https://github.com/SAP/open-ux-tools/pull/2164 so 0.16.23 should be the right version for the preview middleware but I don't find where it is maintained in the generator 🕵🏻 Or is it only an indirect dependency of @sap/ux-ui5-tooling? For testing purposes I added it to the package.json of the generated ui app and everything seems to work with the ts template. But please double check as well 😸
@nicoschoenteich not sure what this error is all about 🤷🏻
npm error Lifecycle script `ts-typecheck` failed with error:
npm error Error: command failed
npm error in workspace: [email protected]
npm error at location: /home/runner/work/generator-ui5-project/generator-ui5-project/test-output/com.myorg.myui5project/myui5app
npm error Lifecycle script `build` failed with error:
npm error Error: command failed
npm error in workspace: [email protected]
npm error at location: /home/runner/work/generator-ui5-project/generator-ui5-project/test-output/com.myorg.myui5project/myui5app
make: *** [Makefile_20241028135626.mta:28: pre_build] Error 1
Error: could not build the MTA project: could not execute the "make -f Makefile_20241028135626.mta p=cf mtar=com.myorg.myui5project.mtar strict=true mode=" command: exit status 2
at checkExecSyncError (node:child_process:890:11)
at execSync (node:child_process:962:15)
at Context.<anonymous> (file:///home/runner/work/generator-ui5-project/generator-ui5-project/test/all-projects.js:162:11)
at process.processImmediate (node:internal/timers:476:21)
I think a new version of the template now runs tsc as part of a ts-typecheck script, so we would need tsc as a dev dependency if this.options.config.enableTypescript. I think this shouldn't be fixed here, but rather on the template side in @sap-ux/ui5-application-writer.
I think a new version of the template now runs
tscas part of ats-typecheckscript, so we would needtscas a dev dependency ifthis.options.config.enableTypescript. I think this shouldn't be fixed here, but rather on the template side in@sap-ux/ui5-application-writer.
The tsc command comes with the typescript package. And this is part of the core templates for typescript/package.json. So I would have expected it is already in 🤔
You are right. This particular test also passes locally (after uninstalling typescript globally). Not sure what is going on here - we might just merge anyway. What do you think?
@nicoschoenteich this PR is still open. Can it be merged?
Hi @heimwege, as briefly discussed in the hall a minute ago, my apologies for letting this sit for so long. I was stupid enough to more or less the same changes myself beginning of this week, but merged your PR now. Thanks!