dev-approuter 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.5.2](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/dev-approuter@0.5.1...dev-approuter@0.5.2) (2025-05-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **dev-approuter:** switch to custom logger to avoid loading cds.env … ([#1211](https://github.com/ui5-community/ui5-ecosystem-showcase/issues/1211)) ([9327c0a](https://github.com/ui5-community/ui5-ecosystem-showcase/commit/9327c0a8b968ac5652e0f83b8a156c8fd04e0905))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.5.1](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/dev-approuter@0.5.0...dev-approuter@0.5.1) (2025-03-19)
18
+
19
+ **Note:** Version bump only for package dev-approuter
20
+
21
+
22
+
23
+
24
+
6
25
  # [0.5.0](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/dev-approuter@0.4.0...dev-approuter@0.5.0) (2025-02-06)
7
26
 
8
27
 
@@ -2,15 +2,13 @@ const approuter = require("@sap/approuter");
2
2
  const express = require("express");
3
3
  const xsenv = require("@sap/xsenv");
4
4
 
5
- const LOG = require("@sap/cds").log("dev-approuter") || console;
6
-
7
5
  const findUI5Modules = require("cds-plugin-ui5/lib/findUI5Modules");
8
6
  const createPatchedRouter = require("cds-plugin-ui5/lib/createPatchedRouter");
9
7
  const applyUI5Middleware = require("cds-plugin-ui5/lib/applyUI5Middleware");
10
8
  const findCDSModules = require("ui5-middleware-cap/lib/findCDSModules");
11
9
  const applyCDSMiddleware = require("ui5-middleware-cap/lib/applyCDSMiddleware");
12
10
 
13
- const { parseConfig, applyDependencyConfig, addDestination, configureCDSRoute, configureUI5Route } = require("./helpers");
11
+ const { LOG, parseConfig, applyDependencyConfig, addDestination, configureCDSRoute, configureUI5Route } = require("./helpers");
14
12
 
15
13
  // marker that the dev-approuter is running
16
14
  process.env["dev-approuter"] = true;
@@ -164,8 +162,8 @@ class DevApprouter {
164
162
  // this endpoint helps to debug auth(n,z) issues
165
163
  // DANGER, WILL SMITH: you must not use this in production envs!
166
164
  _approuter.beforeRequestHandler.use("/my-jwt", (req, res) => {
167
- res.end(req.session?.user?.token?.accessToken || "none")
168
- })
165
+ res.end(req.session?.user?.token?.accessToken || "none");
166
+ });
169
167
  _approuter.start({
170
168
  port: arPort,
171
169
  xsappConfig: applyDependencyConfig(config),
package/lib/helpers.js CHANGED
@@ -1,7 +1,16 @@
1
1
  const path = require("path");
2
2
  const fs = require("fs");
3
3
 
4
- const LOG = require("@sap/cds").log("dev-approuter") || console;
4
+ /**
5
+ * Custom logger for the dev-approuter.
6
+ * Prefixes all logs with "[dev-approuter] - ", similar to what the CDS logger does.
7
+ * The reason not to use the CDS logger directly is to avoid loading the cds.env too early, before the cds.root is properly detected.
8
+ */
9
+ const LOG = {
10
+ info: (...args) => {
11
+ console.log("[dev-approuter] -", ...args);
12
+ },
13
+ };
5
14
 
6
15
  /**
7
16
  * Parses the approuter configuration from an `xs-dev.json` file.
@@ -133,6 +142,7 @@ const configureUI5Route = (moduleId, sourcePath, route) => {
133
142
  };
134
143
 
135
144
  module.exports = {
145
+ LOG,
136
146
  parseConfig,
137
147
  applyDependencyConfig,
138
148
  addDestination,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-approuter",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "A dev time wrapper for the SAP Application Router that can serve UI5 and CDS modules added as dependencies.",
5
5
  "author": "Nico Schoenteich <nicolai.schoenteich@sap.com> (https://github.com/nicoschoenteich)",
6
6
  "license": "Apache-2.0",
@@ -11,19 +11,11 @@
11
11
  "directory": "packages/dev-approuter"
12
12
  },
13
13
  "dependencies": {
14
- "@sap/approuter": ">=19.0.0",
15
- "@sap/xsenv": "5.4.0",
14
+ "@sap/approuter": ">=19.0.4",
15
+ "@sap/xsenv": "5.5.0",
16
16
  "cds-plugin-ui5": "^0.12.0",
17
17
  "express": "^4.21.2",
18
18
  "ui5-middleware-cap": "^3.3.0"
19
19
  },
20
- "peerDependencies": {
21
- "@sap/cds": "*"
22
- },
23
- "peerDependenciesMeta": {
24
- "@sap/cds": {
25
- "optional": true
26
- }
27
- },
28
- "gitHead": "ce6bb3836d24a9318fe1c9fb394fb609195607ae"
20
+ "gitHead": "4e8f6476b4052d5ac409c7c863c229a2303362f1"
29
21
  }