@geenius/tools 0.1.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 (160) hide show
  1. package/.changeset/config.json +11 -0
  2. package/.env.example +2 -0
  3. package/.github/CODEOWNERS +1 -0
  4. package/.github/ISSUE_TEMPLATE/bug_report.md +16 -0
  5. package/.github/ISSUE_TEMPLATE/feature_request.md +11 -0
  6. package/.github/PULL_REQUEST_TEMPLATE.md +10 -0
  7. package/.github/dependabot.yml +11 -0
  8. package/.github/workflows/ci.yml +23 -0
  9. package/.github/workflows/release.yml +29 -0
  10. package/.node-version +1 -0
  11. package/.nvmrc +1 -0
  12. package/.prettierrc +7 -0
  13. package/.project/ACCOUNT.yaml +4 -0
  14. package/.project/IDEAS.yaml +7 -0
  15. package/.project/PROJECT.yaml +11 -0
  16. package/.project/ROADMAP.yaml +15 -0
  17. package/CHANGELOG.md +16 -0
  18. package/CODE_OF_CONDUCT.md +26 -0
  19. package/CONTRIBUTING.md +69 -0
  20. package/LICENSE +21 -0
  21. package/README.md +1 -0
  22. package/SECURITY.md +18 -0
  23. package/SUPPORT.md +14 -0
  24. package/package.json +75 -0
  25. package/packages/convex/shared/README.md +1 -0
  26. package/packages/convex/shared/package.json +42 -0
  27. package/packages/convex/shared/src/audit/index.ts +5 -0
  28. package/packages/convex/shared/src/audit/presets.ts +165 -0
  29. package/packages/convex/shared/src/audit/schema.ts +85 -0
  30. package/packages/convex/shared/src/audit/write.ts +102 -0
  31. package/packages/convex/shared/src/extract.ts +75 -0
  32. package/packages/convex/shared/src/index.ts +41 -0
  33. package/packages/convex/shared/src/messages.ts +45 -0
  34. package/packages/convex/shared/src/security.ts +112 -0
  35. package/packages/convex/shared/src/throw.ts +184 -0
  36. package/packages/convex/shared/src/types.ts +57 -0
  37. package/packages/convex/shared/src/utils.ts +58 -0
  38. package/packages/convex/shared/tsconfig.json +28 -0
  39. package/packages/convex/shared/tsup.config.ts +12 -0
  40. package/packages/devtools/package.json +27 -0
  41. package/packages/devtools/react/README.md +1 -0
  42. package/packages/devtools/react/package.json +53 -0
  43. package/packages/devtools/react/src/components/DesignPreview.tsx +59 -0
  44. package/packages/devtools/react/src/components/DesignSwitcherDropdown.tsx +99 -0
  45. package/packages/devtools/react/src/components/DevSidebar.tsx +247 -0
  46. package/packages/devtools/react/src/components/DevToolbar.tsx +242 -0
  47. package/packages/devtools/react/src/components/GitHubIssueDialog.tsx +402 -0
  48. package/packages/devtools/react/src/components/InspectorOverlay.tsx +312 -0
  49. package/packages/devtools/react/src/components/PageLoadWaterfall.tsx +144 -0
  50. package/packages/devtools/react/src/components/PerformancePanel.tsx +330 -0
  51. package/packages/devtools/react/src/context/DevModeContext.tsx +226 -0
  52. package/packages/devtools/react/src/context/PerformanceContext.tsx +143 -0
  53. package/packages/devtools/react/src/data/designs.ts +13 -0
  54. package/packages/devtools/react/src/hooks/useGitHubLabels.ts +47 -0
  55. package/packages/devtools/react/src/hooks/useVirtualList.ts +124 -0
  56. package/packages/devtools/react/src/index.ts +77 -0
  57. package/packages/devtools/react/src/panels/ConvexSpy.tsx +130 -0
  58. package/packages/devtools/react/src/panels/DatabaseSeeder.tsx +116 -0
  59. package/packages/devtools/react/src/panels/DevModePhase2.tsx +191 -0
  60. package/packages/devtools/react/src/panels/DevModePhase3.tsx +234 -0
  61. package/packages/devtools/react/src/panels/FeatureFlagsToggle.tsx +104 -0
  62. package/packages/devtools/react/src/panels/QuickRouteJump.tsx +152 -0
  63. package/packages/devtools/react/src/services/github-service.ts +247 -0
  64. package/packages/devtools/react/tsconfig.json +31 -0
  65. package/packages/devtools/react/tsup.config.ts +18 -0
  66. package/packages/devtools/solidjs/README.md +1 -0
  67. package/packages/devtools/solidjs/package.json +49 -0
  68. package/packages/devtools/solidjs/src/components/DesignPreview.tsx +51 -0
  69. package/packages/devtools/solidjs/src/components/DesignSwitcherDropdown.tsx +95 -0
  70. package/packages/devtools/solidjs/src/components/DevSidebar.tsx +247 -0
  71. package/packages/devtools/solidjs/src/components/DevToolbar.tsx +242 -0
  72. package/packages/devtools/solidjs/src/components/GitHubIssueDialog.tsx +400 -0
  73. package/packages/devtools/solidjs/src/components/InspectorOverlay.tsx +311 -0
  74. package/packages/devtools/solidjs/src/components/PageLoadWaterfall.tsx +144 -0
  75. package/packages/devtools/solidjs/src/components/PerformancePanel.tsx +330 -0
  76. package/packages/devtools/solidjs/src/context/DevModeContext.tsx +216 -0
  77. package/packages/devtools/solidjs/src/context/PerformanceContext.tsx +135 -0
  78. package/packages/devtools/solidjs/src/data/designs.ts +13 -0
  79. package/packages/devtools/solidjs/src/hooks/createGitHubLabels.ts +47 -0
  80. package/packages/devtools/solidjs/src/index.ts +64 -0
  81. package/packages/devtools/solidjs/src/services/github-service.ts +247 -0
  82. package/packages/devtools/solidjs/tsconfig.json +21 -0
  83. package/packages/devtools/src/index.ts +377 -0
  84. package/packages/devtools/tsup.config.ts +12 -0
  85. package/packages/env/package.json +30 -0
  86. package/packages/env/src/index.ts +264 -0
  87. package/packages/env/tsup.config.ts +12 -0
  88. package/packages/errors/package.json +27 -0
  89. package/packages/errors/react/README.md +1 -0
  90. package/packages/errors/react/package.json +72 -0
  91. package/packages/errors/react/src/analytics.ts +16 -0
  92. package/packages/errors/react/src/components/ErrorBoundary.tsx +248 -0
  93. package/packages/errors/react/src/components/ErrorDisplay.tsx +328 -0
  94. package/packages/errors/react/src/components/ValidationErrors.tsx +102 -0
  95. package/packages/errors/react/src/config.ts +199 -0
  96. package/packages/errors/react/src/constants.ts +74 -0
  97. package/packages/errors/react/src/hooks/useErrorBoundary.ts +92 -0
  98. package/packages/errors/react/src/hooks/useErrorHandler.ts +87 -0
  99. package/packages/errors/react/src/index.ts +96 -0
  100. package/packages/errors/react/src/types.ts +102 -0
  101. package/packages/errors/react/src/utils/errorMessages.ts +35 -0
  102. package/packages/errors/react/src/utils/errorPolicy.ts +139 -0
  103. package/packages/errors/react/src/utils/extractAppError.ts +174 -0
  104. package/packages/errors/react/src/utils/formatError.ts +112 -0
  105. package/packages/errors/react/tsconfig.json +25 -0
  106. package/packages/errors/react/tsup.config.ts +24 -0
  107. package/packages/errors/solidjs/README.md +1 -0
  108. package/packages/errors/solidjs/package.json +46 -0
  109. package/packages/errors/solidjs/src/components/ErrorDisplay.tsx +179 -0
  110. package/packages/errors/solidjs/src/config.ts +98 -0
  111. package/packages/errors/solidjs/src/hooks/createErrorHandler.ts +107 -0
  112. package/packages/errors/solidjs/src/index.ts +61 -0
  113. package/packages/errors/solidjs/src/types.ts +34 -0
  114. package/packages/errors/solidjs/src/utils/errorPolicy.ts +56 -0
  115. package/packages/errors/solidjs/src/utils/extractAppError.ts +94 -0
  116. package/packages/errors/solidjs/src/utils/formatError.ts +33 -0
  117. package/packages/errors/solidjs/tsconfig.json +26 -0
  118. package/packages/errors/solidjs/tsup.config.ts +21 -0
  119. package/packages/errors/src/index.ts +320 -0
  120. package/packages/errors/tsup.config.ts +12 -0
  121. package/packages/logger/package.json +27 -0
  122. package/packages/logger/react/README.md +1 -0
  123. package/packages/logger/react/package.json +46 -0
  124. package/packages/logger/react/src/index.ts +4 -0
  125. package/packages/logger/react/src/useMetrics.ts +42 -0
  126. package/packages/logger/react/src/usePerformanceLog.ts +61 -0
  127. package/packages/logger/react/tsconfig.json +31 -0
  128. package/packages/logger/react/tsup.config.ts +12 -0
  129. package/packages/logger/solidjs/README.md +1 -0
  130. package/packages/logger/solidjs/package.json +45 -0
  131. package/packages/logger/solidjs/src/createMetrics.ts +37 -0
  132. package/packages/logger/solidjs/src/createPerformanceLog.ts +58 -0
  133. package/packages/logger/solidjs/src/index.ts +4 -0
  134. package/packages/logger/solidjs/tsconfig.json +32 -0
  135. package/packages/logger/solidjs/tsup.config.ts +12 -0
  136. package/packages/logger/src/index.ts +363 -0
  137. package/packages/logger/tsup.config.ts +12 -0
  138. package/packages/perf/package.json +27 -0
  139. package/packages/perf/react/README.md +1 -0
  140. package/packages/perf/react/package.json +59 -0
  141. package/packages/perf/react/src/components/PerformanceDashboard.tsx +257 -0
  142. package/packages/perf/react/src/hooks/useMonitoredQuery.ts +89 -0
  143. package/packages/perf/react/src/hooks/usePerformanceMetrics.ts +78 -0
  144. package/packages/perf/react/src/index.ts +33 -0
  145. package/packages/perf/react/src/services/PerformanceMonitor.ts +313 -0
  146. package/packages/perf/react/src/types.ts +77 -0
  147. package/packages/perf/react/tsconfig.json +25 -0
  148. package/packages/perf/react/tsup.config.ts +19 -0
  149. package/packages/perf/solidjs/README.md +1 -0
  150. package/packages/perf/solidjs/package.json +41 -0
  151. package/packages/perf/solidjs/src/components/PerformanceDashboard.tsx +207 -0
  152. package/packages/perf/solidjs/src/hooks/createPerformanceMetrics.ts +73 -0
  153. package/packages/perf/solidjs/src/index.ts +31 -0
  154. package/packages/perf/solidjs/src/services/PerformanceMonitor.ts +134 -0
  155. package/packages/perf/solidjs/src/types.ts +78 -0
  156. package/packages/perf/solidjs/tsconfig.json +26 -0
  157. package/packages/perf/solidjs/tsup.config.ts +14 -0
  158. package/packages/perf/src/index.ts +410 -0
  159. package/packages/perf/tsup.config.ts +12 -0
  160. package/pnpm-workspace.yaml +2 -0
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3
+ "changelog": "@changesets/cli/changelog",
4
+ "commit": false,
5
+ "fixed": [],
6
+ "linked": [],
7
+ "access": "public",
8
+ "baseBranch": "main",
9
+ "updateInternalDependencies": "patch",
10
+ "ignore": []
11
+ }
package/.env.example ADDED
@@ -0,0 +1,2 @@
1
+ # No environment variables required for library development
2
+ # This file exists for compliance — the library has no runtime env dependencies
@@ -0,0 +1 @@
1
+ * @mxn2020
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug
4
+ labels: bug
5
+ ---
6
+
7
+ ## Describe the bug
8
+
9
+ ## Steps to reproduce
10
+
11
+ ## Expected behavior
12
+
13
+ ## Environment
14
+ - Package version:
15
+ - Node version:
16
+ - OS:
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a new feature
4
+ labels: enhancement
5
+ ---
6
+
7
+ ## Problem
8
+
9
+ ## Proposed solution
10
+
11
+ ## Alternatives considered
@@ -0,0 +1,10 @@
1
+ ## What
2
+
3
+ ## Why
4
+
5
+ ## How
6
+
7
+ ## Checklist
8
+ - [ ] Tests added/updated
9
+ - [ ] `pnpm changeset` run (if applicable)
10
+ - [ ] Documentation updated
@@ -0,0 +1,11 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "npm"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ open-pull-requests-limit: 10
8
+ - package-ecosystem: "github-actions"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
@@ -0,0 +1,23 @@
1
+ name: CI
2
+ on:
3
+ pull_request:
4
+ branches: [main]
5
+ push:
6
+ branches: [main]
7
+
8
+ jobs:
9
+ check:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: pnpm/action-setup@v4
14
+ with:
15
+ version: 10
16
+ - uses: actions/setup-node@v4
17
+ with:
18
+ node-version-file: '.nvmrc'
19
+ cache: 'pnpm'
20
+ - run: pnpm install --frozen-lockfile
21
+ - run: pnpm build
22
+ - run: pnpm lint
23
+ - run: pnpm test
@@ -0,0 +1,29 @@
1
+ name: Release
2
+ on:
3
+ push:
4
+ branches: [main]
5
+
6
+ concurrency: ${{ github.workflow }}-${{ github.ref }}
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: pnpm/action-setup@v4
14
+ with:
15
+ version: 10
16
+ - uses: actions/setup-node@v4
17
+ with:
18
+ node-version-file: '.nvmrc'
19
+ cache: 'pnpm'
20
+ registry-url: 'https://registry.npmjs.org'
21
+ - run: pnpm install --frozen-lockfile
22
+ - run: pnpm build
23
+ - uses: changesets/action@v1
24
+ with:
25
+ publish: pnpm changeset publish
26
+ version: pnpm changeset version
27
+ env:
28
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.node-version ADDED
@@ -0,0 +1 @@
1
+ 20
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 22
package/.prettierrc ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "semi": false,
3
+ "singleQuote": true,
4
+ "trailingComma": "all",
5
+ "printWidth": 120,
6
+ "tabWidth": 2
7
+ }
@@ -0,0 +1,4 @@
1
+ owner: Mehdi Nabhani
2
+ email: mehdi@geenius.app
3
+ github: mxn2020
4
+ organization: geenius
@@ -0,0 +1,7 @@
1
+ ideas:
2
+ - title: "CLI scaffolding"
3
+ description: "Add a create command to geenius-cli for this package"
4
+ priority: medium
5
+ - title: "Vue adapter"
6
+ description: "Add Vue 3 support alongside React and SolidJS"
7
+ priority: low
@@ -0,0 +1,11 @@
1
+ name: geenius-tools
2
+ description: "Geenius Tools — Reusable dev tools for React, Solid, and Convex"
3
+ category: library
4
+ priority: high
5
+ tags:
6
+ - geenius
7
+ - npm-package
8
+ - react
9
+ - solidjs
10
+ deploy_url: null
11
+ npm_scope: "@geenius-tools"
@@ -0,0 +1,15 @@
1
+ version: "0.1"
2
+ milestones:
3
+ - name: "v0.1.0 — Initial Release"
4
+ status: in-progress
5
+ items:
6
+ - "Core shared types and logic"
7
+ - "React hooks and components"
8
+ - "SolidJS primitives"
9
+ - "npm publishing via Changesets"
10
+ - name: "v0.2.0 — Stability"
11
+ status: planned
12
+ items:
13
+ - "Test coverage ≥ 50%"
14
+ - "API documentation"
15
+ - "Convex adapter"
package/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.0.1] - 2026-03-08
9
+
10
+ ### Added
11
+ - Initial release
12
+ - Error handling: `convex-errors`, `errors-react`, `errors-solidjs`
13
+ - Logging: `logger`, `logger-react`, `logger-solid`
14
+ - Performance: `perf-react`, `perf-solidjs`
15
+ - Utilities: `convex-wrappers`, `env`
16
+ - Developer tools: `devtools-react`
@@ -0,0 +1,26 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to a positive environment:
10
+ - Using welcoming and inclusive language
11
+ - Being respectful of differing viewpoints and experiences
12
+ - Gracefully accepting constructive criticism
13
+ - Focusing on what is best for the community
14
+
15
+ Examples of unacceptable behavior:
16
+ - Trolling, insulting/derogatory comments, and personal or political attacks
17
+ - Public or private harassment
18
+ - Publishing others' private information without explicit permission
19
+
20
+ ## Enforcement
21
+
22
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers at support@geenius.app. All complaints will be reviewed and investigated.
23
+
24
+ ## Attribution
25
+
26
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.
@@ -0,0 +1,69 @@
1
+ # Contributing to @geenius-tools
2
+
3
+ Thank you for your interest in contributing! This guide will help you get started.
4
+
5
+ ## Development Setup
6
+
7
+ ```bash
8
+ # Clone the repository
9
+ git clone https://github.com/mxn2020/geenius-tools.git
10
+ cd geenius-tools
11
+
12
+ # Install dependencies
13
+ pnpm install
14
+
15
+ # Build all packages
16
+ pnpm build
17
+
18
+ # Run tests
19
+ pnpm test
20
+
21
+ # Lint
22
+ pnpm lint
23
+ ```
24
+
25
+ ## Project Structure
26
+
27
+ ```
28
+ packages/
29
+ convex-errors/ — Convex error handling utilities
30
+ convex-wrappers/ — Convex function wrappers
31
+ devtools-react/ — React developer tools panel
32
+ env/ — Environment variable utilities
33
+ errors-react/ — React error boundaries and displays
34
+ errors-solidjs/ — SolidJS error handling
35
+ logger/ — Structured logging
36
+ logger-react/ — React logging hooks
37
+ logger-solid/ — SolidJS logging hooks
38
+ perf-react/ — React performance monitoring
39
+ perf-solidjs/ — SolidJS performance monitoring
40
+ ```
41
+
42
+ ## Contribution Workflow
43
+
44
+ 1. **Fork** the repository
45
+ 2. **Create a branch** for your change: `git checkout -b feat/my-feature`
46
+ 3. **Make your changes** and add tests
47
+ 4. **Ensure checks pass**: `pnpm lint && pnpm test && pnpm build`
48
+ 5. **Commit** with a conventional message: `feat: add metrics collector`
49
+ 6. **Push** and open a Pull Request
50
+
51
+ ## Commit Convention
52
+
53
+ We follow [Conventional Commits](https://www.conventionalcommits.org/):
54
+ - `feat:` — New feature or utility
55
+ - `fix:` — Bug fix
56
+ - `docs:` — Documentation only
57
+ - `refactor:` — Code change that neither fixes a bug nor adds a feature
58
+ - `test:` — Adding or updating tests
59
+ - `chore:` — Tooling, CI, dependencies
60
+
61
+ ## Code Style
62
+
63
+ - TypeScript strict mode
64
+ - Prettier for formatting
65
+ - ESLint for linting
66
+
67
+ ## Questions?
68
+
69
+ Open an issue or reach out at support@geenius.app.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Geenius
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # ✦ geenius-tools\n\n> Geenius Tools — Reusable dev tools for React, Solid, and Convex\n\n---\n\n## Overview\nBuilt with Steve Jobs-level minimalism and Jony Ive-level craftsmanship, this package is designed to deliver unparalleled developer experience (DX) and rock-solid performance.\n\n## Installation\n\n```bash\npnpm add geenius-tools\n```\n\n## Usage\n\n```typescript\nimport { init } from 'geenius-tools';\n\n// Initialize the module with absolute precision\ninit({\n mode: 'premium',\n});\n```\n\n## Architecture\n- **Zero-config**: It just works.\n- **Strictly Typed**: Fully written in TypeScript for flawless IntelliSense.\n- **Framework Agnostic**: seamlessly integrates into the Geenius ecosystem.\n\n---\n\n*Designed by Antigravity HQ*\n
package/SECURITY.md ADDED
@@ -0,0 +1,18 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ | Version | Supported |
6
+ |---------|-------------------|
7
+ | 0.0.x | ✅ Yes |
8
+
9
+ ## Reporting a Vulnerability
10
+
11
+ If you discover a security vulnerability, please report it responsibly:
12
+
13
+ 1. **Do NOT** open a public GitHub issue
14
+ 2. **Email** security@geenius.app with details
15
+ 3. Include steps to reproduce, impact assessment, and any suggested fix
16
+ 4. You will receive a response within **48 hours**
17
+
18
+ We will coordinate disclosure and credit you (if desired) once the issue is resolved.
package/SUPPORT.md ADDED
@@ -0,0 +1,14 @@
1
+ # Support
2
+
3
+ ## Getting Help
4
+
5
+ - **Documentation**: See the [README](./README.md) for usage and API reference
6
+ - **Issues**: [Open a GitHub issue](https://github.com/mxn2020/geenius-tools/issues) for bugs or feature requests
7
+ - **Discussions**: Use [GitHub Discussions](https://github.com/mxn2020/geenius-tools/discussions) for questions and community support
8
+ - **Email**: support@geenius.app for private inquiries
9
+
10
+ ## Response Times
11
+
12
+ - **Bug reports**: Within 48 hours
13
+ - **Feature requests**: Reviewed weekly
14
+ - **Security issues**: Within 24 hours (see [SECURITY.md](./SECURITY.md))
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@geenius/tools",
3
+ "type": "module",
4
+ "version": "0.1.0",
5
+ "description": "Geenius Tools — Reusable dev tools for React, Solid, and Convex",
6
+ "author": "Antigravity HQ",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/mxn2020/geenius-tools.git"
11
+ },
12
+ "keywords": [
13
+ "devtools",
14
+ "error-handling",
15
+ "logging",
16
+ "performance",
17
+ "convex",
18
+ "react",
19
+ "solidjs",
20
+ "geenius"
21
+ ],
22
+ "scripts": {
23
+ "dev": "pnpm -r --parallel type-check",
24
+ "build": "pnpm -r build",
25
+ "clean": "pnpm -r clean",
26
+ "lint": "pnpm -r --parallel type-check",
27
+ "test": "echo \"No tests configured yet\" && exit 0",
28
+ "type-check": "pnpm -r type-check",
29
+ "format": "prettier --write \"packages/*/src/**/*.{ts,tsx}\"",
30
+ "version:patch": "pnpm -r exec -- npm version patch --no-git-tag-version && npm version patch -m 'v%s'",
31
+ "version:minor": "pnpm -r exec -- npm version minor --no-git-tag-version && npm version minor -m 'v%s'",
32
+ "version:major": "pnpm -r exec -- npm version major --no-git-tag-version && npm version major -m 'v%s'",
33
+ "release": "git push && git push --tags",
34
+ "publish:all": "pnpm -r publish --access public",
35
+ "stop": "pkill -f 'vite.*geenius-tools' || true"
36
+ },
37
+ "devDependencies": {
38
+ "prettier": "^3.8.1"
39
+ },
40
+ "engines": {
41
+ "node": ">=20.0.0"
42
+ },
43
+ "exports": {
44
+ ".": {
45
+ "types": "./packages/env/dist/index.d.ts",
46
+ "import": "./packages/env/dist/index.js"
47
+ },
48
+ "./env": {
49
+ "types": "./packages/env/dist/index.d.ts",
50
+ "import": "./packages/env/dist/index.js"
51
+ },
52
+ "./errors": {
53
+ "types": "./packages/errors/dist/index.d.ts",
54
+ "import": "./packages/errors/dist/index.js"
55
+ },
56
+ "./logger": {
57
+ "types": "./packages/logger/dist/index.d.ts",
58
+ "import": "./packages/logger/dist/index.js"
59
+ },
60
+ "./perf": {
61
+ "types": "./packages/perf/dist/index.d.ts",
62
+ "import": "./packages/perf/dist/index.js"
63
+ },
64
+ "./devtools": {
65
+ "types": "./packages/devtools/dist/index.d.ts",
66
+ "import": "./packages/devtools/dist/index.js"
67
+ },
68
+ "./convex": {
69
+ "types": "./packages/convex/shared/dist/index.d.ts",
70
+ "import": "./packages/convex/shared/dist/index.js"
71
+ }
72
+ },
73
+ "main": "./packages/env/dist/index.js",
74
+ "types": "./packages/env/dist/index.d.ts"
75
+ }
@@ -0,0 +1 @@
1
+ # ✦ @geenius-tools/convex\n\n> Typed error system for Convex applications\n\n---\n\n## Overview\nBuilt with Steve Jobs-level minimalism and Jony Ive-level craftsmanship, this package is designed to deliver unparalleled developer experience (DX) and rock-solid performance.\n\n## Installation\n\n```bash\npnpm add @geenius-tools/convex\n```\n\n## Usage\n\n```typescript\nimport { init } from '@geenius-tools/convex';\n\n// Initialize the module with absolute precision\ninit({\n mode: 'premium',\n});\n```\n\n## Architecture\n- **Zero-config**: It just works.\n- **Strictly Typed**: Fully written in TypeScript for flawless IntelliSense.\n- **Framework Agnostic**: seamlessly integrates into the Geenius ecosystem.\n\n---\n\n*Designed by Antigravity HQ*\n
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@geenius-tools/convex",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "Typed error system for Convex applications",
7
+ "license": "MIT",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "main": "./dist/index.js",
12
+ "module": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "src"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsup",
26
+ "clean": "rm -rf dist",
27
+ "type-check": "tsc --noEmit",
28
+ "prepublishOnly": "pnpm clean && pnpm build"
29
+ },
30
+ "peerDependencies": {
31
+ "convex": ">=1.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "convex": "^1.34.0",
35
+ "tsup": "^8.5.1",
36
+ "typescript": "~5.9.3"
37
+ },
38
+ "author": "Antigravity HQ",
39
+ "engines": {
40
+ "node": ">=20.0.0"
41
+ }
42
+ }
@@ -0,0 +1,5 @@
1
+ // @geenius-tools/convex-wrappers — src/audit/index.ts
2
+
3
+ export { auditLogFields, auditLogIndexes } from './schema'
4
+ export { writeAudit, generateSearchableText, computeDiff } from './write'
5
+ export { auditPreset } from './presets'
@@ -0,0 +1,165 @@
1
+ // @geenius-tools/convex-wrappers — src/audit/presets.ts
2
+
3
+ import type { AuditLogEntry } from '../types'
4
+ import { computeDiff } from './write'
5
+
6
+ /**
7
+ * Audit log presets — reusable patterns for common mutation audit scenarios.
8
+ *
9
+ * These return factory functions compatible with the mutation wrapper's
10
+ * `.audit()` builder, producing `AuditLogEntry` payloads automatically.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * // In your Convex mutation:
15
+ * import { auditPreset } from '@geenius-tools/convex-wrappers'
16
+ *
17
+ * export const updateOrderStatus = authedMutation()
18
+ * .name('orders.updateStatus')
19
+ * .args({ orderId: v.id('orders'), status: v.string() })
20
+ * .audit(auditPreset.entityStatus({
21
+ * entityTable: 'orders',
22
+ * entityId: (args) => args.orderId,
23
+ * action: 'update_status',
24
+ * before: async (ctx, args) => {
25
+ * const order = await ctx.db.get(args.orderId)
26
+ * return order?.status
27
+ * },
28
+ * after: (args) => args.status,
29
+ * }))
30
+ * .handler(async (ctx, args) => { ... })
31
+ * ```
32
+ */
33
+ export const auditPreset = {
34
+ /**
35
+ * Preset for status changes (before → after).
36
+ * Generates a diff showing `{ status: { from, to } }`.
37
+ */
38
+ entityStatus<TArgs, TResult = unknown>(params: {
39
+ entityTable: string
40
+ entityId: (args: TArgs) => string
41
+ action: string
42
+ before?: (ctx: any, args: TArgs) => Promise<unknown> | unknown
43
+ after: ((args: TArgs, result: TResult) => unknown) | unknown
44
+ reason?: (args: TArgs) => string | undefined
45
+ }) {
46
+ return (args: TArgs) => ({
47
+ onSuccess: async (callParams: {
48
+ ctx: any
49
+ args: TArgs
50
+ result: TResult
51
+ requestId: string
52
+ userId?: string
53
+ user?: any
54
+ flags: Record<string, boolean>
55
+ }): Promise<Omit<AuditLogEntry, 'createdAt'> | null> => {
56
+ const { ctx, result, requestId, user } = callParams
57
+
58
+ const beforeVal = params.before
59
+ ? await params.before(ctx, args)
60
+ : undefined
61
+
62
+ const afterVal =
63
+ typeof params.after === 'function'
64
+ ? (params.after as (args: TArgs, result: TResult) => unknown)(args, result)
65
+ : params.after
66
+
67
+ return {
68
+ actorId: user?._id,
69
+ role: user?.role ?? 'system',
70
+ actorRoles: user?.roles ?? (user?.role ? [user.role] : undefined),
71
+ action: params.action,
72
+ entityTable: params.entityTable,
73
+ entityId: params.entityId(args),
74
+ beforeJson: beforeVal === undefined ? undefined : JSON.stringify(beforeVal),
75
+ afterJson: afterVal === undefined ? undefined : JSON.stringify(afterVal),
76
+ diffJson: JSON.stringify({ status: { from: beforeVal, to: afterVal } }),
77
+ reason: params.reason ? params.reason(args) : undefined,
78
+ requestId,
79
+ }
80
+ },
81
+ })
82
+ },
83
+
84
+ /**
85
+ * Preset for entity patches (partial updates with full before/after + diff).
86
+ */
87
+ entityPatch<TArgs, TResult = unknown>(params: {
88
+ entityTable: string
89
+ entityId: (args: TArgs) => string
90
+ action: string
91
+ before: (ctx: any, args: TArgs) => Promise<Record<string, unknown>>
92
+ patch: (args: TArgs, result: TResult) => Record<string, unknown>
93
+ reason?: (args: TArgs) => string | undefined
94
+ }) {
95
+ return (args: TArgs) => ({
96
+ onSuccess: async (callParams: {
97
+ ctx: any
98
+ args: TArgs
99
+ result: TResult
100
+ requestId: string
101
+ userId?: string
102
+ user?: any
103
+ flags: Record<string, boolean>
104
+ }): Promise<Omit<AuditLogEntry, 'createdAt'> | null> => {
105
+ const { ctx, result, requestId, user } = callParams
106
+
107
+ const beforeObj = await params.before(ctx, args)
108
+ const patchObj = params.patch(args, result)
109
+ const afterObj = { ...beforeObj, ...patchObj }
110
+ const diff = computeDiff(beforeObj, afterObj)
111
+
112
+ return {
113
+ actorId: user?._id,
114
+ role: user?.role ?? 'system',
115
+ actorRoles: user?.roles ?? (user?.role ? [user.role] : undefined),
116
+ action: params.action,
117
+ entityTable: params.entityTable,
118
+ entityId: params.entityId(args),
119
+ beforeJson: JSON.stringify(beforeObj),
120
+ afterJson: JSON.stringify(afterObj),
121
+ diffJson: JSON.stringify(diff),
122
+ reason: params.reason?.(args),
123
+ requestId,
124
+ }
125
+ },
126
+ })
127
+ },
128
+
129
+ /**
130
+ * Preset for simple create/delete actions (no before/after diff needed).
131
+ */
132
+ entityAction<TArgs>(params: {
133
+ entityTable: string
134
+ entityId: (args: TArgs) => string
135
+ action: string
136
+ description?: (args: TArgs) => string | undefined
137
+ reason?: (args: TArgs) => string | undefined
138
+ }) {
139
+ return (_args: TArgs) => ({
140
+ onSuccess: async (callParams: {
141
+ ctx: any
142
+ args: TArgs
143
+ result: unknown
144
+ requestId: string
145
+ userId?: string
146
+ user?: any
147
+ flags: Record<string, boolean>
148
+ }): Promise<Omit<AuditLogEntry, 'createdAt'> | null> => {
149
+ const { args, requestId, user } = callParams
150
+
151
+ return {
152
+ actorId: user?._id,
153
+ role: user?.role ?? 'system',
154
+ actorRoles: user?.roles ?? (user?.role ? [user.role] : undefined),
155
+ action: params.action,
156
+ entityTable: params.entityTable,
157
+ entityId: params.entityId(args),
158
+ description: params.description?.(args),
159
+ reason: params.reason?.(args),
160
+ requestId,
161
+ }
162
+ },
163
+ })
164
+ },
165
+ }