waibu 2.4.0 → 2.5.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/index.js CHANGED
@@ -301,7 +301,7 @@ async function factory (pkgName) {
301
301
  }
302
302
 
303
303
  /**
304
- * Get origin of fastify's request object
304
+ * Get origin from fastify's request object
305
305
  *
306
306
  * @method
307
307
  * @param {Object} req
@@ -314,6 +314,16 @@ async function factory (pkgName) {
314
314
  return `${req.protocol}://${host}`
315
315
  }
316
316
 
317
+ /**
318
+ * Get hostname from fastify's request object
319
+ *
320
+ * @param {Object} req
321
+ * @returns {string}
322
+ */
323
+ getHostname = (req) => {
324
+ return req.hostname.split(':')[0]
325
+ }
326
+
317
327
  /**
318
328
  * Get plugin by prefix
319
329
  *
@@ -56,7 +56,7 @@ async function buildLocals ({ tpl, params = {}, opts = {} } = {}) {
56
56
  const { runHook } = this.app.bajo
57
57
  const { set, merge, pick, get, isEmpty, find, pullAt } = this.app.lib._
58
58
  const { req, reply } = opts
59
- params.page = merge(params.page ?? {}, { ns: req.ns })
59
+ params.page = merge(params.page ?? {}, { ns: req.ns, features: [] })
60
60
  params.sidebar = params.sidebar ?? []
61
61
 
62
62
  const { site, user, lang, darkMode } = req
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Web Framework for Bajo",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-02-17
4
+
5
+ - [2.5.0] Add ```getHostname()```
6
+
7
+ ## 2026-02-16
8
+
9
+ - [2.4.1] Bug fix on page with features
10
+
3
11
  ## 2026-02-09
4
12
 
5
13
  - [2.3.4] Bug fix on error handling