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
package/package.json CHANGED
@@ -1,27 +1,19 @@
1
1
  {
2
2
  "name": "app-devtools",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "",
5
- "scripts": {
6
- "dev": "vite",
7
- "test": "vitest --ui",
8
- "test:run": "echo 'no tests'",
9
- "preview": "vite preview",
10
- "tsc": "tsc -p tsconfig.prod.json",
11
- "eslint": "eslint --ext .js,.ts,.tsx,.jsx src",
12
- "lint": "pnpm eslint && pnpm tsc",
13
- "tsc:w": "tsc -w -p tsconfig.prod.json",
14
- "convert-har": "tsm scripts/filterFetchRequests.ts",
15
- "build": "pnpm test:run && pnpm lint && pnpm build:no-test",
16
- "build:no-test": "vite build && tsup --dts-only",
17
- "publish": "./scripts/check-if-is-sync.sh && pnpm run build && npm publish"
18
- },
19
5
  "packageManager": "pnpm@6.29.1",
20
6
  "license": "MIT",
7
+ "author": "Lucas Santos",
8
+ "repository": "github:lucasols/app-devtools",
21
9
  "type": "module",
22
10
  "main": "./dist/main.cjs",
23
11
  "module": "./dist/main.js",
24
12
  "types": "./dist/main.d.ts",
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "sideEffects": false,
25
17
  "exports": {
26
18
  ".": {
27
19
  "import": "./dist/main.js",
@@ -62,5 +54,18 @@
62
54
  "tsm": "^2.3.0",
63
55
  "tsup": "^6.6.3",
64
56
  "happy-dom": "^8.7.1"
57
+ },
58
+ "scripts": {
59
+ "dev": "vite",
60
+ "test": "vitest --ui",
61
+ "test:run": "echo 'no tests'",
62
+ "preview": "vite preview",
63
+ "tsc": "tsc -p tsconfig.prod.json",
64
+ "eslint": "eslint --ext .js,.ts,.tsx,.jsx src",
65
+ "lint": "pnpm eslint && pnpm tsc",
66
+ "tsc:w": "tsc -w -p tsconfig.prod.json",
67
+ "convert-har": "tsm scripts/filterFetchRequests.ts",
68
+ "build": "pnpm test:run && pnpm lint && pnpm build:no-test",
69
+ "build:no-test": "vite build && tsup --dts-only"
65
70
  }
66
- }
71
+ }
package/.eslintignore DELETED
@@ -1,3 +0,0 @@
1
- docs
2
- resources
3
- dist
package/.eslintrc.cjs DELETED
@@ -1,112 +0,0 @@
1
- const isCI = process.env.CI === 'true'
2
-
3
- const OFF = 0
4
- const WARN = 1
5
- const ERROR = 2
6
- const ERROR_IN_CI = isCI ? ERROR : WARN
7
- const ERROR_IN_CI_ONLY = isCI ? ERROR : 0
8
-
9
- module.exports = {
10
- parser: '@typescript-eslint/parser',
11
- parserOptions: {
12
- project: './tsconfig.json',
13
- createDefaultProgram: true,
14
- ecmaVersion: 8,
15
- ecmaFeatures: {
16
- jsx: true,
17
- },
18
- useJSXTextNode: true,
19
- sourceType: 'module',
20
- },
21
- env: {
22
- browser: true,
23
- },
24
- plugins: ['@typescript-eslint', '@lucasols/extended-lint'],
25
-
26
- rules: {
27
- 'no-warning-comments': [ERROR_IN_CI, { terms: ['FIX:'] }],
28
- '@lucasols/extended-lint/no-warning-comments': [
29
- ERROR_IN_CI_ONLY,
30
- { terms: ['FIX-LATER:', 'FIXLATER:'] },
31
- ],
32
- 'no-constant-binary-expression': ERROR_IN_CI,
33
- 'object-shorthand': ERROR_IN_CI,
34
- 'no-useless-rename': ERROR_IN_CI,
35
- 'no-param-reassign': ERROR_IN_CI,
36
- 'prefer-template': ERROR_IN_CI,
37
- 'prefer-const': [ERROR_IN_CI, { destructuring: 'all' }],
38
-
39
- 'no-prototype-builtins': OFF,
40
- 'no-inner-declarations': OFF,
41
- 'no-undef': OFF,
42
- 'no-console': [ERROR_IN_CI, { allow: ['warn', 'error', 'info'] }],
43
- 'no-restricted-imports': [
44
- ERROR_IN_CI,
45
- {
46
- patterns: [
47
- {
48
- group: ['*.test'],
49
- message: 'Do not import test files',
50
- },
51
- ],
52
- },
53
- ],
54
- 'no-restricted-syntax': [
55
- ERROR_IN_CI_ONLY,
56
- {
57
- selector: 'CallExpression[callee.property.name="only"]',
58
- message: 'No test.only',
59
- },
60
- {
61
- selector: 'CallExpression[callee.property.name="todo"]',
62
- message: 'No test.todo',
63
- },
64
- ],
65
- 'no-implicit-coercion': [
66
- ERROR_IN_CI,
67
- { disallowTemplateShorthand: true, allow: ['!!'] },
68
- ],
69
-
70
- /* typescript */
71
- '@typescript-eslint/no-unnecessary-condition': ERROR_IN_CI,
72
- '@typescript-eslint/naming-convention': [
73
- 'error',
74
- {
75
- selector: 'typeLike',
76
- format: ['PascalCase'],
77
- },
78
- ],
79
- '@typescript-eslint/no-throw-literal': ERROR_IN_CI,
80
- '@typescript-eslint/no-unused-expressions': ERROR_IN_CI,
81
- '@typescript-eslint/no-unused-vars': [
82
- ERROR_IN_CI,
83
- { argsIgnorePattern: '^_', ignoreRestSiblings: true },
84
- ],
85
- '@typescript-eslint/no-shadow': [
86
- ERROR_IN_CI,
87
- { ignoreOnInitialization: true, allow: ['expect'] },
88
- ],
89
- '@typescript-eslint/ban-types': [
90
- ERROR_IN_CI,
91
- {
92
- types: {
93
- Error: 'Dont use error type',
94
- },
95
- },
96
- ],
97
-
98
- '@typescript-eslint/no-non-null-assertion': OFF,
99
- '@typescript-eslint/no-empty-function': OFF,
100
- '@typescript-eslint/no-explicit-any': OFF,
101
- '@typescript-eslint/no-floating-promises': OFF,
102
- '@typescript-eslint/no-unsafe-assignment': OFF,
103
- '@typescript-eslint/no-misused-promises': OFF,
104
- '@typescript-eslint/restrict-template-expressions': OFF,
105
- '@typescript-eslint/unbound-method': OFF,
106
- },
107
- extends: [
108
- 'eslint:recommended',
109
- 'plugin:@typescript-eslint/recommended',
110
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
111
- ],
112
- }
package/.gitattributes DELETED
@@ -1,22 +0,0 @@
1
- # Auto detect text files and perform LF normalization
2
- * text eol=lf
3
-
4
- # Custom for Visual Studio
5
- *.cs diff=csharp
6
-
7
- # Standard to msysgit
8
- *.doc diff=astextplain
9
- *.DOC diff=astextplain
10
- *.docx diff=astextplain
11
- *.DOCX diff=astextplain
12
- *.dot diff=astextplain
13
- *.DOT diff=astextplain
14
- *.pdf diff=astextplain
15
- *.PDF diff=astextplain
16
- *.rtf diff=astextplain
17
- *.RTF diff=astextplain
18
-
19
- # Denote all files that are truly binary and should not be modified.
20
- *.png binary
21
- *.jpg binary
22
- *.ico binary
package/.prettierrc DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "printWidth": 80,
3
- "semi": false,
4
- "singleQuote": true,
5
- "trailingComma": "all",
6
- "offsetTernaryExpressions": true,
7
- "breakBeforeElse": true,
8
- "singleAttributePerLine": true,
9
- "importFormatting": "oneline"
10
- }
package/.quokka.ts DELETED
@@ -1,115 +0,0 @@
1
- import { isObject } from './src/utils/isObject';
2
-
3
- function formatArray(
4
- type: 'all' | { firstNItems: number } | 'length',
5
- array: any[],
6
- ): string {
7
- if (type === 'length') {
8
- return `Array(${array.length})`;
9
- }
10
-
11
- const normalizedItems: string[] = [];
12
-
13
- for (const item of array) {
14
- if (isObject(item)) {
15
- normalizedItems.push(`{${formatObject(item)}}`);
16
- } else {
17
- normalizedItems.push(String(item));
18
- }
19
-
20
- if (
21
- typeof type === 'object' &&
22
- normalizedItems.length >= type.firstNItems
23
- ) {
24
- normalizedItems.push(`...(${array.length - type.firstNItems} more)`);
25
- break;
26
- }
27
- }
28
-
29
- return `[${normalizedItems.join(', ')}]`;
30
- }
31
-
32
- function formatObject(obj: Record<string, any>): string {
33
- return Object.keys(obj)
34
- .map((key) => {
35
- let value = obj[key];
36
-
37
- if (isObject(value)) {
38
- value = JSON.stringify(value)
39
- .replace(/"/g, '')
40
- .replace(/,/g, ', ')
41
- .replace(/:/g, ': ');
42
- }
43
-
44
- return `${key}: ${value}`;
45
- })
46
- .join(', ');
47
- }
48
-
49
- function simplifyArraySnapshot(
50
- array: any[],
51
- arrayType: 'all' | { firstNItems: number } | 'length' = { firstNItems: 4 },
52
- ) {
53
- return array
54
- .map((item) => {
55
- if (isObject(item)) {
56
- return formatObject(item);
57
- }
58
-
59
- if (Array.isArray(item)) {
60
- return formatArray(arrayType, item);
61
- }
62
-
63
- return String(item);
64
- })
65
- .join('\n');
66
- }
67
-
68
- simplifyArraySnapshot([
69
- null,
70
- [1, 2, 3],
71
- [
72
- { a: 1, b: 2 },
73
- { a: 3, b: 4 },
74
- { a: 3, b: 4 },
75
- { a: 3, b: 4 },
76
- { a: 3, b: 4 },
77
- { a: 3, b: 4 },
78
- { a: 3, b: 4 },
79
- ],
80
- {
81
- data: {
82
- id: 1,
83
- name: 'User 1',
84
- },
85
- id: 'users||1',
86
- },
87
- {
88
- data: {
89
- id: 2,
90
- name: 'User 2',
91
- },
92
- id: 'users||2',
93
- },
94
- {
95
- data: {
96
- id: 3,
97
- name: 'modified',
98
- },
99
- id: 'users||3',
100
- },
101
- {
102
- data: {
103
- id: 4,
104
- name: 'modified',
105
- },
106
- id: 'users||4',
107
- },
108
- {
109
- data: {
110
- id: 5,
111
- name: 'modified',
112
- },
113
- id: 'users||5',
114
- },
115
- ]); //?
@@ -1,7 +0,0 @@
1
- {
2
- "typescript.tsdk": "node_modules/typescript/lib",
3
- "emmet.includeLanguages": {
4
- "typescriptreact": "html",
5
- "javascriptreact": "xml"
6
- }
7
- }
@@ -1,75 +0,0 @@
1
- {
2
- // Place your srs-v2 workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3
- // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4
- // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5
- // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6
- // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7
- // Placeholders with the same ids are connected.
8
- // Example:
9
- // "Print to console": {
10
- // "scope": "javascript,typescript",
11
- // "prefix": "log",
12
- // "body": [
13
- // "console.log('$1');",
14
- // "$2"
15
- // ],
16
- // "description": "Log output to console"
17
- // }
18
-
19
- /* solid components */
20
- "solidComponent": {
21
- "scope": "typescriptreact,javascriptreact",
22
- "prefix": "_scomp",
23
- "body": [
24
- "import { css } from 'solid-styled-components';",
25
- "",
26
- "const containerStyle = css`",
27
- " $6",
28
- "`;",
29
- "",
30
- "type $1Props = {",
31
- "};",
32
- "",
33
- "export const ${1:${TM_FILENAME_BASE}} = (props: $1Props) => {",
34
- " $8",
35
- "",
36
- " return (",
37
- " <div class={containerStyle}>",
38
- " $7",
39
- " </div>",
40
- " );",
41
- "};"
42
- ],
43
- "description": "Solidjs Component"
44
- },
45
-
46
- "solid <For>": {
47
- "scope": "typescriptreact,javascriptreact",
48
- "prefix": "_sfor",
49
- "body": [
50
- "<For each={$1}>",
51
- " {(${2:item}) => (",
52
- " $3",
53
- " )}",
54
- "</For>"
55
- ]
56
- },
57
-
58
- "solid <Show>": {
59
- "scope": "typescriptreact,javascriptreact",
60
- "prefix": "_sshow",
61
- "body": [
62
- "<Show when={$1}>",
63
- " {(${2:item}) => (",
64
- " $3",
65
- " )}",
66
- "</Show>"
67
- ]
68
- },
69
-
70
- "css": {
71
- "scope": "typescriptreact",
72
- "prefix": "_scss",
73
- "body": ["const $1Style = css$3`", "$2", "`"]
74
- }
75
- }
@@ -1,17 +0,0 @@
1
- {
2
- "version": "2.0.0",
3
- "tasks": [
4
- {
5
- "type": "npm",
6
- "script": "dev",
7
- "problemMatcher": [],
8
- "label": "vite dev"
9
- },
10
- {
11
- "type": "npm",
12
- "script": "publish",
13
- "problemMatcher": [],
14
- "label": "publish"
15
- }
16
- ]
17
- }
package/index.html DELETED
@@ -1,46 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta
6
- name="robots"
7
- content="noindex"
8
- />
9
- <meta
10
- name="viewport"
11
- content="width=device-width, initial-scale=1"
12
- />
13
- <meta
14
- name="theme-color"
15
- content="#111827"
16
- />
17
-
18
- <link
19
- type="text/css"
20
- rel="stylesheet"
21
- href="https://fonts.googleapis.com/css2?family=Work+Sans:wght@300..700&display=swap"
22
- />
23
- <link
24
- type="text/css"
25
- rel="stylesheet"
26
- href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap"
27
- />
28
-
29
- <link
30
- rel="shortcut icon"
31
- type="image/png"
32
- href="/src/assets/favicon.png"
33
- />
34
-
35
- <title>App DevTools</title>
36
- </head>
37
- <body>
38
- <noscript>You need to enable JavaScript to run this app.</noscript>
39
- <div id="app"></div>
40
-
41
- <script
42
- src="/src/main.tsx"
43
- type="module"
44
- ></script>
45
- </body>
46
- </html>