@lensjs/core 1.0.1

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 (84) hide show
  1. package/README.md +1 -0
  2. package/copy-front-build.cjs +16 -0
  3. package/package.json +40 -0
  4. package/src/abstracts/adapter.ts +41 -0
  5. package/src/abstracts/store.ts +36 -0
  6. package/src/context/container.ts +67 -0
  7. package/src/context/context.ts +9 -0
  8. package/src/core/api_controller.ts +116 -0
  9. package/src/core/lens.ts +147 -0
  10. package/src/core/watcher.ts +6 -0
  11. package/src/index.ts +11 -0
  12. package/src/stores/better_sqlite.ts +176 -0
  13. package/src/stores/index.ts +1 -0
  14. package/src/types/index.ts +103 -0
  15. package/src/ui/README.md +69 -0
  16. package/src/ui/bun.lock +750 -0
  17. package/src/ui/eslint.config.js +27 -0
  18. package/src/ui/index.html +13 -0
  19. package/src/ui/package-lock.json +2953 -0
  20. package/src/ui/package.json +40 -0
  21. package/src/ui/public/favicon.ico +0 -0
  22. package/src/ui/src/App.tsx +40 -0
  23. package/src/ui/src/components/DetailPanel.tsx +70 -0
  24. package/src/ui/src/components/JsonViewer.tsx +232 -0
  25. package/src/ui/src/components/LoadMore.tsx +25 -0
  26. package/src/ui/src/components/MethodBadge.tsx +19 -0
  27. package/src/ui/src/components/Modal.tsx +48 -0
  28. package/src/ui/src/components/StatusCode.tsx +20 -0
  29. package/src/ui/src/components/Table.tsx +127 -0
  30. package/src/ui/src/components/layout/DeleteButton.tsx +60 -0
  31. package/src/ui/src/components/layout/Footer.tsx +12 -0
  32. package/src/ui/src/components/layout/Header.tsx +40 -0
  33. package/src/ui/src/components/layout/Layout.tsx +49 -0
  34. package/src/ui/src/components/layout/LoadingScreen.tsx +14 -0
  35. package/src/ui/src/components/layout/Sidebar.tsx +67 -0
  36. package/src/ui/src/components/queryFormatters/MongoViewer.tsx +92 -0
  37. package/src/ui/src/components/queryFormatters/QueryViewer.tsx +18 -0
  38. package/src/ui/src/components/queryFormatters/SqlViewer.tsx +105 -0
  39. package/src/ui/src/components/table/NoData.tsx +26 -0
  40. package/src/ui/src/components/tabs/TabbedDataViewer.tsx +77 -0
  41. package/src/ui/src/containers/queries/QueriesContainer.tsx +21 -0
  42. package/src/ui/src/containers/queries/QueryDetailsContainer.tsx +15 -0
  43. package/src/ui/src/containers/requests/RequestDetailsContainer.tsx +16 -0
  44. package/src/ui/src/containers/requests/RequestsContainer.tsx +22 -0
  45. package/src/ui/src/hooks/useLensApi.ts +92 -0
  46. package/src/ui/src/hooks/useLoadMore.ts +48 -0
  47. package/src/ui/src/hooks/useQueries.ts +58 -0
  48. package/src/ui/src/hooks/useRequests.ts +79 -0
  49. package/src/ui/src/hooks/useTanstackApi.ts +126 -0
  50. package/src/ui/src/index.css +78 -0
  51. package/src/ui/src/interfaces/index.ts +10 -0
  52. package/src/ui/src/main.tsx +33 -0
  53. package/src/ui/src/router/Router.ts +11 -0
  54. package/src/ui/src/router/routes/Loading.tsx +5 -0
  55. package/src/ui/src/router/routes/index.tsx +85 -0
  56. package/src/ui/src/types/index.ts +95 -0
  57. package/src/ui/src/utils/api.ts +7 -0
  58. package/src/ui/src/utils/context.ts +24 -0
  59. package/src/ui/src/utils/date.ts +36 -0
  60. package/src/ui/src/views/queries/QueryDetails.tsx +58 -0
  61. package/src/ui/src/views/queries/QueryTable.tsx +21 -0
  62. package/src/ui/src/views/queries/columns.tsx +83 -0
  63. package/src/ui/src/views/requests/BasicRequestDetails.tsx +82 -0
  64. package/src/ui/src/views/requests/RequestDetails.tsx +70 -0
  65. package/src/ui/src/views/requests/RequetsTable.tsx +19 -0
  66. package/src/ui/src/views/requests/columns.tsx +62 -0
  67. package/src/ui/src/vite-env.d.ts +1 -0
  68. package/src/ui/tsconfig.app.json +27 -0
  69. package/src/ui/tsconfig.json +7 -0
  70. package/src/ui/tsconfig.node.json +25 -0
  71. package/src/ui/vite.config.ts +9 -0
  72. package/src/utils/event_emitter.ts +13 -0
  73. package/src/utils/index.ts +176 -0
  74. package/src/watchers/index.ts +2 -0
  75. package/src/watchers/query_watcher.ts +15 -0
  76. package/src/watchers/request_watcher.ts +27 -0
  77. package/tests/core/lens.test.ts +89 -0
  78. package/tests/stores/better_sqlite.test.ts +168 -0
  79. package/tests/utils/index.test.ts +182 -0
  80. package/tests/watchers/query_watcher.test.ts +35 -0
  81. package/tests/watchers/request_watcher.test.ts +59 -0
  82. package/tsconfig.json +3 -0
  83. package/tsup.config.ts +15 -0
  84. package/vitest.config.ts +9 -0
@@ -0,0 +1,27 @@
1
+ import js from "@eslint/js";
2
+ import reactHooks from "eslint-plugin-react-hooks";
3
+ import reactRefresh from "eslint-plugin-react-refresh";
4
+ import { globalIgnores } from "eslint/config";
5
+ import globals from "globals";
6
+ import tseslint from "typescript-eslint";
7
+
8
+ export default tseslint.config([
9
+ globalIgnores(["dist"]),
10
+ {
11
+ files: ["**/*.{ts,tsx}"],
12
+ extends: [
13
+ js.configs.recommended,
14
+ tseslint.configs.recommended,
15
+ reactHooks.configs["recommended-latest"],
16
+ reactRefresh.configs.vite,
17
+ ],
18
+ rules: {
19
+ "@typescript-eslint/no-unused-expressions": "off",
20
+ "no-console": "warn",
21
+ },
22
+ languageOptions: {
23
+ ecmaVersion: 2020,
24
+ globals: globals.browser,
25
+ },
26
+ },
27
+ ]);
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="./public/favicon.ico" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Lens</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.tsx"></script>
12
+ </body>
13
+ </html>