Giter Club home page Giter Club logo

generator-ui5-project's Introduction

we're UI5, folks!

This is the head space of the UI5 community.

generator-ui5-project's People

Contributors

alexanderk22 avatar dh4rry avatar flx-rsc avatar georgbischoff avatar iobert avatar lboehm avatar marianfoo avatar mariusfreitag avatar matseee avatar nicoschoenteich avatar ohitslena avatar petermuessig avatar tobiasqueck avatar tsaleksandrova avatar vobu avatar wridgeu avatar ziyang-works avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-ui5-project's Issues

npm global install fails on linux

Dear team,

I am failing to npm install the generator in version 3.0.1 fails with authorization error on linux during the postinstallation.

This is what I do:
sudo npm install generator-easy-ui5 -g

Maybe the sudo run as is not being propagated?

I have attached the result.
installation_output.txt

Installation works fine with version 2.4.6.

Thanks a lot
Michel

Error when creating "newwebapp" with "project" generator

Easy-Ui5 version:

3.6.2

OS/version:

Windows 11 Enterprise 22H2

Browser/version (+device/version):

Not yet run on browser as project is not getting created

Steps to reproduce the problem:

Create newwebapp using the project generator

What is the expected result?:

project/newwebapp should be created successfully

What happens instead? Error in creating the newwebapp -

An error occured while running ui5-project:newwebapp#writing
Error easy-ui5

Cannot read properties of undefined (reading 'includes')

Any other information? (attach screenshot if possible)

image

npm -g outdated: ERR! No versions available for generator-template-ui5-project

❯ npm -g outdated
npm ERR! code ENOVERSIONS
npm ERR! No versions available for generator-template-ui5-project

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pieter/.npm/_logs/2021-08-19T06_49_30_591Z-debug.log
❯ npm -g list --depth=0
/home/pieter/.nvm/versions/node/v14.16.1/lib
├── @sap/[email protected]
├── @sap/[email protected]
├── @sap/[email protected]
├── @ui5/[email protected]
├── [email protected]
├── [email protected]
├── [email protected] -> ./node_modules/generator-easy-ui5/plugin-generators/generator-ui5-project
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Is it caused by it not being open source and that it's actually VS Code Fiori Tools that installs that generator?

Include mockserver in apps generated for Netweaver

I'm moving this issue from the old repo on behalf of @unkoder-dev

Using the generator for a Netweaver application does not produce the localService folder nor the "start-local" task in package.json. It would be great to have the possibility to add a service metadata.xml and service data in a .json file to be able to run the app locally without backend server.

Among other cases, this would help create examples people can download and run without having to create the backend service in an SAP System.

Original issue:SAP/generator-easy-ui5#65

Being composable from other generators

I would like to reuse the sub generators e.g. (newwebapp) in my custom generator (wich is a seperate node project not a fork of this one).

For that I use " this.composeWith" method like this (config contains everything that is also be present at that main generator app/index.js:

    async writing() {
        const oConfig = this.config.getAll();
        const oSubGen = Object.assign({}, oConfig);
        oSubGen.isSubgeneratorCall = true;
        oSubGen.cwd = this.destinationRoot();
        oSubGen.modulename = "";
        this.composeWith(require.resolve("generator-template-ui5-project/generators/newwebapp"), oSubGen);
    }

The problem is that the configs are separeted for each generator (so my custom generator cannot add configs to "generator-template-ui5-project" config).
At the moment lot of Information can be passed via options, but not all.
The newwebapp subgenerater composes opa5 generater and only transfers "namespaceInput" from the config (via this.options.oneTimeConfig) and not from the options.

This will later result in this Error:

TypeError: Cannot read property 'split' of undefined
at module.exports.prompting (/mnt/c/Users/hwa/Documents/generator-ui5wrap/node_modules/generator-template-ui5-project/generators/opa5/index.js:21:83)`

QoL change: projectname ↔ "name" attribute in package.json

Hey everyone,

I've come to notice that we're using the projectname from the prompt as name within the package.json. This doesn't fit a 100% though.

image

I'm not sure if there are any restrictions on the UI5 projectname (i.e. myUI5App, used as default), at least I haven't come across any so far. I do feel like the common way of naming such projects is all lowercase ("myapp") or sometimes with hyphenation ("my-app").

ideas

Would it make sense to either restrict/adjust the way projectnames can be given during the prompt?

return this.prompt([
{
type: "input",
name: "projectname",
message: "How do you want to name this project?",
validate: (s) => {
if (/^\d*[a-zA-Z][a-zA-Z0-9]*$/g.test(s)) {
return true;
}
return "Please use alpha numeric characters only for the project name.";
},
default: "myUI5App"

... or would it make more sense to maybe match the RegEx / or just put it all lowercase in the package.json creation?

let packge = {
name: oConfig.projectname,
version: "0.0.1",

infos

name attribute of package.json: https://docs.npmjs.com/creating-a-package-json-file#required-name-and-version-fields

feedback

Would you even consider this being nice to have or do you see this from different PoVs like "just name it properly", "just rename it in package.json later on" or something like that?

Feature: FLP Plugin Project Type

Hello Marius,

I was thinking to create a generator for the FLP plugin project. Can you suggest where should I add this generator generator-ui5-project or generator-ui5-library or entirely create a new project in UI5 Community

I saw the main generator generator-easy-ui5 fetching repository from
UI5 Community & showing list if we don't pass any options to the generator.

Let me know any other contribution required from my side I am happy to do that.

Providing some documentation on how to contribute

Hi @IObert,

I think it would help if there were any documentation for people who want to contribute to this generator. I was quite struggling to get started, especially debugging wasn't easy. I didn't get it running at the weekend, because I found out that the problem can't be solved in this repo, so I didn't dig deeper on how to debug. Probably it's not complicated if you know what to do. But it would help people when they want to contribute.

What do you think? Could you or someone else provide some information.

BR,
Lukas

Duplicate entries in `.eslintrc` for project scaffolding

Hey there, 👋

I've noticed that the .eslintrc file will always have duplicate entries (see img below) when agreeing on adding the "code assist libraries" during the project scaffolding (cmd: yo easy-ui5 project).

image

This is because these options are being set here:

let eslintrc = {
plugins: ["@sap/ui5-jsdocs"],
extends: ["plugin:@sap/ui5-jsdocs/recommended", "eslint:recommended"]
};

even though they already exist in the base .eslintrc file for this type of generator:

"plugins": ["@sap/ui5-jsdocs"],
"extends": ["plugin:@sap/ui5-jsdocs/recommended", "eslint:recommended"]

Would it make sense to remove these additions (plugins & extends) in the index.js? I think using JSDoc is viable even without the type-hinting from the tsconfig.json.

Generators for views/models/controls does not work for ts-app

Easy-Ui5 version:

3.0.1

OS/version:

Windows 10

Browser/version (+device/version):

Chrome

Steps to reproduce the problem:

  1. yo easy-ui5 ts-app
  2. cd com.myorg.myapp/
  3. yo easy-ui5 project newview

What is the expected result?

Module automatically found and yo should continue to ask questions about view to generate

What happens instead?

Screen stuck with message and user cannot do anything:
? To which module do you want to add a view? (Use arrow keys)

Any other information? (attach screenshot if possible)

2021-07-25_12-34-44

eslint always looks for "xml", even if oConfig.viewtype=="JSON"

Easy-Ui5 version:

Node.js: v16.9.1
yeoman-environment: 3.9.1
generator-easy-ui5: 3.2.1
home: /Users/i533499/Documents/coding/generator-easy-ui5
pluginsHome: /Users/i533499/Documents/coding/generator-easy-ui5/plugin-generators
Available generators:

  • generator-ui5-project: 0.1.1

Steps to reproduce the problem:

  1. Run yo easy-ui5 project
  2. Create a new app
  3. Select JSON as view type

What is the expected result?

lint-fix should run smoothly after installation.

What happens instead?

Screenshot 2022-02-11 at 10 54 49

This is related to @lboehm's PR a few weeks ago. eslint specifically looks for xml. I guess we should look for a different pattern or make this dependent on oConfig.viewtype.

Proposal to add a more sophisticated eslint ruleset

Hi all,

I have two improvements regarding the eslint ruleset, currently generated by this generator:

  1. I would propose to change the rule config from integers to string. Currently it says:

    {
    "block-scoped-var": 1
    }
    

    Based on the eslint documentation, the 1 can be replaced with warn, which is easier to understand.

  2. And more importantly, I would propose to add some more rules. There are quite important ones missing, from my point of view. For example the eqeqeq rule (link).
    And I think as IE11 isn't supported any longer we can add eslint rules that enforce code that can't be executed by IE11 without transpilation. For example the no-var rule (link).

I've provided a PR with a changed ruleset. As this is a very important matter, we should propably discuss the changed rules. Maybe the proposed ruleset is too strict. But it can serve as a basis for a discussion.

I think we have the chance to help developers create more readable, more maintainable source code. So I would really love to have a more sophisticated ruleset. What do you guys think?

Best regards
Lukas

Error in directory paths when generating a new app inside an existing project

Easy-Ui5 version:

Run yo easy-ui5 --plugins to print all relevant version strings
Node.js: v16.14.0
yeoman-environment: 3.12.1
generator-easy-ui5: 3.5.1
home: /Users/I540401/.nvm/versions/node/v16.14.0/lib/node_modules/generator-easy-ui5
pluginsHome: /Users/I540401/.nvm/versions/node/v16.14.0/lib/node_modules/generator-easy-ui5/plugin-generators

Available generators:

  • ui5-project: 0.2.1

OS/version:

Macos 12.6

Browser/version (+device/version):

Chrome (latest)

Steps to reproduce the problem:

  1. Create a project directory like this:
root-project-folder
    server
    README.md
    ... other stuff
  1. cd into root-project-folder and run easy-ui5 to generate a new ui5 app (devtoberfest.travel) with fiori-tools support and choose YES to create a new directory.
    This leave you with a project structure like this:
root-project-folder
    devtoberfest.travel
        uimodule
        package.json
        ...
    server
    README.md
    ... other stuff
  1. Now open vscode at the devtoberfest.travel folder and try npm start or click the "preview application" tile.
    This fails with this error:
    image

Now if I just create a new folder somewhere else and run easy-ui5 inside it and say 'dont create a new folder' it all works.
I can't see any difference in the generated files and paths).

Any ideas?

Cannot find module 'object-assign-deep'

Easy-Ui5 version:

Run yo easy-ui5 --plugins to print all relevant version strings
Node.js: v14.15.3
yeoman-environment: 3.8.1
generator-ui5-project: 0.1.1

OS/version:

Windows 10 (64bit)

Browser/version (+device/version):

Chrome 87.0.4280.88

Steps to reproduce the problem:

  1. Step 1 npm install -g yo generator-easy-ui5
  2. Step 2 yo easy-ui5
  3. Step 3 Select your generator? generator-ui5-project

What is the expected result?

The project is generated successfully.

What happens instead?

Error easy-ui5 project

Cannot find module 'object-assign-deep'
Require stack:

...\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\helpers\fileaccess.js
...\AppData\Roaming\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\additionalmodules\index.js
...\AppData\Roaming\npm\node_modules\generator-easy-ui5\node_modules\yeoman-environment\lib\util\esm.js
...\AppData\Roaming\npm\node_modules\generator-easy-ui5\node_modules\yeoman-environment\lib\store.js
...\AppData\Roaming\npm\node_modules\generator-easy-ui5\node_modules\yeoman-environment\lib\environment.js
...\AppData\Roaming\npm\node_modules\generator-easy-ui5\generators\app\index.js
...\AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-environment\lib\util\esm.js
...\AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-environment\lib\store.js
...\AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-environment\lib\environment.js
...\AppData\Roaming\npm\node_modules\yo\lib\router.js
...\AppData\Roaming\npm\node_modules\yo\lib\cli.js

Any other information? (attach screenshot if possible)

Proposal: Add prettier config

Hi @IObert,

I've got another proposal, how easy-ui5 could be improved. I would suggest to add prettier to the generated projects. Prettier provides two helpful features:

  • Prettier checks if the code is formatted according to the given rules. This is helpful when a developer wants to check if the whole UI5 project is well formatted. And it's helpful when you want to validate code quality in a pipeline. (You can compare this feature to eslint, that just checks for possible errors.)
  • And prettier can format all the JS code in the project, so a developer doesn't have to check and format every file on his own. You can just run prettier --write and the whole project matches the defined code style. (You can compare this feature to eslint --fix, that fixes errors as far as possible.)

easy-ui5 generates two npm tasks:

  • lint for linting the projects JavaScript code
  • lint-fix for auto fixing those issues that can be auto fixed

I propose to add prettier checks to the lint task and prettier --write to the lint-fix task.

At our company we're using this configuration and it's quite helpful. Here you can see the output when executing npm run lint:

image

To achieve this behaviour, we would have to do the following things:

  • add one or two npm packages as dev dependency
  • add the prettier-config file
  • Adjust the npm tasks for linting, so that they don't just call eslint, but prettier as well

If you like my proposal (or the community likes it 🙂) I would provide a PR. But I wanted to ask first, to make sure my PR won't be in vain.

What do you think?

BR,
Lukas

Limit of alpha numeric project names for OPA5

I'm moving this issue from the old repo on behalf of @StefanButscher

Dear colleagues,

when I run yo easy-ui5:opa5 for my project with name sap.ui.demo.cart.controller I get the error message:

Please use alpha numeric characters only for the project name.

This restriction is difficult for FIORI development, projects follow the name pattern
area.subarea.*

e.g. fin.ar.bankstatement.manage

Is it possible to soften this project name check ?

Thanks and Best Regards,
Stefan

App.controller.js has wrong namespace

Easy-Ui5 version:

3.5.0

Run yo easy-ui5 --plugins to print all relevant version strings

Node.js: v16.13.0
yeoman-environment: 3.10.0
generator-easy-ui5: 3.5.0
Available generators:

  • ui5-project: 0.2.0

OS/version:

Windows 10 Enterprise 21H2 19044.1826

Browser/version (+device/version):

Steps to reproduce the problem:

yo easy-ui5 project app

? How do you want to name this project? generatorBug
? Which namespace do you want to use? test
? Do you want to enable the SAP Fiori elements flexible programming model? No
? On which platform would you like to host the application? SAP Launchpad service
? Which view type do you want to use? XML
? Where should your UI5 libs be served from? Content delivery network (SAPUI5)
? Would you like to create a new directory for the project? No
? Would you like to add JavaScript code assist libraries to the project? No  
? Would you like to initialize a local git repository for the project? No
? What name should be displayed on the Fiori Launchpad tile? App1
  • after npm install finished, open uimodule\webapp\controller\App.controller.js
  • in line 9 the namespace contains controll.controller

What is the expected result?

return BaseController.extend("test.generatorBug.controller.App", {

What happens instead?

return BaseController.extend("test.generatorBug.controller.controller.App", {

Any other information? (attach screenshot if possible)

Remove JS View from template(s)

easy-ui5 version

easy-ui5 3.8.1

Steps to reproduce

yo easy-ui5 project

Observed behavior

Wizard asks for view type and gives as option: XML and JS

image

Expected result

Is it possible to remove the view type JS? Seems that from the other templates this view type is already removed (yo easy-ui5 -> app -> does not ask and uses XML). Giving the users the option to use JS as view type will make it hard to find examples in the UI5 SDK docu

"Therefore, we concentrate on XML views and only provide examples for XML views throughout this documentation."

Suggestion: Remove JS and HTML View Types

Easy-Ui5 version:

Node.js: v16.18.0
yeoman-environment: 3.13.0
generator-easy-ui5: 3.5.1
home: /Users/mobert/.nvm/versions/node/v16.18.0/lib/node_modules/generator-easy-ui5
pluginsHome: /Users/mobert/.nvm/versions/node/v16.18.0/lib/node_modules/generator-easy-ui5/plugin-generators

Available generators:

  • ui5-project: 0.3.1

OS/version:

Browser/version (+device/version):

Steps to reproduce the problem:

  1. Run easy-ui5 yo easy-ui5 project app
  2. See this prompt:

Screenshot 2023-01-17 at 15 06 18

  1. The doc no longer mentions JS and HTML views. So I'd suggest to remove this options from this generator as well.

Screenshot 2023-01-17 at 15 05 45

Tests `JS-Application Router @ Cloud Foundry` fails

Easy-Ui5 version:

I am not running a released easy-ui5 version but run the tests in the repo.

OS/version:

MacOs/12.3.1

Browser/version (+device/version):

n/a

Other versions

yarn: 1.22.17
node: 14.18.1

Steps to reproduce the problem:

  1. Clone the repository
  2. yarn
  3. yarn test test/basic.js --grep 'JS-Application Router @ Cloud Foundry'

What is the expected result?

A successful test run.

What happens instead?

should pass the OPA tests fails

Any other information? (attach screenshot if possible)

I also tried it with npm instead of yarn but ran into the same issue.

Basic project capabilities
    XML
      ✔ should create the necessary ui5 files
      ✔ should create an installable project (23610ms)
      ✔ should run lint-fix (1828ms)
      ✔ should pass the OPA tests (10375ms)
    JS-Application Router @ Cloud Foundry
      ✔ should create the necessary ui5 files
      ✔ should reference the base controller
      ✔ ui5.yaml middleware should point to the right xs-app.json file
      ✔ should create an installable project (31709ms)
      ✔ should run lint-fix (2451ms)
      1) should pass the OPA tests
      ✔ should create an buildable project (16399ms)
    JSON-Local resources (SAPUI5)
      ✔ should create the necessary ui5 files
      ✔ should reference the base controller
      ✔ should create an installable project (22355ms)
      ✔ should run lint-fix (2386ms)
      2) should pass the OPA tests
    JSON-Local resources (SAPUI5)-SAP NetWeaver
      ✔ should create the necessary ui5 files
      ✔ should reference the base controller
      ✔ should create an installable project (24628ms)
      ✔ should run lint-fix (2380ms)
      3) should pass the OPA tests
    HTML-Local resources (OpenUI5)-Application Router @ Cloud Foundry
      ✔ should create the necessary ui5 files
      ✔ should reference the base controller
      ✔ ui5.yaml middleware should point to the right xs-app.json file
      ✔ should create an installable project (33025ms)
      ✔ should run lint-fix (2555ms)
      4) should pass the OPA tests
      ✔ should create an buildable project (65394ms)
    JSON-SAP Launchpad service
      ✔ should create the necessary ui5 files
      ✔ should reference the base controller
      ✔ ui5.yaml middleware should point to the right xs-app.json file
      ✔ should create an installable project (33701ms)
      ✔ should run lint-fix (2408ms)
      5) should pass the OPA tests
      ✔ should create an buildable project (4361ms)
    XML-SAP HTML5 Application Repository service for SAP BTP
      ✔ should create the necessary ui5 files
      ✔ ui5.yaml middleware should point to the right xs-app.json file
      ✔ should create an installable project (32904ms)
      ✔ should run lint-fix (2405ms)
      ✔ should pass the OPA tests (14378ms)
      ✔ should create an buildable project (16607ms)
    XML-SAP NetWeaver
      ✔ should create the necessary ui5 files
      ✔ should create an installable project (25570ms)
      ✔ should run lint-fix (2246ms)
      ✔ should pass the OPA tests (12527ms)

Feature request: Add package.json for each application in the project

Easy-Ui5 version:

Run yo easy-ui5 --plugins to print all relevant version strings

generator-easy-ui5: 3.5.0

When I generate a project using generator-ui5-project, I get a file and folder structure like following

com.myorg.myUI5App
    ├── karma-ci.conf.js
    ├── karma.conf.js
    ├── node_modules
    ├── package-lock.json
    ├── package.json
    ├── readme.md
    ├── tsconfig.json
    └── uimodule
        ├── ui5-mock.yaml
        ├── ui5.yaml
        └── webapp

The actual UI5 application resides in uimodule, where the ui5.yaml config and webapp directory is. This project structure suggests, that there might be other apps in the same project. However, with multiple apps in the same project, the root package.json would be shared. This might lead to unwanted behavior as in some situations, different applications have different devDependencies, dependencies, or scripts. To overcome this inflexibility, I propose to slightly change the generated structure of projects to include a package.json for each application in the project. This would enable the flexibility we know from monorepos, common dependencies are hoisted to the root of the project, but we still have the flexibility to have dependencies per app.

We could also consider generating all apps into a new directory packages, which is commonly used for monorepos (but not necessarily required).

The resulting project structure could look like this


com.myorg.myUI5App
    ├── karma-ci.conf.js
    ├── karma.conf.js
    ├── node_modules (hoisted)
    ├── package-lock.json
    ├── package.json
    ├── readme.md
    ├── tsconfig.json
    └── packages
        ├── uimoduleA
        |   ├── node_modules (from ui module A)
        |   ├── package.json
        |   ├── ui5-mock.yaml
        |   ├── ui5.yaml
        |   └── webapp
        └── uimoduleB
            ├── node_modules (from ui module B)
            ├── package.json
            ├── ui5-mock.yaml
            ├── ui5.yaml
            └── webapp

As we from SAP Fiori tools organization receive requests to support monorepos, we could help in preparing the code for such a structure into generator-ui5-project

@tobiasqueck @petermuessig @nicogeburek @lboehm @vobu what do you think?

ajax and xhr are not available in

Easy-Ui5 version:

Run yo easy-ui5 --plugins to print all relevant version strings

Node.js: v14.19.3
yeoman-environment: 3.9.1
generator-easy-ui5: 3.3.0
home: C:\Develop\nodejs\node_global\node_modules\generator-easy-ui5
pluginsHome: C:\Develop\nodejs\node_global\node_modules\generator-easy-ui5\plugin-generators

Available generators:

  • generator-ui5-project: 0.2.1
  • generator-ui5-ts-app: 1.0.1

OS/version: win 10 21H2

Browser/version (+device/version): Microsoft Edge 107.0.1418.62 (Official build) (64-bit)

Steps to reproduce the problem:

  1. Step 1
    use yo easy-ui5 project to generate a ui5 project.
  2. Step 2
    Change MainView.controller.js
  3. Step 3
    add the following code in onInit funnction:
    let xhr = new XMLHttpRequest();

the error is "Cannot find name 'XMLHttpRequest'.ts(2304)"

$.ajax also can not be used .

What is the expected result?

In the generated project XHR and ajax can be used .

What happens instead?

Any other information? (attach screenshot if possible)

easy-ui5 is not using the BaseController

Hi,

easy-ui5 is generating a MainView.controller.js and a BaseController.js. But the BaseController.js is not used by the MainView.controller.js, so I have to change MainView.controller.js manually to make use of the BaseController.js.

Easy-Ui5 version:

C:\Users\A002220>yo easy-ui5 --plugins
Node.js: v14.16.1
home: C:\Users\*****\AppData\Roaming\npm\node_modules\generator-easy-ui5\
yeoman-environment: 3.8.1
generator-ui5-project: 0.1.0

OS/version:

Windows 10

Steps to reproduce the problem:

Generate a project like this:

? Select your generator? generator-ui5-project
? What do you want to do? Create a new OpenUI5/SAPUI5 project                          [app]
? How do you want to name this project? myUI5App
? Which namespace do you want to use? com.myorg
? On which platform would you like to host the application? SAP NetWeaver
? Which view type do you want to use? XML
? Where should your UI5 libs be served from? Content delivery network (SAPUI5)
? Would you like to create a new directory for the project? No
? Would you like to add JavaScript code assist libraries to the project? No

What is the expected result?

I would expect the MainView.controller.js to use the BaseController.js.

What happens instead?

Instead MainView.controller.js uses sap/ui/core/mvc/Controller:

sap.ui.define(
  ["sap/ui/core/mvc/Controller"],
  /**
   * @param {typeof sap.ui.core.mvc.Controller} Controller
   */
  function (Controller) {
    "use strict";

    return Controller.extend("com.myorg.myUI5App.controller.MainView", {
      onInit: function () {},
    });
  }
);

Thanks & Best regards,
Lukas

Deployed app is not visible in the html5-apps-repo

Easy-Ui5 version:

3.4.0

OS/version:

Windows 10

Browser/version (+device/version):

Not relevant

Steps to reproduce the problem:

  1. Generate a new project (using platform SAP HTML5 Application Repository service for SAP BTP )
  2. run command npm run deploy

What is the expected result?

The app should be visible in the BTP cockpit under HTML5 Applications

What happens instead?

A configuration error is shown:
- Destination [redacted] points to the html5-apps-repo instance [redacted], which does not contain any HTML5 applications. It could be that the HTML5 applications for the html5-apps-repo instance [redacted] were not uploaded correctly. You can try to redeploy the HTML5 applications.

Any other information? (attach screenshot if possible)

Please refer to this question, the last response resolve the issue.

Component is not loaded with newest version of @sap-ux/ui5-application-writer

Node.js: v16.9.1
yeoman-environment: 3.9.1
generator-easy-ui5: 3.2.2
The dependency "@sap-ux/fiori-freestyle-writer" uses "@sap-ux/ui5-application-writer": "0.11.2"

A recent commit in the open-ux-tools changed the template for the index.html we use in the newwebapp generator. As a result of this the component of the ui5 app is not loaded unless we specify loadReuseLibs: false when generating the app from the @sap-ux/fiori-freestyle-writer, at least with the current way we handle the whole localResources configuration. This is with version 0.11.2 of the @sap-ux/ui5-application-writer (I tested version 0.10.1 and that still worked fine). I will provide a PR for this in a minute.

Easy-UI5 doesn't generated an FlpSandbox since using new @sap/ux-ui5-tooling

Easy-Ui5 version:

Most recent aka 3.0.3

Steps to reproduce the problem:

Described here: https://answers.sap.com/questions/13530042/tutrial-creating-fiori-lauinchpad-app-error.html?childToView=13531170

What is the expected result?

The project should include a flpSandbox that displays the web app.

What happens instead?

The flpSandbox is not in the webapp folder but in webapp/test. But then when using this path, the app won't show properly.

Screenshot 2021-11-23 at 11 02 10

[error] No parser could be inferred for file

Easy-Ui5 version: 3.7.0

Run yo easy-ui5 --plugins to print all relevant version strings

OS/version: windows 11

Browser/version (+device/version):

Steps to reproduce the problem:

Step 1
Install NodeJS version 18
Step 2
npm install -g yo generator-easy-ui5
Step 3
execute yo easy-ui5 project

What is the expected result?

project creation

What happens instead?

[error] No parser could be inferred for file. such error occurs, even i have tried with many node version but still end up with same error.

Any other information? (attach screenshot if possible)

Screenshot 2023-12-06 110317

Do the views generated by easy-ui5 align with best practices?

Hi @IObert,

I've found something and I'm not sure if it's an error:

What happens

when using easy-ui5 to generate a new project it generates the following view:

<mvc:View
    controllerName="com.myorg.myUI5App.controller.MainView"
    xmlns:mvc="sap.ui.core.mvc"
    displayBlock="true"
    xmlns="sap.m"
>
    <Shell id="shell">
        <App id="app">
            <pages>
                <Page id="page" title="{i18n>title}">
                    <content />
                </Page>
            </pages>
        </App>
    </Shell>
</mvc:View>

When adding another view it generates basically the same again (except the shell):

 <mvc:View controllerName="com.myorg.myUI5App.controller.DetailView"
  displayBlock="true"
  xmlns="sap.m"
  xmlns:mvc="sap.ui.core.mvc">
  <App id="DetailView" >
    <pages>
      <Page title="{i18n>title}">
        <content></content>
      </Page>
    </pages>
  </App>
</mvc:View>

As a result my UI5 app has n <App>-tags when it has n views. I'm not sure, but this doesn't seem right.

What I would expect

From my understanding it would be better to generate one "container file" that holds the app:

// App.view.xml

<mvc:View controllerName="a41s.workbook.controller.App" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" displayBlock="true"
	xmlns="sap.m">
	<App id="app">
	</App>
</mvc:View>

And then, for each view generated a file like this one is generated:

<mvc:View 
	xmlns:uxap="sap.uxap" >
	<uxap:ObjectPageLayout>
	    // ...
	</uxap:ObjectPageLayout>
</mvc:View>

The rootView (in my example the App.view.xml) would be defined in the manifest.json:

    "sap.ui5": {
        "rootView": {
            "viewName": "myorg.myapp.App",
            "type": "XML"
        },

This approach is described here: Step 2: Enable Routing

Am I missing something? Are there reasons why easy-ui5 isn't following this approach?

Thank you and best regards,
Lukas

Generated FlpSandbox shows an empty page

Easy-Ui5 version:

3.3.0

OS/version:

Windows 10 (Node.js version 14.19.0 and 16.14.0)

Browser/version (+device/version):

Mozilla Firefox 97.0.1 (also MS Edge)

Steps to reproduce the problem:

Follow this tutorial

  1. Step 1
    run yo easy-ui5 project
  2. Step 2
    Select SAP Launchpad service as hosting platform
  3. Step 3
    run npm start

What is the expected result?

Flp should show up in browser, with the application tile

What happens instead?

An empty page is displayed

Any other information? (attach screenshot if possible)

Generated flpSandbox.html

<!DOCTYPE HTML>
<html>
<!-- Copyright (c) 2015 SAP AG, All Rights Reserved -->
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{appTitle}}</title>

    <!-- Bootstrap the unified shell in sandbox mode for standalone usage.

         The renderer is specified in the global Unified Shell configuration object "sap-ushell-config".

         The fiori2 renderer will render the shell header allowing, for instance,
         testing of additional application setting buttons.

         The navigation target resolution service is configured in a way that the empty URL hash is
         resolved to our own application.

         This example uses relative path references for the SAPUI5 resources and test-resources;
         it might be necessary to adapt them depending on the target runtime platform.
         The sandbox platform is restricted to development or demo use cases and must NOT be used
         for productive scenarios.
    -->
    <script type="text/javascript">
        window["sap-ushell-config"] = {
            defaultRenderer: "fiori2",
            bootstrapPlugins: {
                "RuntimeAuthoringPlugin": {
                    component: "sap.ushell.plugins.rta",
                    config: {
                        validateAppVersion: false
                    }
                }
            },
            renderers: {
                fiori2: {
                    componentData: {
                        config: {
                            search: "hidden"
                        }
                    }
                }
            },
            applications: {
                "comexamplenwProduct-tile": {
                    title: "Title of com.example.nwProduct",
                    description: "Description of com.example.nwProduct",
                    additionalInformation: "SAPUI5.Component=com.example.nwProduct",
                    applicationType: "URL",
                    url: "../"
                }
            }
        };
    </script>

    <script src="https://sapui5.hana.ondemand.com/test-resources/sap/ushell/bootstrap/sandbox.js" id="sap-ushell-bootstrap"></script>
    <!-- Bootstrap the UI5 core library -->
    <script id="sap-ui-bootstrap"
        src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
        data-sap-ui-libs="sap.m,sap.ui.core"
        data-sap-ui-async="true"
        data-sap-ui-preload="async"
        data-sap-ui-theme="sap_fiori_3"
        data-sap-ui-compatVersion="edge"
        data-sap-ui-language="en"
        data-sap-ui-resourceroots='{"com.example.nwProduct": "../"}'
        data-sap-ui-frameOptions="allow"> // NON-SECURE setting for testing environment
        </script>
</head>

<!-- UI Content -->

<body class="sapUiBody" id="content">
</body>

</html>

Console output:
immagine

Command-line arguments for all options

Love the application. Well done!
Is it possible for you to add command-line arguments for all options in the generator, so that I can run it without user interaction at all? This works for some, but all the options i think?

Thank you

Error with ui5-project generator

Easy-Ui5 version: 3.6.2

Run yo easy-ui5 --plugins to print all relevant version strings
Node.js: v16.20.0
yeoman-environment: 3.15.1
generator-easy-ui5: 3.2.0
home: /Users/finbarcallaghan/Projects/SAP/UI5/Yogenerated/node_modules/generator-easy-ui5
pluginsHome: /Users/finbarcallaghan/Projects/SAP/UI5/Yogenerated/node_modules/generator-easy-ui5/plugin-generators

Available generators:

  • generator-ui5-app: 1.1.0
  • generator-ui5-project: 0.3.1
  • generator-ui5-ts-app: 1.1.0

OS/version:

Mac OS Ventura 13.4.1

Browser/version (+device/version):

Chrome Version 115.0.5790.170

Steps to reproduce the problem:

  1. "yo easy-ui5 project"
  2. "app"
  3. Step 3

What is the expected result?

progresses to the new step

What happens instead?

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sap-ux/ui5-config' imported from /Users/finbarcallaghan/Projects/SAP/UI5/Yogenerated/node_modules/generator-easy-ui5/plugin-generators/generator-ui5-project/generators/enablefpm/index.js
at new NodeError (node:internal/errors:387:5)
at packageResolve (node:internal/modules/esm/resolve:852:9)
at moduleResolve (node:internal/modules/esm/resolve:901:20)
at defaultResolve (node:internal/modules/esm/resolve:1115:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap. (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36)
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sap-ux/ui5-config' imported from /Users/finbarcallaghan/Projects/SAP/UI5/Yogenerated/node_modules/generator-easy-ui5/plugin-generators/generator-ui5-project/generators/enablefpm/index.js
at new NodeError (node:internal/errors:387:5)
at packageResolve (node:internal/modules/esm/resolve:852:9)
at moduleResolve (node:internal/modules/esm/resolve:901:20)
at defaultResolve (node:internal/modules/esm/resolve:1115:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap. (node:internal/modules/esm/module_job:76:40)

Any other information? (attach screenshot if possible)

Hello,
I’m hoping you can help me with the following error, as you can see from below I’m running version 16.20 of node and yo doctor hasn’t picked up anything. It appears that the Project generator does not work, however the odd thing is that Typescript generator does works. In addition the Project generator did work for me back on June 30 from the perspective of version control!

image

With the following directory reference
image

The list of modules that are missing are listed as follows;
“@sap-ux/fe-fpm-writer” error
Within etc./generators/enablefpm/index.js & etc./generators/newfpmpage/index.js
“@sap-ux/ui5-application-writer” error
Within etc./generators/newwebapp/index.js
“object-assign-deep” error
Within etc./helpers/fileaccess.js
“valid-filename” error
image

“@sap-ux/ui5-config” & “@sap-ux/odata-service-writer”

My list of plugins are as follows
image

I did wonder is this anything to do with legacy generators, as I get the following error when doing a forceUpdate
image
When I list the additional modules I get the same error
image
Thanking you in advance,
Finbar

Allow usage of Promises when using code assist

Hi!

When generating a project with code assist, the following error is shown, when you're using promises:

any 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.ts(2585)

image

I think, it should be easily possible to use Promises, especially after IE11 support is dropped. To solve this issue the tsconfig.json has to be changed:

{
    "compilerOptions": {
        "module": "none",
        "noEmit": true,
        "checkJs": true,
        "allowJs": true,
        "types": ["@sapui5/ts-types"],
        "lib": ["es2015"]                    <<< new
    }
}

Important: The eslint.rc file should have the following config, otherwise we will receive another error:

image

{
    "env": {
        "es6": true
    },

This PR does not contain the necessary change in the eslint.rc, because this change comes with the PR #31.

So if you like you can wait with merging this one, until #31 is resolved. Or you merge this one now, because the devs will receive just a different error message than they currently do. So no big difference.

BR,
Lukas

Error when attempting to copy _.editorconfig

During project generation I am getting an error:
AssertionError [ERR_ASSERTION]: Trying to copy from a source that does not exist: D:\Users\<user>\AppData(Roaming)\npm\node_modules\generator-easy-ui5\plugin-generators\generator-ui5-project\generators\app\templates\_.editorconfig

I have confirmed that file is definitely there at this very location. Any idea what might cause this issue? I'm on my company's notebook which has a seperate admin user (that I'm not using for my daily activities) and all that. Could this be a problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.