Skip to content

fix: namespace used as package name und project name in ui5.yaml #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ export default class extends Generator {
this.config.set("tstypesVersion", props.frameworkVersion);

// appId + appURI
this.config.set("appId", `${props.namespace}`);
this.config.set("appURI", `${props.namespace.split(".").join("/")}`);
const parts = props.namespace.split(".");
this.config.set("appId", parts[parts.length - 1]);
this.config.set("appURI", parts.join("/"));

// CDN domain
this.config.set("cdnDomain", fwkCDNDomain[props.framework]);
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "<%= namespace %>",
"name": "<%= appId %>",
"version": "1.0.0",
"description": "UI5 Application: <%= namespace %>",
"author": "<%= author %>",
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/webapp/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Device from "sap/ui/Device";<% } else { %>
import * as Device from "sap/ui/Device"; // for UI5 >= 1.115.0 use: import Device from "sap/ui/Device";<% } %>

/**
* @namespace <%= appId %>
* @namespace <%= namespace %>
*/
export default class Component extends UIComponent {
public static metadata = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BaseController from "./BaseController";

/**
* @namespace <%= appId %>.controller
* @namespace <%= namespace %>.controller
*/
export default class App extends BaseController {
public onInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Router from "sap/ui/core/routing/Router";
import History from "sap/ui/core/routing/History";

/**
* @namespace <%= appId %>.controller
* @namespace <%= namespace %>.controller
*/
export default abstract class BaseController extends Controller {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import MessageBox from "sap/m/MessageBox";
import BaseController from "./BaseController";

/**
* @namespace <%= appId %>.controller
* @namespace <%= namespace %>.controller
*/
export default class Main extends BaseController {
public sayHello(): void {
Expand Down
4 changes: 2 additions & 2 deletions generators/app/templates/webapp/index-cdn.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
id="sap-ui-bootstrap"
src="https://<%= cdnDomain %>/<%= frameworkVersion %>/resources/sap-ui-core.js"
data-sap-ui-resource-roots='{
"<%= appId %>": "./"
"<%= namespace %>": "./"
}'
data-sap-ui-theme="<%= defaultTheme %>"
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
Expand All @@ -26,6 +26,6 @@
</head>

<body class="sapUiBody">
<div data-sap-ui-component data-name="<%= appId %>"></div>
<div data-sap-ui-component data-name="<%= namespace %>"></div>
</body>
</html>
4 changes: 2 additions & 2 deletions generators/app/templates/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
id="sap-ui-bootstrap"
src="resources/sap-ui-core.js"
data-sap-ui-resource-roots='{
"<%= appId %>": "./"
"<%= namespace %>": "./"
}'
data-sap-ui-theme="<%= defaultTheme %>"
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
Expand All @@ -25,6 +25,6 @@
</head>

<body class="sapUiBody">
<div data-sap-ui-component data-name="<%= appId %>"></div>
<div data-sap-ui-component data-name="<%= namespace %>"></div>
</body>
</html>
6 changes: 3 additions & 3 deletions generators/app/templates/webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

"sap.ui5": {
"rootView": {
"viewName": "<%= appId %>.view.App",
"viewName": "<%= namespace %>.view.App",
"type": "XML",
"async": true,
"id": "app"
Expand All @@ -49,7 +49,7 @@
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "<%= appId %>.i18n.i18n"
"bundleName": "<%= namespace %>.i18n.i18n"
}
}
},
Expand All @@ -58,7 +58,7 @@
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"viewPath": "<%= appId %>.view",
"viewPath": "<%= namespace %>.view",
"controlId": "app",
"controlAggregation": "pages",
"async": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ opaTest("Should open the Hello dialog", function () {
// Arrangements
onTheMainPage.iStartMyUIComponent({
componentConfig: {
name: "<%= appId %>"
name: "<%= namespace %>"
}
});

Expand All @@ -33,7 +33,7 @@ opaTest("Should close the Hello dialog", function () {
// Arrangements
onTheMainPage.iStartMyUIComponent({
componentConfig: {
name: "<%= appId %>"
name: "<%= namespace %>"
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
src="../../resources/sap-ui-core.js"
data-sap-ui-theme="<%= defaultTheme %>"
data-sap-ui-resource-roots='{
"<%= appId %>": "../../",
"<%= namespace %>": "../../",
"integration": "."
}'
data-sap-ui-animation="false"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Opa5 from "sap/ui/test/Opa5";
import Press from "sap/ui/test/actions/Press";

const viewName = "<%= appId %>.view.Main";
const viewName = "<%= namespace %>.view.Main";

export default class MainPage extends Opa5 {
// Actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
id="sap-ui-bootstrap"
src="../../resources/sap-ui-core.js"
data-sap-ui-resource-roots='{
"<%= appId %>": "../../",
"<%= namespace %>": "../../",
"unit": "."
}'
data-sap-ui-compat-version="edge"
Expand Down
4 changes: 2 additions & 2 deletions generators/app/templates/webapp/view/App.view.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<mvc:View
controllerName="<%= appId %>.controller.App"
controllerName="<%= namespace %>.controller.App"
displayBlock="true"
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc">

<App id="app" />

</mvc:View>
</mvc:View>
2 changes: 1 addition & 1 deletion generators/app/templates/webapp/view/Main.view.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<mvc:View
controllerName="<%= appId %>.controller.Main"
controllerName="<%= namespace %>.controller.Main"
displayBlock="true"
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc"
Expand Down