@ui5/server 3.0.0-rc.2 → 3.0.0

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
@@ -2,20 +2,24 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
4
4
 
5
- A list of unreleased changes can be found [here](https://github.com/SAP/ui5-server/compare/v3.0.0-rc.2...HEAD).
5
+ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-server/compare/v3.0.0...HEAD).
6
6
 
7
- <a name="v3.0.0-rc.2"></a>
8
- ## [v3.0.0-rc.2] - 2023-01-24
9
-
10
- <a name="v3.0.0-rc.1"></a>
11
- ## [v3.0.0-rc.1] - 2023-01-23
12
-
13
- <a name="v3.0.0-rc.0"></a>
14
- ## [v3.0.0-rc.0] - 2022-12-23
7
+ <a name="v3.0.0"></a>
8
+ ## [v3.0.0] - 2023-02-09
15
9
  ### Breaking Changes
10
+ - Transform to ES Modules ([#501](https://github.com/SAP/ui5-server/issues/501)) [`05e3013`](https://github.com/SAP/ui5-server/commit/05e3013605e28e9ab5a785aa57616473d40e5710)
16
11
  - Remove "/proxy" endpoint ([#550](https://github.com/SAP/ui5-server/issues/550)) [`4bdf839`](https://github.com/SAP/ui5-server/commit/4bdf839e96f67ddbc4cb2a18216921d54df4006e)
12
+ - Require Project Graph ([#479](https://github.com/SAP/ui5-server/issues/479)) [`d62f85a`](https://github.com/SAP/ui5-server/commit/d62f85a193115a587dbf58225e8130318a475023)
13
+ - Require Node.js >= 16.18.0 / npm >= 8 [`63d216a`](https://github.com/SAP/ui5-server/commit/63d216a3ba34e8e50acc6621d43a78c3a0804d67)
17
14
 
18
15
  ### BREAKING CHANGE
16
+ This package has been transformed to ES Modules. Therefore it no longer provides a CommonJS export.
17
+ If your project uses CommonJS, it needs to be converted to ESM or use a dynamic import.
18
+
19
+ For more information see also:
20
+
21
+ - https://sap.github.io/ui5-tooling/updates/migrate-v3/
22
+ - https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
19
23
 
20
24
  This removes the "/proxy" endpoint and the corresponding
21
25
  "connectUi5Proxy" middleware from the standard ui5-server.
@@ -28,68 +32,22 @@ in the form of custom middleware extensions from the UI5-community.
28
32
  The UI5 Team might provide a dedicated custom middleware extension,
29
33
  with similar functionality, in the future.
30
34
 
35
+ - Server now requires a Project Graph instance instead.
36
+ - Standard middleware now rely on Project instances being available on Resources (see https://github.com/SAP/ui5-fs/pull/381)
37
+ - MiddlewareRepository#addMiddleware has been removed. Custom middleware need to be added to the project graph instead
31
38
 
32
- <a name="v3.0.0-beta.4"></a>
33
- ## [v3.0.0-beta.4] - 2022-12-01
34
- ### Dependency Updates
35
- - Bump connect-openui5 from 0.10.2 to 0.10.3 [`90871f8`](https://github.com/SAP/ui5-server/commit/90871f89815501860616ffbdf8927824412ec909)
36
-
37
-
38
- <a name="v3.0.0-beta.3"></a>
39
- ## [v3.0.0-beta.3] - 2022-11-30
39
+ Support for older Node.js and npm releases has been dropped.
40
+ Only Node.js v16.18.0 and npm v8 or higher are supported.
40
41
 
41
- <a name="v3.0.0-beta.2"></a>
42
- ## [v3.0.0-beta.2] - 2022-11-29
43
42
  ### Features
44
43
  - **MiddlewareUtil:** Add getProject/getDependencies/resourceFactory API to interface ([#547](https://github.com/SAP/ui5-server/issues/547)) [`ab28f78`](https://github.com/SAP/ui5-server/commit/ab28f789ba929ef1319b6e562267e9717cc9937b)
45
44
 
46
45
 
47
- <a name="v3.0.0-beta.1"></a>
48
- ## [v3.0.0-beta.1] - 2022-11-07
49
-
50
- <a name="v3.0.0-alpha.4"></a>
51
- ## [v3.0.0-alpha.4] - 2022-10-24
52
- ### Breaking Changes
53
- - Transform to native ESM ([#501](https://github.com/SAP/ui5-server/issues/501)) [`05e3013`](https://github.com/SAP/ui5-server/commit/05e3013605e28e9ab5a785aa57616473d40e5710)
54
-
55
- ### BREAKING CHANGE
56
-
57
- This package has been transformed to native ESM. Therefore it no longer provides a CommonJS export.
58
- If your project uses CommonJS, it needs to be converted to ESM or use a dynamic import.
59
-
60
- For more information see also:
61
- - https://sap.github.io/ui5-tooling/updates/migrate-v3/
62
- - https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
63
-
64
-
65
- <a name="v3.0.0-alpha.3"></a>
66
- ## [v3.0.0-alpha.3] - 2022-07-27
67
-
68
- <a name="v3.0.0-alpha.2"></a>
69
- ## [v3.0.0-alpha.2] - 2022-06-14
70
- ### Breaking Changes
71
- - Require Project Graph ([#479](https://github.com/SAP/ui5-server/issues/479)) [`d62f85a`](https://github.com/SAP/ui5-server/commit/d62f85a193115a587dbf58225e8130318a475023)
72
-
73
- ### BREAKING CHANGE
74
-
75
- * Server now requires a Project Graph instance instead.
76
- * Standard middleware now rely on Project instances being available on Resources (see https://github.com/SAP/ui5-fs/pull/381)
77
- * MiddlewareRepository#addMiddleware has been removed. Custom middleware need to be added to the project graph instead
78
-
79
-
80
- <a name="v3.0.0-alpha.1"></a>
81
- ## [v3.0.0-alpha.1] - 2022-01-25
82
- ### Breaking Changes
83
- - Require Node.js >= 16.13.2 / npm >= 8 [`63d216a`](https://github.com/SAP/ui5-server/commit/63d216a3ba34e8e50acc6621d43a78c3a0804d67)
84
-
85
- ### BREAKING CHANGE
86
-
87
- Support for older Node.js and npm releases has been dropped.
88
- Only Node.js v16.13.2 and npm v8 or higher are supported.
89
-
46
+ <a name="v2.4.1"></a>
47
+ ## [v2.4.1] - 2022-11-30
48
+ ### Dependency Updates
49
+ - Bump connect-openui5 from 0.10.2 to 0.10.3 [`20b6fc8`](https://github.com/SAP/ui5-server/commit/20b6fc8fbad69265bae3e8f7efd320f6297ac4c4)
90
50
 
91
- <a name="v3.0.0-alpha.0"></a>
92
- ## [v3.0.0-alpha.0] - 2021-12-14
93
51
 
94
52
  <a name="v2.4.0"></a>
95
53
  ## [v2.4.0] - 2021-10-19
@@ -125,7 +83,7 @@ Only Node.js v16.13.2 and npm v8 or higher are supported.
125
83
  ## [v2.2.6] - 2020-10-22
126
84
  ### Bug Fixes
127
85
  - Improve parallel theme request handling [`88bc0d6`](https://github.com/SAP/ui5-server/commit/88bc0d6d4e5ca8bb191029335451713579360e1c)
128
- - **nonReadRequests middleware:** Use native response API [`2d2325f`](https://github.com/SAP/ui5-server/commit/2d2325f638820d25738ddbd56afe0d104e37f2e0)
86
+ - **nonReadRequests middleware:** Use response API [`2d2325f`](https://github.com/SAP/ui5-server/commit/2d2325f638820d25738ddbd56afe0d104e37f2e0)
129
87
 
130
88
 
131
89
  <a name="v2.2.5"></a>
@@ -174,7 +132,7 @@ Only Node.js v16.13.2 and npm v8 or higher are supported.
174
132
  <a name="v2.0.2"></a>
175
133
  ## [v2.0.2] - 2020-04-30
176
134
  ### Bug Fixes
177
- - **CSP Middleware:** Use native res.getHeader/setHeader methods ([#312](https://github.com/SAP/ui5-server/issues/312)) [`c53525c`](https://github.com/SAP/ui5-server/commit/c53525ca4bb5825d241d0f137ce3912d681e6548)
135
+ - **CSP Middleware:** Use res.getHeader/setHeader methods ([#312](https://github.com/SAP/ui5-server/issues/312)) [`c53525c`](https://github.com/SAP/ui5-server/commit/c53525ca4bb5825d241d0f137ce3912d681e6548)
178
136
 
179
137
 
180
138
  <a name="v2.0.1"></a>
@@ -332,19 +290,8 @@ Only Node.js v10 or higher is supported.
332
290
 
333
291
  <a name="v0.0.1"></a>
334
292
  ## v0.0.1 - 2018-06-06
335
-
336
- [v3.0.0-rc.2]: https://github.com/SAP/ui5-server/compare/v3.0.0-rc.1...v3.0.0-rc.2
337
- [v3.0.0-rc.1]: https://github.com/SAP/ui5-server/compare/v3.0.0-rc.0...v3.0.0-rc.1
338
- [v3.0.0-rc.0]: https://github.com/SAP/ui5-server/compare/v3.0.0-beta.4...v3.0.0-rc.0
339
- [v3.0.0-beta.4]: https://github.com/SAP/ui5-server/compare/v3.0.0-beta.3...v3.0.0-beta.4
340
- [v3.0.0-beta.3]: https://github.com/SAP/ui5-server/compare/v3.0.0-beta.2...v3.0.0-beta.3
341
- [v3.0.0-beta.2]: https://github.com/SAP/ui5-server/compare/v3.0.0-beta.1...v3.0.0-beta.2
342
- [v3.0.0-beta.1]: https://github.com/SAP/ui5-server/compare/v3.0.0-alpha.4...v3.0.0-beta.1
343
- [v3.0.0-alpha.4]: https://github.com/SAP/ui5-server/compare/v3.0.0-alpha.3...v3.0.0-alpha.4
344
- [v3.0.0-alpha.3]: https://github.com/SAP/ui5-server/compare/v3.0.0-alpha.2...v3.0.0-alpha.3
345
- [v3.0.0-alpha.2]: https://github.com/SAP/ui5-server/compare/v3.0.0-alpha.1...v3.0.0-alpha.2
346
- [v3.0.0-alpha.1]: https://github.com/SAP/ui5-server/compare/v3.0.0-alpha.0...v3.0.0-alpha.1
347
- [v3.0.0-alpha.0]: https://github.com/SAP/ui5-server/compare/v2.4.0...v3.0.0-alpha.0
293
+ [v3.0.0]: https://github.com/SAP/ui5-server/compare/v2.4.0...v3.0.0
294
+ [v2.4.1]: https://github.com/SAP/ui5-server/compare/v2.4.0...v2.4.1
348
295
  [v2.4.0]: https://github.com/SAP/ui5-server/compare/v2.3.1...v2.4.0
349
296
  [v2.3.1]: https://github.com/SAP/ui5-server/compare/v2.3.0...v2.3.1
350
297
  [v2.3.0]: https://github.com/SAP/ui5-server/compare/v2.2.10...v2.3.0
@@ -274,6 +274,12 @@ class MiddlewareManager {
274
274
  `Custom middleware definition ${middlewareDef.name} of project ${project.getName()} ` +
275
275
  `defines neither a "beforeMiddleware" nor an "afterMiddleware" parameter. One must be defined.`);
276
276
  }
277
+ const customMiddleware = this.graph.getExtension(middlewareDef.name);
278
+ if (!customMiddleware) {
279
+ throw new Error(
280
+ `Could not find custom middleware ${middlewareDef.name}, ` +
281
+ `referenced by project ${project.getName()}`);
282
+ }
277
283
 
278
284
  let middlewareName = middlewareDef.name;
279
285
  if (this.middleware[middlewareName]) {
@@ -288,8 +294,6 @@ class MiddlewareManager {
288
294
 
289
295
  await this.addMiddleware(middlewareName, {
290
296
  customMiddleware: async ({resources, middlewareUtil}) => {
291
- const customMiddleware = this.graph.getExtension(middlewareDef.name);
292
-
293
297
  const params = {
294
298
  resources,
295
299
  options: {
@@ -108,6 +108,7 @@ class MiddlewareUtil {
108
108
  * @property {Function} getNamespace Get the project namespace
109
109
  * @property {Function} getRootReader Get the project rootReader
110
110
  * @property {Function} getReader Get the project reader
111
+ * @property {Function} getRootPath Get the local File System path of the project's root directory
111
112
  * @property {Function} getSourcePath Get the local File System path of the project's source directory
112
113
  * @property {Function} getCustomConfiguration Get the project Custom Configuration
113
114
  * @property {Function} isFrameworkProject Check whether the project is a UI5-Framework project
@@ -226,7 +227,7 @@ class MiddlewareUtil {
226
227
  const baseProjectInterface = {};
227
228
  bindFunctions(project, baseProjectInterface, [
228
229
  "getType", "getName", "getVersion", "getNamespace",
229
- "getRootReader", "getReader", "getSourcePath",
230
+ "getRootReader", "getReader", "getRootPath", "getSourcePath",
230
231
  "getCustomConfiguration", "isFrameworkProject"
231
232
  ]);
232
233
  return baseProjectInterface;
@@ -56,7 +56,7 @@ function createResourceInfo(resource) {
56
56
  size: formatSize(stat.size),
57
57
  sizeInBytes: stat.size,
58
58
  project: resource.getProject()?.getName() || "<unknown>",
59
- projectPath: resource.getProject()?.getPath() || "<unknown>"
59
+ projectPath: resource.getProject()?.getRootPath() || "<unknown>"
60
60
  };
61
61
  }
62
62
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/server",
3
- "version": "3.0.0-rc.2",
3
+ "version": "3.0.0",
4
4
  "description": "UI5 Tooling - Server",
5
5
  "author": {
6
6
  "name": "SAP SE",
@@ -25,7 +25,7 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "engines": {
28
- "node": "^16.18.0 || >=18.0.0",
28
+ "node": "^16.18.0 || >=18.12.0",
29
29
  "npm": ">= 8"
30
30
  },
31
31
  "scripts": {
@@ -43,7 +43,7 @@
43
43
  "jsdoc-generate": "jsdoc -c ./jsdoc.json -t $(node -p 'path.dirname(require.resolve(\"docdash\"))') ./lib/ || (echo 'Error during JSDoc generation! Check log.' && exit 1)",
44
44
  "jsdoc-watch": "npm run jsdoc && chokidar \"./lib/**/*.js\" -c \"npm run jsdoc-generate\"",
45
45
  "preversion": "npm test",
46
- "version": "git-chglog --sort semver --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
46
+ "version": "git-chglog --sort semver --next-tag v$npm_package_version -o CHANGELOG.md v3.0.0.. && git add CHANGELOG.md",
47
47
  "postversion": "git push --follow-tags",
48
48
  "release-note": "git-chglog --sort semver -c .chglog/release-config.yml v$npm_package_version",
49
49
  "depcheck": "depcheck --ignores @ui5/server,docdash,compression,cors,@istanbuljs/esm-loader-hook --parsers='**/*.js:es6,**/*.cjs:es6'"
@@ -114,9 +114,9 @@
114
114
  "url": "git@github.com:SAP/ui5-server.git"
115
115
  },
116
116
  "dependencies": {
117
- "@ui5/builder": "^3.0.0-rc.3",
118
- "@ui5/fs": "^3.0.0-rc.4",
119
- "@ui5/logger": "^3.0.1-rc.2",
117
+ "@ui5/builder": "^3.0.0",
118
+ "@ui5/fs": "^3.0.0",
119
+ "@ui5/logger": "^3.0.0",
120
120
  "body-parser": "^1.20.1",
121
121
  "compression": "^1.7.4",
122
122
  "cors": "^2.8.5",
@@ -136,21 +136,21 @@
136
136
  },
137
137
  "devDependencies": {
138
138
  "@istanbuljs/esm-loader-hook": "^0.2.0",
139
- "@ui5/project": "^3.0.0-rc.6",
140
- "ava": "^5.1.1",
139
+ "@ui5/project": "^3.0.0-rc.9",
140
+ "ava": "^5.2.0",
141
141
  "chokidar-cli": "^3.0.0",
142
142
  "cross-env": "^7.0.3",
143
143
  "depcheck": "^1.4.3",
144
144
  "docdash": "^2.0.1",
145
- "eslint": "^8.32.0",
145
+ "eslint": "^8.33.0",
146
146
  "eslint-config-google": "^0.14.0",
147
147
  "eslint-plugin-ava": "^14.0.0",
148
- "eslint-plugin-jsdoc": "^39.6.7",
148
+ "eslint-plugin-jsdoc": "^39.8.0",
149
149
  "esmock": "^2.1.0",
150
- "jsdoc": "^3.6.11",
150
+ "jsdoc": "^4.0.0",
151
151
  "nyc": "^15.1.0",
152
152
  "open-cli": "^7.1.0",
153
- "rimraf": "^4.1.1",
153
+ "rimraf": "^4.1.2",
154
154
  "sinon": "^15.0.1",
155
155
  "supertest": "^6.3.3",
156
156
  "tap-xunit": "^2.4.1"