cds-plugin-ui5 0.2.0 → 0.2.1

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,17 @@
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.2.1](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/cds-plugin-ui5@0.2.0...cds-plugin-ui5@0.2.1) (2023-08-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **cds-plugin-ui5:** delay server start until bootstrap is completed ([#783](https://github.com/ui5-community/ui5-ecosystem-showcase/issues/783)) ([88380ba](https://github.com/ui5-community/ui5-ecosystem-showcase/commit/88380ba91ff9d4539a746edf7dc36f3bd4228137))
12
+
13
+
14
+
15
+
16
+
6
17
  # [0.2.0](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/cds-plugin-ui5@0.1.7...cds-plugin-ui5@0.2.0) (2023-07-31)
7
18
 
8
19
 
package/cds-plugin.js CHANGED
@@ -10,6 +10,23 @@ const applyUI5Middleware = require("./lib/applyUI5Middleware");
10
10
  // to disable the ui5-middleware-cap if used in apps
11
11
  process.env["cds-plugin-ui5"] = true;
12
12
 
13
+ // promise to await the bootstrap and lock the
14
+ // served event to delay the startup a bit
15
+ let bootstrapped;
16
+ const bootstrapCompleted = new Promise((r) => {
17
+ bootstrapped = r;
18
+ });
19
+
20
+ // hook into the "served" event to delay the startup of the
21
+ // CDS server until the bootstrap is completed and the UI5
22
+ // middlewares for the UI5 applications are properly available
23
+ cds.on("served", async function served(/* cdsServices */) {
24
+ log.debug("served");
25
+ await bootstrapCompleted;
26
+ });
27
+
28
+ // hook into the "bootstrap" event to startup the UI5 middlewares
29
+ // for the available UI5 applications in the CDS server and its deps
13
30
  cds.on("bootstrap", async function bootstrap(app) {
14
31
  log.debug("bootstrap");
15
32
 
@@ -115,6 +132,8 @@ cds.on("bootstrap", async function bootstrap(app) {
115
132
  log.error(`Failed to inject application pages to CAP overview page! You need to manually open the application pages!`);
116
133
  }
117
134
  }
135
+ // bootstrap completed, unlock the "served" event
136
+ bootstrapped();
118
137
  });
119
138
 
120
139
  // return callback for plugin activation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cds-plugin-ui5",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A CAP server cds-plugin to inject the middlewares of all related UI5 tooling based projects.",
5
5
  "author": "Peter Muessig",
6
6
  "license": "Apache-2.0",
@@ -24,5 +24,5 @@
24
24
  "@sap/cds": ">=6.8.2",
25
25
  "express": ">=4.18.2"
26
26
  },
27
- "gitHead": "c6e94b130e72603fc05d70bcaf982bd681b72604"
27
+ "gitHead": "648744879c475e77319f84dfe8f14509bdd4a667"
28
28
  }