app-devtools 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/main.d.ts +62 -0
  2. package/dist/main.js +2396 -0
  3. package/dist/main.umd.cjs +753 -0
  4. package/package.json +21 -16
  5. package/.eslintignore +0 -3
  6. package/.eslintrc.cjs +0 -112
  7. package/.gitattributes +0 -22
  8. package/.prettierrc +0 -10
  9. package/.quokka.ts +0 -115
  10. package/.vscode/settings.json +0 -7
  11. package/.vscode/snippets.code-snippets +0 -75
  12. package/.vscode/tasks.json +0 -17
  13. package/index.html +0 -46
  14. package/pnpm-lock.yaml +0 -5313
  15. package/scripts/check-if-is-sync.sh +0 -6
  16. package/scripts/filterFetchRequests.ts +0 -60
  17. package/src/Root.tsx +0 -11
  18. package/src/assets/icons/caret-down.svg +0 -11
  19. package/src/assets/icons/network.svg +0 -6
  20. package/src/assets/icons/search.svg +0 -3
  21. package/src/assets/icons/send.svg +0 -3
  22. package/src/assets/icons/settings.svg +0 -3
  23. package/src/components/ButtonElement.tsx +0 -18
  24. package/src/components/Icon.tsx +0 -44
  25. package/src/components/Section.tsx +0 -57
  26. package/src/components/Select.tsx +0 -101
  27. package/src/components/ValueVisualizer.tsx +0 -397
  28. package/src/config/icons.tsx +0 -23
  29. package/src/initializeApp.tsx +0 -28
  30. package/src/initializeDevTools.ts +0 -33
  31. package/src/main.ts +0 -42
  32. package/src/mocks/mockedRequests.json +0 -28391
  33. package/src/pages/api-explorer/ApiExplorerMenu.tsx +0 -136
  34. package/src/pages/api-explorer/ApiExplorerMenuItem.tsx +0 -208
  35. package/src/pages/api-explorer/Diff.tsx +0 -223
  36. package/src/pages/api-explorer/RequestDetails.tsx +0 -264
  37. package/src/pages/api-explorer/Timeline.tsx +0 -174
  38. package/src/pages/api-explorer/api-explorer.tsx +0 -21
  39. package/src/pages/api-explorer/getRequestPayload.tsx +0 -15
  40. package/src/pages/app/App.tsx +0 -79
  41. package/src/stores/callsStore.ts +0 -267
  42. package/src/stores/uiStore.ts +0 -15
  43. package/src/style/globalStyle.ts +0 -54
  44. package/src/style/helpers/allowTextSelection.ts +0 -7
  45. package/src/style/helpers/anchorColor.ts +0 -9
  46. package/src/style/helpers/centerContent.ts +0 -5
  47. package/src/style/helpers/circle.ts +0 -7
  48. package/src/style/helpers/ellipsis.ts +0 -8
  49. package/src/style/helpers/fillContainer.ts +0 -7
  50. package/src/style/helpers/gradientBorder.ts +0 -28
  51. package/src/style/helpers/gradientText.ts +0 -8
  52. package/src/style/helpers/inline.ts +0 -34
  53. package/src/style/helpers/mountAnim.ts +0 -26
  54. package/src/style/helpers/multilineEllipsis.ts +0 -8
  55. package/src/style/helpers/outline.ts +0 -5
  56. package/src/style/helpers/responsiveSize.ts +0 -27
  57. package/src/style/helpers/stack.ts +0 -36
  58. package/src/style/helpers/transition.ts +0 -63
  59. package/src/style/mediaQueries.ts +0 -6
  60. package/src/style/reset.ts +0 -75
  61. package/src/style/scrollBar.ts +0 -37
  62. package/src/style/theme.ts +0 -35
  63. package/src/types/global.d.ts +0 -8
  64. package/src/utils/initializeScreenLogger.ts +0 -12
  65. package/tsconfig.json +0 -36
  66. package/tsconfig.prod.json +0 -10
  67. package/tsup.config.ts +0 -7
  68. package/utils/arrayUtils.ts +0 -29
  69. package/utils/assertions.ts +0 -7
  70. package/utils/autoIncrementId.ts +0 -5
  71. package/utils/createThemev2.ts +0 -64
  72. package/utils/cx.ts +0 -27
  73. package/utils/getDiff.ts +0 -15
  74. package/utils/hexToRgb.ts +0 -14
  75. package/utils/objectUtils.ts +0 -3
  76. package/utils/parseUnit.ts +0 -10
  77. package/utils/solid.ts +0 -76
  78. package/utils/truncateText.ts +0 -7
  79. package/utils/tryExpression.ts +0 -14
  80. package/utils/typed.ts +0 -23
  81. package/utils/typings.ts +0 -40
  82. package/utils/urlPattern.ts +0 -25
  83. package/vite.config.ts +0 -46
@@ -1,6 +0,0 @@
1
- if [[ `git status --porcelain` ]]; then
2
- echo "Commit you changes before publish"
3
- exit 1
4
- else
5
- exit 0
6
- fi
@@ -1,60 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-argument */
2
- /* eslint-disable @typescript-eslint/no-unsafe-return */
3
- /* eslint-disable @typescript-eslint/no-unsafe-call */
4
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
5
- import { readFileSync, writeFileSync } from 'fs'
6
-
7
- const harFile = readFileSync('./jestorRequests.har', 'utf8')
8
-
9
- const har = JSON.parse(harFile)
10
-
11
- const filteredHar = har.log.entries.filter((entry: any) => {
12
- return (
13
- entry.request.url.includes('api.jestor') &&
14
- entry.request.method !== 'OPTIONS'
15
- )
16
- })
17
-
18
- const normalizedValues = filteredHar.map((entry: any) => {
19
- const { request, response, time, startedDateTime } = entry
20
-
21
- let payload = request.postData?.params[0].value
22
-
23
- try {
24
- payload = payload && JSON.parse(payload)
25
-
26
- if (payload.token) {
27
- payload.token = undefined
28
- }
29
- } catch (error) {
30
- payload = undefined
31
- console.log('error', payload)
32
- }
33
-
34
- let reqRes = response.content.text
35
- reqRes = reqRes && JSON.parse(reqRes)
36
-
37
- const urlObject = new URL(request.url)
38
-
39
- return {
40
- request: {
41
- method: request.method,
42
- path: urlObject.pathname + urlObject.search,
43
- payload,
44
- },
45
- response: {
46
- status: response.status,
47
- body: reqRes?.data,
48
- },
49
- stats: {
50
- time,
51
- startTime: new Date(startedDateTime).getTime(),
52
- },
53
- metadata: reqRes?.metadata,
54
- }
55
- })
56
-
57
- writeFileSync(
58
- './src/mocks/mockedRequests.json',
59
- JSON.stringify(normalizedValues, null, 2),
60
- )
package/src/Root.tsx DELETED
@@ -1,11 +0,0 @@
1
- import { App } from '@src/pages/app/App'
2
-
3
- const Root = () => {
4
- return (
5
- <>
6
- <App />
7
- </>
8
- )
9
- }
10
-
11
- export default Root
@@ -1,11 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- width="32"
4
- height="32"
5
- viewBox="0 0 32 32"
6
- >
7
- <path
8
- fill="currentColor"
9
- d="m24 12l-8 10l-8-10z"
10
- />
11
- </svg>
@@ -1,6 +0,0 @@
1
- <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M21 28C22.1046 28 23 27.1046 23 26C23 24.8954 22.1046 24 21 24C19.8954 24 19 24.8954 19 26C19 27.1046 19.8954 28 21 28Z" fill="currentColor"/>
3
- <path d="M21 8C22.1046 8 23 7.10457 23 6C23 4.89543 22.1046 4 21 4C19.8954 4 19 4.89543 19 6C19 7.10457 19.8954 8 21 8Z" fill="currentColor"/>
4
- <path d="M4 18C5.10457 18 6 17.1046 6 16C6 14.8954 5.10457 14 4 14C2.89543 14 2 14.8954 2 16C2 17.1046 2.89543 18 4 18Z" fill="currentColor"/>
5
- <path d="M28 12C27.1156 12.0026 26.2571 12.2986 25.5589 12.8415C24.8608 13.3844 24.3624 14.1435 24.142 15H19.858C19.7164 14.4361 19.4525 13.9101 19.085 13.4595C18.7175 13.0089 18.2555 12.6446 17.7315 12.3924C17.2076 12.1402 16.6346 12.0064 16.0532 12.0002C15.4718 11.9941 14.8961 12.1159 14.367 12.357L11.19 8.387C11.7126 7.7007 11.997 6.86262 12 6C12 5.20887 11.7654 4.43552 11.3259 3.77772C10.8864 3.11992 10.2616 2.60723 9.53073 2.30448C8.79983 2.00173 7.99556 1.92252 7.21964 2.07686C6.44371 2.2312 5.73098 2.61216 5.17157 3.17157C4.61216 3.73098 4.2312 4.44371 4.07686 5.21964C3.92252 5.99556 4.00173 6.79983 4.30448 7.53073C4.60723 8.26164 5.11992 8.88635 5.77772 9.32588C6.43552 9.7654 7.20887 10 8 10C8.56387 9.99869 9.12096 9.87698 9.634 9.643L12.81 13.613C12.285 14.298 12.0005 15.137 12.0005 16C12.0005 16.863 12.285 17.702 12.81 18.387L9.634 22.357C9.12096 22.123 8.56387 22.0013 8 22C7.20887 22 6.43552 22.2346 5.77772 22.6741C5.11992 23.1136 4.60723 23.7384 4.30448 24.4693C4.00173 25.2002 3.92252 26.0044 4.07686 26.7804C4.2312 27.5563 4.61216 28.269 5.17157 28.8284C5.73098 29.3878 6.44371 29.7688 7.21964 29.9231C7.99556 30.0775 8.79983 29.9983 9.53073 29.6955C10.2616 29.3928 10.8864 28.8801 11.3259 28.2223C11.7654 27.5645 12 26.7911 12 26C11.9971 25.1374 11.7127 24.2993 11.19 23.613L14.366 19.643C14.8952 19.8843 15.4709 20.0062 16.0525 20.0002C16.634 19.9942 17.2071 19.8603 17.7312 19.6081C18.2552 19.3559 18.7174 18.9915 19.0849 18.5408C19.4525 18.0901 19.7164 17.5641 19.858 17H24.142C24.3303 17.7226 24.7175 18.3778 25.2595 18.8914C25.8015 19.405 26.4766 19.7563 27.2083 19.9055C27.9399 20.0547 28.6987 19.9957 29.3985 19.7353C30.0983 19.4749 30.7111 19.0234 31.1673 18.4323C31.6234 17.8411 31.9047 17.1339 31.9791 16.3909C32.0535 15.6479 31.9181 14.899 31.5882 14.2291C31.2584 13.5592 30.7473 12.9952 30.113 12.6012C29.4787 12.2072 28.7467 11.9989 28 12ZM6 6C6 5.60444 6.1173 5.21776 6.33706 4.88886C6.55682 4.55996 6.86918 4.30362 7.23463 4.15224C7.60009 4.00087 8.00222 3.96126 8.39018 4.03843C8.77814 4.1156 9.13451 4.30608 9.41421 4.58579C9.69392 4.86549 9.8844 5.22186 9.96157 5.60982C10.0387 5.99778 9.99913 6.39991 9.84776 6.76537C9.69638 7.13082 9.44004 7.44318 9.11114 7.66294C8.78224 7.8827 8.39556 8 8 8C7.46973 7.99947 6.96133 7.78859 6.58637 7.41363C6.21141 7.03867 6.00053 6.53027 6 6ZM8 28C7.60444 28 7.21776 27.8827 6.88886 27.6629C6.55996 27.4432 6.30362 27.1308 6.15224 26.7654C6.00087 26.3999 5.96126 25.9978 6.03843 25.6098C6.1156 25.2219 6.30608 24.8655 6.58579 24.5858C6.86549 24.3061 7.22186 24.1156 7.60982 24.0384C7.99778 23.9613 8.39991 24.0009 8.76537 24.1522C9.13082 24.3036 9.44318 24.56 9.66294 24.8889C9.8827 25.2178 10 25.6044 10 26C9.99947 26.5303 9.78859 27.0387 9.41363 27.4136C9.03867 27.7886 8.53027 27.9995 8 28ZM16 18C15.6044 18 15.2178 17.8827 14.8889 17.6629C14.56 17.4432 14.3036 17.1308 14.1522 16.7654C14.0009 16.3999 13.9613 15.9978 14.0384 15.6098C14.1156 15.2219 14.3061 14.8655 14.5858 14.5858C14.8655 14.3061 15.2219 14.1156 15.6098 14.0384C15.9978 13.9613 16.3999 14.0009 16.7654 14.1522C17.1308 14.3036 17.4432 14.56 17.6629 14.8889C17.8827 15.2178 18 15.6044 18 16C17.9995 16.5303 17.7886 17.0387 17.4136 17.4136C17.0387 17.7886 16.5303 17.9995 16 18ZM28 18C27.6044 18 27.2178 17.8827 26.8889 17.6629C26.56 17.4432 26.3036 17.1308 26.1522 16.7654C26.0009 16.3999 25.9613 15.9978 26.0384 15.6098C26.1156 15.2219 26.3061 14.8655 26.5858 14.5858C26.8655 14.3061 27.2219 14.1156 27.6098 14.0384C27.9978 13.9613 28.3999 14.0009 28.7654 14.1522C29.1308 14.3036 29.4432 14.56 29.6629 14.8889C29.8827 15.2178 30 15.6044 30 16C29.9995 16.5303 29.7886 17.0387 29.4136 17.4136C29.0387 17.7886 28.5303 17.9995 28 18Z" fill="currentColor"/>
6
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M29 27.586L21.448 20.034C23.2628 17.8553 24.1678 15.0608 23.9747 12.2319C23.7816 9.40297 22.5053 6.75739 20.4112 4.84552C18.3172 2.93364 15.5667 1.90267 12.732 1.96709C9.89717 2.0315 7.19635 3.18633 5.19134 5.19134C3.18633 7.19635 2.0315 9.89717 1.96709 12.732C1.90268 15.5667 2.93364 18.3172 4.84552 20.4112C6.75739 22.5053 9.40297 23.7816 12.2319 23.9747C15.0608 24.1678 17.8553 23.2628 20.034 21.448L27.586 29L29 27.586ZM4 13C4 11.22 4.52784 9.47991 5.51677 7.99987C6.50571 6.51983 7.91132 5.36627 9.55585 4.68508C11.2004 4.0039 13.01 3.82567 14.7558 4.17293C16.5016 4.5202 18.1053 5.37737 19.364 6.63604C20.6226 7.89471 21.4798 9.49836 21.8271 11.2442C22.1743 12.99 21.9961 14.7996 21.3149 16.4442C20.6337 18.0887 19.4802 19.4943 18.0001 20.4832C16.5201 21.4722 14.78 22 13 22C10.6139 21.9974 8.32622 21.0483 6.63896 19.361C4.95171 17.6738 4.00265 15.3861 4 13Z" fill="currentColor"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M27.71 4.29C27.575 4.15567 27.4045 4.06267 27.2185 4.02193C27.0325 3.98118 26.8388 3.99439 26.66 4.06L4.66 12.06C4.47027 12.132 4.30692 12.26 4.19165 12.427C4.07638 12.594 4.01465 12.7921 4.01465 12.995C4.01465 13.1979 4.07638 13.396 4.19165 13.563C4.30692 13.73 4.47027 13.858 4.66 13.93L14.26 17.77L18.1 27.37C18.1721 27.5514 18.2958 27.7077 18.4557 27.8197C18.6157 27.9316 18.8049 27.9943 19 28C19.2021 27.9959 19.3982 27.9306 19.5624 27.8127C19.7266 27.6949 19.8513 27.5301 19.92 27.34L27.92 5.34C27.9881 5.16308 28.0046 4.97043 27.9674 4.78452C27.9302 4.59862 27.8409 4.42711 27.71 4.29ZM19 24.2L16.21 17.2L21 12.41L19.59 11L14.76 15.83L7.8 13L25.33 6.67L19 24.2Z" fill="currentColor"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M30 8H25.9C25.4 5.7 23.4 4 21 4C18.6 4 16.6 5.7 16.1 8H2V10H16.1C16.6 12.3 18.6 14 21 14C23.4 14 25.4 12.3 25.9 10H30V8ZM21 12C19.3 12 18 10.7 18 9C18 7.3 19.3 6 21 6C22.7 6 24 7.3 24 9C24 10.7 22.7 12 21 12ZM2 24H6.1C6.6 26.3 8.6 28 11 28C13.4 28 15.4 26.3 15.9 24H30V22H15.9C15.4 19.7 13.4 18 11 18C8.6 18 6.6 19.7 6.1 22H2V24ZM11 20C12.7 20 14 21.3 14 23C14 24.7 12.7 26 11 26C9.3 26 8 24.7 8 23C8 21.3 9.3 20 11 20Z" fill="currentColor"/>
3
- </svg>
@@ -1,18 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-call */
2
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3
- import { JSX } from 'solid-js'
4
-
5
- const ButtonElement = (props: JSX.ButtonHTMLAttributes<HTMLButtonElement>) => {
6
- return (
7
- <button
8
- {...props}
9
- onMouseDown={preventDefault}
10
- />
11
- )
12
- }
13
-
14
- export default ButtonElement
15
-
16
- function preventDefault(e: any) {
17
- e.preventDefault()
18
- }
@@ -1,44 +0,0 @@
1
- import { getIconSvg, Icons } from '@src/config/icons'
2
- import { fillContainer } from '@src/style/helpers/fillContainer'
3
- import { parseUnit } from '@utils/parseUnit'
4
- import { css } from 'solid-styled-components'
5
-
6
- export const style = css`
7
- &&& {
8
- position: relative;
9
- color: currentColor;
10
- height: var(--icon-size, 24px);
11
- width: var(--icon-size, 24px);
12
-
13
- svg {
14
- display: block;
15
- ${fillContainer};
16
- }
17
- }
18
- `
19
-
20
- type IconProps = {
21
- name: Icons
22
- class?: string
23
- color?: string
24
- size?: number
25
- }
26
-
27
- const Icon = (props: IconProps) => {
28
- const icon = getIconSvg(props.name)
29
-
30
- return (
31
- <div
32
- class={`icon ${props.class || ''} ${style}`}
33
- style={
34
- {
35
- color: props.color,
36
- '--icon-size': props.size && parseUnit(props.size),
37
- } as any
38
- }
39
- innerHTML={icon}
40
- />
41
- )
42
- }
43
-
44
- export default Icon
@@ -1,57 +0,0 @@
1
- import { stack } from '@src/style/helpers/stack'
2
- import { colors, fonts } from '@src/style/theme'
3
- import { cx } from '@utils/cx'
4
- import { JSX } from 'solid-js'
5
- import { css } from 'solid-styled-components'
6
-
7
- const containerStyle = css`
8
- &&& {
9
- ${stack()};
10
-
11
- > h1 {
12
- font-size: 14px;
13
- color: ${colors.secondary.var};
14
- letter-spacing: 0.08em;
15
- font-family: ${fonts.decorative};
16
- font-weight: 300;
17
- background: ${colors.bgPrimary.var};
18
- z-index: 1;
19
- align-self: flex-start;
20
- position: sticky;
21
- padding-inline: 4px;
22
- border-radius: 0 0 4px 0;
23
- padding-bottom: 2px;
24
- top: 0;
25
- }
26
-
27
- > .content {
28
- --padding-top: 0px;
29
- margin-top: calc(var(--padding-top) * -1);
30
- padding-top: calc(var(--padding-top) + 10px);
31
- padding-inline: 10px;
32
- padding-bottom: 10px;
33
- background: ${colors.white.alpha(0.05)};
34
- border-radius: 4px;
35
- }
36
-
37
- & + & {
38
- margin-top: 20px;
39
- }
40
- }
41
- `
42
-
43
- type SectionProps = {
44
- title: string | null
45
- children: JSX.Element
46
- class?: string
47
- }
48
-
49
- export const Section = (props: SectionProps) => {
50
- return (
51
- <div class={cx(containerStyle, props.class)}>
52
- {props.title && <h1>{props.title}</h1>}
53
-
54
- <div class="content">{props.children}</div>
55
- </div>
56
- )
57
- }
@@ -1,101 +0,0 @@
1
- import { stack } from '@src/style/helpers/stack'
2
- import { colors } from '@src/style/theme'
3
- import { autoIncrementId } from '@utils/autoIncrementId'
4
- import { cx } from '@utils/cx'
5
- import { css } from 'solid-styled-components'
6
-
7
- const containerStyle = css`
8
- &&& {
9
- ${stack({ align: 'left' })};
10
- width: 100%;
11
- position: relative;
12
-
13
- label {
14
- color: ${colors.primary.var};
15
- z-index: 1;
16
- font-size: 13px;
17
- letter-spacing: 0.08em;
18
- margin-left: 6px;
19
- }
20
-
21
- .inputContainer {
22
- background: ${colors.white.alpha(0.05)};
23
- border-radius: 4px;
24
- margin-top: 0px;
25
- position: relative;
26
- width: 100%;
27
- overflow: hidden;
28
- ${stack({ align: 'left' })};
29
- }
30
-
31
- select {
32
- height: 32px;
33
- border: 0;
34
- width: 100%;
35
- padding-top: 2px;
36
- padding-left: 10px;
37
- font-size: 14px;
38
- background: transparent;
39
- color: ${colors.white.var};
40
-
41
- &:focus {
42
- outline: 0;
43
- }
44
-
45
- option {
46
- font-size: 18px;
47
- }
48
- }
49
-
50
- .label-background {
51
- position: absolute;
52
- left: 0;
53
- right: 8px;
54
- height: 17px;
55
- background: ${colors.white.var};
56
- }
57
- }
58
- `
59
-
60
- interface SelectProps<T> {
61
- class?: string
62
- value: T | null
63
- label?: string
64
- options: {
65
- value: T
66
- label: string
67
- }[]
68
- onChange: (value: T) => any
69
- }
70
-
71
- const Select = <T extends string>(props: SelectProps<T>) => {
72
- const inputId = `input${autoIncrementId()}`
73
-
74
- return (
75
- <div class={cx(containerStyle, props.class)}>
76
- <Show when={props.label}>
77
- <label for={inputId}>{props.label}</label>
78
- </Show>
79
-
80
- <div class="inputContainer">
81
- <select
82
- id={inputId}
83
- value={props.value ?? ''}
84
- onChange={(e) => {
85
- if (e.currentTarget.value) {
86
- props.onChange(e.currentTarget.value as T)
87
- }
88
- }}
89
- >
90
- {!props.value && <option value="">-- select an option --</option>}
91
-
92
- <For each={props.options}>
93
- {(option) => <option value={option.value}>{option.label}</option>}
94
- </For>
95
- </select>
96
- </div>
97
- </div>
98
- )
99
- }
100
-
101
- export default Select