-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: update ui5 cli, add ui5 stringreplacer * feat: first version string replacer * feat: replace ui5stringreplacer with custom * feat: add test sample app * chore: update workflow * chore: update workflow run headless * chore: update lockfiles * chore: update lockfiles * chore: update lockfiles * fix: update consuming and tests * chore: update package.json script * chore: update replace string * chore: update npm versioning * fix: replace string * docs: update * chore: remove license from example
- Loading branch information
Showing
95 changed files
with
45,816 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# Exclude folders | ||
node_modules | ||
dist | ||
webapp | ||
examples | ||
|
||
# Include all JS files | ||
!*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules | ||
dist | ||
/webapp/ | ||
|
||
.vscode | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* eslint-disable no-undef */ | ||
const replace = require("replace-in-file"); | ||
const fs = require("fs"); | ||
|
||
// copy result to webapp folder | ||
if (!fs.existsSync("webapp")) { | ||
fs.mkdirSync("webapp"); | ||
} | ||
|
||
function copyDirectorySync(src, dest) { | ||
const files = fs.readdirSync(src); | ||
|
||
for (const file of files) { | ||
const srcPath = `${src}/${file}`; | ||
const destPath = `${dest}/${file}`; | ||
|
||
if (fs.statSync(srcPath).isFile()) { | ||
fs.copyFileSync(srcPath, destPath); | ||
} else if (fs.statSync(srcPath).isDirectory()) { | ||
fs.mkdirSync(destPath, { recursive: true }); | ||
copyDirectorySync(srcPath, destPath); | ||
} | ||
} | ||
} | ||
|
||
copyDirectorySync("src", "webapp"); | ||
|
||
// Read the contents of the package.json file | ||
const packageJson = fs.readFileSync("package.json", "utf8"); | ||
|
||
// Parse the JSON content | ||
const packageData = JSON.parse(packageJson); | ||
|
||
// Get the version from the parsed data | ||
const version = `v${packageData.version}`; | ||
const versionSlash = version.replaceAll(".", "/"); | ||
|
||
// replace strings in publish folder | ||
const options = { | ||
files: ["**/webapp/**"], | ||
from: [/XXXnamespaceXXX/g, /XXXnamespaceSlashXXX/g], | ||
to: [version, versionSlash], | ||
}; | ||
replace.sync(options); | ||
|
||
fs.copyFileSync("ui5-publish.yaml", "ui5.yaml"); | ||
|
||
const optionsYaml = { | ||
files: ["**/ui5.yaml"], | ||
from: [/XXXnamespaceSlashXXX/g], | ||
to: [versionSlash], | ||
}; | ||
replace.sync(optionsYaml); | ||
|
||
// Read the contents of the package.json file | ||
const manifestV4 = fs.readFileSync("examples/packages/orders/webapp/manifest.json", "utf8"); | ||
// Parse the JSON content | ||
let manifestV4Data = JSON.parse(manifestV4); | ||
// Read the contents of the package.json file | ||
const manifestV2 = fs.readFileSync("examples/packages/ordersv2/webapp/manifest.json", "utf8"); | ||
// Parse the JSON content | ||
let manifestV2Data = JSON.parse(manifestV2); | ||
|
||
manifestV4Data["sap.ui5"].resourceRoots["cc.excelUpload"] = `./thirdparty/customControl/excelUpload/${versionSlash}`; | ||
manifestV2Data["sap.ui5"].resourceRoots["cc.excelUpload"] = `./thirdparty/customControl/excelUpload/${versionSlash}`; | ||
|
||
manifestV4Data = JSON.stringify(manifestV4Data, null, 2); | ||
manifestV2Data = JSON.stringify(manifestV2Data, null, 2); | ||
|
||
fs.writeFileSync("examples/packages/orders/webapp/manifest.json", manifestV4Data, "utf8"); | ||
fs.writeFileSync("examples/packages/ordersv2/webapp/manifest.json", manifestV2Data, "utf8"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
# Change these settings to your own preference | ||
indent_style = tab | ||
|
||
[*.{yaml,yml,md,json,xml,properties}] | ||
indent_size = 2 | ||
indent_style = space | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# node_modules | ||
node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# build results | ||
|
||
dist | ||
src-gen | ||
test-gen | ||
|
||
# server db | ||
server/db.json | ||
|
||
# Mac files | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Enable Pre/Post Scripts for PNPM | ||
enable-pre-post-scripts=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lts/gallium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Ignore files | ||
pnpm-lock.yaml | ||
package-lock.json | ||
.yo-rc.json | ||
|
||
# Ignore build output folders | ||
/packages/*/dist/** | ||
/packages/*/webapp/** | ||
/packages/*/*-gen/** | ||
|
||
# Ignore files by extension | ||
/**/*.svg | ||
/**/*.png | ||
/**/*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
// Make Prettier work with PNPM using JS config and require plugins | ||
// https://github.com/pnpm/pnpm/issues/3641 | ||
plugins: Object.keys(require("./package").devDependencies) | ||
.filter((packageName) => { | ||
return packageName != "prettier" && packageName.includes("prettier"); | ||
}) | ||
.flatMap((packageName) => { | ||
return [require(packageName)]; | ||
}), | ||
singleQuote: false, | ||
printWidth: 200, | ||
endOfLine: "lf", | ||
trailingComma: "none", | ||
tabWidth: 4, | ||
useTabs: true, | ||
overrides: [ | ||
{ | ||
files: ["*.yaml", "*.yml", "*.md", "*.json", "*.xml", "*.properties"], | ||
options: { | ||
useTabs: false, | ||
tabWidth: 2, | ||
keySeparator: "=", | ||
xmlWhitespaceSensitivity: "ignore" | ||
} | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Sample Setup for `ui5-cc-excelupload` | ||
|
||
## Description | ||
|
||
This setup is a sample the ui5 module `ui5-cc-excelupload`. | ||
Template was is the [ui5-community/hacking-away-sampleapp](https://github.com/ui5-community/hacking-away-sampleapp). | ||
|
||
## Project setup | ||
|
||
Currently there is one CAP App to serve the ODataV2 and ODataV4 Service at `/packages/server`. | ||
The template for this Service was the sample at the [SAP-samples/cloud-cap-samples](https://github.com/SAP-samples/cloud-cap-samples/tree/main/orders) repo. | ||
|
||
Two Fiori Element App consuming the services: `/packages/orders` (OData V4) and `/packages/ordersV2` (OData V2). | ||
These Apps are generated with Fiori Tools. | ||
|
||
## Requirements | ||
|
||
[pnpm](https://pnpm.io/) for dependency management. | ||
|
||
## Preparation | ||
|
||
Use `pnpm` to install the dependencies: | ||
|
||
```sh | ||
pnpm i | ||
``` | ||
|
||
## Run the App | ||
|
||
|
||
Execute the following command to run the app locally for development in watch mode (the browser reloads the app automatically when there are changes in the source code): | ||
|
||
```sh | ||
npm start | ||
``` | ||
|
||
|
||
## License | ||
|
||
This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the [LICENSE](LICENSE) file. |
Oops, something went wrong.