Skip to content
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

Update locate-reuse-lib.js ui5 linter issues #2334

Merged
merged 20 commits into from
Nov 5, 2024
Merged
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
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
Loading