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

feat: update dependencies and improved v4 compatibility #1070

Merged
merged 1 commit into from
Sep 6, 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
21 changes: 0 additions & 21 deletions .eslintignore

This file was deleted.

22 changes: 0 additions & 22 deletions .eslintrc.json

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,7 @@ dist
.vscode/settings.json

# local workspace configs
ui5-workspace.yaml
ui5-workspace.yaml

# local markdown files
TODO.md
4 changes: 2 additions & 2 deletions .ncurc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"reject": [
"pnpm",
"@sap/cds",
"chart.js",
"@octokit/core",
Expand All @@ -11,7 +12,6 @@
"@wdio/spec-reporter",
"wdio-ui5-service",
"eslint-plugin-wdio",
"@prettier/plugin-xml",
"prettier"
"http-proxy-middleware"
]
}
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
return packageName != "prettier" && packageName.includes("prettier");
})
.flatMap((packageName) => {
return [require(packageName)];
return [require.resolve(packageName)];
}),
singleQuote: false,
printWidth: 200,
Expand Down
40 changes: 40 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import globals from "globals";
import js from "@eslint/js";
import jsdoc from "eslint-plugin-jsdoc";

export default [
js.configs.recommended,
jsdoc.configs["flat/recommended"],
{
languageOptions: {
globals: {
...globals.browser,
...globals.commonjs,
...globals.node,
yo: "writable",
confirm: "writable",
map: "writable",
input: "writable",
sap: "readonly",
},
ecmaVersion: 2023,
sourceType: "script",
},
rules: {
"no-mixed-spaces-and-tabs": "warn",
"jsdoc/tag-lines": "off",
},
},
{
ignores: [
// ignore files for the following packages reusing this config
"/packages/ui5-middleware-approuter/test/*/**",
"/packages/ui5-tooling-modules/test/*/**",

// config files
"eslint.config.js",
"eslint.config.mjs",
"karma*.conf.js",
],
},
];
3 changes: 0 additions & 3 deletions jsconfig.json

This file was deleted.

21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,21 @@
"ncu": "ncu -ws --root"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@prettier/plugin-xml": "^2.2.0",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@prettier/plugin-xml": "^3.4.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.57.0",
"eslint-plugin-jsdoc": "^48.8.3",
"husky": "^9.1.1",
"lerna": "^8.1.7",
"lint-staged": "^15.2.7",
"eslint": "^9.9.1",
"eslint-plugin-jsdoc": "^50.2.2",
"globals": "^15.9.0",
"husky": "^9.1.5",
"lerna": "^8.1.8",
"lint-staged": "^15.2.10",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"prettier": "^3.3.3",
"prettier-plugin-properties": "^0.3.0",
"pretty-quick": "^4.0.0",
"wait-on": "^7.2.0"
"wait-on": "^8.0.0"
},
"pnpm": {
"overrides": {
Expand Down
3 changes: 3 additions & 0 deletions packages/cds-plugin-ui5/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"**/*.js": "eslint"
}
6 changes: 3 additions & 3 deletions packages/cds-plugin-ui5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"directory": "packages/cds-plugin-ui5"
},
"dependencies": {
"@ui5/fs": "^4.0.0",
"@ui5/project": "^4.0.2",
"@ui5/server": "^4.0.3",
"@ui5/fs": "^4",
"@ui5/project": "^4",
"@ui5/server": "^4",
"js-yaml": "^4.1.0",
"node-html-parser": "^6.1.13",
"semver": "^7.6.3"
Expand Down
3 changes: 3 additions & 0 deletions packages/dev-approuter/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"lib/**/*.js": "eslint"
}
4 changes: 2 additions & 2 deletions packages/dev-approuter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"directory": "packages/dev-approuter"
},
"dependencies": {
"@sap/approuter": ">=16.6.0",
"@sap/xsenv": "5.1.0",
"@sap/approuter": ">=16.7.1",
"@sap/xsenv": "5.2.0",
"cds-plugin-ui5": "workspace:^",
"express": "^4.19.2",
"ui5-middleware-cap": "workspace:^"
Expand Down
3 changes: 3 additions & 0 deletions packages/karma-ui5-transpile/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"lib/**/*.js": "eslint"
}
4 changes: 2 additions & 2 deletions packages/karma-ui5-transpile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
"sapui5"
],
"dependencies": {
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-istanbul": "^7.0.0",
"js-yaml": "^4.1.0"
},
"devDependencies": {
"karma": "^6.4.3",
"karma": "^6.4.4",
"ui5-tooling-transpile": "workspace:^"
},
"peerDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions packages/ui5-middleware-approuter/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"lib/**/*.js": "eslint",
"test/*.js": "eslint"
}
8 changes: 4 additions & 4 deletions packages/ui5-middleware-approuter/lib/middleware.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* global globalThis */

const fs = require("fs")
const path = require("path")

Expand Down Expand Up @@ -93,6 +91,7 @@ module.exports = async ({ log, options, middlewareUtil }) => {
let destinations
try {
destinations = JSON.parse(process.env.destinations)
// eslint-disable-next-line no-unused-vars
} catch (ex) {
// no destinations from environment => let's check the effectiveOptions
}
Expand Down Expand Up @@ -167,7 +166,7 @@ module.exports = async ({ log, options, middlewareUtil }) => {
`adding cf-like destination "${
route.destination || "(xs-app.json specific setting)"
}" proxying reqs to ${route.source}`
)
)
: null
}
})
Expand Down Expand Up @@ -210,6 +209,7 @@ module.exports = async ({ log, options, middlewareUtil }) => {
)
})
return extensionModule
// eslint-disable-next-line no-unused-vars
} catch (ex) {
log.warn(
`⚠️ Failed to resolve extension "${JSON.stringify(extension)}"! The extension will be ignored...`
Expand Down Expand Up @@ -381,6 +381,6 @@ module.exports = async ({ log, options, middlewareUtil }) => {
})
},
proxyMiddleware
)
)
: proxyMiddleware
}
14 changes: 7 additions & 7 deletions packages/ui5-middleware-approuter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"timeout": "20s"
},
"dependencies": {
"@sap/approuter": "^16.6.0",
"@sap/approuter": "^16.7.1",
"content-type": "^1.0.5",
"dotenv": "^16.4.5",
"http-proxy-middleware": "^2.0.6",
Expand All @@ -32,16 +32,16 @@
"ui5-utils-express": "workspace:^"
},
"devDependencies": {
"@ui5/cli": "^3.11.0",
"@ui5/project": "^3.9.2",
"@ui5/server": "^3.2.1",
"@ui5/cli": "^3",
"@ui5/project": "^3",
"@ui5/server": "^3",
"ava": "^6.1.3",
"envfile": "7.1.0",
"get-port": "^7.1.0",
"nock": "^13.5.4",
"replace-in-file": "^7.1.0",
"nock": "^13.5.5",
"replace-in-file": "^8.1.0",
"supertest": "^7.0.0",
"ui5-middleware-websocket": "workspace:^",
"wait-on": "^7.2.0"
"wait-on": "^8.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/ui5-middleware-approuter/test/_fs_app_util.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { mkdir, cp, rmdir, symlink } = require("fs").promises
const { mkdir, cp, symlink } = require("fs").promises
const path = require("path")

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/ui5-middleware-approuter/test/_prep_server_util.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const { cp } = require("fs").promises
const path = require("path")
const replace = require("replace-in-file")

/**
* @typedef UI5ServerConfig
Expand All @@ -23,9 +22,10 @@ const replace = require("replace-in-file")
* @returns {UI5ServerConfig} full path to the test fixtures of ui5.yaml, xsapp.json and defaultEnv.json (the latter is an empty object if not provided as an input parameter)
*/
async function prepUI5ServerConfig({ ui5Yaml, appRouterPort, xsAppJson, defaultEnvJson, tmpDir }) {
const { replaceInFile } = await import("replace-in-file")
// replace default port 1091 for app router w/ random port
await cp(path.resolve(ui5Yaml), `${tmpDir}/ui5.yaml`) // copy orig ui5.yaml test fixture
const _ui5Yaml = await replace({ files: path.resolve(`${tmpDir}/ui5.yaml`), from: "1091", to: appRouterPort }) // replace port config in file
const _ui5Yaml = await replaceInFile({ files: path.resolve(`${tmpDir}/ui5.yaml`), from: "1091", to: appRouterPort }) // replace port config in file
const ui5 = { yaml: _ui5Yaml[0].file }

const _xsapp = { json: path.resolve(xsAppJson) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
type: application
framework:
name: OpenUI5
version: "1.126.0"
version: "1.127.0"
libraries:
- name: sap.m
- name: sap.ui.core
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
type: application
framework:
name: OpenUI5
version: "1.126.0"
version: "1.127.0"
libraries:
- name: sap.m
- name: sap.ui.core
Expand Down
4 changes: 2 additions & 2 deletions packages/ui5-middleware-approuter/test/boot.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const crypto = require("crypto")
const { randomBytes } = require("crypto")
const fs = require("fs-extra")
const nock = require("nock")
const path = require("path")
Expand All @@ -12,7 +12,7 @@ const prepUI5ServerConfig = require("./_prep_server_util")

test.beforeEach(async (t) => {
// copy ui5 app to a temp dir in test folder scope
t.context.tmpDir = path.resolve(`./test/_ui5-app/${crypto.randomBytes(5).toString("hex")}`)
t.context.tmpDir = path.resolve(`./test/_ui5-app/${randomBytes(5).toString("hex")}`)
await copyUI5app(t.context.tmpDir)

// dynamic port allocation for ui5 serve
Expand Down
8 changes: 3 additions & 5 deletions packages/ui5-middleware-approuter/test/crud.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const crypto = require("crypto")
const { randomBytes } = require("crypto")
const fs = require("fs-extra")
const nock = require("nock")
const path = require("path")
const replace = require("replace-in-file")
const request = require("supertest")
const { spawn } = require("child_process")
const test = require("ava")
Expand All @@ -13,7 +11,7 @@ const prepUI5ServerConfig = require("./_prep_server_util")

test.beforeEach(async (t) => {
// copy ui5 app to a temp dir in test folder scope
t.context.tmpDir = path.resolve(`./test/_ui5-app/${crypto.randomBytes(5).toString("hex")}`)
t.context.tmpDir = path.resolve(`./test/_ui5-app/${randomBytes(5).toString("hex")}`)
await copyUI5app(t.context.tmpDir)

// dynamic port allocation for ui5 serve
Expand Down Expand Up @@ -66,7 +64,7 @@ test("crud commands (GET, POST, PUT, DELETE)", async (t) => {
t.true(respGET.body.value.length > 0, "Entries found")

// create new person
const user = `pimue${crypto.randomBytes(5).toString("hex")}`
const user = `pimue${randomBytes(5).toString("hex")}`
const respPOST = await app
.post("/backend/People")
.send({
Expand Down
2 changes: 1 addition & 1 deletion packages/ui5-middleware-approuter/test/crud/ui5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
type: application
framework:
name: OpenUI5
version: "1.126.0"
version: "1.127.0"
libraries:
- name: sap.m
- name: sap.ui.core
Expand Down
Loading
Loading