renovate-log-parser 0.1.0 → 0.1.2
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/README.md +39 -27
- package/dist/commands/web.d.ts +2 -1
- package/dist/commands/web.js +23 -11
- package/dist/commands/web.js.map +1 -1
- package/dist/server/api.d.ts +16 -0
- package/dist/server/api.js +173 -0
- package/dist/server/api.js.map +1 -0
- package/dist/server/http-error.d.ts +18 -0
- package/dist/server/http-error.js +23 -0
- package/dist/server/http-error.js.map +1 -0
- package/dist/server/index.d.ts +34 -0
- package/dist/server/index.js +54 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/log-registry.d.ts +34 -0
- package/dist/server/log-registry.js +157 -0
- package/dist/server/log-registry.js.map +1 -0
- package/dist/server/server-main.d.ts +1 -0
- package/dist/server/server-main.js +31 -0
- package/dist/server/server-main.js.map +1 -0
- package/dist/server/translate-filters.d.ts +58 -0
- package/dist/server/translate-filters.js +119 -0
- package/dist/server/translate-filters.js.map +1 -0
- package/package.json +6 -3
- package/web/.output/public/200.html +1 -0
- package/web/.output/public/404.html +1 -0
- package/web/.output/public/_nuxt/{CGPWRqbc.js → B4JKWaDj.js} +1 -1
- package/web/.output/public/_nuxt/Bs-RnkRE.js +37 -0
- package/web/.output/public/_nuxt/{Sgtec1U0.js → DjtJytwR.js} +1 -1
- package/web/.output/public/_nuxt/{BgApMHS1.js → a71R3CFc.js} +1 -1
- package/web/.output/public/_nuxt/builds/latest.json +1 -1
- package/web/.output/public/_nuxt/builds/meta/bc129b23-5172-4e74-875d-2a24574a5dbe.json +1 -0
- package/web/.output/public/index.html +1 -0
- package/web/.output/nitro.json +0 -15
- package/web/.output/public/_nuxt/BWja8e3M.js +0 -37
- package/web/.output/public/_nuxt/builds/meta/c4723e49-0623-47af-ae79-9ab6428bdcc1.json +0 -1
- package/web/.output/server/chunks/_/error-500.mjs +0 -19
- package/web/.output/server/chunks/_/error-500.mjs.map +0 -1
- package/web/.output/server/chunks/_/icons.mjs +0 -6153
- package/web/.output/server/chunks/_/icons.mjs.map +0 -1
- package/web/.output/server/chunks/_/icons2.mjs +0 -11494
- package/web/.output/server/chunks/_/icons2.mjs.map +0 -1
- package/web/.output/server/chunks/build/_plugin-vue_export-helper-1tPrXgE0.mjs +0 -10
- package/web/.output/server/chunks/build/_plugin-vue_export-helper-1tPrXgE0.mjs.map +0 -1
- package/web/.output/server/chunks/build/client.precomputed.mjs +0 -4
- package/web/.output/server/chunks/build/client.precomputed.mjs.map +0 -1
- package/web/.output/server/chunks/build/error-404-DyaaQUIS.mjs +0 -106
- package/web/.output/server/chunks/build/error-404-DyaaQUIS.mjs.map +0 -1
- package/web/.output/server/chunks/build/error-404-styles.9cNA4arh.mjs +0 -8
- package/web/.output/server/chunks/build/error-404-styles.9cNA4arh.mjs.map +0 -1
- package/web/.output/server/chunks/build/error-500-CVSP-p02.mjs +0 -89
- package/web/.output/server/chunks/build/error-500-CVSP-p02.mjs.map +0 -1
- package/web/.output/server/chunks/build/error-500-styles.BX54ZlkH.mjs +0 -8
- package/web/.output/server/chunks/build/error-500-styles.BX54ZlkH.mjs.map +0 -1
- package/web/.output/server/chunks/build/index-88dXYOxO.mjs +0 -19675
- package/web/.output/server/chunks/build/index-88dXYOxO.mjs.map +0 -1
- package/web/.output/server/chunks/build/index-styles.V2iua2bE.mjs +0 -8
- package/web/.output/server/chunks/build/index-styles.V2iua2bE.mjs.map +0 -1
- package/web/.output/server/chunks/build/server.mjs +0 -7910
- package/web/.output/server/chunks/build/server.mjs.map +0 -1
- package/web/.output/server/chunks/build/styles.mjs +0 -10
- package/web/.output/server/chunks/build/styles.mjs.map +0 -1
- package/web/.output/server/chunks/nitro/nitro.mjs +0 -6944
- package/web/.output/server/chunks/nitro/nitro.mjs.map +0 -1
- package/web/.output/server/chunks/routes/api/fields.get.mjs +0 -27
- package/web/.output/server/chunks/routes/api/fields.get.mjs.map +0 -1
- package/web/.output/server/chunks/routes/api/findings.get.mjs +0 -30
- package/web/.output/server/chunks/routes/api/findings.get.mjs.map +0 -1
- package/web/.output/server/chunks/routes/api/log/contents.post.mjs +0 -29
- package/web/.output/server/chunks/routes/api/log/contents.post.mjs.map +0 -1
- package/web/.output/server/chunks/routes/api/log/path.post.mjs +0 -30
- package/web/.output/server/chunks/routes/api/log/path.post.mjs.map +0 -1
- package/web/.output/server/chunks/routes/api/repositories.get.mjs +0 -27
- package/web/.output/server/chunks/routes/api/repositories.get.mjs.map +0 -1
- package/web/.output/server/chunks/routes/api/rows.get.mjs +0 -48
- package/web/.output/server/chunks/routes/api/rows.get.mjs.map +0 -1
- package/web/.output/server/chunks/routes/renderer.mjs +0 -451
- package/web/.output/server/chunks/routes/renderer.mjs.map +0 -1
- package/web/.output/server/chunks/virtual/_virtual_spa-template.mjs +0 -4
- package/web/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +0 -1
- package/web/.output/server/index.mjs +0 -16
- package/web/.output/server/index.mjs.map +0 -1
- package/web/.output/server/node_modules/.nitro/hookable@5.5.3/dist/index.mjs +0 -290
- package/web/.output/server/node_modules/.nitro/hookable@5.5.3/package.json +0 -49
- package/web/.output/server/node_modules/.nitro/hookable@6.1.1/dist/index.mjs +0 -257
- package/web/.output/server/node_modules/.nitro/hookable@6.1.1/package.json +0 -53
- package/web/.output/server/node_modules/@babel/parser/lib/index.js +0 -14599
- package/web/.output/server/node_modules/@babel/parser/package.json +0 -50
- package/web/.output/server/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +0 -1038
- package/web/.output/server/node_modules/@floating-ui/core/package.json +0 -63
- package/web/.output/server/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +0 -789
- package/web/.output/server/node_modules/@floating-ui/dom/package.json +0 -72
- package/web/.output/server/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +0 -165
- package/web/.output/server/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs +0 -136
- package/web/.output/server/node_modules/@floating-ui/utils/package.json +0 -70
- package/web/.output/server/node_modules/@floating-ui/vue/dist/floating-ui.vue.mjs +0 -190
- package/web/.output/server/node_modules/@floating-ui/vue/package.json +0 -71
- package/web/.output/server/node_modules/@iconify/utils/lib/colors/index.js +0 -295
- package/web/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +0 -701
- package/web/.output/server/node_modules/@iconify/utils/lib/css/common.js +0 -75
- package/web/.output/server/node_modules/@iconify/utils/lib/css/format.js +0 -39
- package/web/.output/server/node_modules/@iconify/utils/lib/css/icon.js +0 -47
- package/web/.output/server/node_modules/@iconify/utils/lib/css/icons.js +0 -128
- package/web/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +0 -19
- package/web/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +0 -13
- package/web/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +0 -17
- package/web/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +0 -16
- package/web/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +0 -30
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +0 -78
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +0 -100
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +0 -28
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +0 -58
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +0 -48
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +0 -203
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +0 -33
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +0 -132
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +0 -165
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +0 -79
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +0 -92
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +0 -26
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +0 -76
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +0 -66
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +0 -45
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +0 -103
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +0 -36
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +0 -92
- package/web/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +0 -62
- package/web/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +0 -25
- package/web/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +0 -16
- package/web/.output/server/node_modules/@iconify/utils/lib/icon/name.js +0 -57
- package/web/.output/server/node_modules/@iconify/utils/lib/icon/square.js +0 -33
- package/web/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +0 -12
- package/web/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +0 -125
- package/web/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +0 -19
- package/web/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +0 -25
- package/web/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +0 -36
- package/web/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +0 -91
- package/web/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +0 -46
- package/web/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +0 -23
- package/web/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +0 -42
- package/web/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +0 -123
- package/web/.output/server/node_modules/@iconify/utils/lib/index.js +0 -52
- package/web/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +0 -30
- package/web/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +0 -26
- package/web/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +0 -27
- package/web/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +0 -105
- package/web/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +0 -26
- package/web/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +0 -26
- package/web/.output/server/node_modules/@iconify/utils/lib/misc/title.js +0 -9
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/build.js +0 -113
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +0 -31
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +0 -13
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/html.js +0 -9
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/id.js +0 -41
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +0 -22
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +0 -67
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +0 -54
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/size.js +0 -27
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +0 -7
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/url.js +0 -22
- package/web/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +0 -8
- package/web/.output/server/node_modules/@iconify/utils/package.json +0 -119
- package/web/.output/server/node_modules/@iconify/vue/dist/iconify.mjs +0 -1896
- package/web/.output/server/node_modules/@iconify/vue/package.json +0 -62
- package/web/.output/server/node_modules/@tanstack/virtual-core/dist/esm/index.js +0 -1268
- package/web/.output/server/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js +0 -34
- package/web/.output/server/node_modules/@tanstack/virtual-core/dist/esm/utils.js +0 -74
- package/web/.output/server/node_modules/@tanstack/virtual-core/package.json +0 -56
- package/web/.output/server/node_modules/@tanstack/vue-virtual/dist/esm/index.js +0 -66
- package/web/.output/server/node_modules/@tanstack/vue-virtual/package.json +0 -68
- package/web/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +0 -6759
- package/web/.output/server/node_modules/@vue/compiler-core/package.json +0 -58
- package/web/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +0 -689
- package/web/.output/server/node_modules/@vue/compiler-dom/package.json +0 -57
- package/web/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +0 -1413
- package/web/.output/server/node_modules/@vue/compiler-ssr/package.json +0 -34
- package/web/.output/server/node_modules/@vue/devtools-api/dist/index.js +0 -2
- package/web/.output/server/node_modules/@vue/devtools-api/package.json +0 -34
- package/web/.output/server/node_modules/@vue/devtools-kit/dist/index.js +0 -5670
- package/web/.output/server/node_modules/@vue/devtools-kit/node_modules/hookable/dist/index.mjs +0 -290
- package/web/.output/server/node_modules/@vue/devtools-kit/node_modules/hookable/package.json +0 -49
- package/web/.output/server/node_modules/@vue/devtools-kit/package.json +0 -44
- package/web/.output/server/node_modules/@vue/devtools-shared/dist/index.js +0 -239
- package/web/.output/server/node_modules/@vue/devtools-shared/package.json +0 -33
- package/web/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +0 -1899
- package/web/.output/server/node_modules/@vue/reactivity/package.json +0 -55
- package/web/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +0 -6940
- package/web/.output/server/node_modules/@vue/runtime-core/package.json +0 -52
- package/web/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +0 -1822
- package/web/.output/server/node_modules/@vue/runtime-dom/package.json +0 -60
- package/web/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +0 -896
- package/web/.output/server/node_modules/@vue/server-renderer/package.json +0 -55
- package/web/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +0 -604
- package/web/.output/server/node_modules/@vue/shared/package.json +0 -47
- package/web/.output/server/node_modules/@vueuse/core/dist/index.js +0 -8464
- package/web/.output/server/node_modules/@vueuse/core/package.json +0 -49
- package/web/.output/server/node_modules/@vueuse/shared/dist/index.js +0 -2013
- package/web/.output/server/node_modules/@vueuse/shared/package.json +0 -42
- package/web/.output/server/node_modules/aria-hidden/dist/es5/index.js +0 -174
- package/web/.output/server/node_modules/aria-hidden/package.json +0 -71
- package/web/.output/server/node_modules/birpc/dist/index.mjs +0 -291
- package/web/.output/server/node_modules/birpc/package.json +0 -57
- package/web/.output/server/node_modules/consola/dist/chunks/prompt.mjs +0 -280
- package/web/.output/server/node_modules/consola/dist/core.mjs +0 -512
- package/web/.output/server/node_modules/consola/dist/index.mjs +0 -651
- package/web/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +0 -72
- package/web/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +0 -288
- package/web/.output/server/node_modules/consola/package.json +0 -136
- package/web/.output/server/node_modules/devalue/index.js +0 -4
- package/web/.output/server/node_modules/devalue/package.json +0 -40
- package/web/.output/server/node_modules/devalue/src/base64.js +0 -60
- package/web/.output/server/node_modules/devalue/src/constants.js +0 -12
- package/web/.output/server/node_modules/devalue/src/parse.js +0 -283
- package/web/.output/server/node_modules/devalue/src/stringify.js +0 -401
- package/web/.output/server/node_modules/devalue/src/uneval.js +0 -552
- package/web/.output/server/node_modules/devalue/src/utils.js +0 -160
- package/web/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +0 -77
- package/web/.output/server/node_modules/entities/dist/commonjs/decode.js +0 -568
- package/web/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +0 -7
- package/web/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +0 -7
- package/web/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +0 -21
- package/web/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +0 -31
- package/web/.output/server/node_modules/entities/dist/commonjs/package.json +0 -3
- package/web/.output/server/node_modules/entities/package.json +0 -120
- package/web/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +0 -344
- package/web/.output/server/node_modules/estree-walker/package.json +0 -37
- package/web/.output/server/node_modules/hookable/dist/index.mjs +0 -257
- package/web/.output/server/node_modules/hookable/package.json +0 -53
- package/web/.output/server/node_modules/nostics/dist/index.mjs +0 -179
- package/web/.output/server/node_modules/nostics/package.json +0 -124
- package/web/.output/server/node_modules/perfect-debounce/dist/index.mjs +0 -89
- package/web/.output/server/node_modules/perfect-debounce/package.json +0 -41
- package/web/.output/server/node_modules/rou3/dist/index.mjs +0 -501
- package/web/.output/server/node_modules/rou3/package.json +0 -48
- package/web/.output/server/node_modules/source-map-js/lib/array-set.js +0 -121
- package/web/.output/server/node_modules/source-map-js/lib/base64-vlq.js +0 -140
- package/web/.output/server/node_modules/source-map-js/lib/base64.js +0 -67
- package/web/.output/server/node_modules/source-map-js/lib/binary-search.js +0 -111
- package/web/.output/server/node_modules/source-map-js/lib/mapping-list.js +0 -79
- package/web/.output/server/node_modules/source-map-js/lib/quick-sort.js +0 -132
- package/web/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +0 -1188
- package/web/.output/server/node_modules/source-map-js/lib/source-map-generator.js +0 -444
- package/web/.output/server/node_modules/source-map-js/lib/source-node.js +0 -413
- package/web/.output/server/node_modules/source-map-js/lib/util.js +0 -594
- package/web/.output/server/node_modules/source-map-js/package.json +0 -71
- package/web/.output/server/node_modules/source-map-js/source-map.js +0 -8
- package/web/.output/server/node_modules/srvx/dist/_chunks/_body-limit.mjs +0 -39
- package/web/.output/server/node_modules/srvx/dist/_chunks/_plugins.mjs +0 -56
- package/web/.output/server/node_modules/srvx/dist/_chunks/_trust-proxy.mjs +0 -58
- package/web/.output/server/node_modules/srvx/dist/_chunks/_url.mjs +0 -134
- package/web/.output/server/node_modules/srvx/dist/_chunks/_utils.mjs +0 -15
- package/web/.output/server/node_modules/srvx/dist/_chunks/_utils2.mjs +0 -75
- package/web/.output/server/node_modules/srvx/dist/adapters/node.mjs +0 -976
- package/web/.output/server/node_modules/srvx/package.json +0 -102
- package/web/.output/server/node_modules/tailwind-merge/dist/bundle-mjs.mjs +0 -3365
- package/web/.output/server/node_modules/tailwind-merge/package.json +0 -93
- package/web/.output/server/node_modules/tailwind-variants/dist/chunk-LQJYWU4O.js +0 -112
- package/web/.output/server/node_modules/tailwind-variants/dist/chunk-RZF76H2U.js +0 -269
- package/web/.output/server/node_modules/tailwind-variants/dist/index.js +0 -38
- package/web/.output/server/node_modules/tailwind-variants/package.json +0 -122
- package/web/.output/server/node_modules/tailwindcss/dist/chunk-X4GG3EDV.mjs +0 -1
- package/web/.output/server/node_modules/tailwindcss/dist/colors.mjs +0 -1
- package/web/.output/server/node_modules/tailwindcss/package.json +0 -89
- package/web/.output/server/node_modules/ufo/dist/index.mjs +0 -645
- package/web/.output/server/node_modules/ufo/package.json +0 -48
- package/web/.output/server/node_modules/unhead/dist/index.mjs +0 -9
- package/web/.output/server/node_modules/unhead/dist/parser.mjs +0 -508
- package/web/.output/server/node_modules/unhead/dist/plugins.mjs +0 -101
- package/web/.output/server/node_modules/unhead/dist/scripts.mjs +0 -30
- package/web/.output/server/node_modules/unhead/dist/server.mjs +0 -180
- package/web/.output/server/node_modules/unhead/dist/shared/unhead.B3VbJo7Y.mjs +0 -207
- package/web/.output/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +0 -43
- package/web/.output/server/node_modules/unhead/dist/shared/unhead.BnoAbrHA.mjs +0 -269
- package/web/.output/server/node_modules/unhead/dist/shared/unhead.CaI5ZD4O.mjs +0 -182
- package/web/.output/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +0 -71
- package/web/.output/server/node_modules/unhead/dist/shared/unhead.D4vSFytZ.mjs +0 -236
- package/web/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +0 -196
- package/web/.output/server/node_modules/unhead/dist/shared/unhead.Dh1cQCTe.mjs +0 -44
- package/web/.output/server/node_modules/unhead/dist/shared/unhead.TxTMM7cM.mjs +0 -166
- package/web/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +0 -38
- package/web/.output/server/node_modules/unhead/dist/utils.mjs +0 -5
- package/web/.output/server/node_modules/unhead/node_modules/hookable/dist/index.mjs +0 -257
- package/web/.output/server/node_modules/unhead/node_modules/hookable/package.json +0 -53
- package/web/.output/server/node_modules/unhead/package.json +0 -105
- package/web/.output/server/node_modules/vue/dist/vue.cjs.js +0 -80
- package/web/.output/server/node_modules/vue/dist/vue.cjs.prod.js +0 -66
- package/web/.output/server/node_modules/vue/index.js +0 -7
- package/web/.output/server/node_modules/vue/index.mjs +0 -1
- package/web/.output/server/node_modules/vue/package.json +0 -112
- package/web/.output/server/node_modules/vue/server-renderer/index.mjs +0 -1
- package/web/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +0 -249
- package/web/.output/server/node_modules/vue-bundle-renderer/package.json +0 -57
- package/web/.output/server/node_modules/vue-demi/lib/index.mjs +0 -34
- package/web/.output/server/node_modules/vue-demi/package.json +0 -47
- package/web/.output/server/node_modules/vue-router/dist/devtools-Bpr7ZAVB.js +0 -1056
- package/web/.output/server/node_modules/vue-router/dist/useApi-CROJJdhE.js +0 -436
- package/web/.output/server/node_modules/vue-router/dist/vue-router.js +0 -1543
- package/web/.output/server/node_modules/vue-router/package.json +0 -214
- package/web/.output/server/node_modules/vue-router/vue-router.node.mjs +0 -2
- package/web/.output/server/package.json +0 -51
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ npx renovate-log-parser detect-errors path/to/renovate.jsonl --out report.json
|
|
|
31
31
|
# Emit token-efficient stats for an AI coding agent
|
|
32
32
|
npx renovate-log-parser analyze path/to/renovate.jsonl
|
|
33
33
|
|
|
34
|
-
# Explore a log interactively in the
|
|
34
|
+
# Explore a log interactively in the web UI
|
|
35
35
|
npx renovate-log-parser web path/to/renovate.jsonl
|
|
36
36
|
```
|
|
37
37
|
|
|
@@ -205,9 +205,11 @@ when non-interactive, or a write failure).
|
|
|
205
205
|
|
|
206
206
|
### `web`
|
|
207
207
|
|
|
208
|
-
Starts the bundled
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
Starts the bundled web UI for interactive, filtered log exploration: a
|
|
209
|
+
statically-rendered [Nuxt](https://nuxt.com) SPA (with
|
|
210
|
+
[Nuxt UI](https://ui.nuxt.com)) served by a small
|
|
211
|
+
[Express](https://expressjs.com) server that also exposes the `/api` endpoints.
|
|
212
|
+
Pass an optional log path to open it automatically; otherwise use the in-app file
|
|
211
213
|
picker. The server keeps the parsed log in memory (SQLite-backed) and streams
|
|
212
214
|
paged rows to the client.
|
|
213
215
|
|
|
@@ -248,8 +250,8 @@ collapsible JSON tree of the full entry.
|
|
|
248
250
|
|
|
249
251
|
## Development
|
|
250
252
|
|
|
251
|
-
This repository is an npm workspace: the publishable CLI
|
|
252
|
-
the Nuxt
|
|
253
|
+
This repository is an npm workspace: the publishable CLI and the Express web
|
|
254
|
+
server live at the root (`src/`), the Nuxt frontend lives in [`web/`](./web).
|
|
253
255
|
|
|
254
256
|
```bash
|
|
255
257
|
# Install all workspace dependencies
|
|
@@ -259,10 +261,12 @@ npm install
|
|
|
259
261
|
npm run dev:cli -- detect-errors path/to/renovate.jsonl
|
|
260
262
|
npm run dev:cli -- web
|
|
261
263
|
|
|
262
|
-
# Run the
|
|
263
|
-
|
|
264
|
+
# Run the web UI in dev mode: two processes, in two terminals.
|
|
265
|
+
# The Nuxt dev server (HMR) proxies /api to the Express server on port 3001.
|
|
266
|
+
npm run dev:api # Express API on :3001 (tsx watch)
|
|
267
|
+
npm run dev:web # Nuxt dev server on :3000
|
|
264
268
|
|
|
265
|
-
# Build everything (
|
|
269
|
+
# Build everything (static SPA in web/.output/public + compiled CLI)
|
|
266
270
|
npm run build
|
|
267
271
|
|
|
268
272
|
# Run the compiled CLI
|
|
@@ -304,15 +308,15 @@ Three suites, each catching a different failure class:
|
|
|
304
308
|
- **Packaging E2E tests** (`e2e/pack-install.e2e.ts`) — build, `npm pack`,
|
|
305
309
|
install the tarball into an empty throwaway project, then drive the installed
|
|
306
310
|
`renovate-log-parser` binary against a fixture. This is the only suite that
|
|
307
|
-
can catch a missing `package.json#files` entry
|
|
308
|
-
|
|
311
|
+
can catch a missing `package.json#files` entry or a `dist/` import that only
|
|
312
|
+
resolved because `src/` sat next to it.
|
|
309
313
|
Set `SKIP_E2E=1` to skip.
|
|
310
314
|
|
|
311
315
|
Its nested `web UI` block starts the installed `web` command and drives the
|
|
312
316
|
real UI in a headless Chromium, using the `playwright-core` _library_ — there
|
|
313
317
|
is no second test runner or config file, these are plain `node:test` cases in
|
|
314
318
|
the same file. Because they run against the installed tarball, they assert
|
|
315
|
-
that the shipped
|
|
319
|
+
that the shipped server actually boots and serves the SPA, not merely that its
|
|
316
320
|
files are present. Chromium must be installed once with
|
|
317
321
|
`npx playwright-core install chromium`; when a browser test fails, a
|
|
318
322
|
screenshot, an HTML dump and the captured console/server output are written to
|
|
@@ -367,34 +371,42 @@ npm run format:check # Prettier check (no writes — useful in CI)
|
|
|
367
371
|
### How it's built
|
|
368
372
|
|
|
369
373
|
- **CLI** — TypeScript compiled with `tsc` to ESM in `dist/`. Uses
|
|
370
|
-
[`yargs`](https://yargs.js.org) for command parsing.
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
and
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
374
|
+
[`yargs`](https://yargs.js.org) for command parsing.
|
|
375
|
+
- **Frontend** — a Nuxt UI app built with `nuxt generate` and `ssr: false`, i.e.
|
|
376
|
+
a purely client-side SPA: `web/.output/public` holds an app shell plus static
|
|
377
|
+
assets, and nothing of Nitro/h3 is shipped or run. It shares the CLI's
|
|
378
|
+
filtering model and level metadata from `src/core/` (aliased into the bundle
|
|
379
|
+
as `renovate-core`), so the browser and the CLI speak about the same
|
|
380
|
+
SQLite-backed model.
|
|
381
|
+
- **Backend** — a plain Express server in [`src/server/`](./src/server),
|
|
382
|
+
compiled by the same `tsc` pass as the CLI. It imports `src/core/` through
|
|
383
|
+
ordinary relative imports (no bundler, no alias), serves the `/api` routes
|
|
384
|
+
from `api.ts`, and serves the static SPA with an `index.html` fallback so
|
|
385
|
+
client-side routing works. `log-registry.ts` holds the process-wide "current
|
|
386
|
+
log" (one open `Parser`/SQLite handle per loaded md5, plus a memoized error
|
|
387
|
+
report). The `web` command spawns `dist/server/server-main.js` as a child
|
|
388
|
+
process; when given a log path it hands it off to the UI via a `?log=` query
|
|
389
|
+
parameter.
|
|
378
390
|
|
|
379
391
|
### What gets published
|
|
380
392
|
|
|
381
393
|
Two `package.json` mechanisms cooperate so that both build outputs ship to npm:
|
|
382
394
|
|
|
383
|
-
- **`files: ["dist", "web/.output"]`** — an allow-list of what goes into the
|
|
395
|
+
- **`files: ["dist", "web/.output/public"]`** — an allow-list of what goes into the
|
|
384
396
|
published tarball. npm always adds `package.json`, `README`, `LICENSE`, and the
|
|
385
397
|
`bin` target, then includes everything matched here — both directories,
|
|
386
398
|
recursively. This list takes precedence over `.gitignore`, which is why
|
|
387
399
|
`web/.output/` (gitignored as a build artifact) is still published.
|
|
388
400
|
- **`prepublishOnly: "npm run build"`** — a lifecycle hook npm runs automatically
|
|
389
|
-
before packing on `npm publish`. It
|
|
390
|
-
CLI `dist`, so both directories exist and are current by the time the
|
|
391
|
-
allow-list is evaluated.
|
|
401
|
+
before packing on `npm publish`. It generates the static SPA and compiles the
|
|
402
|
+
CLI + server `dist`, so both directories exist and are current by the time the
|
|
403
|
+
`files` allow-list is evaluated.
|
|
392
404
|
|
|
393
405
|
```
|
|
394
406
|
npm publish
|
|
395
|
-
└─ prepublishOnly → npm run build → build:web (nuxt
|
|
396
|
-
→ build:cli (tsc
|
|
397
|
-
└─ pack tarball using `files`: dist/ + web/.output/ (+ package.json, README, LICENSE)
|
|
407
|
+
└─ prepublishOnly → npm run build → build:web (nuxt generate → web/.output/public/)
|
|
408
|
+
→ build:cli (tsc → dist/)
|
|
409
|
+
└─ pack tarball using `files`: dist/ + web/.output/public/ (+ package.json, README, LICENSE)
|
|
398
410
|
└─ upload to registry
|
|
399
411
|
```
|
|
400
412
|
|
package/dist/commands/web.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ interface WebArgs {
|
|
|
6
6
|
open: boolean;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* `web` — starts the bundled
|
|
9
|
+
* `web` — starts the bundled Express server, which serves the JSON API and the
|
|
10
|
+
* statically-rendered Nuxt SPA.
|
|
10
11
|
*/
|
|
11
12
|
export declare const webCommand: CommandModule<object, WebArgs>;
|
|
12
13
|
export {};
|
package/dist/commands/web.js
CHANGED
|
@@ -3,11 +3,18 @@ import { fileURLToPath } from "node:url";
|
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
/**
|
|
6
|
-
* Resolve the
|
|
7
|
-
* Layout after `tsc`: dist/commands/web.js →
|
|
6
|
+
* Resolve the Express server entry that ships inside this package.
|
|
7
|
+
* Layout after `tsc`: dist/commands/web.js → ../server/server-main.js
|
|
8
8
|
*/
|
|
9
9
|
function resolveServerEntry() {
|
|
10
|
-
return fileURLToPath(new URL("
|
|
10
|
+
return fileURLToPath(new URL("../server/server-main.js", import.meta.url));
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Resolve the statically-rendered SPA that the server serves.
|
|
14
|
+
* Layout after `tsc`: dist/commands/web.js → ../../web/.output/public
|
|
15
|
+
*/
|
|
16
|
+
function resolveSpaIndex() {
|
|
17
|
+
return fileURLToPath(new URL("../../web/.output/public/index.html", import.meta.url));
|
|
11
18
|
}
|
|
12
19
|
/** Best-effort, dependency-free browser opener. */
|
|
13
20
|
function openBrowser(url) {
|
|
@@ -25,11 +32,12 @@ function openBrowser(url) {
|
|
|
25
32
|
}
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
28
|
-
* `web` — starts the bundled
|
|
35
|
+
* `web` — starts the bundled Express server, which serves the JSON API and the
|
|
36
|
+
* statically-rendered Nuxt SPA.
|
|
29
37
|
*/
|
|
30
38
|
export const webCommand = {
|
|
31
39
|
command: "web [path]",
|
|
32
|
-
describe: "Start the
|
|
40
|
+
describe: "Start the web UI",
|
|
33
41
|
builder: (yargs) => yargs
|
|
34
42
|
.positional("path", {
|
|
35
43
|
type: "string",
|
|
@@ -52,10 +60,16 @@ export const webCommand = {
|
|
|
52
60
|
}),
|
|
53
61
|
handler: (argv) => {
|
|
54
62
|
const serverEntry = resolveServerEntry();
|
|
55
|
-
|
|
63
|
+
const spaIndex = resolveSpaIndex();
|
|
64
|
+
const missing = !existsSync(serverEntry)
|
|
65
|
+
? serverEntry
|
|
66
|
+
: !existsSync(spaIndex)
|
|
67
|
+
? spaIndex
|
|
68
|
+
: null;
|
|
69
|
+
if (missing) {
|
|
56
70
|
console.error("The web UI has not been built yet.\n" +
|
|
57
|
-
"
|
|
58
|
-
|
|
71
|
+
"Missing:\n " +
|
|
72
|
+
missing +
|
|
59
73
|
'\nRun "npm run build" from the package source before using the "web" command.');
|
|
60
74
|
process.exitCode = 1;
|
|
61
75
|
return;
|
|
@@ -81,12 +95,10 @@ export const webCommand = {
|
|
|
81
95
|
...process.env,
|
|
82
96
|
PORT: String(argv.port),
|
|
83
97
|
HOST: argv.host,
|
|
84
|
-
NITRO_PORT: String(argv.port),
|
|
85
|
-
NITRO_HOST: argv.host,
|
|
86
98
|
},
|
|
87
99
|
});
|
|
88
100
|
if (argv.open) {
|
|
89
|
-
// Give
|
|
101
|
+
// Give the server a moment to bind before opening the browser.
|
|
90
102
|
setTimeout(() => openBrowser(openUrl), 1000);
|
|
91
103
|
}
|
|
92
104
|
const forward = (signal) => () => {
|
package/dist/commands/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/commands/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUp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AAC,CAAC;QAE1C,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YACxB,OAAO,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `/api` Express router — the whole web backend.
|
|
3
|
+
*
|
|
4
|
+
* Every route operates on the process-wide "current log" held by the
|
|
5
|
+
* {@link ./log-registry.js log registry}; the two POST routes are what make a
|
|
6
|
+
* log current. Handlers throw {@link HttpError}s, which {@link apiErrorHandler}
|
|
7
|
+
* renders as JSON.
|
|
8
|
+
*/
|
|
9
|
+
import { Router, type NextFunction, type Request, type Response } from "express";
|
|
10
|
+
/** Build the API router. */
|
|
11
|
+
export declare function createApiRouter(): Router;
|
|
12
|
+
/**
|
|
13
|
+
* Render errors as JSON. The client composables read `statusMessage` (h3's
|
|
14
|
+
* shape), so keep that key even though there is no h3 anymore.
|
|
15
|
+
*/
|
|
16
|
+
export declare function apiErrorHandler(err: unknown, _req: Request, res: Response, next: NextFunction): void;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `/api` Express router — the whole web backend.
|
|
3
|
+
*
|
|
4
|
+
* Every route operates on the process-wide "current log" held by the
|
|
5
|
+
* {@link ./log-registry.js log registry}; the two POST routes are what make a
|
|
6
|
+
* log current. Handlers throw {@link HttpError}s, which {@link apiErrorHandler}
|
|
7
|
+
* renders as JSON.
|
|
8
|
+
*/
|
|
9
|
+
import express, { Router, } from "express";
|
|
10
|
+
import { buildQuery, buildCountQuery } from "../core/query-builder.js";
|
|
11
|
+
import { extractExpr } from "../core/filters.js";
|
|
12
|
+
import { createError, HttpError } from "./http-error.js";
|
|
13
|
+
import { loadLogFromBytes, loadLogFromPath, requireCurrentFindings, requireCurrentParser, } from "./log-registry.js";
|
|
14
|
+
import { parseFilterWire, translateFilters } from "./translate-filters.js";
|
|
15
|
+
/** Default page size for `GET /api/rows` when the client omits a limit. */
|
|
16
|
+
const DEFAULT_LIMIT = 100;
|
|
17
|
+
/** Upload cap for `POST /api/log/contents` — Renovate debug logs get big. */
|
|
18
|
+
const MAX_UPLOAD_SIZE = "2gb";
|
|
19
|
+
/** Build the API router. */
|
|
20
|
+
export function createApiRouter() {
|
|
21
|
+
const router = Router();
|
|
22
|
+
/**
|
|
23
|
+
* GET /api/fields — the distinct set of root-level JSON keys across the
|
|
24
|
+
* current log. Powers the "ignored fields" checkboxes in the UI. The
|
|
25
|
+
* synthetic keys the Parser uses for blank / malformed lines are excluded.
|
|
26
|
+
*/
|
|
27
|
+
router.get("/fields", (_req, res) => {
|
|
28
|
+
const parser = requireCurrentParser();
|
|
29
|
+
const rows = parser.query("SELECT DISTINCT je.key AS key FROM logs, json_each(logs.logentry) AS je");
|
|
30
|
+
const synthetic = new Set(["_blank", "_parseError", "_raw"]);
|
|
31
|
+
res.json(rows
|
|
32
|
+
.map((r) => r.key)
|
|
33
|
+
.filter((key) => !synthetic.has(key))
|
|
34
|
+
.sort());
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* GET /api/repositories — the distinct `repository` values across the current
|
|
38
|
+
* log, excluding git-URL sub-repos (e.g. pre-commit hooks) whose `repository`
|
|
39
|
+
* is an `https://…` URL rather than an `owner/repo` slug — these aren't real
|
|
40
|
+
* repos and just clutter the dropdown (mirrors the exclusion in
|
|
41
|
+
* `analyzer.ts`'s per-repo stats). The UI adds a "Repository-independent"
|
|
42
|
+
* pseudo-entry for entries with no `repository` — that is not returned here.
|
|
43
|
+
*/
|
|
44
|
+
router.get("/repositories", (_req, res) => {
|
|
45
|
+
const parser = requireCurrentParser();
|
|
46
|
+
const expr = extractExpr("repository");
|
|
47
|
+
const rows = parser.query(`SELECT DISTINCT ${expr} AS repo FROM logs WHERE ${expr} IS NOT NULL ORDER BY repo`);
|
|
48
|
+
res.json(rows.map((r) => r.repo).filter((repo) => !repo.startsWith("https://")));
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* GET /api/findings — the error-detector report for the current log.
|
|
52
|
+
*
|
|
53
|
+
* Per-finding `details` are stripped: the Problems panel only needs
|
|
54
|
+
* category/severity/message/line/repo, and the full entry is already reachable
|
|
55
|
+
* via `GET /api/rows` + the details slide-over.
|
|
56
|
+
*/
|
|
57
|
+
router.get("/findings", (_req, res) => {
|
|
58
|
+
const report = requireCurrentFindings();
|
|
59
|
+
const findings = report.findings.map(
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- drop `details` from the wire payload
|
|
61
|
+
({ details, ...rest }) => rest);
|
|
62
|
+
res.json({
|
|
63
|
+
summary: report.summary,
|
|
64
|
+
counts: report.counts,
|
|
65
|
+
findings,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* GET /api/rows — the paginated, filtered row feed for the current log.
|
|
70
|
+
* Query params:
|
|
71
|
+
* - `filters` : URL-encoded JSON of the reactive filter object (optional)
|
|
72
|
+
* - `offset` : rows to skip (default 0)
|
|
73
|
+
* - `limit` : max rows to return (default 100)
|
|
74
|
+
*
|
|
75
|
+
* Returns `{ total, offset, limit, rows }` where each row is a `RowDTO`:
|
|
76
|
+
* `{ _oL, ...entry }` with the ignored root fields stripped (`msg` is never
|
|
77
|
+
* stripped). `total` is the count matching the filters, ignoring pagination,
|
|
78
|
+
* so the client can drive virtualization.
|
|
79
|
+
*/
|
|
80
|
+
router.get("/rows", (req, res) => {
|
|
81
|
+
const parser = requireCurrentParser();
|
|
82
|
+
const wire = parseFilterWire(queryParam(req, "filters"));
|
|
83
|
+
const { filters, ignoredFields } = translateFilters(wire);
|
|
84
|
+
const offset = Math.max(0, parseIntParam(queryParam(req, "offset"), 0));
|
|
85
|
+
const limit = Math.max(0, parseIntParam(queryParam(req, "limit"), DEFAULT_LIMIT));
|
|
86
|
+
const countQuery = buildCountQuery(filters);
|
|
87
|
+
const total = parser.query(countQuery.sql, countQuery.params)[0]?.n ?? 0;
|
|
88
|
+
const dataQuery = buildQuery(filters, { limit, offset }, "line, logentry");
|
|
89
|
+
const rows = parser
|
|
90
|
+
.queryEntries(dataQuery.sql, dataQuery.params)
|
|
91
|
+
.map(({ line, entry }) => projectRow(line, entry, ignoredFields));
|
|
92
|
+
res.json({ total, offset, limit, rows });
|
|
93
|
+
});
|
|
94
|
+
/**
|
|
95
|
+
* POST /api/log/path — load a log from an absolute local path and make it the
|
|
96
|
+
* current log. Body: `{ "path": "<absolute>" }`. Blocks until the log is
|
|
97
|
+
* parsed (or a valid cache is reused). Returns the load metadata.
|
|
98
|
+
*
|
|
99
|
+
* This reads any local absolute path unrestricted — the tool is a local,
|
|
100
|
+
* single-user utility.
|
|
101
|
+
*/
|
|
102
|
+
router.post("/log/path", express.json(), (req, res) => {
|
|
103
|
+
const path = req.body?.path;
|
|
104
|
+
if (typeof path !== "string") {
|
|
105
|
+
throw createError({
|
|
106
|
+
statusCode: 400,
|
|
107
|
+
statusMessage: 'Request body must include a string "path".',
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
res.json(loadLogFromPath(path));
|
|
111
|
+
});
|
|
112
|
+
/**
|
|
113
|
+
* POST /api/log/contents — load a log from uploaded bytes (file picker). The
|
|
114
|
+
* bytes are written to a temp file named by their md5, which becomes the log's
|
|
115
|
+
* `path`. The file contents are sent as the raw request body.
|
|
116
|
+
*/
|
|
117
|
+
router.post("/log/contents", express.raw({ type: () => true, limit: MAX_UPLOAD_SIZE }), (req, res) => {
|
|
118
|
+
const bytes = Buffer.isBuffer(req.body) ? req.body : Buffer.alloc(0);
|
|
119
|
+
if (bytes.length === 0) {
|
|
120
|
+
throw createError({
|
|
121
|
+
statusCode: 400,
|
|
122
|
+
statusMessage: "Request body was empty.",
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
res.json(loadLogFromBytes(bytes));
|
|
126
|
+
});
|
|
127
|
+
return router;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Render errors as JSON. The client composables read `statusMessage` (h3's
|
|
131
|
+
* shape), so keep that key even though there is no h3 anymore.
|
|
132
|
+
*/
|
|
133
|
+
export function apiErrorHandler(err, _req, res, next) {
|
|
134
|
+
if (res.headersSent) {
|
|
135
|
+
next(err);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const statusCode = err instanceof HttpError ? err.statusCode : 500;
|
|
139
|
+
const statusMessage = err instanceof HttpError
|
|
140
|
+
? err.statusMessage
|
|
141
|
+
: err instanceof Error
|
|
142
|
+
? err.message
|
|
143
|
+
: "Internal server error.";
|
|
144
|
+
if (statusCode >= 500)
|
|
145
|
+
console.error(err);
|
|
146
|
+
res
|
|
147
|
+
.status(statusCode)
|
|
148
|
+
.json({ statusCode, statusMessage, message: statusMessage });
|
|
149
|
+
}
|
|
150
|
+
/** Build a RowDTO: original line + entry with ignored fields stripped. */
|
|
151
|
+
function projectRow(line, entry, ignoredFields) {
|
|
152
|
+
const stripped = new Set(ignoredFields.filter((f) => f !== "msg"));
|
|
153
|
+
const dto = { _oL: line };
|
|
154
|
+
for (const [key, value] of Object.entries(entry)) {
|
|
155
|
+
if (stripped.has(key))
|
|
156
|
+
continue;
|
|
157
|
+
dto[key] = value;
|
|
158
|
+
}
|
|
159
|
+
return dto;
|
|
160
|
+
}
|
|
161
|
+
/** Read a query parameter as a string (repeated/structured params ignored). */
|
|
162
|
+
function queryParam(req, name) {
|
|
163
|
+
const value = req.query[name];
|
|
164
|
+
return typeof value === "string" ? value : undefined;
|
|
165
|
+
}
|
|
166
|
+
/** Parse a query-string integer, falling back to a default when absent/NaN. */
|
|
167
|
+
function parseIntParam(value, fallback) {
|
|
168
|
+
if (value === undefined)
|
|
169
|
+
return fallback;
|
|
170
|
+
const parsed = Number.parseInt(value, 10);
|
|
171
|
+
return Number.isNaN(parsed) ? fallback : parsed;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=api.js.map
|
|
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C,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1C,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal HTTP error type for the Express API.
|
|
3
|
+
*
|
|
4
|
+
* Replaces h3's `createError`: handlers and the log registry throw these, and
|
|
5
|
+
* the Express error middleware in `api.ts` turns them into a JSON response.
|
|
6
|
+
* Anything that is not an {@link HttpError} is treated as a 500.
|
|
7
|
+
*/
|
|
8
|
+
/** An error carrying the HTTP status it should be reported with. */
|
|
9
|
+
export declare class HttpError extends Error {
|
|
10
|
+
readonly statusCode: number;
|
|
11
|
+
readonly statusMessage: string;
|
|
12
|
+
constructor(statusCode: number, statusMessage: string);
|
|
13
|
+
}
|
|
14
|
+
/** Create an {@link HttpError} (h3-compatible call shape). */
|
|
15
|
+
export declare function createError(options: {
|
|
16
|
+
statusCode: number;
|
|
17
|
+
statusMessage: string;
|
|
18
|
+
}): HttpError;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal HTTP error type for the Express API.
|
|
3
|
+
*
|
|
4
|
+
* Replaces h3's `createError`: handlers and the log registry throw these, and
|
|
5
|
+
* the Express error middleware in `api.ts` turns them into a JSON response.
|
|
6
|
+
* Anything that is not an {@link HttpError} is treated as a 500.
|
|
7
|
+
*/
|
|
8
|
+
/** An error carrying the HTTP status it should be reported with. */
|
|
9
|
+
export class HttpError extends Error {
|
|
10
|
+
statusCode;
|
|
11
|
+
statusMessage;
|
|
12
|
+
constructor(statusCode, statusMessage) {
|
|
13
|
+
super(statusMessage);
|
|
14
|
+
this.name = "HttpError";
|
|
15
|
+
this.statusCode = statusCode;
|
|
16
|
+
this.statusMessage = statusMessage;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Create an {@link HttpError} (h3-compatible call shape). */
|
|
20
|
+
export function createError(options) {
|
|
21
|
+
return new HttpError(options.statusCode, options.statusMessage);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=http-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-error.js","sourceRoot":"","sources":["../../src/server/http-error.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oEAAoE;AACpE,MAAM,OAAO,SAAU,SAAQ,KAAK;IACzB,UAAU,CAAS;IACnB,aAAa,CAAS;IAE/B,YAAY,UAAkB,EAAE,aAAqB;QACnD,KAAK,CAAC,aAAa,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;CACF;AAED,8DAA8D;AAC9D,MAAM,UAAU,WAAW,CAAC,OAG3B;IACC,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Express application that backs the `web` command.
|
|
3
|
+
*
|
|
4
|
+
* It does two things:
|
|
5
|
+
* 1. serves the JSON API under `/api` (see {@link ./api.js}), and
|
|
6
|
+
* 2. serves the statically-rendered Nuxt SPA (`web/.output/public`), falling
|
|
7
|
+
* back to `index.html` for unknown paths so client-side routing works.
|
|
8
|
+
*
|
|
9
|
+
* There is deliberately no server-side rendering: the SPA is a static bundle,
|
|
10
|
+
* so this process only ever pushes bytes and answers API calls.
|
|
11
|
+
*/
|
|
12
|
+
import { type Express } from "express";
|
|
13
|
+
/** Options for {@link createApp}. */
|
|
14
|
+
export interface AppOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Directory holding the built SPA. Defaults to the `web/.output/public`
|
|
17
|
+
* shipped inside this package. When it does not exist, only `/api` is served.
|
|
18
|
+
*/
|
|
19
|
+
staticDir?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Directory of the prebuilt SPA shipped in this package.
|
|
23
|
+
* Layout after `tsc`: dist/server/index.js → ../../web/.output/public
|
|
24
|
+
*/
|
|
25
|
+
export declare function defaultStaticDir(): string;
|
|
26
|
+
/** Build the Express app (API + static SPA). */
|
|
27
|
+
export declare function createApp(options?: AppOptions): Express;
|
|
28
|
+
/** Options for {@link startServer}. */
|
|
29
|
+
export interface ServeOptions extends AppOptions {
|
|
30
|
+
port: number;
|
|
31
|
+
host: string;
|
|
32
|
+
}
|
|
33
|
+
/** Start the HTTP server and resolve once it is listening. */
|
|
34
|
+
export declare function startServer(options: ServeOptions): Promise<void>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Express application that backs the `web` command.
|
|
3
|
+
*
|
|
4
|
+
* It does two things:
|
|
5
|
+
* 1. serves the JSON API under `/api` (see {@link ./api.js}), and
|
|
6
|
+
* 2. serves the statically-rendered Nuxt SPA (`web/.output/public`), falling
|
|
7
|
+
* back to `index.html` for unknown paths so client-side routing works.
|
|
8
|
+
*
|
|
9
|
+
* There is deliberately no server-side rendering: the SPA is a static bundle,
|
|
10
|
+
* so this process only ever pushes bytes and answers API calls.
|
|
11
|
+
*/
|
|
12
|
+
import express from "express";
|
|
13
|
+
import { existsSync } from "node:fs";
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
import { createApiRouter, apiErrorHandler } from "./api.js";
|
|
17
|
+
/**
|
|
18
|
+
* Directory of the prebuilt SPA shipped in this package.
|
|
19
|
+
* Layout after `tsc`: dist/server/index.js → ../../web/.output/public
|
|
20
|
+
*/
|
|
21
|
+
export function defaultStaticDir() {
|
|
22
|
+
return fileURLToPath(new URL("../../web/.output/public", import.meta.url));
|
|
23
|
+
}
|
|
24
|
+
/** Build the Express app (API + static SPA). */
|
|
25
|
+
export function createApp(options = {}) {
|
|
26
|
+
const app = express();
|
|
27
|
+
const staticDir = options.staticDir ?? defaultStaticDir();
|
|
28
|
+
app.use("/api", createApiRouter());
|
|
29
|
+
app.use("/api", apiErrorHandler);
|
|
30
|
+
const indexHtml = join(staticDir, "index.html");
|
|
31
|
+
if (existsSync(indexHtml)) {
|
|
32
|
+
app.use(express.static(staticDir));
|
|
33
|
+
// SPA fallback: anything not matched above (and not an API call) gets the
|
|
34
|
+
// app shell, which then routes client-side.
|
|
35
|
+
app.use((req, res, next) => {
|
|
36
|
+
if (req.method !== "GET" && req.method !== "HEAD")
|
|
37
|
+
return next();
|
|
38
|
+
res.sendFile("index.html", { root: staticDir });
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return app;
|
|
42
|
+
}
|
|
43
|
+
/** Start the HTTP server and resolve once it is listening. */
|
|
44
|
+
export function startServer(options) {
|
|
45
|
+
const app = createApp(options);
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
const server = app.listen(options.port, options.host, () => {
|
|
48
|
+
console.log(`renovate-log-parser web UI listening on http://${options.host}:${options.port}`);
|
|
49
|
+
resolve();
|
|
50
|
+
});
|
|
51
|
+
server.on("error", reject);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,OAAyB,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAW5D;;;GAGG;AACH,MAAM,UAAU,gBAAgB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AAO,CAAC,IAAI,EAAE,GAAG,EAAE;YACzD,OAAO,CAAC,GAAG,CACT,kDAAkD,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE,CACjF,CAAC;YACF,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Parser } from "../core/parser.js";
|
|
2
|
+
import { type DetectionReport } from "../core/error-detector.js";
|
|
3
|
+
/** Public metadata returned to the client after a successful load. */
|
|
4
|
+
export interface LoadedLogInfo {
|
|
5
|
+
md5: string;
|
|
6
|
+
path: string;
|
|
7
|
+
totalLines: number;
|
|
8
|
+
levelCounts: Record<string, number>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Load a log from an absolute filesystem path and make it current.
|
|
12
|
+
*
|
|
13
|
+
* @throws {HttpError} when the path is not absolute / missing, or the parse
|
|
14
|
+
* fails — the route layer maps these to HTTP responses.
|
|
15
|
+
*/
|
|
16
|
+
export declare function loadLogFromPath(rawPath: string): LoadedLogInfo;
|
|
17
|
+
/**
|
|
18
|
+
* Persist uploaded bytes to a temp file (named by their md5) and load it. The
|
|
19
|
+
* temp copy becomes the log's `path`, mirroring the on-disk load path.
|
|
20
|
+
*/
|
|
21
|
+
export declare function loadLogFromBytes(bytes: Uint8Array): LoadedLogInfo;
|
|
22
|
+
/**
|
|
23
|
+
* Return the parser for the current log, or throw a 409 when none is loaded.
|
|
24
|
+
* The GET routes call this first.
|
|
25
|
+
*/
|
|
26
|
+
export declare function requireCurrentParser(): Parser;
|
|
27
|
+
/**
|
|
28
|
+
* Return the error-detector report for the current log, computing (and caching)
|
|
29
|
+
* it on first request. Runs without ignore rules — the web surfaces every
|
|
30
|
+
* finding. Throws a 409 when no log is loaded (via {@link requireCurrentEntry}).
|
|
31
|
+
*/
|
|
32
|
+
export declare function requireCurrentFindings(): DetectionReport;
|
|
33
|
+
/** Count entries per numeric `level` via a single grouped SQL scan. */
|
|
34
|
+
export declare function computeLevelCounts(parser: Parser): Record<string, number>;
|