From 256d3387e8a094f4a6d2632285d7c455ba23d054 Mon Sep 17 00:00:00 2001 From: Juri Leino Date: Fri, 3 Feb 2023 15:31:35 +0100 Subject: [PATCH 1/3] feat: request and ambigous route log level closes #67 To ease application development and custom messages not drown in roaster's own logs the log level for the following messages is lowered to "debug": - incoming requests (was "info") - outgoing requests (was "info") - ambigous route message (was "warn") --- content/router.xql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/router.xql b/content/router.xql index 447c5bb..e278794 100644 --- a/content/router.xql +++ b/content/router.xql @@ -88,7 +88,7 @@ declare function router:route ($api-files as xs:string+, $lookup as function(xs: } return ( - util:log("info", ``[[`{$request-data?id}`] request `{$request-data?method}` `{$request-data?path}`]``), + util:log("debug", ``[[`{$request-data?id}`] request `{$request-data?method}` `{$request-data?path}`]``), try { (: load router definitions :) let $specs := @@ -114,7 +114,7 @@ declare function router:route ($api-files as xs:string+, $lookup as function(xs: $matching-routes else ( (: if there are multiple matches, prefer the one matching the longest pattern and the highest priority :) - util:log("warn", "ambigous route: " || $request-data?path), + util:log("debug", "ambigous route: " || $request-data?path), head(sort($matching-routes, (), router:route-specificity#1)) ) @@ -227,7 +227,7 @@ declare %private function router:process-request ($pattern-map as map(*), $looku return ( router:write-response($status, $response, $route), - util:log("info", ``[[`{$base-request?id}`] `{$base-request?method}` `{$base-request?path}`: `{$status}`]``) + util:log("debug", ``[[`{$base-request?id}`] `{$base-request?method}` `{$base-request?path}`: `{$status}`]``) ) }; From 71a6770d2cd1dea16ab01ba94081237785b72627 Mon Sep 17 00:00:00 2001 From: Juri Leino Date: Sat, 4 Feb 2023 10:09:18 +0100 Subject: [PATCH 2/3] chore(dev-deps): update to gulp-exist 4.4.0 --- package-lock.json | 74 ++++++++++++++++++++++++++++++++++++++++++----- package.json | 2 +- 2 files changed, 67 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd58e4b..373a800 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.7.6", "license": "GPL-3.0", "devDependencies": { - "@existdb/gulp-exist": "^4.3.2", + "@existdb/gulp-exist": "^4.4.0", "@existdb/gulp-replace-tmpl": "^1.0.4", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", @@ -137,19 +137,45 @@ } }, "node_modules/@existdb/gulp-exist": { - "version": "4.3.2", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@existdb/gulp-exist/-/gulp-exist-4.4.0.tgz", + "integrity": "sha512-lXhWpDgWOM2exUAS+QQTX+xmtmAZeZf5pBIF2K+5UtEc525mbCp04DtNcp2LC4GbLbmsyyE7gc1b14uqTqtPXQ==", "dev": true, - "license": "MIT", "dependencies": { - "@existdb/node-exist": "^5.1.0", + "@existdb/node-exist": "^5.4.0", "chokidar": "^3.5.3", "fancy-log": "^2.0.0", "glob-stream": "^7.0.0", "gulp": "^4.0.2", "lodash.assign": "^4.2.0", - "plugin-error": "^2.0.0", + "plugin-error": "^2.0.1", "through2": "^4.0.2", - "vinyl": "^2.2.1" + "vinyl": "^3.0.0" + } + }, + "node_modules/@existdb/gulp-exist/node_modules/replace-ext": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-2.0.0.tgz", + "integrity": "sha512-UszKE5KVK6JvyD92nzMn9cDapSk6w/CaFZ96CnmDMUqH9oowfxF/ZjRITD25H4DnOQClLA4/j7jLGXXLVKxAug==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@existdb/gulp-exist/node_modules/vinyl": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-3.0.0.tgz", + "integrity": "sha512-rC2VRfAVVCGEgjnxHUnpIVh3AGuk62rP3tqVrn+yab0YH7UULisC085+NYH+mnqf3Wx4SpSi1RQMwudL89N03g==", + "dev": true, + "dependencies": { + "clone": "^2.1.2", + "clone-stats": "^1.0.0", + "remove-trailing-separator": "^1.1.0", + "replace-ext": "^2.0.0", + "teex": "^1.0.1" + }, + "engines": { + "node": ">=10.13.0" } }, "node_modules/@existdb/gulp-replace-tmpl": { @@ -2693,6 +2719,12 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-fifo": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.1.0.tgz", + "integrity": "sha512-Kl29QoNbNvn4nhDsLYjyIAaIqaJB6rBx5p3sL9VjaefJ+eMFBWVZiaoguaoZfzEKr5RhAti0UgM8703akGPJ6g==", + "dev": true + }, "node_modules/fast-glob": { "version": "3.2.12", "dev": true, @@ -9033,9 +9065,10 @@ } }, "node_modules/plugin-error": { - "version": "2.0.0", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-2.0.1.tgz", + "integrity": "sha512-zMakqvIDyY40xHOvzXka0kUvf40nYIuwRE8dWhti2WtjQZ31xAgBZBhxsK7vK3QbRXS1Xms/LO7B5cuAsfB2Gg==", "dev": true, - "license": "MIT", "dependencies": { "ansi-colors": "^1.0.1" }, @@ -9141,6 +9174,12 @@ ], "license": "MIT" }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "dev": true + }, "node_modules/quick-lru": { "version": "5.1.1", "dev": true, @@ -10524,6 +10563,16 @@ "dev": true, "license": "MIT" }, + "node_modules/streamx": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.13.2.tgz", + "integrity": "sha512-+TWqixPhGDXEG9L/XczSbhfkmwAtGs3BJX5QNU6cvno+pOLKeszByWcnaTu6dg8efsTYqR8ZZuXWHhZfgrxMvA==", + "dev": true, + "dependencies": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "dev": true, @@ -10656,6 +10705,15 @@ "dev": true, "license": "MIT" }, + "node_modules/teex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz", + "integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==", + "dev": true, + "dependencies": { + "streamx": "^2.12.5" + } + }, "node_modules/temp-dir": { "version": "2.0.0", "dev": true, diff --git a/package.json b/package.json index 76c102d..453a240 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "license": "GPL-3.0", "devDependencies": { - "@existdb/gulp-exist": "^4.3.2", + "@existdb/gulp-exist": "^4.4.0", "@existdb/gulp-replace-tmpl": "^1.0.4", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", From b4e822ffd145546599079036ece6d1b055647b69 Mon Sep 17 00:00:00 2001 From: Juri Leino Date: Sat, 4 Feb 2023 10:19:46 +0100 Subject: [PATCH 3/3] ci: test on exist-db 5.5.1 The transient test-dependency on crypto lib requires 5.3.0 or later the library itself should run on earlier versions as well. --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index cab348a..af36584 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - exist-version: [latest, release, 5.4.1, 5.0.0] + exist-version: [latest, release, 5.5.1] services: exist: image: existdb/existdb:${{ matrix.exist-version }}