Skip to content

Commit

Permalink
Update locate-reuse-lib.js ui5 linter issues (#2334)
Browse files Browse the repository at this point in the history
* Update locate-reuse-lib.js

* update snapshots

* Add linter to other modules

* further updates to support GTE and LT UI5 1.120.x

* Update FF with locate reuse libs

* fixes

* lint fixes

* Update logic on FF project checks

* fix

* fixes

* reformat projectChecks

* fix ui5 linter errors in locate-reuse-libs.js

* Create sixty-dolls-allow.md
  • Loading branch information
devinea authored Nov 5, 2024
1 parent 8bdd9ed commit b2de757
Show file tree
Hide file tree
Showing 14 changed files with 2,037 additions and 74 deletions.
6 changes: 6 additions & 0 deletions .changeset/sixty-dolls-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@sap-ux/fiori-freestyle-writer": patch
"@sap-ux/ui5-application-writer": patch
---

Fix @ui5/linter errors in locate-reuse-lib.js
56 changes: 29 additions & 27 deletions packages/fiori-elements-writer/test/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,37 +165,39 @@ export const projectChecks = async (
config: FioriElementsApp<unknown>,
debugFull = false
): Promise<void> => {
if (debugFull && (config.appOptions?.typescript ?? config.appOptions?.eslint)) {
// Do additonal checks on generated projects
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
let npmResult;
try {
// Do npm install
npmResult = await exec(`${npm} install`, { cwd: rootPath });
console.log('stdout:', npmResult.stdout);
console.log('stderr:', npmResult.stderr);

// run checks on the project
if (config.appOptions?.typescript && config.service?.type === ServiceType.EDMX) {
// Check TS Types
npmResult = await exec(`${npm} run ts-typecheck`, { cwd: rootPath });
// Do additional checks on generated projects
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
let npmResult;
try {
if (debugFull) {
if (config.appOptions?.typescript ?? config.appOptions?.eslint) {
// Do npm install
npmResult = await exec(`${npm} install`, { cwd: rootPath });
console.log('stdout:', npmResult.stdout);
console.log('stderr:', npmResult.stderr);

// run checks on the project
if (config.appOptions?.typescript && config.service?.type === ServiceType.EDMX) {
// Check TS Types
npmResult = await exec(`${npm} run ts-typecheck`, { cwd: rootPath });
console.log('stdout:', npmResult.stdout);
console.log('stderr:', npmResult.stderr);
// Check Eslint
npmResult = await exec(`${npm} run lint`, { cwd: rootPath });
console.log('stdout:', npmResult.stdout);
console.log('stderr:', npmResult.stderr);
}
// Check Eslint
npmResult = await exec(`${npm} run lint`, { cwd: rootPath });
console.log('stdout:', npmResult.stdout);
console.log('stderr:', npmResult.stderr);
}
// Check Eslint
if (config.appOptions?.eslint) {
npmResult = await exec(`${npm} run lint`, { cwd: rootPath });
console.log('stdout:', npmResult.stdout);
console.log('stderr:', npmResult.stderr);
if (config.appOptions?.eslint) {
npmResult = await exec(`${npm} run lint`, { cwd: rootPath });
console.log('stdout:', npmResult.stdout);
console.log('stderr:', npmResult.stderr);
}
}
} catch (error) {
console.log('stdout:', error?.stdout);
console.log('stderr:', error?.stderr);
expect(error).toBeUndefined();
}
} catch (error) {
console.log('stdout:', error?.stdout);
console.log('stderr:', error?.stderr);
expect(error).toBeUndefined();
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!DOCTYPE HTML>
<html lang="en">
<!-- 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",
enableSearch: false
}
}
}
},
applications: {
"<%- app.flpAppId %>": {
title: "<%- escapeFLPText(app.title) %>",
description: "<%- escapeFLPText(app.description) %>",
additionalInformation: "SAPUI5.Component=<%- app.id %>",
applicationType: "URL",
url: "../"
}
}
};
</script>

<script src="<%- locals.uShellBootstrapResourceUrl %>" id="sap-ushell-bootstrap"></script>
<!-- Bootstrap the UI5 core library. 'data-sap-ui-frameOptions="allow"'' is a NON-SECURE setting for test environments -->
<script id="sap-ui-bootstrap"
src="<%- locals.uiBootstrapResourceUrl %>"
data-sap-ui-libs="<%- ui5.ui5Libs %>"
data-sap-ui-async="true"
data-sap-ui-preload="async"
data-sap-ui-theme="<%- ui5.ui5Theme %>"
data-sap-ui-compatVersion="edge"
data-sap-ui-language="en"
data-sap-ui-resourceroots='{"<%- app.id %>": "../"}'
data-sap-ui-frameOptions="allow"
data-sap-ui-flexibilityServices='[{"connector": "LocalStorageConnector"}]'>
</script><% if (appOptions.loadReuseLibs) { %>
<script id="locate-reuse-libs" src="./locate-reuse-libs.js" data-sap-ui-manifest-uri="../manifest.json">
</script><% } else { %>
<script>
sap.ui.getCore().attachInit(function () {
sap.ushell.Container.createRenderer().placeAt("content");
});
</script><% } %>
</head>

<!-- UI Content -->

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

</html>
Loading

0 comments on commit b2de757

Please sign in to comment.