From 6219b959a762e7549e3ad90a8dba891dc933af91 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 28 Oct 2023 11:36:30 +0400 Subject: [PATCH 01/72] seed fsd structure --- .eslintrc => .eslintrc.json | 21 ++- .storybook/main.ts | 1 + package.json | 2 + src/.eslintrc.json | 3 + src/app/.gitkeep | 0 src/entities/.gitkeep | 0 src/features/.gitkeep | 0 src/screens/.gitkeep | 0 src/shared/.gitkeep | 0 src/widgets/.gitkeep | 0 yarn.lock | 312 +++++++++++++++++++++++++++++++++++- 11 files changed, 329 insertions(+), 10 deletions(-) rename .eslintrc => .eslintrc.json (65%) create mode 100644 src/.eslintrc.json create mode 100644 src/app/.gitkeep create mode 100644 src/entities/.gitkeep create mode 100644 src/features/.gitkeep create mode 100644 src/screens/.gitkeep create mode 100644 src/shared/.gitkeep create mode 100644 src/widgets/.gitkeep diff --git a/.eslintrc b/.eslintrc.json similarity index 65% rename from .eslintrc rename to .eslintrc.json index 8c837062..9a0ca9ae 100644 --- a/.eslintrc +++ b/.eslintrc.json @@ -13,7 +13,12 @@ "parser": "vue-eslint-parser", "plugins": ["@typescript-eslint"], "root": true, - "ignorePatterns": ["package.json", "postcss.config.js","tailwind.config.js", "vendor/"], + "ignorePatterns": [ + "package.json", + "postcss.config.js", + "tailwind.config.js", + "vendor/" + ], "parserOptions": { "project": "./tsconfig.json", "extraFileExtensions": [".vue"], @@ -24,10 +29,14 @@ }, "rules": { "import/prefer-default-export": "off", - "no-console": ["error", { "allow": ["info","warn", "error"] }], - "vue/component-name-in-template-casing": ["error", "PascalCase", { - "registeredComponentsOnly": true, - "ignores": [] - }] + "no-console": ["error", { "allow": ["info", "warn", "error"] }], + "vue/component-name-in-template-casing": [ + "error", + "PascalCase", + { + "registeredComponentsOnly": true, + "ignores": [] + } + ] } } diff --git a/.storybook/main.ts b/.storybook/main.ts index f6318872..6888c3a7 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -10,6 +10,7 @@ module.exports = { "../components/**/*.stories.@(js|jsx|ts|tsx)", "../layouts/**/*.stories.@(js|jsx|ts|tsx)", "../pages/**/*.stories.@(js|jsx|ts|tsx)", + "../src/**/**/**/*.stories.@(js|jsx|ts|tsx)", ], addons: [ "@storybook/addon-links", diff --git a/package.json b/package.json index 41ba6e1c..76d5809f 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "*.{js,css,md}": "prettier --write" }, "devDependencies": { + "@conarti/eslint-plugin-feature-sliced": "^1.0.5", "@nuxtjs/eslint-config-typescript": "^12.0.0", "@nuxtjs/tailwindcss": "^6.2.0", "@storybook/addon-essentials": "^6.5.15", @@ -46,6 +47,7 @@ "eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^8.6.0", + "eslint-plugin-import": "^2.29.0", "eslint-plugin-nuxt": "^4.0.0", "eslint-plugin-vue": "^9.9.0", "husky": "^8.0.3", diff --git a/src/.eslintrc.json b/src/.eslintrc.json new file mode 100644 index 00000000..4abc62ff --- /dev/null +++ b/src/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": ["../.eslintrc.json", "plugin:@conarti/feature-sliced/recommended"] +} diff --git a/src/app/.gitkeep b/src/app/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/entities/.gitkeep b/src/entities/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/features/.gitkeep b/src/features/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/screens/.gitkeep b/src/screens/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/shared/.gitkeep b/src/shared/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/widgets/.gitkeep b/src/widgets/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/yarn.lock b/yarn.lock index 7c32e4d7..cc74fc1c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1270,6 +1270,13 @@ resolved "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== +"@conarti/eslint-plugin-feature-sliced@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@conarti/eslint-plugin-feature-sliced/-/eslint-plugin-feature-sliced-1.0.5.tgz#7f177b673256f066221a73363f2f1b6a5a8612bc" + integrity sha512-Gx90Zupi8nv6cCP3O6cYWE9GT4RIw0D9JBHWeUwXEv7qmjCd3dXSqDEmQchN7k41hhCPupZvMevH4JrSORcVjQ== + dependencies: + picomatch "^2.3.1" + "@csstools/cascade-layer-name-parser@^1.0.3": version "1.0.3" resolved "https://registry.npmjs.org/@csstools/cascade-layer-name-parser/-/cascade-layer-name-parser-1.0.3.tgz" @@ -4250,6 +4257,17 @@ array-includes@^3.0.3, array-includes@^3.1.6: get-intrinsic "^1.1.3" is-string "^1.0.7" +array-includes@^3.1.7: + version "3.1.7" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.7.tgz#8cd2e01b26f7a3086cbc87271593fe921c62abda" + integrity sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + is-string "^1.0.7" + array-union@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz" @@ -4272,6 +4290,17 @@ array-unique@^0.3.2: resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz" integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== +array.prototype.findlastindex@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz#b37598438f97b579166940814e2c0493a4f50207" + integrity sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + get-intrinsic "^1.2.1" + array.prototype.flat@^1.2.1, array.prototype.flat@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz" @@ -4282,6 +4311,16 @@ array.prototype.flat@^1.2.1, array.prototype.flat@^1.3.1: es-abstract "^1.20.4" es-shim-unscopables "^1.0.0" +array.prototype.flat@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz#1476217df8cff17d72ee8f3ba06738db5b387d18" + integrity sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + array.prototype.flatmap@^1.2.1, array.prototype.flatmap@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz" @@ -4292,6 +4331,16 @@ array.prototype.flatmap@^1.2.1, array.prototype.flatmap@^1.3.1: es-abstract "^1.20.4" es-shim-unscopables "^1.0.0" +array.prototype.flatmap@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz#c9a7c6831db8e719d6ce639190146c24bbd3e527" + integrity sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + array.prototype.map@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.5.tgz" @@ -4326,6 +4375,19 @@ arraybuffer.prototype.slice@^1.0.1: is-array-buffer "^3.0.2" is-shared-array-buffer "^1.0.2" +arraybuffer.prototype.slice@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz#98bd561953e3e74bb34938e77647179dfe6e9f12" + integrity sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + arrify@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz" @@ -4994,6 +5056,15 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" +call-bind@^1.0.4, call-bind@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.5.tgz#6fa2b7845ce0ea49bf4d8b9ef64727a2c2e2e513" + integrity sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ== + dependencies: + function-bind "^1.1.2" + get-intrinsic "^1.2.1" + set-function-length "^1.1.1" + call-me-maybe@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz" @@ -6208,6 +6279,15 @@ define-data-property@^1.0.1: gopd "^1.0.1" has-property-descriptors "^1.0.0" +define-data-property@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" + integrity sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz" @@ -6668,6 +6748,51 @@ es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.2: unbox-primitive "^1.0.2" which-typed-array "^1.1.10" +es-abstract@^1.22.1: + version "1.22.3" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.3.tgz#48e79f5573198de6dee3589195727f4f74bc4f32" + integrity sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA== + dependencies: + array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.2" + available-typed-arrays "^1.0.5" + call-bind "^1.0.5" + es-set-tostringtag "^2.0.1" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.6" + get-intrinsic "^1.2.2" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.12" + is-weakref "^1.0.2" + object-inspect "^1.13.1" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.1" + safe-array-concat "^1.0.1" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.8" + string.prototype.trimend "^1.0.7" + string.prototype.trimstart "^1.0.7" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" + typed-array-byte-offset "^1.0.0" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.13" + es-array-method-boxes-properly@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz" @@ -6836,6 +6961,15 @@ eslint-import-resolver-node@^0.3.7: is-core-module "^2.11.0" resolve "^1.22.1" +eslint-import-resolver-node@^0.3.9: + version "0.3.9" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" + integrity sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== + dependencies: + debug "^3.2.7" + is-core-module "^2.13.0" + resolve "^1.22.4" + eslint-import-resolver-typescript@^3.5.2: version "3.5.5" resolved "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.5.5.tgz" @@ -6850,7 +6984,7 @@ eslint-import-resolver-typescript@^3.5.2: is-glob "^4.0.3" synckit "^0.8.5" -eslint-module-utils@^2.7.4: +eslint-module-utils@^2.7.4, eslint-module-utils@^2.8.0: version "2.8.0" resolved "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz" integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== @@ -6894,6 +7028,29 @@ eslint-plugin-import@^2.26.0: semver "^6.3.0" tsconfig-paths "^3.14.1" +eslint-plugin-import@^2.29.0: + version "2.29.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.29.0.tgz#8133232e4329ee344f2f612885ac3073b0b7e155" + integrity sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg== + dependencies: + array-includes "^3.1.7" + array.prototype.findlastindex "^1.2.3" + array.prototype.flat "^1.3.2" + array.prototype.flatmap "^1.3.2" + debug "^3.2.7" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.9" + eslint-module-utils "^2.8.0" + hasown "^2.0.0" + is-core-module "^2.13.1" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.fromentries "^2.0.7" + object.groupby "^1.0.1" + object.values "^1.1.7" + semver "^6.3.1" + tsconfig-paths "^3.14.2" + eslint-plugin-n@^15.5.1: version "15.7.0" resolved "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz" @@ -7749,6 +7906,11 @@ function-bind@^1.1.1: resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + function.prototype.name@^1.1.0, function.prototype.name@^1.1.5: version "1.1.5" resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz" @@ -7759,6 +7921,16 @@ function.prototype.name@^1.1.0, function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" +function.prototype.name@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" + integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + functions-have-names "^1.2.3" + functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz" @@ -7809,6 +7981,16 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@ has-proto "^1.0.1" has-symbols "^1.0.3" +get-intrinsic@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.2.tgz#281b7622971123e1ef4b3c90fd7539306da93f3b" + integrity sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA== + dependencies: + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" @@ -8206,6 +8388,13 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" +hasown@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" + integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== + dependencies: + function-bind "^1.1.2" + hast-to-hyperscript@^9.0.0: version "9.0.1" resolved "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz" @@ -8738,6 +8927,13 @@ is-core-module@^2.11.0: dependencies: has "^1.0.3" +is-core-module@^2.13.0, is-core-module@^2.13.1: + version "2.13.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" + integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== + dependencies: + hasown "^2.0.0" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz" @@ -9020,7 +9216,7 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" -is-typed-array@^1.1.10, is-typed-array@^1.1.3, is-typed-array@^1.1.9: +is-typed-array@^1.1.10, is-typed-array@^1.1.12, is-typed-array@^1.1.3, is-typed-array@^1.1.9: version "1.1.12" resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz" integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== @@ -10624,6 +10820,11 @@ object-inspect@^1.12.3, object-inspect@^1.9.0: resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== +object-inspect@^1.13.1: + version "1.13.1" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" + integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== + object-is@^1.0.1: version "1.1.5" resolved "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz" @@ -10672,6 +10873,15 @@ object.entries@^1.1.0, object.entries@^1.1.5: define-properties "^1.1.4" es-abstract "^1.20.4" +object.fromentries@^2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.7.tgz#71e95f441e9a0ea6baf682ecaaf37fa2a8d7e616" + integrity sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.2: version "2.1.6" resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.6.tgz" @@ -10683,6 +10893,16 @@ object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.2 es-abstract "^1.21.2" safe-array-concat "^1.0.0" +object.groupby@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.1.tgz#d41d9f3c8d6c778d9cbac86b4ee9f5af103152ee" + integrity sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + object.pick@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz" @@ -10699,6 +10919,15 @@ object.values@^1.1.0, object.values@^1.1.6: define-properties "^1.1.4" es-abstract "^1.20.4" +object.values@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.7.tgz#617ed13272e7e1071b43973aa1655d9291b8442a" + integrity sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + ofetch@^1.0.1, ofetch@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/ofetch/-/ofetch-1.1.1.tgz" @@ -12485,6 +12714,15 @@ regexp.prototype.flags@^1.4.3, regexp.prototype.flags@^1.5.0: define-properties "^1.2.0" functions-have-names "^1.2.3" +regexp.prototype.flags@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e" + integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + set-function-name "^2.0.0" + regexpp@^3.0.0, regexpp@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz" @@ -12671,6 +12909,15 @@ resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.14.2, resolve@^1.15 path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@^1.22.4: + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz" @@ -12773,7 +13020,7 @@ rxjs@^7.8.0: dependencies: tslib "^2.1.0" -safe-array-concat@^1.0.0: +safe-array-concat@^1.0.0, safe-array-concat@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz" integrity sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q== @@ -12989,6 +13236,25 @@ set-blocking@^2.0.0: resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-function-length@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.1.1.tgz#4bc39fafb0307224a33e106a7d35ca1218d659ed" + integrity sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ== + dependencies: + define-data-property "^1.1.1" + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + +set-function-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== + dependencies: + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" + set-value@^2.0.0, set-value@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz" @@ -13436,6 +13702,15 @@ string.prototype.trim@^1.2.7: define-properties "^1.1.4" es-abstract "^1.20.4" +string.prototype.trim@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd" + integrity sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string.prototype.trimend@^1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz" @@ -13445,6 +13720,15 @@ string.prototype.trimend@^1.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +string.prototype.trimend@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz#1bb3afc5008661d73e2dc015cd4853732d6c471e" + integrity sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string.prototype.trimstart@^1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz" @@ -13454,6 +13738,15 @@ string.prototype.trimstart@^1.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +string.prototype.trimstart@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz#d4cdb44b83a4737ffbac2d406e405d43d0184298" + integrity sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" @@ -14016,7 +14309,7 @@ ts-pnp@^1.1.6: resolved "https://registry.npmjs.org/ts-pnp/-/ts-pnp-1.2.0.tgz" integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw== -tsconfig-paths@^3.14.1: +tsconfig-paths@^3.14.1, tsconfig-paths@^3.14.2: version "3.14.2" resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz" integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== @@ -15022,6 +15315,17 @@ which-typed-array@^1.1.10, which-typed-array@^1.1.11, which-typed-array@^1.1.2: gopd "^1.0.1" has-tostringtag "^1.0.0" +which-typed-array@^1.1.13: + version "1.1.13" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.13.tgz#870cd5be06ddb616f504e7b039c4c24898184d36" + integrity sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.4" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + which@^1.2.9: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz" From 4b29b4107e8e0c09f81806711fb3b4ac796fda7d Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 28 Oct 2023 13:19:21 +0400 Subject: [PATCH 02/72] move icon-svg to fsd structure --- .storybook/main.ts | 2 +- components/CodeSnippet/CodeSnippet.vue | 2 +- components/LayoutSidebar/LayoutSidebar.vue | 2 +- components/PageHeader/PageHeader.vue | 2 +- .../PagePlaceholder/PagePlaceholder.vue | 2 +- .../PreviewCardFooter/PreviewCardFooter.vue | 2 +- .../PreviewCardHeader/PreviewCardHeader.vue | 2 +- .../ProfilerPageCallGraph.vue | 2 +- .../RayTypesPreview/MailablePayload.vue | 68 +++++++++++++------ .../SentryExceptionFrame.vue | 2 +- .../SmtpPagePreview/SmtpPagePreview.vue | 2 +- pages/settings.vue | 2 +- src/shared/.gitkeep | 0 .../icon-svg-originals}/collapsed.svg | 0 .../icon-svg-originals}/connected.svg | 0 .../ui/icon-svg/icon-svg-originals}/copy.svg | 0 .../ui/icon-svg/icon-svg-originals}/dd.svg | 0 .../icon-svg-originals}/desktop-device.svg | 0 .../icon-svg-originals}/disconnected.svg | 0 .../ui/icon-svg/icon-svg-originals}/docs.svg | 0 .../icon-svg/icon-svg-originals}/events.svg | 0 .../icon-svg-originals}/fullscreen.svg | 0 .../icon-svg/icon-svg-originals}/github.svg | 0 .../icon-svg-originals}/heartBeat.svg | 0 .../ui/icon-svg/icon-svg-originals}/host.svg | 0 .../icon-svg-originals}/http-dumps.svg | 0 .../icon-svg-originals}/inspector.svg | 0 .../icon-svg/icon-svg-originals}/lock-off.svg | 0 .../ui/icon-svg/icon-svg-originals}/lock.svg | 0 .../ui/icon-svg/icon-svg-originals}/logo.svg | 0 .../icon-svg/icon-svg-originals}/logout.svg | 0 .../ui/icon-svg/icon-svg-originals}/minus.svg | 0 .../icon-svg-originals}/mobile-device.svg | 0 .../ui/icon-svg/icon-svg-originals}/moon.svg | 0 .../icon-svg-originals}/newScreen.svg | 0 .../ui/icon-svg/icon-svg-originals}/plus.svg | 0 .../icon-svg/icon-svg-originals}/profiler.svg | 0 .../icon-svg/icon-svg-originals}/screen.svg | 0 .../icon-svg/icon-svg-originals}/sentry.svg | 0 .../icon-svg/icon-svg-originals}/settings.svg | 0 .../ui/icon-svg/icon-svg-originals}/smtp.svg | 0 .../ui/icon-svg/icon-svg-originals}/sun.svg | 0 .../icon-svg-originals}/tablet-device.svg | 0 .../ui/icon-svg/icon-svg-originals}/times.svg | 0 .../icon-svg-originals}/trash-bin.svg | 0 .../shared/ui/icon-svg/icon-svg.stories.ts | 4 +- .../shared/ui/icon-svg/icon-svg.vue | 62 ++++++++--------- src/shared/ui/icon-svg/index.ts | 3 + src/shared/ui/index.ts | 1 + 49 files changed, 94 insertions(+), 66 deletions(-) delete mode 100644 src/shared/.gitkeep rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/collapsed.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/connected.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/copy.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/dd.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/desktop-device.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/disconnected.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/docs.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/events.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/fullscreen.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/github.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/heartBeat.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/host.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/http-dumps.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/inspector.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/lock-off.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/lock.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/logo.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/logout.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/minus.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/mobile-device.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/moon.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/newScreen.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/plus.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/profiler.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/screen.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/sentry.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/settings.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/smtp.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/sun.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/tablet-device.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/times.svg (100%) rename {components/IconSvg => src/shared/ui/icon-svg/icon-svg-originals}/trash-bin.svg (100%) rename components/IconSvg/IconSvg.stories.ts => src/shared/ui/icon-svg/icon-svg.stories.ts (92%) rename components/IconSvg/IconSvg.vue => src/shared/ui/icon-svg/icon-svg.vue (95%) create mode 100644 src/shared/ui/icon-svg/index.ts create mode 100644 src/shared/ui/index.ts diff --git a/.storybook/main.ts b/.storybook/main.ts index 6888c3a7..8d9f1cb3 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -68,7 +68,7 @@ module.exports = { }; }, env: (config) => { - const iconComponentFolder = path.resolve(__dirname, '../components/IconSvg'); + const iconComponentFolder = path.resolve(__dirname, '../src/shared/ui/icon-svg/icon-svg-originals'); const allIconNamesList = !fs.existsSync(iconComponentFolder) ? [] : fs diff --git a/components/CodeSnippet/CodeSnippet.vue b/components/CodeSnippet/CodeSnippet.vue index b480e6a9..8b5e4973 100644 --- a/components/CodeSnippet/CodeSnippet.vue +++ b/components/CodeSnippet/CodeSnippet.vue @@ -14,7 +14,7 @@ + + + + + + + + + + + + +` diff --git a/src/shared/mocks/index.ts b/src/shared/mocks/index.ts new file mode 100644 index 00000000..4ad6f3cc --- /dev/null +++ b/src/shared/mocks/index.ts @@ -0,0 +1,4 @@ +import HTMLCode from './html-code'; +import PHPCode from './php-code'; + +export { HTMLCode, PHPCode }; diff --git a/src/shared/mocks/php-code.ts b/src/shared/mocks/php-code.ts new file mode 100644 index 00000000..93927235 --- /dev/null +++ b/src/shared/mocks/php-code.ts @@ -0,0 +1,20 @@ +export default `use RoadRunner\\Centrifugo\\CentrifugoApiInterface; + +final class UserBanService +{ + public function __construct( + private readonly UserRepository $repository, + private readonly CentrifugoApiInterface $ws + ) {} + + public function handle(string $userUuid): void + { + $user = $this->repository->findByPK($userUuid); + + // Ban user... + + // Disconnect from webscoket server + $this->ws->disconnect($user->getId()); + } +} +` diff --git a/components/CodeSnippet/CodeSnippet.stories.ts b/src/widgets/ui/code-snippet/code-snippet.stories.ts similarity index 57% rename from components/CodeSnippet/CodeSnippet.stories.ts rename to src/widgets/ui/code-snippet/code-snippet.stories.ts index 99317f4e..96b2d8ec 100644 --- a/components/CodeSnippet/CodeSnippet.stories.ts +++ b/src/widgets/ui/code-snippet/code-snippet.stories.ts @@ -1,10 +1,10 @@ import { Meta, Story } from "@storybook/vue3"; import { EVENT_TYPES } from "~/config/constants"; -import CodeSnippet from "~/components/CodeSnippet/CodeSnippet.vue"; -import { HTML } from '@/mocks/mail'; +import { HTMLCode, PHPCode } from '@/src/shared/mocks'; +import CodeSnippet from "./code-snippet.vue"; export default { - title: "Components/CodeSnippet", + title: "FSD/Widgets/CodeSnippet", component: CodeSnippet, } as Meta; @@ -18,6 +18,12 @@ const Template: Story = (args) => ({ template: ``, }); +export const Default = Template.bind({}); +Default.args = { + code: "Hello World!", + language: 'text' +}; + export const Object = Template.bind({}); Object.args = { code: { @@ -36,31 +42,10 @@ Object.args = { export const HTMLString = Template.bind({}); HTMLString.args = { - code: HTML, + code: HTMLCode, language: 'html' }; -const PHPCode = `use RoadRunner\\Centrifugo\\CentrifugoApiInterface; - -final class UserBanService -{ - public function __construct( - private readonly UserRepository $repository, - private readonly CentrifugoApiInterface $ws - ) {} - - public function handle(string $userUuid): void - { - $user = $this->repository->findByPK($userUuid); - - // Ban user... - - // Disconnect from webscoket server - $this->ws->disconnect($user->getId()); - } -} -` - export const PHPString = Template.bind({}); PHPString.args = { code: PHPCode, diff --git a/components/CodeSnippet/CodeSnippet.vue b/src/widgets/ui/code-snippet/code-snippet.vue similarity index 94% rename from components/CodeSnippet/CodeSnippet.vue rename to src/widgets/ui/code-snippet/code-snippet.vue index 8b5e4973..00440b1f 100644 --- a/components/CodeSnippet/CodeSnippet.vue +++ b/src/widgets/ui/code-snippet/code-snippet.vue @@ -1,6 +1,6 @@ + + + + diff --git a/src/widgets/ui/render-graph/types.ts b/src/widgets/ui/render-graph/types.ts new file mode 100644 index 00000000..e69de29b From c8aebfec4e1fbbd451e72572c4e6de89c258e1bb Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 28 Oct 2023 16:45:31 +0400 Subject: [PATCH 08/72] move utils-formats to new structure --- .../SentryPageDevice/SentryPageDevice.vue | 8 ++- components/SmtpAttachment/SmtpAttachment.vue | 6 ++- components/StatBoard/StatBoard.vue | 8 +-- utils/formats.test.ts | 34 ------------- utils/formats.ts | 51 ------------------- 5 files changed, 15 insertions(+), 92 deletions(-) delete mode 100644 utils/formats.test.ts delete mode 100644 utils/formats.ts diff --git a/components/SentryPageDevice/SentryPageDevice.vue b/components/SentryPageDevice/SentryPageDevice.vue index 79a58a5d..774ac8c2 100644 --- a/components/SentryPageDevice/SentryPageDevice.vue +++ b/components/SentryPageDevice/SentryPageDevice.vue @@ -122,10 +122,12 @@ - - diff --git a/src/widgets/ui/code-snippet/constants.ts b/src/widgets/ui/code-snippet/constants.ts deleted file mode 100644 index e69de29b..00000000 From 19ec35f03abb83984d8e23d5ddae3497b3199de6 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 28 Oct 2023 18:45:23 +0400 Subject: [PATCH 10/72] move cytoscape types from utils --- config/types.ts | 20 -------------------- src/shared/lib/cytoscape/prepare-data.ts | 13 +++++++------ src/shared/lib/cytoscape/types.ts | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 26 deletions(-) create mode 100644 src/shared/lib/cytoscape/types.ts diff --git a/config/types.ts b/config/types.ts index 199bb392..3bfc04dd 100644 --- a/config/types.ts +++ b/config/types.ts @@ -285,7 +285,6 @@ export interface HttpDump { export interface ProfilerCost { [key: string]: number, - "ct": number, "wt": number, "cpu": number, @@ -390,25 +389,6 @@ export interface NormalizedEvent { payload: Monolog | SMTP | Sentry | VarDump | Profiler | Inspector | HttpDump | RayDump | unknown } -export type TGraphNode = { - data: { - id: string, - name: string, - cost?: ProfilerCost, - color?: string, - textColor?: string - } -} - -export type TGraphEdge = { - data: { - id?: string, - source: string, - target: string, - label?: string, - color?: string, - } -} export enum GraphTypes { CPU= 'cpu' , diff --git a/src/shared/lib/cytoscape/prepare-data.ts b/src/shared/lib/cytoscape/prepare-data.ts index ae464bbc..2291f38a 100644 --- a/src/shared/lib/cytoscape/prepare-data.ts +++ b/src/shared/lib/cytoscape/prepare-data.ts @@ -1,6 +1,7 @@ -import { GraphTypes, ProfilerEdge, ProfilerEdges, TGraphEdge, TGraphNode } from "~/config/types"; -import {useFormats} from "../formats"; // TODO: need to move types to FSD structure +import { GraphTypes, ProfilerEdge, ProfilerEdges } from "~/config/types"; +import { useFormats } from "../formats"; +import { TEdge, TNode } from "./types"; const { formatDuration, formatFileSize } = useFormats(); const formatValue = (value: number, metric: string): string | number => { @@ -27,8 +28,8 @@ export const prepareData: ( metric: GraphTypes, threshold: number ) => ({ - nodes: TGraphNode[], - edges: TGraphEdge[] + nodes: TNode[], + edges: TEdge[] }) = (edges: ProfilerEdges, metric , threshold = 1) => Object.values(edges) .reduce((arr, edge: ProfilerEdge, index) => { @@ -65,6 +66,6 @@ export const prepareData: ( return arr }, { - nodes: [] as TGraphNode[], - edges: [] as TGraphEdge[] + nodes: [] as TNode[], + edges: [] as TEdge[] }); diff --git a/src/shared/lib/cytoscape/types.ts b/src/shared/lib/cytoscape/types.ts new file mode 100644 index 00000000..d4fdbdd5 --- /dev/null +++ b/src/shared/lib/cytoscape/types.ts @@ -0,0 +1,21 @@ +import { ProfilerCost } from "~/config/types"; + +export type TNode = { + data: { + id: string, + name: string, + cost?: ProfilerCost, + color?: string, + textColor?: string + } +} + +export type TEdge = { + data: { + id?: string, + source: string, + target: string, + label?: string, + color?: string, + } +} From b6b9006c87a0cdfe6deec69882747cb1a057eff6 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 28 Oct 2023 19:04:33 +0400 Subject: [PATCH 11/72] move statboard to new file structure --- components/ProfilerPage/ProfilerPage.vue | 2 +- .../ProfilerPageCallGraph.vue | 3 +- .../ProfilerPreview/ProfilerPreview.vue | 2 +- config/types.ts | 2 +- nuxt.config.ts | 1 - src/entities/.gitkeep | 0 src/entities/lib/index.ts | 1 + src/entities/lib/normalize-event/index.ts | 2 + .../normalize-profile-event.ts | 13 + .../normalize-event/use-normalize-event.ts | 11 + src/entities/profiler/mocks/index.ts | 5 + src/entities/profiler/mocks/profiler.json | 23508 ++++++++++++++++ src/shared/ui/icon-svg/icon-svg.stories.ts | 2 +- .../ui/code-snippet/code-snippet.stories.ts | 2 +- src/widgets/ui/index.ts | 1 + src/widgets/ui/stat-board/index.ts | 5 + .../ui/stat-board/stat-board.stories.ts | 15 +- .../widgets/ui/stat-board/stat-board.vue | 81 +- 18 files changed, 23599 insertions(+), 57 deletions(-) delete mode 100644 src/entities/.gitkeep create mode 100644 src/entities/lib/index.ts create mode 100644 src/entities/lib/normalize-event/index.ts create mode 100644 src/entities/lib/normalize-event/normalize-profile-event.ts create mode 100644 src/entities/lib/normalize-event/use-normalize-event.ts create mode 100644 src/entities/profiler/mocks/index.ts create mode 100644 src/entities/profiler/mocks/profiler.json create mode 100644 src/widgets/ui/stat-board/index.ts rename components/StatBoard/StatBoard.stories.ts => src/widgets/ui/stat-board/stat-board.stories.ts (56%) rename components/StatBoard/StatBoard.vue => src/widgets/ui/stat-board/stat-board.vue (56%) diff --git a/components/ProfilerPage/ProfilerPage.vue b/components/ProfilerPage/ProfilerPage.vue index 2f8f4e94..54815b00 100644 --- a/components/ProfilerPage/ProfilerPage.vue +++ b/components/ProfilerPage/ProfilerPage.vue @@ -59,7 +59,7 @@ + - - - - - - - - - - - - - - -` From 0be76aab5a6fd5b5824810ddefbb25b1db09ec45 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 28 Oct 2023 19:39:09 +0400 Subject: [PATCH 15/72] move monolog mocks to new structure --- components/MonologPreview/MonologPreview.stories.ts | 4 ++-- .../PreviewEventMapper/PreviewEventMapper.stories.ts | 8 ++++---- components/PreviewFallback/PreviewFallback.stories.ts | 4 ++-- src/entities/monolog/mocks/index.ts | 5 +++++ {mocks => src/entities/monolog/mocks}/monolog.json | 0 5 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 src/entities/monolog/mocks/index.ts rename {mocks => src/entities/monolog/mocks}/monolog.json (100%) diff --git a/components/MonologPreview/MonologPreview.stories.ts b/components/MonologPreview/MonologPreview.stories.ts index f8e8b400..670ef604 100644 --- a/components/MonologPreview/MonologPreview.stories.ts +++ b/components/MonologPreview/MonologPreview.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeMonologEvent } from "~/utils/normalize-event"; -import monologEventMock from '~/mocks/monolog.json' import MonologPreview from '~/components/MonologPreview/MonologPreview.vue'; +import { monologMock } from '~/src/entities/monolog/mocks' export default { title: "Monolog/Components/Preview", @@ -21,5 +21,5 @@ const Template: Story = (args) => ({ export const Event = Template.bind({}); Event.args = { - event: normalizeMonologEvent(monologEventMock), + event: normalizeMonologEvent(monologMock), }; diff --git a/components/PreviewEventMapper/PreviewEventMapper.stories.ts b/components/PreviewEventMapper/PreviewEventMapper.stories.ts index a73133b1..bd3eadf1 100644 --- a/components/PreviewEventMapper/PreviewEventMapper.stories.ts +++ b/components/PreviewEventMapper/PreviewEventMapper.stories.ts @@ -1,12 +1,12 @@ import { Meta, Story } from "@storybook/vue3"; import PreviewEventMapper from "~/components/PreviewEventMapper/PreviewEventMapper.vue"; -import monologEventMock from "~/mocks/monolog.json"; import sentryEventMock from "~/mocks/sentry-spiral.json"; import smtpEventMock from "~/mocks/smtp-welcome.json"; import varDumpEventMock from "~/mocks/var-dump-object.json"; import inspectorEventMock from "~/mocks/inspector.json"; import httpDumpEventMock from "~/mocks/http-dump.json"; import { profilerMock } from "~/src/entities/profiler/mocks"; +import { monologMock } from '~/src/entities/monolog/mocks' export default { title: "Preview/PreviewEventMapper", @@ -32,7 +32,7 @@ Default.args = { export const Monolog = Template.bind({}); Monolog.args = { - event: monologEventMock, + event: monologMock, }; export const Sentry = Template.bind({}); @@ -71,11 +71,11 @@ HttpDump.args = { }; const eventsList = [ - monologEventMock, + monologMock, sentryEventMock, smtpEventMock, varDumpEventMock, - profilerEventMock, + profilerMock, inspectorEventMock, httpDumpEventMock, ]; diff --git a/components/PreviewFallback/PreviewFallback.stories.ts b/components/PreviewFallback/PreviewFallback.stories.ts index 86e05d77..bb118703 100644 --- a/components/PreviewFallback/PreviewFallback.stories.ts +++ b/components/PreviewFallback/PreviewFallback.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeFallbackEvent } from "~/utils/normalize-event"; -import monologEventMock from '~/mocks/monolog.json' import PreviewFallback from '~/components/PreviewFallback/PreviewFallback.vue'; +import { monologMock } from '~/src/entities/monolog/mocks' export default { title: "Preview/PreviewFallback", @@ -21,5 +21,5 @@ const Template: Story = (args) => ({ export const Default = Template.bind({}); Default.args = { - event: normalizeFallbackEvent({ ...monologEventMock, type: 'unknown' }), + event: normalizeFallbackEvent({ ...monologMock, type: 'unknown' }), }; diff --git a/src/entities/monolog/mocks/index.ts b/src/entities/monolog/mocks/index.ts new file mode 100644 index 00000000..556a09e1 --- /dev/null +++ b/src/entities/monolog/mocks/index.ts @@ -0,0 +1,5 @@ +import monologMock from './monolog.json'; + +export { + monologMock, +} diff --git a/mocks/monolog.json b/src/entities/monolog/mocks/monolog.json similarity index 100% rename from mocks/monolog.json rename to src/entities/monolog/mocks/monolog.json From 6b4a28d5afd369ee0f15c463b6b75990f5df0f8d Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 28 Oct 2023 19:47:37 +0400 Subject: [PATCH 16/72] move inspector mock to new structure --- components/InspectorPage/InspectorPage.stories.ts | 4 ++-- .../InspectorPageTimeline.stories.ts | 4 ++-- .../InspectorPreview/InspectorPreview.stories.ts | 4 ++-- .../InspectorStatBoard/InspectorStatBoard.stories.ts | 4 ++-- .../PreviewEventMapper/PreviewEventMapper.stories.ts | 12 ++++++------ src/entities/inspector/mocks/index.ts | 5 +++++ .../entities/inspector/mocks}/inspector.json | 0 7 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 src/entities/inspector/mocks/index.ts rename {mocks => src/entities/inspector/mocks}/inspector.json (100%) diff --git a/components/InspectorPage/InspectorPage.stories.ts b/components/InspectorPage/InspectorPage.stories.ts index 8826691a..377b7ab4 100644 --- a/components/InspectorPage/InspectorPage.stories.ts +++ b/components/InspectorPage/InspectorPage.stories.ts @@ -1,7 +1,7 @@ import {Meta, Story} from "@storybook/vue3"; import {normalizeInspectorEvent} from "~/utils/normalize-event"; -import inspectorEventMock from '~/mocks/inspector.json' import InspectorPage from '~/components/InspectorPage/InspectorPage.vue'; +import { inspectorMock } from '~/src/entities/inspector/mocks' export default { title: "Inspector/Page/InspectorPage", @@ -21,5 +21,5 @@ const Template: Story = (args) => ({ export const Default = Template.bind({}); Default.args = { - event: normalizeInspectorEvent(inspectorEventMock), + event: normalizeInspectorEvent(inspectorMock), }; diff --git a/components/InspectorPageTimeline/InspectorPageTimeline.stories.ts b/components/InspectorPageTimeline/InspectorPageTimeline.stories.ts index 7f127c41..1c05b110 100644 --- a/components/InspectorPageTimeline/InspectorPageTimeline.stories.ts +++ b/components/InspectorPageTimeline/InspectorPageTimeline.stories.ts @@ -1,7 +1,7 @@ import {Meta, Story} from "@storybook/vue3"; import {normalizeInspectorEvent} from "~/utils/normalize-event"; -import inspectorEventMock from '~/mocks/inspector.json' import InspectorPageTimeline from '~/components/InspectorPageTimeline/InspectorPageTimeline.vue'; +import { inspectorMock } from '~/src/entities/inspector/mocks' export default { title: "Inspector/Page/InspectorPageTimeline", @@ -21,5 +21,5 @@ const Template: Story = (args) => ({ export const Timeline = Template.bind({}); Timeline.args = { - event: normalizeInspectorEvent(inspectorEventMock) + event: normalizeInspectorEvent(inspectorMock) }; diff --git a/components/InspectorPreview/InspectorPreview.stories.ts b/components/InspectorPreview/InspectorPreview.stories.ts index 09060cde..b1196ec0 100644 --- a/components/InspectorPreview/InspectorPreview.stories.ts +++ b/components/InspectorPreview/InspectorPreview.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeInspectorEvent } from "~/utils/normalize-event"; -import inspectorEventMock from '~/mocks/inspector.json' import InspectorPreview from '~/components/InspectorPreview/InspectorPreview.vue'; +import { inspectorMock } from '~/src/entities/inspector/mocks' export default { title: "Inspector/Components/InspectorPreview", @@ -21,5 +21,5 @@ const Template: Story = (args) => ({ export const Event = Template.bind({}); Event.args = { - event: normalizeInspectorEvent(inspectorEventMock), + event: normalizeInspectorEvent(inspectorMock), }; diff --git a/components/InspectorStatBoard/InspectorStatBoard.stories.ts b/components/InspectorStatBoard/InspectorStatBoard.stories.ts index 49021903..77f7fb5e 100644 --- a/components/InspectorStatBoard/InspectorStatBoard.stories.ts +++ b/components/InspectorStatBoard/InspectorStatBoard.stories.ts @@ -1,7 +1,7 @@ import {Meta, Story} from "@storybook/vue3"; import {normalizeInspectorEvent} from "~/utils/normalize-event"; -import inspectorEventMock from '~/mocks/inspector.json' import InspectorStatBoard from '~/components/InspectorStatBoard/InspectorStatBoard.vue'; +import { inspectorMock } from '~/src/entities/inspector/mocks' export default { title: "Inspector/Components/InspectorStatBoard", @@ -21,5 +21,5 @@ const Template: Story = (args) => ({ export const StatBoardStories = Template.bind({}); StatBoardStories.args = { - transaction: normalizeInspectorEvent(inspectorEventMock).payload[0] + transaction: normalizeInspectorEvent(inspectorMock).payload[0] }; diff --git a/components/PreviewEventMapper/PreviewEventMapper.stories.ts b/components/PreviewEventMapper/PreviewEventMapper.stories.ts index bd3eadf1..094e2ebe 100644 --- a/components/PreviewEventMapper/PreviewEventMapper.stories.ts +++ b/components/PreviewEventMapper/PreviewEventMapper.stories.ts @@ -3,10 +3,10 @@ import PreviewEventMapper from "~/components/PreviewEventMapper/PreviewEventMapp import sentryEventMock from "~/mocks/sentry-spiral.json"; import smtpEventMock from "~/mocks/smtp-welcome.json"; import varDumpEventMock from "~/mocks/var-dump-object.json"; -import inspectorEventMock from "~/mocks/inspector.json"; import httpDumpEventMock from "~/mocks/http-dump.json"; import { profilerMock } from "~/src/entities/profiler/mocks"; -import { monologMock } from '~/src/entities/monolog/mocks' +import { monologMock } from '~/src/entities/monolog/mocks'; +import { inspectorMock } from '~/src/entities/inspector/mocks'; export default { title: "Preview/PreviewEventMapper", @@ -62,7 +62,7 @@ Profiler.args = { export const Inspector = Template.bind({}); Inspector.args = { - event: inspectorEventMock, + event: inspectorMock, }; export const HttpDump = Template.bind({}); @@ -76,7 +76,7 @@ const eventsList = [ smtpEventMock, varDumpEventMock, profilerMock, - inspectorEventMock, + inspectorMock, httpDumpEventMock, ]; @@ -94,7 +94,7 @@ const TemplateList: Story = (args) => ({ export const EventsList = TemplateList.bind({}); EventsList.args = { - event: inspectorEventMock, + event: inspectorMock, }; const TemplateListVirtual: Story = (args) => ({ @@ -122,5 +122,5 @@ const TemplateListVirtual: Story = (args) => ({ export const EventsListVirtual = TemplateListVirtual.bind({}); EventsListVirtual.args = { - event: inspectorEventMock, + event: inspectorMock, }; diff --git a/src/entities/inspector/mocks/index.ts b/src/entities/inspector/mocks/index.ts new file mode 100644 index 00000000..f6a4653d --- /dev/null +++ b/src/entities/inspector/mocks/index.ts @@ -0,0 +1,5 @@ +import inspectorMock from './inspector.json'; + +export { + inspectorMock, +} diff --git a/mocks/inspector.json b/src/entities/inspector/mocks/inspector.json similarity index 100% rename from mocks/inspector.json rename to src/entities/inspector/mocks/inspector.json From 63f01ad20e67efabcc588474cd44898ffb64ed65 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sun, 29 Oct 2023 00:45:36 +0400 Subject: [PATCH 17/72] move smtp mocks to new structure --- .../PreviewEventMapper/PreviewEventMapper.stories.ts | 8 ++++---- components/SmtpPage/SmtpPage.stories.ts | 4 ++-- components/SmtpPreview/SmtpPreview.stories.ts | 7 +++---- src/entities/smtp/mocks/index.ts | 7 +++++++ {mocks => src/entities/smtp/mocks}/smtp-order.json | 0 {mocks => src/entities/smtp/mocks}/smtp-welcome.json | 0 6 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 src/entities/smtp/mocks/index.ts rename {mocks => src/entities/smtp/mocks}/smtp-order.json (100%) rename {mocks => src/entities/smtp/mocks}/smtp-welcome.json (100%) diff --git a/components/PreviewEventMapper/PreviewEventMapper.stories.ts b/components/PreviewEventMapper/PreviewEventMapper.stories.ts index 094e2ebe..1a7f5808 100644 --- a/components/PreviewEventMapper/PreviewEventMapper.stories.ts +++ b/components/PreviewEventMapper/PreviewEventMapper.stories.ts @@ -1,12 +1,12 @@ import { Meta, Story } from "@storybook/vue3"; import PreviewEventMapper from "~/components/PreviewEventMapper/PreviewEventMapper.vue"; import sentryEventMock from "~/mocks/sentry-spiral.json"; -import smtpEventMock from "~/mocks/smtp-welcome.json"; import varDumpEventMock from "~/mocks/var-dump-object.json"; import httpDumpEventMock from "~/mocks/http-dump.json"; import { profilerMock } from "~/src/entities/profiler/mocks"; import { monologMock } from '~/src/entities/monolog/mocks'; import { inspectorMock } from '~/src/entities/inspector/mocks'; +import { smtpWelcomeMock } from '~/src/entities/smtp/mocks'; export default { title: "Preview/PreviewEventMapper", @@ -26,7 +26,7 @@ const Template: Story = (args) => ({ export const Default = Template.bind({}); Default.args = { - event: { ...smtpEventMock, type: "unknown" }, + event: { ...smtpWelcomeMock, type: "unknown" }, }; export const Monolog = Template.bind({}); @@ -44,7 +44,7 @@ Sentry.args = { export const Smtp = Template.bind({}); Smtp.args = { - event: smtpEventMock, + event: smtpWelcomeMock, }; export const VarDump = Template.bind({}); @@ -73,7 +73,7 @@ HttpDump.args = { const eventsList = [ monologMock, sentryEventMock, - smtpEventMock, + smtpWelcomeMock, varDumpEventMock, profilerMock, inspectorMock, diff --git a/components/SmtpPage/SmtpPage.stories.ts b/components/SmtpPage/SmtpPage.stories.ts index dca3395b..c1cc20b0 100644 --- a/components/SmtpPage/SmtpPage.stories.ts +++ b/components/SmtpPage/SmtpPage.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeSMTPEvent } from "~/utils/normalize-event"; -import smtpEventMock from '~/mocks/smtp-welcome.json' import SmtpPage from "~/components/SmtpPage/SmtpPage.vue"; +import { smtpWelcomeMock } from '~/src/entities/smtp/mocks'; export default { title: "Smtp/Page/SmtpPage", @@ -20,7 +20,7 @@ const Template: Story = (args) => ({ export const Default = Template.bind({}); -const normalizeEvent = normalizeSMTPEvent(smtpEventMock) +const normalizeEvent = normalizeSMTPEvent(smtpWelcomeMock) Default.args = { event: normalizeEvent, diff --git a/components/SmtpPreview/SmtpPreview.stories.ts b/components/SmtpPreview/SmtpPreview.stories.ts index 3a198fc1..297770a3 100644 --- a/components/SmtpPreview/SmtpPreview.stories.ts +++ b/components/SmtpPreview/SmtpPreview.stories.ts @@ -1,8 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeSMTPEvent } from "~/utils/normalize-event"; -import smtpOrderShippedEventMock from '~/mocks/smtp-order.json'; -import smtpWelcomeEventMock from '~/mocks/smtp-welcome.json'; import SmtpPreview from '~/components/SmtpPreview/SmtpPreview.vue'; +import { smtpOrderMock, smtpWelcomeMock } from '~/src/entities/smtp/mocks'; export default { title: "SMTP/Components/SmtpPreview", @@ -22,11 +21,11 @@ const Template: Story = (args) => ({ export const OrderShipped = Template.bind({}); OrderShipped.args = { - event: normalizeSMTPEvent(smtpOrderShippedEventMock), + event: normalizeSMTPEvent(smtpOrderMock), }; export const Welcome = Template.bind({}); Welcome.args = { - event: normalizeSMTPEvent(smtpWelcomeEventMock), + event: normalizeSMTPEvent(smtpWelcomeMock), }; diff --git a/src/entities/smtp/mocks/index.ts b/src/entities/smtp/mocks/index.ts new file mode 100644 index 00000000..ad57b432 --- /dev/null +++ b/src/entities/smtp/mocks/index.ts @@ -0,0 +1,7 @@ +import smtpOrderMock from './smtp-order.json'; +import smtpWelcomeMock from './smtp-welcome.json'; + +export { + smtpOrderMock, + smtpWelcomeMock, +} diff --git a/mocks/smtp-order.json b/src/entities/smtp/mocks/smtp-order.json similarity index 100% rename from mocks/smtp-order.json rename to src/entities/smtp/mocks/smtp-order.json diff --git a/mocks/smtp-welcome.json b/src/entities/smtp/mocks/smtp-welcome.json similarity index 100% rename from mocks/smtp-welcome.json rename to src/entities/smtp/mocks/smtp-welcome.json From 7ef94ed727d186cad056bc41f63c5aa8f3448921 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sun, 29 Oct 2023 00:55:20 +0400 Subject: [PATCH 18/72] move http-dump mocks to new structure --- .../HttpDumpPage/HttpDumpPage.stories.ts | 7 +++---- .../HttpDumpPreview.stories.ts | 4 ++-- .../PreviewEventMapper.stories.ts | 6 +++--- config/types.ts | 5 ++++- .../http-dump/mocks}/http-dump-with-pdf.json | 0 .../entities/http-dump/mocks}/http-dump.json | 20 ++++++------------- src/entities/http-dump/mocks/index.ts | 7 +++++++ 7 files changed, 25 insertions(+), 24 deletions(-) rename {mocks => src/entities/http-dump/mocks}/http-dump-with-pdf.json (100%) rename {mocks => src/entities/http-dump/mocks}/http-dump.json (70%) create mode 100644 src/entities/http-dump/mocks/index.ts diff --git a/components/HttpDumpPage/HttpDumpPage.stories.ts b/components/HttpDumpPage/HttpDumpPage.stories.ts index 4b33908b..09bd1db0 100644 --- a/components/HttpDumpPage/HttpDumpPage.stories.ts +++ b/components/HttpDumpPage/HttpDumpPage.stories.ts @@ -1,8 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeHttpDumpEvent } from "~/utils/normalize-event"; -import httpDumpEventMock from '~/mocks/http-dump.json' -import httpDumpPDFEventMock from '~/mocks/http-dump-with-pdf.json' import HttpDumpPage from "~/components/HttpDumpPage/HttpDumpPage.vue"; +import { httpDumpMock, httpDumpPdfMock } from '~/src/entities/http-dump/mocks'; export default { title: "HttpDump/Page/HttpDumpPage", @@ -23,10 +22,10 @@ export const Default = Template.bind({}); Default.args = { - event: normalizeHttpDumpEvent(httpDumpEventMock), + event: normalizeHttpDumpEvent(httpDumpMock), }; export const WithPdf = Template.bind({}); WithPdf.args = { - event: normalizeHttpDumpEvent(httpDumpPDFEventMock), + event: normalizeHttpDumpEvent(httpDumpPdfMock), }; diff --git a/components/HttpDumpPreview/HttpDumpPreview.stories.ts b/components/HttpDumpPreview/HttpDumpPreview.stories.ts index 88d6c1a9..69b936db 100644 --- a/components/HttpDumpPreview/HttpDumpPreview.stories.ts +++ b/components/HttpDumpPreview/HttpDumpPreview.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeHttpDumpEvent } from "~/utils/normalize-event"; -import httpDumpEventMock from '~/mocks/http-dump.json' import HttpDumpPreview from '~/components/HttpDumpPreview/HttpDumpPreview.vue'; +import { httpDumpMock } from '~/src/entities/http-dump/mocks'; export default { title: "HttpDump/Components/HttpDumpPreview", @@ -21,5 +21,5 @@ const Template: Story = (args) => ({ export const Event = Template.bind({}); Event.args = { - event: normalizeHttpDumpEvent(httpDumpEventMock), + event: normalizeHttpDumpEvent(httpDumpMock), }; diff --git a/components/PreviewEventMapper/PreviewEventMapper.stories.ts b/components/PreviewEventMapper/PreviewEventMapper.stories.ts index 1a7f5808..d0a18736 100644 --- a/components/PreviewEventMapper/PreviewEventMapper.stories.ts +++ b/components/PreviewEventMapper/PreviewEventMapper.stories.ts @@ -2,11 +2,11 @@ import { Meta, Story } from "@storybook/vue3"; import PreviewEventMapper from "~/components/PreviewEventMapper/PreviewEventMapper.vue"; import sentryEventMock from "~/mocks/sentry-spiral.json"; import varDumpEventMock from "~/mocks/var-dump-object.json"; -import httpDumpEventMock from "~/mocks/http-dump.json"; import { profilerMock } from "~/src/entities/profiler/mocks"; import { monologMock } from '~/src/entities/monolog/mocks'; import { inspectorMock } from '~/src/entities/inspector/mocks'; import { smtpWelcomeMock } from '~/src/entities/smtp/mocks'; +import { httpDumpMock } from '~/src/entities/http-dump/mocks'; export default { title: "Preview/PreviewEventMapper", @@ -67,7 +67,7 @@ Inspector.args = { export const HttpDump = Template.bind({}); HttpDump.args = { - event: httpDumpEventMock, + event: httpDumpMock, }; const eventsList = [ @@ -77,7 +77,7 @@ const eventsList = [ varDumpEventMock, profilerMock, inspectorMock, - httpDumpEventMock, + httpDumpMock, ]; const TemplateList: Story = (args) => ({ diff --git a/config/types.ts b/config/types.ts index 9d48c6bf..39619934 100644 --- a/config/types.ts +++ b/config/types.ts @@ -259,9 +259,12 @@ export interface SmtpAttachment { } export interface HttpDumpFile { - originalName: string, + originalName?: string, mime: string, size: number, + id: string; + name?: string; + uri?: string } export interface HttpDump { diff --git a/mocks/http-dump-with-pdf.json b/src/entities/http-dump/mocks/http-dump-with-pdf.json similarity index 100% rename from mocks/http-dump-with-pdf.json rename to src/entities/http-dump/mocks/http-dump-with-pdf.json diff --git a/mocks/http-dump.json b/src/entities/http-dump/mocks/http-dump.json similarity index 70% rename from mocks/http-dump.json rename to src/entities/http-dump/mocks/http-dump.json index 96dfc973..1cb4cec3 100644 --- a/mocks/http-dump.json +++ b/src/entities/http-dump/mocks/http-dump.json @@ -8,23 +8,15 @@ "method": "GET", "uri": "user/3/update?sort=name&page=1", "headers": { - "Host": [ - "127.0.0.1:8082" - ], - "Sec-Ch-Ua-Platform": [ - "\"Windows\"" - ], + "Host": ["127.0.0.1:8082"], + "Sec-Ch-Ua-Platform": ["\"Windows\""], "User-Agent": [ - "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/112.0.0.0 Safari\/537.36" - ], - "Accept-Language": [ - "en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,ka;q=0.6" - ], - "Accept-Encoding": [ - "gzip, deflate, br" + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" ], + "Accept-Language": ["en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,ka;q=0.6"], + "Accept-Encoding": ["gzip, deflate, br"], "Accept": [ - "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/avif,image\/webp,image\/apng,*\/*;q=0.8,application\/signed-exchange;v=b3;q=0.7" + "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7" ] }, "body": "{\"username\":\"Marcel\",\"password\":\"supersecret\"}", diff --git a/src/entities/http-dump/mocks/index.ts b/src/entities/http-dump/mocks/index.ts new file mode 100644 index 00000000..0ab8d572 --- /dev/null +++ b/src/entities/http-dump/mocks/index.ts @@ -0,0 +1,7 @@ +import httpDumpPdfMock from './http-dump-with-pdf.json'; +import httpDumpMock from './http-dump.json'; + +export { + httpDumpMock, + httpDumpPdfMock +} From 8da85b5096af5634478333b29d779fd00ad5dfb2 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sun, 29 Oct 2023 01:20:54 +0400 Subject: [PATCH 19/72] move sentry mocks to new file structure --- .../PreviewEventMapper.stories.ts | 6 +- .../SentryException.stories.ts | 4 +- .../SentryExceptionFrame.stories.ts | 4 +- components/SentryPage/SentryPage.stories.ts | 11 +-- .../SentryPageApp/SentryPageApp.stories.ts | 4 +- .../SentryPageBreadcrumbs.stories.ts | 7 +- .../SentryPageDevice.stories.ts | 4 +- .../SentryPageRequest.stories.ts | 7 +- .../SentryPageTags/SentryPageTags.stories.ts | 7 +- .../SentryPreview/SentryPreview.stories.ts | 13 ++- src/entities/sentry/mocks/index.ts | 15 ++++ .../entities/sentry/mocks}/sentry-common.json | 0 .../entities/sentry/mocks}/sentry-event.json | 87 +++++-------------- .../sentry/mocks}/sentry-js-event.json | 0 .../entities/sentry/mocks}/sentry-js.json | 0 .../sentry/mocks}/sentry-laravel.json | 0 .../entities/sentry/mocks}/sentry-spiral.json | 0 17 files changed, 65 insertions(+), 104 deletions(-) create mode 100644 src/entities/sentry/mocks/index.ts rename {mocks => src/entities/sentry/mocks}/sentry-common.json (100%) rename {mocks => src/entities/sentry/mocks}/sentry-event.json (93%) rename {mocks => src/entities/sentry/mocks}/sentry-js-event.json (100%) rename {mocks => src/entities/sentry/mocks}/sentry-js.json (100%) rename {mocks => src/entities/sentry/mocks}/sentry-laravel.json (100%) rename {mocks => src/entities/sentry/mocks}/sentry-spiral.json (100%) diff --git a/components/PreviewEventMapper/PreviewEventMapper.stories.ts b/components/PreviewEventMapper/PreviewEventMapper.stories.ts index d0a18736..5f3c2f71 100644 --- a/components/PreviewEventMapper/PreviewEventMapper.stories.ts +++ b/components/PreviewEventMapper/PreviewEventMapper.stories.ts @@ -1,12 +1,12 @@ import { Meta, Story } from "@storybook/vue3"; import PreviewEventMapper from "~/components/PreviewEventMapper/PreviewEventMapper.vue"; -import sentryEventMock from "~/mocks/sentry-spiral.json"; import varDumpEventMock from "~/mocks/var-dump-object.json"; import { profilerMock } from "~/src/entities/profiler/mocks"; import { monologMock } from '~/src/entities/monolog/mocks'; import { inspectorMock } from '~/src/entities/inspector/mocks'; import { smtpWelcomeMock } from '~/src/entities/smtp/mocks'; import { httpDumpMock } from '~/src/entities/http-dump/mocks'; +import { sentrySpiralMock } from '~/src/entities/sentry/mocks'; export default { title: "Preview/PreviewEventMapper", @@ -38,7 +38,7 @@ Monolog.args = { export const Sentry = Template.bind({}); Sentry.args = { - event: sentryEventMock, + event: sentrySpiralMock, }; export const Smtp = Template.bind({}); @@ -72,7 +72,7 @@ HttpDump.args = { const eventsList = [ monologMock, - sentryEventMock, + sentrySpiralMock, smtpWelcomeMock, varDumpEventMock, profilerMock, diff --git a/components/SentryException/SentryException.stories.ts b/components/SentryException/SentryException.stories.ts index 940c40ac..2b8fd70b 100644 --- a/components/SentryException/SentryException.stories.ts +++ b/components/SentryException/SentryException.stories.ts @@ -1,8 +1,8 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeSentryEvent } from "~/utils/normalize-event"; -import sentryEventMock from '~/mocks/sentry-common.json' import { Sentry } from "~/config/types"; import SentryException from '~/components/SentryException/SentryException.vue'; +import { sentryCommonMock } from '~/src/entities/sentry/mocks'; export default { title: "Sentry/Components/SentryException", @@ -22,5 +22,5 @@ const Template: Story = (args) => ({ export const Exception = Template.bind({}); Exception.args = { - exception: (normalizeSentryEvent(sentryEventMock)?.payload as Sentry)?.exception?.values[0], + exception: (normalizeSentryEvent(sentryCommonMock)?.payload as Sentry)?.exception?.values[0], }; diff --git a/components/SentryExceptionFrame/SentryExceptionFrame.stories.ts b/components/SentryExceptionFrame/SentryExceptionFrame.stories.ts index e84403d4..9bd6f37e 100644 --- a/components/SentryExceptionFrame/SentryExceptionFrame.stories.ts +++ b/components/SentryExceptionFrame/SentryExceptionFrame.stories.ts @@ -1,8 +1,8 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeSentryEvent } from "~/utils/normalize-event"; -import sentrySpiralEventMock from '~/mocks/sentry-spiral.json' import { Sentry } from "~/config/types"; import SentryExceptionFrame from '~/components/SentryExceptionFrame/SentryExceptionFrame.vue'; +import { sentrySpiralMock } from '~/src/entities/sentry/mocks'; export default { title: "Sentry/Components/SentryExceptionFrame", @@ -23,5 +23,5 @@ export const Frame = Template.bind({}); Frame.args = { isOpen: true, - frame: (normalizeSentryEvent(sentrySpiralEventMock)?.payload as Sentry)?.exception?.values[0]?.stacktrace?.frames[1], + frame: (normalizeSentryEvent(sentrySpiralMock)?.payload as Sentry)?.exception?.values[0]?.stacktrace?.frames[1], }; diff --git a/components/SentryPage/SentryPage.stories.ts b/components/SentryPage/SentryPage.stories.ts index b65bec1d..f10be614 100644 --- a/components/SentryPage/SentryPage.stories.ts +++ b/components/SentryPage/SentryPage.stories.ts @@ -1,10 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeSentryEvent } from "~/utils/normalize-event"; -import sentryCommonMock from '~/mocks/sentry-common.json' -import sentryEventMock from '~/mocks/sentry-event.json' -import sentryJsEventMock from '~/mocks/sentry-js-event.json' -import sentryJsMock from '~/mocks/sentry-js.json' import SentryPage from '~/components/SentryPage/SentryPage.vue'; +import { sentryCommonMock, sentryMock, sentryJSMock, sentryJSEventMock } from '~/src/entities/sentry/mocks'; export default { title: "Sentry/Page/SentryPage", @@ -30,18 +27,18 @@ PageCommon.args = { export const PageEvent = Template.bind({}); PageEvent.args = { - event: normalizeSentryEvent(sentryEventMock), + event: normalizeSentryEvent(sentryMock), }; export const PageJS = Template.bind({}); PageJS.args = { - event: normalizeSentryEvent(sentryJsMock), + event: normalizeSentryEvent(sentryJSMock), }; export const PageJSEvent = Template.bind({}); PageJSEvent.args = { - event: normalizeSentryEvent(sentryJsEventMock), + event: normalizeSentryEvent(sentryJSEventMock), }; diff --git a/components/SentryPageApp/SentryPageApp.stories.ts b/components/SentryPageApp/SentryPageApp.stories.ts index 2ea284e9..090642ef 100644 --- a/components/SentryPageApp/SentryPageApp.stories.ts +++ b/components/SentryPageApp/SentryPageApp.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeSentryEvent } from "~/utils/normalize-event"; -import sentryEventMock from '~/mocks/sentry-common.json' import SentryPageApp from '~/components/SentryPageApp/SentryPageApp.vue'; +import { sentryCommonMock } from '~/src/entities/sentry/mocks'; export default { title: "Sentry/Page/SentryPageApp", @@ -21,5 +21,5 @@ const Template: Story = (args) => ({ export const App = Template.bind({}); App.args = { - event: normalizeSentryEvent(sentryEventMock).payload, + event: normalizeSentryEvent(sentryCommonMock).payload, }; diff --git a/components/SentryPageBreadcrumbs/SentryPageBreadcrumbs.stories.ts b/components/SentryPageBreadcrumbs/SentryPageBreadcrumbs.stories.ts index 20ce1716..79ec3feb 100644 --- a/components/SentryPageBreadcrumbs/SentryPageBreadcrumbs.stories.ts +++ b/components/SentryPageBreadcrumbs/SentryPageBreadcrumbs.stories.ts @@ -1,8 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeSentryEvent } from "~/utils/normalize-event"; -import sentryLaravelEventMock from '~/mocks/sentry-laravel.json' -import sentrySpiralEventMock from '~/mocks/sentry-spiral.json' import SentryPageBreadcrumbs from '~/components/SentryPageBreadcrumbs/SentryPageBreadcrumbs.vue'; +import { sentryLaravelMock, sentrySpiralMock } from '~/src/entities/sentry/mocks' export default { title: "Sentry/Page/SentryPageBreadcrumbs", @@ -22,11 +21,11 @@ const Template: Story = (args) => ({ export const Laravel = Template.bind({}); Laravel.args = { - event: normalizeSentryEvent(sentryLaravelEventMock).payload, + event: normalizeSentryEvent(sentryLaravelMock).payload, }; export const Spiral = Template.bind({}); Spiral.args = { - event: normalizeSentryEvent(sentrySpiralEventMock).payload, + event: normalizeSentryEvent(sentrySpiralMock).payload, }; diff --git a/components/SentryPageDevice/SentryPageDevice.stories.ts b/components/SentryPageDevice/SentryPageDevice.stories.ts index af833f72..8837aa1a 100644 --- a/components/SentryPageDevice/SentryPageDevice.stories.ts +++ b/components/SentryPageDevice/SentryPageDevice.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeSentryEvent } from "~/utils/normalize-event"; -import sentryEventMock from '~/mocks/sentry-common.json' import SentryPageDevice from '~/components/SentryPageDevice/SentryPageDevice.vue'; +import { sentryCommonMock } from '~/src/entities/sentry/mocks'; export default { title: "Sentry/Page/SentryPageDevice", @@ -21,5 +21,5 @@ const Template: Story = (args) => ({ export const Device = Template.bind({}); Device.args = { - event: normalizeSentryEvent(sentryEventMock).payload, + event: normalizeSentryEvent(sentryCommonMock).payload, }; diff --git a/components/SentryPageRequest/SentryPageRequest.stories.ts b/components/SentryPageRequest/SentryPageRequest.stories.ts index efc9ca84..63663499 100644 --- a/components/SentryPageRequest/SentryPageRequest.stories.ts +++ b/components/SentryPageRequest/SentryPageRequest.stories.ts @@ -1,8 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeSentryEvent } from "~/utils/normalize-event"; -import sentryLaravelEventMock from '~/mocks/sentry-laravel.json' -import sentrySpiralEventMock from '~/mocks/sentry-spiral.json' import SentryPageRequest from '~/components/SentryPageRequest/SentryPageRequest.vue'; +import { sentryLaravelMock, sentrySpiralMock } from '~/src/entities/sentry/mocks' export default { title: "Sentry/Page/SentryPageRequest", @@ -22,11 +21,11 @@ const Template: Story = (args) => ({ export const Laravel = Template.bind({}); Laravel.args = { - event: normalizeSentryEvent(sentryLaravelEventMock).payload, + event: normalizeSentryEvent(sentryLaravelMock).payload, }; export const Spiral = Template.bind({}); Spiral.args = { - event: normalizeSentryEvent(sentrySpiralEventMock).payload, + event: normalizeSentryEvent(sentrySpiralMock).payload, }; diff --git a/components/SentryPageTags/SentryPageTags.stories.ts b/components/SentryPageTags/SentryPageTags.stories.ts index f99bcb5f..52da5d4b 100644 --- a/components/SentryPageTags/SentryPageTags.stories.ts +++ b/components/SentryPageTags/SentryPageTags.stories.ts @@ -1,8 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeSentryEvent } from "~/utils/normalize-event"; -import sentryLaravelEventMock from '~/mocks/sentry-laravel.json' -import sentrySpiralEventMock from '~/mocks/sentry-spiral.json' import SentryPageTags from '~/components/SentryPageTags/SentryPageTags.vue'; +import { sentryLaravelMock, sentrySpiralMock } from '~/src/entities/sentry/mocks'; export default { title: "Sentry/Page/SentryPageTags", @@ -22,11 +21,11 @@ const Template: Story = (args) => ({ export const Laravel = Template.bind({}); Laravel.args = { - event: normalizeSentryEvent(sentryLaravelEventMock).payload, + event: normalizeSentryEvent(sentryLaravelMock).payload, }; export const Spiral = Template.bind({}); Spiral.args = { - event: normalizeSentryEvent(sentrySpiralEventMock).payload, + event: normalizeSentryEvent(sentrySpiralMock).payload, }; diff --git a/components/SentryPreview/SentryPreview.stories.ts b/components/SentryPreview/SentryPreview.stories.ts index c2d33493..b68d28ed 100644 --- a/components/SentryPreview/SentryPreview.stories.ts +++ b/components/SentryPreview/SentryPreview.stories.ts @@ -1,10 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeSentryEvent } from "~/utils/normalize-event"; -import sentrySpiralEventMock from '~/mocks/sentry-spiral.json' -import sentryLaravelEventMock from '~/mocks/sentry-laravel.json' -import sentryEventMock from '~/mocks/sentry-event.json' -import sentryJsEventMock from '~/mocks/sentry-js-event.json' import SentryPreview from '~/components/SentryPreview/SentryPreview.vue'; +import { sentryMock, sentryJSEventMock, sentryLaravelMock, sentrySpiralMock } from '~/src/entities/sentry/mocks'; export default { title: "Sentry/Components/SentryPreview", @@ -24,24 +21,24 @@ const Template: Story = (args) => ({ export const Spiral = Template.bind({}); Spiral.args = { - event: normalizeSentryEvent(sentrySpiralEventMock), + event: normalizeSentryEvent(sentrySpiralMock), }; export const Laravel = Template.bind({}); Laravel.args = { - event: normalizeSentryEvent(sentryLaravelEventMock), + event: normalizeSentryEvent(sentryLaravelMock), }; export const Event = Template.bind({}); Event.args = { - event: normalizeSentryEvent(sentryEventMock), + event: normalizeSentryEvent(sentryMock), }; export const JSEvent = Template.bind({}); JSEvent.args = { - event: normalizeSentryEvent(sentryJsEventMock), + event: normalizeSentryEvent(sentryJSEventMock), }; diff --git a/src/entities/sentry/mocks/index.ts b/src/entities/sentry/mocks/index.ts new file mode 100644 index 00000000..ec6689fe --- /dev/null +++ b/src/entities/sentry/mocks/index.ts @@ -0,0 +1,15 @@ +import sentryCommonMock from './sentry-common.json'; +import sentryMock from './sentry-event.json'; +import sentryJSEventMock from './sentry-js-event.json'; +import sentryJSMock from './sentry-js.json'; +import sentryLaravelMock from './sentry-laravel.json'; +import sentrySpiralMock from './sentry-spiral.json'; + +export { + sentryCommonMock, + sentryMock, + sentryJSMock, + sentryJSEventMock, + sentryLaravelMock, + sentrySpiralMock, +} diff --git a/mocks/sentry-common.json b/src/entities/sentry/mocks/sentry-common.json similarity index 100% rename from mocks/sentry-common.json rename to src/entities/sentry/mocks/sentry-common.json diff --git a/mocks/sentry-event.json b/src/entities/sentry/mocks/sentry-event.json similarity index 93% rename from mocks/sentry-event.json rename to src/entities/sentry/mocks/sentry-event.json index c7c3343f..e2d4184c 100644 --- a/mocks/sentry-event.json +++ b/src/entities/sentry/mocks/sentry-event.json @@ -1,9 +1,7 @@ { "id": "17d252f1-a602-4ab5-9a1f-837cf8ba9be6", "type": "sentry", - "labels": [ - "sentry.1" - ], + "labels": ["sentry.1"], "origin": null, "serverName": "", "date": "2023-09-17T20:33:28.000Z", @@ -192,9 +190,7 @@ "data": { "connectionName": "sqlite", "executionTimeMs": 0.28, - "bindings": [ - "migrations" - ] + "bindings": ["migrations"] } }, { @@ -218,9 +214,7 @@ "data": { "connectionName": "sqlite", "executionTimeMs": 0.22, - "bindings": [ - "migrations" - ] + "bindings": ["migrations"] } }, { @@ -292,10 +286,7 @@ "data": { "connectionName": "sqlite", "executionTimeMs": 8.53, - "bindings": [ - "2014_10_12_000000_create_users_table", - 1 - ] + "bindings": ["2014_10_12_000000_create_users_table", 1] } }, { @@ -331,10 +322,7 @@ "data": { "connectionName": "sqlite", "executionTimeMs": 8.56, - "bindings": [ - "2014_10_12_100000_create_password_resets_table", - 1 - ] + "bindings": ["2014_10_12_100000_create_password_resets_table", 1] } }, { @@ -370,10 +358,7 @@ "data": { "connectionName": "sqlite", "executionTimeMs": 8.2, - "bindings": [ - "2019_08_19_000000_create_failed_jobs_table", - 1 - ] + "bindings": ["2019_08_19_000000_create_failed_jobs_table", 1] } }, { @@ -614,57 +599,27 @@ "url": "http://127.0.0.1:8000/", "method": "POST", "headers": { - "host": [ - "127.0.0.1:8000" - ], - "connection": [ - "keep-alive" - ], - "content-length": [ - "25" - ], + "host": ["127.0.0.1:8000"], + "connection": ["keep-alive"], + "content-length": ["25"], "sec-ch-ua": [ "\"Chromium\";v=\"116\", \"Not)A;Brand\";v=\"24\", \"Google Chrome\";v=\"116\"" ], - "sec-ch-ua-platform": [ - "\"Windows\"" - ], - "sec-ch-ua-mobile": [ - "?0" - ], + "sec-ch-ua-platform": ["\"Windows\""], + "sec-ch-ua-mobile": ["?0"], "user-agent": [ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" ], - "content-type": [ - "application/json" - ], - "accept": [ - "*/*" - ], - "origin": [ - "http://127.0.0.1:8000" - ], - "sec-fetch-site": [ - "same-origin" - ], - "sec-fetch-mode": [ - "cors" - ], - "sec-fetch-dest": [ - "empty" - ], - "referer": [ - "http://127.0.0.1:8000/" - ], - "accept-encoding": [ - "gzip, deflate, br" - ], - "accept-language": [ - "en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,ka;q=0.6" - ], - "cookie": [ - "[Filtered]" - ] + "content-type": ["application/json"], + "accept": ["*/*"], + "origin": ["http://127.0.0.1:8000"], + "sec-fetch-site": ["same-origin"], + "sec-fetch-mode": ["cors"], + "sec-fetch-dest": ["empty"], + "referer": ["http://127.0.0.1:8000/"], + "accept-encoding": ["gzip, deflate, br"], + "accept-language": ["en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,ka;q=0.6"], + "cookie": ["[Filtered]"] }, "data": { "action": "sentry:event" diff --git a/mocks/sentry-js-event.json b/src/entities/sentry/mocks/sentry-js-event.json similarity index 100% rename from mocks/sentry-js-event.json rename to src/entities/sentry/mocks/sentry-js-event.json diff --git a/mocks/sentry-js.json b/src/entities/sentry/mocks/sentry-js.json similarity index 100% rename from mocks/sentry-js.json rename to src/entities/sentry/mocks/sentry-js.json diff --git a/mocks/sentry-laravel.json b/src/entities/sentry/mocks/sentry-laravel.json similarity index 100% rename from mocks/sentry-laravel.json rename to src/entities/sentry/mocks/sentry-laravel.json diff --git a/mocks/sentry-spiral.json b/src/entities/sentry/mocks/sentry-spiral.json similarity index 100% rename from mocks/sentry-spiral.json rename to src/entities/sentry/mocks/sentry-spiral.json From 34f14a19d57238db40a3469269975757f926d7d8 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sun, 29 Oct 2023 01:32:49 +0400 Subject: [PATCH 20/72] move var-dump mocks to the new structure --- .../PreviewEventMapper.stories.ts | 6 ++-- components/ValueDump/ValueDump.stories.ts | 4 +-- .../VarDumpPreview/VarDumpPreview.stories.ts | 31 ++++++++++--------- src/entities/var-dump/mocks/index.ts | 17 ++++++++++ .../var-dump/mocks}/var-dump-array.json | 0 .../var-dump/mocks/var-dump-false.json | 0 .../var-dump/mocks}/var-dump-number.json | 0 .../var-dump/mocks}/var-dump-object.json | 0 .../mocks}/var-dump-string-empty.json | 0 .../var-dump/mocks}/var-dump-string.json | 0 .../var-dump/mocks/var-dump-true.json | 0 11 files changed, 38 insertions(+), 20 deletions(-) create mode 100644 src/entities/var-dump/mocks/index.ts rename {mocks => src/entities/var-dump/mocks}/var-dump-array.json (100%) rename mocks/var-dump-boolean-false.json => src/entities/var-dump/mocks/var-dump-false.json (100%) rename {mocks => src/entities/var-dump/mocks}/var-dump-number.json (100%) rename {mocks => src/entities/var-dump/mocks}/var-dump-object.json (100%) rename {mocks => src/entities/var-dump/mocks}/var-dump-string-empty.json (100%) rename {mocks => src/entities/var-dump/mocks}/var-dump-string.json (100%) rename mocks/var-dump-boolean-true.json => src/entities/var-dump/mocks/var-dump-true.json (100%) diff --git a/components/PreviewEventMapper/PreviewEventMapper.stories.ts b/components/PreviewEventMapper/PreviewEventMapper.stories.ts index 5f3c2f71..78e8d47e 100644 --- a/components/PreviewEventMapper/PreviewEventMapper.stories.ts +++ b/components/PreviewEventMapper/PreviewEventMapper.stories.ts @@ -1,6 +1,6 @@ import { Meta, Story } from "@storybook/vue3"; import PreviewEventMapper from "~/components/PreviewEventMapper/PreviewEventMapper.vue"; -import varDumpEventMock from "~/mocks/var-dump-object.json"; +import { varDumpObjectMock } from "~/src/entities/var-dump/mocks"; import { profilerMock } from "~/src/entities/profiler/mocks"; import { monologMock } from '~/src/entities/monolog/mocks'; import { inspectorMock } from '~/src/entities/inspector/mocks'; @@ -50,7 +50,7 @@ Smtp.args = { export const VarDump = Template.bind({}); VarDump.args = { - event: varDumpEventMock, + event: varDumpObjectMock, }; export const Profiler = Template.bind({}); @@ -74,7 +74,7 @@ const eventsList = [ monologMock, sentrySpiralMock, smtpWelcomeMock, - varDumpEventMock, + varDumpObjectMock, profilerMock, inspectorMock, httpDumpMock, diff --git a/components/ValueDump/ValueDump.stories.ts b/components/ValueDump/ValueDump.stories.ts index 9f99d7c4..0e7c87c3 100644 --- a/components/ValueDump/ValueDump.stories.ts +++ b/components/ValueDump/ValueDump.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import ValueDump from '~/components/ValueDump/ValueDump.vue'; -import varDumpObjectEventMock from '~/mocks/var-dump-object.json' +import { varDumpObjectMock } from '~/src/entities/var-dump/mocks'; export default { title: "Components/ValueDump", @@ -34,5 +34,5 @@ Boolean.args = { export const SfDump = Template.bind({}); SfDump.args = { - value: varDumpObjectEventMock.payload.payload.value, + value: varDumpObjectMock.payload.payload.value, }; diff --git a/components/VarDumpPreview/VarDumpPreview.stories.ts b/components/VarDumpPreview/VarDumpPreview.stories.ts index e947c9db..f39e46bf 100644 --- a/components/VarDumpPreview/VarDumpPreview.stories.ts +++ b/components/VarDumpPreview/VarDumpPreview.stories.ts @@ -1,14 +1,15 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeVarDumpEvent } from "~/utils/normalize-event"; - -import varDumpObjectEventMock from '~/mocks/var-dump-object.json' -import varDumpNumberEventMock from '~/mocks/var-dump-number.json' -import varDumpStringEventMock from '~/mocks/var-dump-string.json' -import varDumpStringEmptyEventMock from '~/mocks/var-dump-string-empty.json' -import varDumpArrayEventMock from '~/mocks/var-dump-array.json' -import varDumpBoolTrueEventMock from '~/mocks/var-dump-boolean-true.json' -import varDumpBoolFalseEventMock from '~/mocks/var-dump-boolean-false.json' import VarDumpPreview from '~/components/VarDumpPreview/VarDumpPreview.vue'; +import { + varDumpArrayMock, + varDumpFalseMock, + varDumpTrueMock, + varDumpNumberMock, + varDumpObjectMock, + varDumpStringMock, + varDumpEmptyStringMock, +} from '~/src/entities/var-dump/mocks'; export default { title: "VarDump/Components/Preview", @@ -28,41 +29,41 @@ const Template: Story = (args) => ({ export const Object = Template.bind({}); Object.args = { - event: normalizeVarDumpEvent(varDumpObjectEventMock), + event: normalizeVarDumpEvent(varDumpObjectMock), }; export const Number = Template.bind({}); Number.args = { - event: normalizeVarDumpEvent(varDumpNumberEventMock), + event: normalizeVarDumpEvent(varDumpNumberMock), }; export const String = Template.bind({}); String.args = { - event: normalizeVarDumpEvent(varDumpStringEventMock), + event: normalizeVarDumpEvent(varDumpStringMock), }; export const StringEmpty = Template.bind({}); StringEmpty.args = { - event: normalizeVarDumpEvent(varDumpStringEmptyEventMock), + event: normalizeVarDumpEvent(varDumpEmptyStringMock), }; export const BooleanTrue = Template.bind({}); BooleanTrue.args = { - event: normalizeVarDumpEvent(varDumpBoolTrueEventMock), + event: normalizeVarDumpEvent(varDumpTrueMock), }; export const BooleanFalse = Template.bind({}); BooleanFalse.args = { - event: normalizeVarDumpEvent(varDumpBoolFalseEventMock), + event: normalizeVarDumpEvent(varDumpFalseMock), }; export const Array = Template.bind({}); Array.args = { - event: normalizeVarDumpEvent(varDumpArrayEventMock), + event: normalizeVarDumpEvent(varDumpArrayMock), }; diff --git a/src/entities/var-dump/mocks/index.ts b/src/entities/var-dump/mocks/index.ts new file mode 100644 index 00000000..52f5bdcc --- /dev/null +++ b/src/entities/var-dump/mocks/index.ts @@ -0,0 +1,17 @@ +import varDumpArrayMock from './var-dump-array.json' +import varDumpFalseMock from './var-dump-false.json' +import varDumpNumberMock from './var-dump-number.json' +import varDumpObjectMock from './var-dump-object.json' +import varDumpEmptyStringMock from './var-dump-string-empty.json' +import varDumpStringMock from './var-dump-string.json' +import varDumpTrueMock from './var-dump-true.json' + +export { + varDumpArrayMock, + varDumpFalseMock, + varDumpTrueMock, + varDumpNumberMock, + varDumpObjectMock, + varDumpStringMock, + varDumpEmptyStringMock, +} diff --git a/mocks/var-dump-array.json b/src/entities/var-dump/mocks/var-dump-array.json similarity index 100% rename from mocks/var-dump-array.json rename to src/entities/var-dump/mocks/var-dump-array.json diff --git a/mocks/var-dump-boolean-false.json b/src/entities/var-dump/mocks/var-dump-false.json similarity index 100% rename from mocks/var-dump-boolean-false.json rename to src/entities/var-dump/mocks/var-dump-false.json diff --git a/mocks/var-dump-number.json b/src/entities/var-dump/mocks/var-dump-number.json similarity index 100% rename from mocks/var-dump-number.json rename to src/entities/var-dump/mocks/var-dump-number.json diff --git a/mocks/var-dump-object.json b/src/entities/var-dump/mocks/var-dump-object.json similarity index 100% rename from mocks/var-dump-object.json rename to src/entities/var-dump/mocks/var-dump-object.json diff --git a/mocks/var-dump-string-empty.json b/src/entities/var-dump/mocks/var-dump-string-empty.json similarity index 100% rename from mocks/var-dump-string-empty.json rename to src/entities/var-dump/mocks/var-dump-string-empty.json diff --git a/mocks/var-dump-string.json b/src/entities/var-dump/mocks/var-dump-string.json similarity index 100% rename from mocks/var-dump-string.json rename to src/entities/var-dump/mocks/var-dump-string.json diff --git a/mocks/var-dump-boolean-true.json b/src/entities/var-dump/mocks/var-dump-true.json similarity index 100% rename from mocks/var-dump-boolean-true.json rename to src/entities/var-dump/mocks/var-dump-true.json From 2f3a7c631515847eb0d8a60c8825b4a7fa3b18e7 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sun, 29 Oct 2023 02:17:39 +0400 Subject: [PATCH 21/72] move ray mocks to new structure --- .../RayDumpLaravelPreview.stories.ts | 26 ++++--- .../RayDumpPreview/RayDumpPreview.stories.ts | 78 ++++++++++--------- .../RayTypesPreview/CallerPayload.stories.ts | 4 +- .../RayTypesPreview/CarbonPayload.stories.ts | 4 +- .../RayTypesPreview/CustomPayload.stories.ts | 4 +- .../ExceptionPayload.stories.ts | 4 +- .../RayTypesPreview/LogPayload.stories.ts | 4 +- .../MailablePayload.stories.ts | 4 +- .../RayTypesPreview/MeasurePayload.stories.ts | 7 +- src/entities/ray/mocks-laravel/index.ts | 23 ++++++ .../ray/mocks-laravel}/ray-laravel-cache.json | 0 .../ray-laravel-collections.json | 4 +- .../mocks-laravel}/ray-laravel-eloquent.json | 0 .../mocks-laravel}/ray-laravel-events.json | 0 .../ray-laravel-http-request.json | 0 .../ray/mocks-laravel}/ray-laravel-jobs.json | 0 .../mocks-laravel}/ray-laravel-mailable.json | 0 .../ray-laravel-query-no-bindings.json | 0 .../ray/mocks-laravel}/ray-laravel-query.json | 4 +- .../ray/mocks-laravel}/ray-laravel-views.json | 0 src/entities/ray/mocks/index.ts | 43 ++++++++++ .../entities/ray/mocks}/ray-caller.json | 0 .../entities/ray/mocks}/ray-carbon.json | 0 .../entities/ray/mocks}/ray-color.json | 4 +- .../entities/ray/mocks}/ray-counter.json | 0 .../entities/ray/mocks}/ray-dump.json | 0 .../entities/ray/mocks/ray-empty-string.json | 0 .../entities/ray/mocks}/ray-exception.json | 0 .../entities/ray/mocks}/ray-hide.json | 0 .../entities/ray/mocks}/ray-image.json | 0 .../entities/ray/mocks/ray-integer.json | 3 - .../entities/ray/mocks}/ray-json.json | 0 .../entities/ray/mocks}/ray-label.json | 0 .../entities/ray/mocks}/ray-lock.json | 2 +- .../ray/mocks}/ray-measure-start.json | 0 .../entities/ray/mocks}/ray-measure.json | 0 .../entities/ray/mocks}/ray-notify.json | 0 .../entities/ray/mocks}/ray-size.json | 0 .../entities/ray/mocks}/ray-table.json | 0 .../entities/ray/mocks}/ray-text.json | 0 .../entities/ray/mocks}/ray-trace.json | 0 41 files changed, 139 insertions(+), 79 deletions(-) create mode 100644 src/entities/ray/mocks-laravel/index.ts rename {mocks => src/entities/ray/mocks-laravel}/ray-laravel-cache.json (100%) rename {mocks => src/entities/ray/mocks-laravel}/ray-laravel-collections.json (99%) rename {mocks => src/entities/ray/mocks-laravel}/ray-laravel-eloquent.json (100%) rename {mocks => src/entities/ray/mocks-laravel}/ray-laravel-events.json (100%) rename {mocks => src/entities/ray/mocks-laravel}/ray-laravel-http-request.json (100%) rename {mocks => src/entities/ray/mocks-laravel}/ray-laravel-jobs.json (100%) rename {mocks => src/entities/ray/mocks-laravel}/ray-laravel-mailable.json (100%) rename {mocks => src/entities/ray/mocks-laravel}/ray-laravel-query-no-bindings.json (100%) rename {mocks => src/entities/ray/mocks-laravel}/ray-laravel-query.json (92%) rename {mocks => src/entities/ray/mocks-laravel}/ray-laravel-views.json (100%) create mode 100644 src/entities/ray/mocks/index.ts rename {mocks => src/entities/ray/mocks}/ray-caller.json (100%) rename {mocks => src/entities/ray/mocks}/ray-carbon.json (100%) rename {mocks => src/entities/ray/mocks}/ray-color.json (94%) rename {mocks => src/entities/ray/mocks}/ray-counter.json (100%) rename {mocks => src/entities/ray/mocks}/ray-dump.json (100%) rename mocks/ray-github-issue-44.json => src/entities/ray/mocks/ray-empty-string.json (100%) rename {mocks => src/entities/ray/mocks}/ray-exception.json (100%) rename {mocks => src/entities/ray/mocks}/ray-hide.json (100%) rename {mocks => src/entities/ray/mocks}/ray-image.json (100%) rename mocks/ray-int.json => src/entities/ray/mocks/ray-integer.json (99%) rename {mocks => src/entities/ray/mocks}/ray-json.json (100%) rename {mocks => src/entities/ray/mocks}/ray-label.json (100%) rename {mocks => src/entities/ray/mocks}/ray-lock.json (88%) rename {mocks => src/entities/ray/mocks}/ray-measure-start.json (100%) rename {mocks => src/entities/ray/mocks}/ray-measure.json (100%) rename {mocks => src/entities/ray/mocks}/ray-notify.json (100%) rename {mocks => src/entities/ray/mocks}/ray-size.json (100%) rename {mocks => src/entities/ray/mocks}/ray-table.json (100%) rename {mocks => src/entities/ray/mocks}/ray-text.json (100%) rename {mocks => src/entities/ray/mocks}/ray-trace.json (100%) diff --git a/components/RayDumpPreview/RayDumpLaravelPreview.stories.ts b/components/RayDumpPreview/RayDumpLaravelPreview.stories.ts index 6c6d6754..34b3c5be 100644 --- a/components/RayDumpPreview/RayDumpLaravelPreview.stories.ts +++ b/components/RayDumpPreview/RayDumpLaravelPreview.stories.ts @@ -1,12 +1,14 @@ import { Meta, Story } from "@storybook/vue3"; import RayDumpPreview from '~/components/RayDumpPreview/RayDumpPreview.vue'; import { normalizeRayDumpEvent } from "~/utils/normalize-event"; -import rayQueryEventMock from '~/mocks/ray-laravel-query.json' -import rayQuery2EventMock from '~/mocks/ray-laravel-query-no-bindings.json' -import rayEloquentEventMock from '~/mocks/ray-laravel-eloquent.json' -import rayViewsEventMock from '~/mocks/ray-laravel-views.json' -import rayEventsEventMock from '~/mocks/ray-laravel-events.json' -import rayJobsEventMock from '~/mocks/ray-laravel-jobs.json' +import { + rayLaravelQueryMock, + rayLaravelQueryNoBindingsMock, + rayLaravelEloquentMock, + rayLaravelViewsMock, + rayLaravelEventsMock, + rayLaravelJobsMock, +} from '~/src/entities/ray/mocks-laravel'; export default { title: "RayDump/RayDumpPreview/Laravel", @@ -24,19 +26,19 @@ const Template: Story = (args) => ({ }); export const Query = Template.bind({}); -Query.args = {event: normalizeRayDumpEvent(rayQueryEventMock),}; +Query.args = {event: normalizeRayDumpEvent(rayLaravelQueryMock),}; export const Query2 = Template.bind({}); -Query2.args = {event: normalizeRayDumpEvent(rayQuery2EventMock),}; +Query2.args = {event: normalizeRayDumpEvent(rayLaravelQueryNoBindingsMock),}; export const Eloquent = Template.bind({}); -Eloquent.args = {event: normalizeRayDumpEvent(rayEloquentEventMock),}; +Eloquent.args = {event: normalizeRayDumpEvent(rayLaravelEloquentMock),}; export const Views = Template.bind({}); -Views.args = {event: normalizeRayDumpEvent(rayViewsEventMock),}; +Views.args = {event: normalizeRayDumpEvent(rayLaravelViewsMock),}; export const Events = Template.bind({}); -Events.args = {event: normalizeRayDumpEvent(rayEventsEventMock),}; +Events.args = {event: normalizeRayDumpEvent(rayLaravelEventsMock),}; export const Jobs = Template.bind({}); -Jobs.args = {event: normalizeRayDumpEvent(rayJobsEventMock),}; +Jobs.args = {event: normalizeRayDumpEvent(rayLaravelJobsMock),}; diff --git a/components/RayDumpPreview/RayDumpPreview.stories.ts b/components/RayDumpPreview/RayDumpPreview.stories.ts index c6510db2..31a29e2d 100644 --- a/components/RayDumpPreview/RayDumpPreview.stories.ts +++ b/components/RayDumpPreview/RayDumpPreview.stories.ts @@ -1,25 +1,27 @@ import { Meta, Story } from "@storybook/vue3"; import RayDumpPreview from '~/components/RayDumpPreview/RayDumpPreview.vue'; import { normalizeRayDumpEvent } from "~/utils/normalize-event"; -import rayIntEventMock from '~/mocks/ray-int.json' -import rayCallerEventMock from '~/mocks/ray-caller.json' -import rayCarbonEventMock from '~/mocks/ray-carbon.json' -import rayColorEventMock from '~/mocks/ray-color.json' -import rayCounterEventMock from '~/mocks/ray-counter.json' -import rayDumpEventMock from '~/mocks/ray-dump.json' -import rayExceptionEventMock from '~/mocks/ray-exception.json' -import rayHideEventMock from '~/mocks/ray-hide.json' -import rayImageEventMock from '~/mocks/ray-image.json' -import rayJsonEventMock from '~/mocks/ray-json.json' -import rayLabelEventMock from '~/mocks/ray-label.json' -import rayMeasureEventMock from '~/mocks/ray-measure.json' -import rayNotifyEventMock from '~/mocks/ray-notify.json' -import raySizeEventMock from '~/mocks/ray-size.json' -import rayTableEventMock from '~/mocks/ray-table.json' -import rayTextEventMock from '~/mocks/ray-text.json' -import rayTraceEventMock from '~/mocks/ray-trace.json' -import rayLockEventMock from '~/mocks/ray-lock.json' -import rayIssue44EventMock from '~/mocks/ray-github-issue-44.json' +import { + rayCallerMock, + rayCarbonMock, + rayColorMock, + rayCounterMock, + rayDumpMock, + rayExceptionMock, + rayEmptyStringMock, + rayHideMock, + rayImageMock, + rayIntegerMock, + rayJsonMock, + rayLabelMock, + rayMeasureStartMock, + rayNotifyMock, + raySizeMock, + rayTableMock, + rayTextMock, + rayTraceMock, + rayLockMock, +} from '~/src/entities/ray/mocks'; export default { title: "RayDump/RayDumpPreview/Common", @@ -38,58 +40,58 @@ const Template: Story = (args) => ({ export const Text = Template.bind({}); -Text.args = {event: normalizeRayDumpEvent(rayTextEventMock),}; +Text.args = {event: normalizeRayDumpEvent(rayTextMock),}; export const Trace = Template.bind({}); -Trace.args = {event: normalizeRayDumpEvent(rayTraceEventMock),}; +Trace.args = {event: normalizeRayDumpEvent(rayTraceMock),}; export const Table = Template.bind({}); -Table.args = {event: normalizeRayDumpEvent(rayTableEventMock),}; +Table.args = {event: normalizeRayDumpEvent(rayTableMock),}; export const Size = Template.bind({}); -Size.args = {event: normalizeRayDumpEvent(raySizeEventMock),}; +Size.args = {event: normalizeRayDumpEvent(raySizeMock),}; export const Notify = Template.bind({}); -Notify.args = {event: normalizeRayDumpEvent(rayNotifyEventMock),}; +Notify.args = {event: normalizeRayDumpEvent(rayNotifyMock),}; export const Measure = Template.bind({}); -Measure.args = {event: normalizeRayDumpEvent(rayMeasureEventMock),}; +Measure.args = {event: normalizeRayDumpEvent(rayMeasureStartMock),}; export const Label = Template.bind({}); -Label.args = {event: normalizeRayDumpEvent(rayLabelEventMock),}; +Label.args = {event: normalizeRayDumpEvent(rayLabelMock),}; export const Json = Template.bind({}); -Json.args = {event: normalizeRayDumpEvent(rayJsonEventMock),}; +Json.args = {event: normalizeRayDumpEvent(rayJsonMock),}; export const Image = Template.bind({}); -Image.args = {event: normalizeRayDumpEvent(rayImageEventMock),}; +Image.args = {event: normalizeRayDumpEvent(rayImageMock),}; export const Hide = Template.bind({}); -Hide.args = {event: normalizeRayDumpEvent(rayHideEventMock),}; +Hide.args = {event: normalizeRayDumpEvent(rayHideMock),}; export const Exception = Template.bind({}); -Exception.args = {event: normalizeRayDumpEvent(rayExceptionEventMock),}; +Exception.args = {event: normalizeRayDumpEvent(rayExceptionMock),}; export const Dump = Template.bind({}); -Dump.args = {event: normalizeRayDumpEvent(rayDumpEventMock),}; +Dump.args = {event: normalizeRayDumpEvent(rayDumpMock),}; export const Counter = Template.bind({}); -Counter.args = {event: normalizeRayDumpEvent(rayCounterEventMock),}; +Counter.args = {event: normalizeRayDumpEvent(rayCounterMock),}; export const Color = Template.bind({}); -Color.args = {event: normalizeRayDumpEvent(rayColorEventMock),}; +Color.args = {event: normalizeRayDumpEvent(rayColorMock),}; export const Carbon = Template.bind({}); -Carbon.args = {event: normalizeRayDumpEvent(rayCarbonEventMock),}; +Carbon.args = {event: normalizeRayDumpEvent(rayCarbonMock),}; export const Int = Template.bind({}); -Int.args = {event: normalizeRayDumpEvent(rayIntEventMock),}; +Int.args = {event: normalizeRayDumpEvent(rayIntegerMock),}; export const Caller = Template.bind({}); -Caller.args = {event: normalizeRayDumpEvent(rayCallerEventMock),}; +Caller.args = {event: normalizeRayDumpEvent(rayCallerMock),}; export const Lock = Template.bind({}); -Lock.args = {event: normalizeRayDumpEvent(rayLockEventMock),}; +Lock.args = {event: normalizeRayDumpEvent(rayLockMock),}; export const Issue44 = Template.bind({}); -Issue44.args = {event: normalizeRayDumpEvent(rayIssue44EventMock),}; +Issue44.args = {event: normalizeRayDumpEvent(rayEmptyStringMock),}; diff --git a/components/RayDumpPreview/RayTypesPreview/CallerPayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/CallerPayload.stories.ts index edfb5c4f..98d22eae 100644 --- a/components/RayDumpPreview/RayTypesPreview/CallerPayload.stories.ts +++ b/components/RayDumpPreview/RayTypesPreview/CallerPayload.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import CallerPayload from '~/components/RayDumpPreview/RayTypesPreview/CallerPayload.vue'; import { normalizeRayDumpEvent } from "~/utils/normalize-event"; -import rayCallerEventMock from '~/mocks/ray-caller.json' +import { rayCallerMock } from '~/src/entities/ray/mocks'; export default { title: "RayDump/Types/Caller", @@ -19,4 +19,4 @@ const Template: Story = (args) => ({ }); export const Caller = Template.bind({}); -Caller.args = {payload: normalizeRayDumpEvent(rayCallerEventMock).payload.payload.payloads[0]}; +Caller.args = {payload: normalizeRayDumpEvent(rayCallerMock).payload.payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/CarbonPayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/CarbonPayload.stories.ts index 2b3dfe9e..53100dd1 100644 --- a/components/RayDumpPreview/RayTypesPreview/CarbonPayload.stories.ts +++ b/components/RayDumpPreview/RayTypesPreview/CarbonPayload.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import CarbonPayload from '~/components/RayDumpPreview/RayTypesPreview/CarbonPayload.vue'; import { normalizeRayDumpEvent } from "~/utils/normalize-event"; -import eventMock from '~/mocks/ray-carbon.json' +import { rayCarbonMock } from '~/src/entities/ray/mocks' export default { title: "RayDump/Types/Carbon", @@ -19,4 +19,4 @@ const Template: Story = (args) => ({ }); export const Carbon = Template.bind({}); -Carbon.args = {payload: normalizeRayDumpEvent(eventMock).payload.payload.payloads[0]}; +Carbon.args = {payload: normalizeRayDumpEvent(rayCarbonMock).payload.payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/CustomPayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/CustomPayload.stories.ts index 99778c66..e3fee496 100644 --- a/components/RayDumpPreview/RayTypesPreview/CustomPayload.stories.ts +++ b/components/RayDumpPreview/RayTypesPreview/CustomPayload.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import CustomPayload from '~/components/RayDumpPreview/RayTypesPreview/CustomPayload.vue'; import { normalizeRayDumpEvent } from "~/utils/normalize-event"; -import eventMock from '~/mocks/ray-text.json' +import { rayTextMock } from '~/src/entities/ray/mocks' export default { title: "RayDump/Types/Custom", @@ -19,4 +19,4 @@ const Template: Story = (args) => ({ }); export const Custom = Template.bind({}); -Custom.args = {payload: normalizeRayDumpEvent(eventMock).payload.payload.payloads[0]}; +Custom.args = {payload: normalizeRayDumpEvent(rayTextMock).payload.payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.stories.ts index e9e2be9f..9b883c25 100644 --- a/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.stories.ts +++ b/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import ExceptionPayload from '~/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.vue'; import { normalizeRayDumpEvent } from "~/utils/normalize-event"; -import eventMock from '~/mocks/ray-exception.json' +import { rayExceptionMock } from '~/src/entities/ray/mocks'; export default { title: "RayDump/Types/Exception", @@ -19,4 +19,4 @@ const Template: Story = (args) => ({ }); export const Exception = Template.bind({}); -Exception.args = {payload: normalizeRayDumpEvent(eventMock).payload.payload.payloads[0]}; +Exception.args = {payload: normalizeRayDumpEvent(rayExceptionMock).payload.payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/LogPayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/LogPayload.stories.ts index 1506f013..21bc65ac 100644 --- a/components/RayDumpPreview/RayTypesPreview/LogPayload.stories.ts +++ b/components/RayDumpPreview/RayTypesPreview/LogPayload.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import LogPayload from '~/components/RayDumpPreview/RayTypesPreview/LogPayload.vue'; import { normalizeRayDumpEvent } from "~/utils/normalize-event"; -import eventMock from '~/mocks/ray-color.json' +import { rayColorMock } from '~/src/entities/ray/mocks' export default { title: "RayDump/Types/Log", @@ -19,4 +19,4 @@ const Template: Story = (args) => ({ }); export const Log = Template.bind({}); -Log.args = {payload: normalizeRayDumpEvent(eventMock).payload.payload.payloads[0]}; +Log.args = {payload: normalizeRayDumpEvent(rayColorMock).payload.payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/MailablePayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/MailablePayload.stories.ts index 08352965..28f30fb5 100644 --- a/components/RayDumpPreview/RayTypesPreview/MailablePayload.stories.ts +++ b/components/RayDumpPreview/RayTypesPreview/MailablePayload.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import { normalizeRayDumpEvent } from "~/utils/normalize-event"; -import eventMock from '~/mocks/ray-laravel-mailable.json'; import MailablePayload from "~/components/RayDumpPreview/RayTypesPreview/MailablePayload.vue"; +import { rayLaravelMailableMock } from '~/src/entities/ray/mocks-laravel' export default { title: "RayDump/Types/Mailable", @@ -19,5 +19,5 @@ const Template: Story = (args) => ({ }); export const Mailable = Template.bind({}); -Mailable.args = {payload: normalizeRayDumpEvent(eventMock).payload.payload.payloads[0]}; +Mailable.args = {payload: normalizeRayDumpEvent(rayLaravelMailableMock).payload.payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/MeasurePayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/MeasurePayload.stories.ts index 5a2d6768..651b8160 100644 --- a/components/RayDumpPreview/RayTypesPreview/MeasurePayload.stories.ts +++ b/components/RayDumpPreview/RayTypesPreview/MeasurePayload.stories.ts @@ -1,8 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; import MeasurePayload from '~/components/RayDumpPreview/RayTypesPreview/MeasurePayload.vue'; import { normalizeRayDumpEvent } from "~/utils/normalize-event"; -import eventMock from '~/mocks/ray-measure.json'; -import eventStartMock from '~/mocks/ray-measure-start.json'; +import { rayMeasureMock, rayMeasureStartMock } from '~/src/entities/ray/mocks' export default { title: "RayDump/Types/Measure", @@ -20,7 +19,7 @@ const Template: Story = (args) => ({ }); export const Default = Template.bind({}); -Default.args = {payload: normalizeRayDumpEvent(eventMock).payload.payload.payloads[0]}; +Default.args = {payload: normalizeRayDumpEvent(rayMeasureMock).payload.payload.payloads[0]}; export const Start = Template.bind({}); -Start.args = {payload: normalizeRayDumpEvent(eventStartMock).payload.payload.payloads[0]}; +Start.args = {payload: normalizeRayDumpEvent(rayMeasureStartMock).payload.payload.payloads[0]}; diff --git a/src/entities/ray/mocks-laravel/index.ts b/src/entities/ray/mocks-laravel/index.ts new file mode 100644 index 00000000..f9178c38 --- /dev/null +++ b/src/entities/ray/mocks-laravel/index.ts @@ -0,0 +1,23 @@ +import rayLaravelCacheMock from './ray-laravel-cache.json'; +import rayLaravelCollectionMock from './ray-laravel-collections.json'; +import rayLaravelEloquentMock from './ray-laravel-eloquent.json'; +import rayLaravelEventsMock from './ray-laravel-events.json'; +import rayLaravelHttpRequestMock from './ray-laravel-http-request.json'; +import rayLaravelJobsMock from './ray-laravel-jobs.json'; +import rayLaravelMailableMock from './ray-laravel-mailable.json'; +import rayLaravelQueryNoBindingsMock from './ray-laravel-query-no-bindings.json'; +import rayLaravelQueryMock from './ray-laravel-query.json'; +import rayLaravelViewsMock from './ray-laravel-views.json'; + +export { + rayLaravelCacheMock, + rayLaravelCollectionMock, + rayLaravelEloquentMock, + rayLaravelJobsMock, + rayLaravelEventsMock, + rayLaravelHttpRequestMock, + rayLaravelMailableMock, + rayLaravelQueryMock, + rayLaravelQueryNoBindingsMock, + rayLaravelViewsMock +} diff --git a/mocks/ray-laravel-cache.json b/src/entities/ray/mocks-laravel/ray-laravel-cache.json similarity index 100% rename from mocks/ray-laravel-cache.json rename to src/entities/ray/mocks-laravel/ray-laravel-cache.json diff --git a/mocks/ray-laravel-collections.json b/src/entities/ray/mocks-laravel/ray-laravel-collections.json similarity index 99% rename from mocks/ray-laravel-collections.json rename to src/entities/ray/mocks-laravel/ray-laravel-collections.json index 761a8bfc..c8a0e05e 100644 --- a/mocks/ray-laravel-collections.json +++ b/src/entities/ray/mocks-laravel/ray-laravel-collections.json @@ -7,9 +7,7 @@ { "type": "log", "content": { - "values": [ - "uppercased collection" - ] + "values": ["uppercased collection"] }, "origin": { "file": "/root/repos/buggreagtor/examples/app/Modules/Ray/RayLaravel.php", diff --git a/mocks/ray-laravel-eloquent.json b/src/entities/ray/mocks-laravel/ray-laravel-eloquent.json similarity index 100% rename from mocks/ray-laravel-eloquent.json rename to src/entities/ray/mocks-laravel/ray-laravel-eloquent.json diff --git a/mocks/ray-laravel-events.json b/src/entities/ray/mocks-laravel/ray-laravel-events.json similarity index 100% rename from mocks/ray-laravel-events.json rename to src/entities/ray/mocks-laravel/ray-laravel-events.json diff --git a/mocks/ray-laravel-http-request.json b/src/entities/ray/mocks-laravel/ray-laravel-http-request.json similarity index 100% rename from mocks/ray-laravel-http-request.json rename to src/entities/ray/mocks-laravel/ray-laravel-http-request.json diff --git a/mocks/ray-laravel-jobs.json b/src/entities/ray/mocks-laravel/ray-laravel-jobs.json similarity index 100% rename from mocks/ray-laravel-jobs.json rename to src/entities/ray/mocks-laravel/ray-laravel-jobs.json diff --git a/mocks/ray-laravel-mailable.json b/src/entities/ray/mocks-laravel/ray-laravel-mailable.json similarity index 100% rename from mocks/ray-laravel-mailable.json rename to src/entities/ray/mocks-laravel/ray-laravel-mailable.json diff --git a/mocks/ray-laravel-query-no-bindings.json b/src/entities/ray/mocks-laravel/ray-laravel-query-no-bindings.json similarity index 100% rename from mocks/ray-laravel-query-no-bindings.json rename to src/entities/ray/mocks-laravel/ray-laravel-query-no-bindings.json diff --git a/mocks/ray-laravel-query.json b/src/entities/ray/mocks-laravel/ray-laravel-query.json similarity index 92% rename from mocks/ray-laravel-query.json rename to src/entities/ray/mocks-laravel/ray-laravel-query.json index 61d67be0..56397d68 100644 --- a/mocks/ray-laravel-query.json +++ b/src/entities/ray/mocks-laravel/ray-laravel-query.json @@ -8,9 +8,7 @@ "type": "executed_query", "content": { "sql": "select * from \"users\" where \"email\" = ? limit 1", - "bindings": [ - "john@example.com" - ], + "bindings": ["john@example.com"], "connection_name": "sqlite", "time": 0.38 }, diff --git a/mocks/ray-laravel-views.json b/src/entities/ray/mocks-laravel/ray-laravel-views.json similarity index 100% rename from mocks/ray-laravel-views.json rename to src/entities/ray/mocks-laravel/ray-laravel-views.json diff --git a/src/entities/ray/mocks/index.ts b/src/entities/ray/mocks/index.ts new file mode 100644 index 00000000..99e82586 --- /dev/null +++ b/src/entities/ray/mocks/index.ts @@ -0,0 +1,43 @@ +import rayCallerMock from './ray-caller.json'; +import rayCarbonMock from './ray-carbon.json'; +import rayColorMock from './ray-color.json'; +import rayCounterMock from './ray-counter.json'; +import rayDumpMock from './ray-dump.json'; +import rayEmptyStringMock from './ray-empty-string.json'; +import rayExceptionMock from './ray-exception.json'; +import rayHideMock from './ray-hide.json'; +import rayImageMock from './ray-image.json'; +import rayIntegerMock from './ray-integer.json'; +import rayJsonMock from './ray-json.json'; +import rayLabelMock from './ray-label.json'; +import rayLockMock from './ray-lock.json'; +import rayMeasureStartMock from './ray-measure-start.json'; +import rayMeasureMock from './ray-measure.json'; +import rayNotifyMock from './ray-notify.json'; +import raySizeMock from './ray-size.json'; +import rayTableMock from './ray-table.json'; +import rayTextMock from './ray-text.json'; +import rayTraceMock from './ray-trace.json'; + +export { + rayCallerMock, + rayCarbonMock, + rayColorMock, + rayCounterMock, + rayDumpMock, + rayExceptionMock, + rayEmptyStringMock, + rayHideMock, + rayImageMock, + rayIntegerMock, + rayJsonMock, + rayLabelMock, + rayLockMock, + rayMeasureMock, + rayMeasureStartMock, + rayNotifyMock, + raySizeMock, + rayTableMock, + rayTextMock, + rayTraceMock, +} diff --git a/mocks/ray-caller.json b/src/entities/ray/mocks/ray-caller.json similarity index 100% rename from mocks/ray-caller.json rename to src/entities/ray/mocks/ray-caller.json diff --git a/mocks/ray-carbon.json b/src/entities/ray/mocks/ray-carbon.json similarity index 100% rename from mocks/ray-carbon.json rename to src/entities/ray/mocks/ray-carbon.json diff --git a/mocks/ray-color.json b/src/entities/ray/mocks/ray-color.json similarity index 94% rename from mocks/ray-color.json rename to src/entities/ray/mocks/ray-color.json index fe9a8190..dae44393 100644 --- a/mocks/ray-color.json +++ b/src/entities/ray/mocks/ray-color.json @@ -7,9 +7,7 @@ { "type": "log", "content": { - "values": [ - "this is green" - ] + "values": ["this is green"] }, "origin": { "file": "/root/repos/buggreagtor/examples/app/Modules/Ray/RayCommon.php", diff --git a/mocks/ray-counter.json b/src/entities/ray/mocks/ray-counter.json similarity index 100% rename from mocks/ray-counter.json rename to src/entities/ray/mocks/ray-counter.json diff --git a/mocks/ray-dump.json b/src/entities/ray/mocks/ray-dump.json similarity index 100% rename from mocks/ray-dump.json rename to src/entities/ray/mocks/ray-dump.json diff --git a/mocks/ray-github-issue-44.json b/src/entities/ray/mocks/ray-empty-string.json similarity index 100% rename from mocks/ray-github-issue-44.json rename to src/entities/ray/mocks/ray-empty-string.json diff --git a/mocks/ray-exception.json b/src/entities/ray/mocks/ray-exception.json similarity index 100% rename from mocks/ray-exception.json rename to src/entities/ray/mocks/ray-exception.json diff --git a/mocks/ray-hide.json b/src/entities/ray/mocks/ray-hide.json similarity index 100% rename from mocks/ray-hide.json rename to src/entities/ray/mocks/ray-hide.json diff --git a/mocks/ray-image.json b/src/entities/ray/mocks/ray-image.json similarity index 100% rename from mocks/ray-image.json rename to src/entities/ray/mocks/ray-image.json diff --git a/mocks/ray-int.json b/src/entities/ray/mocks/ray-integer.json similarity index 99% rename from mocks/ray-int.json rename to src/entities/ray/mocks/ray-integer.json index 9da2b1a5..91fcf5a2 100644 --- a/mocks/ray-int.json +++ b/src/entities/ray/mocks/ray-integer.json @@ -127,6 +127,3 @@ "timestamp": 1673266869, "project_id": null } - - - diff --git a/mocks/ray-json.json b/src/entities/ray/mocks/ray-json.json similarity index 100% rename from mocks/ray-json.json rename to src/entities/ray/mocks/ray-json.json diff --git a/mocks/ray-label.json b/src/entities/ray/mocks/ray-label.json similarity index 100% rename from mocks/ray-label.json rename to src/entities/ray/mocks/ray-label.json diff --git a/mocks/ray-lock.json b/src/entities/ray/mocks/ray-lock.json similarity index 88% rename from mocks/ray-lock.json rename to src/entities/ray/mocks/ray-lock.json index 7fc7b21f..afb388ad 100644 --- a/mocks/ray-lock.json +++ b/src/entities/ray/mocks/ray-lock.json @@ -10,7 +10,7 @@ "name": "07c1878459f801740304771cd63993c7" }, "origin": { - "file": "\/root\/repos\/buggreagtor\/examples\/app\/Modules\/Ray\/RayCommon.php", + "file": "/root/repos/buggreagtor/examples/app/Modules/Ray/RayCommon.php", "line_number": 102, "hostname": "ButschsterLpp" } diff --git a/mocks/ray-measure-start.json b/src/entities/ray/mocks/ray-measure-start.json similarity index 100% rename from mocks/ray-measure-start.json rename to src/entities/ray/mocks/ray-measure-start.json diff --git a/mocks/ray-measure.json b/src/entities/ray/mocks/ray-measure.json similarity index 100% rename from mocks/ray-measure.json rename to src/entities/ray/mocks/ray-measure.json diff --git a/mocks/ray-notify.json b/src/entities/ray/mocks/ray-notify.json similarity index 100% rename from mocks/ray-notify.json rename to src/entities/ray/mocks/ray-notify.json diff --git a/mocks/ray-size.json b/src/entities/ray/mocks/ray-size.json similarity index 100% rename from mocks/ray-size.json rename to src/entities/ray/mocks/ray-size.json diff --git a/mocks/ray-table.json b/src/entities/ray/mocks/ray-table.json similarity index 100% rename from mocks/ray-table.json rename to src/entities/ray/mocks/ray-table.json diff --git a/mocks/ray-text.json b/src/entities/ray/mocks/ray-text.json similarity index 100% rename from mocks/ray-text.json rename to src/entities/ray/mocks/ray-text.json diff --git a/mocks/ray-trace.json b/src/entities/ray/mocks/ray-trace.json similarity index 100% rename from mocks/ray-trace.json rename to src/entities/ray/mocks/ray-trace.json From 33ca55b005c9c3b505eb1c160aec712ccff3d413 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sun, 29 Oct 2023 02:44:31 +0400 Subject: [PATCH 22/72] update normalize-profiler-events usage for new structure --- .../PreviewEventMapper/PreviewEventMapper.vue | 13 +++++++++++-- .../ProfilePageFlamegraph.stories.ts | 4 +++- components/ProfilerPage/ProfilerPage.stories.ts | 4 +++- .../ProfilerPageCallGraph.stories.ts | 4 +++- .../ProfilerPageCallStack.stories.ts | 4 +++- .../ProfilerPageCallStackRow.stories.ts | 4 +++- .../ProfilerPreview/ProfilerPreview.stories.ts | 4 +++- pages/profiler/[id].vue | 4 +++- src/entities/lib/index.ts | 1 - src/entities/lib/normalize-event/index.ts | 2 -- src/entities/profiler/index.ts | 1 + src/entities/profiler/lib/index.ts | 2 ++ .../lib}/normalize-profile-event.ts | 0 .../lib/use-profiler.ts} | 5 ++--- src/widgets/ui/stat-board/stat-board.stories.ts | 6 +++--- utils/normalize-event.ts | 12 ------------ 16 files changed, 40 insertions(+), 30 deletions(-) delete mode 100644 src/entities/lib/index.ts delete mode 100644 src/entities/lib/normalize-event/index.ts create mode 100644 src/entities/profiler/index.ts create mode 100644 src/entities/profiler/lib/index.ts rename src/entities/{lib/normalize-event => profiler/lib}/normalize-profile-event.ts (100%) rename src/entities/{lib/normalize-event/use-normalize-event.ts => profiler/lib/use-profiler.ts} (65%) diff --git a/components/PreviewEventMapper/PreviewEventMapper.vue b/components/PreviewEventMapper/PreviewEventMapper.vue index 2e918538..3926cedc 100644 --- a/components/PreviewEventMapper/PreviewEventMapper.vue +++ b/components/PreviewEventMapper/PreviewEventMapper.vue @@ -18,7 +18,6 @@ import { normalizeVarDumpEvent, normalizeSentryEvent, normalizeInspectorEvent, - normalizeProfilerEvent, normalizeHttpDumpEvent, normalizeFallbackEvent, normalizeRayDumpEvent, @@ -32,13 +31,23 @@ import ProfilerPreview from "~/components/ProfilerPreview/ProfilerPreview.vue"; import InspectorPreview from "~/components/InspectorPreview/InspectorPreview.vue"; import PreviewFallback from "~/components/PreviewFallback/PreviewFallback.vue"; import HttpDumpPreview from "~/components/HttpDumpPreview/HttpDumpPreview.vue"; +import { useProfiler } from "~/src/entities/profiler"; +const { normalizeProfilerEvent } = useProfiler(); export default defineComponent({ props: { event: { type: Object as PropType< ServerEvent< - Monolog | SMTP | Sentry | VarDump | Profiler | Inspector | HttpDump | RayDump | unknown + | Monolog + | SMTP + | Sentry + | VarDump + | Profiler + | Inspector + | HttpDump + | RayDump + | unknown > >, required: true, diff --git a/components/ProfilePageFlamegraph/ProfilePageFlamegraph.stories.ts b/components/ProfilePageFlamegraph/ProfilePageFlamegraph.stories.ts index 9a9083f8..de0a2b4c 100644 --- a/components/ProfilePageFlamegraph/ProfilePageFlamegraph.stories.ts +++ b/components/ProfilePageFlamegraph/ProfilePageFlamegraph.stories.ts @@ -1,8 +1,10 @@ import {Meta, Story} from "@storybook/vue3"; -import {normalizeProfilerEvent} from "~/utils/normalize-event"; import { Profiler } from "~/config/types"; import ProfilePageFlamegraph from '~/components/ProfilePageFlamegraph/ProfilePageFlamegraph.vue'; import { profilerMock } from "~/src/entities/profiler/mocks"; +import { useProfiler } from "~/src/entities/profiler/lib"; + +const { normalizeProfilerEvent } = useProfiler(); export default { title: "Profiler/Page/ProfilePageFlamegraph", diff --git a/components/ProfilerPage/ProfilerPage.stories.ts b/components/ProfilerPage/ProfilerPage.stories.ts index 9e7c6711..e8f7632c 100644 --- a/components/ProfilerPage/ProfilerPage.stories.ts +++ b/components/ProfilerPage/ProfilerPage.stories.ts @@ -1,7 +1,9 @@ import { Meta, Story } from "@storybook/vue3"; -import { normalizeProfilerEvent } from "~/utils/normalize-event"; import ProfilerPage from '~/components/ProfilerPage/ProfilerPage.vue'; import { profilerMock } from "~/src/entities/profiler/mocks"; +import { useProfiler } from "~/src/entities/profiler/lib"; + +const { normalizeProfilerEvent } = useProfiler(); export default { title: "Profiler/Page/ProfilerPage", diff --git a/components/ProfilerPageCallGraph/ProfilerPageCallGraph.stories.ts b/components/ProfilerPageCallGraph/ProfilerPageCallGraph.stories.ts index 184a771a..a5f5a093 100644 --- a/components/ProfilerPageCallGraph/ProfilerPageCallGraph.stories.ts +++ b/components/ProfilerPageCallGraph/ProfilerPageCallGraph.stories.ts @@ -1,7 +1,9 @@ import { Meta, Story } from "@storybook/vue3"; -import { normalizeProfilerEvent } from "~/utils/normalize-event"; import ProfilerPageCallGraph from '~/components/ProfilerPageCallGraph/ProfilerPageCallGraph.vue'; import { profilerMock } from "~/src/entities/profiler/mocks"; +import { useProfiler } from "~/src/entities/profiler/lib"; + +const { normalizeProfilerEvent } = useProfiler(); export default { title: "Profiler/Page/ProfilerPageCallGraph", diff --git a/components/ProfilerPageCallStack/ProfilerPageCallStack.stories.ts b/components/ProfilerPageCallStack/ProfilerPageCallStack.stories.ts index 572dd81d..1e6fdd4d 100644 --- a/components/ProfilerPageCallStack/ProfilerPageCallStack.stories.ts +++ b/components/ProfilerPageCallStack/ProfilerPageCallStack.stories.ts @@ -1,7 +1,9 @@ import { Meta, Story } from "@storybook/vue3"; -import { normalizeProfilerEvent } from "~/utils/normalize-event"; import ProfilerPageCallStack from '~/components/ProfilerPageCallStack/ProfilerPageCallStack.vue'; import { profilerMock } from "~/src/entities/profiler/mocks"; +import { useProfiler } from "~/src/entities/profiler/lib"; + +const { normalizeProfilerEvent } = useProfiler(); export default { title: "Profiler/Page/ProfilerPageCallStack", diff --git a/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.stories.ts b/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.stories.ts index c59adb4a..0035e4c9 100644 --- a/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.stories.ts +++ b/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.stories.ts @@ -1,7 +1,9 @@ import { Meta, Story } from "@storybook/vue3"; -import { normalizeProfilerEvent } from "~/utils/normalize-event"; import ProfilerPageCallStackRow from '~/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.vue'; import { profilerMock } from "~/src/entities/profiler/mocks"; +import { useProfiler } from '~/src/entities/profiler/lib'; + +const { normalizeProfilerEvent } = useProfiler(); export default { title: "Profiler/Page/ProfilerPageCallStackRow", diff --git a/components/ProfilerPreview/ProfilerPreview.stories.ts b/components/ProfilerPreview/ProfilerPreview.stories.ts index 665df231..6506dd27 100644 --- a/components/ProfilerPreview/ProfilerPreview.stories.ts +++ b/components/ProfilerPreview/ProfilerPreview.stories.ts @@ -1,7 +1,9 @@ import { Meta, Story } from "@storybook/vue3"; -import { normalizeProfilerEvent } from "~/utils/normalize-event"; import ProfilerPreview from '~/components/ProfilerPreview/ProfilerPreview.vue'; import { profilerMock } from "~/src/entities/profiler/mocks"; +import { useProfiler } from "~/src/entities/profiler/lib"; + +const { normalizeProfilerEvent } = useProfiler(); export default { title: "Profiler/Components/ProfilerPreview", diff --git a/pages/profiler/[id].vue b/pages/profiler/[id].vue index bfb1f811..75d3ad77 100644 --- a/pages/profiler/[id].vue +++ b/pages/profiler/[id].vue @@ -26,9 +26,11 @@ import { defineComponent } from "vue"; import { EventId } from "~/config/types"; import { useFetch, useNuxtApp, useRoute, useRouter } from "#app"; -import { normalizeProfilerEvent } from "~/utils/normalize-event"; import ProfilerPage from "~/components/ProfilerPage/ProfilerPage.vue"; import PageHeader from "~/components/PageHeader/PageHeader.vue"; +import { useProfiler } from "~/src/entities/profiler/lib"; + +const { normalizeProfilerEvent } = useProfiler(); export default defineComponent({ components: { ProfilerPage, PageHeader }, diff --git a/src/entities/lib/index.ts b/src/entities/lib/index.ts deleted file mode 100644 index 28ab8f1b..00000000 --- a/src/entities/lib/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./normalize-event"; diff --git a/src/entities/lib/normalize-event/index.ts b/src/entities/lib/normalize-event/index.ts deleted file mode 100644 index f16c80c7..00000000 --- a/src/entities/lib/normalize-event/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./use-normalize-event"; - diff --git a/src/entities/profiler/index.ts b/src/entities/profiler/index.ts new file mode 100644 index 00000000..f41a696f --- /dev/null +++ b/src/entities/profiler/index.ts @@ -0,0 +1 @@ +export * from './lib'; diff --git a/src/entities/profiler/lib/index.ts b/src/entities/profiler/lib/index.ts new file mode 100644 index 00000000..7a55f667 --- /dev/null +++ b/src/entities/profiler/lib/index.ts @@ -0,0 +1,2 @@ +export * from "./use-profiler"; + diff --git a/src/entities/lib/normalize-event/normalize-profile-event.ts b/src/entities/profiler/lib/normalize-profile-event.ts similarity index 100% rename from src/entities/lib/normalize-event/normalize-profile-event.ts rename to src/entities/profiler/lib/normalize-profile-event.ts diff --git a/src/entities/lib/normalize-event/use-normalize-event.ts b/src/entities/profiler/lib/use-profiler.ts similarity index 65% rename from src/entities/lib/normalize-event/use-normalize-event.ts rename to src/entities/profiler/lib/use-profiler.ts index 6bfcd5ec..9dd8c92c 100644 --- a/src/entities/lib/normalize-event/use-normalize-event.ts +++ b/src/entities/profiler/lib/use-profiler.ts @@ -1,11 +1,10 @@ import { NormalizedEvent, Profiler, ServerEvent } from "~/config/types"; import { normalizeProfilerEvent } from "./normalize-profile-event"; -// TODO: need to move types to FSD structure -type TUseNormalizer = () => { +type TUseProfiler = () => { normalizeProfilerEvent: (event: ServerEvent) => NormalizedEvent } -export const useNormalizeEvent: TUseNormalizer = () => ({ +export const useProfiler: TUseProfiler = () => ({ normalizeProfilerEvent }) diff --git a/src/widgets/ui/stat-board/stat-board.stories.ts b/src/widgets/ui/stat-board/stat-board.stories.ts index 3ea291b3..177e62b1 100644 --- a/src/widgets/ui/stat-board/stat-board.stories.ts +++ b/src/widgets/ui/stat-board/stat-board.stories.ts @@ -1,11 +1,11 @@ import { Meta, Story } from "@storybook/vue3"; // TODO: move type to entities import type { Profiler } from "~/config/types"; -import { useNormalizeEvent } from "~/src/entities/lib"; -import { profilerMock } from "~/src/entities/profiler/mocks"; +import { useProfiler } from "~/src/entities/profiler"; +import { profilerMock } from "~/src/entities/profiler/mocks"; import StatBoard from "./stat-board.vue"; -const { normalizeProfilerEvent } = useNormalizeEvent() +const { normalizeProfilerEvent } = useProfiler() export default { title: "FSD/widgets/StatBoard", diff --git a/utils/normalize-event.ts b/utils/normalize-event.ts index 2b686b75..7712125f 100644 --- a/utils/normalize-event.ts +++ b/utils/normalize-event.ts @@ -4,7 +4,6 @@ import { InspectorTransaction, Monolog, NormalizedEvent, - Profiler, RayDump, Sentry, ServerEvent, @@ -43,16 +42,6 @@ export const normalizeInspectorEvent = (event: ServerEvent): Normaliz } } -export const normalizeProfilerEvent = (event: ServerEvent): NormalizedEvent => ({ - id: event.uuid, - type: EVENT_TYPES.PROFILER, - labels: [EVENT_TYPES.PROFILER], - origin: {name: event.payload.app_name, ...event.payload.tags}, - serverName: event.payload.hostname, - date: new Date(event.timestamp * 1000), - payload: event.payload -}) - export const normalizeHttpDumpEvent = (event: ServerEvent): NormalizedEvent => ({ id: event.uuid, type: EVENT_TYPES.HTTP_DUMP, @@ -63,7 +52,6 @@ export const normalizeHttpDumpEvent = (event: ServerEvent): Normalized payload: event.payload }) - export const normalizeMonologEvent = (event: ServerEvent): NormalizedEvent => ({ id: event.uuid, type: EVENT_TYPES.MONOLOG, From 826ea579139e1e9fb5c0fd7fbb10dfbaa02f2b11 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Tue, 31 Oct 2023 22:39:45 +0400 Subject: [PATCH 23/72] move page-header to new file structure --- pages/http-dumps/[id].vue | 2 +- pages/index.vue | 2 +- pages/inspector/[id].vue | 2 +- pages/profiler/[id].vue | 2 +- pages/sentry/[id].vue | 2 +- pages/settings.vue | 2 +- pages/smtp/[id].vue | 2 +- src/widgets/ui/index.ts | 1 + src/widgets/ui/page-header/index.ts | 3 ++ .../ui/page-header/page-header.stories.ts | 4 +- .../widgets/ui/page-header/page-header.vue | 53 +++++++++---------- 11 files changed, 37 insertions(+), 38 deletions(-) create mode 100644 src/widgets/ui/page-header/index.ts rename components/PageHeader/PageHeader.stories.ts => src/widgets/ui/page-header/page-header.stories.ts (93%) rename components/PageHeader/PageHeader.vue => src/widgets/ui/page-header/page-header.vue (71%) diff --git a/pages/http-dumps/[id].vue b/pages/http-dumps/[id].vue index 62ec144f..a627cbab 100644 --- a/pages/http-dumps/[id].vue +++ b/pages/http-dumps/[id].vue @@ -28,7 +28,7 @@ import { EventId } from "~/config/types"; import { useFetch, useNuxtApp, useRoute, useRouter } from "#app"; import { normalizeHttpDumpEvent } from "~/utils/normalize-event"; import HttpDumpPage from "~/components/HttpDumpPage/HttpDumpPage.vue"; -import PageHeader from "~/components/PageHeader/PageHeader.vue"; +import { PageHeader } from "~/src/widgets/ui"; export default defineComponent({ components: { HttpDumpPage, PageHeader }, diff --git a/pages/index.vue b/pages/index.vue index a095ae96..27bccdf7 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -49,7 +49,7 @@ + - - diff --git a/config/constants.ts b/config/constants.ts index 83dddb65..6f7cceaf 100644 --- a/config/constants.ts +++ b/config/constants.ts @@ -53,9 +53,3 @@ export const LOCAL_STORAGE_KEYS = { NAVBAR: "navbar", }; - -export enum SORT_ORDER { - ASC = 'asc', - DESC = 'desc', - DEFAULT = 'default', -} diff --git a/src/shared/ui/index.ts b/src/shared/ui/index.ts index f5fff4b8..1abbfc5a 100644 --- a/src/shared/ui/index.ts +++ b/src/shared/ui/index.ts @@ -1,2 +1,3 @@ export * from './icon-svg'; export * from './table-base'; +export * from './sorting-wrapper'; diff --git a/src/shared/ui/sorting-wrapper/constants.ts b/src/shared/ui/sorting-wrapper/constants.ts new file mode 100644 index 00000000..4d95cb98 --- /dev/null +++ b/src/shared/ui/sorting-wrapper/constants.ts @@ -0,0 +1,6 @@ + +export enum SORTING_ORDER { + ASC = 'asc', + DESC = 'desc', + DEFAULT = 'default', +} diff --git a/src/shared/ui/sorting-wrapper/index.ts b/src/shared/ui/sorting-wrapper/index.ts new file mode 100644 index 00000000..8c1ef292 --- /dev/null +++ b/src/shared/ui/sorting-wrapper/index.ts @@ -0,0 +1,4 @@ +import { SORTING_ORDER } from "./constants"; +import SortingWrapper from "./sorting-wrapper.vue"; + +export { SortingWrapper, SORTING_ORDER }; diff --git a/components/SortWrap/SortWrap.stories.ts b/src/shared/ui/sorting-wrapper/sorting-wrapper.stories.ts similarity index 79% rename from components/SortWrap/SortWrap.stories.ts rename to src/shared/ui/sorting-wrapper/sorting-wrapper.stories.ts index 709f28ce..a08dac01 100644 --- a/components/SortWrap/SortWrap.stories.ts +++ b/src/shared/ui/sorting-wrapper/sorting-wrapper.stories.ts @@ -1,10 +1,10 @@ -import { Meta, Story } from "@storybook/vue3"; -import SortWrap from "~/components/SortWrap/SortWrap.vue"; -import { SORT_ORDER } from "~/config/constants"; import { action } from "@storybook/addon-actions"; +import { Meta, Story } from "@storybook/vue3"; +import { SORTING_ORDER } from "./constants"; +import SortWrap from "./sorting-wrapper.vue"; export default { - title: "Components/SortWrap", + title: "FSD/shared/SortingWrapper", component: SortWrap, } as Meta; @@ -16,7 +16,7 @@ const Template: Story = (args) => ({ setup() { return { args, - SORT_ORDER, + SORTING_ORDER, }; }, @@ -33,7 +33,7 @@ const Template: Story = (args) => ({
ASC sort @@ -42,7 +42,7 @@ const Template: Story = (args) => ({
DESC sort diff --git a/src/shared/ui/sorting-wrapper/sorting-wrapper.vue b/src/shared/ui/sorting-wrapper/sorting-wrapper.vue new file mode 100644 index 00000000..176a730f --- /dev/null +++ b/src/shared/ui/sorting-wrapper/sorting-wrapper.vue @@ -0,0 +1,81 @@ + + + + + From 96c34ffac0ba42429199bca79c1d3fcc0b005c04 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Tue, 31 Oct 2023 23:37:16 +0400 Subject: [PATCH 25/72] move common constants to new structure --- components/PreviewCard/PreviewCard.stories.ts | 2 +- .../PreviewCardHeader.stories.ts | 2 +- .../PreviewCardHeader/PreviewCardHeader.vue | 5 +-- .../PreviewEventMapper/PreviewEventMapper.vue | 3 +- .../RayDumpTypeMapper/RayDumpTypeMapper.vue | 1 - config/constants.ts | 32 ---------------- config/types.ts | 23 +++--------- pages/http-dumps/[id].vue | 2 +- pages/http-dumps/index.vue | 6 +-- pages/index.vue | 18 ++++----- pages/inspector/[id].vue | 2 +- pages/inspector/index.vue | 6 +-- pages/profiler/[id].vue | 2 +- pages/profiler/index.vue | 6 +-- pages/sentry/[id].vue | 2 +- pages/sentry/index.vue | 6 +-- pages/smtp/[id].vue | 2 +- pages/smtp/index.vue | 6 +-- plugins/events.client.ts | 4 +- .../profiler/lib/normalize-profile-event.ts | 4 +- src/entities/profiler/lib/use-profiler.ts | 3 +- src/shared/constants/index.ts | 1 + src/shared/constants/pages.ts | 13 +++++++ src/shared/types/events.ts | 36 ++++++++++++++++++ src/shared/types/generics.ts | 1 + src/shared/types/index.ts | 3 ++ src/shared/types/local-storage.ts | 6 +++ .../ui/code-snippet/code-snippet.stories.ts | 2 +- .../ui/page-header/page-header.stories.ts | 2 +- stores/cached-ids.ts | 37 ++++++++++--------- stores/events.ts | 4 +- stores/settings.ts | 2 +- utils/api-transport.ts | 4 +- utils/io/events-requests.ts | 6 +-- utils/io/types.ts | 2 - utils/normalize-event.ts | 4 +- 36 files changed, 136 insertions(+), 124 deletions(-) create mode 100644 src/shared/constants/index.ts create mode 100644 src/shared/constants/pages.ts create mode 100644 src/shared/types/events.ts create mode 100644 src/shared/types/generics.ts create mode 100644 src/shared/types/index.ts create mode 100644 src/shared/types/local-storage.ts diff --git a/components/PreviewCard/PreviewCard.stories.ts b/components/PreviewCard/PreviewCard.stories.ts index 14fcfd3d..baf57edc 100644 --- a/components/PreviewCard/PreviewCard.stories.ts +++ b/components/PreviewCard/PreviewCard.stories.ts @@ -1,5 +1,5 @@ import { Meta, Story } from "@storybook/vue3"; -import { EVENT_TYPES } from "~/config/constants"; +import { EVENT_TYPES } from "~/src/shared/types"; import PreviewCard from "~/components/PreviewCard/PreviewCard.vue"; export default { diff --git a/components/PreviewCardHeader/PreviewCardHeader.stories.ts b/components/PreviewCardHeader/PreviewCardHeader.stories.ts index 30bd0d7b..6d650b84 100644 --- a/components/PreviewCardHeader/PreviewCardHeader.stories.ts +++ b/components/PreviewCardHeader/PreviewCardHeader.stories.ts @@ -1,6 +1,6 @@ import { action } from '@storybook/addon-actions' import { Meta, Story } from "@storybook/vue3"; -import { EVENT_TYPES } from '~/config/constants'; +import { EVENT_TYPES } from "~/src/shared/types"; import PreviewCardHeader from '~/components/PreviewCardHeader/PreviewCardHeader.vue'; export default { diff --git a/components/PreviewCardHeader/PreviewCardHeader.vue b/components/PreviewCardHeader/PreviewCardHeader.vue index f033869b..705aaaf5 100644 --- a/components/PreviewCardHeader/PreviewCardHeader.vue +++ b/components/PreviewCardHeader/PreviewCardHeader.vue @@ -61,8 +61,7 @@ - - diff --git a/components/VarDumpPreview/VarDumpPreview.vue b/components/VarDumpPreview/VarDumpPreview.vue index 0e5f3082..7c391bfb 100644 --- a/components/VarDumpPreview/VarDumpPreview.vue +++ b/components/VarDumpPreview/VarDumpPreview.vue @@ -1,9 +1,6 @@ @@ -11,7 +8,7 @@ import { defineComponent, PropType } from "vue"; import { NormalizedEvent, VarDump } from "~/config/types"; import PreviewCard from "~/components/PreviewCard/PreviewCard.vue"; -import ValueDump from "~/components/ValueDump/ValueDump.vue"; +import { ValueDump } from "~/src/widgets/ui"; export default defineComponent({ components: { diff --git a/src/widgets/ui/index.ts b/src/widgets/ui/index.ts index 55572b7c..3c7470f4 100644 --- a/src/widgets/ui/index.ts +++ b/src/widgets/ui/index.ts @@ -2,3 +2,4 @@ export * from './code-snippet'; export * from './render-graph'; export * from './stat-board'; export * from './page-header'; +export * from './value-dump'; diff --git a/src/widgets/ui/value-dump/index.ts b/src/widgets/ui/value-dump/index.ts new file mode 100644 index 00000000..fd6f9747 --- /dev/null +++ b/src/widgets/ui/value-dump/index.ts @@ -0,0 +1,3 @@ +import ValueDump from './value-dump.vue'; + +export { ValueDump }; diff --git a/components/ValueDump/ValueDump.stories.ts b/src/widgets/ui/value-dump/value-dump.stories.ts similarity index 89% rename from components/ValueDump/ValueDump.stories.ts rename to src/widgets/ui/value-dump/value-dump.stories.ts index 0e7c87c3..290112df 100644 --- a/components/ValueDump/ValueDump.stories.ts +++ b/src/widgets/ui/value-dump/value-dump.stories.ts @@ -1,10 +1,9 @@ import { Meta, Story } from "@storybook/vue3"; - -import ValueDump from '~/components/ValueDump/ValueDump.vue'; import { varDumpObjectMock } from '~/src/entities/var-dump/mocks'; +import ValueDump from './value-dump.vue'; export default { - title: "Components/ValueDump", + title: "FSD/widgets/ValueDump", component: ValueDump } as Meta; diff --git a/src/widgets/ui/value-dump/value-dump.vue b/src/widgets/ui/value-dump/value-dump.vue new file mode 100644 index 00000000..fb61dfcc --- /dev/null +++ b/src/widgets/ui/value-dump/value-dump.vue @@ -0,0 +1,65 @@ + + + + + From c2fff06903ed9130f9747dd70283036a32e2d66d Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 4 Nov 2023 17:37:55 +0400 Subject: [PATCH 29/72] move preview card to new structure --- .../HttpDumpPreview/HttpDumpPreview.vue | 5 +- .../InspectorPreview/InspectorPreview.vue | 2 +- components/MonologPreview/MonologPreview.vue | 2 +- components/PreviewCard/PreviewCard.vue | 196 ------------------ .../PreviewFallback/PreviewFallback.vue | 2 +- .../ProfilerPreview/ProfilerPreview.vue | 2 +- components/RayDumpPreview/RayDumpPreview.vue | 19 +- components/SentryPreview/SentryPreview.vue | 2 +- components/SmtpPreview/SmtpPreview.vue | 2 +- components/VarDumpPreview/VarDumpPreview.vue | 2 +- src/shared/ui/index.ts | 1 + src/shared/ui/preview-card/index.ts | 3 + .../preview-card-footer.stories.ts | 6 +- .../ui/preview-card/preview-card-footer.vue | 42 ++-- .../preview-card-header.stories.ts | 6 +- .../ui/preview-card/preview-card-header.vue | 132 +++++------- .../ui/preview-card/preview-card.stories.ts | 6 +- src/shared/ui/preview-card/preview-card.vue | 181 ++++++++++++++++ 18 files changed, 285 insertions(+), 326 deletions(-) delete mode 100644 components/PreviewCard/PreviewCard.vue create mode 100644 src/shared/ui/preview-card/index.ts rename components/PreviewCardFooter/PreviewCardFooter.stories.ts => src/shared/ui/preview-card/preview-card-footer.stories.ts (70%) rename components/PreviewCardFooter/PreviewCardFooter.vue => src/shared/ui/preview-card/preview-card-footer.vue (73%) rename components/PreviewCardHeader/PreviewCardHeader.stories.ts => src/shared/ui/preview-card/preview-card-header.stories.ts (85%) rename components/PreviewCardHeader/PreviewCardHeader.vue => src/shared/ui/preview-card/preview-card-header.vue (72%) rename components/PreviewCard/PreviewCard.stories.ts => src/shared/ui/preview-card/preview-card.stories.ts (80%) create mode 100644 src/shared/ui/preview-card/preview-card.vue diff --git a/components/HttpDumpPreview/HttpDumpPreview.vue b/components/HttpDumpPreview/HttpDumpPreview.vue index ec6ae2d1..019ecda2 100644 --- a/components/HttpDumpPreview/HttpDumpPreview.vue +++ b/components/HttpDumpPreview/HttpDumpPreview.vue @@ -1,7 +1,8 @@ @@ -9,7 +10,7 @@ - - diff --git a/components/PreviewFallback/PreviewFallback.vue b/components/PreviewFallback/PreviewFallback.vue index a9f53401..9ccb6497 100644 --- a/components/PreviewFallback/PreviewFallback.vue +++ b/components/PreviewFallback/PreviewFallback.vue @@ -7,7 +7,7 @@ diff --git a/components/SentryPreview/SentryPreview.vue b/components/SentryPreview/SentryPreview.vue index f7025741..22d9a064 100644 --- a/components/SentryPreview/SentryPreview.vue +++ b/components/SentryPreview/SentryPreview.vue @@ -24,7 +24,7 @@ + - - From d4a9e1a21315868096eebab6ac129bc5036d620e Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 4 Nov 2023 18:23:30 +0400 Subject: [PATCH 30/72] move var-dump preview to new structure --- components/MonologPreview/MonologPreview.vue | 3 +- .../PreviewEventMapper/PreviewEventMapper.vue | 8 +++-- .../PreviewFallback/PreviewFallback.vue | 3 +- .../RayTypesPreview/CustomPayload.vue | 2 +- .../RayTypesPreview/EloquentPayload.vue | 2 +- .../RayTypesPreview/EventPayload.vue | 2 +- .../RayTypesPreview/JobPayload.vue | 2 +- .../RayTypesPreview/LogPayload.vue | 2 +- .../RayTypesPreview/QueryPayload.vue | 3 +- .../RayTypesPreview/TablePayload.vue | 3 +- .../RayTypesPreview/ViewsPayload.vue | 2 +- components/SentryPageApp/SentryPageApp.vue | 3 +- .../SentryPageBreadcrumbs.vue | 2 +- .../SentryPageDevice/SentryPageDevice.vue | 3 +- components/SentryPageTags/SentryPageTags.vue | 2 +- components/SmtpPage/SmtpPage.vue | 3 +- components/VarDumpPreview/VarDumpPreview.vue | 36 ------------------- src/entities/var-dump/index.ts | 1 + src/entities/var-dump/ui/index.ts | 1 + .../var-dump/ui/preview-card/index.ts | 3 ++ .../ui/preview-card/preview-card.stories.ts | 16 ++++----- .../var-dump/ui/preview-card/preview-card.vue | 26 ++++++++++++++ src/shared/mocks/escaped-html-string.ts | 1 + src/shared/mocks/index.ts | 4 ++- src/shared/mocks/sf-dump-code.ts | 1 + .../ui/code-snippet/code-snippet.stories.ts | 6 ++-- .../ui/code-snippet/code-snippet.vue | 2 +- .../ui/code-snippet/index.ts | 0 src/shared/ui/index.ts | 2 ++ .../ui/value-dump/index.ts | 0 .../ui/value-dump/value-dump.stories.ts | 8 ++--- .../ui/value-dump/value-dump.vue | 0 src/widgets/ui/index.ts | 2 -- 33 files changed, 74 insertions(+), 80 deletions(-) delete mode 100644 components/VarDumpPreview/VarDumpPreview.vue create mode 100644 src/entities/var-dump/ui/index.ts create mode 100644 src/entities/var-dump/ui/preview-card/index.ts rename components/VarDumpPreview/VarDumpPreview.stories.ts => src/entities/var-dump/ui/preview-card/preview-card.stories.ts (76%) create mode 100644 src/entities/var-dump/ui/preview-card/preview-card.vue create mode 100644 src/shared/mocks/escaped-html-string.ts create mode 100644 src/shared/mocks/sf-dump-code.ts rename src/{widgets => shared}/ui/code-snippet/code-snippet.stories.ts (87%) rename src/{widgets => shared}/ui/code-snippet/code-snippet.vue (97%) rename src/{widgets => shared}/ui/code-snippet/index.ts (100%) rename src/{widgets => shared}/ui/value-dump/index.ts (100%) rename src/{widgets => shared}/ui/value-dump/value-dump.stories.ts (61%) rename src/{widgets => shared}/ui/value-dump/value-dump.vue (100%) diff --git a/components/MonologPreview/MonologPreview.vue b/components/MonologPreview/MonologPreview.vue index bca39ba2..adf4bf6e 100644 --- a/components/MonologPreview/MonologPreview.vue +++ b/components/MonologPreview/MonologPreview.vue @@ -24,8 +24,7 @@ - - diff --git a/src/entities/var-dump/index.ts b/src/entities/var-dump/index.ts index f41a696f..03a8d531 100644 --- a/src/entities/var-dump/index.ts +++ b/src/entities/var-dump/index.ts @@ -1 +1,2 @@ export * from './lib'; +export * from './ui'; diff --git a/src/entities/var-dump/ui/index.ts b/src/entities/var-dump/ui/index.ts new file mode 100644 index 00000000..7f760c0c --- /dev/null +++ b/src/entities/var-dump/ui/index.ts @@ -0,0 +1 @@ +export * from './preview-card' diff --git a/src/entities/var-dump/ui/preview-card/index.ts b/src/entities/var-dump/ui/preview-card/index.ts new file mode 100644 index 00000000..95cd2ccf --- /dev/null +++ b/src/entities/var-dump/ui/preview-card/index.ts @@ -0,0 +1,3 @@ +import PreviewCard from "./preview-card.vue"; + +export { PreviewCard }; diff --git a/components/VarDumpPreview/VarDumpPreview.stories.ts b/src/entities/var-dump/ui/preview-card/preview-card.stories.ts similarity index 76% rename from components/VarDumpPreview/VarDumpPreview.stories.ts rename to src/entities/var-dump/ui/preview-card/preview-card.stories.ts index 48b08579..dfa63221 100644 --- a/components/VarDumpPreview/VarDumpPreview.stories.ts +++ b/src/entities/var-dump/ui/preview-card/preview-card.stories.ts @@ -1,5 +1,5 @@ import { Meta, Story } from "@storybook/vue3"; -import VarDumpPreview from '~/components/VarDumpPreview/VarDumpPreview.vue'; +import { useVarDump } from "../../lib"; import { varDumpArrayMock, varDumpFalseMock, @@ -8,24 +8,24 @@ import { varDumpObjectMock, varDumpStringMock, varDumpEmptyStringMock, -} from '~/src/entities/var-dump/mocks'; -import { useVarDump } from "~/src/entities/var-dump"; +} from '../../mocks'; +import PreviewCard from './preview-card.vue'; const { normalizeVarDumpEvent } = useVarDump(); export default { - title: "VarDump/Components/Preview", - component: VarDumpPreview -} as Meta; + title: "FSD/entities/var-dump/PreviewCard", + component: PreviewCard +} as Meta; const Template: Story = (args) => ({ - components: { VarDumpPreview }, + components: { PreviewCard }, setup() { return { args, }; }, - template: ``, + template: ``, }); export const Object = Template.bind({}); diff --git a/src/entities/var-dump/ui/preview-card/preview-card.vue b/src/entities/var-dump/ui/preview-card/preview-card.vue new file mode 100644 index 00000000..b9f6ef16 --- /dev/null +++ b/src/entities/var-dump/ui/preview-card/preview-card.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/shared/mocks/escaped-html-string.ts b/src/shared/mocks/escaped-html-string.ts new file mode 100644 index 00000000..6b59a2db --- /dev/null +++ b/src/shared/mocks/escaped-html-string.ts @@ -0,0 +1 @@ +export default `<?xml version="1.0"?>
<one>
  <two>
    <three>3</three>
  </two>
</one>` diff --git a/src/shared/mocks/index.ts b/src/shared/mocks/index.ts index 4ad6f3cc..8f5d2d58 100644 --- a/src/shared/mocks/index.ts +++ b/src/shared/mocks/index.ts @@ -1,4 +1,6 @@ +import HTMLEscapedString from './escaped-html-string'; import HTMLCode from './html-code'; import PHPCode from './php-code'; +import SFDumpCode from './sf-dump-code'; -export { HTMLCode, PHPCode }; +export { HTMLCode, PHPCode, SFDumpCode, HTMLEscapedString }; diff --git a/src/shared/mocks/sf-dump-code.ts b/src/shared/mocks/sf-dump-code.ts new file mode 100644 index 00000000..a7b3d5e8 --- /dev/null +++ b/src/shared/mocks/sf-dump-code.ts @@ -0,0 +1 @@ +export default "
Nyholm\\Psr7\\ServerRequest {#1545\n  -attributes: array:4 [\n    \"rr_parsed_body\" => false\n    \"route\" => Spiral\\Router\\Route {#1543\n      #uriHandler: Spiral\\Router\\UriHandler {#82\n        -pattern: \"[<action>.html]\"\n        -slugify: Cocur\\Slugify\\Slugify {#1380\n          #rules: array:833 [\n            \"°\" => \"0\"\n            \"¹\" => \"1\"\n            \"²\" => \"2\"\n            \"³\" => \"3\"\n            \"\" => \"4\"\n            \"\" => \"5\"\n            \"\" => \"6\"\n            \"\" => \"7\"\n            \"\" => \"8\"\n            \"\" => \"9\"\n            \"\" => \"0\"\n            \"\" => \"1\"\n            \"\" => \"2\"\n            \"\" => \"3\"\n            \"\" => \"4\"\n            \"\" => \"5\"\n            \"\" => \"6\"\n            \"\" => \"7\"\n            \"\" => \"8\"\n            \"\" => \"9\"\n            \"æ\" => \"ae\"\n            \"ǽ\" => \"ae\"\n            \"À\" => \"A\"\n            \"Á\" => \"A\"\n            \"Â\" => \"A\"\n            \"Ã\" => \"A\"\n            \"Å\" => \"AA\"\n            \"Ǻ\" => \"A\"\n            \"Ă\" => \"A\"\n            \"Ǎ\" => \"A\"\n            \"Æ\" => \"AE\"\n            \"Ǽ\" => \"AE\"\n            \"à\" => \"a\"\n            \"á\" => \"a\"\n            \"â\" => \"a\"\n            \"ã\" => \"a\"\n            \"å\" => \"aa\"\n            \"ǻ\" => \"a\"\n            \"ă\" => \"a\"\n            \"ǎ\" => \"a\"\n            \"ª\" => \"a\"\n            \"@\" => \"at\"\n            \"Ĉ\" => \"C\"\n            \"Ċ\" => \"C\"\n            \"Ç\" => \"C\"\n            \"ç\" => \"c\"\n            \"ĉ\" => \"c\"\n            \"ċ\" => \"c\"\n            \"©\" => \"c\"\n            \"Ð\" => \"Dj\"\n            \"Đ\" => \"D\"\n            \"ð\" => \"dj\"\n            \"đ\" => \"d\"\n            \"È\" => \"E\"\n            \"É\" => \"E\"\n            \"Ê\" => \"E\"\n            \"Ë\" => \"E\"\n            \"Ĕ\" => \"E\"\n            \"Ė\" => \"E\"\n            \"è\" => \"e\"\n            \"é\" => \"e\"\n            \"ê\" => \"e\"\n            \"ë\" => \"e\"\n            \"ĕ\" => \"e\"\n            \"ė\" => \"e\"\n            \"ƒ\" => \"f\"\n            \"Ĝ\" => \"G\"\n            \"Ġ\" => \"G\"\n            \"ĝ\" => \"g\"\n            \"ġ\" => \"g\"\n            \"Ĥ\" => \"H\"\n            \"Ħ\" => \"H\"\n            \"ĥ\" => \"h\"\n            \"ħ\" => \"h\"\n            \"Ì\" => \"I\"\n            \"Í\" => \"I\"\n            \"Î\" => \"I\"\n            \"Ï\" => \"I\"\n            \"Ĩ\" => \"I\"\n            \"Ĭ\" => \"I\"\n            \"Ǐ\" => \"I\"\n            \"Į\" => \"I\"\n            \"IJ\" => \"IJ\"\n            \"ì\" => \"i\"\n            \"í\" => \"i\"\n            \"î\" => \"i\"\n            \"ï\" => \"i\"\n            \"ĩ\" => \"i\"\n            \"ĭ\" => \"i\"\n            \"ǐ\" => \"i\"\n            \"į\" => \"i\"\n            \"ij\" => \"ij\"\n            \"Ĵ\" => \"J\"\n            \"ĵ\" => \"j\"\n            \"Ĺ\" => \"L\"\n            \"Ľ\" => \"L\"\n            \"Ŀ\" => \"L\"\n            \"ĺ\" => \"l\"\n            \"ľ\" => \"l\"\n            \"ŀ\" => \"l\"\n            \"Ñ\" => \"N\"\n            \"ñ\" => \"n\"\n            \"ʼn\" => \"n\"\n            \"Ò\" => \"O\"\n            \"Ó\" => \"O\"\n            \"Ô\" => \"O\"\n            \"Õ\" => \"O\"\n            \"Ō\" => \"O\"\n            \"Ŏ\" => \"O\"\n            \"Ǒ\" => \"O\"\n            \"Ő\" => \"O\"\n            \"Ơ\" => \"O\"\n            \"Ø\" => \"OE\"\n            \"Ǿ\" => \"O\"\n            \"Œ\" => \"OE\"\n            \"ò\" => \"o\"\n            \"ó\" => \"o\"\n            \"ô\" => \"o\"\n            \"õ\" => \"o\"\n            \"ō\" => \"o\"\n            \"ŏ\" => \"o\"\n            \"ǒ\" => \"o\"\n            \"ő\" => \"o\"\n            \"ơ\" => \"o\"\n            \"ø\" => \"oe\"\n            \"ǿ\" => \"o\"\n            \"º\" => \"o\"\n            \"œ\" => \"oe\"\n            \"Ŕ\" => \"R\"\n            \"Ŗ\" => \"R\"\n            \"ŕ\" => \"r\"\n            \"ŗ\" => \"r\"\n            \"Ŝ\" => \"S\"\n            \"Ș\" => \"S\"\n            \"ŝ\" => \"s\"\n            \"ș\" => \"s\"\n            \"ſ\" => \"s\"\n            \"Ţ\" => \"T\"\n            \"Ț\" => \"T\"\n            \"Ŧ\" => \"T\"\n            \"Þ\" => \"TH\"\n            \"ţ\" => \"t\"\n            \"ț\" => \"t\"\n            \"ŧ\" => \"t\"\n            \"þ\" => \"th\"\n            \"Ù\" => \"U\"\n            \"Ú\" => \"U\"\n            \"Û\" => \"U\"\n            \"Ü\" => \"UE\"\n            \"Ũ\" => \"U\"\n            \"Ŭ\" => \"U\"\n            \"Ű\" => \"U\"\n            \"Ų\" => \"U\"\n            \"Ư\" => \"U\"\n            \"Ǔ\" => \"U\"\n            \"Ǖ\" => \"U\"\n            \"Ǘ\" => \"U\"\n            \"Ǚ\" => \"U\"\n            \"Ǜ\" => \"U\"\n            \"ù\" => \"u\"\n            \"ú\" => \"u\"\n            \"û\" => \"u\"\n            \"ü\" => \"ue\"\n            \"ũ\" => \"u\"\n            \"ŭ\" => \"u\"\n            \"ű\" => \"u\"\n            \"ų\" => \"u\"\n            \"ư\" => \"u\"\n            \"ǔ\" => \"u\"\n            \"ǖ\" => \"u\"\n            \"ǘ\" => \"u\"\n            \"ǚ\" => \"u\"\n            \"ǜ\" => \"u\"\n            \"Ŵ\" => \"W\"\n            \"ŵ\" => \"w\"\n            \"Ý\" => \"Y\"\n            \"Ÿ\" => \"Y\"\n            \"Ŷ\" => \"Y\"\n            \"ý\" => \"y\"\n            \"ÿ\" => \"y\"\n            \"ŷ\" => \"y\"\n            \"Ա\" => \"A\"\n            \"Բ\" => \"B\"\n            \"Գ\" => \"G\"\n            \"Դ\" => \"D\"\n            \"Ե\" => \"E\"\n            \"Զ\" => \"Z\"\n            \"Է\" => \"E\"\n            \"Ը\" => \"Y\"\n            \"Թ\" => \"Th\"\n            \"Ժ\" => \"Zh\"\n            \"Ի\" => \"I\"\n            \"Լ\" => \"L\"\n            \"Խ\" => \"Kh\"\n            \"Ծ\" => \"Ts\"\n            \"Կ\" => \"K\"\n            \"Հ\" => \"H\"\n            \"Ձ\" => \"Dz\"\n            \"Ղ\" => \"Gh\"\n            \"Ճ\" => \"Tch\"\n            \"Մ\" => \"M\"\n            \"Յ\" => \"Y\"\n            \"Ն\" => \"N\"\n            \"Շ\" => \"Sh\"\n            \"Ո\" => \"Vo\"\n            \"Չ\" => \"Ch\"\n            \"Պ\" => \"P\"\n            \"Ջ\" => \"J\"\n            \"Ռ\" => \"R\"\n            \"Ս\" => \"S\"\n            \"Վ\" => \"V\"\n            \"Տ\" => \"T\"\n            \"Ր\" => \"R\"\n            \"Ց\" => \"C\"\n            \"Ւ\" => \"u\"\n            \"Փ\" => \"Ph\"\n            \"Ք\" => \"Q\"\n            \"և\" => \"ev\"\n            \"Օ\" => \"O\"\n            \"Ֆ\" => \"F\"\n            \"ա\" => \"a\"\n            \"բ\" => \"b\"\n            \"գ\" => \"g\"\n            \"դ\" => \"d\"\n            \"ե\" => \"e\"\n            \"զ\" => \"z\"\n            \"է\" => \"e\"\n            \"ը\" => \"y\"\n            \"թ\" => \"th\"\n            \"ժ\" => \"zh\"\n            \"ի\" => \"i\"\n            \"լ\" => \"l\"\n            \"խ\" => \"kh\"\n            \"ծ\" => \"ts\"\n            \"կ\" => \"k\"\n            \"հ\" => \"h\"\n            \"ձ\" => \"dz\"\n            \"ղ\" => \"gh\"\n            \"ճ\" => \"tch\"\n            \"մ\" => \"m\"\n            \"յ\" => \"y\"\n            \"ն\" => \"n\"\n            \"շ\" => \"sh\"\n            \"ո\" => \"vo\"\n            \"չ\" => \"ch\"\n            \"պ\" => \"p\"\n            \"ջ\" => \"j\"\n            \"ռ\" => \"r\"\n            \"ս\" => \"s\"\n            \"վ\" => \"v\"\n            \"տ\" => \"t\"\n            \"ր\" => \"r\"\n            \"ց\" => \"c\"\n            \"ւ\" => \"u\"\n            \"փ\" => \"ph\"\n            \"ք\" => \"q\"\n            \"օ\" => \"o\"\n            \"ֆ\" => \"f\"\n            \"Ə\" => \"E\"\n            \"Ğ\" => \"G\"\n            \"İ\" => \"I\"\n            \"Ş\" => \"S\"\n            \"Ö\" => \"OE\"\n            \"ə\" => \"e\"\n            \"ğ\" => \"g\"\n            \"ı\" => \"i\"\n            \"ş\" => \"s\"\n            \"ö\" => \"oe\"\n            \"က\" => \"k\"\n            \"\" => \"kh\"\n            \"\" => \"g\"\n            \"\" => \"ga\"\n            \"\" => \"ng\"\n            \"\" => \"s\"\n            \"\" => \"sa\"\n            \"\" => \"z\"\n            \"စျ\" => \"za\"\n            \"\" => \"ny\"\n            \"\" => \"t\"\n            \"\" => \"ta\"\n            \"\" => \"d\"\n            \"\" => \"da\"\n            \"\" => \"na\"\n            \"\" => \"t\"\n            \"\" => \"ta\"\n            \"\" => \"d\"\n            \"\" => \"da\"\n            \"\" => \"n\"\n            \"\" => \"p\"\n            \"\" => \"pa\"\n            \"\" => \"b\"\n            \"\" => \"ba\"\n            \"\" => \"m\"\n            \"\" => \"y\"\n            \"\" => \"ya\"\n            \"\" => \"l\"\n            \"\" => \"w\"\n            \"\" => \"th\"\n            \"\" => \"h\"\n            \"\" => \"la\"\n            \"\" => \"a\"\n            \"\" => \"y\"\n            \"\" => \"ya\"\n            \"\" => \"w\"\n            \"ြွ\" => \"yw\"\n            \"ျွ\" => \"ywa\"\n            \"\" => \"h\"\n            \"\" => \"e\"\n            \"\" => \"-e\"\n            \"\" => \"i\"\n            \"\" => \"-i\"\n            \"\" => \"u\"\n            \"\" => \"-u\"\n            \"\" => \"aw\"\n            \"သြော\" => \"aw\"\n            \"\" => \"aw\"\n            \"\" => \"ywae\"\n            \"\" => \"hnaik\"\n            \"\" => \"0\"\n            \"\" => \"1\"\n            \"\" => \"2\"\n            \"\" => \"3\"\n            \"\" => \"4\"\n            \"\" => \"5\"\n            \"\" => \"6\"\n            \"\" => \"7\"\n            \"\" => \"8\"\n            \"\" => \"9\"\n            \"\" => \"\"\n            \"\" => \"\"\n            \"\" => \"\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"e\"\n            \"\" => \"e\"\n            \"\" => \"i\"\n            \"\" => \"i\"\n            \"ို\" => \"o\"\n            \"\" => \"u\"\n            \"\" => \"u\"\n            \"ေါင်\" => \"aung\"\n            \"ော\" => \"aw\"\n            \"ော်\" => \"aw\"\n            \"ေါ\" => \"aw\"\n            \"ေါ်\" => \"aw\"\n            \"\" => \"at\"\n            \"က်\" => \"et\"\n            \"ိုက်\" => \"aik\"\n            \"ောက်\" => \"auk\"\n            \"င်\" => \"in\"\n            \"ိုင်\" => \"aing\"\n            \"ောင်\" => \"aung\"\n            \"စ်\" => \"it\"\n            \"ည်\" => \"i\"\n            \"တ်\" => \"at\"\n            \"ိတ်\" => \"eik\"\n            \"ုတ်\" => \"ok\"\n            \"ွတ်\" => \"ut\"\n            \"ေတ်\" => \"it\"\n            \"ဒ်\" => \"d\"\n            \"ိုဒ်\" => \"ok\"\n            \"ုဒ်\" => \"ait\"\n            \"န်\" => \"an\"\n            \"ာန်\" => \"an\"\n            \"ိန်\" => \"ein\"\n            \"ုန်\" => \"on\"\n            \"ွန်\" => \"un\"\n            \"ပ်\" => \"at\"\n            \"ိပ်\" => \"eik\"\n            \"ုပ်\" => \"ok\"\n            \"ွပ်\" => \"ut\"\n            \"န်ုပ်\" => \"nub\"\n            \"မ်\" => \"an\"\n            \"ိမ်\" => \"ein\"\n            \"ုမ်\" => \"on\"\n            \"ွမ်\" => \"un\"\n            \"ယ်\" => \"e\"\n            \"ိုလ်\" => \"ol\"\n            \"ဉ်\" => \"in\"\n            \"\" => \"an\"\n            \"ိံ\" => \"ein\"\n            \"ုံ\" => \"on\"\n            \"\" => \"a\"\n            \"\" => \"aa\"\n            \"\" => \"e\"\n            \"\" => \"ii\"\n            \"\" => \"ei\"\n            \"\" => \"ae\"\n            \"\" => \"ai\"\n            \"\" => \"i\"\n            \"\" => \"o\"\n            \"\" => \"oi\"\n            \"\" => \"oii\"\n            \"\" => \"uu\"\n            \"\" => \"ou\"\n            \"\" => \"u\"\n            \"\" => \"B\"\n            \"\" => \"Bha\"\n            \"\" => \"Ca\"\n            \"\" => \"Chha\"\n            \"\" => \"Da\"\n            \"\" => \"Dha\"\n            \"\" => \"Fa\"\n            \"फ़\" => \"Fi\"\n            \"\" => \"Ga\"\n            \"\" => \"Gha\"\n            \"ग़\" => \"Ghi\"\n            \"\" => \"Ha\"\n            \"\" => \"Ja\"\n            \"\" => \"Jha\"\n            \"\" => \"Ka\"\n            \"\" => \"Kha\"\n            \"ख़\" => \"Khi\"\n            \"\" => \"L\"\n            \"\" => \"Li\"\n            \"\" => \"Li\"\n            \"\" => \"Lii\"\n            \"\" => \"Lii\"\n            \"\" => \"Ma\"\n            \"\" => \"Na\"\n            \"\" => \"Na\"\n            \"\" => \"Nia\"\n            \"\" => \"Nae\"\n            \"\" => \"Ni\"\n            \"\" => \"oms\"\n            \"\" => \"Pa\"\n            \"क़\" => \"Qi\"\n            \"\" => \"Ra\"\n            \"\" => \"Ri\"\n            \"\" => \"Ri\"\n            \"\" => \"Ri\"\n            \"\" => \"Sa\"\n            \"\" => \"Sha\"\n            \"\" => \"Shha\"\n            \"\" => \"Ta\"\n            \"\" => \"Ta\"\n            \"\" => \"Tha\"\n            \"\" => \"Tha\"\n            \"\" => \"Tha\"\n            \"\" => \"Thha\"\n            \"ड़\" => \"ugDha\"\n            \"ढ़\" => \"ugDhha\"\n            \"\" => \"Va\"\n            \"\" => \"Ya\"\n            \"य़\" => \"Yi\"\n            \"ज़\" => \"Za\"\n            \"\" => \"a\"\n            \"\" => \"b\"\n            \"\" => \"g\"\n            \"\" => \"d\"\n            \"\" => \"e\"\n            \"\" => \"v\"\n            \"\" => \"z\"\n            \"\" => \"t\"\n            \"\" => \"i\"\n            \"\" => \"k\"\n            \"\" => \"l\"\n            \"\" => \"m\"\n            \"\" => \"n\"\n            \"\" => \"o\"\n            \"\" => \"p\"\n            \"\" => \"zh\"\n            \"\" => \"r\"\n            \"\" => \"s\"\n            \"\" => \"t\"\n            \"\" => \"u\"\n            \"\" => \"f\"\n            \"\" => \"k\"\n            \"\" => \"gh\"\n            \"\" => \"q\"\n            \"\" => \"sh\"\n            \"\" => \"ch\"\n            \"\" => \"ts\"\n            \"\" => \"dz\"\n            \"\" => \"ts\"\n            \"\" => \"ch\"\n            \"\" => \"kh\"\n            \"\" => \"j\"\n            \"\" => \"h\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"a\"\n            \"\" => \"e\"\n            \"\" => \"e\"\n            \"\" => \"e\"\n            \"\" => \"e\"\n            \"ế\" => \"e\"\n            \"\" => \"e\"\n            \"\" => \"e\"\n            \"\" => \"e\"\n            \"\" => \"i\"\n            \"\" => \"i\"\n            \"\" => \"o\"\n            \"\" => \"o\"\n            \"\" => \"o\"\n            \"\" => \"o\"\n            \"\" => \"o\"\n            \"\" => \"o\"\n            \"\" => \"o\"\n            \"\" => \"o\"\n            \"\" => \"o\"\n            \"\" => \"o\"\n            \"\" => \"o\"\n            \"\" => \"o\"\n            \"\" => \"u\"\n            \"\" => \"u\"\n            \"\" => \"u\"\n            \"\" => \"u\"\n            \"\" => \"u\"\n            \"\" => \"u\"\n            \"\" => \"u\"\n            \"\" => \"y\"\n            \"\" => \"y\"\n            \"\" => \"y\"\n            \"\" => \"y\"\n            \"\" => \"A\"\n            \"\" => \"A\"\n            \"\" => \"A\"\n            \"\" => \"A\"\n            \"\" => \"A\"\n            \"\" => \"A\"\n            \"\" => \"A\"\n            \"\" => \"A\"\n            \"\" => \"A\"\n            \"\" => \"A\"\n            \"\" => \"A\"\n            \"\" => \"A\"\n            \"\" => \"E\"\n            \"\" => \"E\"\n            \"\" => \"E\"\n            \"\" => \"E\"\n            \"\" => \"E\"\n            \"\" => \"E\"\n            \"\" => \"E\"\n            \"\" => \"E\"\n            \"\" => \"I\"\n            \"\" => \"I\"\n            \"\" => \"O\"\n            \"\" => \"O\"\n            \"\" => \"O\"\n            \"\" => \"O\"\n            \"\" => \"O\"\n            \"\" => \"O\"\n            \"\" => \"O\"\n            \"\" => \"O\"\n            \"\" => \"O\"\n            \"\" => \"O\"\n            \"\" => \"O\"\n            \"\" => \"O\"\n            \"\" => \"U\"\n            \"\" => \"U\"\n            \"\" => \"U\"\n            \"\" => \"U\"\n            \"\" => \"U\"\n            \"\" => \"U\"\n            \"\" => \"U\"\n            \"\" => \"Y\"\n            \"\" => \"Y\"\n            \"\" => \"Y\"\n            \"\" => \"Y\"\n            \"Ґ\" => \"G\"\n            \"І\" => \"I\"\n            \"Ї\" => \"Ji\"\n            \"Є\" => \"Ye\"\n            \"ґ\" => \"g\"\n            \"і\" => \"i\"\n            \"ї\" => \"ji\"\n            \"є\" => \"ye\"\n            \"Ā\" => \"A\"\n            \"Ē\" => \"E\"\n            \"Ģ\" => \"G\"\n            \"Ī\" => \"I\"\n            \"Ķ\" => \"K\"\n            \"Ļ\" => \"L\"\n            \"Ņ\" => \"N\"\n            \"Ū\" => \"U\"\n            \"ā\" => \"a\"\n            \"ē\" => \"e\"\n            \"ģ\" => \"g\"\n            \"ī\" => \"i\"\n            \"ķ\" => \"k\"\n            \"ļ\" => \"l\"\n            \"ņ\" => \"n\"\n            \"ū\" => \"u\"\n            \"Ä\" => \"AE\"\n            \"ä\" => \"ae\"\n            \"ΑΥ\" => \"AU\"\n            \"Αυ\" => \"Au\"\n            \"ΟΥ\" => \"OU\"\n            \"Ου\" => \"Ou\"\n            \"ΕΥ\" => \"EU\"\n            \"Ευ\" => \"Eu\"\n            \"ΕΙ\" => \"I\"\n            \"Ει\" => \"I\"\n            \"ΟΙ\" => \"I\"\n            \"Οι\" => \"I\"\n            \"ΥΙ\" => \"I\"\n            \"Υι\" => \"I\"\n            \"ΑΎ\" => \"AU\"\n            \"Αύ\" => \"Au\"\n            \"ΟΎ\" => \"OU\"\n            \"Ού\" => \"Ou\"\n            \"ΕΎ\" => \"EU\"\n            \"Εύ\" => \"Eu\"\n            \"ΕΊ\" => \"I\"\n            \"Εί\" => \"I\"\n            \"ΟΊ\" => \"I\"\n            \"Οί\" => \"I\"\n            \"ΎΙ\" => \"I\"\n            \"Ύι\" => \"I\"\n            \"ΥΊ\" => \"I\"\n            \"Υί\" => \"I\"\n            \"αυ\" => \"au\"\n            \"ου\" => \"ou\"\n            \"ευ\" => \"eu\"\n            \"ει\" => \"i\"\n            \"οι\" => \"i\"\n            \"υι\" => \"i\"\n            \"αύ\" => \"au\"\n            \"ού\" => \"ou\"\n            \"εύ\" => \"eu\"\n            \"εί\" => \"i\"\n            \"οί\" => \"i\"\n            \"ύι\" => \"i\"\n            \"υί\" => \"i\"\n            \"Α\" => \"A\"\n            \"Β\" => \"V\"\n            \"Γ\" => \"G\"\n            \"Δ\" => \"D\"\n            \"Ε\" => \"E\"\n            \"Ζ\" => \"Z\"\n            \"Η\" => \"I\"\n            \"Θ\" => \"Th\"\n            \"Ι\" => \"I\"\n            \"Κ\" => \"K\"\n            \"Λ\" => \"L\"\n            \"Μ\" => \"M\"\n            \"Ν\" => \"N\"\n            \"Ξ\" => \"X\"\n            \"Ο\" => \"O\"\n            \"Π\" => \"P\"\n            \"Ρ\" => \"R\"\n            \"Σ\" => \"S\"\n            \"Τ\" => \"T\"\n            \"Υ\" => \"I\"\n            \"Φ\" => \"F\"\n            \"Χ\" => \"Ch\"\n            \"Ψ\" => \"Ps\"\n            \"Ω\" => \"O\"\n            \"Ά\" => \"A\"\n            \"Έ\" => \"E\"\n            \"Ή\" => \"I\"\n            \"Ί\" => \"I\"\n            \"Ό\" => \"O\"\n            \"Ύ\" => \"I\"\n            \"Ϊ\" => \"I\"\n            \"Ϋ\" => \"I\"\n            \"ϒ\" => \"I\"\n            \"α\" => \"a\"\n            \"β\" => \"v\"\n            \"γ\" => \"g\"\n            \"δ\" => \"d\"\n            \"ε\" => \"e\"\n            \"ζ\" => \"z\"\n            \"η\" => \"i\"\n            \"θ\" => \"th\"\n            \"ι\" => \"i\"\n            \"κ\" => \"k\"\n            \"λ\" => \"l\"\n            \"μ\" => \"m\"\n            \"ν\" => \"n\"\n            \"ξ\" => \"x\"\n            \"ο\" => \"o\"\n            \"π\" => \"p\"\n            \"ρ\" => \"r\"\n            \"ς\" => \"s\"\n            \"σ\" => \"s\"\n            \"τ\" => \"t\"\n            \"υ\" => \"i\"\n            \"φ\" => \"f\"\n            \"χ\" => \"ch\"\n            \"ψ\" => \"ps\"\n            \"ω\" => \"o\"\n            \"ά\" => \"a\"\n            \"έ\" => \"e\"\n            \"ή\" => \"i\"\n            \"ί\" => \"i\"\n            \"ό\" => \"o\"\n            \"ύ\" => \"i\"\n            \"ϊ\" => \"i\"\n            \"ϋ\" => \"i\"\n            \"ΰ\" => \"i\"\n            \"ώ\" => \"o\"\n            \"ϐ\" => \"v\"\n            \"ϑ\" => \"th\"\n            \"Č\" => \"C\"\n            \"Ď\" => \"D\"\n            \"Ě\" => \"E\"\n            \"Ň\" => \"N\"\n            \"Ř\" => \"R\"\n            \"Š\" => \"S\"\n            \"Ť\" => \"T\"\n            \"Ů\" => \"U\"\n            \"Ž\" => \"Z\"\n            \"č\" => \"c\"\n            \"ď\" => \"d\"\n            \"ě\" => \"e\"\n            \"ň\" => \"n\"\n            \"ř\" => \"r\"\n            \"š\" => \"s\"\n            \"ť\" => \"t\"\n            \"ů\" => \"u\"\n            \"ž\" => \"z\"\n            \"أ\" => \"a\"\n            \"ب\" => \"b\"\n            \"ت\" => \"t\"\n            \"ث\" => \"th\"\n            \"ج\" => \"g\"\n            \"ح\" => \"h\"\n            \"خ\" => \"kh\"\n            \"د\" => \"d\"\n            \"ذ\" => \"th\"\n            \"ر\" => \"r\"\n            \"ز\" => \"z\"\n            \"س\" => \"s\"\n            \"ش\" => \"sh\"\n            \"ص\" => \"s\"\n            \"ض\" => \"d\"\n            \"ط\" => \"t\"\n            \"ظ\" => \"th\"\n            \"ع\" => \"aa\"\n            \"غ\" => \"gh\"\n            \"ف\" => \"f\"\n            \"ق\" => \"k\"\n            \"ك\" => \"k\"\n            \"ل\" => \"l\"\n            \"م\" => \"m\"\n            \"ن\" => \"n\"\n            \"ه\" => \"h\"\n            \"و\" => \"o\"\n            \"ي\" => \"y\"\n            \"Ą\" => \"A\"\n            \"Ć\" => \"C\"\n            \"Ę\" => \"E\"\n            \"Ł\" => \"L\"\n            \"Ń\" => \"N\"\n            \"Ś\" => \"S\"\n            \"Ź\" => \"Z\"\n            \"Ż\" => \"Z\"\n            \"ą\" => \"a\"\n            \"ć\" => \"c\"\n            \"ę\" => \"e\"\n            \"ł\" => \"l\"\n            \"ń\" => \"n\"\n            \"ś\" => \"s\"\n            \"ź\" => \"z\"\n            \"ż\" => \"z\"\n            \"ß\" => \"ss\"\n            \"Ъ\" => \"\"\n            \"Ь\" => \"\"\n            \"А\" => \"A\"\n            \"Б\" => \"B\"\n            \"Ц\" => \"C\"\n            \"Ч\" => \"Ch\"\n            \"Д\" => \"D\"\n            \"Е\" => \"E\"\n            \"Ё\" => \"E\"\n            \"Э\" => \"E\"\n            \"Ф\" => \"F\"\n            \"Г\" => \"G\"\n            \"Х\" => \"H\"\n            \"И\" => \"I\"\n            \"Й\" => \"Y\"\n            \"Я\" => \"Ya\"\n            \"Ю\" => \"Yu\"\n            \"К\" => \"K\"\n            \"Л\" => \"L\"\n            \"М\" => \"M\"\n            \"Н\" => \"N\"\n            \"О\" => \"O\"\n            \"П\" => \"P\"\n            \"Р\" => \"R\"\n            \"С\" => \"S\"\n            \"Ш\" => \"Sh\"\n            \"Щ\" => \"Shch\"\n            \"Т\" => \"T\"\n            \"У\" => \"U\"\n            \"В\" => \"V\"\n            \"Ы\" => \"Y\"\n            \"З\" => \"Z\"\n            \"Ж\" => \"Zh\"\n            \"ъ\" => \"\"\n            \"ь\" => \"\"\n            \"а\" => \"a\"\n            \"б\" => \"b\"\n            \"ц\" => \"c\"\n            \"ч\" => \"ch\"\n            \"д\" => \"d\"\n            \"е\" => \"e\"\n            \"ё\" => \"e\"\n            \"э\" => \"e\"\n            \"ф\" => \"f\"\n            \"г\" => \"g\"\n            \"х\" => \"h\"\n            \"и\" => \"i\"\n            \"й\" => \"y\"\n            \"я\" => \"ya\"\n            \"ю\" => \"yu\"\n            \"к\" => \"k\"\n            \"л\" => \"l\"\n            \"м\" => \"m\"\n            \"н\" => \"n\"\n            \"о\" => \"o\"\n            \"п\" => \"p\"\n            \"р\" => \"r\"\n            \"с\" => \"s\"\n            \"ш\" => \"sh\"\n            \"щ\" => \"shch\"\n            \"т\" => \"t\"\n            \"у\" => \"u\"\n            \"в\" => \"v\"\n            \"ы\" => \"y\"\n            \"з\" => \"z\"\n            \"ж\" => \"zh\"\n          ]\n          #provider: Cocur\\Slugify\\RuleProvider\\DefaultRuleProvider {#1365\n            #rules: array:36 [\n              \"arabic\" => array:28 [\n                \"أ\" => \"a\"\n                \"ب\" => \"b\"\n                \"ت\" => \"t\"\n                \"ث\" => \"th\"\n                \"ج\" => \"g\"\n                \"ح\" => \"h\"\n                \"خ\" => \"kh\"\n                \"د\" => \"d\"\n                \"ذ\" => \"th\"\n                \"ر\" => \"r\"\n                \"ز\" => \"z\"\n                \"س\" => \"s\"\n                \"ش\" => \"sh\"\n                \"ص\" => \"s\"\n                \"ض\" => \"d\"\n                \"ط\" => \"t\"\n                \"ظ\" => \"th\"\n                \"ع\" => \"aa\"\n                \"غ\" => \"gh\"\n                \"ف\" => \"f\"\n                \"ق\" => \"k\"\n                \"ك\" => \"k\"\n                \"ل\" => \"l\"\n                \"م\" => \"m\"\n                \"ن\" => \"n\"\n                \"ه\" => \"h\"\n                \"و\" => \"o\"\n                \"ي\" => \"y\"\n              ]\n              \"armenian\" => array:77 [\n                \"Ա\" => \"A\"\n                \"Բ\" => \"B\"\n                \"Գ\" => \"G\"\n                \"Դ\" => \"D\"\n                \"Ե\" => \"E\"\n                \"Զ\" => \"Z\"\n                \"Է\" => \"E\"\n                \"Ը\" => \"Y\"\n                \"Թ\" => \"Th\"\n                \"Ժ\" => \"Zh\"\n                \"Ի\" => \"I\"\n                \"Լ\" => \"L\"\n                \"Խ\" => \"Kh\"\n                \"Ծ\" => \"Ts\"\n                \"Կ\" => \"K\"\n                \"Հ\" => \"H\"\n                \"Ձ\" => \"Dz\"\n                \"Ղ\" => \"Gh\"\n                \"Ճ\" => \"Tch\"\n                \"Մ\" => \"M\"\n                \"Յ\" => \"Y\"\n                \"Ն\" => \"N\"\n                \"Շ\" => \"Sh\"\n                \"Ո\" => \"Vo\"\n                \"Չ\" => \"Ch\"\n                \"Պ\" => \"P\"\n                \"Ջ\" => \"J\"\n                \"Ռ\" => \"R\"\n                \"Ս\" => \"S\"\n                \"Վ\" => \"V\"\n                \"Տ\" => \"T\"\n                \"Ր\" => \"R\"\n                \"Ց\" => \"C\"\n                \"Ւ\" => \"u\"\n                \"Փ\" => \"Ph\"\n                \"Ք\" => \"Q\"\n                \"և\" => \"ev\"\n                \"Օ\" => \"O\"\n                \"Ֆ\" => \"F\"\n                \"ա\" => \"a\"\n                \"բ\" => \"b\"\n                \"գ\" => \"g\"\n                \"դ\" => \"d\"\n                \"ե\" => \"e\"\n                \"զ\" => \"z\"\n                \"է\" => \"e\"\n                \"ը\" => \"y\"\n                \"թ\" => \"th\"\n                \"ժ\" => \"zh\"\n                \"ի\" => \"i\"\n                \"լ\" => \"l\"\n                \"խ\" => \"kh\"\n                \"ծ\" => \"ts\"\n                \"կ\" => \"k\"\n                \"հ\" => \"h\"\n                \"ձ\" => \"dz\"\n                \"ղ\" => \"gh\"\n                \"ճ\" => \"tch\"\n                \"մ\" => \"m\"\n                \"յ\" => \"y\"\n                \"ն\" => \"n\"\n                \"շ\" => \"sh\"\n                \"ո\" => \"vo\"\n                \"չ\" => \"ch\"\n                \"պ\" => \"p\"\n                \"ջ\" => \"j\"\n                \"ռ\" => \"r\"\n                \"ս\" => \"s\"\n                \"վ\" => \"v\"\n                \"տ\" => \"t\"\n                \"ր\" => \"r\"\n                \"ց\" => \"c\"\n                \"ւ\" => \"u\"\n                \"փ\" => \"ph\"\n                \"ք\" => \"q\"\n                \"օ\" => \"o\"\n                \"ֆ\" => \"f\"\n              ]\n              \"austrian\" => array:7 [\n                \"Ä\" => \"AE\"\n                \"Ö\" => \"OE\"\n                \"Ü\" => \"UE\"\n                \"ß\" => \"sz\"\n                \"ä\" => \"ae\"\n                \"ö\" => \"oe\"\n                \"ü\" => \"ue\"\n              ]\n              \"azerbaijani\" => array:14 [\n                \"Ə\" => \"E\"\n                \"Ç\" => \"C\"\n                \"Ğ\" => \"G\"\n                \"İ\" => \"I\"\n                \"Ş\" => \"S\"\n                \"Ö\" => \"O\"\n                \"Ü\" => \"U\"\n                \"ə\" => \"e\"\n                \"ç\" => \"c\"\n                \"ğ\" => \"g\"\n                \"ı\" => \"i\"\n                \"ş\" => \"s\"\n                \"ö\" => \"o\"\n                \"ü\" => \"u\"\n              ]\n              \"bulgarian\" => array:63 [\n                \"А\" => \"A\"\n                \"Б\" => \"B\"\n                \"В\" => \"V\"\n                \"Г\" => \"G\"\n                \"Д\" => \"D\"\n                \"Е\" => \"E\"\n                \"Ж\" => \"J\"\n                \"З\" => \"Z\"\n                \"И\" => \"I\"\n                \"Й\" => \"Y\"\n                \"К\" => \"K\"\n                \"Л\" => \"L\"\n                \"М\" => \"M\"\n                \"Н\" => \"N\"\n                \"О\" => \"O\"\n                \"П\" => \"P\"\n                \"Р\" => \"R\"\n                \"С\" => \"S\"\n                \"Т\" => \"T\"\n                \"У\" => \"U\"\n                \"Ф\" => \"F\"\n                \"Х\" => \"H\"\n                \"Ц\" => \"Ts\"\n                \"Ч\" => \"Ch\"\n                \"Ш\" => \"Sh\"\n                \"Щ\" => \"Sht\"\n                \"Ъ\" => \"A\"\n                \"Ь\" => \"I\"\n                \"Ю\" => \"Iu\"\n                \"Я\" => \"Ia\"\n                \"а\" => \"a\"\n                \"б\" => \"b\"\n                \"в\" => \"v\"\n                \"г\" => \"g\"\n                \"д\" => \"d\"\n                \"е\" => \"e\"\n                \"ж\" => \"j\"\n                \"з\" => \"z\"\n                \"и\" => \"i\"\n                \"й\" => \"y\"\n                \"к\" => \"k\"\n                \"л\" => \"l\"\n                \"м\" => \"m\"\n                \"н\" => \"n\"\n                \"о\" => \"o\"\n                \"п\" => \"p\"\n                \"р\" => \"r\"\n                \"с\" => \"s\"\n                \"т\" => \"t\"\n                \"у\" => \"u\"\n                \"ф\" => \"f\"\n                \"х\" => \"h\"\n                \"ц\" => \"ts\"\n                \"ч\" => \"ch\"\n                \"ш\" => \"sh\"\n                \"щ\" => \"sht\"\n                \"ъ\" => \"a\"\n                \"ь\" => \"i\"\n                \"ю\" => \"iu\"\n                \"я\" => \"ia\"\n                \"ия\" => \"ia\"\n                \"йо\" => \"\"\n                \"ьо\" => \"io\"\n              ]\n              \"burmese\" => array:114 [\n                \"က\" => \"k\"\n                \"\" => \"kh\"\n                \"\" => \"g\"\n                \"\" => \"ga\"\n                \"\" => \"ng\"\n                \"\" => \"s\"\n                \"\" => \"sa\"\n                \"\" => \"z\"\n                \"စျ\" => \"za\"\n                \"\" => \"ny\"\n                \"\" => \"t\"\n                \"\" => \"ta\"\n                \"\" => \"d\"\n                \"\" => \"da\"\n                \"\" => \"na\"\n                \"\" => \"t\"\n                \"\" => \"ta\"\n                \"\" => \"d\"\n                \"\" => \"da\"\n                \"\" => \"n\"\n                \"\" => \"p\"\n                \"\" => \"pa\"\n                \"\" => \"b\"\n                \"\" => \"ba\"\n                \"\" => \"m\"\n                \"\" => \"y\"\n                \"\" => \"ya\"\n                \"\" => \"l\"\n                \"\" => \"w\"\n                \"\" => \"th\"\n                \"\" => \"h\"\n                \"\" => \"la\"\n                \"\" => \"a\"\n                \"\" => \"y\"\n                \"\" => \"ya\"\n                \"\" => \"w\"\n                \"ြွ\" => \"yw\"\n                \"ျွ\" => \"ywa\"\n                \"\" => \"h\"\n                \"\" => \"e\"\n                \"\" => \"-e\"\n                \"\" => \"i\"\n                \"\" => \"-i\"\n                \"\" => \"u\"\n                \"\" => \"-u\"\n                \"\" => \"aw\"\n                \"သြော\" => \"aw\"\n                \"\" => \"aw\"\n                \"\" => \"ywae\"\n                \"\" => \"hnaik\"\n                \"\" => \"0\"\n                \"\" => \"1\"\n                \"\" => \"2\"\n                \"\" => \"3\"\n                \"\" => \"4\"\n                \"\" => \"5\"\n                \"\" => \"6\"\n                \"\" => \"7\"\n                \"\" => \"8\"\n                \"\" => \"9\"\n                \"\" => \"\"\n                \"\" => \"\"\n                \"\" => \"\"\n                \"\" => \"a\"\n                \"\" => \"a\"\n                \"\" => \"e\"\n                \"\" => \"e\"\n                \"\" => \"i\"\n                \"\" => \"i\"\n                \"ို\" => \"o\"\n                \"\" => \"u\"\n                \"\" => \"u\"\n                \"ေါင်\" => \"aung\"\n                \"ော\" => \"aw\"\n                \"ော်\" => \"aw\"\n                \"ေါ\" => \"aw\"\n                \"ေါ်\" => \"aw\"\n                \"\" => \"at\"\n                \"က်\" => \"et\"\n                \"ိုက်\" => \"aik\"\n                \"ောက်\" => \"auk\"\n                \"င်\" => \"in\"\n                \"ိုင်\" => \"aing\"\n                \"ောင်\" => \"aung\"\n                \"စ်\" => \"it\"\n                \"ည်\" => \"i\"\n                \"တ်\" => \"at\"\n                \"ိတ်\" => \"eik\"\n                \"ုတ်\" => \"ok\"\n                \"ွတ်\" => \"ut\"\n                \"ေတ်\" => \"it\"\n                \"ဒ်\" => \"d\"\n                \"ိုဒ်\" => \"ok\"\n                \"ုဒ်\" => \"ait\"\n                \"န်\" => \"an\"\n                \"ာန်\" => \"an\"\n                \"ိန်\" => \"ein\"\n                \"ုန်\" => \"on\"\n                \"ွန်\" => \"un\"\n                \"ပ်\" => \"at\"\n                \"ိပ်\" => \"eik\"\n                \"ုပ်\" => \"ok\"\n                \"ွပ်\" => \"ut\"\n                \"န်ုပ်\" => \"nub\"\n                \"မ်\" => \"an\"\n                \"ိမ်\" => \"ein\"\n                \"ုမ်\" => \"on\"\n                \"ွမ်\" => \"un\"\n                \"ယ်\" => \"e\"\n                \"ိုလ်\" => \"ol\"\n                \"ဉ်\" => \"in\"\n                \"\" => \"an\"\n                \"ိံ\" => \"ein\"\n                \"ုံ\" => \"on\"\n              ]\n              \"chinese\" => array:6933 [\n                \"\" => \"yan\"\n                \"\" => \"a\"\n                \"\" => \"po\"\n                \"\" => \"ai\"\n                \"\" => \"ai\"\n                \"\" => \"ai\"\n                \"\" => \"ai\"\n                \"\" => \"an\"\n                \"\" => \"ao\"\n                \"\" => \"ao\"\n                \"\" => \"niu\"\n                \"\" => \"ao\"\n                \"\" => \"ao\"\n                \"\" => \"ba\"\n                \"\" => \"ba\"\n                \"\" => \"pa\"\n                \"\" => \"ba\"\n                \"\" => \"ban\"\n                \"\" => \"pang\"\n                \"\" => \"bang\"\n                \"\" => \"pao\"\n                \"\" => \"pu\"\n                \"\" => \"pao\"\n                \"\" => \"pu\"\n                \"\" => \"bei\"\n                \"\" => \"pi\"\n                \"\" => \"bei\"\n                \"\" => \"bei\"\n                \"\" => \"bei\"\n                \"\" => \"bei\"\n                \"\" => \"bei\"\n                \"\" => \"ben\"\n                \"\" => \"beng\"\n                \"\" => \"bi\"\n                \"\" => \"mi\"\n                \"\" => \"pi\"\n                \"\" => \"mi\"\n                \"\" => \"bi\"\n                \"\" => \"bi\"\n                \"\" => \"bi\"\n                \"\" => \"bi\"\n                \"\" => \"bi\"\n                \"\" => \"bi\"\n                \"\" => \"bi\"\n                \"\" => \"bi\"\n                \"\" => \"bi\"\n                \"\" => \"bian\"\n                \"\" => \"bian\"\n                \"\" => \"bian\"\n                \"\" => \"bian\"\n                \"便\" => \"bian\"\n                \"\" => \"bian\"\n                \"\" => \"bian\"\n                \"\" => \"biao\"\n                \"\" => \"shao\"\n                \"\" => \"biao\"\n                \"\" => \"biao\"\n                \"\" => \"biao\"\n                \"\" => \"biao\"\n                \"\" => \"bin\"\n                \"\" => \"bin\"\n                \"\" => \"bin\"\n                \"\" => \"bin\"\n                \"\" => \"ping\"\n                \"\" => \"bo\"\n                \"\" => \"bu\"\n                \"\" => \"bu\"\n                \"\" => \"bu\"\n                \"\" => \"bu\"\n                \"\" => \"pu\"\n                \"\" => \"bu\"\n                \"\" => \"ca\"\n                \"\" => \"can\"\n                \"\" => \"zang\"\n                \"\" => \"cao\"\n                \"\" => \"ce\"\n                \"\" => \"zha\"\n                \"\" => \"sha\"\n                \"\" => \"chai\"\n                \"\" => \"chan\"\n                \"\" => \"chan\"\n                \"\" => \"tan\"\n                \"\" => \"chan\"\n                \"\" => \"chan\"\n                \"\" => \"chang\"\n                \"\" => \"chang\"\n                \"\" => \"chang\"\n                \"\" => \"chang\"\n                \"\" => \"chang\"\n                \"\" => \"chang\"\n                \"\" => \"chao\"\n                \"\" => \"chao\"\n                \"\" => \"che\"\n                \"\" => \"chen\"\n                \"\" => \"chen\"\n                \"\" => \"chen\"\n                \"\" => \"cheng\"\n                \"\" => \"cheng\"\n                \"\" => \"cheng\"\n                \"\" => \"cheng\"\n                \"\" => \"cheng\"\n                \"\" => \"chi\"\n                \"\" => \"chi\"\n                \"\" => \"chi\"\n                \"\" => \"chi\"\n                \"\" => \"di\"\n                \"\" => \"chi\"\n                \"\" => \"zhong\"\n                \"\" => \"zhong\"\n                \"\" => \"chou\"\n                \"\" => \"chou\"\n                \"\" => \"chou\"\n                \"\" => \"chou\"\n                \"\" => \"chou\"\n                \"\" => \"chu\"\n                \"\" => \"chu\"\n                \"\" => \"zuo\"\n                \"\" => \"chuai\"\n                \"\" => \"chuan\"\n                \"\" => \"zhui\"\n                \"\" => \"ci\"\n                \"\" => \"zi\"\n                \"\" => \"si\"\n                \"\" => \"cong\"\n                \"\" => \"cou\"\n                \"\" => \"zan\"\n                \"\" => \"cuan\"\n                \"\" => \"zhui\"\n                \"\" => \"cui\"\n                \"\" => \"cuo\"\n                \"\" => \"cuo\"\n                \"\" => \"da\"\n                \"\" => \"da\"\n                \"\" => \"ta\"\n                \"\" => \"tai\"\n                \"\" => \"dai\"\n                \"\" => \"dai\"\n                \"\" => \"dai\"\n                \"\" => \"dan\"\n                \"\" => \"dan\"\n                \"\" => \"dao\"\n                \"\" => \"dao\"\n                \"\" => \"deng\"\n                \"\" => \"ti\"\n                \"\" => \"zhai\"\n                \"\" => \"ti\"\n                \"\" => \"dian\"\n                \"\" => \"dian\"\n                \"\" => \"dian\"\n                \"\" => \"dian\"\n                \"\" => \"tiao\"\n                \"\" => \"diao\"\n                \"\" => \"yi\"\n                \"\" => \"die\"\n                \"\" => \"die\"\n                \"\" => \"die\"\n                \"\" => \"die\"\n                \"\" => \"ding\"\n                \"\" => \"dong\"\n                \"\" => \"dong\"\n                \"\" => \"dong\"\n                \"\" => \"dong\"\n                \"\" => \"dong\"\n                \"\" => \"du\"\n                \"\" => \"duan\"\n                \"\" => \"dui\"\n                \"\" => \"dui\"\n                \"\" => \"tun\"\n                \"\" => \"duo\"\n                \"\" => \"duo\"\n                \"\" => \"tuo\"\n                \"\" => \"tuo\"\n                \"\" => \"tuo\"\n                \"\" => \"o\"\n                \"\" => \"e\"\n                \"\" => \"e\"\n                \"\" => \"e\"\n                \"\" => \"e\"\n                \"\" => \"e\"\n                \"\" => \"ea\"\n                \"\" => \"er\"\n                \"\" => \"er\"\n                \"\" => \"er\"\n                \"\" => \"fan\"\n                \"\" => \"pang\"\n                \"\" => \"fei\"\n                \"\" => \"fei\"\n                \"\" => \"fei\"\n                \"\" => \"fei\"\n                \"\" => \"fen\"\n                \"\" => \"fen\"\n                \"\" => \"fou\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"pu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"fu\"\n                \"\" => \"ka\"\n                \"\" => \"ga\"\n                \"\" => \"zha\"\n                \"\" => \"gai\"\n                \"\" => \"gai\"\n                \"\" => \"kang\"\n                \"\" => \"gang\"\n                \"\" => \"gang\"\n                \"\" => \"gao\"\n                \"\" => \"gao\"\n                \"\" => \"gao\"\n                \"\" => \"ge\"\n                \"\" => \"yi\"\n                \"\" => \"ge\"\n                \"\" => \"ge\"\n                \"\" => \"ge\"\n                \"\" => \"ge\"\n                \"\" => \"ju\"\n                \"\" => \"gou\"\n                \"\" => \"gou\"\n                \"\" => \"gou\"\n                \"\" => \"gou\"\n                \"\" => \"gu\"\n                \"\" => \"gu\"\n                \"\" => \"gu\"\n                \"\" => \"gu\"\n                \"\" => \"gu\"\n                \"\" => \"kuo\"\n                \"\" => \"guan\"\n                \"\" => \"lun\"\n                \"\" => \"guan\"\n                \"\" => \"wo\"\n                \"\" => \"guo\"\n                \"\" => \"guo\"\n                \"\" => \"guo\"\n                \"\" => \"ke\"\n                \"\" => \"hai\"\n                \"\" => \"han\"\n                \"\" => \"keng\"\n                \"\" => \"hang\"\n                \"\" => \"xiang\"\n                \"\" => \"ke\"\n                \"\" => \"he\"\n                \"\" => \"xia\"\n                \"\" => \"heng\"\n                \"\" => \"hong\"\n                \"\" => \"hong\"\n                \"\" => \"hong\"\n                \"\" => \"hou\"\n                \"\" => \"hu\"\n                \"\" => \"hu\"\n                \"\" => \"hu\"\n                \"\" => \"hu\"\n                \"\" => \"hu\"\n                \"\" => \"huan\"\n                \"\" => \"huan\"\n                \"\" => \"xun\"\n                \"\" => \"huan\"\n                \"\" => \"huan\"\n                \"\" => \"hui\"\n                \"\" => \"hui\"\n                \"\" => \"hui\"\n                \"\" => \"kui\"\n                \"\" => \"hui\"\n                \"\" => \"hui\"\n                \"\" => \"huo\"\n                \"\" => \"huo\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"xi\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"qi\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"ji\"\n                \"\" => \"qie\"\n                \"\" => \"jia\"\n                \"\" => \"jia\"\n                \"\" => \"jia\"\n                \"\" => \"jia\"\n                \"\" => \"jia\"\n                \"\" => \"jia\"\n                \"\" => \"jia\"\n                \"\" => \"jia\"\n                \"\" => \"qia\"\n                \"\" => \"jia\"\n                \"\" => \"jiao\"\n                \"\" => \"jiao\"\n                \"\" => \"jia\"\n                \"\" => \"jiao\"\n                \"\" => \"qiu\"\n                \"\" => \"jiao\"\n                \"\" => \"jia\"\n                \"\" => \"qian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jian\"\n                \"\" => \"jiang\"\n                \"\" => \"jiang\"\n                \"\" => \"jiang\"\n                \"\" => \"jiang\"\n                \"\" => \"jiang\"\n                \"\" => \"jiang\"\n                \"\" => \"jiao\"\n                \"\" => \"jiao\"\n                \"\" => \"jiao\"\n                \"\" => \"jiao\"\n                \"\" => \"jiao\"\n                \"\" => \"jiao\"\n                \"\" => \"qiao\"\n                \"\" => \"jiao\"\n                \"\" => \"xiao\"\n                \"\" => \"jiao\"\n                \"\" => \"jiao\"\n                \"\" => \"jie\"\n                \"\" => \"jie\"\n                \"\" => \"ju\"\n                \"\" => \"jie\"\n                \"\" => \"jie\"\n                \"\" => \"jie\"\n                \"\" => \"jie\"\n                \"\" => \"jie\"\n                \"\" => \"jie\"\n                \"\" => \"jie\"\n                \"\" => \"jie\"\n                \"\" => \"jin\"\n                \"\" => \"jin\"\n                \"\" => \"jin\"\n                \"\" => \"jin\"\n                \"\" => \"jin\"\n                \"槿\" => \"jin\"\n                \"\" => \"jin\"\n                \"\" => \"jin\"\n                \"\" => \"jin\"\n                \"\" => \"jin\"\n                \"\" => \"jin\"\n                \"\" => \"jing\"\n                \"\" => \"jing\"\n                \"\" => \"jing\"\n                \"\" => \"jing\"\n                \"\" => \"jing\"\n                \"\" => \"jing\"\n                \"\" => \"jing\"\n                \"\" => \"jing\"\n                \"\" => \"jiong\"\n                \"\" => \"jiu\"\n                \"\" => \"jiu\"\n                \"\" => \"jiu\"\n                \"\" => \"jiu\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"ju\"\n                \"\" => \"quan\"\n                \"\" => \"juan\"\n                \"\" => \"juan\"\n                \"\" => \"juan\"\n                \"\" => \"juan\"\n                \"\" => \"juan\"\n                \"\" => \"juan\"\n                \"\" => \"jue\"\n                \"\" => \"jue\"\n                \"\" => \"jue\"\n                \"\" => \"jue\"\n                \"\" => \"jue\"\n                \"\" => \"jue\"\n                \"\" => \"jue\"\n                \"\" => \"jue\"\n                \"\" => \"jue\"\n                \"\" => \"jue\"\n                \"\" => \"jun\"\n                \"\" => \"jun\"\n                \"\" => \"jun\"\n                \"\" => \"jun\"\n                \"\" => \"ka\"\n                \"\" => \"ka\"\n                \"\" => \"ka\"\n                \"\" => \"ka\"\n                \"\" => \"kai\"\n                \"\" => \"kai\"\n                \"\" => \"kai\"\n                \"\" => \"kai\"\n                \"\" => \"kai\"\n                \"\" => \"kan\"\n                \"\" => \"kan\"\n                \"\" => \"kang\"\n                \"\" => \"kang\"\n                \"\" => \"kao\"\n                \"\" => \"kao\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ke\"\n                \"\" => \"ken\"\n                \"\" => \"kong\"\n                \"\" => \"kong\"\n                \"\" => \"kong\"\n                \"\" => \"kou\"\n                \"\" => \"kou\"\n                \"\" => \"kou\"\n                \"\" => \"ku\"\n                \"\" => \"ku\"\n                 …6466\n              ]\n              \"croatian\" => array:10 [ …10]\n              \"czech\" => array:18 [ …18]\n              \"danish\" => array:8 [ …8]\n              \"default\" => array:181 [ …181]\n              \"esperanto\" => array:12 [ …12]\n              \"estonian\" => array:12 [ …12]\n              \"finnish\" => array:4 [ …4]\n              \"french\" => array:32 [ …32]\n              \"georgian\" => array:33 [ …33]\n              \"german\" => array:7 [ …7]\n              \"greek\" => array:109 [ …109]\n              \"hindi\" => array:64 [ …64]\n              \"hungarian\" => array:18 [ …18]\n              \"italian\" => array:11 [ …11]\n              \"latvian\" => array:16 [ …16]\n              \"lithuanian\" => array:18 [ …18]\n              \"macedonian\" => array:62 [ …62]\n              \"norwegian\" => array:6 [ …6]\n              \"persian\" => array:32 [ …32]\n              \"polish\" => array:18 [ …18]\n              \"portuguese-brazil\" => array:181 [ …181]\n              \"romanian\" => array:14 [ …14]\n              \"russian\" => array:66 [ …66]\n              \"serbian\" => array:70 [ …70]\n              \"swedish\" => array:6 [ …6]\n              \"turkish\" => array:12 [ …12]\n              \"turkmen\" => array:16 [ …16]\n              \"ukrainian\" => array:8 [ …8]\n              \"vietnamese\" => array:90 [ …90]\n            ]\n          }\n          #options: array:7 [\n            \"regexp\" => \"/[^A-Za-z0-9]+/\"\n            \"separator\" => \"-\"\n            \"lowercase\" => true\n            \"lowercase_after_regexp\" => false\n            \"trim\" => true\n            \"strip_tags\" => false\n            \"rulesets\" => array:19 [\n              0 => \"default\"\n              1 => \"armenian\"\n              2 => \"azerbaijani\"\n              3 => \"burmese\"\n              4 => \"hindi\"\n              5 => \"georgian\"\n              6 => \"norwegian\"\n              7 => \"vietnamese\"\n              8 => \"ukrainian\"\n              9 => \"latvian\"\n              10 => \"finnish\"\n              11 => \"greek\"\n              12 => \"czech\"\n              13 => \"arabic\"\n              14 => \"turkish\"\n              15 => \"polish\"\n              16 => \"german\"\n              17 => \"russian\"\n              18 => \"romanian\"\n            ]\n          ]\n        }\n        -constrains: array:1 [\n          \"action\" => null\n        ]\n        -defaults: array:1 [\n          \"action\" => \"index\"\n        ]\n        -matchHost: false\n        -prefix: \"\"\n        -basePath: \"/\"\n        -compiled: \"/^(?:(?P<action>[^\\/]+)\\.html)?$/iu\"\n        -template: \"[<action>.html]\"\n        -options: array:1 [\n          \"action\" => null\n        ]\n        -uriFactory: Nyholm\\Psr7\\Factory\\Psr17Factory {#1350}\n        -patternRegistry: Spiral\\Router\\Registry\\DefaultPatternRegistry {#1351\n          -patterns: array:3 [\n            \"int\" => \"\\d+\"\n            \"integer\" => \"\\d+\"\n            \"uuid\" => \"[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}\"\n          ]\n        }\n      }\n      #matches: array:1 [\n        \"action\" => \"index\"\n      ]\n      #pattern: \"[<action>.html]\"\n      #verbs: array:7 [\n        0 => \"GET\"\n        1 => \"POST\"\n        2 => \"PUT\"\n        3 => \"PATCH\"\n        4 => \"OPTIONS\"\n        5 => \"HEAD\"\n        6 => \"DELETE\"\n      ]\n      #defaults: array:1 [\n        \"action\" => \"index\"\n      ]\n      -target: Spiral\\Router\\Target\\Controller {#69\n        -core: null\n        -handler: Spiral\\Router\\CoreHandler {#1544\n          -tracer: Spiral\\Telemetry\\NullTracer {#1337\n            -scope: Spiral\\Core\\Container {#4\n              -state: Spiral\\Core\\Internal\\State {#7\n                +bindings: & array:187 [\n                  \"Spiral\\Core\\Container\" => WeakReference {#8\n                    object: Spiral\\Core\\Container {#4}\n                  }\n                  \"Psr\\Container\\ContainerInterface\" => \"Spiral\\Core\\Container\"\n                  \"Spiral\\Core\\BinderInterface\" => \"Spiral\\Core\\Container\"\n                  \"Spiral\\Core\\FactoryInterface\" => \"Spiral\\Core\\Container\"\n                  \"Spiral\\Core\\ScopeInterface\" => \"Spiral\\Core\\Container\"\n                  \"Spiral\\Core\\ResolverInterface\" => \"Spiral\\Core\\Container\"\n                  \"Spiral\\Core\\InvokerInterface\" => \"Spiral\\Core\\Container\"\n                  \"Spiral\\Boot\\BootloadManager\\InitializerInterface\" => \"Spiral\\Boot\\BootloadManager\\Initializer\"\n                  \"Spiral\\Boot\\BootloadManager\\InvokerStrategyInterface\" => \"Spiral\\Boot\\BootloadManager\\DefaultInvokerStrategy\"\n                  \"Spiral\\Boot\\BootloadManager\\ClassesRegistry\" => Spiral\\Boot\\BootloadManager\\ClassesRegistry {#59\n                    -classes: array:59 [ …59]\n                  }\n                  \"Spiral\\Boot\\BootloadManager\\Initializer\" => Spiral\\Boot\\BootloadManager\\Initializer {#54\n                    #container: Spiral\\Core\\Container {#4}\n                    #binder: Spiral\\Core\\Container {#4}\n                    #bootloaders: Spiral\\Boot\\BootloadManager\\ClassesRegistry {#59}\n                  }\n                  \"Spiral\\Boot\\BootloadManager\\StrategyBasedBootloadManager\" => Spiral\\Boot\\BootloadManager\\StrategyBasedBootloadManager {#30\n                    -scope: Spiral\\Core\\Container {#4}\n                    #initializer: Spiral\\Boot\\BootloadManager\\Initializer {#54}\n                    -invoker: Spiral\\Boot\\BootloadManager\\DefaultInvokerStrategy {#42 …3}\n                  }\n                  \"Spiral\\Boot\\BootloadManagerInterface\" => Spiral\\Boot\\BootloadManager\\StrategyBasedBootloadManager {#30}\n                  \"Spiral\\Exceptions\\ExceptionHandlerInterface\" => App\\Exception\\Handler {#22\n                    +verbosity: Spiral\\Exceptions\\Verbosity {#21 …2}\n                    #renderers: & array:2 [ …2]\n                    #reporters: array:3 [ …3]\n                    #output: null\n                  }\n                  \"Spiral\\Exceptions\\ExceptionRendererInterface\" => App\\Exception\\Handler {#22}\n                  \"Spiral\\Exceptions\\ExceptionReporterInterface\" => App\\Exception\\Handler {#22}\n                  \"Spiral\\Exceptions\\ExceptionHandler\" => App\\Exception\\Handler {#22}\n                  \"Spiral\\Boot\\KernelInterface\" => App\\App {#19\n                    #finalizer: Spiral\\Boot\\Finalizer {#24\n                      -dispatcher: null\n                      -finalizers: array:5 [ …5]\n                    }\n                    #dispatchers: array:5 [ …5]\n                    -runningCallbacks: & array:1 [ …1]\n                    -bootingCallbacks: & []\n                    -bootedCallbacks: & []\n                    -bootstrappedCallbacks: & []\n                    #container: Spiral\\Core\\Container {#4}\n                    #exceptionHandler: App\\Exception\\Handler {#22}\n                    #bootloader: Spiral\\Boot\\BootloadManager\\StrategyBasedBootloadManager {#30}\n                    -bootingCallbacks: & []\n                    -bootedCallbacks: & []\n                  }\n                  \"Spiral\\Boot\\AbstractKernel\" => App\\App {#19}\n                  \"App\\App\" => App\\App {#19}\n                  \"Spiral\\Boot\\DirectoriesInterface\" => Spiral\\Boot\\Directories {#20\n                    -directories: array:11 [ …11]\n                  }\n                  \"Spiral\\Boot\\FinalizerInterface\" => Spiral\\Boot\\Finalizer {#24}\n                  \"Spiral\\Logger\\LogsInterface\" => array:2 [\n                    0 => \"Spiral\\Monolog\\LogFactory\"\n                    1 => true\n                  ]\n                  \"Spiral\\Config\\ConfigManager\" => Spiral\\Config\\ConfigManager {#57\n                    -data: array:17 [ …17]\n                    -defaults: array:26 [ …26]\n                    -instances: array:11 [ …11]\n                    -loader: Spiral\\Config\\Loader\\DirectoryLoader {#60 …2}\n                    -strict: true\n                  }\n                  \"Spiral\\Config\\ConfiguratorInterface\" => Spiral\\Config\\ConfigManager {#57}\n                  \"Spiral\\Tokenizer\\Bootloader\\TokenizerBootloader\" => Spiral\\Tokenizer\\Bootloader\\TokenizerBootloader {#39\n                    -config: Spiral\\Config\\ConfigManager {#57}\n                  }\n                  \"Spiral\\Tokenizer\\ScopedClassesInterface\" => \"Spiral\\Tokenizer\\ScopedClassLocator\"\n                  \"Spiral\\Tokenizer\\ClassesInterface\" => \"Spiral\\Tokenizer\\ClassLocator\"\n                  \"Spiral\\Tokenizer\\InvocationsInterface\" => \"Spiral\\Tokenizer\\InvocationLocator\"\n                  \"Spiral\\Boot\\EnvironmentInterface\" => Spiral\\Boot\\Environment {#25\n                    -id: null\n                    -values: array:61 [ …61]\n                    -overwrite: false\n                  }\n                  \"Spiral\\Prototype\\PrototypeRegistry\" => Spiral\\Prototype\\PrototypeRegistry {#105\n                    -dependencies: array:33 [ …33]\n                    -container: Spiral\\Core\\Container {#4}\n                  }\n                  \"Spiral\\Prototype\\Bootloader\\PrototypeBootloader\" => Spiral\\Prototype\\Bootloader\\PrototypeBootloader {#47\n                    -registry: Spiral\\Prototype\\PrototypeRegistry {#105}\n                  }\n                  \"Spiral\\Tokenizer\\Bootloader\\TokenizerListenerBootloader\" => Spiral\\Tokenizer\\Bootloader\\TokenizerListenerBootloader {#26\n                    -listeners: []\n                  }\n                  \"Spiral\\Console\\Bootloader\\ConsoleBootloader\" => Spiral\\Console\\Bootloader\\ConsoleBootloader {#107\n                    -config: Spiral\\Config\\ConfigManager {#57}\n                  }\n                  \"Spiral\\Console\\Console\" => array:2 [\n                    0 => \"Spiral\\Console\\Console\"\n                    1 => true\n                  ]\n                  \"Spiral\\Monolog\\Bootloader\\MonologBootloader\" => Spiral\\Monolog\\Bootloader\\MonologBootloader {#111\n                    -config: Spiral\\Config\\ConfigManager {#57}\n                  }\n                  \"log.rotate\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => false\n                  ]\n                  \"Spiral\\Http\\Middleware\\ErrorHandlerMiddleware\\SuppressErrorsInterface\" => \"Spiral\\Http\\Middleware\\ErrorHandlerMiddleware\\EnvSuppressErrors\"\n                  \"Spiral\\Http\\ErrorHandler\\RendererInterface\" => \"App\\ErrorHandler\\ViewRenderer\"\n                  \"Spiral\\Snapshots\\SnapshotterInterface\" => array:2 [\n                    0 => \"Spiral\\Snapshots\\FileSnapshooter\"\n                    1 => true\n                  ]\n                  \"Spiral\\Cache\\CacheStorageProviderInterface\" => array:2 [\n                    0 => \"Spiral\\Cache\\CacheManager\"\n                    1 => true\n                  ]\n                  \"Spiral\\Cache\\CacheManager\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\RoadRunner\\GRPC\\Server\" => array:2 [\n                    0 => \"Spiral\\RoadRunner\\GRPC\\Server\"\n                    1 => true\n                  ]\n                  \"Spiral\\RoadRunner\\GRPC\\InvokerInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\RoadRunnerBridge\\GRPC\\LocatorInterface\" => array:2 [\n                    0 => \"Spiral\\RoadRunnerBridge\\GRPC\\ServiceLocator\"\n                    1 => true\n                  ]\n                  \"Spiral\\RoadRunnerBridge\\GRPC\\ProtoRepository\\ProtoFilesRepositoryInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\Bootloader\\Http\\HttpBootloader\" => Spiral\\Bootloader\\Http\\HttpBootloader {#94\n                    -config: Spiral\\Config\\ConfigManager {#57}\n                  }\n                  \"Spiral\\Telemetry\\ClockInterface\" => array:2 [\n                    0 => \"Spiral\\Telemetry\\Clock\\SystemClock\"\n                    1 => true\n                  ]\n                  \"Spiral\\Serializer\\SerializerManager\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\Serializer\\SerializerRegistryInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\Serializer\\SerializerInterface\" => array:2 [\n                    0 => \"Spiral\\Serializer\\SerializerManager\"\n                    1 => true\n                  ]\n                  \"Spiral\\Queue\\SerializerRegistryInterface\" => array:2 [\n                    0 => \"Spiral\\Queue\\QueueRegistry\"\n                    1 => true\n                  ]\n                  \"Spiral\\Queue\\Failed\\FailedJobHandlerInterface\" => array:2 [\n                    0 => \"Spiral\\Queue\\Failed\\LogFailedJobHandler\"\n                    1 => true\n                  ]\n                  \"Spiral\\Bootloader\\I18nBootloader\" => Spiral\\Bootloader\\I18nBootloader {#97\n                    -config: Spiral\\Config\\ConfigManager {#57}\n                  }\n                  \"Symfony\\Contracts\\Translation\\TranslatorInterface\" => array:2 [\n                    0 => \"Spiral\\Translator\\TranslatorInterface\"\n                    1 => true\n                  ]\n                  \"Spiral\\Stempler\\Bootloader\\StemplerBootloader\" => Spiral\\Stempler\\Bootloader\\StemplerBootloader {#83\n                    -config: Spiral\\Config\\ConfigManager {#57}\n                  }\n                  \"Spiral\\Views\\Bootloader\\ViewsBootloader\" => Spiral\\Views\\Bootloader\\ViewsBootloader {#79\n                    -config: Spiral\\Config\\ConfigManager {#57}\n                  }\n                  \"Spiral\\Views\\GlobalVariables\" => array:2 [\n                    0 => \"Spiral\\Views\\GlobalVariables\"\n                    1 => true\n                  ]\n                  \"Spiral\\SendIt\\RendererInterface\" => array:2 [\n                    0 => \"Spiral\\SendIt\\Renderer\\ViewRenderer\"\n                    1 => true\n                  ]\n                  \"Spiral\\SendIt\\MailJob\" => array:2 [\n                    0 => \"Spiral\\SendIt\\MailJob\"\n                    1 => true\n                  ]\n                  \"Symfony\\Component\\Mailer\\MailerInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\SendIt\\TransportResolver\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\SendIt\\TransportResolverInterface\" => array:2 [\n                    0 => \"Spiral\\SendIt\\TransportResolver\"\n                    1 => true\n                  ]\n                  \"Spiral\\SendIt\\TransportRegistryInterface\" => array:2 [\n                    0 => \"Spiral\\SendIt\\TransportResolver\"\n                    1 => true\n                  ]\n                  \"Symfony\\Component\\Mailer\\Transport\\TransportInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\Encrypter\\EncrypterInterface\" => \"Spiral\\Encrypter\\Encrypter\"\n                  \"Spiral\\Encrypter\\EncryptionInterface\" => array:2 [\n                    0 => \"Spiral\\Encrypter\\EncrypterFactory\"\n                    1 => true\n                  ]\n                  \"Spiral\\Validation\\Bootloader\\ValidationBootloader\" => Spiral\\Validation\\Bootloader\\ValidationBootloader {#103\n                    -config: Spiral\\Config\\ConfigManager {#57}\n                  }\n                  \"Spiral\\Validation\\ValidationProviderInterface\" => array:2 [\n                    0 => \"Spiral\\Validation\\ValidationProvider\"\n                    1 => true\n                  ]\n                  \"Spiral\\Validation\\ValidationInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\Bootloader\\Security\\FiltersBootloader\" => Spiral\\Bootloader\\Security\\FiltersBootloader {#88\n                    -container: Spiral\\Core\\Container {#4}\n                    -binder: Spiral\\Core\\Container {#4}\n                    -config: Spiral\\Config\\ConfigManager {#57}\n                  }\n                  \"Spiral\\Filters\\Model\\FilterProviderInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\Filters\\InputInterface\" => array:2 [\n                    0 => \"Spiral\\Filter\\InputScope\"\n                    1 => true\n                  ]\n                  \"Spiral\\Security\\ActorInterface\" => \"Spiral\\Security\\Actor\\Guest\"\n                  \"Spiral\\Security\\PermissionsInterface\" => array:2 [\n                    0 => \"Spiral\\Security\\PermissionManager\"\n                    1 => true\n                  ]\n                  \"Spiral\\Security\\RulesInterface\" => array:2 [\n                    0 => \"Spiral\\Security\\RuleManager\"\n                    1 => true\n                  ]\n                  \"Spiral\\Security\\GuardInterface\" => array:2 [\n                    0 => \"Spiral\\Security\\GuardScope\"\n                    1 => true\n                  ]\n                  \"Spiral\\Domain\\PermissionsProviderInterface\" => array:2 [\n                    0 => \"Spiral\\Domain\\GuardPermissionsProvider\"\n                    1 => true\n                  ]\n                  \"Spiral\\Router\\RouteInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\Bootloader\\Http\\CookiesBootloader\" => Spiral\\Bootloader\\Http\\CookiesBootloader {#86\n                    -config: Spiral\\Config\\ConfigManager {#57}\n                  }\n                  \"Spiral\\Cookies\\CookieQueue\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => false\n                  ]\n                  \"Spiral\\Session\\SessionFactoryInterface\" => array:2 [\n                    0 => \"Spiral\\Session\\SessionFactory\"\n                    1 => true\n                  ]\n                  \"Spiral\\Pagination\\PaginationProviderInterface\" => array:2 [\n                    0 => \"Spiral\\Http\\PaginationFactory\"\n                    1 => true\n                  ]\n                  \"Spiral\\Router\\Bootloader\\AnnotatedRoutesBootloader\" => Spiral\\Router\\Bootloader\\AnnotatedRoutesBootloader {#81}\n                  \"Spiral\\Cycle\\Bootloader\\DatabaseBootloader\" => Spiral\\Cycle\\Bootloader\\DatabaseBootloader {#87}\n                  \"Cycle\\Database\\DatabaseManager\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Cycle\\Database\\DatabaseProviderInterface\" => array:2 [\n                    0 => \"Cycle\\Database\\DatabaseManager\"\n                    1 => true\n                  ]\n                  \"Cycle\\Database\\LoggerFactoryInterface\" => array:2 [\n                    0 => \"Spiral\\Cycle\\LoggerFactory\"\n                    1 => true\n                  ]\n                  \"Cycle\\Migrations\\Migrator\" => array:2 [\n                    0 => \"Cycle\\Migrations\\Migrator\"\n                    1 => true\n                  ]\n                  \"Cycle\\Migrations\\RepositoryInterface\" => array:2 [\n                    0 => \"Cycle\\Migrations\\FileRepository\"\n                    1 => true\n                  ]\n                  \"Spiral\\Cycle\\Bootloader\\SchemaBootloader\" => Spiral\\Cycle\\Bootloader\\SchemaBootloader {#74\n                    -defaultGenerators: array:3 [ …3]\n                    -container: Spiral\\Core\\Container {#4}\n                  }\n                  \"Cycle\\Annotated\\Embeddings\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => false\n                  ]\n                  \"Cycle\\Annotated\\Entities\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => false\n                  ]\n                  \"Cycle\\Annotated\\MergeColumns\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => false\n                  ]\n                  \"Cycle\\Annotated\\TableInheritance\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => false\n                  ]\n                  \"Cycle\\Annotated\\MergeIndexes\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => false\n                  ]\n                  \"Cycle\\ORM\\ORMInterface\" => array:2 [\n                    0 => \"Cycle\\ORM\\ORM\"\n                    1 => true\n                  ]\n                  \"Cycle\\ORM\\EntityManagerInterface\" => array:2 [\n                    0 => \"Cycle\\ORM\\EntityManager\"\n                    1 => true\n                  ]\n                  \"Cycle\\ORM\\FactoryInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Cycle\\ORM\\SchemaInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => false\n                  ]\n                  \"Cocur\\Slugify\\SlugifyInterface\" => \"Cocur\\Slugify\\Slugify\"\n                  \"Spiral\\Bootloader\\DebugBootloader\" => Spiral\\Bootloader\\DebugBootloader {#52\n                    -collectors: array:3 [ …3]\n                    -factory: Spiral\\Core\\Container {#4}\n                  }\n                  \"Spiral\\Debug\\StateInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => false\n                  ]\n                  \"Spiral\\Debug\\StateCollector\\EnvironmentCollector\" => array:2 [\n                    0 => \"Spiral\\Debug\\StateCollector\\EnvironmentCollector\"\n                    1 => true\n                  ]\n                  \"Spiral\\Validator\\RulesInterface\" => array:2 [\n                    0 => \"Spiral\\Validator\\RulesProvider\"\n                    1 => true\n                  ]\n                  \"Spiral\\Filters\\FilterProviderInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\Goridge\\RPC\\RPCInterface\" => array:2 [\n                    0 => \"Spiral\\Goridge\\RPC\\RPC\"\n                    1 => true\n                  ]\n                  \"Spiral\\Goridge\\RPC\\RPC\" => array:2 [\n                    0 => Closure(EnvironmentInterface $env): RPCInterface {#117 …2}\n                    1 => true\n                  ]\n                  \"Spiral\\RoadRunner\\KeyValue\\FactoryInterface\" => array:2 [\n                    0 => Closure(RPCInterface $rpc) {#122 …1}\n                    1 => true\n                  ]\n                  \"Spiral\\RoadRunner\\KeyValue\\StorageInterface\" => array:2 [\n                    0 => Closure(FactoryInterface $factory, string $driver) {#123 …1}\n                    1 => false\n                  ]\n                  \"Spiral\\RoadRunner\\Environment\" => Spiral\\RoadRunner\\Environment {#162\n                    -env: array:61 [ …61]\n                  }\n                  \"Spiral\\RoadRunner\\EnvironmentInterface\" => Spiral\\RoadRunner\\Environment {#162}\n                  \"Spiral\\RoadRunnerBridge\\RoadRunnerMode\" => Spiral\\RoadRunnerBridge\\RoadRunnerMode {#148\n                    +name: \"Http\"\n                    +value: \"http\"\n                  }\n                  \"Spiral\\RoadRunnerBridge\\Queue\\PipelineRegistryInterface\" => array:2 [\n                    0 => Closure(JobsInterface $jobs, JobsAdapterSerializer $serializer, array $pipelines, array $aliases): PipelineRegistryInterface {#129 …2}\n                    1 => false\n                  ]\n                  \"Spiral\\RoadRunnerBridge\\Queue\\JobsAdapterSerializer\" => array:2 [\n                    0 => Closure(SerializerRegistryInterface $registry) {#121 …1}\n                    1 => true\n                  ]\n                  \"Spiral\\RoadRunner\\Jobs\\Serializer\\SerializerInterface\" => array:2 [\n                    0 => \"Spiral\\RoadRunnerBridge\\Queue\\JobsAdapterSerializer\"\n                    1 => true\n                  ]\n                  \"Spiral\\RoadRunner\\Jobs\\JobsInterface\" => array:2 [\n                    0 => Closure(RPCInterface $rpc, SerializerInterface $serializer): Jobs {#128 …2}\n                    1 => true\n                  ]\n                  \"Spiral\\RoadRunner\\Jobs\\ConsumerInterface\" => array:2 [\n                    0 => Closure(JobsAdapterSerializer $serializer, WorkerInterface $worker): Consumer {#124 …2}\n                    1 => true\n                  ]\n                  \"Spiral\\Boot\\Environment\\DebugMode\" => Spiral\\Boot\\Environment\\DebugMode {#140\n                    +name: \"Enabled\"\n                  }\n                  \"Spiral\\Tokenizer\\TokenizerListenerRegistryInterface\" => Spiral\\Tokenizer\\Bootloader\\TokenizerListenerBootloader {#26}\n                  \"Spiral\\Attributes\\ReaderInterface\" => Spiral\\Attributes\\Composite\\SelectiveReader {#188\n                    #readers: array:2 [ …2]\n                  }\n                  \"Spiral\\Router\\GroupRegistry\" => Spiral\\Router\\GroupRegistry {#190\n                    -defaultGroup: \"web\"\n                    -groups: array:3 [ …3]\n                    -factory: Spiral\\Core\\Container {#4}\n                  }\n                  \"Spiral\\Debug\\StateCollector\\LogCollector\" => Spiral\\Debug\\StateCollector\\LogCollector {#146\n                    -logEvents: []\n                  }\n                  \"Spiral\\Logger\\ListenerRegistryInterface\" => Spiral\\Logger\\ListenerRegistry {#193\n                    -listeners: array:1 [ …1]\n                  }\n                  \"Spiral\\Debug\\StateCollector\\HttpCollector\" => Spiral\\Debug\\StateCollector\\HttpCollector {#161\n                    -request: Nyholm\\Psr7\\ServerRequest {#1349 …13}\n                  }\n                  \"Spiral\\Core\\ConfigsInterface\" => Spiral\\Config\\ConfigManager {#57}\n                  \"Sentry\\ClientInterface\" => Sentry\\Client {#228\n                    -options: Sentry\\Options {#207 …2}\n                    -transport: Sentry\\Transport\\HttpTransport {#230 …7}\n                    -logger: Psr\\Log\\NullLogger {#227}\n                    -integrations: array:8 [ …8]\n                    -representationSerializer: Sentry\\Serializer\\RepresentationSerializer {#279 …4}\n                    -stacktraceBuilder: Sentry\\StacktraceBuilder {#280 …1}\n                    -sdkIdentifier: \"sentry.php.spiral\"\n                    -sdkVersion: \"3.1.2\"\n                  }\n                  \"Spiral\\Session\\SessionScope\" => Spiral\\Session\\SessionScope {#294\n                    -container: Spiral\\Core\\Container {#4}\n                  }\n                  \"Psr\\Log\\LoggerInterface\" => Monolog\\Logger {#350\n                    #name: \"socket\"\n                    #handlers: & array:2 [ …2]\n                    #processors: array:1 [ …1]\n                    #microsecondTimestamps: true\n                    #timezone: DateTimeZone {#352 …3}\n                    #exceptionHandler: null\n                    -logDepth: 0\n                    -fiberLogDepth: WeakMap {#353}\n                    -detectCycles: true\n                  }\n                  \"Spiral\\Files\\FilesInterface\" => Spiral\\Files\\Files {#368\n                    -destructFiles: []\n                  }\n                  \"Spiral\\Snapshots\\FileSnapshot\" => Spiral\\Snapshots\\FileSnapshot {#356\n                    -directory: \"/root/repos/spiral-apps/filters-bridge/runtime//snapshots/\"\n                    -maxFiles: 25\n                    -verbosity: Spiral\\Exceptions\\Verbosity {#349\n                      +name: \"VERBOSE\"\n                      +value: 1\n                    }\n                    -renderer: Spiral\\Exceptions\\Renderer\\PlainRenderer {#357 …2}\n                    -files: Spiral\\Files\\Files {#368}\n                  }\n                  \"Spiral\\RoadRunnerBridge\\Http\\ErrorHandlerInterface\" => Spiral\\RoadRunnerBridge\\Http\\LogErrorHandler {#380\n                    -container: Spiral\\Core\\Container {#4}\n                  }\n                  \"Spiral\\Mailer\\MailerInterface\" => array:2 [\n                    0 => Closure(MailerConfig $config, QueueConnectionProviderInterface $provider): MailQueue {#335 …2}\n                    1 => true\n                  ]\n                  \"Spiral\\Queue\\QueueRegistry\" => Spiral\\Queue\\QueueRegistry {#337\n                    -handlers: array:1 [ …1]\n                    -serializers: []\n                    -container: Spiral\\Core\\Container {#4}\n                    -factory: Spiral\\Core\\Container {#4}\n                    -fallbackHandlers: Spiral\\Queue\\ContainerRegistry {#378 …2}\n                  }\n                  \"Spiral\\Router\\Loader\\LoaderRegistryInterface\" => Spiral\\Router\\Loader\\LoaderRegistry {#1336\n                    -loaders: array:1 [ …1]\n                  }\n                  \"Spiral\\Router\\Loader\\LoaderInterface\" => Spiral\\Router\\Loader\\DelegatingLoader {#1330\n                    -registry: Spiral\\Router\\Loader\\LoaderRegistry {#1336}\n                  }\n                  \"Spiral\\Router\\Loader\\Configurator\\RoutingConfigurator\" => Spiral\\Router\\Loader\\Configurator\\RoutingConfigurator {#1111\n                    -collection: Spiral\\Router\\RouteCollection {#1324 …1}\n                    -loader: Spiral\\Router\\Loader\\DelegatingLoader {#1330}\n                  }\n                  \"Psr\\Http\\Message\\UriFactoryInterface\" => Nyholm\\Psr7\\Factory\\Psr17Factory {#1350}\n                  \"Spiral\\Router\\Registry\\RoutePatternRegistryInterface\" => Spiral\\Router\\Registry\\DefaultPatternRegistry {#1351}\n                  \"Spiral\\Telemetry\\TracerFactoryProviderInterface\" => Spiral\\Telemetry\\ConfigTracerFactoryProvider {#1361\n                    -drivers: array:1 [ …1]\n                    -config: Spiral\\Telemetry\\Config\\TelemetryConfig {#1368 …1}\n                    -factory: Spiral\\Core\\Container {#4}\n                  }\n                  \"Spiral\\Telemetry\\TracerFactoryInterface\" => Spiral\\Telemetry\\NullTracerFactory {#1356\n                    -scope: Spiral\\Core\\Container {#4}\n                  }\n                  \"Spiral\\Router\\RouterInterface\" => Spiral\\Router\\Router {#1329\n                    -basePath: \"/\"\n                    -routes: array:5 [ …5]\n                    -default: null\n                    -uriHandler: Spiral\\Router\\UriHandler {#1342 …12}\n                    -container: Spiral\\Core\\Container {#4}\n                    -eventDispatcher: null\n                    -tracer: Spiral\\Telemetry\\NullTracer {#1337}\n                  }\n                  \"Spiral\\Validation\\ValidationProvider\" => Spiral\\Validation\\ValidationProvider {#1354\n                    -resolvers: array:1 [ …1]\n                    -invoker: Spiral\\Core\\Container {#4}\n                  }\n                  \"Inspector\\Inspector\" => Inspector\\Inspector {#1335\n                    #configuration: Inspector\\Configuration {#1343 …7}\n                    #transport: Inspector\\Transports\\AsyncTransport {#1359 …4}\n                    #transaction: null\n                  }\n                  \"Spiral\\Tokenizer\\Tokenizer\" => Spiral\\Tokenizer\\Tokenizer {#91\n                    -config: Spiral\\Tokenizer\\Config\\TokenizerConfig {#41 …1}\n                  }\n                  \"Spiral\\Tokenizer\\Listener\\ClassesLoaderInterface\" => Spiral\\Tokenizer\\Listener\\CachedClassesLoader {#99\n                    -reader: Spiral\\Attributes\\Composite\\SelectiveReader {#188}\n                    -memory: Spiral\\Boot\\Memory {#85 …2}\n                    -locator: Spiral\\Tokenizer\\Listener\\ClassLocatorByTarget {#104 …2}\n                    -invoker: Spiral\\Tokenizer\\Listener\\ListenerInvoker {#90}\n                    -readCache: true\n                  }\n                  \"middleware:web\" => array:2 [\n                    0 => Closure(PipelineFactory $factory): Pipeline {#327 …3}\n                    1 => false\n                  ]\n                  \"middleware:profiler\" => array:2 [\n                    0 => Closure(PipelineFactory $factory): Pipeline {#332 …3}\n                    1 => false\n                  ]\n                  \"middleware:api\" => array:2 [\n                    0 => Closure(PipelineFactory $factory): Pipeline {#336 …3}\n                    1 => false\n                  ]\n                  \"Spiral\\Boot\\DispatcherInterface\" => Spiral\\RoadRunnerBridge\\Http\\Dispatcher {#371\n                    -container: Spiral\\Core\\Container {#4}\n                    -errorHandler: Spiral\\RoadRunnerBridge\\Http\\LogErrorHandler {#380}\n                    -finalizer: Spiral\\Boot\\Finalizer {#24}\n                    -mode: Spiral\\RoadRunnerBridge\\RoadRunnerMode {#148}\n                  }\n                  \"Spiral\\RoadRunner\\Worker\" => Spiral\\RoadRunner\\Worker {#1375\n                    -relay: Spiral\\Goridge\\StreamRelay {#1378 …2}\n                    -logger: Spiral\\RoadRunner\\Logger {#1395}\n                  }\n                  \"Spiral\\RoadRunner\\WorkerInterface\" => Spiral\\RoadRunner\\Worker {#1375}\n                  \"Psr\\Http\\Message\\ServerRequestFactoryInterface\" => Nyholm\\Psr7\\Factory\\Psr17Factory {#93}\n                  \"Psr\\Http\\Message\\StreamFactoryInterface\" => Nyholm\\Psr7\\Factory\\Psr17Factory {#1397}\n                  \"Psr\\Http\\Message\\UploadedFileFactoryInterface\" => Nyholm\\Psr7\\Factory\\Psr17Factory {#1401}\n                  \"Spiral\\RoadRunner\\Http\\PSR7Worker\" => Spiral\\RoadRunner\\Http\\PSR7Worker {#1392\n                    +chunkSize: 0\n                    -httpWorker: Spiral\\RoadRunner\\Http\\HttpWorker {#333 …1}\n                    -requestFactory: Nyholm\\Psr7\\Factory\\Psr17Factory {#93}\n                    -streamFactory: Nyholm\\Psr7\\Factory\\Psr17Factory {#1397}\n                    -uploadsFactory: Nyholm\\Psr7\\Factory\\Psr17Factory {#1401}\n                    -originalServer: array:61 [ …61]\n                  }\n                  \"Spiral\\RoadRunner\\Http\\PSR7WorkerInterface\" => Spiral\\RoadRunner\\Http\\PSR7Worker {#1392}\n                  \"Spiral\\Telemetry\\TracerInterface\" => Spiral\\Telemetry\\NullTracer {#1337}\n                  \"Psr\\Http\\Server\\RequestHandlerInterface\" => Spiral\\Router\\Router {#1329}\n                  \"Psr\\Http\\Message\\ResponseFactoryInterface\" => Spiral\\Nyholm\\ResponseFactory {#1406\n                    -config: Spiral\\Http\\Config\\HttpConfig {#58\n                      #config: array:5 [\n                        \"basePath\" => \"/\"\n                        \"headers\" => array:1 [ …1]\n                        \"middleware\" => array:4 [ …4]\n                        \"chunkSize\" => null\n                        \"inputBags\" => []\n                      ]\n                    }\n                    -factory: Nyholm\\Psr7\\Factory\\Psr17Factory {#1409}\n                  }\n                  \"Spiral\\Translator\\Catalogue\\LoaderInterface\" => Spiral\\Translator\\Catalogue\\CatalogueLoader {#1432\n                    -config: Spiral\\Translator\\Config\\TranslatorConfig {#1414 …2}\n                    -logger: null\n                  }\n                  \"Spiral\\Boot\\MemoryInterface\" => Spiral\\Boot\\Memory {#1441\n                    -directory: \"/root/repos/spiral-apps/filters-bridge/runtime/cache\"\n                    -files: Spiral\\Files\\Files {#368}\n                  }\n                  \"Spiral\\Translator\\Catalogue\\CacheInterface\" => Spiral\\Translator\\MemoryCache {#1433\n                    -memory: Spiral\\Boot\\Memory {#1441}\n                  }\n                  \"Spiral\\Translator\\CatalogueManagerInterface\" => Spiral\\Translator\\Catalogue\\CatalogueManager {#1422\n                    -locales: array:2 [ …2]\n                    -cache: Spiral\\Translator\\MemoryCache {#1433}\n                    -catalogues: array:1 [ …1]\n                    -loader: Spiral\\Translator\\Catalogue\\CatalogueLoader {#1432}\n                  }\n                  \"Symfony\\Component\\Translation\\IdentityTranslator\" => Symfony\\Component\\Translation\\IdentityTranslator {#1416\n                    -locale: null\n                  }\n                  \"Spiral\\Translator\\Translator\" => Spiral\\Translator\\Translator {#1404\n                    -locale: \"en\"\n                    -config: Spiral\\Translator\\Config\\TranslatorConfig {#1414 …2}\n                    -catalogueManager: Spiral\\Translator\\Catalogue\\CatalogueManager {#1422}\n                    -identityTranslator: Symfony\\Component\\Translation\\IdentityTranslator {#1416}\n                    -dispatcher: null\n                  }\n                  \"Spiral\\Views\\GlobalVariablesInterface\" => Spiral\\Views\\GlobalVariables {#1444\n                    -variables: []\n                  }\n                  \"Spiral\\Views\\LoaderInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => true\n                  ]\n                  \"Spiral\\Translator\\TranslatorInterface\" => Spiral\\Translator\\Translator {#1404}\n                  \"Spiral\\Stempler\\StemplerEngine\" => Spiral\\Stempler\\StemplerEngine {#1453\n                    -classPrefix: \"__StemplerView__\"\n                    -builder: null\n                    -loader: null\n                    -container: Spiral\\Core\\Container {#4}\n                    -config: Spiral\\Stempler\\Config\\StemplerConfig {#1457 …1}\n                    -cache: null\n                  }\n                  \"Spiral\\Translator\\Views\\LocaleProcessor\" => Spiral\\Translator\\Views\\LocaleProcessor {#1461\n                    -translator: Spiral\\Translator\\Translator {#1404}\n                  }\n                  \"Spiral\\Stempler\\Directive\\RouteDirective\" => Spiral\\Stempler\\Directive\\RouteDirective {#1474\n                    -r: ReflectionObject {#1473 …7}\n                    -container: Spiral\\Core\\Container {#4}\n                  }\n                  \"Spiral\\Views\\ViewManager\" => Spiral\\Views\\ViewManager {#1437\n                    -loader: Spiral\\Views\\ViewLoader {#1435 …5}\n                    -cache: null\n                    -context: Spiral\\Views\\ViewContext {#1434 …1}\n                    -engines: & array:2 [ …2]\n                    -config: Spiral\\Views\\Config\\ViewsConfig {#1442 …1}\n                    -globalVariables: Spiral\\Views\\GlobalVariables {#1444}\n                  }\n                  \"Spiral\\Views\\ViewsInterface\" => Spiral\\Views\\ViewManager {#1437}\n                  \"Spiral\\Exceptions\\Verbosity\" => Spiral\\Exceptions\\Verbosity {#349}\n                  \"Spiral\\Http\\Http\" => Spiral\\Http\\Http {#1367\n                    -handler: Spiral\\Router\\Router {#1329}\n                    -tracerFactory: Spiral\\Telemetry\\NullTracerFactory {#1356}\n                    -config: Spiral\\Http\\Config\\HttpConfig {#58}\n                    -pipeline: Spiral\\Http\\Pipeline {#1403 …6}\n                    -responseFactory: Spiral\\Nyholm\\ResponseFactory {#1406}\n                    -container: Spiral\\Core\\Container {#4}\n                  }\n                  \"Spiral\\Telemetry\\SpanInterface\" => Spiral\\Telemetry\\Span {#1570\n                    -status: null\n                    -name: \"Controller [App\\Controller\\HomeController:index]\"\n                    -attributes: array:3 [ …3]\n                  }\n                  \"Psr\\Http\\Message\\ServerRequestInterface\" => Nyholm\\Psr7\\ServerRequest {#1545}\n                  \"Spiral\\Core\\CoreInterface\" => Spiral\\Core\\InterceptableCore {#1550\n                    -pipeline: Spiral\\Core\\InterceptorPipeline {#1546\n                      -core: null\n                      -interceptors: array:1 [\n                        0 => Spiral\\Filters\\Interceptor\\FilterInterceptor {#1556 …3}\n                      ]\n                      -position: 0\n                      -dispatcher: null\n                    }\n                    -core: Spiral\\Core\\Core {#1558\n                      #resolver: Spiral\\Core\\Container {#4}\n                      #container: Spiral\\Core\\Container {#4}\n                    }\n                  }\n                  \"SpiralPackages\\Profiler\\Storage\\StorageInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => false\n                  ]\n                  \"SpiralPackages\\Profiler\\Driver\\DriverInterface\" => array:2 [\n                    0 => array:2 [ …2]\n                    1 => false\n                  ]\n                  \"Psr\\Http\\Message\\ResponseInterface\" => Nyholm\\Psr7\\Response {#1569\n                    -reasonPhrase: \"\"\n                    -statusCode: 200\n                    -headers: array:1 [ …1]\n                    -headerNames: array:1 [ …1]\n                    -protocol: \"1.1\"\n                    -stream: null\n                  }\n                  \"Spiral\\Queue\\QueueManager\" => Spiral\\Queue\\QueueManager {#1617\n                    -pipelines: array:1 [ …1]\n                    -config: Spiral\\Queue\\Config\\QueueConfig {#48 …1}\n                    -container: Spiral\\Core\\Container {#4}\n                    -factory: Spiral\\Core\\Container {#4}\n                    -dispatcher: null\n                  }\n                  \"Spiral\\Queue\\QueueConnectionProviderInterface\" => Spiral\\Queue\\QueueManager {#1617}\n                  \"Spiral\\Queue\\HandlerRegistryInterface\" => Spiral\\Queue\\QueueRegistry {#337}\n                  \"Spiral\\Queue\\Interceptor\\Consume\\Handler\" => Spiral\\Queue\\Interceptor\\Consume\\Handler {#1610\n                    -tracerFactory: Spiral\\Telemetry\\NullTracerFactory {#1356}\n                    -core: Spiral\\Core\\InterceptableCore {#1613 …2}\n                  }\n                  \"App\\Controller\\HomeController\" => App\\Controller\\HomeController {#1589\n                    -data: []\n                    -queue: Spiral\\Queue\\Queue {#1597 …1}\n                    -views: Spiral\\Views\\ViewManager {#1437}\n                  }\n                ]\n                +injectors: array:23 [\n                  \"Spiral\\Tokenizer\\ClassLocator\" => \"Spiral\\Tokenizer\\ClassLocatorInjector\"\n                  \"Spiral\\Tokenizer\\InvocationLocator\" => \"Spiral\\Tokenizer\\InvocationLocatorInjector\"\n                  \"Monolog\\Logger\" => \"Spiral\\Monolog\\LogFactory\"\n                  \"Psr\\SimpleCache\\CacheInterface\" => \"Spiral\\Cache\\Core\\CacheInjector\"\n                  \"Spiral\\Queue\\QueueInterface\" => \"Spiral\\Queue\\Core\\QueueInjector\"\n                  \"Spiral\\RoadRunnerBridge\\RoadRunnerMode\" => \"Spiral\\Boot\\Injector\\EnumInjector\"\n                  \"Spiral\\Boot\\Environment\\DebugMode\" => \"Spiral\\Boot\\Injector\\EnumInjector\"\n                  \"Spiral\\Filters\\Model\\FilterInterface\" => \"Spiral\\Bootloader\\Security\\FiltersBootloader\"\n                  \"Cycle\\Database\\DatabaseInterface\" => \"Spiral\\Cycle\\Injector\\DatabaseInjector\"\n                  \"Cycle\\ORM\\RepositoryInterface\" => \"Spiral\\Cycle\\Injector\\RepositoryInjector\"\n                  \"Spiral\\Filters\\FilterInterface\" => \"Spiral\\Filters\\Bootloader\\FiltersBootloader\"\n                  \"Spiral\\Sentry\\Config\\SentryConfig\" => \"Spiral\\Core\\ConfigsInterface\"\n                  \"Spiral\\Monolog\\Config\\MonologConfig\" => \"Spiral\\Core\\ConfigsInterface\"\n                  \"Spiral\\Telemetry\\Config\\TelemetryConfig\" => \"Spiral\\Core\\ConfigsInterface\"\n                  \"Spiral\\Queue\\Config\\QueueConfig\" => \"Spiral\\Core\\ConfigsInterface\"\n                  \"Spiral\\Tokenizer\\Config\\TokenizerConfig\" => \"Spiral\\Core\\ConfigsInterface\"\n                  \"Spiral\\Cycle\\Config\\CycleConfig\" => \"Spiral\\Core\\ConfigsInterface\"\n                  \"Spiral\\Http\\Config\\HttpConfig\" => \"Spiral\\Core\\ConfigsInterface\"\n                  \"Spiral\\Translator\\Config\\TranslatorConfig\" => \"Spiral\\Core\\ConfigsInterface\"\n                  \"Spiral\\Views\\Config\\ViewsConfig\" => \"Spiral\\Core\\ConfigsInterface\"\n                  \"Spiral\\Stempler\\Config\\StemplerConfig\" => \"Spiral\\Core\\ConfigsInterface\"\n                  \"Spiral\\Exceptions\\Verbosity\" => \"Spiral\\Boot\\Injector\\EnumInjector\"\n                  \"Spiral\\Bootloader\\Http\\JsonPayloadConfig\" => \"Spiral\\Core\\ConfigsInterface\"\n                ]\n                +finalizers: []\n              }\n              -resolver: Spiral\\Core\\Internal\\Resolver {#12\n                -factory: Spiral\\Core\\Internal\\Factory {#13\n                  -state: Spiral\\Core\\Internal\\State {#7}\n                  -binder: Spiral\\Core\\Internal\\Binder {#14\n                    #state: Spiral\\Core\\Internal\\State {#7}\n                    -container: Spiral\\Core\\Internal\\Container {#15\n                      -state: Spiral\\Core\\Internal\\State {#7}\n                      -factory: Spiral\\Core\\Internal\\Factory {#13}\n                    }\n                  }\n                  -invoker: Spiral\\Core\\Internal\\Invoker {#16\n                    -container: Spiral\\Core\\Internal\\Container {#15}\n                    -resolver: Spiral\\Core\\Internal\\Resolver {#12}\n                  }\n                  -container: Spiral\\Core\\Internal\\Container {#15}\n                  -resolver: Spiral\\Core\\Internal\\Resolver {#12}\n                  -tracer: Spiral\\Core\\Internal\\Tracer {#17\n                    -traces: & array:1 [\n                      0 => []\n                    ]\n                  }\n                  -scope: Spiral\\Core\\Internal\\Scope {#9\n                    -parent: null\n                    -parentScope: null\n                    -scopeName: \"root\"\n                  }\n                }\n                -container: Spiral\\Core\\Internal\\Container {#15}\n              }\n              -factory: Spiral\\Core\\Internal\\Factory {#13}\n              -container: Spiral\\Core\\Internal\\Container {#15}\n              -binder: Spiral\\Core\\Internal\\Binder {#14}\n              -invoker: Spiral\\Core\\Internal\\Invoker {#16}\n              -scope: Spiral\\Core\\Internal\\Scope {#9}\n              -config: Spiral\\Core\\Config {#5\n                +scope: \"Spiral\\Core\\Internal\\Scope\"\n                +scopedBindings: Spiral\\Core\\Internal\\Config\\StateStorage {#6\n                  -states: array:1 [\n                    \"root\" => Spiral\\Core\\Internal\\State {#7}\n                  ]\n                }\n                -rootLocked: false\n                +state: \"Spiral\\Core\\Internal\\State\"\n                +resolver: \"Spiral\\Core\\Internal\\Resolver\"\n                +factory: \"Spiral\\Core\\Internal\\Factory\"\n                +container: \"Spiral\\Core\\Internal\\Container\"\n                +binder: \"Spiral\\Core\\Internal\\Binder\"\n                +invoker: \"Spiral\\Core\\Internal\\Invoker\"\n                +tracer: \"Spiral\\Core\\Internal\\Tracer\"\n              }\n            }\n          }\n          -controller: null\n          -verbActions: null\n          -parameters: null\n          -core: Spiral\\Core\\InterceptableCore {#1550}\n          -scope: Spiral\\Core\\Container {#4}\n          -responseFactory: Spiral\\Nyholm\\ResponseFactory {#1406}\n        }\n        -verbActions: false\n        -defaults: array:1 [\n          \"action\" => null\n        ]\n        -constrains: array:1 [\n          \"action\" => null\n        ]\n        -defaultAction: \"index\"\n        -controller: \"App\\Controller\\HomeController\"\n      }\n      -requestHandler: Spiral\\Router\\CoreHandler {#1539\n        -tracer: Spiral\\Telemetry\\NullTracer {#1337}\n        -controller: \"App\\Controller\\HomeController\"\n        -action: \"index\"\n        -verbActions: false\n        -parameters: array:1 [\n          \"action\" => \"index\"\n        ]\n        -core: Spiral\\Core\\InterceptableCore {#1550}\n        -scope: Spiral\\Core\\Container {#4}\n        -responseFactory: Spiral\\Nyholm\\ResponseFactory {#1406}\n      }\n      #pipeline: Spiral\\Http\\Pipeline {#101\n        -position: 0\n        -tracer: Spiral\\Telemetry\\NullTracer {#1373\n          -scope: Spiral\\Core\\Container {#4}\n        }\n        -handler: null\n        -scope: Spiral\\Core\\Container {#4}\n        -dispatcher: null\n        #middleware: array:1 [\n          0 => Spiral\\Http\\Pipeline {#1374\n            -position: 0\n            -tracer: Spiral\\Telemetry\\NullTracer {#1383\n              -scope: Spiral\\Core\\Container {#4}\n            }\n            -handler: null\n            -scope: Spiral\\Core\\Container {#4}\n            -dispatcher: null\n            #middleware: array:2 [\n              0 => Spiral\\Profiler\\ProfilerMiddleware {#1384 …3}\n              1 => Spiral\\Http\\Pipeline {#1389 …6}\n            ]\n          }\n        ]\n      }\n      #middleware: array:1 [\n        0 => \"middleware:profiler\"\n      ]\n      #container: Spiral\\Core\\Container {#4}\n    }\n    \"routeName\" => \"html\"\n    \"matches\" => array:1 [\n      \"action\" => \"index\"\n    ]\n  ]\n  -cookieParams: array:4 [\n    \"_ga_TD1X69YDT5\" => \"GS1.1.1678132611.22.1.1678137856.0.0.0\"\n    \"_ga\" => \"GA1.1.734953706.1673627847\"\n    \"_lfa\" => \"LF1.1.f98950321ce4fe9c.1673271587691\"\n    \"theme\" => \"light\"\n  ]\n  -parsedBody: null\n  -queryParams: []\n  -serverParams: array:79 [\n    \"SHELL\" => \"/bin/bash\"\n    \"WSL2_GUI_APPS_ENABLED\" => \"1\"\n    \"WSL_DISTRO_NAME\" => \"Ubuntu-22.04\"\n    \"NODE_OPTIONS\" => \"--openssl-legacy-provider\"\n    \"NAME\" => \"ButschsterLpp\"\n    \"PWD\" => \"/root/repos/spiral-apps/filters-bridge\"\n    \"LOGNAME\" => \"root\"\n    \"HOME\" => \"/root\"\n    \"LANG\" => \"C.UTF-8\"\n    \"WSL_INTEROP\" => \"/run/WSL/29721_interop\"\n    \"LS_COLORS\" => \"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:\"\n    \"WAYLAND_DISPLAY\" => \"wayland-0\"\n    \"LESSCLOSE\" => \"/usr/bin/lesspipe %s %s\"\n    \"TERM\" => \"xterm-256color\"\n    \"LESSOPEN\" => \"| /usr/bin/lesspipe %s\"\n    \"USER\" => \"root\"\n    \"DISPLAY\" => \":0\"\n    \"SHLVL\" => \"1\"\n    \"COMPOSER_ALLOW_SUPERUSER\" => \"1\"\n    \"XDG_RUNTIME_DIR\" => \"/mnt/wslg/runtime-dir\"\n    \"WSLENV\" => \"\"\n    \"XDG_DATA_DIRS\" => \"/usr/local/share:/usr/share:/var/lib/snapd/desktop\"\n    \"PATH\" => \"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/ProgramData/ComposerSetup/bin:/mnt/c/Users/butsc/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/JetBrains/PhpStorm 2022.2.2/bin:/mnt/c/Users/butsc/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/butsc/Documents/PHP/8.1:/mnt/c/Users/butsc/OneDrive/PHP/composer:/mnt/c/Users/butsc/AppData/Roaming/Composer/vendor/bin:/snap/bin\"\n    \"HOSTTYPE\" => \"x86_64\"\n    \"PULSE_SERVER\" => \"unix:/mnt/wslg/PulseServer\"\n    \"_\" => \"./rr\"\n    \"RR_RELAY\" => \"pipes\"\n    \"RR_RPC\" => \"tcp://127.0.0.1:6002\"\n    \"RR_MODE\" => \"http\"\n    \"PHP_SELF\" => \"app.php\"\n    \"SCRIPT_NAME\" => \"app.php\"\n    \"SCRIPT_FILENAME\" => \"app.php\"\n    \"PATH_TRANSLATED\" => \"app.php\"\n    \"DOCUMENT_ROOT\" => \"\"\n    \"REQUEST_TIME_FLOAT\" => 1678272165.0609\n    \"REQUEST_TIME\" => 1678272165\n    \"argv\" => array:1 [\n      0 => \"app.php\"\n    ]\n    \"argc\" => 1\n    \"APP_ENV\" => \"local\"\n    \"DEBUG\" => \"true\"\n    \"TOKENIZER_CACHE_TARGETS\" => \"true\"\n    \"ENCRYPTER_KEY\" => \"def00000c7cb5691f7d052a7d4d1aea220b23db12a2a0f9d5be80c044e6cc5c2671d049decfe970c545c7d457f8e7edf2f979acefd988a926bcfa84dc042873db3a19dc6\"\n    \"SAFE_MIGRATIONS\" => \"true\"\n    \"QUEUE_CONNECTION\" => \"sync\"\n    \"MONOLOG_DEFAULT_CHANNEL\" => \"socket\"\n    \"MONOLOG_DEFAULT_LEVEL\" => \"DEBUG\"\n    \"MONOLOG_SOCKET_HOST\" => \"127.0.0.1:9913\"\n    \"CACHE_STORAGE\" => \"local\"\n    \"SESSION_LIFETIME\" => \"86400\"\n    \"SESSION_COOKIE\" => \"sid\"\n    \"MAILER_DSN\" => \"smtp://127.0.0.1:1025\"\n    \"MAILER_PIPELINE\" => \"local\"\n    \"MAILER_FROM\" => \"Spiral <sendit@local.host>\"\n    \"STORAGE_DEFAULT\" => \"default\"\n    \"CYCLE_SCHEMA_CACHE\" => \"true\"\n    \"CYCLE_SCHEMA_WARMUP\" => \"false\"\n    \"SENTRY_DSN\" => \"http://tsfsdfsdfsdfcsdf@127.0.0.1:8082/1\"\n    \"VAR_DUMPER_FORMAT\" => \"server\"\n    \"VAR_DUMPER_SERVER\" => \"127.0.0.1:9912\"\n    \"PROFILER_ENDPOINT\" => \"http://127.0.0.1:8082/api/profiler/store\"\n    \"PROFILER_APP_NAME\" => \"My super app\"\n    \"REQUEST_URI\" => \"http://127.0.0.1:8080/\"\n    \"REMOTE_ADDR\" => \"127.0.0.1\"\n    \"REQUEST_METHOD\" => \"GET\"\n    \"HTTP_USER_AGENT\" => \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36\"\n    \"HTTP_CACHE_CONTROL\" => \"max-age=0\"\n    \"HTTP_SEC_CH_UA_PLATFORM\" => \""Windows"\"\n    \"HTTP_UPGRADE_INSECURE_REQUESTS\" => \"1\"\n    \"HTTP_SEC_FETCH_SITE\" => \"none\"\n    \"HTTP_CONNECTION\" => \"keep-alive\"\n    \"HTTP_SEC_CH_UA\" => \""Chromium";v="110", "Not A(Brand";v="24", "Google Chrome";v="110"\"\n    \"HTTP_SEC_CH_UA_MOBILE\" => \"?0\"\n    \"HTTP_ACCEPT_LANGUAGE\" => \"en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,ka;q=0.6\"\n    \"HTTP_COOKIE\" => \"_ga=GA1.1.734953706.1673627847; _lfa=LF1.1.f98950321ce4fe9c.1673271587691; theme=light; _ga_TD1X69YDT5=GS1.1.1678132611.22.1.1678137856.0.0.0\"\n    \"HTTP_ACCEPT\" => \"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7\"\n    \"HTTP_SEC_FETCH_DEST\" => \"document\"\n    \"HTTP_ACCEPT_ENCODING\" => \"gzip, deflate, br\"\n    \"HTTP_SEC_FETCH_MODE\" => \"navigate\"\n    \"HTTP_SEC_FETCH_USER\" => \"?1\"\n  ]\n  -uploadedFiles: []\n  -headers: array:16 [\n    \"Host\" => array:1 [\n      0 => \"127.0.0.1:8080\"\n    ]\n    \"User-Agent\" => array:1 [\n      0 => \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36\"\n    ]\n    \"Cache-Control\" => array:1 [\n      0 => \"max-age=0\"\n    ]\n    \"Sec-Ch-Ua-Platform\" => array:1 [\n      0 => \""Windows"\"\n    ]\n    \"Upgrade-Insecure-Requests\" => array:1 [\n      0 => \"1\"\n    ]\n    \"Sec-Fetch-Site\" => array:1 [\n      0 => \"none\"\n    ]\n    \"Connection\" => array:1 [\n      0 => \"keep-alive\"\n    ]\n    \"Sec-Ch-Ua\" => array:1 [\n      0 => \""Chromium";v="110", "Not A(Brand";v="24", "Google Chrome";v="110"\"\n    ]\n    \"Sec-Ch-Ua-Mobile\" => array:1 [\n      0 => \"?0\"\n    ]\n    \"Accept-Language\" => array:1 [\n      0 => \"en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7,ka;q=0.6\"\n    ]\n    \"Cookie\" => array:1 [\n      0 => \"_ga=GA1.1.734953706.1673627847; _lfa=LF1.1.f98950321ce4fe9c.1673271587691; theme=light; _ga_TD1X69YDT5=GS1.1.1678132611.22.1.1678137856.0.0.0\"\n    ]\n    \"Accept\" => array:1 [\n      0 => \"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7\"\n    ]\n    \"Sec-Fetch-Dest\" => array:1 [\n      0 => \"document\"\n    ]\n    \"Accept-Encoding\" => array:1 [\n      0 => \"gzip, deflate, br\"\n    ]\n    \"Sec-Fetch-Mode\" => array:1 [\n      0 => \"navigate\"\n    ]\n    \"Sec-Fetch-User\" => array:1 [\n      0 => \"?1\"\n    ]\n  ]\n  -headerNames: array:16 [\n    \"host\" => \"Host\"\n    \"user-agent\" => \"User-Agent\"\n    \"cache-control\" => \"Cache-Control\"\n    \"sec-ch-ua-platform\" => \"Sec-Ch-Ua-Platform\"\n    \"upgrade-insecure-requests\" => \"Upgrade-Insecure-Requests\"\n    \"sec-fetch-site\" => \"Sec-Fetch-Site\"\n    \"connection\" => \"Connection\"\n    \"sec-ch-ua\" => \"Sec-Ch-Ua\"\n    \"sec-ch-ua-mobile\" => \"Sec-Ch-Ua-Mobile\"\n    \"accept-language\" => \"Accept-Language\"\n    \"cookie\" => \"Cookie\"\n    \"accept\" => \"Accept\"\n    \"sec-fetch-dest\" => \"Sec-Fetch-Dest\"\n    \"accept-encoding\" => \"Accept-Encoding\"\n    \"sec-fetch-mode\" => \"Sec-Fetch-Mode\"\n    \"sec-fetch-user\" => \"Sec-Fetch-User\"\n  ]\n  -protocol: \"1.1\"\n  -stream: null\n  -method: \"GET\"\n  -requestTarget: null\n  -uri: Nyholm\\Psr7\\Uri {#119\n    -scheme: \"http\"\n    -userInfo: \"\"\n    -host: \"127.0.0.1\"\n    -port: 8080\n    -path: \"/\"\n    -query: \"\"\n    -fragment: \"\"\n  }\n}\n
\n" diff --git a/src/widgets/ui/code-snippet/code-snippet.stories.ts b/src/shared/ui/code-snippet/code-snippet.stories.ts similarity index 87% rename from src/widgets/ui/code-snippet/code-snippet.stories.ts rename to src/shared/ui/code-snippet/code-snippet.stories.ts index 55e123d0..ada609e9 100644 --- a/src/widgets/ui/code-snippet/code-snippet.stories.ts +++ b/src/shared/ui/code-snippet/code-snippet.stories.ts @@ -1,10 +1,10 @@ import { Meta, Story } from "@storybook/vue3"; -import { HTMLCode, PHPCode } from '@/src/shared/mocks'; -import { EVENT_TYPES } from "~/src/shared/types"; +import { HTMLCode, PHPCode } from '../../mocks'; +import { EVENT_TYPES } from "../../types"; import CodeSnippet from "./code-snippet.vue"; export default { - title: "FSD/widgets/CodeSnippet", + title: "FSD/shared/CodeSnippet", component: CodeSnippet, } as Meta; diff --git a/src/widgets/ui/code-snippet/code-snippet.vue b/src/shared/ui/code-snippet/code-snippet.vue similarity index 97% rename from src/widgets/ui/code-snippet/code-snippet.vue rename to src/shared/ui/code-snippet/code-snippet.vue index 78efec87..a5eea041 100644 --- a/src/widgets/ui/code-snippet/code-snippet.vue +++ b/src/shared/ui/code-snippet/code-snippet.vue @@ -2,7 +2,7 @@ import highlightPlugin from "@highlightjs/vue-plugin"; import isString from "lodash/isString"; import { ref, computed } from "vue"; -import { IconSvg } from "~/src/shared/ui"; +import { IconSvg } from "../icon-svg"; const CondeHighlight = highlightPlugin.component; diff --git a/src/widgets/ui/code-snippet/index.ts b/src/shared/ui/code-snippet/index.ts similarity index 100% rename from src/widgets/ui/code-snippet/index.ts rename to src/shared/ui/code-snippet/index.ts diff --git a/src/shared/ui/index.ts b/src/shared/ui/index.ts index c0a773da..7c2afd29 100644 --- a/src/shared/ui/index.ts +++ b/src/shared/ui/index.ts @@ -2,3 +2,5 @@ export * from './icon-svg'; export * from './table-base'; export * from './sorting-wrapper'; export * from './preview-card'; +export * from './value-dump'; +export * from './code-snippet'; diff --git a/src/widgets/ui/value-dump/index.ts b/src/shared/ui/value-dump/index.ts similarity index 100% rename from src/widgets/ui/value-dump/index.ts rename to src/shared/ui/value-dump/index.ts diff --git a/src/widgets/ui/value-dump/value-dump.stories.ts b/src/shared/ui/value-dump/value-dump.stories.ts similarity index 61% rename from src/widgets/ui/value-dump/value-dump.stories.ts rename to src/shared/ui/value-dump/value-dump.stories.ts index 290112df..78f8bf25 100644 --- a/src/widgets/ui/value-dump/value-dump.stories.ts +++ b/src/shared/ui/value-dump/value-dump.stories.ts @@ -1,9 +1,9 @@ import { Meta, Story } from "@storybook/vue3"; -import { varDumpObjectMock } from '~/src/entities/var-dump/mocks'; +import { SFDumpCode, HTMLEscapedString } from "../../mocks"; import ValueDump from './value-dump.vue'; export default { - title: "FSD/widgets/ValueDump", + title: "FSD/shared/ValueDump", component: ValueDump } as Meta; @@ -20,7 +20,7 @@ const Template: Story = (args) => ({ export const String = Template.bind({}); String.args = { - value: `<?xml version="1.0"?>
<one>
  <two>
    <three>3</three>
  </two>
</one>`, + value: HTMLEscapedString, type: 'string', }; @@ -33,5 +33,5 @@ Boolean.args = { export const SfDump = Template.bind({}); SfDump.args = { - value: varDumpObjectMock.payload.payload.value, + value: SFDumpCode, }; diff --git a/src/widgets/ui/value-dump/value-dump.vue b/src/shared/ui/value-dump/value-dump.vue similarity index 100% rename from src/widgets/ui/value-dump/value-dump.vue rename to src/shared/ui/value-dump/value-dump.vue diff --git a/src/widgets/ui/index.ts b/src/widgets/ui/index.ts index 3c7470f4..31c0b1d2 100644 --- a/src/widgets/ui/index.ts +++ b/src/widgets/ui/index.ts @@ -1,5 +1,3 @@ -export * from './code-snippet'; export * from './render-graph'; export * from './stat-board'; export * from './page-header'; -export * from './value-dump'; From ba90456645866d6e525b61bf4ab707883c3dd6cf Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 4 Nov 2023 18:29:47 +0400 Subject: [PATCH 31/72] move stat-board to shared ui --- components/ProfilerPage/ProfilerPage.vue | 2 +- components/ProfilerPreview/ProfilerPreview.vue | 3 +-- src/shared/ui/index.ts | 1 + src/{widgets => shared}/ui/stat-board/index.ts | 0 .../ui/stat-board/stat-board.stories.ts | 16 ++++++++-------- .../ui/stat-board/stat-board.vue | 2 +- src/widgets/ui/index.ts | 1 - src/widgets/ui/render-graph/render-graph.vue | 8 +------- 8 files changed, 13 insertions(+), 20 deletions(-) rename src/{widgets => shared}/ui/stat-board/index.ts (100%) rename src/{widgets => shared}/ui/stat-board/stat-board.stories.ts (61%) rename src/{widgets => shared}/ui/stat-board/stat-board.vue (96%) diff --git a/components/ProfilerPage/ProfilerPage.vue b/components/ProfilerPage/ProfilerPage.vue index 54815b00..013c59c5 100644 --- a/components/ProfilerPage/ProfilerPage.vue +++ b/components/ProfilerPage/ProfilerPage.vue @@ -59,7 +59,7 @@ + - - diff --git a/pages/sentry/[id].vue b/pages/sentry/[id].vue index c436e310..32b7a948 100644 --- a/pages/sentry/[id].vue +++ b/pages/sentry/[id].vue @@ -24,9 +24,11 @@ import { defineComponent } from "vue"; import { EventId } from "~/src/shared/types"; import { useNuxtApp, useRoute, useRouter, useFetch } from "#app"; -import { normalizeSentryEvent } from "~/utils/normalize-event"; import SentryPage from "~/components/SentryPage/SentryPage.vue"; import { PageHeader } from "~/src/widgets/ui"; +import { useSentry } from "~/src/entities/sentry"; + +const { normalizeSentryEvent } = useSentry(); export default defineComponent({ components: { diff --git a/src/entities/sentry/index.ts b/src/entities/sentry/index.ts new file mode 100644 index 00000000..03a8d531 --- /dev/null +++ b/src/entities/sentry/index.ts @@ -0,0 +1,2 @@ +export * from './lib'; +export * from './ui'; diff --git a/src/entities/sentry/lib/index.ts b/src/entities/sentry/lib/index.ts new file mode 100644 index 00000000..576054b8 --- /dev/null +++ b/src/entities/sentry/lib/index.ts @@ -0,0 +1,2 @@ +export * from "./use-sentry"; + diff --git a/src/entities/sentry/lib/normalize-sentry-event.ts b/src/entities/sentry/lib/normalize-sentry-event.ts new file mode 100644 index 00000000..f7009f1f --- /dev/null +++ b/src/entities/sentry/lib/normalize-sentry-event.ts @@ -0,0 +1,15 @@ +import { EVENT_TYPES, ServerEvent, NormalizedEvent } from "~/src/shared/types"; +import { Sentry } from "../types"; + +export const normalizeSentryEvent = (event: ServerEvent): NormalizedEvent => ({ + id: event.uuid, + type: EVENT_TYPES.SENTRY, + labels: [EVENT_TYPES.SENTRY, 'exception'], + origin: { + logger: event.payload.logger, + environment: event.payload.environment + }, + serverName: event.payload.server_name, + date: event.timestamp ? new Date(event.timestamp * 1000) : null, + payload: event.payload +}) diff --git a/src/entities/sentry/lib/use-sentry.ts b/src/entities/sentry/lib/use-sentry.ts new file mode 100644 index 00000000..ebdae0e3 --- /dev/null +++ b/src/entities/sentry/lib/use-sentry.ts @@ -0,0 +1,11 @@ +import { ServerEvent, NormalizedEvent } from '~/src/shared/types'; +import { Sentry } from "../types"; +import { normalizeSentryEvent } from "./normalize-sentry-event"; + +type TUseSentry = () => { + normalizeSentryEvent: (event: ServerEvent) => NormalizedEvent +} + +export const useSentry: TUseSentry = () => ({ + normalizeSentryEvent +}) diff --git a/src/entities/sentry/mocks/sentry-event.json b/src/entities/sentry/mocks/sentry-event.json index e2d4184c..42478ba5 100644 --- a/src/entities/sentry/mocks/sentry-event.json +++ b/src/entities/sentry/mocks/sentry-event.json @@ -1,9 +1,10 @@ { - "id": "17d252f1-a602-4ab5-9a1f-837cf8ba9be6", + "uuid": "17d252f1-a602-4ab5-9a1f-837cf8ba9be6", "type": "sentry", "labels": ["sentry.1"], "origin": null, - "serverName": "", + "server_name": "", + "project_id": null, "date": "2023-09-17T20:33:28.000Z", "payload": { "event_id": "16f48014895e405ab3f94dd18018d34d", diff --git a/src/entities/sentry/mocks/sentry-js-event.json b/src/entities/sentry/mocks/sentry-js-event.json index 213e3e58..54aab248 100644 --- a/src/entities/sentry/mocks/sentry-js-event.json +++ b/src/entities/sentry/mocks/sentry-js-event.json @@ -1,9 +1,9 @@ { - "id": "79e27c1d-e610-4c82-9180-aa07b51d2295", + "uuid": "79e27c1d-e610-4c82-9180-aa07b51d2295", "type": "sentry", "labels": ["sentry.1"], "origin": null, - "serverName": "", + "server_name": "", "date": "2023-09-17T21:49:59.000Z", "payload": { "message": "Something went wrong", @@ -12,6 +12,7 @@ "platform": "javascript", "timestamp": 1694987399.84, "environment": "production", + "server_name": "ButschsterLpp", "sdk": { "integrations": [ "InboundFilters", @@ -50,5 +51,6 @@ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36" } } - } + }, + "project_id": null } diff --git a/src/entities/sentry/mocks/sentry-js.json b/src/entities/sentry/mocks/sentry-js.json index 474c07fa..9742abbe 100644 --- a/src/entities/sentry/mocks/sentry-js.json +++ b/src/entities/sentry/mocks/sentry-js.json @@ -1,9 +1,10 @@ { - "id": "28482489-cbf9-4331-b4d8-90549009f777", + "uuid": "28482489-cbf9-4331-b4d8-90549009f777", "type": "sentry", "labels": ["sentry.1"], "origin": null, - "serverName": "", + "server_name": "", + "project_id": null, "date": "2023-09-17T21:51:25.000Z", "payload": { "exception": { diff --git a/src/entities/sentry/types.ts b/src/entities/sentry/types.ts new file mode 100644 index 00000000..c83a0fd5 --- /dev/null +++ b/src/entities/sentry/types.ts @@ -0,0 +1,103 @@ +export interface SentryFrame { + filename: string, + lineno: number, + in_app: boolean, + abs_path?: string, + pre_context?: string[], + context_line?: string, + post_context?: string[], + function?: unknown, +} + +export interface SentryException { + type: string, + value: string, + stacktrace: { + frames: SentryFrame[] + }, + [key: string]: unknown +} + +export interface SentryVersion { + name: string, + version: string, + build?: string, + kernel_version?: string, +} + +export interface Sentry { + event_id: string, + timestamp: number, + platform: string, + message?: string, + contexts: { + runtime?: SentryVersion | unknown, + os?: SentryVersion | unknown, + app?: { + device_app_hash: string, + build_type: string, + app_identifier: string, + app_name: string, + app_version: string, + app_build: string, + app_id: string, + type: string, + } | unknown, + device?: { + screen_resolution: string, + orientation: string, + family: string, + battery_level: number, + screen_dpi: number, + memory_size: number, + timezone: string, + external_storage_size: number, + external_free_storage: number, + screen_width_pixels: number, + low_memory: boolean, + simulator: boolean, + screen_height_pixels: number, + free_memory: number, + online: boolean, + screen_density: number, + type: string, + charging: boolean, + model_id: string, + brand: string, + storage_size: number, + boot_time: string, + arch: string, + manufacturer: string, + name: string, // redacted + free_storage: number, + model: string, + } | unknown, + trace?: Record, + }, + breadcrumbs?: { + values: [{ + type: string, + category: string, + level: string, + timestamp: number, + message: string, + }] + } | unknown, + sdk: SentryVersion, + logger?: string, + transaction?: string, + server_name: string, + environment: string, + modules?: object, + extra?: unknown, + tags?: object, + request?: { + url: string, + method?: string, + headers: object, + data?: object, + }, + exception?: { + values: SentryException[] + } +} diff --git a/src/entities/sentry/ui/index.ts b/src/entities/sentry/ui/index.ts new file mode 100644 index 00000000..5c183b80 --- /dev/null +++ b/src/entities/sentry/ui/index.ts @@ -0,0 +1,2 @@ +export * from './preview-card'; +export * from './sentry-exception'; diff --git a/src/entities/sentry/ui/preview-card/index.ts b/src/entities/sentry/ui/preview-card/index.ts new file mode 100644 index 00000000..cdc15345 --- /dev/null +++ b/src/entities/sentry/ui/preview-card/index.ts @@ -0,0 +1,3 @@ +import PreviewCard from './preview-card.vue' + +export { PreviewCard }; diff --git a/components/SentryPreview/SentryPreview.stories.ts b/src/entities/sentry/ui/preview-card/preview-card.stories.ts similarity index 64% rename from components/SentryPreview/SentryPreview.stories.ts rename to src/entities/sentry/ui/preview-card/preview-card.stories.ts index b68d28ed..c18ba591 100644 --- a/components/SentryPreview/SentryPreview.stories.ts +++ b/src/entities/sentry/ui/preview-card/preview-card.stories.ts @@ -1,21 +1,23 @@ import { Meta, Story } from "@storybook/vue3"; -import { normalizeSentryEvent } from "~/utils/normalize-event"; -import SentryPreview from '~/components/SentryPreview/SentryPreview.vue'; -import { sentryMock, sentryJSEventMock, sentryLaravelMock, sentrySpiralMock } from '~/src/entities/sentry/mocks'; +import { PreviewCard } from '~/src/shared/ui'; +import { useSentry } from "../../lib"; +import { sentryMock, sentryJSEventMock, sentryLaravelMock, sentrySpiralMock } from '../../mocks'; + +const { normalizeSentryEvent } = useSentry(); export default { - title: "Sentry/Components/SentryPreview", - component: SentryPreview -} as Meta; + title: "FSD/entities/sentry/PreviewCard", + component: PreviewCard +} as Meta; const Template: Story = (args) => ({ - components: { SentryPreview }, + components: { PreviewCard }, setup() { return { args, }; }, - template: ``, + template: ``, }); export const Spiral = Template.bind({}); diff --git a/src/entities/sentry/ui/preview-card/preview-card.vue b/src/entities/sentry/ui/preview-card/preview-card.vue new file mode 100644 index 00000000..a89ebfbf --- /dev/null +++ b/src/entities/sentry/ui/preview-card/preview-card.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/entities/sentry/ui/sentry-exception/index.ts b/src/entities/sentry/ui/sentry-exception/index.ts new file mode 100644 index 00000000..d847eaf0 --- /dev/null +++ b/src/entities/sentry/ui/sentry-exception/index.ts @@ -0,0 +1,3 @@ +import SentryException from './sentry-exception.vue' + +export { SentryException }; diff --git a/src/entities/sentry/ui/sentry-exception/sentry-exception-frame.stories.ts b/src/entities/sentry/ui/sentry-exception/sentry-exception-frame.stories.ts new file mode 100644 index 00000000..ba1eb0a5 --- /dev/null +++ b/src/entities/sentry/ui/sentry-exception/sentry-exception-frame.stories.ts @@ -0,0 +1,28 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useSentry } from "../../lib"; +import { sentrySpiralMock } from '../../mocks'; +import SentryExceptionFrame from './sentry-exception-frame.vue'; + +const { normalizeSentryEvent } = useSentry(); + +export default { + title: "FSD/entities/sentry/SentryExceptionFrame", + component: SentryExceptionFrame +} as Meta; + +const Template: Story = (args) => ({ + components: { SentryExceptionFrame }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Frame = Template.bind({}); + +Frame.args = { + isOpen: true, + frame: normalizeSentryEvent(sentrySpiralMock).payload.exception?.values[0]?.stacktrace?.frames[1], +}; diff --git a/components/SentryExceptionFrame/SentryExceptionFrame.vue b/src/entities/sentry/ui/sentry-exception/sentry-exception-frame.vue similarity index 79% rename from components/SentryExceptionFrame/SentryExceptionFrame.vue rename to src/entities/sentry/ui/sentry-exception/sentry-exception-frame.vue index ebfc4d4e..9539618c 100644 --- a/components/SentryExceptionFrame/SentryExceptionFrame.vue +++ b/src/entities/sentry/ui/sentry-exception/sentry-exception-frame.vue @@ -1,3 +1,31 @@ + + - - diff --git a/components/SmtpPage/SmtpPage.vue b/components/SmtpPage/SmtpPage.vue index 3b6825c4..7ce3d842 100644 --- a/components/SmtpPage/SmtpPage.vue +++ b/components/SmtpPage/SmtpPage.vue @@ -83,11 +83,11 @@
-
@@ -105,8 +105,13 @@ import moment from "moment"; import { Tab, Tabs } from "vue3-tabs-component"; import SmtpPagePreview from "~/components/SmtpPagePreview/SmtpPagePreview.vue"; import SmtpPageAddresses from "~/components/SmtpPageAddresses/SmtpPageAddresses.vue"; -import SmtpAttachment from "~/components/SmtpAttachment/SmtpAttachment.vue"; -import { TableBase, TableBaseRow, CodeSnippet } from "~/src/shared/ui"; +import { + TableBase, + TableBaseRow, + CodeSnippet, + FileAttachment, +} from "~/src/shared/ui"; +import type { Attachment } from "~/src/shared/types"; export default defineComponent({ components: { @@ -117,7 +122,7 @@ export default defineComponent({ CodeSnippet, Tabs, Tab, - SmtpAttachment, + FileAttachment, }, props: { event: { @@ -163,7 +168,7 @@ export default defineComponent({ return moment(this.event.timestamp).format("DD.MM.YYYY HH:mm:ss"); }, attachments() { - return Object.values(this.event.payload.attachments); + return Object.values(this.event.payload.attachments) as Attachment[]; }, }, }); diff --git a/config/types.ts b/config/types.ts index 621c26ec..a55e1909 100644 --- a/config/types.ts +++ b/config/types.ts @@ -244,15 +244,6 @@ export interface RayDump { } } - -export interface SmtpAttachment { - name: string, - id: string, - uri: string, - size?: number, - mime?: string, -} - export interface HttpDumpFile { originalName?: string, mime: string, diff --git a/src/entities/smtp/types.ts b/src/entities/smtp/types.ts index a7235dad..55d216dc 100644 --- a/src/entities/smtp/types.ts +++ b/src/entities/smtp/types.ts @@ -1,16 +1,9 @@ +import { Attachment } from '~/src/shared/types'; + type SMTPUser = { name: string; email: string; } - -type SMTPAttachment = { - id: string, - name: string, - size: number, - mime: string, - uri: string -} - export interface SMTP { id: string, from: SMTPUser[], @@ -22,5 +15,5 @@ export interface SMTP { text: string, html: string, raw: string, - attachments?: Record | SMTPAttachment[] + attachments?: Record | Attachment[] } diff --git a/src/shared/types/index.ts b/src/shared/types/index.ts index fa164ef2..0416df32 100644 --- a/src/shared/types/index.ts +++ b/src/shared/types/index.ts @@ -1,4 +1,4 @@ export * from "./events"; export * from "./generics"; export * from "./local-storage"; -export * from "./pieces"; +export * from "./partials"; diff --git a/src/shared/types/partials.ts b/src/shared/types/partials.ts new file mode 100644 index 00000000..103c06e4 --- /dev/null +++ b/src/shared/types/partials.ts @@ -0,0 +1,14 @@ +export interface Source { + file: string, + name: string, + line: string, + file_excerpt?: boolean +} + +export interface Attachment { + id: string, + name: string, + size: number, + mime: string, + uri: string +} diff --git a/src/shared/types/pieces.ts b/src/shared/types/pieces.ts deleted file mode 100644 index 69e37f5a..00000000 --- a/src/shared/types/pieces.ts +++ /dev/null @@ -1,7 +0,0 @@ - -export interface Source { - file: string, - name: string, - line: string, - file_excerpt?: boolean -} diff --git a/components/SmtpAttachment/SmtpAttachment.stories.ts b/src/shared/ui/file-attachment/file-attachment.stories.ts similarity index 57% rename from components/SmtpAttachment/SmtpAttachment.stories.ts rename to src/shared/ui/file-attachment/file-attachment.stories.ts index 376799f6..c1a52b11 100644 --- a/components/SmtpAttachment/SmtpAttachment.stories.ts +++ b/src/shared/ui/file-attachment/file-attachment.stories.ts @@ -1,26 +1,26 @@ import {Meta, Story} from "@storybook/vue3"; -import SmtpAttachment from '~/components/SmtpAttachment/SmtpAttachment.vue'; +import FileAttachment from './file-attachment.vue'; export default { - title: "Components/Attachment", - component: SmtpAttachment -} as Meta; + title: "FSD/shared/FileAttachment", + component: FileAttachment +} as Meta; const Template: Story = (args) => ({ - components: {SmtpAttachment}, + components: {FileAttachment}, setup() { return { args, }; }, template: ` - `, + `, }); export const Default = Template.bind({}); Default.args = { - event: {id: 'cbdd3296-1e25-4191-9f52-0e2d7e7d6aae'}, + eventId: 'cbdd3296-1e25-4191-9f52-0e2d7e7d6aae', attachment: { id: 'cbdd3296-1e25-4191-9f52-0e2d7e7d6aae', name: 'attachment.txt', diff --git a/src/shared/ui/file-attachment/file-attachment.vue b/src/shared/ui/file-attachment/file-attachment.vue new file mode 100644 index 00000000..7df7a873 --- /dev/null +++ b/src/shared/ui/file-attachment/file-attachment.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/src/shared/ui/file-attachment/index.ts b/src/shared/ui/file-attachment/index.ts new file mode 100644 index 00000000..374a13a0 --- /dev/null +++ b/src/shared/ui/file-attachment/index.ts @@ -0,0 +1,3 @@ +import FileAttachment from "./file-attachment.vue"; + +export { FileAttachment }; diff --git a/src/shared/ui/index.ts b/src/shared/ui/index.ts index 31b677a2..6995d6ec 100644 --- a/src/shared/ui/index.ts +++ b/src/shared/ui/index.ts @@ -5,3 +5,7 @@ export * from './preview-card'; export * from './value-dump'; export * from './code-snippet'; export * from './stat-board'; +export * from './file-attachment'; + +export class FileAttachmnet { +} From edd570e88d4243771e5e5899347713ac645294a0 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 4 Nov 2023 23:08:17 +0400 Subject: [PATCH 42/72] move inspector-preview and normalizer to new file structure --- .../InspectorPage/InspectorPage.stories.ts | 4 +- components/InspectorPage/InspectorPage.vue | 2 +- .../InspectorPageTimeline.stories.ts | 4 +- .../InspectorPreview.stories.ts | 25 -------- .../InspectorPreview/InspectorPreview.vue | 44 -------------- .../PreviewEventMapper/PreviewEventMapper.vue | 9 ++- src/entities/inspector/index.ts | 2 + src/entities/inspector/lib/index.ts | 2 + .../lib/normalize-inspector-event.ts | 17 ++++++ src/entities/inspector/lib/use-inspector.ts | 11 ++++ src/entities/inspector/types.ts | 60 +++++++++++++++++++ src/entities/inspector/ui/index.ts | 2 + .../ui/inspector-stat-board/index.ts | 3 + .../inspector-stat-board.stories.ts | 10 ++-- .../inspector-stat-board.vue | 57 +++++++++--------- .../inspector/ui/preview-card/index.ts | 3 + .../ui/preview-card/preview-card.stories.ts | 27 +++++++++ .../ui/preview-card/preview-card.vue | 35 +++++++++++ 18 files changed, 208 insertions(+), 109 deletions(-) delete mode 100644 components/InspectorPreview/InspectorPreview.stories.ts delete mode 100644 components/InspectorPreview/InspectorPreview.vue create mode 100644 src/entities/inspector/index.ts create mode 100644 src/entities/inspector/lib/index.ts create mode 100644 src/entities/inspector/lib/normalize-inspector-event.ts create mode 100644 src/entities/inspector/lib/use-inspector.ts create mode 100644 src/entities/inspector/types.ts create mode 100644 src/entities/inspector/ui/index.ts create mode 100644 src/entities/inspector/ui/inspector-stat-board/index.ts rename components/InspectorStatBoard/InspectorStatBoard.stories.ts => src/entities/inspector/ui/inspector-stat-board/inspector-stat-board.stories.ts (63%) rename components/InspectorStatBoard/InspectorStatBoard.vue => src/entities/inspector/ui/inspector-stat-board/inspector-stat-board.vue (63%) create mode 100644 src/entities/inspector/ui/preview-card/index.ts create mode 100644 src/entities/inspector/ui/preview-card/preview-card.stories.ts create mode 100644 src/entities/inspector/ui/preview-card/preview-card.vue diff --git a/components/InspectorPage/InspectorPage.stories.ts b/components/InspectorPage/InspectorPage.stories.ts index 377b7ab4..d030f798 100644 --- a/components/InspectorPage/InspectorPage.stories.ts +++ b/components/InspectorPage/InspectorPage.stories.ts @@ -1,7 +1,9 @@ import {Meta, Story} from "@storybook/vue3"; -import {normalizeInspectorEvent} from "~/utils/normalize-event"; import InspectorPage from '~/components/InspectorPage/InspectorPage.vue'; import { inspectorMock } from '~/src/entities/inspector/mocks' +import { useInspector } from "~/src/entities/inspector/lib"; + +const { normalizeInspectorEvent } = useInspector(); export default { title: "Inspector/Page/InspectorPage", diff --git a/components/InspectorPage/InspectorPage.vue b/components/InspectorPage/InspectorPage.vue index 8c81fc26..466d7894 100644 --- a/components/InspectorPage/InspectorPage.vue +++ b/components/InspectorPage/InspectorPage.vue @@ -54,7 +54,7 @@ import { defineComponent, PropType } from "vue"; import { InspectorTransaction, NormalizedEvent } from "~/config/types"; import moment from "moment/moment"; import InspectorPageTimeline from "~/components/InspectorPageTimeline/InspectorPageTimeline.vue"; -import InspectorStatBoard from "~/components/InspectorStatBoard/InspectorStatBoard.vue"; +import { InspectorStatBoard } from "~/src/entities/inspector"; import { TableBase, TableBaseRow } from "~/src/shared/ui"; export default defineComponent({ diff --git a/components/InspectorPageTimeline/InspectorPageTimeline.stories.ts b/components/InspectorPageTimeline/InspectorPageTimeline.stories.ts index 1c05b110..3375895e 100644 --- a/components/InspectorPageTimeline/InspectorPageTimeline.stories.ts +++ b/components/InspectorPageTimeline/InspectorPageTimeline.stories.ts @@ -1,7 +1,9 @@ import {Meta, Story} from "@storybook/vue3"; -import {normalizeInspectorEvent} from "~/utils/normalize-event"; import InspectorPageTimeline from '~/components/InspectorPageTimeline/InspectorPageTimeline.vue'; import { inspectorMock } from '~/src/entities/inspector/mocks' +import { useInspector } from "~/src/entities/inspector/lib"; + +const { normalizeInspectorEvent } = useInspector(); export default { title: "Inspector/Page/InspectorPageTimeline", diff --git a/components/InspectorPreview/InspectorPreview.stories.ts b/components/InspectorPreview/InspectorPreview.stories.ts deleted file mode 100644 index b1196ec0..00000000 --- a/components/InspectorPreview/InspectorPreview.stories.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import { normalizeInspectorEvent } from "~/utils/normalize-event"; -import InspectorPreview from '~/components/InspectorPreview/InspectorPreview.vue'; -import { inspectorMock } from '~/src/entities/inspector/mocks' - -export default { - title: "Inspector/Components/InspectorPreview", - component: InspectorPreview -} as Meta; - -const Template: Story = (args) => ({ - components: { InspectorPreview }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const Event = Template.bind({}); - -Event.args = { - event: normalizeInspectorEvent(inspectorMock), -}; diff --git a/components/InspectorPreview/InspectorPreview.vue b/components/InspectorPreview/InspectorPreview.vue deleted file mode 100644 index 9ec72acb..00000000 --- a/components/InspectorPreview/InspectorPreview.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - diff --git a/components/PreviewEventMapper/PreviewEventMapper.vue b/components/PreviewEventMapper/PreviewEventMapper.vue index f993c64c..8acb0e4c 100644 --- a/components/PreviewEventMapper/PreviewEventMapper.vue +++ b/components/PreviewEventMapper/PreviewEventMapper.vue @@ -12,13 +12,11 @@ import { } from "~/config/types"; import { EVENT_TYPES, ServerEvent } from "~/src/shared/types"; import { - normalizeInspectorEvent, normalizeHttpDumpEvent, normalizeFallbackEvent, normalizeRayDumpEvent, } from "~/utils/normalize-event"; import RayDumpPreview from "~/components/RayDumpPreview/RayDumpPreview.vue"; -import InspectorPreview from "~/components/InspectorPreview/InspectorPreview.vue"; import PreviewFallback from "~/components/PreviewFallback/PreviewFallback.vue"; import HttpDumpPreview from "~/components/HttpDumpPreview/HttpDumpPreview.vue"; import { @@ -35,12 +33,17 @@ import { } from "~/src/entities/var-dump"; import { useSentry, PreviewCard as PreviewSentry } from "~/src/entities/sentry"; import { useSmtp, PreviewCard as PreviewSMTP } from "~/src/entities/smtp"; +import { + useInspector, + PreviewCard as PreviewInspector, +} from "~/src/entities/inspector"; const { normalizeProfilerEvent } = useProfiler(); const { normalizeVarDumpEvent } = useVarDump(); const { normalizeMonologEvent } = useMonolog(); const { normalizeSentryEvent } = useSentry(); const { normalizeSmtpEvent } = useSmtp(); +const { normalizeInspectorEvent } = useInspector(); export default defineComponent({ props: { @@ -76,7 +79,7 @@ export default defineComponent({ [EVENT_TYPES.PROFILER]: (event: ServerEvent) => h(PreviewProfiler, { event: normalizeProfilerEvent(event) }), [EVENT_TYPES.INSPECTOR]: (event: ServerEvent) => - h(InspectorPreview, { event: normalizeInspectorEvent(event) }), + h(PreviewInspector, { event: normalizeInspectorEvent(event) }), [EVENT_TYPES.HTTP_DUMP]: (event: ServerEvent) => h(HttpDumpPreview, { event: normalizeHttpDumpEvent(event) }), }; diff --git a/src/entities/inspector/index.ts b/src/entities/inspector/index.ts new file mode 100644 index 00000000..2d99edf3 --- /dev/null +++ b/src/entities/inspector/index.ts @@ -0,0 +1,2 @@ +export * from './ui'; +export * from './lib'; diff --git a/src/entities/inspector/lib/index.ts b/src/entities/inspector/lib/index.ts new file mode 100644 index 00000000..1cbc08e2 --- /dev/null +++ b/src/entities/inspector/lib/index.ts @@ -0,0 +1,2 @@ +export * from "./use-inspector"; + diff --git a/src/entities/inspector/lib/normalize-inspector-event.ts b/src/entities/inspector/lib/normalize-inspector-event.ts new file mode 100644 index 00000000..1b3841a7 --- /dev/null +++ b/src/entities/inspector/lib/normalize-inspector-event.ts @@ -0,0 +1,17 @@ +import { InspectorTransaction } from "~/config/types"; +import { EVENT_TYPES, ServerEvent, NormalizedEvent } from "~/src/shared/types"; +import { Inspector } from "../types"; + +export const normalizeInspectorEvent = (event: ServerEvent): NormalizedEvent => { + const transaction = event.payload[0] as InspectorTransaction; + + return { + id: event.uuid, + type: EVENT_TYPES.INSPECTOR, + labels: [EVENT_TYPES.INSPECTOR], + origin: {name: transaction.host.hostname, ip: transaction.host.ip, os: transaction.host.os}, + serverName: transaction.host.hostname, + date: event.timestamp ? new Date(event.timestamp * 1000) : null, + payload: event.payload + } +} diff --git a/src/entities/inspector/lib/use-inspector.ts b/src/entities/inspector/lib/use-inspector.ts new file mode 100644 index 00000000..1dcdbace --- /dev/null +++ b/src/entities/inspector/lib/use-inspector.ts @@ -0,0 +1,11 @@ +import { ServerEvent, NormalizedEvent } from '~/src/shared/types'; +import { Inspector } from "../types"; +import { normalizeInspectorEvent } from "./normalize-inspector-event"; + +type TUseInspector = () => { + normalizeInspectorEvent: (event: ServerEvent) => NormalizedEvent +} + +export const useInspector: TUseInspector = () => ({ + normalizeInspectorEvent +}) diff --git a/src/entities/inspector/types.ts b/src/entities/inspector/types.ts new file mode 100644 index 00000000..a310e238 --- /dev/null +++ b/src/entities/inspector/types.ts @@ -0,0 +1,60 @@ +export interface InspectorTransaction { + model: string, + name?: string, + type: string, + hash?: string, + host: { + hostname: string, + ip: string + os: string, + }, + http?: { + request: { + method: string, + version: string, + socket: { + remote_address: string, + [key: string]: string + }, + cookies: { + [key: string]: string + }, + headers: { + [key: string]: string + } + }, + url: { + protocol: string, + port: number | string, + path: string, + search: string, + full: string, + }, + }, + result?: string, + timestamp: number, + memory_peak?: number, + duration: number, +} + +export interface InspectorSegment { + model: string, + type: string, + label?: string, + host: { + hostname: string, + ip: string + os: string, + }, + transaction?: { + name: string, + timestamp: number, + }, + start?: number, + timestamp: number, + context: object + duration: number, + name?: string, +} + +export type Inspector = InspectorTransaction[] | InspectorSegment[]; diff --git a/src/entities/inspector/ui/index.ts b/src/entities/inspector/ui/index.ts new file mode 100644 index 00000000..b06bf0eb --- /dev/null +++ b/src/entities/inspector/ui/index.ts @@ -0,0 +1,2 @@ +export * from './preview-card'; +export * from './inspector-stat-board'; diff --git a/src/entities/inspector/ui/inspector-stat-board/index.ts b/src/entities/inspector/ui/inspector-stat-board/index.ts new file mode 100644 index 00000000..90231bfe --- /dev/null +++ b/src/entities/inspector/ui/inspector-stat-board/index.ts @@ -0,0 +1,3 @@ +import InspectorStatBoard from './inspector-stat-board.vue' + +export { InspectorStatBoard }; diff --git a/components/InspectorStatBoard/InspectorStatBoard.stories.ts b/src/entities/inspector/ui/inspector-stat-board/inspector-stat-board.stories.ts similarity index 63% rename from components/InspectorStatBoard/InspectorStatBoard.stories.ts rename to src/entities/inspector/ui/inspector-stat-board/inspector-stat-board.stories.ts index 77f7fb5e..d41f8335 100644 --- a/components/InspectorStatBoard/InspectorStatBoard.stories.ts +++ b/src/entities/inspector/ui/inspector-stat-board/inspector-stat-board.stories.ts @@ -1,10 +1,12 @@ import {Meta, Story} from "@storybook/vue3"; -import {normalizeInspectorEvent} from "~/utils/normalize-event"; -import InspectorStatBoard from '~/components/InspectorStatBoard/InspectorStatBoard.vue'; -import { inspectorMock } from '~/src/entities/inspector/mocks' +import { useInspector } from "../../lib"; +import { inspectorMock } from '../../mocks' +import InspectorStatBoard from './inspector-stat-board.vue'; + +const { normalizeInspectorEvent } = useInspector(); export default { - title: "Inspector/Components/InspectorStatBoard", + title: "FSD/entities/inspector/InspectorStatBoard", component: InspectorStatBoard } as Meta; diff --git a/components/InspectorStatBoard/InspectorStatBoard.vue b/src/entities/inspector/ui/inspector-stat-board/inspector-stat-board.vue similarity index 63% rename from components/InspectorStatBoard/InspectorStatBoard.vue rename to src/entities/inspector/ui/inspector-stat-board/inspector-stat-board.vue index 2a586c95..99f94fb0 100644 --- a/components/InspectorStatBoard/InspectorStatBoard.vue +++ b/src/entities/inspector/ui/inspector-stat-board/inspector-stat-board.vue @@ -1,17 +1,38 @@ + + - - From c6cc708d523a938b7dd742b4d6d2d8ad50a0d04b Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Mon, 6 Nov 2023 22:58:57 +0400 Subject: [PATCH 43/72] move http-dump entity to new structure --- .../HttpDumpPage/HttpDumpPage.stories.ts | 4 +- .../HttpDumpPreview.stories.ts | 25 --------- .../HttpDumpPreview/HttpDumpPreview.vue | 54 ------------------- .../PreviewEventMapper/PreviewEventMapper.vue | 9 ++-- pages/http-dumps/[id].vue | 4 +- src/entities/http-dump/index.ts | 2 + src/entities/http-dump/lib/index.ts | 2 + .../lib/normalize-http-dump-event.ts | 14 +++++ src/entities/http-dump/lib/use-http-dump.ts | 11 ++++ src/entities/http-dump/types.ts | 28 ++++++++++ src/entities/http-dump/ui/index.ts | 1 + .../http-dump/ui/preview-card/index.ts | 3 ++ .../ui/preview-card/preview-card.stories.ts | 27 ++++++++++ .../ui/preview-card/preview-card.vue | 45 ++++++++++++++++ utils/normalize-event.ts | 10 ---- 15 files changed, 145 insertions(+), 94 deletions(-) delete mode 100644 components/HttpDumpPreview/HttpDumpPreview.stories.ts delete mode 100644 components/HttpDumpPreview/HttpDumpPreview.vue create mode 100644 src/entities/http-dump/index.ts create mode 100644 src/entities/http-dump/lib/index.ts create mode 100644 src/entities/http-dump/lib/normalize-http-dump-event.ts create mode 100644 src/entities/http-dump/lib/use-http-dump.ts create mode 100644 src/entities/http-dump/types.ts create mode 100644 src/entities/http-dump/ui/index.ts create mode 100644 src/entities/http-dump/ui/preview-card/index.ts create mode 100644 src/entities/http-dump/ui/preview-card/preview-card.stories.ts create mode 100644 src/entities/http-dump/ui/preview-card/preview-card.vue diff --git a/components/HttpDumpPage/HttpDumpPage.stories.ts b/components/HttpDumpPage/HttpDumpPage.stories.ts index 09bd1db0..ee6db175 100644 --- a/components/HttpDumpPage/HttpDumpPage.stories.ts +++ b/components/HttpDumpPage/HttpDumpPage.stories.ts @@ -1,7 +1,9 @@ import { Meta, Story } from "@storybook/vue3"; -import { normalizeHttpDumpEvent } from "~/utils/normalize-event"; import HttpDumpPage from "~/components/HttpDumpPage/HttpDumpPage.vue"; import { httpDumpMock, httpDumpPdfMock } from '~/src/entities/http-dump/mocks'; +import { useHttpDump } from '~/src/entities/http-dump'; + +const { normalizeHttpDumpEvent } = useHttpDump(); export default { title: "HttpDump/Page/HttpDumpPage", diff --git a/components/HttpDumpPreview/HttpDumpPreview.stories.ts b/components/HttpDumpPreview/HttpDumpPreview.stories.ts deleted file mode 100644 index 69b936db..00000000 --- a/components/HttpDumpPreview/HttpDumpPreview.stories.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import { normalizeHttpDumpEvent } from "~/utils/normalize-event"; -import HttpDumpPreview from '~/components/HttpDumpPreview/HttpDumpPreview.vue'; -import { httpDumpMock } from '~/src/entities/http-dump/mocks'; - -export default { - title: "HttpDump/Components/HttpDumpPreview", - component: HttpDumpPreview -} as Meta; - -const Template: Story = (args) => ({ - components: { HttpDumpPreview }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const Event = Template.bind({}); - -Event.args = { - event: normalizeHttpDumpEvent(httpDumpMock), -}; diff --git a/components/HttpDumpPreview/HttpDumpPreview.vue b/components/HttpDumpPreview/HttpDumpPreview.vue deleted file mode 100644 index 019ecda2..00000000 --- a/components/HttpDumpPreview/HttpDumpPreview.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - - - diff --git a/components/PreviewEventMapper/PreviewEventMapper.vue b/components/PreviewEventMapper/PreviewEventMapper.vue index 8acb0e4c..a4c491fa 100644 --- a/components/PreviewEventMapper/PreviewEventMapper.vue +++ b/components/PreviewEventMapper/PreviewEventMapper.vue @@ -12,13 +12,11 @@ import { } from "~/config/types"; import { EVENT_TYPES, ServerEvent } from "~/src/shared/types"; import { - normalizeHttpDumpEvent, normalizeFallbackEvent, normalizeRayDumpEvent, } from "~/utils/normalize-event"; import RayDumpPreview from "~/components/RayDumpPreview/RayDumpPreview.vue"; import PreviewFallback from "~/components/PreviewFallback/PreviewFallback.vue"; -import HttpDumpPreview from "~/components/HttpDumpPreview/HttpDumpPreview.vue"; import { useProfiler, PreviewCard as PreviewProfiler, @@ -37,6 +35,10 @@ import { useInspector, PreviewCard as PreviewInspector, } from "~/src/entities/inspector"; +import { + useHttpDump, + PreviewCard as PreviewHttpDump, +} from "~/src/entities/http-dump"; const { normalizeProfilerEvent } = useProfiler(); const { normalizeVarDumpEvent } = useVarDump(); @@ -44,6 +46,7 @@ const { normalizeMonologEvent } = useMonolog(); const { normalizeSentryEvent } = useSentry(); const { normalizeSmtpEvent } = useSmtp(); const { normalizeInspectorEvent } = useInspector(); +const { normalizeHttpDumpEvent } = useHttpDump(); export default defineComponent({ props: { @@ -81,7 +84,7 @@ export default defineComponent({ [EVENT_TYPES.INSPECTOR]: (event: ServerEvent) => h(PreviewInspector, { event: normalizeInspectorEvent(event) }), [EVENT_TYPES.HTTP_DUMP]: (event: ServerEvent) => - h(HttpDumpPreview, { event: normalizeHttpDumpEvent(event) }), + h(PreviewHttpDump, { event: normalizeHttpDumpEvent(event) }), }; if (Object.values(EVENT_TYPES).includes(this.event.type)) { diff --git a/pages/http-dumps/[id].vue b/pages/http-dumps/[id].vue index 8c27cd82..960dc994 100644 --- a/pages/http-dumps/[id].vue +++ b/pages/http-dumps/[id].vue @@ -26,9 +26,11 @@ import { defineComponent } from "vue"; import { EventId } from "~/src/shared/types"; import { useFetch, useNuxtApp, useRoute, useRouter } from "#app"; -import { normalizeHttpDumpEvent } from "~/utils/normalize-event"; import HttpDumpPage from "~/components/HttpDumpPage/HttpDumpPage.vue"; import { PageHeader } from "~/src/widgets/ui"; +import { useHttpDump } from "~/src/entities/http-dump"; + +const { normalizeHttpDumpEvent } = useHttpDump(); export default defineComponent({ components: { HttpDumpPage, PageHeader }, diff --git a/src/entities/http-dump/index.ts b/src/entities/http-dump/index.ts new file mode 100644 index 00000000..03a8d531 --- /dev/null +++ b/src/entities/http-dump/index.ts @@ -0,0 +1,2 @@ +export * from './lib'; +export * from './ui'; diff --git a/src/entities/http-dump/lib/index.ts b/src/entities/http-dump/lib/index.ts new file mode 100644 index 00000000..f596f51d --- /dev/null +++ b/src/entities/http-dump/lib/index.ts @@ -0,0 +1,2 @@ +export * from "./use-http-dump"; + diff --git a/src/entities/http-dump/lib/normalize-http-dump-event.ts b/src/entities/http-dump/lib/normalize-http-dump-event.ts new file mode 100644 index 00000000..628fda40 --- /dev/null +++ b/src/entities/http-dump/lib/normalize-http-dump-event.ts @@ -0,0 +1,14 @@ +import { EVENT_TYPES, ServerEvent, NormalizedEvent } from "~/src/shared/types"; +import { HttpDump } from "../types"; + +export const normalizeHttpDumpEvent = (event: ServerEvent): NormalizedEvent => ({ + id: event.uuid, + type: EVENT_TYPES.HTTP_DUMP, + labels: [EVENT_TYPES.HTTP_DUMP], + origin: {uri: event.payload.request.uri}, + serverName: event.payload.host, + date: event.timestamp ? new Date(event.timestamp * 1000) : null, + payload: event.payload +}) + + diff --git a/src/entities/http-dump/lib/use-http-dump.ts b/src/entities/http-dump/lib/use-http-dump.ts new file mode 100644 index 00000000..d1c14817 --- /dev/null +++ b/src/entities/http-dump/lib/use-http-dump.ts @@ -0,0 +1,11 @@ +import { ServerEvent, NormalizedEvent } from '~/src/shared/types'; +import { HttpDump } from "../types"; +import { normalizeHttpDumpEvent } from "./normalize-http-dump-event"; + +type TUseInspector = () => { + normalizeHttpDumpEvent: (event: ServerEvent) => NormalizedEvent +} + +export const useHttpDump: TUseInspector = () => ({ + normalizeHttpDumpEvent +}) diff --git a/src/entities/http-dump/types.ts b/src/entities/http-dump/types.ts new file mode 100644 index 00000000..411f8b1b --- /dev/null +++ b/src/entities/http-dump/types.ts @@ -0,0 +1,28 @@ + +export interface HttpDumpFile { + originalName?: string, + mime: string, + size: number, + id: string; + name?: string; + uri?: string +} + +export interface HttpDump { + received_at: string, + host: string, + request: { + method: string, + uri: string, + headers: { + [key: string]: string[] + }, + body: string, + query: any, // eslint-disable-line @typescript-eslint/no-explicit-any + post: any, // eslint-disable-line @typescript-eslint/no-explicit-any + cookies: { + [key: string]: string + }, + files: HttpDumpFile[] + } +} diff --git a/src/entities/http-dump/ui/index.ts b/src/entities/http-dump/ui/index.ts new file mode 100644 index 00000000..52b27d6b --- /dev/null +++ b/src/entities/http-dump/ui/index.ts @@ -0,0 +1 @@ +export * from './preview-card'; diff --git a/src/entities/http-dump/ui/preview-card/index.ts b/src/entities/http-dump/ui/preview-card/index.ts new file mode 100644 index 00000000..7f59f151 --- /dev/null +++ b/src/entities/http-dump/ui/preview-card/index.ts @@ -0,0 +1,3 @@ +import PreviewCard from './preview-card.vue'; + +export { PreviewCard }; diff --git a/src/entities/http-dump/ui/preview-card/preview-card.stories.ts b/src/entities/http-dump/ui/preview-card/preview-card.stories.ts new file mode 100644 index 00000000..4b358348 --- /dev/null +++ b/src/entities/http-dump/ui/preview-card/preview-card.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useHttpDump } from "../../lib"; +import { httpDumpMock } from '../../mocks'; +import PreviewCard from './preview-card.vue'; + +const { normalizeHttpDumpEvent } = useHttpDump(); + +export default { + title: "FSD/entities/http-dump/PreviewCard", + component: PreviewCard +} as Meta; + +const Template: Story = (args) => ({ + components: { PreviewCard }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Event = Template.bind({}); + +Event.args = { + event: normalizeHttpDumpEvent(httpDumpMock), +}; diff --git a/src/entities/http-dump/ui/preview-card/preview-card.vue b/src/entities/http-dump/ui/preview-card/preview-card.vue new file mode 100644 index 00000000..31586a63 --- /dev/null +++ b/src/entities/http-dump/ui/preview-card/preview-card.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/utils/normalize-event.ts b/utils/normalize-event.ts index e6d5c289..783fdb78 100644 --- a/utils/normalize-event.ts +++ b/utils/normalize-event.ts @@ -33,16 +33,6 @@ export const normalizeInspectorEvent = (event: ServerEvent): Normaliz } } -export const normalizeHttpDumpEvent = (event: ServerEvent): NormalizedEvent => ({ - id: event.uuid, - type: EVENT_TYPES.HTTP_DUMP, - labels: [EVENT_TYPES.HTTP_DUMP], - origin: {uri: event.payload.request.uri}, - serverName: event.payload.host, - date: new Date(event.timestamp * 1000), - payload: event.payload -}) - export const normalizeRayDumpEvent = (event: ServerEvent): NormalizedEvent => { const labels = event.payload.payloads .filter(payload => payload.type === 'label') From 088bfdb12b647b3302de4d2197f591e8f256b782 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Tue, 7 Nov 2023 00:11:04 +0400 Subject: [PATCH 44/72] move event mapper to new file structure --- .../PreviewEventMapper/PreviewEventMapper.vue | 101 ------------------ config/types.ts | 2 +- pages/index.vue | 7 +- src/entities/ray/types.ts | 87 +++++++++++++++ src/shared/types/events.ts | 2 +- .../ui/event-card/event-card.stories.ts | 30 +++--- src/widgets/ui/event-card/event-card.vue | 97 +++++++++++++++++ src/widgets/ui/event-card/index.ts | 3 + src/widgets/ui/index.ts | 1 + 9 files changed, 208 insertions(+), 122 deletions(-) delete mode 100644 components/PreviewEventMapper/PreviewEventMapper.vue create mode 100644 src/entities/ray/types.ts rename components/PreviewEventMapper/PreviewEventMapper.stories.ts => src/widgets/ui/event-card/event-card.stories.ts (80%) create mode 100644 src/widgets/ui/event-card/event-card.vue create mode 100644 src/widgets/ui/event-card/index.ts diff --git a/components/PreviewEventMapper/PreviewEventMapper.vue b/components/PreviewEventMapper/PreviewEventMapper.vue deleted file mode 100644 index a4c491fa..00000000 --- a/components/PreviewEventMapper/PreviewEventMapper.vue +++ /dev/null @@ -1,101 +0,0 @@ - diff --git a/config/types.ts b/config/types.ts index a55e1909..730d2eae 100644 --- a/config/types.ts +++ b/config/types.ts @@ -5,7 +5,7 @@ export type Email = string; // TODO: update type type SMTPUser = { name: string; - Email: Email; + email: Email; } export interface Monolog { diff --git a/pages/index.vue b/pages/index.vue index c9c987a1..38fc24a5 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -32,7 +32,7 @@
- import { defineComponent } from "vue"; import PagePlaceholder from "~/components/PagePlaceholder/PagePlaceholder.vue"; -import { PageHeader } from "~/src/widgets/ui"; +import { PageHeader, EventCard } from "~/src/widgets/ui"; import { useNuxtApp } from "#app"; -import PreviewEventMapper from "~/components/PreviewEventMapper/PreviewEventMapper.vue"; import { PAGE_TYPES } from "~/src/shared/constants"; import pluralize from "pluralize"; import { EventType } from "~/src/shared/types"; @@ -59,7 +58,7 @@ import { EventType } from "~/src/shared/types"; export default defineComponent({ components: { PagePlaceholder, - PreviewEventMapper, + EventCard, PageHeader, }, setup() { diff --git a/src/entities/ray/types.ts b/src/entities/ray/types.ts new file mode 100644 index 00000000..23e4c451 --- /dev/null +++ b/src/entities/ray/types.ts @@ -0,0 +1,87 @@ + +interface RayContentFrame { + file_name: string, + line_number: number, + class: string | null, + method: string, + vendor_frame: boolean, + snippet?: { line_number: number, text: string }[] +} +export interface RayContent { + content: string, + label: string, +} + +export interface RayContentCarbone { + formatted: string, + timestamp: number, + timezone: string +} + +export interface RayContentArray { + values: string[] | number[] | boolean[] +} + +export interface RayContentException { + class?: string, + message?: string, + frames: RayContentFrame[] +} +export interface RayContentSQL { + sql: string, + bindings: string[], + connection_name: string + time: number +} +export interface RayContentEloquent { + class_name: string, + attributes: string +} +export interface RayContentViews { + view_path: string, + view_path_relative_to_project_root: string, + data: string +} +export interface RayContentJobs { + event_name: string, + job: string, + exception: string | null +} + + +export interface RayPayload { + type: string, + origin?: { + file: string, + line_number: number, + hostname: string, + }, + content: RayContentException + | RayContentArray + | RayContent + | RayContentCarbone + | RayContentSQL + | RayContentEloquent + | RayContentViews + | RayContentJobs + | { frame: RayContentFrame } + | { value: string } + | { color: string } + | { label: string } + | { name: string } + | { size: string } + | never[] +} + +export interface RayDump { + uuid: string, + payloads: RayPayload[], + meta?: { + php_version: string, + php_version_id: number, + project_name: string, + laravel_version: string, + laravel_ray_package_version: string, + ray_package_version: string, + } +} diff --git a/src/shared/types/events.ts b/src/shared/types/events.ts index 0f3bc9ac..60d6bc09 100644 --- a/src/shared/types/events.ts +++ b/src/shared/types/events.ts @@ -3,7 +3,7 @@ import { OneOfValues } from "./generics"; // TODO: add T prefix to all types export enum EVENT_TYPES { - VAR_DUMP= "var-dump", + VAR_DUMP = "var-dump", SMTP = "smtp", SENTRY = "sentry", PROFILER = "profiler", diff --git a/components/PreviewEventMapper/PreviewEventMapper.stories.ts b/src/widgets/ui/event-card/event-card.stories.ts similarity index 80% rename from components/PreviewEventMapper/PreviewEventMapper.stories.ts rename to src/widgets/ui/event-card/event-card.stories.ts index 78e8d47e..c458ad9e 100644 --- a/components/PreviewEventMapper/PreviewEventMapper.stories.ts +++ b/src/widgets/ui/event-card/event-card.stories.ts @@ -1,26 +1,26 @@ import { Meta, Story } from "@storybook/vue3"; -import PreviewEventMapper from "~/components/PreviewEventMapper/PreviewEventMapper.vue"; -import { varDumpObjectMock } from "~/src/entities/var-dump/mocks"; -import { profilerMock } from "~/src/entities/profiler/mocks"; -import { monologMock } from '~/src/entities/monolog/mocks'; -import { inspectorMock } from '~/src/entities/inspector/mocks'; -import { smtpWelcomeMock } from '~/src/entities/smtp/mocks'; import { httpDumpMock } from '~/src/entities/http-dump/mocks'; +import { inspectorMock } from '~/src/entities/inspector/mocks'; +import { monologMock } from '~/src/entities/monolog/mocks'; +import { profilerMock } from "~/src/entities/profiler/mocks"; import { sentrySpiralMock } from '~/src/entities/sentry/mocks'; +import { smtpWelcomeMock } from '~/src/entities/smtp/mocks'; +import { varDumpObjectMock } from "~/src/entities/var-dump/mocks"; +import PreviewCard from "./event-card.vue"; export default { - title: "Preview/PreviewEventMapper", - component: PreviewEventMapper, -} as Meta; + title: "FSD/widgets/PreviewCard", + component: PreviewCard, +} as Meta; const Template: Story = (args) => ({ - components: { PreviewEventMapper }, + components: { PreviewCard }, setup() { return { args, }; }, - template: ``, + template: ``, }); export const Default = Template.bind({}); @@ -81,14 +81,14 @@ const eventsList = [ ]; const TemplateList: Story = (args) => ({ - components: { PreviewEventMapper }, + components: { PreviewCard }, setup() { return { args, eventsList, }; }, - template: ``, + template: ``, }); export const EventsList = TemplateList.bind({}); @@ -98,7 +98,7 @@ EventsList.args = { }; const TemplateListVirtual: Story = (args) => ({ - components: { PreviewEventMapper }, + components: { PreviewCard }, setup() { return { args, @@ -114,7 +114,7 @@ const TemplateListVirtual: Story = (args) => ({ }, template: ` `, }); diff --git a/src/widgets/ui/event-card/event-card.vue b/src/widgets/ui/event-card/event-card.vue new file mode 100644 index 00000000..92092cb3 --- /dev/null +++ b/src/widgets/ui/event-card/event-card.vue @@ -0,0 +1,97 @@ + + + diff --git a/src/widgets/ui/event-card/index.ts b/src/widgets/ui/event-card/index.ts new file mode 100644 index 00000000..60328a0b --- /dev/null +++ b/src/widgets/ui/event-card/index.ts @@ -0,0 +1,3 @@ +import EventCard from './event-card.vue' + +export { EventCard }; diff --git a/src/widgets/ui/index.ts b/src/widgets/ui/index.ts index 851b8f36..6370f1ed 100644 --- a/src/widgets/ui/index.ts +++ b/src/widgets/ui/index.ts @@ -1,2 +1,3 @@ export * from './render-graph'; export * from './page-header'; +export * from './event-card'; From 3ff66f7d4844b83c1e8daf91e5820f9cde60ece9 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Tue, 7 Nov 2023 00:41:10 +0400 Subject: [PATCH 45/72] fix preview-card optimisation --- src/shared/ui/preview-card/preview-card-header.vue | 2 -- src/shared/ui/preview-card/preview-card.vue | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/shared/ui/preview-card/preview-card-header.vue b/src/shared/ui/preview-card/preview-card-header.vue index 482a1dda..9c080d78 100644 --- a/src/shared/ui/preview-card/preview-card-header.vue +++ b/src/shared/ui/preview-card/preview-card-header.vue @@ -22,8 +22,6 @@ type Emits = { const props = withDefaults(defineProps(), { tags: () => [], eventUrl: "", - isOpen: true, - isVisibleControls: true, }); const emit = defineEmits(); diff --git a/src/shared/ui/preview-card/preview-card.vue b/src/shared/ui/preview-card/preview-card.vue index b80e0ab5..ad15d43a 100644 --- a/src/shared/ui/preview-card/preview-card.vue +++ b/src/shared/ui/preview-card/preview-card.vue @@ -90,12 +90,13 @@ const optimiseRenderHidden = debounce(() => { if (eventRef.value) { const eventNode = eventRef.value as HTMLElement; const { top, height } = eventNode.getBoundingClientRect(); + const extraDelta = height; const isVisible = top - extraDelta <= window.innerHeight && top + height + extraDelta * 2 >= 0; - if (!isVisible && isOptimized.value) { + if (!isVisible && !isOptimized.value) { isOptimized.value = true; eventNode.style.height = `${eventNode.clientHeight}px`; } else if (isVisible && isOptimized.value) { From 63136ed22df4df95f04489dc9364b38631b8ddf1 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 11 Nov 2023 01:20:12 +0400 Subject: [PATCH 46/72] move sentry page to the new structure --- components/SentryPage/SentryPage.vue | 130 ---------------- config/types.ts | 106 +------------ pages/sentry/[id].vue | 2 +- src/entities/sentry/types.ts | 124 ++++++++------- src/screens/.gitkeep | 0 src/screens/sentry/index.ts | 2 + .../screens/sentry/sentry-page.stories.ts | 6 +- src/screens/sentry/sentry-page.vue | 147 ++++++++++++++++++ src/screens/sentry/ui/index.ts | 5 + .../sentry/ui/sentry-page-app/index.ts | 3 + .../sentry-page-app.stories.ts | 12 +- .../ui/sentry-page-app/sentry-page-app.vue | 41 ++--- .../ui/sentry-page-breadcrumbs/index.ts | 3 + .../sentry-page-breadcrumbs.stories.ts | 10 +- .../sentry-page-breadcrumbs.vue | 56 +++---- .../sentry/ui/sentry-page-device/index.ts | 3 + .../sentry-page-device.stories.ts | 14 +- .../sentry-page-device/sentry-page-device.vue | 77 ++++----- .../sentry/ui/sentry-page-request/index.ts | 3 + .../sentry-page-request.stories.ts | 10 +- .../sentry-page-request.vue | 53 +++---- .../sentry/ui/sentry-page-tags/index.ts | 3 + .../sentry-page-tags.stories.ts | 10 +- .../ui/sentry-page-tags/sentry-page-tags.vue | 75 +++++---- src/shared/ui/index.ts | 2 - 25 files changed, 394 insertions(+), 503 deletions(-) delete mode 100644 components/SentryPage/SentryPage.vue delete mode 100644 src/screens/.gitkeep create mode 100644 src/screens/sentry/index.ts rename components/SentryPage/SentryPage.stories.ts => src/screens/sentry/sentry-page.stories.ts (90%) create mode 100644 src/screens/sentry/sentry-page.vue create mode 100644 src/screens/sentry/ui/index.ts create mode 100644 src/screens/sentry/ui/sentry-page-app/index.ts rename components/SentryPageApp/SentryPageApp.stories.ts => src/screens/sentry/ui/sentry-page-app/sentry-page-app.stories.ts (67%) rename components/SentryPageApp/SentryPageApp.vue => src/screens/sentry/ui/sentry-page-app/sentry-page-app.vue (70%) create mode 100644 src/screens/sentry/ui/sentry-page-breadcrumbs/index.ts rename components/SentryPageBreadcrumbs/SentryPageBreadcrumbs.stories.ts => src/screens/sentry/ui/sentry-page-breadcrumbs/sentry-page-breadcrumbs.stories.ts (68%) rename components/SentryPageBreadcrumbs/SentryPageBreadcrumbs.vue => src/screens/sentry/ui/sentry-page-breadcrumbs/sentry-page-breadcrumbs.vue (81%) create mode 100644 src/screens/sentry/ui/sentry-page-device/index.ts rename components/SentryPageDevice/SentryPageDevice.stories.ts => src/screens/sentry/ui/sentry-page-device/sentry-page-device.stories.ts (54%) rename components/SentryPageDevice/SentryPageDevice.vue => src/screens/sentry/ui/sentry-page-device/sentry-page-device.vue (76%) create mode 100644 src/screens/sentry/ui/sentry-page-request/index.ts rename components/SentryPageRequest/SentryPageRequest.stories.ts => src/screens/sentry/ui/sentry-page-request/sentry-page-request.stories.ts (69%) rename components/SentryPageRequest/SentryPageRequest.vue => src/screens/sentry/ui/sentry-page-request/sentry-page-request.vue (50%) create mode 100644 src/screens/sentry/ui/sentry-page-tags/index.ts rename components/SentryPageTags/SentryPageTags.stories.ts => src/screens/sentry/ui/sentry-page-tags/sentry-page-tags.stories.ts (72%) rename components/SentryPageTags/SentryPageTags.vue => src/screens/sentry/ui/sentry-page-tags/sentry-page-tags.vue (75%) diff --git a/components/SentryPage/SentryPage.vue b/components/SentryPage/SentryPage.vue deleted file mode 100644 index 64d5c91d..00000000 --- a/components/SentryPage/SentryPage.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - - - diff --git a/config/types.ts b/config/types.ts index 730d2eae..ad07aba6 100644 --- a/config/types.ts +++ b/config/types.ts @@ -1,4 +1,5 @@ import { EventId, EventType } from "~/src/shared/types"; +import { Sentry } from "~/src/entities/sentry/types"; export type StatusCode = number; // TODO: update type export type Email = string; // TODO: update type @@ -32,111 +33,6 @@ export interface SMTP { attachments: unknown[] } -// TODO: Cover all possible cases -// https://github.com/getsentry/sentry/tree/master/static/app/components/events/contexts - -export type SentryFrame = { - filename: string, - lineno: number, - in_app: boolean, - abs_path: string, - pre_context: string[], - context_line: string, - post_context: string[] -} - -export type SentryException = { - type: string, - value: string, - stacktrace: { - frames: SentryFrame[] - }, - [key: string]: unknown -} - -export interface Sentry { - event_id: string, - timestamp: number, - platform: string, - contexts: { - runtime: { - name: string, - version: string, - } | unknown, - os: { - name: string, - version: string, - } | unknown, - app: { - device_app_hash: string, - build_type: string, - app_identifier: string, - app_name: string, - app_version: string, - app_build: string, - app_id: string, - type: string, - } | unknown, - device: { - screen_resolution: string, - orientation: string, - family: string, - battery_level: number, - screen_dpi: number, - memory_size: number, - timezone: string, - external_storage_size: number, - external_free_storage: number, - screen_width_pixels: number, - low_memory: boolean, - simulator: boolean, - screen_height_pixels: number, - free_memory: number, - online: boolean, - screen_density: number, - type: string, - charging: boolean, - model_id: string, - brand: string, - storage_size: number, - boot_time: string, - arch: string, - manufacturer: string, - name: string, // redacted - free_storage: number, - model: string, - } | unknown, - }, - breadcrumbs: { - values: [{ - type: string, - category: string, - level: string, - timestamp: number, - message: string, - }] - } | unknown, - sdk: { - name: string, - version: string, - } | unknown, - logger: string, - server_name: string, - environment: string, - modules: object, - extra: unknown, - tags: object, - request: { - url: string, - method: string, - headers: object, - data: object, - }, - exception: { - values: SentryException[] - } -} - export interface VarDump { payload: { type: string, diff --git a/pages/sentry/[id].vue b/pages/sentry/[id].vue index 32b7a948..ca98dca9 100644 --- a/pages/sentry/[id].vue +++ b/pages/sentry/[id].vue @@ -24,7 +24,7 @@ import { defineComponent } from "vue"; import { EventId } from "~/src/shared/types"; import { useNuxtApp, useRoute, useRouter, useFetch } from "#app"; -import SentryPage from "~/components/SentryPage/SentryPage.vue"; +import { SentryPage } from "~/src/screens/sentry"; import { PageHeader } from "~/src/widgets/ui"; import { useSentry } from "~/src/entities/sentry"; diff --git a/src/entities/sentry/types.ts b/src/entities/sentry/types.ts index c83a0fd5..688bad49 100644 --- a/src/entities/sentry/types.ts +++ b/src/entities/sentry/types.ts @@ -25,6 +25,70 @@ export interface SentryVersion { kernel_version?: string, } +export type SentryDevice = { + screen_resolution: string, + orientation: string, + family: string, + battery_level: number, + screen_dpi: number, + memory_size: number, + timezone: string, + external_storage_size: number, + external_free_storage: number, + screen_width_pixels: number, + low_memory: boolean, + simulator: boolean, + screen_height_pixels: number, + free_memory: number, + online: boolean, + screen_density: number, + type: string, + charging: boolean, + model_id: string, + brand: string, + storage_size: number, + boot_time: string, + arch: string, + manufacturer: string, + name: string, // redacted + free_storage: number, + model: string, + language?: unknown, + id?: unknown, + battery_temperature?: unknown, + locale?: unknown, +} + +export type SentryBreadcrumb = { + type: string, + category: string, + level: string, + timestamp: number, + message: string, + data?: unknown, +} + +export type SentryApp = { + device_app_hash: string, + build_type: string, + app_identifier: string, + app_name: string, + app_version: string, + app_build: string, + app_id: string, + type: string, + permissions?: unknown, +} + +export type SentryRequest = { + url: string, + method?: string, + headers: object, + data?: object, +} + +// TODO: Cover all possible cases +// https://github.com/getsentry/sentry/tree/master/static/app/components/events/contexts export interface Sentry { event_id: string, timestamp: number, @@ -33,70 +97,22 @@ export interface Sentry { contexts: { runtime?: SentryVersion | unknown, os?: SentryVersion | unknown, - app?: { - device_app_hash: string, - build_type: string, - app_identifier: string, - app_name: string, - app_version: string, - app_build: string, - app_id: string, - type: string, - } | unknown, - device?: { - screen_resolution: string, - orientation: string, - family: string, - battery_level: number, - screen_dpi: number, - memory_size: number, - timezone: string, - external_storage_size: number, - external_free_storage: number, - screen_width_pixels: number, - low_memory: boolean, - simulator: boolean, - screen_height_pixels: number, - free_memory: number, - online: boolean, - screen_density: number, - type: string, - charging: boolean, - model_id: string, - brand: string, - storage_size: number, - boot_time: string, - arch: string, - manufacturer: string, - name: string, // redacted - free_storage: number, - model: string, - } | unknown, + app?: SentryApp | unknown, + device?: SentryDevice | unknown, trace?: Record, }, breadcrumbs?: { - values: [{ - type: string, - category: string, - level: string, - timestamp: number, - message: string, - }] - } | unknown, + values: SentryBreadcrumb[] + }, sdk: SentryVersion, logger?: string, transaction?: string, - server_name: string, + server_name?: string, environment: string, modules?: object, extra?: unknown, tags?: object, - request?: { - url: string, - method?: string, - headers: object, - data?: object, - }, + request?: SentryRequest, exception?: { values: SentryException[] } diff --git a/src/screens/.gitkeep b/src/screens/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/screens/sentry/index.ts b/src/screens/sentry/index.ts new file mode 100644 index 00000000..4de6c15b --- /dev/null +++ b/src/screens/sentry/index.ts @@ -0,0 +1,2 @@ +export * from './ui' +export { default as SentryPage } from './sentry-page.vue' diff --git a/components/SentryPage/SentryPage.stories.ts b/src/screens/sentry/sentry-page.stories.ts similarity index 90% rename from components/SentryPage/SentryPage.stories.ts rename to src/screens/sentry/sentry-page.stories.ts index b84ccba6..705a172c 100644 --- a/components/SentryPage/SentryPage.stories.ts +++ b/src/screens/sentry/sentry-page.stories.ts @@ -1,12 +1,12 @@ import { Meta, Story } from "@storybook/vue3"; -import SentryPage from '~/components/SentryPage/SentryPage.vue'; -import { sentryCommonMock, sentryMock, sentryJSMock, sentryJSEventMock } from '~/src/entities/sentry/mocks'; import { useSentry } from "~/src/entities/sentry"; +import { sentryCommonMock, sentryMock, sentryJSMock, sentryJSEventMock } from '~/src/entities/sentry/mocks'; +import SentryPage from './sentry-page.vue'; const { normalizeSentryEvent } = useSentry(); export default { - title: "Sentry/Page/SentryPage", + title: "FSD/screens/sentry/SentryPage", component: SentryPage } as Meta; diff --git a/src/screens/sentry/sentry-page.vue b/src/screens/sentry/sentry-page.vue new file mode 100644 index 00000000..84df29fd --- /dev/null +++ b/src/screens/sentry/sentry-page.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/src/screens/sentry/ui/index.ts b/src/screens/sentry/ui/index.ts new file mode 100644 index 00000000..1aef1814 --- /dev/null +++ b/src/screens/sentry/ui/index.ts @@ -0,0 +1,5 @@ +export * from './sentry-page-tags' +export * from './sentry-page-request' +export * from './sentry-page-device' +export * from './sentry-page-breadcrumbs' +export * from './sentry-page-app' diff --git a/src/screens/sentry/ui/sentry-page-app/index.ts b/src/screens/sentry/ui/sentry-page-app/index.ts new file mode 100644 index 00000000..ea16881e --- /dev/null +++ b/src/screens/sentry/ui/sentry-page-app/index.ts @@ -0,0 +1,3 @@ +import SentryPageApp from './sentry-page-app.vue' + +export { SentryPageApp } diff --git a/components/SentryPageApp/SentryPageApp.stories.ts b/src/screens/sentry/ui/sentry-page-app/sentry-page-app.stories.ts similarity index 67% rename from components/SentryPageApp/SentryPageApp.stories.ts rename to src/screens/sentry/ui/sentry-page-app/sentry-page-app.stories.ts index 98b74e6e..c07216de 100644 --- a/components/SentryPageApp/SentryPageApp.stories.ts +++ b/src/screens/sentry/ui/sentry-page-app/sentry-page-app.stories.ts @@ -1,12 +1,12 @@ import { Meta, Story } from "@storybook/vue3"; -import SentryPageApp from '~/components/SentryPageApp/SentryPageApp.vue'; -import { sentryCommonMock } from '~/src/entities/sentry/mocks'; import { useSentry } from "~/src/entities/sentry"; +import { sentryCommonMock } from '~/src/entities/sentry/mocks'; +import SentryPageApp from './sentry-page-app.vue'; const { normalizeSentryEvent } = useSentry(); export default { - title: "Sentry/Page/SentryPageApp", + title: "FSD/screens/sentry/SentryPageApp", component: SentryPageApp } as Meta; @@ -20,8 +20,8 @@ const Template: Story = (args) => ({ template: ``, }); -export const App = Template.bind({}); +export const Default = Template.bind({}); -App.args = { - event: normalizeSentryEvent(sentryCommonMock).payload, +Default.args = { + app: normalizeSentryEvent(sentryCommonMock).payload.contexts.app, }; diff --git a/components/SentryPageApp/SentryPageApp.vue b/src/screens/sentry/ui/sentry-page-app/sentry-page-app.vue similarity index 70% rename from components/SentryPageApp/SentryPageApp.vue rename to src/screens/sentry/ui/sentry-page-app/sentry-page-app.vue index 95337b6f..43c9753b 100644 --- a/components/SentryPageApp/SentryPageApp.vue +++ b/src/screens/sentry/ui/sentry-page-app/sentry-page-app.vue @@ -1,5 +1,16 @@ + + - - diff --git a/components/ProfilerPageCallGraph/ProfilerPageCallGraph.stories.ts b/components/ProfilerPageCallGraph/ProfilerPageCallGraph.stories.ts deleted file mode 100644 index a5f5a093..00000000 --- a/components/ProfilerPageCallGraph/ProfilerPageCallGraph.stories.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import ProfilerPageCallGraph from '~/components/ProfilerPageCallGraph/ProfilerPageCallGraph.vue'; -import { profilerMock } from "~/src/entities/profiler/mocks"; -import { useProfiler } from "~/src/entities/profiler/lib"; - -const { normalizeProfilerEvent } = useProfiler(); - -export default { - title: "Profiler/Page/ProfilerPageCallGraph", - component: ProfilerPageCallGraph -} as Meta; - -const Template: Story = (args) => ({ - components: { ProfilerPageCallGraph }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const CallGraph = Template.bind({}); - -CallGraph.args = { - event: normalizeProfilerEvent(profilerMock).payload, -}; diff --git a/components/ProfilerPageCallGraph/ProfilerPageCallGraph.vue b/components/ProfilerPageCallGraph/ProfilerPageCallGraph.vue deleted file mode 100644 index 0ae04537..00000000 --- a/components/ProfilerPageCallGraph/ProfilerPageCallGraph.vue +++ /dev/null @@ -1,182 +0,0 @@ - - - - - diff --git a/components/ProfilerPageCallStack/ProfilerPageCallStack.stories.ts b/components/ProfilerPageCallStack/ProfilerPageCallStack.stories.ts deleted file mode 100644 index 1e6fdd4d..00000000 --- a/components/ProfilerPageCallStack/ProfilerPageCallStack.stories.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import ProfilerPageCallStack from '~/components/ProfilerPageCallStack/ProfilerPageCallStack.vue'; -import { profilerMock } from "~/src/entities/profiler/mocks"; -import { useProfiler } from "~/src/entities/profiler/lib"; - -const { normalizeProfilerEvent } = useProfiler(); - -export default { - title: "Profiler/Page/ProfilerPageCallStack", - component: ProfilerPageCallStack -} as Meta; - -const Template: Story = (args) => ({ - components: { ProfilerPageCallStack }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const List = Template.bind({}); - -List.args = { - event: normalizeProfilerEvent(profilerMock).payload, -}; diff --git a/components/ProfilerPageCallStack/ProfilerPageCallStack.vue b/components/ProfilerPageCallStack/ProfilerPageCallStack.vue deleted file mode 100644 index 6cc425c5..00000000 --- a/components/ProfilerPageCallStack/ProfilerPageCallStack.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - diff --git a/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.stories.ts b/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.stories.ts deleted file mode 100644 index 0035e4c9..00000000 --- a/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.stories.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import ProfilerPageCallStackRow from '~/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.vue'; -import { profilerMock } from "~/src/entities/profiler/mocks"; -import { useProfiler } from '~/src/entities/profiler/lib'; - -const { normalizeProfilerEvent } = useProfiler(); - -export default { - title: "Profiler/Page/ProfilerPageCallStackRow", - component: ProfilerPageCallStackRow -} as Meta; - -const Template: Story = (args) => ({ - components: { ProfilerPageCallStackRow }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const Row = Template.bind({}); - -Row.args = { - edge: normalizeProfilerEvent(profilerMock).payload.edges.e5, -}; diff --git a/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.vue b/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.vue deleted file mode 100644 index 421d68c5..00000000 --- a/components/ProfilerPageCallStackRow/ProfilerPageCallStackRow.vue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - diff --git a/config/types.ts b/config/types.ts index cf74dad1..f75e9f7c 100644 --- a/config/types.ts +++ b/config/types.ts @@ -1,5 +1,6 @@ import { EventId, EventType } from "~/src/shared/types"; import { Sentry } from "~/src/entities/sentry/types"; +import { Profiler } from "~/src/entities/profiler/types"; export type StatusCode = number; // TODO: update type export type Email = string; // TODO: update type @@ -168,34 +169,6 @@ export interface HttpDump { } } -export interface ProfilerCost { - [key: string]: number, - "ct": number, - "wt": number, - "cpu": number, - "mu": number, - "pmu": number -} - -export interface ProfilerEdge { - caller: string | null, - callee: string, - cost: ProfilerCost -} - -export type ProfilerEdges = Record - -export interface Profiler { - tags: { - [key: string]: string | null | number - }, - app_name: string, - hostname: string, - date: number, - peaks: ProfilerCost, - edges: ProfilerEdges -} - export interface InspectorTransaction { model: string, name: string, @@ -267,9 +240,3 @@ export interface NormalizedEvent { payload: Monolog | SMTP | Sentry | VarDump | Profiler | Inspector | HttpDump | RayDump | unknown } - -export enum GraphTypes { - CPU = 'cpu' , - MEMORY_CHANGE = 'pmu', - MEMORY = 'mu' -} diff --git a/pages/profiler/[id].vue b/pages/profiler/[id].vue index 6c3248a9..9dff96be 100644 --- a/pages/profiler/[id].vue +++ b/pages/profiler/[id].vue @@ -26,7 +26,7 @@ import { defineComponent } from "vue"; import { EventId } from "~/src/shared/types"; import { useFetch, useNuxtApp, useRoute, useRouter } from "#app"; -import ProfilerPage from "~/components/ProfilerPage/ProfilerPage.vue"; +import { ProfilerPage } from "~/src/screens/profiler"; import { PageHeader } from "~/src/widgets/ui"; import { useProfiler } from "~/src/entities/profiler/lib"; diff --git a/src/screens/profiler/index.ts b/src/screens/profiler/index.ts new file mode 100644 index 00000000..ed584959 --- /dev/null +++ b/src/screens/profiler/index.ts @@ -0,0 +1 @@ +export * from './ui' diff --git a/src/screens/profiler/types.ts b/src/screens/profiler/types.ts new file mode 100644 index 00000000..792ca640 --- /dev/null +++ b/src/screens/profiler/types.ts @@ -0,0 +1,3 @@ +import { ProfilerEdge } from "~/src/entities/profiler/types"; + +export type CallStackHoverData = ProfilerEdge & { position: { x: number; y: number } } diff --git a/src/screens/profiler/ui/call-graph/call-graph.stories.ts b/src/screens/profiler/ui/call-graph/call-graph.stories.ts new file mode 100644 index 00000000..338a1957 --- /dev/null +++ b/src/screens/profiler/ui/call-graph/call-graph.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useProfiler } from "~/src/entities/profiler"; +import { profilerMock } from "~/src/entities/profiler/mocks"; +import CallGraph from './call-graph.vue'; + +const { normalizeProfilerEvent } = useProfiler(); + +export default { + title: "FSD/screens/profiler/CallGraph", + component: CallGraph +} as Meta; + +const Template: Story = (args) => ({ + components: { CallGraph }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); + +Default.args = { + payload: normalizeProfilerEvent(profilerMock).payload, +}; diff --git a/src/screens/profiler/ui/call-graph/call-graph.vue b/src/screens/profiler/ui/call-graph/call-graph.vue new file mode 100644 index 00000000..196f635a --- /dev/null +++ b/src/screens/profiler/ui/call-graph/call-graph.vue @@ -0,0 +1,164 @@ + + + + + diff --git a/src/screens/profiler/ui/call-graph/index.ts b/src/screens/profiler/ui/call-graph/index.ts new file mode 100644 index 00000000..6e7ffca0 --- /dev/null +++ b/src/screens/profiler/ui/call-graph/index.ts @@ -0,0 +1 @@ +export { default as CallGraph } from "./call-graph.vue"; diff --git a/src/screens/profiler/ui/call-stack-row/call-stack-row.stories.ts b/src/screens/profiler/ui/call-stack-row/call-stack-row.stories.ts new file mode 100644 index 00000000..45d76603 --- /dev/null +++ b/src/screens/profiler/ui/call-stack-row/call-stack-row.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useProfiler } from '~/src/entities/profiler'; +import { profilerMock } from "~/src/entities/profiler/mocks"; +import CallStackRow from './call-stack-row.vue'; + +const { normalizeProfilerEvent } = useProfiler(); + +export default { + title: "FSD/screens/profiler/CallStackRow", + component: CallStackRow +} as Meta; + +const Template: Story = (args) => ({ + components: { CallStackRow }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); + +Default.args = { + edge: normalizeProfilerEvent(profilerMock).payload.edges.e5, +}; diff --git a/src/screens/profiler/ui/call-stack-row/call-stack-row.vue b/src/screens/profiler/ui/call-stack-row/call-stack-row.vue new file mode 100644 index 00000000..989dcb59 --- /dev/null +++ b/src/screens/profiler/ui/call-stack-row/call-stack-row.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/src/screens/profiler/ui/call-stack-row/index.ts b/src/screens/profiler/ui/call-stack-row/index.ts new file mode 100644 index 00000000..e741c182 --- /dev/null +++ b/src/screens/profiler/ui/call-stack-row/index.ts @@ -0,0 +1 @@ +export { default as CallStackRow } from "./call-stack-row.vue"; diff --git a/src/screens/profiler/ui/call-stack/call-stack.stories.ts b/src/screens/profiler/ui/call-stack/call-stack.stories.ts new file mode 100644 index 00000000..20ae2fba --- /dev/null +++ b/src/screens/profiler/ui/call-stack/call-stack.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useProfiler } from "~/src/entities/profiler"; +import { profilerMock } from "~/src/entities/profiler/mocks"; +import CallStack from './call-stack.vue'; + +const { normalizeProfilerEvent } = useProfiler(); + +export default { + title: "FSD/screens/profiler/CallStack", + component: CallStack +} as Meta; + +const Template: Story = (args) => ({ + components: { CallStack }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); + +Default.args = { + payload: normalizeProfilerEvent(profilerMock).payload, +}; diff --git a/src/screens/profiler/ui/call-stack/call-stack.vue b/src/screens/profiler/ui/call-stack/call-stack.vue new file mode 100644 index 00000000..8651e1d8 --- /dev/null +++ b/src/screens/profiler/ui/call-stack/call-stack.vue @@ -0,0 +1,132 @@ + + + + + diff --git a/src/screens/profiler/ui/call-stack/index.ts b/src/screens/profiler/ui/call-stack/index.ts new file mode 100644 index 00000000..bfd5621e --- /dev/null +++ b/src/screens/profiler/ui/call-stack/index.ts @@ -0,0 +1 @@ +export { default as CallStack } from "./call-stack.vue"; diff --git a/src/screens/profiler/ui/call-stat-board/call-stat-board.stories.ts b/src/screens/profiler/ui/call-stat-board/call-stat-board.stories.ts new file mode 100644 index 00000000..dd1ea2b5 --- /dev/null +++ b/src/screens/profiler/ui/call-stat-board/call-stat-board.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useProfiler } from "~/src/entities/profiler"; +import { profilerMock } from "~/src/entities/profiler/mocks"; +import CallStatBoard from './call-stat-board.vue'; + +const { normalizeProfilerEvent } = useProfiler(); + +export default { + title: "FSD/screens/profiler/CallStatBoard", + component: CallStatBoard +} as Meta; + +const Template: Story = (args) => ({ + components: { CallStatBoard }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); + +Default.args = { + edge: normalizeProfilerEvent(profilerMock).payload.edges.e5 +}; diff --git a/src/screens/profiler/ui/call-stat-board/call-stat-board.vue b/src/screens/profiler/ui/call-stat-board/call-stat-board.vue new file mode 100644 index 00000000..6fc2a716 --- /dev/null +++ b/src/screens/profiler/ui/call-stat-board/call-stat-board.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/screens/profiler/ui/call-stat-board/index.ts b/src/screens/profiler/ui/call-stat-board/index.ts new file mode 100644 index 00000000..cbd3bd8e --- /dev/null +++ b/src/screens/profiler/ui/call-stat-board/index.ts @@ -0,0 +1 @@ +export { default as CallStatBoard } from './call-stat-board.vue' diff --git a/src/screens/profiler/ui/index.ts b/src/screens/profiler/ui/index.ts new file mode 100644 index 00000000..b4260e46 --- /dev/null +++ b/src/screens/profiler/ui/index.ts @@ -0,0 +1,5 @@ +export * from './call-stack-row' +export * from './call-stack' +export * from './call-graph' +export * from './call-stat-board' +export * from './profiler-page' diff --git a/src/screens/profiler/ui/profiler-page/index.ts b/src/screens/profiler/ui/profiler-page/index.ts new file mode 100644 index 00000000..7afc0d83 --- /dev/null +++ b/src/screens/profiler/ui/profiler-page/index.ts @@ -0,0 +1 @@ +export { default as ProfilerPage } from './profiler-page.vue' diff --git a/components/ProfilerPage/ProfilerPage.stories.ts b/src/screens/profiler/ui/profiler-page/profiler-page.stories.ts similarity index 75% rename from components/ProfilerPage/ProfilerPage.stories.ts rename to src/screens/profiler/ui/profiler-page/profiler-page.stories.ts index e8f7632c..c518b1a2 100644 --- a/components/ProfilerPage/ProfilerPage.stories.ts +++ b/src/screens/profiler/ui/profiler-page/profiler-page.stories.ts @@ -1,12 +1,12 @@ import { Meta, Story } from "@storybook/vue3"; -import ProfilerPage from '~/components/ProfilerPage/ProfilerPage.vue'; +import { useProfiler } from "~/src/entities/profiler"; import { profilerMock } from "~/src/entities/profiler/mocks"; -import { useProfiler } from "~/src/entities/profiler/lib"; +import ProfilerPage from './profiler-page.vue'; const { normalizeProfilerEvent } = useProfiler(); export default { - title: "Profiler/Page/ProfilerPage", + title: "FSD/screens/profiler/ProfilerPage", component: ProfilerPage } as Meta; diff --git a/src/screens/profiler/ui/profiler-page/profiler-page.vue b/src/screens/profiler/ui/profiler-page/profiler-page.vue new file mode 100644 index 00000000..717d0273 --- /dev/null +++ b/src/screens/profiler/ui/profiler-page/profiler-page.vue @@ -0,0 +1,150 @@ + + + + + diff --git a/src/shared/lib/cytoscape/prepare-data.ts b/src/shared/lib/cytoscape/prepare-data.ts index 2291f38a..6107a6c6 100644 --- a/src/shared/lib/cytoscape/prepare-data.ts +++ b/src/shared/lib/cytoscape/prepare-data.ts @@ -1,5 +1,7 @@ // TODO: need to move types to FSD structure -import { GraphTypes, ProfilerEdge, ProfilerEdges } from "~/config/types"; +// eslint-disable-next-line @conarti/feature-sliced/layers-slices +import { ProfilerEdge, ProfilerEdges } from "~/src/entities/profiler/types"; +import { GraphTypes } from "../../types"; import { useFormats } from "../formats"; import { TEdge, TNode } from "./types"; diff --git a/src/shared/lib/cytoscape/types.ts b/src/shared/lib/cytoscape/types.ts index d4fdbdd5..0145b3d1 100644 --- a/src/shared/lib/cytoscape/types.ts +++ b/src/shared/lib/cytoscape/types.ts @@ -1,4 +1,5 @@ -import { ProfilerCost } from "~/config/types"; +// eslint-disable-next-line @conarti/feature-sliced/layers-slices +import { ProfilerCost } from "~/src/entities/profiler/types"; export type TNode = { data: { diff --git a/src/shared/types/partials.ts b/src/shared/types/partials.ts index 103c06e4..7fb21bfc 100644 --- a/src/shared/types/partials.ts +++ b/src/shared/types/partials.ts @@ -12,3 +12,9 @@ export interface Attachment { mime: string, uri: string } + +export enum GraphTypes { + CPU = 'cpu' , + MEMORY_CHANGE = 'pmu', + MEMORY = 'mu' +} diff --git a/src/widgets/ui/render-graph/render-graph.stories.ts b/src/widgets/ui/render-graph/render-graph.stories.ts index 38c5e5df..59f94c81 100644 --- a/src/widgets/ui/render-graph/render-graph.stories.ts +++ b/src/widgets/ui/render-graph/render-graph.stories.ts @@ -1,7 +1,7 @@ import { Meta, Story } from "@storybook/vue3"; -import { GraphTypes } from "~/config/types"; import { profilerMock } from "~/src/entities/profiler/mocks"; import { useCytoscape } from "~/src/shared/lib/cytoscape"; +import { GraphTypes } from "~/src/shared/types"; import RenderGraph from './render-graph.vue'; const { buildData } = useCytoscape(); diff --git a/utils/flamegraph-builder.ts b/utils/flamegraph-builder.ts index 9f37d940..53378bb4 100644 --- a/utils/flamegraph-builder.ts +++ b/utils/flamegraph-builder.ts @@ -1,4 +1,4 @@ -import { ProfilerCost, ProfilerEdges } from "~/config/types"; +import { ProfilerCost, ProfilerEdges } from "~/src/entities/profiler/types"; import {FlameChartNode} from "flame-chart-js/dist/types"; type FlameChartData = FlameChartNode & { From 4e06faf96ea773a2543521d45e446eed0f46ca07 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Mon, 13 Nov 2023 22:00:23 +0400 Subject: [PATCH 52/72] move cytoscape lib to features --- src/features/.gitkeep | 0 src/{shared => features}/lib/cytoscape/config.ts | 0 src/{shared => features}/lib/cytoscape/index.ts | 0 src/{shared => features}/lib/cytoscape/inicialize.ts | 0 src/{shared => features}/lib/cytoscape/prepare-data.ts | 6 ++---- src/{shared => features}/lib/cytoscape/types.ts | 2 +- .../lib/cytoscape/use-cytoscape.ts | 0 src/screens/profiler/ui/call-graph/call-graph.vue | 8 +++----- src/widgets/ui/render-graph/index.ts | 5 ++--- src/widgets/ui/render-graph/render-graph.stories.ts | 10 +++++----- src/widgets/ui/render-graph/render-graph.vue | 4 ++-- src/widgets/ui/render-graph/types.ts | 0 src/widgets/ui/render-graph/use-render-graph.ts | 8 ++++++++ 13 files changed, 23 insertions(+), 20 deletions(-) delete mode 100644 src/features/.gitkeep rename src/{shared => features}/lib/cytoscape/config.ts (100%) rename src/{shared => features}/lib/cytoscape/index.ts (100%) rename src/{shared => features}/lib/cytoscape/inicialize.ts (100%) rename src/{shared => features}/lib/cytoscape/prepare-data.ts (91%) rename src/{shared => features}/lib/cytoscape/types.ts (83%) rename src/{shared => features}/lib/cytoscape/use-cytoscape.ts (100%) delete mode 100644 src/widgets/ui/render-graph/types.ts create mode 100644 src/widgets/ui/render-graph/use-render-graph.ts diff --git a/src/features/.gitkeep b/src/features/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/shared/lib/cytoscape/config.ts b/src/features/lib/cytoscape/config.ts similarity index 100% rename from src/shared/lib/cytoscape/config.ts rename to src/features/lib/cytoscape/config.ts diff --git a/src/shared/lib/cytoscape/index.ts b/src/features/lib/cytoscape/index.ts similarity index 100% rename from src/shared/lib/cytoscape/index.ts rename to src/features/lib/cytoscape/index.ts diff --git a/src/shared/lib/cytoscape/inicialize.ts b/src/features/lib/cytoscape/inicialize.ts similarity index 100% rename from src/shared/lib/cytoscape/inicialize.ts rename to src/features/lib/cytoscape/inicialize.ts diff --git a/src/shared/lib/cytoscape/prepare-data.ts b/src/features/lib/cytoscape/prepare-data.ts similarity index 91% rename from src/shared/lib/cytoscape/prepare-data.ts rename to src/features/lib/cytoscape/prepare-data.ts index 6107a6c6..0713d18a 100644 --- a/src/shared/lib/cytoscape/prepare-data.ts +++ b/src/features/lib/cytoscape/prepare-data.ts @@ -1,8 +1,6 @@ -// TODO: need to move types to FSD structure -// eslint-disable-next-line @conarti/feature-sliced/layers-slices import { ProfilerEdge, ProfilerEdges } from "~/src/entities/profiler/types"; -import { GraphTypes } from "../../types"; -import { useFormats } from "../formats"; +import { useFormats } from "~/src/shared/lib/formats"; +import { GraphTypes } from "~/src/shared/types"; import { TEdge, TNode } from "./types"; const { formatDuration, formatFileSize } = useFormats(); diff --git a/src/shared/lib/cytoscape/types.ts b/src/features/lib/cytoscape/types.ts similarity index 83% rename from src/shared/lib/cytoscape/types.ts rename to src/features/lib/cytoscape/types.ts index 0145b3d1..4fe94406 100644 --- a/src/shared/lib/cytoscape/types.ts +++ b/src/features/lib/cytoscape/types.ts @@ -1,4 +1,4 @@ -// eslint-disable-next-line @conarti/feature-sliced/layers-slices + import { ProfilerCost } from "~/src/entities/profiler/types"; export type TNode = { diff --git a/src/shared/lib/cytoscape/use-cytoscape.ts b/src/features/lib/cytoscape/use-cytoscape.ts similarity index 100% rename from src/shared/lib/cytoscape/use-cytoscape.ts rename to src/features/lib/cytoscape/use-cytoscape.ts diff --git a/src/screens/profiler/ui/call-graph/call-graph.vue b/src/screens/profiler/ui/call-graph/call-graph.vue index 196f635a..a8b236c1 100644 --- a/src/screens/profiler/ui/call-graph/call-graph.vue +++ b/src/screens/profiler/ui/call-graph/call-graph.vue @@ -1,14 +1,12 @@ - - diff --git a/src/features/lib/flame-chart/build.ts b/src/features/lib/flame-chart/build.ts new file mode 100644 index 00000000..09be9b45 --- /dev/null +++ b/src/features/lib/flame-chart/build.ts @@ -0,0 +1,62 @@ +import {FlameChartNode} from "flame-chart-js/dist/types"; +import { ProfilerCost, ProfilerEdge, ProfilerEdges } from "~/src/entities/profiler/types"; +import { GraphTypes } from "~/src/shared/types"; + +type FlameChartData = FlameChartNode & { + cost: ProfilerCost +} +export const build = (edges: ProfilerEdges, field: GraphTypes): FlameChartData => { + let walked = [] as ProfilerEdge['callee'][] + + const datum: Record = {} + + Object.values(edges).forEach((edge) => { + const parent = edge.caller + const target = edge.callee + + const duration = (edge.cost[String(field)] || 0) > 0 ? edge.cost[String(field)] / 1_000 : 0 + const start = 0 + + if (target && !datum[target]) { + datum[target] = { + name: target, + start, + duration, + cost: edge.cost, + children: [] + } + } + + if (parent && !datum[parent]) { + datum[parent] = { + name: parent, + start, + duration, + cost: edge.cost, + children: [] + } + } + + // NOTE: walked skips several targettions (recursion detected), should be fixed + if (!parent || walked.includes(target)) { + // console.log(node, target) + return + } + + if (datum[parent] && datum[parent].children) { + const parentChildren = datum[parent].children || [] + + const lastChild = parentChildren ? parentChildren[parentChildren.length - 1]: null + datum[target].start = lastChild ? lastChild.start + lastChild.duration : datum[target].start + } else { + datum[target].start += datum[parent].start + } + + datum[parent].children?.push(datum[target]) + walked.push(target) + }) + + walked = [] + + return datum['main()'] +} diff --git a/src/features/lib/flame-chart/index.ts b/src/features/lib/flame-chart/index.ts new file mode 100644 index 00000000..93781ea3 --- /dev/null +++ b/src/features/lib/flame-chart/index.ts @@ -0,0 +1 @@ +export * from './use-flame-chart'; diff --git a/src/features/lib/flame-chart/use-flame-chart.ts b/src/features/lib/flame-chart/use-flame-chart.ts new file mode 100644 index 00000000..acc027da --- /dev/null +++ b/src/features/lib/flame-chart/use-flame-chart.ts @@ -0,0 +1,6 @@ +import {build} from "./build"; + + +export const useFlameChart = () => ({ + build +}) diff --git a/src/screens/profiler/ui/call-stack/call-stack.vue b/src/screens/profiler/ui/call-stack/call-stack.vue index 8651e1d8..bd8e3939 100644 --- a/src/screens/profiler/ui/call-stack/call-stack.vue +++ b/src/screens/profiler/ui/call-stack/call-stack.vue @@ -11,7 +11,7 @@ type Props = { type Emits = { hover: [value: CallStackHoverData]; - hide: [value: boolean]; + hide: []; }; const props = defineProps(); diff --git a/components/ProfilePageFlamegraph/ProfilePageFlamegraph.stories.ts b/src/screens/profiler/ui/flame-graph/flame-graph.stories.ts similarity index 53% rename from components/ProfilePageFlamegraph/ProfilePageFlamegraph.stories.ts rename to src/screens/profiler/ui/flame-graph/flame-graph.stories.ts index 76c3c01a..933c8576 100644 --- a/components/ProfilePageFlamegraph/ProfilePageFlamegraph.stories.ts +++ b/src/screens/profiler/ui/flame-graph/flame-graph.stories.ts @@ -1,24 +1,24 @@ import {Meta, Story} from "@storybook/vue3"; -import { Profiler } from "~/src/entities/profiler/types"; -import ProfilePageFlamegraph from '~/components/ProfilePageFlamegraph/ProfilePageFlamegraph.vue'; +import { useProfiler } from "~/src/entities/profiler"; import { profilerMock } from "~/src/entities/profiler/mocks"; -import { useProfiler } from "~/src/entities/profiler/lib"; +import { Profiler } from "~/src/entities/profiler/types"; +import FlameGraph from './flame-graph.vue'; const { normalizeProfilerEvent } = useProfiler(); export default { - title: "Profiler/Page/ProfilePageFlamegraph", - component: ProfilePageFlamegraph -} as Meta; + title: "FSD/screens/profiler/FlameGraph", + component: FlameGraph +} as Meta; const Template: Story = (args) => ({ - components: {ProfilePageFlamegraph}, + components: {FlameGraph}, setup() { return { args, }; }, - template: ``, + template: ``, }); export const Default = Template.bind({}); diff --git a/src/screens/profiler/ui/flame-graph/flame-graph.vue b/src/screens/profiler/ui/flame-graph/flame-graph.vue new file mode 100644 index 00000000..e5362571 --- /dev/null +++ b/src/screens/profiler/ui/flame-graph/flame-graph.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/src/screens/profiler/ui/flame-graph/index.ts b/src/screens/profiler/ui/flame-graph/index.ts new file mode 100644 index 00000000..2c72f6fc --- /dev/null +++ b/src/screens/profiler/ui/flame-graph/index.ts @@ -0,0 +1 @@ +export { default as FlameGraph } from './flame-graph.vue'; diff --git a/src/screens/profiler/ui/index.ts b/src/screens/profiler/ui/index.ts index b4260e46..ca1812d4 100644 --- a/src/screens/profiler/ui/index.ts +++ b/src/screens/profiler/ui/index.ts @@ -3,3 +3,4 @@ export * from './call-stack' export * from './call-graph' export * from './call-stat-board' export * from './profiler-page' +export * from './flame-graph' diff --git a/src/screens/profiler/ui/profiler-page/profiler-page.vue b/src/screens/profiler/ui/profiler-page/profiler-page.vue index 717d0273..ad389325 100644 --- a/src/screens/profiler/ui/profiler-page/profiler-page.vue +++ b/src/screens/profiler/ui/profiler-page/profiler-page.vue @@ -2,7 +2,6 @@ import { computed, ref } from "vue"; import { PerfectScrollbar } from "vue3-perfect-scrollbar"; import { Tabs, Tab } from "vue3-tabs-component"; -import ProfilePageFlamegraph from "~/components/ProfilePageFlamegraph/ProfilePageFlamegraph.vue"; import type { Profiler, ProfilerEdge } from "~/src/entities/profiler/types"; import type { NormalizedEvent } from "~/src/shared/types"; import { StatBoard } from "~/src/shared/ui"; @@ -10,6 +9,7 @@ import type { CallStackHoverData } from "../../types"; import { CallGraph } from "../call-graph"; import { CallStack } from "../call-stack"; import { CallStatBoard } from "../call-stat-board"; +import { FlameGraph } from "../flame-graph"; type Props = { event: NormalizedEvent; @@ -92,7 +92,7 @@ const tabChange = (selectedTab: { tab: { name: string } }) => { - Date: Mon, 13 Nov 2023 22:59:17 +0400 Subject: [PATCH 54/72] implement master changes --- package.json | 1 + src/features/lib/cytoscape/config.ts | 2 +- src/features/lib/cytoscape/prepare-data.ts | 137 ++- .../profiler/ui/call-graph/call-graph.vue | 43 +- .../profiler/ui/flame-graph/flame-graph.vue | 2 +- src/shared/types/partials.ts | 3 +- src/shared/ui/stat-board/stat-board.vue | 15 +- utils/normalize-event.ts | 18 +- vendor/dumper.js | 873 ++++++++++-------- yarn.lock | 2 +- 10 files changed, 709 insertions(+), 387 deletions(-) diff --git a/package.json b/package.json index 56ac5bec..7961be18 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,7 @@ "html-to-image": "^1.11.4", "lodash.debounce": "^4.0.8", "lodash.isstring": "^4.0.1", + "lodash.pick": "^4.4.0", "moment": "^2.29.4", "nuxt": "3.3.3", "pinia": "^2.0.30", diff --git a/src/features/lib/cytoscape/config.ts b/src/features/lib/cytoscape/config.ts index ab4924f8..94341d61 100644 --- a/src/features/lib/cytoscape/config.ts +++ b/src/features/lib/cytoscape/config.ts @@ -33,7 +33,7 @@ export const cytoscapeStyles: Stylesheet[] = [ "target-arrow-color": "data(color)", content: "data(label)", color: "#fff", - "curve-style": "taxi", + "curve-style": "bezier", "taxi-direction": "downward", "edge-distances": "node-position", "control-point-distance": 5, diff --git a/src/features/lib/cytoscape/prepare-data.ts b/src/features/lib/cytoscape/prepare-data.ts index 0713d18a..1e8056cf 100644 --- a/src/features/lib/cytoscape/prepare-data.ts +++ b/src/features/lib/cytoscape/prepare-data.ts @@ -4,6 +4,92 @@ import { GraphTypes } from "~/src/shared/types"; import { TEdge, TNode } from "./types"; const { formatDuration, formatFileSize } = useFormats(); + + +const getColorForCallCount = (callCount: number) => { + if (callCount <= 1) { + return '#fff'; // Sky Blue for 1 call + } + + if (callCount <= 10) { + return '#7BC8F6'; // Lighter Sky Blue + } + if (callCount <= 25) { + return '#4DA6FF'; // Light Blue + } + if (callCount <= 50) { + return '#1A8FFF'; // Brighter Blue + } + if (callCount <= 75) { + return '#007FFF'; // Azure Blue + } + if (callCount <= 100) { + return '#0059B3'; // Royal Blue + } + if (callCount <= 250) { + return '#FFD700'; // Golden + } + if (callCount <= 500) { + return '#FFA500'; // Orange + } + if (callCount <= 750) { + return '#FF8C00'; // Dark Orange + } + if (callCount <= 1000) { + return '#FF4500'; // OrangeRed + } + if (callCount <= 2500) { + return '#FF0000'; // Red + } + + return '#8B0000'; // Dark Red for 1000 to 1750 calls +} +const getColorForPercentCount = (percent: number) => { + if (percent <= 10) { + return '#FFFFFF'; // White + } + if (percent <= 20) { + return '#f19797'; // Lighter shade towards dark red + } + if (percent <= 30) { + return '#d93939'; // Light shade towards dark red + } + if (percent <= 40) { + return '#ad1e1e'; // Intermediate lighter shade towards dark red + } + if (percent <= 50) { + return '#982525'; // Intermediate shade towards dark red + } + if (percent <= 60) { + return '#862323'; // Intermediate darker shade towards dark red + } + if (percent <= 70) { + return '#671d1d'; // Darker shade towards dark red + } + if (percent <= 80) { + return '#540d0d'; // More towards dark red + } + if (percent <= 90) { + return '#340707'; // Almost dark red + } + + return '#2d0606'; // Dark red +} +const invertHexColor = (hexInput: string) => { + // If the first character is a hash, remove it for processing + const hex = hexInput.replace('#', ''); + + // Convert hex to RGB + const r = parseInt(hex.substr(0, 2), 16); + const g = parseInt(hex.substr(2, 2), 16); + const b = parseInt(hex.substr(4, 2), 16); + + // Calculate the YIQ ratio + const yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; + + // Return black for bright colors, white for dark colors + return (yiq >= 128) ? '#000' : '#fff'; +} const formatValue = (value: number, metric: string): string | number => { const metricFormatMap: Record string|number> = { p_mu: (a: number) => `${a}%`, @@ -26,13 +112,43 @@ const formatValue = (value: number, metric: string): string | number => { export const prepareData: ( edges: ProfilerEdges, metric: GraphTypes, - threshold: number + threshold: number, + percent: number ) => ({ nodes: TNode[], edges: TEdge[] }) = - (edges: ProfilerEdges, metric , threshold = 1) => Object.values(edges) + (edges: ProfilerEdges, metric , threshold = 1, percent = 10) => Object.values(edges) .reduce((arr, edge: ProfilerEdge, index) => { + let nodeColor = '#fff'; + let nodeTextColor = '#000'; + let edgeColor = '#fff'; + let edgeLabel: string = edge.cost.ct > 1 ? `${edge.cost.ct}x` : ''; + + if (metric === GraphTypes.CALLS) { + const metricKey = `ct`; + const isImportantNode: boolean = edge.cost[metricKey] >= percent; + if (!isImportantNode) { + return arr + } + + nodeColor = getColorForCallCount(edge.cost[metricKey]); + } else { + const metricKey = `p_${metric}`; + const isImportantNode: boolean = edge.cost[metricKey] >= percent; + if (!isImportantNode && edge.cost[metricKey] <= threshold) { + return arr + } + + nodeColor = isImportantNode ? getColorForPercentCount(edge.cost[metricKey]) : '#fff'; + nodeTextColor = isImportantNode ? invertHexColor(nodeColor) : '#000'; + + edgeColor = nodeColor; + + const postfix: string = edge.cost.ct > 1 ? ` [ ${edge.cost.ct}x ]` : ''; + edgeLabel = `${formatValue(edge.cost[metricKey], metricKey)}${postfix}`; + } + const metricKey = `p_${metric}`; const isImportantNode = edge.cost.p_pmu > 10; @@ -46,22 +162,23 @@ export const prepareData: ( id: edge.callee, name: edge.callee as string, cost: edge.cost, - color: isImportantNode ? '#e74c3c' : '#fff', - textColor: isImportantNode ? '#fff' : '#000' + color: nodeColor, + textColor: nodeTextColor } }) const hasNodeSource = arr.nodes.find(node => node.data.id === edge.caller); if (index > 0 && hasNodeSource) { - const postfix = edge.cost.ct > 1 ? ` - ${edge.cost.ct }x` : ''; - - arr.edges.push({ data: { + arr.edges.push({ + data: { source: edge.caller || '', target: edge.callee, - color: edge.cost.p_pmu > 10 ? '#e74c3c' : '#fff', - label: `${formatValue(edge.cost[metricKey], metricKey)}${postfix}` - }}) + color: edgeColor, + label: edgeLabel, + weight: edge.cost.ct, + } + }) } return arr diff --git a/src/screens/profiler/ui/call-graph/call-graph.vue b/src/screens/profiler/ui/call-graph/call-graph.vue index a8b236c1..1d220919 100644 --- a/src/screens/profiler/ui/call-graph/call-graph.vue +++ b/src/screens/profiler/ui/call-graph/call-graph.vue @@ -17,15 +17,22 @@ const props = defineProps(); const isFullscreen = ref(false); const metric = ref(GraphTypes.CPU as GraphTypes); const threshold = ref(1); +const percent = ref(10); const isReadyGraph = ref(false); const container = ref(); const graphElements = computed(() => - prepare(props.payload.edges, metric.value, threshold.value) + prepare(props.payload.edges, metric.value, threshold.value, percent.value) ); -const graphKey = computed(() => `${metric.value}-${threshold.value}`); +const percentLabel = computed(() => + metric.value === GraphTypes.CALLS ? "Min calls" : "Percent" +); + +const graphKey = computed( + () => `${metric.value}-${threshold.value}-${percent.value}` +); const graphHeight = computed(() => isFullscreen.value @@ -45,6 +52,10 @@ const setMetric = (value: GraphTypes) => { const setThreshold = (value: number) => { threshold.value = value; }; + +const setMinPercent = (value: number) => { + percent.value = value; +}; diff --git a/src/screens/profiler/ui/flame-graph/flame-graph.vue b/src/screens/profiler/ui/flame-graph/flame-graph.vue index e5362571..3442c1cd 100644 --- a/src/screens/profiler/ui/flame-graph/flame-graph.vue +++ b/src/screens/profiler/ui/flame-graph/flame-graph.vue @@ -98,6 +98,6 @@ onMounted(() => { } .flame-graph__canvas { - @apply bg-gray-300 w-full h-full; + @apply bg-gray-300 w-full h-full px-5; } diff --git a/src/shared/types/partials.ts b/src/shared/types/partials.ts index 7fb21bfc..cf6840dd 100644 --- a/src/shared/types/partials.ts +++ b/src/shared/types/partials.ts @@ -16,5 +16,6 @@ export interface Attachment { export enum GraphTypes { CPU = 'cpu' , MEMORY_CHANGE = 'pmu', - MEMORY = 'mu' + MEMORY = 'mu', + CALLS = 'calls', } diff --git a/src/shared/ui/stat-board/stat-board.vue b/src/shared/ui/stat-board/stat-board.vue index b4935caa..e25d5670 100644 --- a/src/shared/ui/stat-board/stat-board.vue +++ b/src/shared/ui/stat-board/stat-board.vue @@ -1,6 +1,6 @@ @@ -40,6 +45,10 @@ const statItems = computed(() => [

{{ item.title }} + + + [{{ item.percent }}%] +

@@ -75,6 +84,10 @@ const statItems = computed(() => [ @apply text-gray-600 dark:text-gray-300 font-bold text-2xs mb-1 uppercase truncate; } +.stat-board__item-name-detail { + @apply text-2xs truncate ml-1; +} + .stat-board__item-value { @apply text-2xs sm:text-xs md:text-base truncate; } diff --git a/utils/normalize-event.ts b/utils/normalize-event.ts index 5c1cd564..5555bb11 100644 --- a/utils/normalize-event.ts +++ b/utils/normalize-event.ts @@ -6,6 +6,7 @@ import { } from "~/config/types"; import { RAY_EVENT_TYPES } from "~/config/constants"; import { EVENT_TYPES, ServerEvent } from "~/src/shared/types"; +import pick from 'lodash/pick'; export const normalizeFallbackEvent = (event: ServerEvent): NormalizedEvent => ({ id: event.uuid, @@ -32,6 +33,21 @@ export const normalizeInspectorEvent = (event: ServerEvent): Normaliz } export const normalizeRayDumpEvent = (event: ServerEvent): NormalizedEvent => { + let origin = { + php_version: event.payload.meta?.php_version, + laravel_version: event.payload.meta?.laravel_version, + } + + event.payload.payloads + .forEach(payload => { + if (payload.origin) { + origin = { + ...origin, + ...pick(payload.origin, ['file', 'line_number', 'hostname']), + } + } + }) + const labels = event.payload.payloads .filter(payload => payload.type === 'label') .map(payload => payload.content.label) @@ -55,7 +71,7 @@ export const normalizeRayDumpEvent = (event: ServerEvent): NormalizedEv id: event.uuid, type: EVENT_TYPES.RAY_DUMP, labels: [EVENT_TYPES.RAY_DUMP, ...labels, ...typeLabels].filter((x, i, a) => a.indexOf(x) === i), - origin: null, + origin, serverName: "", date: event.timestamp ? new Date(event.timestamp * 1000) : null, color, diff --git a/vendor/dumper.js b/vendor/dumper.js index 7d592840..72effa25 100644 --- a/vendor/dumper.js +++ b/vendor/dumper.js @@ -1,401 +1,538 @@ export default function (doc) { - let refStyle = doc.createElement('style'), rxEsc = /([.*+?^${}()|\[\]\/\\])/g, idRx = /\bsf-dump-\d+-ref[012]\w+\b/, - keyHint = 0 <= navigator.platform.toUpperCase().indexOf('MAC') ? 'Cmd' : 'Ctrl', - addEventListener = function (e, n, cb) { - e.addEventListener(n, cb, false); - }; - refStyle.innerHTML = 'pre.sf-dump .sf-dump-compact, .sf-dump-str-collapse .sf-dump-str-collapse, .sf-dump-str-expand .sf-dump-str-expand { display: none; }'; - (doc.documentElement.firstElementChild || doc.documentElement.children[0]).appendChild(refStyle); - refStyle = doc.createElement('style'); - (doc.documentElement.firstElementChild || doc.documentElement.children[0]).appendChild(refStyle); - if (!doc.addEventListener) { - addEventListener = function (element, eventName, callback) { - element.attachEvent('on' + eventName, function (e) { - e.preventDefault = function () { - e.returnValue = false; - }; - e.target = e.srcElement; - callback(e); - }); + let refStyle = doc.createElement("style"), + rxEsc = /([.*+?^${}()|\[\]\/\\])/g, + idRx = /\bsf-dump-\d+-ref[012]\w+\b/, + keyHint = + 0 <= navigator.platform.toUpperCase().indexOf("MAC") ? "Cmd" : "Ctrl", + addEventListener = function (e, n, cb) { + e.addEventListener(n, cb, false); + }; + refStyle.innerHTML = + "pre.sf-dump .sf-dump-compact, .sf-dump-str-collapse .sf-dump-str-collapse, .sf-dump-str-expand .sf-dump-str-expand { display: none; }"; + ( + doc.documentElement.firstElementChild || doc.documentElement.children[0] + ).appendChild(refStyle); + refStyle = doc.createElement("style"); + ( + doc.documentElement.firstElementChild || doc.documentElement.children[0] + ).appendChild(refStyle); + if (!doc.addEventListener) { + addEventListener = function (element, eventName, callback) { + element.attachEvent("on" + eventName, function (e) { + e.preventDefault = function () { + e.returnValue = false; }; - } - - function toggle(a, recursive) { - var s = a.nextSibling || {}, oldClass = s.className, arrow, newClass; - if (/\bsf-dump-compact\b/.test(oldClass)) { - arrow = '▼'; - newClass = 'sf-dump-expanded'; - } else if (/\bsf-dump-expanded\b/.test(oldClass)) { - arrow = '▶'; - newClass = 'sf-dump-compact'; - } else { - return false; - } - if (doc.createEvent && s.dispatchEvent) { - var event = doc.createEvent('Event'); - event.initEvent('sf-dump-expanded' === newClass ? 'sfbeforedumpexpand' : 'sfbeforedumpcollapse', true, false); - s.dispatchEvent(event); - } - a.lastChild.innerHTML = arrow; - s.className = s.className.replace(/\bsf-dump-(compact|expanded)\b/, newClass); - if (recursive) { - try { - a = s.querySelectorAll('.' + oldClass); - for (s = 0; s < a.length; ++s) { - if (-1 == a[s].className.indexOf(newClass)) { - a[s].className = newClass; - a[s].previousSibling.lastChild.innerHTML = arrow; - } - } - } catch (e) { - } - } - return true; + e.target = e.srcElement; + callback(e); + }); }; + } - function collapse(a, recursive) { - var s = a.nextSibling || {}, oldClass = s.className; - if (/\bsf-dump-expanded\b/.test(oldClass)) { - toggle(a, recursive); - return true; + function toggle(a, recursive) { + var s = a.nextSibling || {}, + oldClass = s.className, + arrow, + newClass; + if (/\bsf-dump-compact\b/.test(oldClass)) { + arrow = "▼"; + newClass = "sf-dump-expanded"; + } else if (/\bsf-dump-expanded\b/.test(oldClass)) { + arrow = "▶"; + newClass = "sf-dump-compact"; + } else { + return false; + } + if (doc.createEvent && s.dispatchEvent) { + var event = doc.createEvent("Event"); + event.initEvent( + "sf-dump-expanded" === newClass + ? "sfbeforedumpexpand" + : "sfbeforedumpcollapse", + true, + false + ); + s.dispatchEvent(event); + } + a.lastChild.innerHTML = arrow; + s.className = s.className.replace( + /\bsf-dump-(compact|expanded)\b/, + newClass + ); + if (recursive) { + try { + a = s.querySelectorAll("." + oldClass); + for (s = 0; s < a.length; ++s) { + if (-1 == a[s].className.indexOf(newClass)) { + a[s].className = newClass; + a[s].previousSibling.lastChild.innerHTML = arrow; + } } - return false; - }; + } catch (e) {} + } + return true; + } - function expand(a, recursive) { - var s = a.nextSibling || {}, oldClass = s.className; - if (/\bsf-dump-compact\b/.test(oldClass)) { - toggle(a, recursive); - return true; - } - return false; - }; + function collapse(a, recursive) { + var s = a.nextSibling || {}, + oldClass = s.className; + if (/\bsf-dump-expanded\b/.test(oldClass)) { + toggle(a, recursive); + return true; + } + return false; + } - function collapseAll(root) { - var a = root.querySelector('a.sf-dump-toggle'); - if (a) { - collapse(a, true); - expand(a); - return true; - } - return false; + function expand(a, recursive) { + var s = a.nextSibling || {}, + oldClass = s.className; + if (/\bsf-dump-compact\b/.test(oldClass)) { + toggle(a, recursive); + return true; } + return false; + } - function reveal(node) { - var previous, parents = []; - while ((node = node.parentNode || {}) && (previous = node.previousSibling) && 'A' === previous.tagName) { - parents.push(previous); - } - if (0 !== parents.length) { - parents.forEach(function (parent) { - expand(parent); - }); - return true; - } - return false; + function collapseAll(root) { + var a = root.querySelector("a.sf-dump-toggle"); + if (a) { + collapse(a, true); + expand(a); + return true; + } + return false; + } + + function reveal(node) { + var previous, + parents = []; + while ( + (node = node.parentNode || {}) && + (previous = node.previousSibling) && + "A" === previous.tagName + ) { + parents.push(previous); } + if (0 !== parents.length) { + parents.forEach(function (parent) { + expand(parent); + }); + return true; + } + return false; + } + + function highlight(root, activeNode, nodes) { + resetHighlightedNodes(root); + Array.from(nodes || []).forEach(function (node) { + if (!/\bsf-dump-highlight\b/.test(node.className)) { + node.className = node.className + " sf-dump-highlight"; + } + }); + if (!/\bsf-dump-highlight-active\b/.test(activeNode.className)) { + activeNode.className = activeNode.className + " sf-dump-highlight-active"; + } + } + + function resetHighlightedNodes(root) { + Array.from( + root.querySelectorAll( + ".sf-dump-str, .sf-dump-key, .sf-dump-public, .sf-dump-protected, .sf-dump-private" + ) + ).forEach(function (strNode) { + strNode.className = strNode.className.replace( + /\bsf-dump-highlight\b/, + "" + ); + strNode.className = strNode.className.replace( + /\bsf-dump-highlight-active\b/, + "" + ); + }); + } - function highlight(root, activeNode, nodes) { - resetHighlightedNodes(root); - Array.from(nodes || []).forEach(function (node) { - if (!/\bsf-dump-highlight\b/.test(node.className)) { - node.className = node.className + ' sf-dump-highlight'; + return function (root, x) { + root = doc.getElementById(root); + var indentRx = new RegExp( + "^(" + + (root.getAttribute("data-indent-pad") || " ").replace(rxEsc, "\\$1") + + ")+", + "m" + ), + options = { maxDepth: 1, maxStringLength: 160, fileLinkFormat: false }, + elt = root.getElementsByTagName("A"), + len = elt.length, + i = 0, + s, + h, + t = []; + while (i < len) t.push(elt[i++]); + for (i in x) { + options[i] = x[i]; + } + + function a(e, f) { + addEventListener(root, e, function (e, n) { + if ("A" == e.target.tagName) { + f(e.target, e); + } else if ("A" == e.target.parentNode.tagName) { + f(e.target.parentNode, e); + } else { + n = /\bsf-dump-ellipsis\b/.test(e.target.className) + ? e.target.parentNode + : e.target; + if ((n = n.nextElementSibling) && "A" == n.tagName) { + if (!/\bsf-dump-toggle\b/.test(n.className)) { + n = n.nextElementSibling || n; } - }); - if (!/\bsf-dump-highlight-active\b/.test(activeNode.className)) { - activeNode.className = activeNode.className + ' sf-dump-highlight-active'; + f(n, e, true); + } } + }); } - function resetHighlightedNodes(root) { - Array.from(root.querySelectorAll('.sf-dump-str, .sf-dump-key, .sf-dump-public, .sf-dump-protected, .sf-dump-private')).forEach(function (strNode) { - strNode.className = strNode.className.replace(/\bsf-dump-highlight\b/, ''); - strNode.className = strNode.className.replace(/\bsf-dump-highlight-active\b/, ''); - }); + function isCtrlKey(e) { + return e.ctrlKey || e.metaKey; } - return function (root, x) { - root = doc.getElementById(root); - var indentRx = new RegExp('^(' + (root.getAttribute('data-indent-pad') || ' ').replace(rxEsc, '\\$1') + ')+', 'm'), - options = {"maxDepth": 1, "maxStringLength": 160, "fileLinkFormat": false}, - elt = root.getElementsByTagName('A'), len = elt.length, i = 0, s, h, t = []; - while (i < len) t.push(elt[i++]); - for (i in x) { - options[i] = x[i]; + function xpathString(str) { + var parts = str.match(/[^'"]+|['"]/g).map(function (part) { + if ("'" == part) { + return '"\'"'; } + if ('"' == part) { + return "'\"'"; + } + return "'" + part + "'"; + }); + return "concat(" + parts.join(",") + ", '')"; + } - function a(e, f) { - addEventListener(root, e, function (e, n) { - if ('A' == e.target.tagName) { - f(e.target, e); - } else if ('A' == e.target.parentNode.tagName) { - f(e.target.parentNode, e); - } else { - n = /\bsf-dump-ellipsis\b/.test(e.target.className) ? e.target.parentNode : e.target; - if ((n = n.nextElementSibling) && 'A' == n.tagName) { - if (!/\bsf-dump-toggle\b/.test(n.className)) { - n = n.nextElementSibling || n; - } - f(n, e, true); - } - } - }); - }; + function xpathHasClass(className) { + return ( + "contains(concat(' ', normalize-space(@class), ' '), ' " + + className + + " ')" + ); + } - function isCtrlKey(e) { - return e.ctrlKey || e.metaKey; + addEventListener(root, "mouseover", function (e) { + if ("" != refStyle.innerHTML) { + refStyle.innerHTML = ""; + } + }); + a("mouseover", function (a, e, c) { + if (c) { + e.target.style.cursor = "pointer"; + } else if ((a = idRx.exec(a.className))) { + try { + refStyle.innerHTML = + "pre.sf-dump ." + + a[0] + + "{background-color: #B729D9; color: #FFF !important; border-radius: 2px}"; + } catch (e) {} + } + }); + a("click", function (a, e, c) { + if (/\bsf-dump-toggle\b/.test(a.className)) { + e.preventDefault(); + if (!toggle(a, isCtrlKey(e))) { + var r = doc.getElementById(a.getAttribute("href").substr(1)), + s = r.previousSibling, + f = r.parentNode, + t = a.parentNode; + t.replaceChild(r, a); + f.replaceChild(a, s); + t.insertBefore(s, r); + f = f.firstChild.nodeValue.match(indentRx); + t = t.firstChild.nodeValue.match(indentRx); + if (f && t && f[0] !== t[0]) { + r.innerHTML = r.innerHTML.replace( + new RegExp("^" + f[0].replace(rxEsc, "\\$1"), "mg"), + t[0] + ); + } + if (/\bsf-dump-compact\b/.test(r.className)) { + toggle(s, isCtrlKey(e)); + } } - - function xpathString(str) { - var parts = str.match(/[^'"]+|['"]/g).map(function (part) { - if ("'" == part) { - return '"\'"'; - } - if ('"' == part) { - return "'\"'"; - } - return "'" + part + "'"; - }); - return "concat(" + parts.join(",") + ", '')"; + if (c) { + } else if (doc.getSelection) { + try { + doc.getSelection().removeAllRanges(); + } catch (e) { + doc.getSelection().empty(); + } + } else { + doc.selection.empty(); } - - function xpathHasClass(className) { - return "contains(concat(' ', normalize-space(@class), ' '), ' " + className + " ')"; + } else if (/\bsf-dump-str-toggle\b/.test(a.className)) { + e.preventDefault(); + e = a.parentNode.parentNode; + e.className = e.className.replace( + /\bsf-dump-str-(expand|collapse)\b/, + a.parentNode.className + ); + } + }); + elt = root.getElementsByTagName("SAMP"); + len = elt.length; + i = 0; + while (i < len) t.push(elt[i++]); + len = t.length; + for (i = 0; i < len; ++i) { + elt = t[i]; + if ("SAMP" == elt.tagName) { + a = elt.previousSibling || {}; + if ("A" != a.tagName) { + a = doc.createElement("A"); + a.className = "sf-dump-ref"; + elt.parentNode.insertBefore(a, elt); + } else { + a.innerHTML += " "; } - - addEventListener(root, 'mouseover', function (e) { - if ('' != refStyle.innerHTML) { - refStyle.innerHTML = ''; - } - }); - a('mouseover', function (a, e, c) { - if (c) { - e.target.style.cursor = "pointer"; - } else if (a = idRx.exec(a.className)) { - try { - refStyle.innerHTML = 'pre.sf-dump .' + a[0] + '{background-color: #B729D9; color: #FFF !important; border-radius: 2px}'; - } catch (e) { - } - } - }); - a('click', function (a, e, c) { - if (/\bsf-dump-toggle\b/.test(a.className)) { - e.preventDefault(); - if (!toggle(a, isCtrlKey(e))) { - var r = doc.getElementById(a.getAttribute('href').substr(1)), s = r.previousSibling, - f = r.parentNode, t = a.parentNode; - t.replaceChild(r, a); - f.replaceChild(a, s); - t.insertBefore(s, r); - f = f.firstChild.nodeValue.match(indentRx); - t = t.firstChild.nodeValue.match(indentRx); - if (f && t && f[0] !== t[0]) { - r.innerHTML = r.innerHTML.replace(new RegExp('^' + f[0].replace(rxEsc, '\\$1'), 'mg'), t[0]); - } - if (/\bsf-dump-compact\b/.test(r.className)) { - toggle(s, isCtrlKey(e)); - } - } - if (c) { - } else if (doc.getSelection) { - try { - doc.getSelection().removeAllRanges(); - } catch (e) { - doc.getSelection().empty(); - } - } else { - doc.selection.empty(); - } - } else if (/\bsf-dump-str-toggle\b/.test(a.className)) { - e.preventDefault(); - e = a.parentNode.parentNode; - e.className = e.className.replace(/\bsf-dump-str-(expand|collapse)\b/, a.parentNode.className); + a.title = + (a.title ? a.title + "\n[" : "[") + + keyHint + + "+click] Expand all children"; + a.innerHTML += + elt.className == "sf-dump-compact" + ? "" + : ""; + a.className += " sf-dump-toggle"; + x = 1; + if ("sf-dump" != elt.parentNode.className) { + x += elt.parentNode.getAttribute("data-depth") / 1; + } + } else if ( + /\bsf-dump-ref\b/.test(elt.className) && + (a = elt.getAttribute("href")) + ) { + a = a.substr(1); + elt.className += " " + a; + if (/[\[{]$/.test(elt.previousSibling.nodeValue)) { + a = a != elt.nextSibling.id && doc.getElementById(a); + try { + s = a.nextSibling; + elt.appendChild(a); + s.parentNode.insertBefore(a, s); + if (/^[@#]/.test(elt.innerHTML)) { + elt.innerHTML += " "; + } else { + elt.innerHTML = ""; + elt.className = "sf-dump-ref"; } - }); - elt = root.getElementsByTagName('SAMP'); - len = elt.length; - i = 0; - while (i < len) t.push(elt[i++]); - len = t.length; - for (i = 0; i < len; ++i) { - elt = t[i]; - if ('SAMP' == elt.tagName) { - a = elt.previousSibling || {}; - if ('A' != a.tagName) { - a = doc.createElement('A'); - a.className = 'sf-dump-ref'; - elt.parentNode.insertBefore(a, elt); - } else { - a.innerHTML += ' '; - } - a.title = (a.title ? a.title + '\n[' : '[') + keyHint + '+click] Expand all children'; - a.innerHTML += elt.className == 'sf-dump-compact' ? '' : ''; - a.className += ' sf-dump-toggle'; - x = 1; - if ('sf-dump' != elt.parentNode.className) { - x += elt.parentNode.getAttribute('data-depth') / 1; - } - } else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) { - a = a.substr(1); - elt.className += ' ' + a; - if (/[\[{]$/.test(elt.previousSibling.nodeValue)) { - a = a != elt.nextSibling.id && doc.getElementById(a); - try { - s = a.nextSibling; - elt.appendChild(a); - s.parentNode.insertBefore(a, s); - if (/^[@#]/.test(elt.innerHTML)) { - elt.innerHTML += ' '; - } else { - elt.innerHTML = ''; - elt.className = 'sf-dump-ref'; - } - elt.className += ' sf-dump-toggle'; - } catch (e) { - if ('&' == elt.innerHTML.charAt(0)) { - elt.innerHTML = '…'; - elt.className = 'sf-dump-ref'; - } - } - } + elt.className += " sf-dump-toggle"; + } catch (e) { + if ("&" == elt.innerHTML.charAt(0)) { + elt.innerHTML = "…"; + elt.className = "sf-dump-ref"; } + } } - if (doc.evaluate && Array.from && root.children.length > 1) { - root.setAttribute('tabindex', 0); - var SearchState = function () { - this.nodes = []; - this.idx = 0; - }; - SearchState.prototype = { - next: function () { - if (this.isEmpty()) { - return this.current(); - } - this.idx = this.idx < (this.nodes.length - 1) ? this.idx + 1 : 0; - return this.current(); - }, previous: function () { - if (this.isEmpty()) { - return this.current(); - } - this.idx = this.idx > 0 ? this.idx - 1 : (this.nodes.length - 1); - return this.current(); - }, isEmpty: function () { - return 0 === this.count(); - }, current: function () { - if (this.isEmpty()) { - return null; - } - return this.nodes[this.idx]; - }, reset: function () { - this.nodes = []; - this.idx = 0; - }, count: function () { - return this.nodes.length; - }, - }; + } + } + if (doc.evaluate && Array.from && root.children.length > 1) { + root.setAttribute("tabindex", 0); + var SearchState = function () { + this.nodes = []; + this.idx = 0; + }; + SearchState.prototype = { + next: function () { + if (this.isEmpty()) { + return this.current(); + } + this.idx = this.idx < this.nodes.length - 1 ? this.idx + 1 : 0; + return this.current(); + }, + previous: function () { + if (this.isEmpty()) { + return this.current(); + } + this.idx = this.idx > 0 ? this.idx - 1 : this.nodes.length - 1; + return this.current(); + }, + isEmpty: function () { + return 0 === this.count(); + }, + current: function () { + if (this.isEmpty()) { + return null; + } + return this.nodes[this.idx]; + }, + reset: function () { + this.nodes = []; + this.idx = 0; + }, + count: function () { + return this.nodes.length; + }, + }; - function showCurrent(state) { - var currentNode = state.current(), currentRect, searchRect; - if (currentNode) { - reveal(currentNode); - highlight(root, currentNode, state.nodes); - if ('scrollIntoView' in currentNode) { - currentNode.scrollIntoView(true); - currentRect = currentNode.getBoundingClientRect(); - searchRect = search.getBoundingClientRect(); - if (currentRect.top < (searchRect.top + searchRect.height)) { - window.scrollBy(0, -(searchRect.top + searchRect.height + 5)); - } - } - } - counter.textContent = (state.isEmpty() ? 0 : state.idx + 1) + ' of ' + state.count(); + function showCurrent(state) { + var currentNode = state.current(), + currentRect, + searchRect; + if (currentNode) { + reveal(currentNode); + highlight(root, currentNode, state.nodes); + if ("scrollIntoView" in currentNode) { + currentNode.scrollIntoView(true); + currentRect = currentNode.getBoundingClientRect(); + searchRect = search.getBoundingClientRect(); + if (currentRect.top < searchRect.top + searchRect.height) { + window.scrollBy(0, -(searchRect.top + searchRect.height + 5)); } + } + } + counter.textContent = + (state.isEmpty() ? 0 : state.idx + 1) + " of " + state.count(); + } - var search = doc.createElement('div'); - search.className = 'sf-dump-search-wrapper sf-dump-search-hidden'; - search.innerHTML = ' 0 of 0<\/span> '; + root.insertBefore(search, root.firstChild); + var state = new SearchState(); + var searchInput = search.querySelector(".sf-dump-search-input"); + var counter = search.querySelector(".sf-dump-search-count"); + var searchInputTimer = 0; + var previousSearchQuery = ""; + addEventListener(searchInput, "keyup", function (e) { + const searchQuery = + e.target + .value; /* Don't perform anything if the pressed key didn't change the query */ + if (searchQuery === previousSearchQuery) { + return; } - if (0 >= options.maxStringLength) { + previousSearchQuery = searchQuery; + clearTimeout(searchInputTimer); + searchInputTimer = setTimeout(function () { + state.reset(); + collapseAll(root); + resetHighlightedNodes(root); + if ("" === searchQuery) { + counter.textContent = "0 of 0"; + return; + } + const classMatches = [ + "sf-dump-str", + "sf-dump-key", + "sf-dump-public", + "sf-dump-protected", + "sf-dump-private", + ] + .map(xpathHasClass) + .join(" or "); + const xpathResult = doc.evaluate( + ".//span[" + + classMatches + + "][contains(translate(child::text(), " + + xpathString(searchQuery.toUpperCase()) + + ", " + + xpathString(searchQuery.toLowerCase()) + + "), " + + xpathString(searchQuery.toLowerCase()) + + ")]", + root, + null, + XPathResult.ORDERED_NODE_ITERATOR_TYPE, + null + ); + + let node; + while ((node = xpathResult.iterateNext())) state.nodes.push(node); + showCurrent(state); + }, 400); + }); + Array.from( + search.querySelectorAll( + ".sf-dump-search-input-next, .sf-dump-search-input-previous" + ) + ).forEach(function (btn) { + addEventListener(btn, "click", function (e) { + e.preventDefault(); + -1 !== e.target.className.indexOf("next") + ? state.next() + : state.previous(); + searchInput.focus(); + collapseAll(root); + showCurrent(state); + }); + }); + addEventListener(root, "keydown", function (e) { + var isSearchActive = !/\bsf-dump-search-hidden\b/.test( + search.className + ); + if ( + (114 === e.keyCode && !isSearchActive) || + (isCtrlKey(e) && 70 === e.keyCode) + ) { + /* F3 or CMD/CTRL + F */ + if (70 === e.keyCode && document.activeElement === searchInput) { + /* * If CMD/CTRL + F is hit while having focus on search input, * the user probably meant to trigger browser search instead. * Let the browser execute its behavior: */ return; + } + e.preventDefault(); + search.className = search.className.replace( + /\bsf-dump-search-hidden\b/, + "" + ); + searchInput.focus(); + } else if (isSearchActive) { + if (27 === e.keyCode) { + /* ESC key */ + search.className += " sf-dump-search-hidden"; + e.preventDefault(); + resetHighlightedNodes(root); + searchInput.value = ""; + } else if ( + (isCtrlKey(e) && 71 === e.keyCode) /* CMD/CTRL + G */ || + 13 === e.keyCode /* Enter */ || + 114 === e.keyCode /* F3 */ + ) { + e.preventDefault(); + e.shiftKey ? state.previous() : state.next(); + collapseAll(root); + showCurrent(state); + } } - try { - elt = root.querySelectorAll('.sf-dump-str'); - len = elt.length; - i = 0; - t = []; - while (i < len) t.push(elt[i++]); - len = t.length; - for (i = 0; i < len; ++i) { - elt = t[i]; - s = elt.innerText || elt.textContent; - x = s.length - options.maxStringLength; - if (0 < x) { - h = elt.innerHTML; - elt[elt.innerText ? 'innerText' : 'textContent'] = s.substring(0, options.maxStringLength); - elt.className += ' sf-dump-str-collapse'; - elt.innerHTML = '' + h + '' + '' + elt.innerHTML + ''; - } - } - } catch (e) { + }); + } + if (0 >= options.maxStringLength) { + return; + } + try { + elt = root.querySelectorAll(".sf-dump-str"); + len = elt.length; + i = 0; + t = []; + while (i < len) t.push(elt[i++]); + len = t.length; + for (i = 0; i < len; ++i) { + elt = t[i]; + s = elt.innerText || elt.textContent; + x = s.length - options.maxStringLength; + if (0 < x) { + h = elt.innerHTML; + elt[elt.innerText ? "innerText" : "textContent"] = s.substring( + 0, + options.maxStringLength + ); + elt.className += " sf-dump-str-collapse"; + elt.innerHTML = + "" + + h + + '' + + "" + + elt.innerHTML + + ''; } - }; -}; + } + } catch (e) {} + }; +} diff --git a/yarn.lock b/yarn.lock index 85ef3af5..2417f49c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9878,7 +9878,7 @@ lodash.merge@^4.6.2: lodash.pick@^4.4.0: version "4.4.0" - resolved "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz" + resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" integrity sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q== lodash.template@^4.5.0: From fe5ddc3237ad75ed69570c1bd7006dfb3a82dbc0 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 18 Nov 2023 22:33:45 +0400 Subject: [PATCH 55/72] apply main changes --- components/SmtpPage/SmtpPage.stories.ts | 20 ++++++-- components/SmtpPage/SmtpPage.vue | 64 ++++++++++++++++++------- src/entities/smtp/mocks/index.ts | 2 + src/entities/smtp/mocks/smtp-text.json | 43 +++++++++++++++++ 4 files changed, 106 insertions(+), 23 deletions(-) create mode 100644 src/entities/smtp/mocks/smtp-text.json diff --git a/components/SmtpPage/SmtpPage.stories.ts b/components/SmtpPage/SmtpPage.stories.ts index 54091b7c..cd3ef4e0 100644 --- a/components/SmtpPage/SmtpPage.stories.ts +++ b/components/SmtpPage/SmtpPage.stories.ts @@ -1,6 +1,6 @@ import { Meta, Story } from "@storybook/vue3"; import SmtpPage from "~/components/SmtpPage/SmtpPage.vue"; -import { smtpWelcomeMock } from '~/src/entities/smtp/mocks'; +import { smtpOrderMock, smtpTextMock, smtpWelcomeMock } from '~/src/entities/smtp/mocks'; import { useSmtp } from "~/src/entities/smtp"; const { normalizeSmtpEvent } = useSmtp(); @@ -22,9 +22,19 @@ const Template: Story = (args) => ({ export const Default = Template.bind({}); -const normalizeEvent = normalizeSmtpEvent(smtpWelcomeMock) - Default.args = { - event: normalizeEvent, - htmlSource: normalizeEvent.payload.html + event: normalizeSmtpEvent(smtpWelcomeMock), + htmlSource: normalizeSmtpEvent(smtpWelcomeMock).payload.html +}; + +export const Order = Template.bind({}); +Order.args = { + event: normalizeSmtpEvent(smtpOrderMock), + htmlSource: normalizeSmtpEvent(smtpOrderMock).payload.html +}; + +export const Text = Template.bind({}); +Text.args = { + event: normalizeSmtpEvent(smtpTextMock), + htmlSource: normalizeSmtpEvent(smtpTextMock).payload.html }; diff --git a/components/SmtpPage/SmtpPage.vue b/components/SmtpPage/SmtpPage.vue index 7ce3d842..b2869b6b 100644 --- a/components/SmtpPage/SmtpPage.vue +++ b/components/SmtpPage/SmtpPage.vue @@ -31,18 +31,46 @@
- +
- + + + + + +
+
+ +
+
+
@@ -76,21 +104,6 @@
- -
-

- Attachments ({{ attachments.length }}) -

- -
- -
-
@@ -131,7 +144,8 @@ export default defineComponent({ }, htmlSource: { type: String, - required: true, + default: "", + required: false, }, }, data() { @@ -161,6 +175,16 @@ export default defineComponent({ }; }, computed: { + isHtml(): boolean { + return ( + this.event.payload?.html !== null && this.event.payload?.html !== "" + ); + }, + isText(): boolean { + return ( + this.event.payload?.text !== null && this.event.payload?.text !== "" + ); + }, mail() { return this.event.payload; }, @@ -245,4 +269,8 @@ export default defineComponent({ @apply flex-1 flex flex-col; } } + +.smtp-page__body-tab-badge { + @apply bg-red-800 ml-2 text-2xs px-2 py-1 rounded text-white uppercase; +} diff --git a/src/entities/smtp/mocks/index.ts b/src/entities/smtp/mocks/index.ts index ad57b432..36c6ff77 100644 --- a/src/entities/smtp/mocks/index.ts +++ b/src/entities/smtp/mocks/index.ts @@ -1,7 +1,9 @@ import smtpOrderMock from './smtp-order.json'; +import smtpTextMock from './smtp-text.json'; import smtpWelcomeMock from './smtp-welcome.json'; export { smtpOrderMock, + smtpTextMock, smtpWelcomeMock, } diff --git a/src/entities/smtp/mocks/smtp-text.json b/src/entities/smtp/mocks/smtp-text.json new file mode 100644 index 00000000..d677082a --- /dev/null +++ b/src/entities/smtp/mocks/smtp-text.json @@ -0,0 +1,43 @@ +{ + "uuid": "6cdacdab-2305-454e-b9c0-185e541ef160", + "type": "smtp", + "payload": { + "id": "3083a616dd72895a1ea59be834f50869@site.com", + "from": [ + { + "email": "sender@site.com", + "name": "sender" + } + ], + "reply_to": [ + { + "email": "reply-to@site.com", + "name": "To name" + } + ], + "subject": "Est debitis nihil repellendus sit.", + "to": [ + { + "name": "", + "email": "nsmitham@olson.biz" + }, + { + "name": "", + "email": "thelma68@hotmail.com" + } + ], + "cc": [ + { + "name": "", + "email": "cc@site.com" + } + ], + "bcc": [], + "text": "[Laravel](https://buggregator.dev)\r\n\r\nThe body of your message.\r\n\r\nButton Text: \r\n\r\nThanks,\r\nLaravel\r\n\r\n© 2023 Laravel. All rights reserved.\r\n", + "html": "\r\n\r\n\r\nLaravel\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\"Laravel\r\n\r\n
\r\n\r\n\r\n\r\n\r\n
\r\n

© 2023 Laravel. All rights reserved.

\r\n\r\n
\r\n
\r\n
\r\n\r\n", + "raw": "From: sender \r\nTo: nsmitham@olson.biz, thelma68@hotmail.com\r\nCc: cc@site.com\r\nReply-To: To name \r\nSubject: Est debitis nihil repellendus sit.\r\nMessage-ID: <3083a616dd72895a1ea59be834f50869@site.com>\r\nMIME-Version: 1.0\r\nDate: Wed, 08 Mar 2023 11:22:03 +0000\r\nContent-Type: multipart/alternative; boundary=a4iT8D1T\r\n\r\n--a4iT8D1T\r\nContent-Type: text/plain; charset=utf-8\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n[Laravel](https://buggregator.dev)\r\n\r\nThe body of your message.\r\n\r\nButt=\r\non Text:=20\r\n\r\nThanks,\r\nLaravel\r\n\r\n=C2=A9 2023 Laravel. All rights reser=\r\nved.\r\n\r\n--a4iT8D1T\r\nContent-Type: text/html; charset=utf-8\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n\r\n\r\n\r\nLaravel\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n=\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n=\r\n\r\n\r\n\r\n\r\n\r\n=\r\n\r\n\r\n\r\n\r\n
\r\n\r\n3D\"Laravel\r\n\r\n
\r\n

T=\r\nhe body of your message.

\r\n\r\n\r\n\r\n\r\n\r\n

Thanks,<=\r\nbr>\r\nLaravel

\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n
\r\nButton Text=\r\n\r\n
\r\n
\r\n
\r\n
\r\n<=\r\ntable class=3D\"footer\" align=3D\"center\" width=3D\"570\" cellpadding=3D\"0\" cel=\r\nlspacing=3D\"0\" role=3D\"presentation\" style=3D\"box-sizing: border-box; font-=\r\nfamily: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, A=\r\nrial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';=\r\n position: relative; -premailer-cellpadding: 0; -premailer-cellspacing: 0; =\r\n-premailer-width: 570px; margin: 0 auto; padding: 0; text-align: center; wi=\r\ndth: 570px;\">\r\n
\r\n

=C2=A9 2023 Laravel. All rights reserved.

\r\n\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n--a4iT8D1T--\r\n\r\n.\r\n", + "attachments": [] + }, + "timestamp": 1678274523, + "project_id": null +} From 51a5e86df85d519fc1ce5df4ca910c40c2eb9bfb Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 18 Nov 2023 22:34:34 +0400 Subject: [PATCH 56/72] remove eslint check json files on pre-commit --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7961be18..9e68b229 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,13 @@ "*.{js,ts}": [ "eslint --fix" ], - "*.{vue,html,json}": [ + "*.{vue,html}": [ "eslint --fix", "prettier --write" ], + "*.{json}": [ + "prettier --write" + ], "*.js": "eslint --cache --fix", "*.{js,css,md}": "prettier --write" }, From 5c916651bf6176677385b61fa3e2ed66046dc0ad Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 18 Nov 2023 22:44:04 +0400 Subject: [PATCH 57/72] fix cytoscape types --- src/features/lib/cytoscape/types.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/features/lib/cytoscape/types.ts b/src/features/lib/cytoscape/types.ts index 4fe94406..74e0e683 100644 --- a/src/features/lib/cytoscape/types.ts +++ b/src/features/lib/cytoscape/types.ts @@ -1,4 +1,4 @@ - + import { ProfilerCost } from "~/src/entities/profiler/types"; export type TNode = { @@ -7,7 +7,7 @@ export type TNode = { name: string, cost?: ProfilerCost, color?: string, - textColor?: string + textColor?: string, } } @@ -18,5 +18,6 @@ export type TEdge = { target: string, label?: string, color?: string, + weight?: number, } } From 5d2481e87bc3d1a69fed6aac4bdd4f09d7bb3f79 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 18 Nov 2023 23:11:28 +0400 Subject: [PATCH 58/72] move http-dump-page to new structure --- config/types.ts | 32 +---- pages/http-dumps/[id].vue | 9 +- src/entities/http-dump/types.ts | 12 +- src/screens/http-dump/index.ts | 1 + .../http-dump-page/http-dump-page.stories.ts | 4 +- .../ui/http-dump-page/http-dump-page.vue | 118 ++++++++---------- .../http-dump/ui/http-dump-page/index.ts | 1 + src/screens/http-dump/ui/index.ts | 1 + 8 files changed, 65 insertions(+), 113 deletions(-) create mode 100644 src/screens/http-dump/index.ts rename components/HttpDumpPage/HttpDumpPage.stories.ts => src/screens/http-dump/ui/http-dump-page/http-dump-page.stories.ts (91%) rename components/HttpDumpPage/HttpDumpPage.vue => src/screens/http-dump/ui/http-dump-page/http-dump-page.vue (66%) create mode 100644 src/screens/http-dump/ui/http-dump-page/index.ts create mode 100644 src/screens/http-dump/ui/index.ts diff --git a/config/types.ts b/config/types.ts index f75e9f7c..0e07638c 100644 --- a/config/types.ts +++ b/config/types.ts @@ -1,6 +1,4 @@ import { EventId, EventType } from "~/src/shared/types"; -import { Sentry } from "~/src/entities/sentry/types"; -import { Profiler } from "~/src/entities/profiler/types"; export type StatusCode = number; // TODO: update type export type Email = string; // TODO: update type @@ -141,34 +139,6 @@ export interface RayDump { } } -export interface HttpDumpFile { - originalName?: string, - mime: string, - size: number, - id: string; - name?: string; - uri?: string -} - -export interface HttpDump { - received_at: string, - host: string, - request: { - method: string, - uri: string, - headers: { - [key: string]: string[] - }, - body: string, - query: any, // eslint-disable-line @typescript-eslint/no-explicit-any - post: any, // eslint-disable-line @typescript-eslint/no-explicit-any - cookies: { - [key: string]: string - }, - files: HttpDumpFile[] - } -} - export interface InspectorTransaction { model: string, name: string, @@ -237,6 +207,6 @@ export interface NormalizedEvent { serverName: string, date: Date | null, color?: string, - payload: Monolog | SMTP | Sentry | VarDump | Profiler | Inspector | HttpDump | RayDump | unknown + payload: Monolog | SMTP | VarDump | Inspector | RayDump | unknown } diff --git a/pages/http-dumps/[id].vue b/pages/http-dumps/[id].vue index 960dc994..ef9f90a7 100644 --- a/pages/http-dumps/[id].vue +++ b/pages/http-dumps/[id].vue @@ -24,11 +24,12 @@ + - - diff --git a/src/widgets/ui/event-card/event-card.vue b/src/widgets/ui/event-card/event-card.vue index 92092cb3..54ebaf2b 100644 --- a/src/widgets/ui/event-card/event-card.vue +++ b/src/widgets/ui/event-card/event-card.vue @@ -1,6 +1,5 @@ + + + + From 03da9f5c54b38b73bd159fe0ef92e3866e31795b Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sat, 18 Nov 2023 23:33:02 +0400 Subject: [PATCH 60/72] fix storybook file name for http-dump-page --- .../http-dump/ui/http-dump-page/http-dump-page.stories.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screens/http-dump/ui/http-dump-page/http-dump-page.stories.ts b/src/screens/http-dump/ui/http-dump-page/http-dump-page.stories.ts index afc38050..612afcd5 100644 --- a/src/screens/http-dump/ui/http-dump-page/http-dump-page.stories.ts +++ b/src/screens/http-dump/ui/http-dump-page/http-dump-page.stories.ts @@ -6,7 +6,7 @@ import HttpDumpPage from "./http-dump-page.vue"; const { normalizeHttpDumpEvent } = useHttpDump(); export default { - title: "HttpDump/Page/HttpDumpPage", + title: "FSD/screens/http-dump/HttpDumpPage", component: HttpDumpPage } as Meta; From b4ba3f95c23f3a52851dc6d1027530c59dd0b727 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sun, 19 Nov 2023 00:04:35 +0400 Subject: [PATCH 61/72] move home-placeholder to new structure --- .../PagePlaceholder/PagePlaceholder.vue | 196 ------------------ pages/index.vue | 3 +- src/app/{.gitkeep => ui/index.ts} | 0 src/widgets/ui/index.ts | 1 + src/widgets/ui/page-placeholder/index.ts | 1 + .../page-placeholder-item.vue | 38 ++++ .../page-placeholder.stories.ts | 4 +- .../ui/page-placeholder/page-placeholder.vue | 83 ++++++++ 8 files changed, 126 insertions(+), 200 deletions(-) delete mode 100644 components/PagePlaceholder/PagePlaceholder.vue rename src/app/{.gitkeep => ui/index.ts} (100%) create mode 100644 src/widgets/ui/page-placeholder/index.ts create mode 100644 src/widgets/ui/page-placeholder/page-placeholder-item.vue rename components/PagePlaceholder/PagePlaceholder.stories.ts => src/widgets/ui/page-placeholder/page-placeholder.stories.ts (75%) create mode 100644 src/widgets/ui/page-placeholder/page-placeholder.vue diff --git a/components/PagePlaceholder/PagePlaceholder.vue b/components/PagePlaceholder/PagePlaceholder.vue deleted file mode 100644 index 4b00bbd3..00000000 --- a/components/PagePlaceholder/PagePlaceholder.vue +++ /dev/null @@ -1,196 +0,0 @@ - - - - - diff --git a/pages/index.vue b/pages/index.vue index 38fc24a5..d6cfb594 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -48,8 +48,7 @@ + + + + diff --git a/components/PagePlaceholder/PagePlaceholder.stories.ts b/src/widgets/ui/page-placeholder/page-placeholder.stories.ts similarity index 75% rename from components/PagePlaceholder/PagePlaceholder.stories.ts rename to src/widgets/ui/page-placeholder/page-placeholder.stories.ts index 6f1a1464..82c7de88 100644 --- a/components/PagePlaceholder/PagePlaceholder.stories.ts +++ b/src/widgets/ui/page-placeholder/page-placeholder.stories.ts @@ -1,8 +1,8 @@ import { Meta, Story } from "@storybook/vue3"; -import PagePlaceholder from "~/components/PagePlaceholder/PagePlaceholder.vue"; +import PagePlaceholder from "./page-placeholder.vue"; export default { - title: "Components/PagePlaceholder", + title: "FSD/widgets/PagePlaceholder", component: PagePlaceholder }as Meta; diff --git a/src/widgets/ui/page-placeholder/page-placeholder.vue b/src/widgets/ui/page-placeholder/page-placeholder.vue new file mode 100644 index 00000000..70307b99 --- /dev/null +++ b/src/widgets/ui/page-placeholder/page-placeholder.vue @@ -0,0 +1,83 @@ + + + + + From b001d931e7ec8f523dd8ad10fa24129203207db9 Mon Sep 17 00:00:00 2001 From: Kuchuk Andrey Date: Sun, 19 Nov 2023 00:16:01 +0400 Subject: [PATCH 62/72] move sidebar to new file structure --- layouts/default.vue | 2 +- src/widgets/ui/index.ts | 1 + src/widgets/ui/layout-sidebar/index.ts | 1 + .../layout-sidebar/layout-sidebar.stories.ts | 7 ++- .../ui/layout-sidebar/layout-sidebar.vue | 57 ++++++++----------- 5 files changed, 32 insertions(+), 36 deletions(-) create mode 100644 src/widgets/ui/layout-sidebar/index.ts rename components/LayoutSidebar/LayoutSidebar.stories.ts => src/widgets/ui/layout-sidebar/layout-sidebar.stories.ts (73%) rename components/LayoutSidebar/LayoutSidebar.vue => src/widgets/ui/layout-sidebar/layout-sidebar.vue (82%) diff --git a/layouts/default.vue b/layouts/default.vue index 944a405a..6a61116c 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -13,7 +13,7 @@ + - - diff --git a/src/screens/inspector/ui/inspector-page/index.ts b/src/screens/inspector/ui/inspector-page/index.ts new file mode 100644 index 00000000..d4b76f7a --- /dev/null +++ b/src/screens/inspector/ui/inspector-page/index.ts @@ -0,0 +1 @@ +export { default as InspectorPage } from './inspector-page.vue'; diff --git a/components/InspectorPage/InspectorPage.stories.ts b/src/screens/inspector/ui/inspector-page/inspector-page.stories.ts similarity index 74% rename from components/InspectorPage/InspectorPage.stories.ts rename to src/screens/inspector/ui/inspector-page/inspector-page.stories.ts index d030f798..2c83dd3a 100644 --- a/components/InspectorPage/InspectorPage.stories.ts +++ b/src/screens/inspector/ui/inspector-page/inspector-page.stories.ts @@ -1,12 +1,12 @@ import {Meta, Story} from "@storybook/vue3"; -import InspectorPage from '~/components/InspectorPage/InspectorPage.vue'; +import { useInspector } from "~/src/entities/inspector"; import { inspectorMock } from '~/src/entities/inspector/mocks' -import { useInspector } from "~/src/entities/inspector/lib"; +import InspectorPage from './inspector-page.vue'; const { normalizeInspectorEvent } = useInspector(); export default { - title: "Inspector/Page/InspectorPage", + title: "FSD/screens/inspector/InspectorPage", component: InspectorPage } as Meta; @@ -22,6 +22,7 @@ const Template: Story = (args) => ({ export const Default = Template.bind({}); + Default.args = { event: normalizeInspectorEvent(inspectorMock), }; diff --git a/components/InspectorPage/InspectorPage.vue b/src/screens/inspector/ui/inspector-page/inspector-page.vue similarity index 74% rename from components/InspectorPage/InspectorPage.vue rename to src/screens/inspector/ui/inspector-page/inspector-page.vue index 466d7894..db977f2f 100644 --- a/components/InspectorPage/InspectorPage.vue +++ b/src/screens/inspector/ui/inspector-page/inspector-page.vue @@ -1,3 +1,25 @@ + + - - diff --git a/components/RayDumpPreview/RayDumpLaravelPreview.stories.ts b/components/RayDumpPreview/RayDumpLaravelPreview.stories.ts deleted file mode 100644 index 5a2ef3aa..00000000 --- a/components/RayDumpPreview/RayDumpLaravelPreview.stories.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import RayDumpPreview from '~/components/RayDumpPreview/RayDumpPreview.vue'; -import { - rayLaravelQueryMock, - rayLaravelQueryNoBindingsMock, - rayLaravelEloquentMock, - rayLaravelViewsMock, - rayLaravelEventsMock, - rayLaravelJobsMock, -} from '~/src/entities/ray/mocks-laravel'; -import { useRay } from '~/src/entities/ray' - -const { normalizeRayEvent } = useRay(); - -export default { - title: "RayDump/RayDumpPreview/Laravel", - component: RayDumpPreview -} as Meta; - -const Template: Story = (args) => ({ - components: { RayDumpPreview }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const Query = Template.bind({}); -Query.args = {event: normalizeRayEvent(rayLaravelQueryMock),}; - -export const Query2 = Template.bind({}); -Query2.args = {event: normalizeRayEvent(rayLaravelQueryNoBindingsMock),}; - -export const Eloquent = Template.bind({}); -Eloquent.args = {event: normalizeRayEvent(rayLaravelEloquentMock),}; - -export const Views = Template.bind({}); -Views.args = {event: normalizeRayEvent(rayLaravelViewsMock),}; - -export const Events = Template.bind({}); -Events.args = {event: normalizeRayEvent(rayLaravelEventsMock),}; - -export const Jobs = Template.bind({}); -Jobs.args = {event: normalizeRayEvent(rayLaravelJobsMock),}; diff --git a/components/RayDumpPreview/RayDumpPreview.vue b/components/RayDumpPreview/RayDumpPreview.vue deleted file mode 100644 index bf5e4067..00000000 --- a/components/RayDumpPreview/RayDumpPreview.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/components/RayDumpPreview/RayTypesPreview/CallerPayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/CallerPayload.stories.ts deleted file mode 100644 index dd95a7a4..00000000 --- a/components/RayDumpPreview/RayTypesPreview/CallerPayload.stories.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import CallerPayload from '~/components/RayDumpPreview/RayTypesPreview/CallerPayload.vue'; -import { rayCallerMock } from '~/src/entities/ray/mocks'; -import { useRay } from "~/src/entities/ray"; - -const { normalizeRayEvent } = useRay(); - -export default { - title: "RayDump/Types/Caller", - component: CallerPayload -} as Meta; - -const Template: Story = (args) => ({ - components: { CallerPayload }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const Caller = Template.bind({}); -Caller.args = {payload: normalizeRayEvent(rayCallerMock).payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/CallerPayload.vue b/components/RayDumpPreview/RayTypesPreview/CallerPayload.vue deleted file mode 100644 index 8f984931..00000000 --- a/components/RayDumpPreview/RayTypesPreview/CallerPayload.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/CarbonPayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/CarbonPayload.stories.ts deleted file mode 100644 index 2a1edd55..00000000 --- a/components/RayDumpPreview/RayTypesPreview/CarbonPayload.stories.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import CarbonPayload from '~/components/RayDumpPreview/RayTypesPreview/CarbonPayload.vue'; -import { rayCarbonMock } from '~/src/entities/ray/mocks' -import { useRay } from "~/src/entities/ray"; - -const { normalizeRayEvent } = useRay(); - -export default { - title: "RayDump/Types/Carbon", - component: CarbonPayload -} as Meta; - -const Template: Story = (args) => ({ - components: { CarbonPayload }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const Carbon = Template.bind({}); -Carbon.args = {payload: normalizeRayEvent(rayCarbonMock).payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/CarbonPayload.vue b/components/RayDumpPreview/RayTypesPreview/CarbonPayload.vue deleted file mode 100644 index 32753aca..00000000 --- a/components/RayDumpPreview/RayTypesPreview/CarbonPayload.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/CustomPayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/CustomPayload.stories.ts deleted file mode 100644 index d5c77866..00000000 --- a/components/RayDumpPreview/RayTypesPreview/CustomPayload.stories.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import CustomPayload from '~/components/RayDumpPreview/RayTypesPreview/CustomPayload.vue'; -import { rayTextMock } from '~/src/entities/ray/mocks' -import { useRay } from "~/src/entities/ray"; - -const { normalizeRayEvent } = useRay(); - -export default { - title: "RayDump/Types/Custom", - component: CustomPayload -} as Meta; - -const Template: Story = (args) => ({ - components: { CustomPayload }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const Custom = Template.bind({}); -Custom.args = {payload: normalizeRayEvent(rayTextMock).payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/CustomPayload.vue b/components/RayDumpPreview/RayTypesPreview/CustomPayload.vue deleted file mode 100644 index 01bd30eb..00000000 --- a/components/RayDumpPreview/RayTypesPreview/CustomPayload.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/EloquentPayload.vue b/components/RayDumpPreview/RayTypesPreview/EloquentPayload.vue deleted file mode 100644 index f202694f..00000000 --- a/components/RayDumpPreview/RayTypesPreview/EloquentPayload.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/EventPayload.vue b/components/RayDumpPreview/RayTypesPreview/EventPayload.vue deleted file mode 100644 index 228d832b..00000000 --- a/components/RayDumpPreview/RayTypesPreview/EventPayload.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.stories.ts deleted file mode 100644 index 29103baa..00000000 --- a/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.stories.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import ExceptionPayload from '~/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.vue'; -import { rayExceptionMock } from '~/src/entities/ray/mocks'; -import { useRay } from "~/src/entities/ray"; - -const { normalizeRayEvent } = useRay(); - -export default { - title: "RayDump/Types/Exception", - component: ExceptionPayload -} as Meta; - -const Template: Story = (args) => ({ - components: { ExceptionPayload }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const Exception = Template.bind({}); -Exception.args = {payload: normalizeRayEvent(rayExceptionMock).payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.vue b/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.vue deleted file mode 100644 index e0743644..00000000 --- a/components/RayDumpPreview/RayTypesPreview/ExceptionPayload.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/JobPayload.vue b/components/RayDumpPreview/RayTypesPreview/JobPayload.vue deleted file mode 100644 index 95f0e9c6..00000000 --- a/components/RayDumpPreview/RayTypesPreview/JobPayload.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/LockPayload.vue b/components/RayDumpPreview/RayTypesPreview/LockPayload.vue deleted file mode 100644 index 57e2b06f..00000000 --- a/components/RayDumpPreview/RayTypesPreview/LockPayload.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/LogPayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/LogPayload.stories.ts deleted file mode 100644 index 29b97fac..00000000 --- a/components/RayDumpPreview/RayTypesPreview/LogPayload.stories.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import LogPayload from '~/components/RayDumpPreview/RayTypesPreview/LogPayload.vue'; -import { rayColorMock } from '~/src/entities/ray/mocks' -import { useRay } from "~/src/entities/ray"; - -const { normalizeRayEvent } = useRay(); - -export default { - title: "RayDump/Types/Log", - component: LogPayload -} as Meta; - -const Template: Story = (args) => ({ - components: { LogPayload }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const Log = Template.bind({}); -Log.args = {payload: normalizeRayEvent(rayColorMock).payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/LogPayload.vue b/components/RayDumpPreview/RayTypesPreview/LogPayload.vue deleted file mode 100644 index 046098bc..00000000 --- a/components/RayDumpPreview/RayTypesPreview/LogPayload.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/MailablePayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/MailablePayload.stories.ts deleted file mode 100644 index 16f0df35..00000000 --- a/components/RayDumpPreview/RayTypesPreview/MailablePayload.stories.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import MailablePayload from "~/components/RayDumpPreview/RayTypesPreview/MailablePayload.vue"; -import { rayLaravelMailableMock } from '~/src/entities/ray/mocks-laravel' -import { useRay } from "~/src/entities/ray"; - -const { normalizeRayEvent } = useRay(); - -export default { - title: "RayDump/Types/Mailable", - component: MailablePayload -} as Meta; - -const Template: Story = (args) => ({ - components: { MailablePayload}, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const Mailable = Template.bind({}); -Mailable.args = {payload: normalizeRayEvent(rayLaravelMailableMock).payload.payloads[0]}; - diff --git a/components/RayDumpPreview/RayTypesPreview/MailablePayload.vue b/components/RayDumpPreview/RayTypesPreview/MailablePayload.vue deleted file mode 100644 index 852146f4..00000000 --- a/components/RayDumpPreview/RayTypesPreview/MailablePayload.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/MeasurePayload.stories.ts b/components/RayDumpPreview/RayTypesPreview/MeasurePayload.stories.ts deleted file mode 100644 index 682526ef..00000000 --- a/components/RayDumpPreview/RayTypesPreview/MeasurePayload.stories.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Meta, Story } from "@storybook/vue3"; -import MeasurePayload from '~/components/RayDumpPreview/RayTypesPreview/MeasurePayload.vue'; -import { rayMeasureMock, rayMeasureStartMock } from '~/src/entities/ray/mocks' -import { useRay } from "~/src/entities/ray"; - -const { normalizeRayEvent } = useRay(); - -export default { - title: "RayDump/Types/Measure", - component: MeasurePayload -} as Meta; - -const Template: Story = (args) => ({ - components: { MeasurePayload }, - setup() { - return { - args, - }; - }, - template: ``, -}); - -export const Default = Template.bind({}); -Default.args = {payload: normalizeRayEvent(rayMeasureMock).payload.payloads[0]}; - -export const Start = Template.bind({}); -Start.args = {payload: normalizeRayEvent(rayMeasureStartMock).payload.payloads[0]}; diff --git a/components/RayDumpPreview/RayTypesPreview/MeasurePayload.vue b/components/RayDumpPreview/RayTypesPreview/MeasurePayload.vue deleted file mode 100644 index 2d9de06a..00000000 --- a/components/RayDumpPreview/RayTypesPreview/MeasurePayload.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/NotifyPayload.vue b/components/RayDumpPreview/RayTypesPreview/NotifyPayload.vue deleted file mode 100644 index c517121e..00000000 --- a/components/RayDumpPreview/RayTypesPreview/NotifyPayload.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/QueryPayload.vue b/components/RayDumpPreview/RayTypesPreview/QueryPayload.vue deleted file mode 100644 index a6c57d4f..00000000 --- a/components/RayDumpPreview/RayTypesPreview/QueryPayload.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/TablePayload.vue b/components/RayDumpPreview/RayTypesPreview/TablePayload.vue deleted file mode 100644 index cb57ecc4..00000000 --- a/components/RayDumpPreview/RayTypesPreview/TablePayload.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/TracePayload.vue b/components/RayDumpPreview/RayTypesPreview/TracePayload.vue deleted file mode 100644 index 522b9f02..00000000 --- a/components/RayDumpPreview/RayTypesPreview/TracePayload.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/components/RayDumpPreview/RayTypesPreview/ViewsPayload.vue b/components/RayDumpPreview/RayTypesPreview/ViewsPayload.vue deleted file mode 100644 index 43abcd34..00000000 --- a/components/RayDumpPreview/RayTypesPreview/ViewsPayload.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - diff --git a/components/RayDumpTypeMapper/RayDumpTypeMapper.vue b/components/RayDumpTypeMapper/RayDumpTypeMapper.vue deleted file mode 100644 index be1d5c0b..00000000 --- a/components/RayDumpTypeMapper/RayDumpTypeMapper.vue +++ /dev/null @@ -1,79 +0,0 @@ - diff --git a/config/constants.ts b/config/constants.ts index f44829b6..139597f9 100644 --- a/config/constants.ts +++ b/config/constants.ts @@ -1,23 +1,2 @@ -export const RAY_EVENT_TYPES = { - LOG: "log", - // SIZE: "size", - CUSTOM: "custom", - // LABEL: "label", - CALLER: "caller", - CARBON: "carbon", - // COLOR: "color", - EXCEPTION: "exception", - // HIDE: "hide", - MEASURE: "measure", - NOTIFY: "notify", - MAILABLE: "mailable", - TABLE: "table", - TRACE: "trace", - QUERY: "executed_query", - ELOQUENT: "eloquent_model", - VIEW: "view", - EVENT: "event", - JOB: "job_event", - LOCK: "create_lock", -} + diff --git a/src/entities/ray/index.ts b/src/entities/ray/index.ts index f41a696f..03a8d531 100644 --- a/src/entities/ray/index.ts +++ b/src/entities/ray/index.ts @@ -1 +1,2 @@ export * from './lib'; +export * from './ui'; diff --git a/src/entities/ray/lib/use-ray/normalize-ray-event.ts b/src/entities/ray/lib/use-ray/normalize-ray-event.ts index 7735a0ea..c36a6e94 100644 --- a/src/entities/ray/lib/use-ray/normalize-ray-event.ts +++ b/src/entities/ray/lib/use-ray/normalize-ray-event.ts @@ -1,9 +1,8 @@ import pick from "lodash/pick"; -import { RAY_EVENT_TYPES } from "~/config/constants"; -import { EVENT_TYPES, ServerEvent, NormalizedEvent } from "~/src/shared/types"; -import { RayContentColor, RayContentLabel, RayContentSize, RayDump } from "../../types"; +import { EVENT_TYPES, ServerEvent } from "~/src/shared/types"; +import { EnhancedRayEvent, RayContentColor, RayContentLabel, RayContentSize, RayDump, RAY_EVENT_TYPES } from "../../types"; -export const normalizeRayEvent = (event: ServerEvent): NormalizedEvent => { +export const normalizeRayEvent = (event: ServerEvent): EnhancedRayEvent => { let origin = { php_version: event.payload.meta?.php_version, laravel_version: event.payload.meta?.laravel_version, @@ -25,7 +24,7 @@ export const normalizeRayEvent = (event: ServerEvent): NormalizedEvent< .filter(Boolean) const typeLabels = event.payload.payloads - .filter(payload => Object.values(RAY_EVENT_TYPES).includes(payload.type)) + .filter(payload => Object.values(RAY_EVENT_TYPES).includes(payload.type as RAY_EVENT_TYPES)) .map(payload => payload.type) .filter(Boolean) @@ -35,11 +34,11 @@ export const normalizeRayEvent = (event: ServerEvent): NormalizedEvent< .filter(Boolean) .shift() || 'black' - const size = event.payload.payloads + const size = (event.payload.payloads .filter(payload => payload.type === 'size') .map(payload => (payload.content as RayContentSize)?.size) .filter(Boolean) - .shift()|| 'md' + .shift() || 'md') as EnhancedRayEvent['meta']['size'] return { id: event.uuid, @@ -48,8 +47,10 @@ export const normalizeRayEvent = (event: ServerEvent): NormalizedEvent< origin, serverName: "", date: event.timestamp ? new Date(event.timestamp * 1000) : null, - // color, - // size, - payload: event.payload + payload: event.payload, + meta: { + color, + size + } } } diff --git a/src/entities/ray/lib/use-ray/use-ray.ts b/src/entities/ray/lib/use-ray/use-ray.ts index 843fc64e..6aa58687 100644 --- a/src/entities/ray/lib/use-ray/use-ray.ts +++ b/src/entities/ray/lib/use-ray/use-ray.ts @@ -1,9 +1,9 @@ -import { ServerEvent, NormalizedEvent } from '~/src/shared/types'; -import { RayDump } from "../../types"; +import { ServerEvent } from '~/src/shared/types'; +import { EnhancedRayEvent, RayDump } from "../../types"; import { normalizeRayEvent } from "./normalize-ray-event"; type TUseRay = () => { - normalizeRayEvent: (event: ServerEvent) => NormalizedEvent + normalizeRayEvent: (event: ServerEvent) => EnhancedRayEvent } export const useRay: TUseRay = () => ({ diff --git a/src/entities/ray/types.ts b/src/entities/ray/types.ts index 9bbae0d2..2827d276 100644 --- a/src/entities/ray/types.ts +++ b/src/entities/ray/types.ts @@ -1,5 +1,6 @@ +import { NormalizedEvent } from "~/src/shared/types"; -interface RayContentFrame { +export interface RayFrame { file_name: string, line_number: number, class: string | null, @@ -7,6 +8,13 @@ interface RayContentFrame { vendor_frame: boolean, snippet?: { line_number: number, text: string }[] } + +export interface RayPayloadOrigin { + file: string, + line_number: number, + hostname: string, +} + export interface RayContent { content: string, label: string, @@ -22,27 +30,37 @@ export interface RayContentArray { values: string[] | number[] | boolean[] } +export interface RayContentObject { + values: { + [key: string]: string + } +} + export interface RayContentException { class?: string, message?: string, - frames: RayContentFrame[] + frames: RayFrame[] } + export interface RayContentSQL { sql: string, - bindings: string[], + bindings?: string[], connection_name: string time: number } + export interface RayContentEloquent { class_name: string, attributes: string } -export interface RayContentViews { + +export interface RayContentView { view_path: string, view_path_relative_to_project_root: string, data: string } -export interface RayContentJobs { + +export interface RayContentJob { event_name: string, job: string, exception: string | null @@ -63,28 +81,83 @@ export interface RayContentSize { [key: string]: unknown } +export interface RayContentFrame { + frame: RayFrame +} + +export interface RayContentFrames { + frames: RayFrame[] +} + +export interface RayContentMeasure { + name: string, + is_new_timer: boolean, + total_time: number, + max_memory_usage_during_total_time: number, + time_since_last_call: number, + max_memory_usage_since_last_call: number +} + +export interface RayUser { + name: string, + email: string, +} + +export interface RayContentMail { + subject: string, + from: RayUser[], + to: RayUser[], + cc?: RayUser[], + bcc?: RayUser[], + reply_to?: RayUser[], + mailable_class?: string, + html: string +} +export interface RayContentLog { + values: string[] | number[] +} + +export interface RayContentEvent { + name: string, + event: string, + payload: unknown, + class_based_event: boolean +} + +export interface RayContentLock { + name: string, +} + +export interface RayContentCustom { + content?: string, + label?: string, +} + export interface RayPayload { type: string, - origin?: { - file: string, - line_number: number, - hostname: string, - }, + origin?: RayPayloadOrigin, content: RayContentException - | RayContentArray | RayContent + | RayContentArray + | RayContentObject | RayContentCarbone | RayContentSQL | RayContentEloquent - | RayContentViews - | RayContentJobs - | { frame: RayContentFrame } + | RayContentView + | RayContentJob + | RayContentFrame + | RayContentFrames + | RayContentMeasure + | RayContentMail + | RayContentLog + | RayContentEvent + | RayContentCustom | { value: string } | RayContentColor | RayContentLabel - | { name: string } + | RayContentLock | RayContentSize - | never + | unknown[] } export interface RayDump { @@ -99,3 +172,33 @@ export interface RayDump { ray_package_version: string, } } + +export interface EnhancedRayEvent extends NormalizedEvent { + meta: { + color: string, + size: 'sm' | 'md' | 'lg' | 'xl', + } +} + +export enum RAY_EVENT_TYPES { + LOG = "log", + // SIZE = "size", + CUSTOM = "custom", + // LABEL = "label", + CALLER = "caller", + CARBON = "carbon", + // COLOR = "color", + EXCEPTION = "exception", + // HIDE = "hide", + MEASURE = "measure", + NOTIFY = "notify", + MAILABLE = "mailable", + TABLE = "table", + TRACE = "trace", + QUERY = "executed_query", + ELOQUENT = "eloquent_model", + VIEW = "view", + EVENT = "event", + JOB = "job_event", + LOCK = "create_lock", +} diff --git a/src/entities/ray/ui/index.ts b/src/entities/ray/ui/index.ts new file mode 100644 index 00000000..8b9d2f2f --- /dev/null +++ b/src/entities/ray/ui/index.ts @@ -0,0 +1,18 @@ +export * from './ray-frame'; +export * from './ray-carbone'; +export * from './ray-exception'; +export * from './ray-file'; +export * from './ray-trace'; +export * from './ray-origin'; +export * from './ray-measure'; +export * from './ray-table'; +export * from './ray-mail'; +export * from './ray-log'; +export * from './ray-view'; +export * from './ray-job'; +export * from './ray-eloquent'; +export * from './ray-query'; +export * from './ray-event'; +export * from './ray-lock'; +export * from './ray-custom'; +export * from './preview-card'; diff --git a/src/entities/ray/ui/preview-card/index.ts b/src/entities/ray/ui/preview-card/index.ts new file mode 100644 index 00000000..6c61edcd --- /dev/null +++ b/src/entities/ray/ui/preview-card/index.ts @@ -0,0 +1 @@ +export { default as PreviewCard } from './preview-card.vue' diff --git a/components/RayDumpPreview/RayDumpPreview.stories.ts b/src/entities/ray/ui/preview-card/preview-card.stories.ts similarity index 63% rename from components/RayDumpPreview/RayDumpPreview.stories.ts rename to src/entities/ray/ui/preview-card/preview-card.stories.ts index 57acc904..6e8adf23 100644 --- a/components/RayDumpPreview/RayDumpPreview.stories.ts +++ b/src/entities/ray/ui/preview-card/preview-card.stories.ts @@ -1,5 +1,5 @@ import { Meta, Story } from "@storybook/vue3"; -import RayDumpPreview from '~/components/RayDumpPreview/RayDumpPreview.vue'; +import { useRay } from "../../lib"; import { rayCallerMock, rayCarbonMock, @@ -20,30 +20,37 @@ import { rayTextMock, rayTraceMock, rayLockMock, -} from '~/src/entities/ray/mocks'; -import { useRay } from "~/src/entities/ray"; +} from '../../mocks'; +import { + rayLaravelEloquentMock, rayLaravelEventsMock, rayLaravelJobsMock, + rayLaravelQueryMock, + rayLaravelQueryNoBindingsMock, rayLaravelViewsMock +} from "../../mocks-laravel"; +import PreviewCard from './preview-card.vue'; const { normalizeRayEvent } = useRay() export default { - title: "RayDump/RayDumpPreview/Common", - component: RayDumpPreview -} as Meta; + title: "FSD/entities/ray/PreviewCard", + component: PreviewCard +} as Meta; const Template: Story = (args) => ({ - components: { RayDumpPreview }, + components: { PreviewCard }, setup() { return { args, }; }, - template: ``, + template: ``, }); export const Text = Template.bind({}); - Text.args = {event: normalizeRayEvent(rayTextMock),}; +export const EmptyText = Template.bind({}); +EmptyText.args = {event: normalizeRayEvent(rayEmptyStringMock),}; + export const Trace = Template.bind({}); Trace.args = {event: normalizeRayEvent(rayTraceMock),}; @@ -95,5 +102,20 @@ Caller.args = {event: normalizeRayEvent(rayCallerMock),}; export const Lock = Template.bind({}); Lock.args = {event: normalizeRayEvent(rayLockMock),}; -export const Issue44 = Template.bind({}); -Issue44.args = {event: normalizeRayEvent(rayEmptyStringMock),}; +export const LaravelQuery = Template.bind({}); +LaravelQuery.args = {event: normalizeRayEvent(rayLaravelQueryMock),}; + +export const LaravelQuery2 = Template.bind({}); +LaravelQuery2.args = {event: normalizeRayEvent(rayLaravelQueryNoBindingsMock),}; + +export const LaravelEloquent = Template.bind({}); +LaravelEloquent.args = {event: normalizeRayEvent(rayLaravelEloquentMock),}; + +export const LaravelViews = Template.bind({}); +LaravelViews.args = {event: normalizeRayEvent(rayLaravelViewsMock),}; + +export const LaravelEvents = Template.bind({}); +LaravelEvents.args = {event: normalizeRayEvent(rayLaravelEventsMock),}; + +export const LaravelJobs = Template.bind({}); +LaravelJobs.args = {event: normalizeRayEvent(rayLaravelJobsMock),}; diff --git a/src/entities/ray/ui/preview-card/preview-card.vue b/src/entities/ray/ui/preview-card/preview-card.vue new file mode 100644 index 00000000..0027d082 --- /dev/null +++ b/src/entities/ray/ui/preview-card/preview-card.vue @@ -0,0 +1,174 @@ + + + diff --git a/src/entities/ray/ui/ray-carbone/index.ts b/src/entities/ray/ui/ray-carbone/index.ts new file mode 100644 index 00000000..3f62df3f --- /dev/null +++ b/src/entities/ray/ui/ray-carbone/index.ts @@ -0,0 +1 @@ +export { default as RayCarbone } from './ray-carbone.vue' diff --git a/src/entities/ray/ui/ray-carbone/ray-carbone.stories.ts b/src/entities/ray/ui/ray-carbone/ray-carbone.stories.ts new file mode 100644 index 00000000..2ec68b55 --- /dev/null +++ b/src/entities/ray/ui/ray-carbone/ray-carbone.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayCarbonMock } from '../../mocks' +import { RayContentCarbone } from "../../types"; +import RayCarbon from './ray-carbone.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayCarbon", + component: RayCarbon +} as Meta; + +const Template: Story = (args) => ({ + components: { RayCarbon }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + carbone: normalizeRayEvent(rayCarbonMock).payload.payloads[0].content as RayContentCarbone, +}; diff --git a/src/entities/ray/ui/ray-carbone/ray-carbone.vue b/src/entities/ray/ui/ray-carbone/ray-carbone.vue new file mode 100644 index 00000000..f8434a0d --- /dev/null +++ b/src/entities/ray/ui/ray-carbone/ray-carbone.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/src/entities/ray/ui/ray-custom/index.ts b/src/entities/ray/ui/ray-custom/index.ts new file mode 100644 index 00000000..bc8cd8f0 --- /dev/null +++ b/src/entities/ray/ui/ray-custom/index.ts @@ -0,0 +1 @@ +export { default as RayCustom } from './ray-custom.vue'; diff --git a/src/entities/ray/ui/ray-custom/ray-custom.stories.ts b/src/entities/ray/ui/ray-custom/ray-custom.stories.ts new file mode 100644 index 00000000..3dcc2fa4 --- /dev/null +++ b/src/entities/ray/ui/ray-custom/ray-custom.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayTextMock } from '../../mocks'; +import { RayContentCustom } from '../../types'; +import RayCustom from './ray-custom.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayCustom", + component: RayCustom +} as Meta; + +const Template: Story = (args) => ({ + components: { RayCustom }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + content: (normalizeRayEvent(rayTextMock).payload.payloads[0].content as RayContentCustom) +}; diff --git a/src/entities/ray/ui/ray-custom/ray-custom.vue b/src/entities/ray/ui/ray-custom/ray-custom.vue new file mode 100644 index 00000000..4bc1f1c9 --- /dev/null +++ b/src/entities/ray/ui/ray-custom/ray-custom.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/src/entities/ray/ui/ray-eloquent/index.ts b/src/entities/ray/ui/ray-eloquent/index.ts new file mode 100644 index 00000000..ebb481df --- /dev/null +++ b/src/entities/ray/ui/ray-eloquent/index.ts @@ -0,0 +1 @@ +export { default as RayEloquent } from './ray-eloquent.vue'; diff --git a/src/entities/ray/ui/ray-eloquent/ray-eloquent.stories.ts b/src/entities/ray/ui/ray-eloquent/ray-eloquent.stories.ts new file mode 100644 index 00000000..3055eddd --- /dev/null +++ b/src/entities/ray/ui/ray-eloquent/ray-eloquent.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayLaravelEloquentMock } from '../../mocks-laravel'; +import { RayContentEloquent, RayContentJob } from '../../types'; +import RayEloquent from './ray-eloquent.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayEloquent", + component: RayEloquent +} as Meta; + +const Template: Story = (args) => ({ + components: { RayEloquent }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + content: (normalizeRayEvent(rayLaravelEloquentMock).payload.payloads[0].content as RayContentEloquent) +}; diff --git a/src/entities/ray/ui/ray-eloquent/ray-eloquent.vue b/src/entities/ray/ui/ray-eloquent/ray-eloquent.vue new file mode 100644 index 00000000..54e79eb3 --- /dev/null +++ b/src/entities/ray/ui/ray-eloquent/ray-eloquent.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/entities/ray/ui/ray-event/index.ts b/src/entities/ray/ui/ray-event/index.ts new file mode 100644 index 00000000..41667122 --- /dev/null +++ b/src/entities/ray/ui/ray-event/index.ts @@ -0,0 +1 @@ +export { default as RayEvent } from './ray-event.vue'; diff --git a/src/entities/ray/ui/ray-event/ray-event.stories.ts b/src/entities/ray/ui/ray-event/ray-event.stories.ts new file mode 100644 index 00000000..2daf2b16 --- /dev/null +++ b/src/entities/ray/ui/ray-event/ray-event.stories.ts @@ -0,0 +1,28 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayLaravelEventsMock } from '../../mocks-laravel'; +import { RayContentEvent } from '../../types'; +import RayEvent from './ray-event.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayEvent", + component: RayEvent +} as Meta; + +const Template: Story = (args) => ({ + components: { RayEvent }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + content: (normalizeRayEvent(rayLaravelEventsMock).payload.payloads[0].content as RayContentEvent) +}; + diff --git a/src/entities/ray/ui/ray-event/ray-event.vue b/src/entities/ray/ui/ray-event/ray-event.vue new file mode 100644 index 00000000..98e0c086 --- /dev/null +++ b/src/entities/ray/ui/ray-event/ray-event.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/entities/ray/ui/ray-exception/index.ts b/src/entities/ray/ui/ray-exception/index.ts new file mode 100644 index 00000000..513a5e59 --- /dev/null +++ b/src/entities/ray/ui/ray-exception/index.ts @@ -0,0 +1 @@ +export { default as RayException } from './ray-exception.vue'; diff --git a/src/entities/ray/ui/ray-exception/ray-exception.stories.ts b/src/entities/ray/ui/ray-exception/ray-exception.stories.ts new file mode 100644 index 00000000..c78d253f --- /dev/null +++ b/src/entities/ray/ui/ray-exception/ray-exception.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayExceptionMock } from '../../mocks'; +import { RayContentException } from "../../types"; +import RayException from './ray-exception.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayException", + component: RayException +} as Meta; + +const Template: Story = (args) => ({ + components: { RayException }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Exception = Template.bind({}); +Exception.args = { + exception: normalizeRayEvent(rayExceptionMock).payload.payloads[0].content as RayContentException, +}; diff --git a/src/entities/ray/ui/ray-exception/ray-exception.vue b/src/entities/ray/ui/ray-exception/ray-exception.vue new file mode 100644 index 00000000..af7b9854 --- /dev/null +++ b/src/entities/ray/ui/ray-exception/ray-exception.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/src/entities/ray/ui/ray-file/index.ts b/src/entities/ray/ui/ray-file/index.ts new file mode 100644 index 00000000..0c577d41 --- /dev/null +++ b/src/entities/ray/ui/ray-file/index.ts @@ -0,0 +1 @@ +export { default as RayFile } from './ray-file.vue'; diff --git a/src/entities/ray/ui/ray-file/ray-file.stories.ts b/src/entities/ray/ui/ray-file/ray-file.stories.ts new file mode 100644 index 00000000..e5e281c2 --- /dev/null +++ b/src/entities/ray/ui/ray-file/ray-file.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayExceptionMock } from "../../mocks"; +import { RayContentException } from "../../types"; +import RayFile from "./ray-file.vue"; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayFile", + component: RayFile +} as Meta; + +const Template: Story = (args) => ({ + components: { RayFile }, + setup() { + return { + args, + }; + }, + template: `This is a row 1`, +}); + +export const FileDefault = Template.bind({}); +FileDefault.args = { + file: (normalizeRayEvent(rayExceptionMock).payload.payloads[0].content as RayContentException).frames[0] +}; diff --git a/src/entities/ray/ui/ray-file/ray-file.vue b/src/entities/ray/ui/ray-file/ray-file.vue new file mode 100644 index 00000000..7b737702 --- /dev/null +++ b/src/entities/ray/ui/ray-file/ray-file.vue @@ -0,0 +1,96 @@ + + + + diff --git a/src/entities/ray/ui/ray-frame/index.ts b/src/entities/ray/ui/ray-frame/index.ts new file mode 100644 index 00000000..f715bf6d --- /dev/null +++ b/src/entities/ray/ui/ray-frame/index.ts @@ -0,0 +1 @@ +export { default as RayFrame } from './ray-frame.vue'; diff --git a/src/entities/ray/ui/ray-frame/ray-frame.stories.ts b/src/entities/ray/ui/ray-frame/ray-frame.stories.ts new file mode 100644 index 00000000..26d62d2f --- /dev/null +++ b/src/entities/ray/ui/ray-frame/ray-frame.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayCallerMock } from '../../mocks'; +import { RayContentFrame } from '../../types'; +import RayFrame from './ray-frame.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayFrame", + component: RayFrame +} as Meta; + +const Template: Story = (args) => ({ + components: { RayFrame }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + frame: (normalizeRayEvent(rayCallerMock).payload.payloads[0].content as RayContentFrame).frame +}; diff --git a/src/entities/ray/ui/ray-frame/ray-frame.vue b/src/entities/ray/ui/ray-frame/ray-frame.vue new file mode 100644 index 00000000..8a75e2fd --- /dev/null +++ b/src/entities/ray/ui/ray-frame/ray-frame.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/entities/ray/ui/ray-job/index.ts b/src/entities/ray/ui/ray-job/index.ts new file mode 100644 index 00000000..851c0dac --- /dev/null +++ b/src/entities/ray/ui/ray-job/index.ts @@ -0,0 +1 @@ +export { default as RayJob } from './ray-job.vue'; diff --git a/src/entities/ray/ui/ray-job/ray-job.stories.ts b/src/entities/ray/ui/ray-job/ray-job.stories.ts new file mode 100644 index 00000000..f98c65ed --- /dev/null +++ b/src/entities/ray/ui/ray-job/ray-job.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayLaravelJobsMock } from '../../mocks-laravel'; +import { RayContentJob } from '../../types'; +import RayJob from './ray-job.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayJob", + component: RayJob +} as Meta; + +const Template: Story = (args) => ({ + components: { RayJob }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + content: (normalizeRayEvent(rayLaravelJobsMock).payload.payloads[0].content as RayContentJob) +}; diff --git a/src/entities/ray/ui/ray-job/ray-job.vue b/src/entities/ray/ui/ray-job/ray-job.vue new file mode 100644 index 00000000..cd390f72 --- /dev/null +++ b/src/entities/ray/ui/ray-job/ray-job.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/src/entities/ray/ui/ray-lock/index.ts b/src/entities/ray/ui/ray-lock/index.ts new file mode 100644 index 00000000..34473194 --- /dev/null +++ b/src/entities/ray/ui/ray-lock/index.ts @@ -0,0 +1 @@ +export { default as RayLock } from './ray-lock.vue'; diff --git a/src/entities/ray/ui/ray-lock/ray-lock.stories.ts b/src/entities/ray/ui/ray-lock/ray-lock.stories.ts new file mode 100644 index 00000000..3650df51 --- /dev/null +++ b/src/entities/ray/ui/ray-lock/ray-lock.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayLockMock } from '../../mocks' +import { RayContentLock } from '../../types' +import RayLock from './ray-lock.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayLock", + component: RayLock +} as Meta; + +const Template: Story = (args) => ({ + components: { RayLock }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + name: (normalizeRayEvent(rayLockMock).payload.payloads[0].content as RayContentLock).name +}; diff --git a/src/entities/ray/ui/ray-lock/ray-lock.vue b/src/entities/ray/ui/ray-lock/ray-lock.vue new file mode 100644 index 00000000..36e92c4f --- /dev/null +++ b/src/entities/ray/ui/ray-lock/ray-lock.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/src/entities/ray/ui/ray-log/index.ts b/src/entities/ray/ui/ray-log/index.ts new file mode 100644 index 00000000..e34e36f2 --- /dev/null +++ b/src/entities/ray/ui/ray-log/index.ts @@ -0,0 +1 @@ +export { default as RayLog } from './ray-log.vue' diff --git a/src/entities/ray/ui/ray-log/ray-log.stories.ts b/src/entities/ray/ui/ray-log/ray-log.stories.ts new file mode 100644 index 00000000..94e91798 --- /dev/null +++ b/src/entities/ray/ui/ray-log/ray-log.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayColorMock } from '../../mocks' +import { RayContentLog } from '../../types' +import RayLog from './ray-log.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayLog", + component: RayLog +} as Meta; + +const Template: Story = (args) => ({ + components: { RayLog }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + log: (normalizeRayEvent(rayColorMock).payload.payloads[0].content as RayContentLog).values[0] +}; diff --git a/src/entities/ray/ui/ray-log/ray-log.vue b/src/entities/ray/ui/ray-log/ray-log.vue new file mode 100644 index 00000000..b5445e80 --- /dev/null +++ b/src/entities/ray/ui/ray-log/ray-log.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/src/entities/ray/ui/ray-mail/index.ts b/src/entities/ray/ui/ray-mail/index.ts new file mode 100644 index 00000000..57da2b83 --- /dev/null +++ b/src/entities/ray/ui/ray-mail/index.ts @@ -0,0 +1 @@ +export { default as RayMail } from './ray-mail.vue' diff --git a/src/entities/ray/ui/ray-mail/ray-mail.stories.ts b/src/entities/ray/ui/ray-mail/ray-mail.stories.ts new file mode 100644 index 00000000..8907dbea --- /dev/null +++ b/src/entities/ray/ui/ray-mail/ray-mail.stories.ts @@ -0,0 +1,28 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayLaravelMailableMock } from '../../mocks-laravel' +import { RayContentMail } from "../../types"; +import RayMail from "./ray-mail.vue"; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayMail", + component: RayMail +} as Meta; + +const Template: Story = (args) => ({ + components: { RayMail}, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Mailable = Template.bind({}); +Mailable.args = { + content: normalizeRayEvent(rayLaravelMailableMock).payload.payloads[0].content as RayContentMail +}; + diff --git a/src/entities/ray/ui/ray-mail/ray-mail.vue b/src/entities/ray/ui/ray-mail/ray-mail.vue new file mode 100644 index 00000000..19b7b671 --- /dev/null +++ b/src/entities/ray/ui/ray-mail/ray-mail.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/src/entities/ray/ui/ray-measure/index.ts b/src/entities/ray/ui/ray-measure/index.ts new file mode 100644 index 00000000..94b4c476 --- /dev/null +++ b/src/entities/ray/ui/ray-measure/index.ts @@ -0,0 +1 @@ +export { default as RayMeasure } from './ray-measure.vue' diff --git a/src/entities/ray/ui/ray-measure/ray-measure.stories.ts b/src/entities/ray/ui/ray-measure/ray-measure.stories.ts new file mode 100644 index 00000000..48cb0f70 --- /dev/null +++ b/src/entities/ray/ui/ray-measure/ray-measure.stories.ts @@ -0,0 +1,32 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayMeasureMock, rayMeasureStartMock } from '../../mocks' +import { RayContentMeasure } from "../../types"; +import RayMeasure from './ray-measure.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayMeasure", + component: RayMeasure +} as Meta; + +const Template: Story = (args) => ({ + components: { RayMeasure }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + measure: normalizeRayEvent(rayMeasureMock).payload.payloads[0].content as RayContentMeasure +}; + +export const Start = Template.bind({}); +Start.args = { + measure: normalizeRayEvent(rayMeasureStartMock).payload.payloads[0].content as RayContentMeasure +}; diff --git a/src/entities/ray/ui/ray-measure/ray-measure.vue b/src/entities/ray/ui/ray-measure/ray-measure.vue new file mode 100644 index 00000000..e2cbd4fa --- /dev/null +++ b/src/entities/ray/ui/ray-measure/ray-measure.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/src/entities/ray/ui/ray-origin/index.ts b/src/entities/ray/ui/ray-origin/index.ts new file mode 100644 index 00000000..5024283d --- /dev/null +++ b/src/entities/ray/ui/ray-origin/index.ts @@ -0,0 +1 @@ +export { default as RayOrigin } from './ray-origin.vue'; diff --git a/src/entities/ray/ui/ray-origin/ray-origin.stories.ts b/src/entities/ray/ui/ray-origin/ray-origin.stories.ts new file mode 100644 index 00000000..f3f11abb --- /dev/null +++ b/src/entities/ray/ui/ray-origin/ray-origin.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayCallerMock } from '../../mocks'; +import { RayPayloadOrigin } from '../../types'; +import RayOrigin from './ray-origin.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayOrigin", + component: RayOrigin +} as Meta; + +const Template: Story = (args) => ({ + components: { RayOrigin }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + origin: (normalizeRayEvent(rayCallerMock).payload.payloads[0].origin as RayPayloadOrigin) +}; diff --git a/src/entities/ray/ui/ray-origin/ray-origin.vue b/src/entities/ray/ui/ray-origin/ray-origin.vue new file mode 100644 index 00000000..f5577d7a --- /dev/null +++ b/src/entities/ray/ui/ray-origin/ray-origin.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/src/entities/ray/ui/ray-query/index.ts b/src/entities/ray/ui/ray-query/index.ts new file mode 100644 index 00000000..31ba576b --- /dev/null +++ b/src/entities/ray/ui/ray-query/index.ts @@ -0,0 +1 @@ +export { default as RayQuery } from './ray-query.vue'; diff --git a/src/entities/ray/ui/ray-query/ray-query.stories.ts b/src/entities/ray/ui/ray-query/ray-query.stories.ts new file mode 100644 index 00000000..6f6f98d6 --- /dev/null +++ b/src/entities/ray/ui/ray-query/ray-query.stories.ts @@ -0,0 +1,33 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayLaravelQueryMock, rayLaravelQueryNoBindingsMock } from '../../mocks-laravel'; +import { RayContentSQL } from '../../types'; +import RayQuery from './ray-query.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayQuery", + component: RayQuery +} as Meta; + +const Template: Story = (args) => ({ + components: { RayQuery }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + content: (normalizeRayEvent(rayLaravelQueryMock).payload.payloads[0].content as RayContentSQL) +}; + + +export const NoBindings = Template.bind({}); +NoBindings.args = { + content: (normalizeRayEvent(rayLaravelQueryNoBindingsMock).payload.payloads[0].content as RayContentSQL) +}; diff --git a/src/entities/ray/ui/ray-query/ray-query.vue b/src/entities/ray/ui/ray-query/ray-query.vue new file mode 100644 index 00000000..3f2b2202 --- /dev/null +++ b/src/entities/ray/ui/ray-query/ray-query.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/src/entities/ray/ui/ray-table/index.ts b/src/entities/ray/ui/ray-table/index.ts new file mode 100644 index 00000000..bfe1ebcf --- /dev/null +++ b/src/entities/ray/ui/ray-table/index.ts @@ -0,0 +1 @@ +export { default as RayTable } from './ray-table.vue'; diff --git a/src/entities/ray/ui/ray-table/ray-table.stories.ts b/src/entities/ray/ui/ray-table/ray-table.stories.ts new file mode 100644 index 00000000..02d6d2b1 --- /dev/null +++ b/src/entities/ray/ui/ray-table/ray-table.stories.ts @@ -0,0 +1,28 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayMeasureMock, rayTableMock } from '../../mocks' +import { RayContentMeasure } from "../../types"; +import RayTable from './ray-table.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayTable", + component: RayTable +} as Meta; + +const Template: Story = (args) => ({ + components: { RayTable }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + table: normalizeRayEvent(rayTableMock).payload.payloads[0].content as RayContentMeasure +}; + diff --git a/src/entities/ray/ui/ray-table/ray-table.vue b/src/entities/ray/ui/ray-table/ray-table.vue new file mode 100644 index 00000000..52bec031 --- /dev/null +++ b/src/entities/ray/ui/ray-table/ray-table.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/entities/ray/ui/ray-trace/index.ts b/src/entities/ray/ui/ray-trace/index.ts new file mode 100644 index 00000000..086b9672 --- /dev/null +++ b/src/entities/ray/ui/ray-trace/index.ts @@ -0,0 +1 @@ +export { default as RayTrace } from './ray-trace.vue'; diff --git a/src/entities/ray/ui/ray-trace/ray-trace.stories.ts b/src/entities/ray/ui/ray-trace/ray-trace.stories.ts new file mode 100644 index 00000000..bac71555 --- /dev/null +++ b/src/entities/ray/ui/ray-trace/ray-trace.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayTraceMock } from '../../mocks'; +import { RayContentFrames } from '../../types'; +import RayTrace from './ray-trace.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayTrace", + component: RayTrace +} as Meta; + +const Template: Story = (args) => ({ + components: { RayTrace }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + frames: (normalizeRayEvent(rayTraceMock).payload.payloads[0].content as RayContentFrames).frames +}; diff --git a/src/entities/ray/ui/ray-trace/ray-trace.vue b/src/entities/ray/ui/ray-trace/ray-trace.vue new file mode 100644 index 00000000..7c704c02 --- /dev/null +++ b/src/entities/ray/ui/ray-trace/ray-trace.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/entities/ray/ui/ray-view/index.ts b/src/entities/ray/ui/ray-view/index.ts new file mode 100644 index 00000000..84080245 --- /dev/null +++ b/src/entities/ray/ui/ray-view/index.ts @@ -0,0 +1 @@ +export { default as RayView } from './ray-view.vue' diff --git a/src/entities/ray/ui/ray-view/ray-view.stories.ts b/src/entities/ray/ui/ray-view/ray-view.stories.ts new file mode 100644 index 00000000..8bbe08c4 --- /dev/null +++ b/src/entities/ray/ui/ray-view/ray-view.stories.ts @@ -0,0 +1,27 @@ +import { Meta, Story } from "@storybook/vue3"; +import { useRay } from "../../lib"; +import { rayLaravelViewsMock } from '../../mocks-laravel'; +import { RayContentView } from '../../types'; +import RayViews from './ray-view.vue'; + +const { normalizeRayEvent } = useRay(); + +export default { + title: "FSD/entities/ray/RayView", + component: RayViews +} as Meta; + +const Template: Story = (args) => ({ + components: { RayViews }, + setup() { + return { + args, + }; + }, + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = { + view: normalizeRayEvent(rayLaravelViewsMock).payload.payloads[0].content as RayContentView +}; diff --git a/src/entities/ray/ui/ray-view/ray-view.vue b/src/entities/ray/ui/ray-view/ray-view.vue new file mode 100644 index 00000000..7a021171 --- /dev/null +++ b/src/entities/ray/ui/ray-view/ray-view.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/src/widgets/ui/event-card/event-card.vue b/src/widgets/ui/event-card/event-card.vue index fa2232bc..238a08aa 100644 --- a/src/widgets/ui/event-card/event-card.vue +++ b/src/widgets/ui/event-card/event-card.vue @@ -1,6 +1,5 @@