diff --git a/.changeset/metal-guests-melt.md b/.changeset/metal-guests-melt.md deleted file mode 100644 index 528e1538fd..0000000000 --- a/.changeset/metal-guests-melt.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -"@vue-storefront/middleware": major ---- - -- [CHANGED] [BREAKING] Changed return type of `createServer()` from `Express` to `Server` (from built-in `node:http` package). Both of those types' interfaces have the `.listen()` method with the same shape. In some older templates for starting the middleware (`middleware.js` in your repo) you come across: - -```ts -async function runMiddleware(app: Express) { -``` - -If you're using that older template, please change the `Express` type to `Server`: -```diff -+ import { Server } from "node:http" -+ async function runMiddleware(app: Server) { -- async function runMiddleware(app: Express) { -``` - -- [ADDED] New GET /readyz endpoint for middleware for using with Kubernetes readiness probes. Please see https://docs.alokai.com/middleware/guides/readiness-probes for more information diff --git a/docs/content/3.middleware/3.api/middleware.api.json b/docs/content/3.middleware/3.api/middleware.api.json index 2558036ed2..02f65debbe 100644 --- a/docs/content/3.middleware/3.api/middleware.api.json +++ b/docs/content/3.middleware/3.api/middleware.api.json @@ -3566,8 +3566,8 @@ }, { "kind": "Reference", - "text": "Express", - "canonicalReference": "@types/express!e.Express:interface" + "text": "Server", + "canonicalReference": "!\"\\\"http\\\"\".Server:class" }, { "kind": "Content", @@ -3733,6 +3733,38 @@ "startIndex": 1, "endIndex": 4 } + }, + { + "kind": "PropertySignature", + "canonicalReference": "@vue-storefront/middleware!CreateServerOptions#readinessProbes:member", + "docComment": "/**\n * Array of functions that will be called in parallel every time the /readyz endpoint receives a GET request If at least one function throws an exception, the response from the /readyz endpoint will report an error\n *\n * @see\n *\n * https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "readinessProbes?: " + }, + { + "kind": "Reference", + "text": "ReadinessProbe", + "canonicalReference": "@vue-storefront/middleware!ReadinessProbe:type" + }, + { + "kind": "Content", + "text": "[]" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": false, + "isOptional": true, + "releaseTag": "Public", + "name": "readinessProbes", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } } ], "extendsTokenRanges": [] @@ -6204,6 +6236,41 @@ "endIndex": 6 } }, + { + "kind": "TypeAlias", + "canonicalReference": "@vue-storefront/middleware!ReadinessProbe:type", + "docComment": "/**\n * Function that will be called to determine readiness of middleware to accept connections\n *\n * @returns Return value is never considered - only thrown exceptions\n *\n * @throws\n *\n * The implementation *must* throw an exception at some point in the code, which means that the readiness check should fail\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export type ReadinessProbe = " + }, + { + "kind": "Content", + "text": "() => " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "src/types/server.ts", + "releaseTag": "Public", + "name": "ReadinessProbe", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 4 + } + }, { "kind": "TypeAlias", "canonicalReference": "@vue-storefront/middleware!RecordOverloadedReturnType:type", diff --git a/docs/content/3.middleware/4.reference/change-log.md b/docs/content/3.middleware/4.reference/change-log.md index 459ac7eaa3..a455b03984 100644 --- a/docs/content/3.middleware/4.reference/change-log.md +++ b/docs/content/3.middleware/4.reference/change-log.md @@ -1,5 +1,25 @@ # Change log +## 5.0.0 + +### Major Changes + +- [CHANGED] [BREAKING] Changed return type of `createServer()` from `Express` to `Server` (from built-in `node:http` package). Both of those types' interfaces have the `.listen()` method with the same shape. In some older templates for starting the middleware (`middleware.js` in your repo) you come across: + +```ts +async function runMiddleware(app: Express) { +``` + +If you're using that older template, please change the `Express` type to `Server`: + +```diff ++ import { Server } from "node:http" ++ async function runMiddleware(app: Server) { +- async function runMiddleware(app: Express) { +``` + +- [ADDED] New GET /readyz endpoint for middleware for using with Kubernetes readiness probes. Please see https://docs.alokai.com/middleware/guides/readiness-probes for more information + ## 4.3.1 ### Patch Changes diff --git a/docs/content/3.middleware/4.reference/multistore/change-log.md b/docs/content/3.middleware/4.reference/multistore/change-log.md index ab97d58ef8..3d91537607 100644 --- a/docs/content/3.middleware/4.reference/multistore/change-log.md +++ b/docs/content/3.middleware/4.reference/multistore/change-log.md @@ -1,5 +1,12 @@ # Change log +## 4.1.1 + +### Patch Changes + +- Updated dependencies: + - @vue-storefront/middleware@5.0.0 + ## 4.1.0 ### Minor Changes diff --git a/packages/middleware/CHANGELOG.md b/packages/middleware/CHANGELOG.md index 459ac7eaa3..a455b03984 100644 --- a/packages/middleware/CHANGELOG.md +++ b/packages/middleware/CHANGELOG.md @@ -1,5 +1,25 @@ # Change log +## 5.0.0 + +### Major Changes + +- [CHANGED] [BREAKING] Changed return type of `createServer()` from `Express` to `Server` (from built-in `node:http` package). Both of those types' interfaces have the `.listen()` method with the same shape. In some older templates for starting the middleware (`middleware.js` in your repo) you come across: + +```ts +async function runMiddleware(app: Express) { +``` + +If you're using that older template, please change the `Express` type to `Server`: + +```diff ++ import { Server } from "node:http" ++ async function runMiddleware(app: Server) { +- async function runMiddleware(app: Express) { +``` + +- [ADDED] New GET /readyz endpoint for middleware for using with Kubernetes readiness probes. Please see https://docs.alokai.com/middleware/guides/readiness-probes for more information + ## 4.3.1 ### Patch Changes diff --git a/packages/middleware/package.json b/packages/middleware/package.json index fd01694fc9..f4c1d8b539 100644 --- a/packages/middleware/package.json +++ b/packages/middleware/package.json @@ -1,6 +1,6 @@ { "name": "@vue-storefront/middleware", - "version": "4.3.1", + "version": "5.0.0", "main": "lib/index.cjs.js", "module": "lib/index.es.js", "types": "lib/index.d.ts", diff --git a/packages/multistore/CHANGELOG.md b/packages/multistore/CHANGELOG.md index ab97d58ef8..3d91537607 100644 --- a/packages/multistore/CHANGELOG.md +++ b/packages/multistore/CHANGELOG.md @@ -1,5 +1,12 @@ # Change log +## 4.1.1 + +### Patch Changes + +- Updated dependencies: + - @vue-storefront/middleware@5.0.0 + ## 4.1.0 ### Minor Changes diff --git a/packages/multistore/package.json b/packages/multistore/package.json index 80c6fbc06e..3edb778cff 100644 --- a/packages/multistore/package.json +++ b/packages/multistore/package.json @@ -1,6 +1,6 @@ { "name": "@vue-storefront/multistore", - "version": "4.1.0", + "version": "4.1.1", "author": "Fifciu", "license": "MIT", "main": "lib/index.cjs.js", @@ -20,7 +20,7 @@ "prepublishOnly": "yarn build" }, "dependencies": { - "@vue-storefront/middleware": "^4.1.0", + "@vue-storefront/middleware": "^5.0.0", "express": "^4.18.1" }, "publishConfig": { diff --git a/yarn.lock b/yarn.lock index b5c689b459..d2756e6674 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5023,6 +5023,17 @@ local-pkg "^0.5.0" magic-string-ast "^0.5.0" +"@vue-storefront/middleware@^4.2.0": + version "4.3.1" + resolved "https://registry.yarnpkg.com/@vue-storefront/middleware/-/middleware-4.3.1.tgz#075a594f35b9a6cbe3969eb2f1a101eaa632e04f" + integrity sha512-hIFp6djLFt3SLkeC0bs0CAiLfSifJMxdZQXxdnd9wA6Ud4IltG0ykVwXgedMmU4UiuANruUMQczDo5LCbJ5hYA== + dependencies: + consola "^2.15.3" + cookie-parser "^1.4.6" + cors "^2.8.5" + express "^4.18.1" + helmet "^5.1.1" + "@vue-storefront/rollup-config@^0.0.6": version "0.0.6" resolved "https://registry.yarnpkg.com/@vue-storefront/rollup-config/-/rollup-config-0.0.6.tgz#625f4e67790f11e2b9ff2843a95fea52849effa2"