@jmruthers/pace-core 0.2.4
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.
- package/CHANGELOG.md +202 -0
- package/README.md +299 -0
- package/dist/DataTable-BHlzyKZP.d.ts +116 -0
- package/dist/DataTable-GEY5U7OI.js +100 -0
- package/dist/DataTable-GEY5U7OI.js.map +1 -0
- package/dist/PublicLoadingSpinner-DztrzuJr.d.ts +3430 -0
- package/dist/UnifiedAuthProvider-w66zSCUf.d.ts +160 -0
- package/dist/api-GZHIDA4X.js +41 -0
- package/dist/api-GZHIDA4X.js.map +1 -0
- package/dist/appConfig-BVGyuvI7.d.ts +71 -0
- package/dist/appNameResolver-7GHF5ED2.js +22 -0
- package/dist/appNameResolver-7GHF5ED2.js.map +1 -0
- package/dist/audit-BUW3LMJB.js +16 -0
- package/dist/audit-BUW3LMJB.js.map +1 -0
- package/dist/chunk-22KLBHPS.js +29 -0
- package/dist/chunk-22KLBHPS.js.map +1 -0
- package/dist/chunk-24MKLB7U.js +81 -0
- package/dist/chunk-24MKLB7U.js.map +1 -0
- package/dist/chunk-2MKP6IYD.js +388 -0
- package/dist/chunk-2MKP6IYD.js.map +1 -0
- package/dist/chunk-2V3Y6YBC.js +114 -0
- package/dist/chunk-2V3Y6YBC.js.map +1 -0
- package/dist/chunk-5CDJCTOO.js +190 -0
- package/dist/chunk-5CDJCTOO.js.map +1 -0
- package/dist/chunk-6ZQVSHKL.js +1345 -0
- package/dist/chunk-6ZQVSHKL.js.map +1 -0
- package/dist/chunk-74C6SNEC.js +77 -0
- package/dist/chunk-74C6SNEC.js.map +1 -0
- package/dist/chunk-7BNPOCLL.js +178 -0
- package/dist/chunk-7BNPOCLL.js.map +1 -0
- package/dist/chunk-7JL3T7BO.js +3344 -0
- package/dist/chunk-7JL3T7BO.js.map +1 -0
- package/dist/chunk-CDQ3PX7L.js +18 -0
- package/dist/chunk-CDQ3PX7L.js.map +1 -0
- package/dist/chunk-DY5E3AT7.js +1734 -0
- package/dist/chunk-DY5E3AT7.js.map +1 -0
- package/dist/chunk-ETEJVKYK.js +6032 -0
- package/dist/chunk-ETEJVKYK.js.map +1 -0
- package/dist/chunk-I5Z3QH5X.js +32 -0
- package/dist/chunk-I5Z3QH5X.js.map +1 -0
- package/dist/chunk-MZBUOP4P.js +119 -0
- package/dist/chunk-MZBUOP4P.js.map +1 -0
- package/dist/chunk-N2EUGZRW.js +98 -0
- package/dist/chunk-N2EUGZRW.js.map +1 -0
- package/dist/chunk-NQ4TOOO6.js +20 -0
- package/dist/chunk-NQ4TOOO6.js.map +1 -0
- package/dist/chunk-OHXGNT3K.js +21 -0
- package/dist/chunk-OHXGNT3K.js.map +1 -0
- package/dist/chunk-OKXMUYIB.js +522 -0
- package/dist/chunk-OKXMUYIB.js.map +1 -0
- package/dist/chunk-PFRRIDYA.js +382 -0
- package/dist/chunk-PFRRIDYA.js.map +1 -0
- package/dist/chunk-PLDDJCW6.js +49 -0
- package/dist/chunk-PLDDJCW6.js.map +1 -0
- package/dist/chunk-SS3E6QLB.js +695 -0
- package/dist/chunk-SS3E6QLB.js.map +1 -0
- package/dist/chunk-TMRLB2LA.js +326 -0
- package/dist/chunk-TMRLB2LA.js.map +1 -0
- package/dist/chunk-WYB6MBZA.js +5533 -0
- package/dist/chunk-WYB6MBZA.js.map +1 -0
- package/dist/chunk-YDJW5XTN.js +84 -0
- package/dist/chunk-YDJW5XTN.js.map +1 -0
- package/dist/components.d.ts +1308 -0
- package/dist/components.js +3759 -0
- package/dist/components.js.map +1 -0
- package/dist/database-C3Szpi5J.d.ts +470 -0
- package/dist/hooks.d.ts +449 -0
- package/dist/hooks.js +612 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +385 -0
- package/dist/index.js +569 -0
- package/dist/index.js.map +1 -0
- package/dist/organisation-CO3Sh3_D.d.ts +99 -0
- package/dist/providers.d.ts +45 -0
- package/dist/providers.js +36 -0
- package/dist/providers.js.map +1 -0
- package/dist/rbac/eslint-rules.d.ts +52 -0
- package/dist/rbac/eslint-rules.js +252 -0
- package/dist/rbac/eslint-rules.js.map +1 -0
- package/dist/rbac/index.d.ts +1918 -0
- package/dist/rbac/index.js +2212 -0
- package/dist/rbac/index.js.map +1 -0
- package/dist/styles/core.css +401 -0
- package/dist/styles/fonts/georama-italic.woff2 +0 -0
- package/dist/styles/fonts/georama.woff2 +0 -0
- package/dist/styles/fonts/open-sans-italic.woff2 +0 -0
- package/dist/styles/fonts/open-sans.woff2 +0 -0
- package/dist/styles/fonts/reddit-mono.woff2 +0 -0
- package/dist/styles/index.d.ts +36 -0
- package/dist/styles/index.js +24 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/theming/runtime.d.ts +73 -0
- package/dist/theming/runtime.js +16 -0
- package/dist/theming/runtime.js.map +1 -0
- package/dist/types-CInEi-ng.d.ts +316 -0
- package/dist/types.d.ts +196 -0
- package/dist/types.js +83 -0
- package/dist/types.js.map +1 -0
- package/dist/unified-CM7T0aTK.d.ts +198 -0
- package/dist/useComponentPerformance-DE9l5RkL.d.ts +11 -0
- package/dist/usePublicRouteParams-B6i0KtXW.d.ts +477 -0
- package/dist/utils.d.ts +639 -0
- package/dist/utils.js +1103 -0
- package/dist/utils.js.map +1 -0
- package/dist/validation-PM_iOaTI.d.ts +159 -0
- package/dist/validation.d.ts +138 -0
- package/dist/validation.js +477 -0
- package/dist/validation.js.map +1 -0
- package/docs/INDEX.md +192 -0
- package/docs/README.md +165 -0
- package/docs/api/.nojekyll +1 -0
- package/docs/api/README.md +301 -0
- package/docs/api/classes/ErrorBoundary.md +144 -0
- package/docs/api/classes/PublicErrorBoundary.md +132 -0
- package/docs/api/interfaces/AggregateConfig.md +43 -0
- package/docs/api/interfaces/ButtonProps.md +53 -0
- package/docs/api/interfaces/CardProps.md +40 -0
- package/docs/api/interfaces/ColorPalette.md +7 -0
- package/docs/api/interfaces/ColorShade.md +41 -0
- package/docs/api/interfaces/DataTableAction.md +200 -0
- package/docs/api/interfaces/DataTableColumn.md +300 -0
- package/docs/api/interfaces/DataTableProps.md +517 -0
- package/docs/api/interfaces/DataTableToolbarButton.md +96 -0
- package/docs/api/interfaces/EmptyStateConfig.md +61 -0
- package/docs/api/interfaces/EventContextType.md +96 -0
- package/docs/api/interfaces/EventLogoProps.md +152 -0
- package/docs/api/interfaces/EventProviderProps.md +19 -0
- package/docs/api/interfaces/FileSizeLimits.md +7 -0
- package/docs/api/interfaces/FileUploadProps.md +154 -0
- package/docs/api/interfaces/FooterProps.md +105 -0
- package/docs/api/interfaces/InactivityWarningModalProps.md +115 -0
- package/docs/api/interfaces/InputProps.md +53 -0
- package/docs/api/interfaces/LabelProps.md +107 -0
- package/docs/api/interfaces/LoginFormProps.md +184 -0
- package/docs/api/interfaces/NavigationItem.md +176 -0
- package/docs/api/interfaces/NavigationMenuProps.md +236 -0
- package/docs/api/interfaces/Organisation.md +140 -0
- package/docs/api/interfaces/OrganisationContextType.md +377 -0
- package/docs/api/interfaces/OrganisationMembership.md +140 -0
- package/docs/api/interfaces/OrganisationProviderProps.md +19 -0
- package/docs/api/interfaces/OrganisationSecurityError.md +62 -0
- package/docs/api/interfaces/PaceAppLayoutProps.md +393 -0
- package/docs/api/interfaces/PaceLoginPageProps.md +34 -0
- package/docs/api/interfaces/PaletteData.md +41 -0
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +94 -0
- package/docs/api/interfaces/PublicErrorBoundaryState.md +68 -0
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +86 -0
- package/docs/api/interfaces/PublicPageFooterProps.md +112 -0
- package/docs/api/interfaces/PublicPageHeaderProps.md +138 -0
- package/docs/api/interfaces/PublicPageLayoutProps.md +138 -0
- package/docs/api/interfaces/StorageConfig.md +41 -0
- package/docs/api/interfaces/StorageFileInfo.md +74 -0
- package/docs/api/interfaces/StorageFileMetadata.md +140 -0
- package/docs/api/interfaces/StorageListOptions.md +86 -0
- package/docs/api/interfaces/StorageListResult.md +41 -0
- package/docs/api/interfaces/StorageUploadOptions.md +88 -0
- package/docs/api/interfaces/StorageUploadResult.md +63 -0
- package/docs/api/interfaces/StorageUrlOptions.md +47 -0
- package/docs/api/interfaces/StyleImport.md +19 -0
- package/docs/api/interfaces/ToastActionElement.md +9 -0
- package/docs/api/interfaces/ToastProps.md +9 -0
- package/docs/api/interfaces/UnifiedAuthContextType.md +1108 -0
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +171 -0
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +136 -0
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +123 -0
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +87 -0
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +81 -0
- package/docs/api/interfaces/UsePublicEventOptions.md +34 -0
- package/docs/api/interfaces/UsePublicEventReturn.md +68 -0
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +94 -0
- package/docs/api/interfaces/UserEventAccess.md +118 -0
- package/docs/api/interfaces/UserMenuProps.md +86 -0
- package/docs/api/interfaces/UserProfile.md +63 -0
- package/docs/api/modules.md +4153 -0
- package/docs/api-reference/components.md +1623 -0
- package/docs/api-reference/hooks.md +627 -0
- package/docs/api-reference/providers.md +487 -0
- package/docs/api-reference/types.md +1005 -0
- package/docs/api-reference/utilities.md +1104 -0
- package/docs/app.css.example +53 -0
- package/docs/architecture/README.md +577 -0
- package/docs/best-practices/README.md +400 -0
- package/docs/best-practices/deployment.md +1042 -0
- package/docs/best-practices/performance.md +789 -0
- package/docs/best-practices/security.md +881 -0
- package/docs/best-practices/testing.md +981 -0
- package/docs/consuming-app-example.md +290 -0
- package/docs/consuming-app-vite-config.md +233 -0
- package/docs/core-concepts/authentication.md +98 -0
- package/docs/core-concepts/events.md +756 -0
- package/docs/core-concepts/organisations.md +790 -0
- package/docs/core-concepts/permissions.md +729 -0
- package/docs/core-concepts/rbac-system.md +233 -0
- package/docs/database-schema-requirements.md +172 -0
- package/docs/documentation-style-checklist.md +294 -0
- package/docs/examples/navigation-menu-auth-fix.md +344 -0
- package/docs/getting-started/examples/README.md +106 -0
- package/docs/getting-started/examples/basic-auth-app.md +521 -0
- package/docs/getting-started/examples/full-featured-app.md +616 -0
- package/docs/getting-started/installation.md +269 -0
- package/docs/getting-started/quick-start.md +401 -0
- package/docs/implementation-guides/app-layout.md +983 -0
- package/docs/implementation-guides/data-tables.md +1898 -0
- package/docs/implementation-guides/dynamic-colors.md +195 -0
- package/docs/implementation-guides/forms.md +578 -0
- package/docs/implementation-guides/hierarchical-datatable.md +850 -0
- package/docs/implementation-guides/large-datasets.md +281 -0
- package/docs/implementation-guides/navigation.md +844 -0
- package/docs/implementation-guides/performance.md +403 -0
- package/docs/implementation-guides/permission-enforcement.md +764 -0
- package/docs/implementation-guides/public-pages.md +752 -0
- package/docs/migration/README.md +493 -0
- package/docs/migration/organisation-context-timing-fix.md +217 -0
- package/docs/migration/quick-migration-guide.md +320 -0
- package/docs/migration/rbac-migration.md +571 -0
- package/docs/migration/v0.4.15-tailwind-scanning.md +272 -0
- package/docs/migration/v0.4.16-css-first-approach.md +306 -0
- package/docs/migration/v0.4.17-source-path-fix.md +229 -0
- package/docs/migration-guide.md +168 -0
- package/docs/performance/README.md +551 -0
- package/docs/print-components/README.md +258 -0
- package/docs/print-components/api-reference.md +636 -0
- package/docs/print-components/examples/README.md +204 -0
- package/docs/print-components/examples/basic-report.tsx +92 -0
- package/docs/print-components/examples/card-catalog.tsx +149 -0
- package/docs/print-components/examples/cover-page-report.tsx +163 -0
- package/docs/print-components/quick-start.md +363 -0
- package/docs/quick-reference.md +576 -0
- package/docs/rbac/README.md +265 -0
- package/docs/rbac/advanced-patterns.md +776 -0
- package/docs/rbac/api-reference.md +1033 -0
- package/docs/rbac/examples.md +883 -0
- package/docs/rbac/getting-started.md +679 -0
- package/docs/rbac/quick-start.md +619 -0
- package/docs/rbac/super-admin-guide.md +592 -0
- package/docs/rbac/troubleshooting.md +316 -0
- package/docs/security/README.md +680 -0
- package/docs/security/checklist.md +343 -0
- package/docs/style-guide.md +522 -0
- package/docs/styles/README.md +319 -0
- package/docs/testing/README.md +874 -0
- package/docs/troubleshooting/README.md +497 -0
- package/docs/troubleshooting/common-issues.md +1563 -0
- package/docs/troubleshooting/database-view-compatibility.md +119 -0
- package/docs/troubleshooting/debugging.md +1117 -0
- package/docs/troubleshooting/migration.md +918 -0
- package/docs/troubleshooting/organisation-context-setup.md +277 -0
- package/docs/troubleshooting/react-hooks-issue-analysis.md +166 -0
- package/docs/troubleshooting/styling-issues.md +219 -0
- package/docs/troubleshooting/tailwind-content-scanning.md +213 -0
- package/docs/usage.md +175 -0
- package/docs/visual-testing.md +114 -0
- package/package.json +211 -0
- package/src/__mocks__/lucide-react.ts +181 -0
- package/src/__tests__/README.md +404 -0
- package/src/__tests__/debug-provider.unit.test.tsx +67 -0
- package/src/__tests__/e2e/workflows.test.tsx +373 -0
- package/src/__tests__/hybridPermissions.unit.test.tsx +474 -0
- package/src/__tests__/index.integration.test.ts +491 -0
- package/src/__tests__/mocks/MockAuthProvider-standalone.tsx +47 -0
- package/src/__tests__/mocks/MockAuthProvider.tsx +63 -0
- package/src/__tests__/mocks/enhancedSupabaseMock.ts +252 -0
- package/src/__tests__/mocks/index.test.ts +23 -0
- package/src/__tests__/mocks/index.ts +16 -0
- package/src/__tests__/mocks/mockAuth.ts +155 -0
- package/src/__tests__/mocks/mockSupabase.ts +83 -0
- package/src/__tests__/mocks/mockSupabaseClient.ts +63 -0
- package/src/__tests__/mocks/providers.tsx +22 -0
- package/src/__tests__/patterns/__tests__/testPatterns.test.ts +394 -0
- package/src/__tests__/patterns/testPatterns.ts +124 -0
- package/src/__tests__/performance/componentPerformance.performance.test.ts +27 -0
- package/src/__tests__/performance/index.ts +24 -0
- package/src/__tests__/performance/performanceValidation.performance.test.ts +15 -0
- package/src/__tests__/security/security.unit.test.tsx +7 -0
- package/src/__tests__/security/securityValidation.security.test.tsx +153 -0
- package/src/__tests__/setup.ts +259 -0
- package/src/__tests__/setupTests.d.ts +1 -0
- package/src/__tests__/shared/componentTestUtils.tsx +475 -0
- package/src/__tests__/shared/errorHandlingTestUtils.ts +107 -0
- package/src/__tests__/shared/index.ts +81 -0
- package/src/__tests__/shared/integrationTestUtils.tsx +375 -0
- package/src/__tests__/shared/performanceTestUtils.tsx +476 -0
- package/src/__tests__/shared/testUtils.optimized.tsx +627 -0
- package/src/__tests__/simple.test.tsx +20 -0
- package/src/__tests__/templates/accessibility.test.template.tsx +279 -0
- package/src/__tests__/templates/component.test.template.tsx +122 -0
- package/src/__tests__/templates/integration.test.template.tsx +199 -0
- package/src/__tests__/test-utils/dataFactories.ts +60 -0
- package/src/__tests__/test-utils/index.ts +6 -0
- package/src/__tests__/typeSafety.unit.test.ts +65 -0
- package/src/__tests__/unifiedAuth.unit.test.tsx +151 -0
- package/src/__tests__/utils/accessibilityHelpers.ts +254 -0
- package/src/__tests__/utils/assertions.ts +50 -0
- package/src/__tests__/utils/deterministicHelpers.ts +31 -0
- package/src/__tests__/utils/edgeCaseConfig.test.ts +75 -0
- package/src/__tests__/utils/edgeCaseConfig.ts +98 -0
- package/src/__tests__/utils/mockHelpers.ts +149 -0
- package/src/__tests__/utils/mockLoader.ts +101 -0
- package/src/__tests__/utils/performanceHelpers.ts +55 -0
- package/src/__tests__/utils/performanceTestHelpers.ts +68 -0
- package/src/__tests__/utils/testDataFactories.ts +28 -0
- package/src/__tests__/utils/testIsolation.ts +67 -0
- package/src/__tests__/utils/visualTestHelpers.ts +20 -0
- package/src/__tests__/visual/__snapshots__/componentSnapshots.visual.test.tsx.snap +68 -0
- package/src/__tests__/visual/__snapshots__/componentVisuals.visual.test.tsx.snap +14 -0
- package/src/__tests__/visual/__snapshots__/visualRegression.test.tsx.snap +217 -0
- package/src/__tests__/visual/__snapshots__/visualRegression.visual.test.tsx.snap +24 -0
- package/src/__tests__/visual/componentSnapshots.visual.test.tsx +33 -0
- package/src/__tests__/visual/componentVisuals.visual.test.tsx +12 -0
- package/src/__tests__/visual/visualRegression.visual.test.tsx +20 -0
- package/src/components/Alert/Alert.tsx +134 -0
- package/src/components/Alert/__tests__/Alert.unit.test.tsx +381 -0
- package/src/components/Alert/index.ts +2 -0
- package/src/components/Avatar/Avatar.tsx +84 -0
- package/src/components/Avatar/__tests__/Avatar.unit.test.tsx +232 -0
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/Button/Button.tsx +270 -0
- package/src/components/Button/__tests__/Button.accessibility.test.tsx +131 -0
- package/src/components/Button/__tests__/Button.comprehensive.test.tsx +721 -0
- package/src/components/Button/__tests__/Button.unit.test.tsx +189 -0
- package/src/components/Button/__tests__/EventSelector.integration.test.tsx +285 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Card/Card.tsx +271 -0
- package/src/components/Card/__tests__/Card.accessibility.test.tsx +394 -0
- package/src/components/Card/__tests__/Card.comprehensive.test.tsx +599 -0
- package/src/components/Card/__tests__/Card.integration.test.tsx +673 -0
- package/src/components/Card/__tests__/Card.performance.test.tsx +546 -0
- package/src/components/Card/__tests__/Card.unit.test.tsx +330 -0
- package/src/components/Card/__tests__/Card.visual.test.tsx +599 -0
- package/src/components/Card/__tests__/README.md +211 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.tsx +75 -0
- package/src/components/Checkbox/__mocks__/Checkbox.tsx +2 -0
- package/src/components/Checkbox/__tests__/Checkbox.unit.test.tsx +520 -0
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/DataTable/DataTable.tsx +440 -0
- package/src/components/DataTable/__tests__/DataTable.autoSizing.test.tsx +526 -0
- package/src/components/DataTable/__tests__/DataTable.errorHandling.test.tsx +259 -0
- package/src/components/DataTable/__tests__/DataTable.hierarchical.test.tsx +675 -0
- package/src/components/DataTable/__tests__/DataTable.infinite-loop.test.tsx +324 -0
- package/src/components/DataTable/__tests__/DataTable.integration.test.tsx +724 -0
- package/src/components/DataTable/__tests__/DataTable.performance.test.tsx +597 -0
- package/src/components/DataTable/__tests__/DataTable.permissions.test.tsx +306 -0
- package/src/components/DataTable/__tests__/DataTable.regressionFixes.test.tsx +546 -0
- package/src/components/DataTable/__tests__/DataTable.selection.controlled.test.tsx +386 -0
- package/src/components/DataTable/__tests__/DataTable.selection.test.tsx +338 -0
- package/src/components/DataTable/__tests__/DataTable.userWorkflows.test.tsx +310 -0
- package/src/components/DataTable/__tests__/DataTable.workflowValidation.test.tsx +489 -0
- package/src/components/DataTable/__tests__/DataTable.workflows.test.tsx +701 -0
- package/src/components/DataTable/__tests__/README.md +136 -0
- package/src/components/DataTable/__tests__/mocks/MockRBACProvider.tsx +66 -0
- package/src/components/DataTable/__tests__/performance-regression.test.tsx +788 -0
- package/src/components/DataTable/__tests__/performance.test.tsx +365 -0
- package/src/components/DataTable/__tests__/test-utils/dataFactories.ts +103 -0
- package/src/components/DataTable/__tests__/test-utils/sharedTestUtils.tsx +382 -0
- package/src/components/DataTable/__tests__/test-utils.ts +94 -0
- package/src/components/DataTable/components/ActionButtons.tsx +177 -0
- package/src/components/DataTable/components/BulkOperationsDropdown.tsx +160 -0
- package/src/components/DataTable/components/ColumnFilter.tsx +114 -0
- package/src/components/DataTable/components/ColumnVisibilityDropdown.tsx +100 -0
- package/src/components/DataTable/components/DataTableBody.tsx +462 -0
- package/src/components/DataTable/components/DataTableCore.tsx +869 -0
- package/src/components/DataTable/components/DataTableErrorBoundary.tsx +214 -0
- package/src/components/DataTable/components/DataTableHeader.tsx +31 -0
- package/src/components/DataTable/components/DataTableModals.tsx +87 -0
- package/src/components/DataTable/components/DataTableToolbar.tsx +251 -0
- package/src/components/DataTable/components/DraggableColumnHeader.tsx +148 -0
- package/src/components/DataTable/components/EditableRow.tsx +160 -0
- package/src/components/DataTable/components/EmptyState.tsx +64 -0
- package/src/components/DataTable/components/ExpandButton.tsx +113 -0
- package/src/components/DataTable/components/FilterRow.tsx +101 -0
- package/src/components/DataTable/components/GroupHeader.tsx +42 -0
- package/src/components/DataTable/components/GroupingDropdown.tsx +96 -0
- package/src/components/DataTable/components/ImportModal.tsx +345 -0
- package/src/components/DataTable/components/LoadingState.tsx +12 -0
- package/src/components/DataTable/components/PaginationControls.tsx +332 -0
- package/src/components/DataTable/components/UnifiedTableBody.tsx +911 -0
- package/src/components/DataTable/components/ViewRowModal.tsx +68 -0
- package/src/components/DataTable/components/VirtualizedDataTable.tsx +593 -0
- package/src/components/DataTable/components/__tests__/ActionButtons.unit.test.tsx +150 -0
- package/src/components/DataTable/components/__tests__/BulkOperationsDropdown.test.tsx +224 -0
- package/src/components/DataTable/components/__tests__/ColumnVisibilityDropdown.unit.test.tsx +244 -0
- package/src/components/DataTable/components/__tests__/DataTable.accessibility.test.tsx +523 -0
- package/src/components/DataTable/components/__tests__/DataTable.integration.test.tsx +401 -0
- package/src/components/DataTable/components/__tests__/DataTable.performance.test.tsx +161 -0
- package/src/components/DataTable/components/__tests__/DataTable.real.test.tsx +251 -0
- package/src/components/DataTable/components/__tests__/DataTable.security.test.tsx +172 -0
- package/src/components/DataTable/components/__tests__/DataTable.unit.test.tsx +290 -0
- package/src/components/DataTable/components/__tests__/DataTableBody.unit.test.tsx +147 -0
- package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.unit.test.tsx +182 -0
- package/src/components/DataTable/components/__tests__/DataTableHeader.unit.test.tsx +143 -0
- package/src/components/DataTable/components/__tests__/DataTableModals.unit.test.tsx +123 -0
- package/src/components/DataTable/components/__tests__/EditableRow.unit.test.tsx +660 -0
- package/src/components/DataTable/components/__tests__/EmptyState.unit.test.tsx +256 -0
- package/src/components/DataTable/components/__tests__/ExpandButton.test.tsx +498 -0
- package/src/components/DataTable/components/__tests__/FilterRow.unit.test.tsx +112 -0
- package/src/components/DataTable/components/__tests__/FilteringToggle.unit.test.tsx +130 -0
- package/src/components/DataTable/components/__tests__/GroupHeader.unit.test.tsx +172 -0
- package/src/components/DataTable/components/__tests__/GroupingDropdown.unit.test.tsx +222 -0
- package/src/components/DataTable/components/__tests__/ImportModal.unit.test.tsx +780 -0
- package/src/components/DataTable/components/__tests__/LoadingState.unit.test.tsx +65 -0
- package/src/components/DataTable/components/__tests__/PaginationControls.unit.test.tsx +634 -0
- package/src/components/DataTable/components/__tests__/StateComponents.unit.test.tsx +48 -0
- package/src/components/DataTable/components/__tests__/UnifiedTableBody.hierarchical.test.tsx +541 -0
- package/src/components/DataTable/components/__tests__/ViewRowModal.unit.test.tsx +228 -0
- package/src/components/DataTable/components/__tests__/VirtualizedDataTable.unit.test.tsx +568 -0
- package/src/components/DataTable/components/index.ts +17 -0
- package/src/components/DataTable/context/DataTableContext.tsx +97 -0
- package/src/components/DataTable/core/ActionManager.ts +235 -0
- package/src/components/DataTable/core/ColumnFactory.ts +268 -0
- package/src/components/DataTable/core/ColumnManager.ts +205 -0
- package/src/components/DataTable/core/DataManager.ts +188 -0
- package/src/components/DataTable/core/DataTableContext.tsx +182 -0
- package/src/components/DataTable/core/LocalDataAdapter.ts +264 -0
- package/src/components/DataTable/core/PluginRegistry.ts +229 -0
- package/src/components/DataTable/core/StateManager.ts +311 -0
- package/src/components/DataTable/core/__tests__/ActionManager.unit.test.ts +405 -0
- package/src/components/DataTable/core/__tests__/ArchitectureIntegration.unit.test.tsx +445 -0
- package/src/components/DataTable/core/__tests__/ColumnFactory.unit.test.ts +288 -0
- package/src/components/DataTable/core/__tests__/ColumnManager.unit.test.ts +623 -0
- package/src/components/DataTable/core/__tests__/DataManager.unit.test.ts +431 -0
- package/src/components/DataTable/core/__tests__/DataTableContext.unit.test.tsx +433 -0
- package/src/components/DataTable/core/__tests__/LocalDataAdapter.unit.test.ts +422 -0
- package/src/components/DataTable/core/__tests__/PluginRegistry.unit.test.tsx +207 -0
- package/src/components/DataTable/core/__tests__/StateManager.unit.test.ts +278 -0
- package/src/components/DataTable/core/index.ts +8 -0
- package/src/components/DataTable/core/interfaces.ts +338 -0
- package/src/components/DataTable/examples/AutoSizingExample.tsx +180 -0
- package/src/components/DataTable/examples/ColumnSizingComparison.tsx +235 -0
- package/src/components/DataTable/examples/HierarchicalActionsExample.tsx +418 -0
- package/src/components/DataTable/examples/HierarchicalExample.tsx +472 -0
- package/src/components/DataTable/examples/InitialPageSizeExample.tsx +173 -0
- package/src/components/DataTable/examples/PerformanceExample.tsx +502 -0
- package/src/components/DataTable/examples/__tests__/PerformanceExample.unit.test.tsx +281 -0
- package/src/components/DataTable/hooks/__tests__/useColumnOrderPersistence.unit.test.ts +407 -0
- package/src/components/DataTable/hooks/__tests__/useColumnReordering.unit.test.ts +679 -0
- package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +95 -0
- package/src/components/DataTable/hooks/useColumnReordering.ts +110 -0
- package/src/components/DataTable/hooks/useDataTableState.ts +325 -0
- package/src/components/DataTable/hooks/useHierarchicalState.ts +174 -0
- package/src/components/DataTable/index.ts +70 -0
- package/src/components/DataTable/styles.ts +171 -0
- package/src/components/DataTable/types.ts +475 -0
- package/src/components/DataTable/utils/__tests__/columnSizing.test.ts +237 -0
- package/src/components/DataTable/utils/__tests__/debugTools.unit.test.ts +267 -0
- package/src/components/DataTable/utils/__tests__/errorHandling.unit.test.ts +467 -0
- package/src/components/DataTable/utils/__tests__/exportUtils.unit.test.ts +380 -0
- package/src/components/DataTable/utils/__tests__/flexibleImport.unit.test.ts +233 -0
- package/src/components/DataTable/utils/__tests__/performanceUtils.unit.test.ts +414 -0
- package/src/components/DataTable/utils/columnSizing.ts +125 -0
- package/src/components/DataTable/utils/debugTools.ts +583 -0
- package/src/components/DataTable/utils/errorHandling.ts +494 -0
- package/src/components/DataTable/utils/exportUtils.ts +126 -0
- package/src/components/DataTable/utils/flexibleImport.ts +510 -0
- package/src/components/DataTable/utils/hierarchicalSorting.ts +151 -0
- package/src/components/DataTable/utils/hierarchicalUtils.ts +218 -0
- package/src/components/DataTable/utils/index.ts +1 -0
- package/src/components/DataTable/utils/performanceUtils.ts +351 -0
- package/src/components/Dialog/Dialog.tsx +782 -0
- package/src/components/Dialog/README.md +804 -0
- package/src/components/Dialog/__tests__/Dialog.accessibility.test.tsx +521 -0
- package/src/components/Dialog/__tests__/Dialog.auto-size.example.tsx +157 -0
- package/src/components/Dialog/__tests__/Dialog.enhanced.test.tsx +538 -0
- package/src/components/Dialog/__tests__/Dialog.unit.test.tsx +1373 -0
- package/src/components/Dialog/examples/BasicHtmlTest.tsx +55 -0
- package/src/components/Dialog/examples/DebugHtmlExample.tsx +68 -0
- package/src/components/Dialog/examples/HtmlDialogExample.tsx +202 -0
- package/src/components/Dialog/examples/SimpleHtmlTest.tsx +61 -0
- package/src/components/Dialog/examples/SmartDialogExample.tsx +322 -0
- package/src/components/Dialog/examples/__tests__/SmartDialogExample.unit.test.tsx +151 -0
- package/src/components/Dialog/index.ts +12 -0
- package/src/components/Dialog/utils/__tests__/safeHtml.unit.test.ts +611 -0
- package/src/components/Dialog/utils/safeHtml.ts +185 -0
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +312 -0
- package/src/components/ErrorBoundary/__tests__/ErrorBoundary.accessibility.test.tsx +517 -0
- package/src/components/ErrorBoundary/__tests__/ErrorBoundary.integration.test.tsx +572 -0
- package/src/components/ErrorBoundary/__tests__/ErrorBoundary.unit.test.tsx +579 -0
- package/src/components/ErrorBoundary/index.ts +8 -0
- package/src/components/EventSelector/EventSelector.tsx +360 -0
- package/src/components/EventSelector/__tests__/EventSelector.test.tsx +528 -0
- package/src/components/EventSelector/index.ts +3 -0
- package/src/components/EventSelector/types.ts +79 -0
- package/src/components/FileUpload/FileUpload.example.tsx +218 -0
- package/src/components/FileUpload/FileUpload.tsx +237 -0
- package/src/components/FileUpload/__tests__/FileUpload.integration.test.tsx +992 -0
- package/src/components/FileUpload/__tests__/FileUpload.real.test.tsx +927 -0
- package/src/components/FileUpload/__tests__/FileUpload.test.tsx +855 -0
- package/src/components/FileUpload/__tests__/FileUpload.unit.test.tsx +1311 -0
- package/src/components/FileUpload/__tests__/FileUpload.unmocked.test.tsx +937 -0
- package/src/components/FileUpload/index.ts +6 -0
- package/src/components/Footer/Footer.tsx +197 -0
- package/src/components/Footer/__tests__/Footer.accessibility.test.tsx +359 -0
- package/src/components/Footer/__tests__/Footer.integration.test.tsx +353 -0
- package/src/components/Footer/__tests__/Footer.performance.test.tsx +309 -0
- package/src/components/Footer/__tests__/Footer.unit.test.tsx +309 -0
- package/src/components/Footer/__tests__/Footer.visual.test.tsx +335 -0
- package/src/components/Footer/index.ts +17 -0
- package/src/components/Form/Form.tsx +166 -0
- package/src/components/Form/FormErrorSummary.tsx +113 -0
- package/src/components/Form/FormField.tsx +249 -0
- package/src/components/Form/FormFieldset.tsx +127 -0
- package/src/components/Form/FormLiveRegion.tsx +198 -0
- package/src/components/Form/__tests__/Form.accessibility.test.tsx +820 -0
- package/src/components/Form/__tests__/Form.unit.test.tsx +305 -0
- package/src/components/Form/__tests__/FormErrorSummary.unit.test.tsx +285 -0
- package/src/components/Form/__tests__/FormFieldset.unit.test.tsx +241 -0
- package/src/components/Form/index.ts +26 -0
- package/src/components/Header/Header.tsx +301 -0
- package/src/components/Header/__tests__/Header.accessibility.test.tsx +382 -0
- package/src/components/Header/__tests__/Header.comprehensive.test.tsx +509 -0
- package/src/components/Header/__tests__/Header.unit.test.tsx +335 -0
- package/src/components/Header/index.ts +4 -0
- package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +196 -0
- package/src/components/InactivityWarningModal/InactivityWarningModal.tsx +164 -0
- package/src/components/InactivityWarningModal/__tests__/InactivityWarningModal.unit.test.tsx +224 -0
- package/src/components/InactivityWarningModal/index.ts +9 -0
- package/src/components/Input/Input.tsx +201 -0
- package/src/components/Input/__mocks__/Input.tsx +2 -0
- package/src/components/Input/__tests__/Input.accessibility.test.tsx +632 -0
- package/src/components/Input/__tests__/Input.unit.test.tsx +1121 -0
- package/src/components/Input/index.ts +9 -0
- package/src/components/Label/Label.tsx +186 -0
- package/src/components/Label/__tests__/Label.accessibility.test.tsx +239 -0
- package/src/components/Label/__tests__/Label.unit.test.tsx +331 -0
- package/src/components/Label/index.ts +2 -0
- package/src/components/LoadingSpinner/LoadingSpinner.tsx +98 -0
- package/src/components/LoadingSpinner/__tests__/LoadingSpinner.accessibility.test.tsx +116 -0
- package/src/components/LoadingSpinner/__tests__/LoadingSpinner.unit.test.tsx +144 -0
- package/src/components/LoadingSpinner/index.ts +3 -0
- package/src/components/LoginForm/LoginForm.tsx +273 -0
- package/src/components/LoginForm/__tests__/LoginForm.accessibility.test.tsx +201 -0
- package/src/components/LoginForm/__tests__/LoginForm.unit.test.tsx +119 -0
- package/src/components/LoginForm/index.ts +3 -0
- package/src/components/NavigationMenu/NavigationMenu.tsx +698 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.accessibility.test.tsx +378 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.enhanced.test.tsx +768 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.integration.test.tsx +576 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.performance.test.tsx +585 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.real.component.test.tsx +783 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.security.enhanced.test.tsx +810 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.security.test.tsx +494 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.unit.test.tsx +331 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.userWorkflows.test.tsx +347 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.workflows.test.tsx +584 -0
- package/src/components/NavigationMenu/index.ts +10 -0
- package/src/components/NavigationMenu/types.ts +85 -0
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +304 -0
- package/src/components/OrganisationSelector/__tests__/OrganisationSelector.unit.test.tsx +664 -0
- package/src/components/OrganisationSelector/index.ts +9 -0
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +699 -0
- package/src/components/PaceAppLayout/README.md +278 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.accessibility.test.tsx +288 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +889 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.performance.test.tsx +629 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +782 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +904 -0
- package/src/components/PaceAppLayout/index.ts +1 -0
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +221 -0
- package/src/components/PaceLoginPage/__tests__/PaceLoginPage.accessibility.test.tsx +463 -0
- package/src/components/PaceLoginPage/__tests__/PaceLoginPage.integration.test.tsx +586 -0
- package/src/components/PaceLoginPage/__tests__/PaceLoginPage.unit.test.tsx +533 -0
- package/src/components/PaceLoginPage/index.ts +1 -0
- package/src/components/PasswordReset/PasswordChangeForm.tsx +186 -0
- package/src/components/PasswordReset/PasswordResetForm.tsx +201 -0
- package/src/components/PasswordReset/__tests__/PasswordChangeForm.accessibility.test.tsx +408 -0
- package/src/components/PasswordReset/__tests__/PasswordChangeForm.unit.test.tsx +561 -0
- package/src/components/PasswordReset/__tests__/PasswordReset.integration.test.tsx +304 -0
- package/src/components/PasswordReset/__tests__/PasswordResetForm.accessibility.test.tsx +20 -0
- package/src/components/PasswordReset/__tests__/PasswordResetForm.unit.test.tsx +523 -0
- package/src/components/PasswordReset/__tests__/__mocks__/UnifiedAuthProvider.ts +29 -0
- package/src/components/PasswordReset/index.ts +4 -0
- package/src/components/Print/__tests__/Print.comprehensive.test.tsx +331 -0
- package/src/components/PrintButton/PrintButton.tsx +321 -0
- package/src/components/PrintButton/PrintButtonGroup.tsx +84 -0
- package/src/components/PrintButton/PrintToolbar.tsx +94 -0
- package/src/components/PrintButton/__tests__/PrintButton.unit.test.tsx +429 -0
- package/src/components/PrintButton/__tests__/PrintButtonGroup.unit.test.tsx +277 -0
- package/src/components/PrintButton/__tests__/PrintToolbar.unit.test.tsx +264 -0
- package/src/components/PrintButton/examples/PrintButtonShowcase.tsx +438 -0
- package/src/components/PrintButton/index.ts +33 -0
- package/src/components/PrintButton/types.ts +173 -0
- package/src/components/PrintCard/PrintCard.tsx +154 -0
- package/src/components/PrintCard/PrintCardContent.tsx +57 -0
- package/src/components/PrintCard/PrintCardFooter.tsx +60 -0
- package/src/components/PrintCard/PrintCardGrid.tsx +91 -0
- package/src/components/PrintCard/PrintCardHeader.tsx +78 -0
- package/src/components/PrintCard/PrintCardImage.tsx +81 -0
- package/src/components/PrintCard/__tests__/PrintCard.unit.test.tsx +233 -0
- package/src/components/PrintCard/__tests__/PrintCardContent.test.tsx +284 -0
- package/src/components/PrintCard/__tests__/PrintCardGrid.unit.test.tsx +214 -0
- package/src/components/PrintCard/__tests__/PrintCardImage.unit.test.tsx +264 -0
- package/src/components/PrintCard/examples/PrintCardShowcase.tsx +239 -0
- package/src/components/PrintCard/index.ts +34 -0
- package/src/components/PrintCard/types.ts +171 -0
- package/src/components/PrintDataTable/PrintDataTable.tsx +215 -0
- package/src/components/PrintDataTable/PrintTableGroup.tsx +90 -0
- package/src/components/PrintDataTable/PrintTableRow.tsx +76 -0
- package/src/components/PrintDataTable/__tests__/PrintDataTable.unit.test.tsx +361 -0
- package/src/components/PrintDataTable/__tests__/PrintTableGroup.unit.test.tsx +314 -0
- package/src/components/PrintDataTable/__tests__/PrintTableRow.unit.test.tsx +362 -0
- package/src/components/PrintDataTable/index.ts +25 -0
- package/src/components/PrintDataTable/types.ts +67 -0
- package/src/components/PrintFooter/PrintFooter.tsx +183 -0
- package/src/components/PrintFooter/PrintFooterContent.tsx +71 -0
- package/src/components/PrintFooter/PrintFooterInfo.tsx +86 -0
- package/src/components/PrintFooter/PrintPageNumber.tsx +90 -0
- package/src/components/PrintFooter/__tests__/PrintFooter.unit.test.tsx +500 -0
- package/src/components/PrintFooter/__tests__/PrintFooterContent.unit.test.tsx +321 -0
- package/src/components/PrintFooter/__tests__/PrintFooterInfo.unit.test.tsx +335 -0
- package/src/components/PrintFooter/__tests__/PrintPageNumber.unit.test.tsx +340 -0
- package/src/components/PrintFooter/examples/PrintFooterShowcase.tsx +390 -0
- package/src/components/PrintFooter/index.ts +30 -0
- package/src/components/PrintFooter/types.ts +149 -0
- package/src/components/PrintGrid/PrintGrid.tsx +180 -0
- package/src/components/PrintGrid/PrintGridBreakpoint.tsx +109 -0
- package/src/components/PrintGrid/PrintGridContainer.tsx +128 -0
- package/src/components/PrintGrid/PrintGridItem.tsx +220 -0
- package/src/components/PrintGrid/__tests__/PrintGrid.unit.test.tsx +340 -0
- package/src/components/PrintGrid/__tests__/PrintGridBreakpoint.unit.test.tsx +261 -0
- package/src/components/PrintGrid/__tests__/PrintGridContainer.unit.test.tsx +338 -0
- package/src/components/PrintGrid/__tests__/PrintGridItem.unit.test.tsx +338 -0
- package/src/components/PrintGrid/examples/PrintGridShowcase.tsx +359 -0
- package/src/components/PrintGrid/index.ts +31 -0
- package/src/components/PrintGrid/types.ts +159 -0
- package/src/components/PrintHeader/PrintCoverHeader.tsx +230 -0
- package/src/components/PrintHeader/PrintHeader.tsx +150 -0
- package/src/components/PrintHeader/__tests__/PrintCoverHeader.unit.test.tsx +309 -0
- package/src/components/PrintHeader/__tests__/PrintHeader.unit.test.tsx +202 -0
- package/src/components/PrintHeader/index.ts +17 -0
- package/src/components/PrintHeader/types.ts +42 -0
- package/src/components/PrintLayout/PrintLayout.tsx +122 -0
- package/src/components/PrintLayout/PrintLayoutContext.tsx +66 -0
- package/src/components/PrintLayout/PrintPageBreak.tsx +52 -0
- package/src/components/PrintLayout/__tests__/PrintLayout.unit.test.tsx +238 -0
- package/src/components/PrintLayout/examples/PrintShowcase.tsx +230 -0
- package/src/components/PrintLayout/index.ts +19 -0
- package/src/components/PrintLayout/types.ts +37 -0
- package/src/components/PrintPageBreak/PrintPageBreak.tsx +120 -0
- package/src/components/PrintPageBreak/PrintPageBreakGroup.tsx +90 -0
- package/src/components/PrintPageBreak/PrintPageBreakIndicator.tsx +112 -0
- package/src/components/PrintPageBreak/__tests__/PrintPageBreak.unit.test.tsx +263 -0
- package/src/components/PrintPageBreak/__tests__/PrintPageBreakGroup.unit.test.tsx +239 -0
- package/src/components/PrintPageBreak/__tests__/PrintPageBreakIndicator.unit.test.tsx +235 -0
- package/src/components/PrintPageBreak/examples/PrintPageBreakShowcase.tsx +279 -0
- package/src/components/PrintPageBreak/index.ts +23 -0
- package/src/components/PrintPageBreak/types.ts +94 -0
- package/src/components/PrintSection/PrintColumn.tsx +104 -0
- package/src/components/PrintSection/PrintDivider.tsx +101 -0
- package/src/components/PrintSection/PrintSection.tsx +129 -0
- package/src/components/PrintSection/PrintSectionContent.tsx +75 -0
- package/src/components/PrintSection/PrintSectionHeader.tsx +97 -0
- package/src/components/PrintSection/__tests__/PrintColumn.unit.test.tsx +385 -0
- package/src/components/PrintSection/__tests__/PrintDivider.unit.test.tsx +373 -0
- package/src/components/PrintSection/__tests__/PrintSection.unit.test.tsx +390 -0
- package/src/components/PrintSection/__tests__/PrintSectionContent.unit.test.tsx +321 -0
- package/src/components/PrintSection/__tests__/PrintSectionHeader.unit.test.tsx +334 -0
- package/src/components/PrintSection/examples/PrintSectionShowcase.tsx +258 -0
- package/src/components/PrintSection/index.ts +33 -0
- package/src/components/PrintSection/types.ts +155 -0
- package/src/components/PrintText/PrintText.tsx +116 -0
- package/src/components/PrintText/__tests__/PrintText.unit.test.tsx +351 -0
- package/src/components/PrintText/index.ts +16 -0
- package/src/components/PrintText/types.ts +24 -0
- package/src/components/Progress/Progress.tsx +116 -0
- package/src/components/Progress/__tests__/Progress.accessibility.test.tsx +240 -0
- package/src/components/Progress/__tests__/Progress.unit.test.tsx +242 -0
- package/src/components/Progress/index.ts +3 -0
- package/src/components/PublicLayout/EventLogo.tsx +287 -0
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +279 -0
- package/src/components/PublicLayout/PublicLoadingSpinner.tsx +208 -0
- package/src/components/PublicLayout/PublicPageContextChecker.tsx +130 -0
- package/src/components/PublicLayout/PublicPageDebugger.tsx +104 -0
- package/src/components/PublicLayout/PublicPageDiagnostic.tsx +162 -0
- package/src/components/PublicLayout/PublicPageFooter.tsx +124 -0
- package/src/components/PublicLayout/PublicPageHeader.tsx +178 -0
- package/src/components/PublicLayout/PublicPageLayout.tsx +232 -0
- package/src/components/PublicLayout/PublicPageProvider.tsx +137 -0
- package/src/components/PublicLayout/__tests__/EventLogo.test.tsx +761 -0
- package/src/components/PublicLayout/__tests__/PublicErrorBoundary.simplified.test.tsx +228 -0
- package/src/components/PublicLayout/__tests__/PublicErrorBoundary.test.tsx +228 -0
- package/src/components/PublicLayout/__tests__/PublicLoadingSpinner.test.tsx +459 -0
- package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +362 -0
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +522 -0
- package/src/components/PublicLayout/__tests__/PublicPageLayout.test.tsx +599 -0
- package/src/components/PublicLayout/__tests__/PublicPageProvider.test.tsx +513 -0
- package/src/components/PublicLayout/index.ts +51 -0
- package/src/components/RBAC/PagePermissionGuard.tsx +274 -0
- package/src/components/RBAC/RBACGuard.tsx +143 -0
- package/src/components/RBAC/RBACProvider.tsx +186 -0
- package/src/components/RBAC/RoleBasedContent.tsx +129 -0
- package/src/components/RBAC/__tests__/PagePermissionGuard.unit.test.tsx +674 -0
- package/src/components/RBAC/__tests__/RBAC.integration.test.tsx +573 -0
- package/src/components/RBAC/__tests__/RBACGuard.unit.test.tsx +467 -0
- package/src/components/RBAC/__tests__/RBACProvider.accessibility.test.tsx +475 -0
- package/src/components/RBAC/__tests__/RBACProvider.advanced.test.tsx +569 -0
- package/src/components/RBAC/__tests__/RBACProvider.integration.test.tsx +352 -0
- package/src/components/RBAC/__tests__/RBACProvider.unit.test.tsx +128 -0
- package/src/components/RBAC/__tests__/RoleBasedContent.unit.test.tsx +657 -0
- package/src/components/RBAC/index.ts +23 -0
- package/src/components/Select/Select.tsx +654 -0
- package/src/components/Select/__tests__/SearchableSelect.unit.test.tsx +437 -0
- package/src/components/Select/__tests__/Select.accessibility.test.tsx +1202 -0
- package/src/components/Select/__tests__/Select.actual.test.tsx +774 -0
- package/src/components/Select/__tests__/Select.comprehensive.test.tsx +837 -0
- package/src/components/Select/__tests__/Select.enhanced.test.tsx +1101 -0
- package/src/components/Select/__tests__/Select.integration.test.tsx +772 -0
- package/src/components/Select/__tests__/Select.performance.test.tsx +695 -0
- package/src/components/Select/__tests__/Select.real-world.test.tsx +1046 -0
- package/src/components/Select/__tests__/Select.search-algorithms.test.tsx +968 -0
- package/src/components/Select/__tests__/Select.unit.test.tsx +647 -0
- package/src/components/Select/__tests__/Select.utils.test.tsx +890 -0
- package/src/components/Select/index.ts +1 -0
- package/src/components/SuperAdminGuard.tsx +116 -0
- package/src/components/Table/Table.tsx +222 -0
- package/src/components/Table/__tests__/Table.accessibility.test.tsx +233 -0
- package/src/components/Table/__tests__/Table.unit.test.tsx +235 -0
- package/src/components/Table/index.ts +11 -0
- package/src/components/Toast/Toast.tsx +339 -0
- package/src/components/Toast/__tests__/Toast.accessibility.test.tsx +238 -0
- package/src/components/Toast/__tests__/Toast.integration.test.tsx +699 -0
- package/src/components/Toast/__tests__/Toast.unit.test.tsx +750 -0
- package/src/components/Toast/index.ts +14 -0
- package/src/components/Tooltip/Tooltip.tsx +167 -0
- package/src/components/Tooltip/__tests__/Tooltip.accessibility.test.tsx +121 -0
- package/src/components/Tooltip/__tests__/Tooltip.unit.test.tsx +185 -0
- package/src/components/Tooltip/index.ts +7 -0
- package/src/components/UserMenu/UserMenu.tsx +243 -0
- package/src/components/UserMenu/__tests__/UserMenu.accessibility.test.tsx +139 -0
- package/src/components/UserMenu/__tests__/UserMenu.integration.test.tsx +188 -0
- package/src/components/UserMenu/__tests__/UserMenu.unit.test.tsx +458 -0
- package/src/components/UserMenu/index.ts +3 -0
- package/src/components/__tests__/EdgeCaseTesting.enhanced.test.tsx +523 -0
- package/src/components/__tests__/ErrorTesting.enhanced.test.tsx +455 -0
- package/src/components/__tests__/SuperAdminGuard.test.tsx +456 -0
- package/src/components/__tests__/SuperAdminGuard.unit.test.tsx +456 -0
- package/src/components/examples/PermissionExample.tsx +150 -0
- package/src/components/examples/__tests__/PermissionExample.unit.test.tsx +360 -0
- package/src/components/index.ts +434 -0
- package/src/components.ts +19 -0
- package/src/constants/performance.ts +14 -0
- package/src/examples/CorrectPublicPageImplementation.tsx +301 -0
- package/src/examples/PublicEventPage.tsx +274 -0
- package/src/examples/PublicPageApp.tsx +308 -0
- package/src/examples/PublicPageUsageExample.tsx +216 -0
- package/src/fonts/georama-italic.woff2 +0 -0
- package/src/fonts/georama.woff2 +0 -0
- package/src/fonts/open-sans-italic.woff2 +0 -0
- package/src/fonts/open-sans.woff2 +0 -0
- package/src/fonts/reddit-mono.woff2 +0 -0
- package/src/hooks/__tests__/hooks.integration.test.tsx +575 -0
- package/src/hooks/__tests__/useApiFetch.unit.test.ts +115 -0
- package/src/hooks/__tests__/useComponentPerformance.unit.test.tsx +133 -0
- package/src/hooks/__tests__/useDebounce.unit.test.ts +82 -0
- package/src/hooks/__tests__/useFocusTrap.unit.test.tsx +293 -0
- package/src/hooks/__tests__/useInactivityTracker.unit.test.ts +385 -0
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +286 -0
- package/src/hooks/__tests__/useOrganisationSecurity.unit.test.tsx +838 -0
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +627 -0
- package/src/hooks/__tests__/useRBAC.unit.test.ts +903 -0
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +537 -0
- package/src/hooks/__tests__/useToast.unit.test.tsx +62 -0
- package/src/hooks/__tests__/useZodForm.unit.test.tsx +37 -0
- package/src/hooks/index.ts +56 -0
- package/src/hooks/public/__tests__/usePublicEvent.test.tsx +397 -0
- package/src/hooks/public/__tests__/usePublicEventLogo.test.tsx +690 -0
- package/src/hooks/public/__tests__/usePublicRouteParams.test.tsx +449 -0
- package/src/hooks/public/index.ts +34 -0
- package/src/hooks/public/usePublicEvent.ts +261 -0
- package/src/hooks/public/usePublicEventLogo.ts +285 -0
- package/src/hooks/public/usePublicRouteParams.ts +259 -0
- package/src/hooks/useAppConfig.ts +94 -0
- package/src/hooks/useComponentPerformance.ts +39 -0
- package/src/hooks/useDataTablePerformance.ts +387 -0
- package/src/hooks/useDataTableState.ts +110 -0
- package/src/hooks/useDebounce.ts +18 -0
- package/src/hooks/useFocusManagement.ts +161 -0
- package/src/hooks/useFocusTrap.ts +155 -0
- package/src/hooks/useInactivityTracker.ts +372 -0
- package/src/hooks/useIsMobile.ts +42 -0
- package/src/hooks/useKeyboardShortcuts.ts +237 -0
- package/src/hooks/useOrganisationPermissions.ts +208 -0
- package/src/hooks/useOrganisationSecurity.ts +262 -0
- package/src/hooks/usePerformanceMonitor.ts +128 -0
- package/src/hooks/usePermissionCache.ts +455 -0
- package/src/hooks/useRBAC.ts +262 -0
- package/src/hooks/useSecureDataAccess.ts +586 -0
- package/src/hooks/useStorage.ts +274 -0
- package/src/hooks/useToast.ts +242 -0
- package/src/hooks/useZodForm.ts +28 -0
- package/src/index.ts +200 -0
- package/src/providers/AuthProvider.tsx +369 -0
- package/src/providers/EventProvider.tsx +324 -0
- package/src/providers/InactivityProvider.tsx +238 -0
- package/src/providers/OrganisationProvider.tsx +588 -0
- package/src/providers/RBACProvider.tsx +622 -0
- package/src/providers/UnifiedAuthProvider.tsx +327 -0
- package/src/providers/__tests__/EventProvider.unit.test.tsx +768 -0
- package/src/providers/__tests__/OrganisationProvider.basic.test.tsx +116 -0
- package/src/providers/__tests__/OrganisationProvider.unit.test.tsx +1312 -0
- package/src/providers/__tests__/UnifiedAuthProvider.inactivity.test.tsx +601 -0
- package/src/providers/__tests__/UnifiedAuthProvider.unit.test.tsx +675 -0
- package/src/providers/__tests__/index.unit.test.ts +78 -0
- package/src/providers/index.ts +15 -0
- package/src/rbac/README.md +885 -0
- package/src/rbac/__tests__/PagePermissionGuard.test.tsx +673 -0
- package/src/rbac/__tests__/README.md +170 -0
- package/src/rbac/__tests__/RoleBasedRouter.test.tsx +709 -0
- package/src/rbac/__tests__/TestContext.tsx +72 -0
- package/src/rbac/__tests__/__mocks__/cache.ts +144 -0
- package/src/rbac/__tests__/__mocks__/supabase.ts +152 -0
- package/src/rbac/__tests__/adapters-hooks-comprehensive.test.tsx +782 -0
- package/src/rbac/__tests__/adapters-hooks.test.tsx +561 -0
- package/src/rbac/__tests__/adapters.comprehensive.test.tsx +963 -0
- package/src/rbac/__tests__/adapters.test.tsx +444 -0
- package/src/rbac/__tests__/api.test.ts +620 -0
- package/src/rbac/__tests__/audit-observability-comprehensive.test.ts +792 -0
- package/src/rbac/__tests__/audit-observability.test.ts +549 -0
- package/src/rbac/__tests__/audit.test.ts +616 -0
- package/src/rbac/__tests__/build-contract-compliance-simple.test.ts +230 -0
- package/src/rbac/__tests__/cache-invalidation-comprehensive.test.ts +889 -0
- package/src/rbac/__tests__/cache-invalidation.test.ts +457 -0
- package/src/rbac/__tests__/cache.test.ts +458 -0
- package/src/rbac/__tests__/components-navigation-guard.enhanced.test.tsx +859 -0
- package/src/rbac/__tests__/components-navigation-guard.test.tsx +895 -0
- package/src/rbac/__tests__/components-navigation-provider.test.tsx +692 -0
- package/src/rbac/__tests__/components-page-permission-guard.test.tsx +673 -0
- package/src/rbac/__tests__/components-page-permission-provider.test.tsx +614 -0
- package/src/rbac/__tests__/components-permission-enforcer.enhanced.fixed.test.tsx +836 -0
- package/src/rbac/__tests__/components-permission-enforcer.enhanced.test.tsx +837 -0
- package/src/rbac/__tests__/components-permission-enforcer.test.tsx +825 -0
- package/src/rbac/__tests__/components-role-based-router.test.tsx +709 -0
- package/src/rbac/__tests__/components-secure-data-provider.test.tsx +607 -0
- package/src/rbac/__tests__/config.test.ts +583 -0
- package/src/rbac/__tests__/core-logic-unit.test.ts +190 -0
- package/src/rbac/__tests__/core-permission-logic-comprehensive.test.ts +1467 -0
- package/src/rbac/__tests__/core-permission-logic-fixed.test.ts +151 -0
- package/src/rbac/__tests__/core-permission-logic-simple.test.ts +968 -0
- package/src/rbac/__tests__/core-permission-logic.test.ts +966 -0
- package/src/rbac/__tests__/edge-cases-comprehensive.test.ts +988 -0
- package/src/rbac/__tests__/edge-cases.test.ts +654 -0
- package/src/rbac/__tests__/engine.test.ts +361 -0
- package/src/rbac/__tests__/engine.unit.test.ts +361 -0
- package/src/rbac/__tests__/hooks.enhanced.test.tsx +979 -0
- package/src/rbac/__tests__/hooks.fixed.test.tsx +475 -0
- package/src/rbac/__tests__/hooks.test.tsx +385 -0
- package/src/rbac/__tests__/index.test.ts +269 -0
- package/src/rbac/__tests__/integration.enhanced.test.tsx +824 -0
- package/src/rbac/__tests__/page-permission-guard-super-admin.test.tsx +261 -0
- package/src/rbac/__tests__/performance.enhanced.test.tsx +724 -0
- package/src/rbac/__tests__/permissions.test.ts +383 -0
- package/src/rbac/__tests__/requires-event.test.ts +330 -0
- package/src/rbac/__tests__/scope-isolation-comprehensive.test.ts +1349 -0
- package/src/rbac/__tests__/scope-isolation.test.ts +755 -0
- package/src/rbac/__tests__/secure-client-rls-comprehensive.test.ts +592 -0
- package/src/rbac/__tests__/secure-client-rls.test.ts +377 -0
- package/src/rbac/__tests__/security.test.ts +296 -0
- package/src/rbac/__tests__/setup.ts +228 -0
- package/src/rbac/__tests__/test-utils-enhanced.tsx +400 -0
- package/src/rbac/__tests__/types.test.ts +685 -0
- package/src/rbac/adapters.tsx +726 -0
- package/src/rbac/api.ts +337 -0
- package/src/rbac/audit-enhanced.ts +339 -0
- package/src/rbac/audit.ts +338 -0
- package/src/rbac/cache.ts +213 -0
- package/src/rbac/components/EnhancedNavigationMenu.tsx +294 -0
- package/src/rbac/components/NavigationGuard.tsx +294 -0
- package/src/rbac/components/NavigationProvider.tsx +314 -0
- package/src/rbac/components/PagePermissionGuard.tsx +430 -0
- package/src/rbac/components/PagePermissionProvider.tsx +274 -0
- package/src/rbac/components/PermissionEnforcer.tsx +307 -0
- package/src/rbac/components/RoleBasedRouter.tsx +425 -0
- package/src/rbac/components/SecureDataProvider.tsx +319 -0
- package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +631 -0
- package/src/rbac/components/__tests__/NavigationProvider.test.tsx +667 -0
- package/src/rbac/components/__tests__/PagePermissionProvider.test.tsx +647 -0
- package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +496 -0
- package/src/rbac/components/index.ts +64 -0
- package/src/rbac/config.ts +133 -0
- package/src/rbac/docs/event-based-apps.md +285 -0
- package/src/rbac/engine.ts +1026 -0
- package/src/rbac/eslint-rules.js +285 -0
- package/src/rbac/examples/CompleteRBACExample.tsx +323 -0
- package/src/rbac/examples/EventBasedApp.tsx +238 -0
- package/src/rbac/hooks.ts +555 -0
- package/src/rbac/index.ts +114 -0
- package/src/rbac/permissions.ts +293 -0
- package/src/rbac/secureClient.ts +244 -0
- package/src/rbac/security.ts +346 -0
- package/src/rbac/testing/__tests__/index.test.tsx +342 -0
- package/src/rbac/testing/index.tsx +340 -0
- package/src/rbac/types.ts +341 -0
- package/src/rbac/utils/__tests__/eventContext.test.ts +428 -0
- package/src/rbac/utils/__tests__/eventContext.unit.test.ts +428 -0
- package/src/rbac/utils/eventContext.ts +83 -0
- package/src/styles/__tests__/styles.unit.test.ts +164 -0
- package/src/styles/core.css +401 -0
- package/src/styles/index.ts +51 -0
- package/src/test-dom-cleanup.test.tsx +38 -0
- package/src/theming/__tests__/README.md +335 -0
- package/src/theming/__tests__/runtime.accessibility.test.ts +474 -0
- package/src/theming/__tests__/runtime.error.test.ts +616 -0
- package/src/theming/__tests__/runtime.integration.test.ts +376 -0
- package/src/theming/__tests__/runtime.performance.test.ts +411 -0
- package/src/theming/__tests__/runtime.unit.test.ts +470 -0
- package/src/theming/runtime.ts +187 -0
- package/src/types/__tests__/database.unit.test.ts +489 -0
- package/src/types/__tests__/guards.unit.test.ts +146 -0
- package/src/types/__tests__/index.unit.test.ts +77 -0
- package/src/types/__tests__/organisation.unit.test.ts +713 -0
- package/src/types/__tests__/rbac.unit.test.ts +621 -0
- package/src/types/__tests__/security.unit.test.ts +347 -0
- package/src/types/__tests__/supabase.unit.test.ts +658 -0
- package/src/types/__tests__/theme.unit.test.ts +218 -0
- package/src/types/__tests__/unified.unit.test.ts +537 -0
- package/src/types/__tests__/validation.unit.test.ts +616 -0
- package/src/types/database.ts +472 -0
- package/src/types/guards.ts +30 -0
- package/src/types/index.ts +25 -0
- package/src/types/organisation.ts +184 -0
- package/src/types/security.ts +70 -0
- package/src/types/supabase.ts +166 -0
- package/src/types/theme.ts +6 -0
- package/src/types/unified.ts +262 -0
- package/src/types/validation.ts +164 -0
- package/src/types/vitest-globals.d.ts +43 -0
- package/src/utils/__mocks__/supabaseMock.ts +75 -0
- package/src/utils/__mocks__/supabaseMock.tsx +198 -0
- package/src/utils/__tests__/appConfig.unit.test.ts +55 -0
- package/src/utils/__tests__/appNameResolver.unit.test.ts +137 -0
- package/src/utils/__tests__/audit.unit.test.ts +69 -0
- package/src/utils/__tests__/auth-utils.unit.test.ts +70 -0
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +317 -0
- package/src/utils/__tests__/cn.unit.test.ts +34 -0
- package/src/utils/__tests__/deviceFingerprint.unit.test.ts +480 -0
- package/src/utils/__tests__/dynamicUtils.unit.test.ts +322 -0
- package/src/utils/__tests__/formatDate.unit.test.ts +109 -0
- package/src/utils/__tests__/formatting.unit.test.ts +66 -0
- package/src/utils/__tests__/index.unit.test.ts +251 -0
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +309 -0
- package/src/utils/__tests__/organisationContext.unit.test.ts +192 -0
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +259 -0
- package/src/utils/__tests__/permissionTypes.unit.test.ts +250 -0
- package/src/utils/__tests__/permissionUtils.unit.test.ts +362 -0
- package/src/utils/__tests__/sanitization.unit.test.ts +346 -0
- package/src/utils/__tests__/schemaUtils.unit.test.ts +441 -0
- package/src/utils/__tests__/secureDataAccess.unit.test.ts +334 -0
- package/src/utils/__tests__/secureErrors.unit.test.ts +377 -0
- package/src/utils/__tests__/secureStorage.unit.test.ts +293 -0
- package/src/utils/__tests__/security.unit.test.ts +127 -0
- package/src/utils/__tests__/securityMonitor.unit.test.ts +280 -0
- package/src/utils/__tests__/sessionTracking.unit.test.ts +370 -0
- package/src/utils/__tests__/validation.unit.test.ts +84 -0
- package/src/utils/__tests__/validationUtils.unit.test.ts +571 -0
- package/src/utils/appConfig.ts +47 -0
- package/src/utils/appIdResolver.ts +130 -0
- package/src/utils/appNameResolver.ts +190 -0
- package/src/utils/audit.ts +127 -0
- package/src/utils/auth-utils.ts +96 -0
- package/src/utils/bundleAnalysis.ts +129 -0
- package/src/utils/cn.ts +7 -0
- package/src/utils/debugLogger.ts +46 -0
- package/src/utils/deviceFingerprint.ts +215 -0
- package/src/utils/dynamicUtils.ts +105 -0
- package/src/utils/formatting.ts +77 -0
- package/src/utils/index.ts +145 -0
- package/src/utils/lazyLoad.tsx +44 -0
- package/src/utils/organisationContext.ts +135 -0
- package/src/utils/performanceBenchmark.ts +64 -0
- package/src/utils/performanceBudgets.ts +111 -0
- package/src/utils/permissionTypes.ts +37 -0
- package/src/utils/permissionUtils.ts +31 -0
- package/src/utils/print/PrintDataProcessor.ts +390 -0
- package/src/utils/print/__tests__/PrintDataProcessor.unit.test.ts +219 -0
- package/src/utils/print/__tests__/usePrintOptimization.unit.test.tsx +353 -0
- package/src/utils/print/examples/PrintUtilitiesShowcase.tsx +397 -0
- package/src/utils/print/index.ts +29 -0
- package/src/utils/print/types.ts +196 -0
- package/src/utils/print/usePrintOptimization.ts +272 -0
- package/src/utils/sanitization.ts +264 -0
- package/src/utils/schemaUtils.ts +37 -0
- package/src/utils/secureDataAccess.ts +361 -0
- package/src/utils/secureErrors.ts +79 -0
- package/src/utils/secureStorage.ts +244 -0
- package/src/utils/security.ts +156 -0
- package/src/utils/securityMonitor.ts +45 -0
- package/src/utils/sessionTracking.ts +170 -0
- package/src/utils/storage/README.md +348 -0
- package/src/utils/storage/__tests__/config.unit.test.ts +206 -0
- package/src/utils/storage/__tests__/helpers.unit.test.ts +646 -0
- package/src/utils/storage/__tests__/index.unit.test.ts +167 -0
- package/src/utils/storage/__tests__/types.unit.test.ts +441 -0
- package/src/utils/storage/config.ts +100 -0
- package/src/utils/storage/helpers.ts +359 -0
- package/src/utils/storage/index.ts +36 -0
- package/src/utils/storage/types.ts +90 -0
- package/src/utils/validation.ts +111 -0
- package/src/utils/validationUtils.ts +120 -0
- package/src/validation/__tests__/common.unit.test.ts +101 -0
- package/src/validation/__tests__/csrf.unit.test.ts +302 -0
- package/src/validation/__tests__/passwordSchema.unit.test.ts +98 -0
- package/src/validation/__tests__/sqlInjectionProtection.unit.test.ts +466 -0
- package/src/validation/common.ts +53 -0
- package/src/validation/csrf.ts +214 -0
- package/src/validation/index.ts +43 -0
- package/src/validation/passwordSchema.ts +125 -0
- package/src/validation/sanitization.ts +96 -0
- package/src/validation/schemaUtils.ts +42 -0
- package/src/validation/sqlInjectionProtection.ts +242 -0
- package/src/validation/user.ts +34 -0
|
@@ -0,0 +1,1117 @@
|
|
|
1
|
+
# Debugging Guide
|
|
2
|
+
|
|
3
|
+
Effective debugging is essential for maintaining and troubleshooting `@jmruthers/pace-core` applications. This guide provides comprehensive debugging techniques and tools.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Debugging in `@jmruthers/pace-core` covers multiple areas:
|
|
8
|
+
|
|
9
|
+
- **Component Debugging**: React component issues and rendering problems
|
|
10
|
+
- **Hook Debugging**: Custom hook behavior and state management
|
|
11
|
+
- **Authentication Debugging**: User authentication and session issues
|
|
12
|
+
- **Permission Debugging**: RBAC and access control problems
|
|
13
|
+
- **API Debugging**: Supabase and external API issues
|
|
14
|
+
- **Performance Debugging**: Performance bottlenecks and memory leaks
|
|
15
|
+
|
|
16
|
+
## Debugging Tools
|
|
17
|
+
|
|
18
|
+
### 1. React Developer Tools
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// Enable React DevTools in development
|
|
22
|
+
if (process.env.NODE_ENV === 'development') {
|
|
23
|
+
// React DevTools will automatically connect
|
|
24
|
+
console.log('React DevTools enabled');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Custom hook for debugging component renders
|
|
28
|
+
function useDebugRender(componentName: string, props?: any) {
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
console.log(`${componentName} rendered with props:`, props);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
console.log(`${componentName} mounted`);
|
|
35
|
+
return () => console.log(`${componentName} unmounted`);
|
|
36
|
+
}, []);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Usage in components
|
|
40
|
+
function MyComponent({ data, loading }) {
|
|
41
|
+
useDebugRender('MyComponent', { data, loading });
|
|
42
|
+
|
|
43
|
+
if (loading) return <div>Loading...</div>;
|
|
44
|
+
return <div>{data}</div>;
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 2. Custom Debug Hooks
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
// hooks/useDebug.ts
|
|
52
|
+
import { useEffect, useRef } from 'react';
|
|
53
|
+
|
|
54
|
+
export function useDebugValue<T>(value: T, label: string) {
|
|
55
|
+
const prevValue = useRef<T>();
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (prevValue.current !== value) {
|
|
59
|
+
console.log(`${label} changed:`, {
|
|
60
|
+
previous: prevValue.current,
|
|
61
|
+
current: value,
|
|
62
|
+
});
|
|
63
|
+
prevValue.current = value;
|
|
64
|
+
}
|
|
65
|
+
}, [value, label]);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function useDebugEffect(effect: () => void, deps: any[], label: string) {
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
console.log(`${label} effect triggered with deps:`, deps);
|
|
71
|
+
effect();
|
|
72
|
+
}, deps);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function useDebugCallback<T extends (...args: any[]) => any>(
|
|
76
|
+
callback: T,
|
|
77
|
+
deps: any[],
|
|
78
|
+
label: string
|
|
79
|
+
): T {
|
|
80
|
+
const prevDeps = useRef<any[]>();
|
|
81
|
+
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (JSON.stringify(prevDeps.current) !== JSON.stringify(deps)) {
|
|
84
|
+
console.log(`${label} callback dependencies changed:`, deps);
|
|
85
|
+
prevDeps.current = deps;
|
|
86
|
+
}
|
|
87
|
+
}, [deps, label]);
|
|
88
|
+
|
|
89
|
+
return callback;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Usage
|
|
93
|
+
function MyComponent({ userId }) {
|
|
94
|
+
useDebugValue(userId, 'userId');
|
|
95
|
+
|
|
96
|
+
const handleClick = useDebugCallback(() => {
|
|
97
|
+
console.log('Button clicked');
|
|
98
|
+
}, [userId], 'handleClick');
|
|
99
|
+
|
|
100
|
+
return <button onClick={handleClick}>Click me</button>;
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 3. Error Boundary with Debugging
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
// components/DebugErrorBoundary.tsx
|
|
108
|
+
import React from 'react';
|
|
109
|
+
import { ErrorBoundary } from '@jmruthers/pace-core';
|
|
110
|
+
|
|
111
|
+
interface DebugErrorBoundaryProps {
|
|
112
|
+
children: React.ReactNode;
|
|
113
|
+
fallback?: React.ComponentType<{ error: Error; resetError: () => void }>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function DebugErrorBoundary({ children, fallback }: DebugErrorBoundaryProps) {
|
|
117
|
+
const handleError = (error: Error, errorInfo: React.ErrorInfo) => {
|
|
118
|
+
console.error('Error caught by boundary:', error);
|
|
119
|
+
console.error('Error info:', errorInfo);
|
|
120
|
+
|
|
121
|
+
// Send to error tracking service
|
|
122
|
+
if (typeof Sentry !== 'undefined') {
|
|
123
|
+
Sentry.captureException(error, {
|
|
124
|
+
extra: {
|
|
125
|
+
componentStack: errorInfo.componentStack,
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const FallbackComponent = fallback || DefaultFallback;
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
<ErrorBoundary onError={handleError} fallback={FallbackComponent}>
|
|
135
|
+
{children}
|
|
136
|
+
</ErrorBoundary>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function DefaultFallback({ error, resetError }: { error: Error; resetError: () => void }) {
|
|
141
|
+
return (
|
|
142
|
+
<div className="error-boundary">
|
|
143
|
+
<h2>Something went wrong</h2>
|
|
144
|
+
<details>
|
|
145
|
+
<summary>Error details</summary>
|
|
146
|
+
<pre>{error.message}</pre>
|
|
147
|
+
<pre>{error.stack}</pre>
|
|
148
|
+
</details>
|
|
149
|
+
<button onClick={resetError}>Try again</button>
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Component Debugging
|
|
156
|
+
|
|
157
|
+
### 1. Component State Debugging
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
// utils/componentDebugger.ts
|
|
161
|
+
export function debugComponentState<T>(
|
|
162
|
+
componentName: string,
|
|
163
|
+
state: T,
|
|
164
|
+
prevState?: T
|
|
165
|
+
) {
|
|
166
|
+
if (process.env.NODE_ENV === 'development') {
|
|
167
|
+
console.group(`${componentName} State Change`);
|
|
168
|
+
console.log('Previous State:', prevState);
|
|
169
|
+
console.log('Current State:', state);
|
|
170
|
+
console.log('Changes:', getStateChanges(prevState, state));
|
|
171
|
+
console.groupEnd();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function getStateChanges(prev: any, current: any): Record<string, any> {
|
|
176
|
+
if (!prev) return { initial: current };
|
|
177
|
+
|
|
178
|
+
const changes: Record<string, any> = {};
|
|
179
|
+
|
|
180
|
+
for (const key in current) {
|
|
181
|
+
if (prev[key] !== current[key]) {
|
|
182
|
+
changes[key] = {
|
|
183
|
+
from: prev[key],
|
|
184
|
+
to: current[key],
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return changes;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Usage in components
|
|
193
|
+
function MyComponent() {
|
|
194
|
+
const [state, setState] = useState({ count: 0, loading: false });
|
|
195
|
+
const prevState = useRef(state);
|
|
196
|
+
|
|
197
|
+
useEffect(() => {
|
|
198
|
+
debugComponentState('MyComponent', state, prevState.current);
|
|
199
|
+
prevState.current = state;
|
|
200
|
+
}, [state]);
|
|
201
|
+
|
|
202
|
+
return <div>{state.count}</div>;
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### 2. Props Debugging
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
// utils/propsDebugger.ts
|
|
210
|
+
export function debugProps<T>(componentName: string, props: T) {
|
|
211
|
+
if (process.env.NODE_ENV === 'development') {
|
|
212
|
+
console.log(`${componentName} props:`, props);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Higher-order component for automatic props debugging
|
|
217
|
+
export function withPropsDebug<P extends object>(
|
|
218
|
+
Component: React.ComponentType<P>,
|
|
219
|
+
componentName?: string
|
|
220
|
+
) {
|
|
221
|
+
const WrappedComponent = (props: P) => {
|
|
222
|
+
const name = componentName || Component.displayName || Component.name;
|
|
223
|
+
debugProps(name, props);
|
|
224
|
+
return <Component {...props} />;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
WrappedComponent.displayName = `withPropsDebug(${Component.displayName || Component.name})`;
|
|
228
|
+
return WrappedComponent;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Usage
|
|
232
|
+
const DebuggedButton = withPropsDebug(Button, 'Button');
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### 3. Render Performance Debugging
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
// utils/renderDebugger.ts
|
|
239
|
+
import { useComponentPerformance } from '@jmruthers/pace-core';
|
|
240
|
+
|
|
241
|
+
export function useRenderDebug(componentName: string) {
|
|
242
|
+
const { renderCount, averageRenderTime, lastRenderTime } = useComponentPerformance();
|
|
243
|
+
|
|
244
|
+
useEffect(() => {
|
|
245
|
+
if (process.env.NODE_ENV === 'development') {
|
|
246
|
+
console.log(`${componentName} render stats:`, {
|
|
247
|
+
renderCount,
|
|
248
|
+
averageRenderTime: averageRenderTime.toFixed(2),
|
|
249
|
+
lastRenderTime: lastRenderTime.toFixed(2),
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}, [renderCount, averageRenderTime, lastRenderTime, componentName]);
|
|
253
|
+
|
|
254
|
+
// Warn if component is rendering too frequently
|
|
255
|
+
useEffect(() => {
|
|
256
|
+
if (renderCount > 10 && averageRenderTime > 16) {
|
|
257
|
+
console.warn(`${componentName} is rendering frequently and slowly:`, {
|
|
258
|
+
renderCount,
|
|
259
|
+
averageRenderTime: averageRenderTime.toFixed(2),
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}, [renderCount, averageRenderTime, componentName]);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Usage
|
|
266
|
+
function ExpensiveComponent() {
|
|
267
|
+
useRenderDebug('ExpensiveComponent');
|
|
268
|
+
|
|
269
|
+
// Component logic here
|
|
270
|
+
return <div>Expensive content</div>;
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Hook Debugging
|
|
275
|
+
|
|
276
|
+
### 1. Authentication Hook Debugging
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
// hooks/useAuthDebug.ts
|
|
280
|
+
import { useUnifiedAuth } from '@jmruthers/pace-core';
|
|
281
|
+
|
|
282
|
+
export function useAuthDebug() {
|
|
283
|
+
const auth = useUnifiedAuth();
|
|
284
|
+
|
|
285
|
+
useEffect(() => {
|
|
286
|
+
if (process.env.NODE_ENV === 'development') {
|
|
287
|
+
console.log('Auth state changed:', {
|
|
288
|
+
user: auth.user,
|
|
289
|
+
loading: auth.loading,
|
|
290
|
+
error: auth.error,
|
|
291
|
+
isAuthenticated: !!auth.user,
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
}, [auth.user, auth.loading, auth.error]);
|
|
295
|
+
|
|
296
|
+
// Debug authentication errors
|
|
297
|
+
useEffect(() => {
|
|
298
|
+
if (auth.error) {
|
|
299
|
+
console.error('Authentication error:', auth.error);
|
|
300
|
+
|
|
301
|
+
// Log additional context
|
|
302
|
+
console.log('Auth error context:', {
|
|
303
|
+
timestamp: new Date().toISOString(),
|
|
304
|
+
userAgent: navigator.userAgent,
|
|
305
|
+
url: window.location.href,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}, [auth.error]);
|
|
309
|
+
|
|
310
|
+
return auth;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Usage
|
|
314
|
+
function AuthDebugger() {
|
|
315
|
+
const auth = useAuthDebug();
|
|
316
|
+
|
|
317
|
+
if (auth.loading) return <div>Loading auth...</div>;
|
|
318
|
+
if (auth.error) return <div>Auth error: {auth.error}</div>;
|
|
319
|
+
if (!auth.user) return <div>Not authenticated</div>;
|
|
320
|
+
|
|
321
|
+
return <div>Authenticated as: {auth.user.email}</div>;
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### 2. RBAC Hook Debugging
|
|
326
|
+
|
|
327
|
+
```typescript
|
|
328
|
+
// hooks/useRBACDebug.ts
|
|
329
|
+
import { useRBAC } from '@jmruthers/pace-core';
|
|
330
|
+
|
|
331
|
+
export function useRBACDebug() {
|
|
332
|
+
const rbac = useRBAC();
|
|
333
|
+
|
|
334
|
+
useEffect(() => {
|
|
335
|
+
if (process.env.NODE_ENV === 'development') {
|
|
336
|
+
console.log('RBAC state:', {
|
|
337
|
+
permissions: rbac.permissions,
|
|
338
|
+
roles: rbac.roles,
|
|
339
|
+
loading: rbac.loading,
|
|
340
|
+
error: rbac.error,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
}, [rbac.permissions, rbac.roles, rbac.loading, rbac.error]);
|
|
344
|
+
|
|
345
|
+
// Debug permission checks
|
|
346
|
+
const debugHasPermission = useCallback((permission: string) => {
|
|
347
|
+
const hasPermission = rbac.hasPermission(permission);
|
|
348
|
+
|
|
349
|
+
if (process.env.NODE_ENV === 'development') {
|
|
350
|
+
console.log(`Permission check: ${permission} = ${hasPermission}`, {
|
|
351
|
+
userPermissions: rbac.permissions,
|
|
352
|
+
userRoles: rbac.roles,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
return hasPermission;
|
|
357
|
+
}, [rbac]);
|
|
358
|
+
|
|
359
|
+
return {
|
|
360
|
+
...rbac,
|
|
361
|
+
hasPermission: debugHasPermission,
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Usage
|
|
366
|
+
function PermissionDebugger() {
|
|
367
|
+
const rbac = useRBACDebug();
|
|
368
|
+
|
|
369
|
+
const canReadUsers = rbac.hasPermission('read:users');
|
|
370
|
+
const canWriteEvents = rbac.hasPermission('write:events');
|
|
371
|
+
|
|
372
|
+
return (
|
|
373
|
+
<div>
|
|
374
|
+
<div>Can read users: {canReadUsers ? 'Yes' : 'No'}</div>
|
|
375
|
+
<div>Can write events: {canWriteEvents ? 'Yes' : 'No'}</div>
|
|
376
|
+
</div>
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### 3. Event Hook Debugging
|
|
382
|
+
|
|
383
|
+
```typescript
|
|
384
|
+
// hooks/useEventDebug.ts
|
|
385
|
+
import { useEvents } from '@jmruthers/pace-core';
|
|
386
|
+
|
|
387
|
+
export function useEventDebug() {
|
|
388
|
+
const events = useEvents();
|
|
389
|
+
|
|
390
|
+
useEffect(() => {
|
|
391
|
+
if (process.env.NODE_ENV === 'development') {
|
|
392
|
+
console.log('Events state:', {
|
|
393
|
+
events: events.events,
|
|
394
|
+
loading: events.loading,
|
|
395
|
+
error: events.error,
|
|
396
|
+
selectedEvent: events.selectedEvent,
|
|
397
|
+
count: events.events?.length || 0,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
}, [events.events, events.loading, events.error, events.selectedEvent]);
|
|
401
|
+
|
|
402
|
+
// Debug event operations
|
|
403
|
+
const debugSetSelectedEvent = useCallback((event: any) => {
|
|
404
|
+
if (process.env.NODE_ENV === 'development') {
|
|
405
|
+
console.log('Setting selected event:', event);
|
|
406
|
+
}
|
|
407
|
+
events.setSelectedEvent(event);
|
|
408
|
+
}, [events.setSelectedEvent]);
|
|
409
|
+
|
|
410
|
+
const debugRefreshEvents = useCallback(async () => {
|
|
411
|
+
if (process.env.NODE_ENV === 'development') {
|
|
412
|
+
console.log('Refreshing events...');
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
try {
|
|
416
|
+
await events.refreshEvents();
|
|
417
|
+
console.log('Events refreshed successfully');
|
|
418
|
+
} catch (error) {
|
|
419
|
+
console.error('Failed to refresh events:', error);
|
|
420
|
+
}
|
|
421
|
+
}, [events.refreshEvents]);
|
|
422
|
+
|
|
423
|
+
return {
|
|
424
|
+
...events,
|
|
425
|
+
setSelectedEvent: debugSetSelectedEvent,
|
|
426
|
+
refreshEvents: debugRefreshEvents,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
## API Debugging
|
|
432
|
+
|
|
433
|
+
### 1. Supabase Debugging
|
|
434
|
+
|
|
435
|
+
```typescript
|
|
436
|
+
// utils/supabaseDebugger.ts
|
|
437
|
+
import { useSupabase } from '@jmruthers/pace-core';
|
|
438
|
+
|
|
439
|
+
export function useSupabaseDebug() {
|
|
440
|
+
const { supabase } = useSupabase();
|
|
441
|
+
|
|
442
|
+
// Debug Supabase queries
|
|
443
|
+
const debugQuery = useCallback(async (table: string, query: any) => {
|
|
444
|
+
if (process.env.NODE_ENV === 'development') {
|
|
445
|
+
console.log(`Supabase query to ${table}:`, query);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
try {
|
|
449
|
+
const result = await supabase.from(table).select('*');
|
|
450
|
+
|
|
451
|
+
if (process.env.NODE_ENV === 'development') {
|
|
452
|
+
console.log(`Query result for ${table}:`, result);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
return result;
|
|
456
|
+
} catch (error) {
|
|
457
|
+
console.error(`Query error for ${table}:`, error);
|
|
458
|
+
throw error;
|
|
459
|
+
}
|
|
460
|
+
}, [supabase]);
|
|
461
|
+
|
|
462
|
+
// Debug authentication
|
|
463
|
+
const debugAuth = useCallback(async (action: string, credentials: any) => {
|
|
464
|
+
if (process.env.NODE_ENV === 'development') {
|
|
465
|
+
console.log(`Auth action: ${action}`, credentials);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
try {
|
|
469
|
+
let result;
|
|
470
|
+
|
|
471
|
+
switch (action) {
|
|
472
|
+
case 'signIn':
|
|
473
|
+
result = await supabase.auth.signInWithPassword(credentials);
|
|
474
|
+
break;
|
|
475
|
+
case 'signUp':
|
|
476
|
+
result = await supabase.auth.signUp(credentials);
|
|
477
|
+
break;
|
|
478
|
+
case 'signOut':
|
|
479
|
+
result = await supabase.auth.signOut();
|
|
480
|
+
break;
|
|
481
|
+
default:
|
|
482
|
+
throw new Error(`Unknown auth action: ${action}`);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
if (process.env.NODE_ENV === 'development') {
|
|
486
|
+
console.log(`Auth result for ${action}:`, result);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
return result;
|
|
490
|
+
} catch (error) {
|
|
491
|
+
console.error(`Auth error for ${action}:`, error);
|
|
492
|
+
throw error;
|
|
493
|
+
}
|
|
494
|
+
}, [supabase]);
|
|
495
|
+
|
|
496
|
+
return {
|
|
497
|
+
supabase,
|
|
498
|
+
debugQuery,
|
|
499
|
+
debugAuth,
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
### 2. Network Request Debugging
|
|
505
|
+
|
|
506
|
+
```typescript
|
|
507
|
+
// utils/networkDebugger.ts
|
|
508
|
+
export function debugNetworkRequest(url: string, options: RequestInit) {
|
|
509
|
+
if (process.env.NODE_ENV === 'development') {
|
|
510
|
+
console.log('Network request:', {
|
|
511
|
+
url,
|
|
512
|
+
method: options.method || 'GET',
|
|
513
|
+
headers: options.headers,
|
|
514
|
+
body: options.body,
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export function debugNetworkResponse(url: string, response: Response, data?: any) {
|
|
520
|
+
if (process.env.NODE_ENV === 'development') {
|
|
521
|
+
console.log('Network response:', {
|
|
522
|
+
url,
|
|
523
|
+
status: response.status,
|
|
524
|
+
statusText: response.statusText,
|
|
525
|
+
headers: Object.fromEntries(response.headers.entries()),
|
|
526
|
+
data,
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// Custom fetch with debugging
|
|
532
|
+
export async function debugFetch(url: string, options: RequestInit = {}) {
|
|
533
|
+
debugNetworkRequest(url, options);
|
|
534
|
+
|
|
535
|
+
try {
|
|
536
|
+
const response = await fetch(url, options);
|
|
537
|
+
const data = await response.json();
|
|
538
|
+
|
|
539
|
+
debugNetworkResponse(url, response, data);
|
|
540
|
+
|
|
541
|
+
if (!response.ok) {
|
|
542
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
return { response, data };
|
|
546
|
+
} catch (error) {
|
|
547
|
+
console.error('Network request failed:', {
|
|
548
|
+
url,
|
|
549
|
+
error: error.message,
|
|
550
|
+
});
|
|
551
|
+
throw error;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
## Performance Debugging
|
|
557
|
+
|
|
558
|
+
### 1. Memory Leak Detection
|
|
559
|
+
|
|
560
|
+
```typescript
|
|
561
|
+
// utils/memoryDebugger.ts
|
|
562
|
+
export function useMemoryLeakDetection(componentName: string) {
|
|
563
|
+
useEffect(() => {
|
|
564
|
+
const initialMemory = performance.memory?.usedJSHeapSize || 0;
|
|
565
|
+
|
|
566
|
+
return () => {
|
|
567
|
+
const finalMemory = performance.memory?.usedJSHeapSize || 0;
|
|
568
|
+
const memoryIncrease = finalMemory - initialMemory;
|
|
569
|
+
|
|
570
|
+
if (memoryIncrease > 1024 * 1024) { // 1MB threshold
|
|
571
|
+
console.warn(`${componentName} may have a memory leak:`, {
|
|
572
|
+
memoryIncrease: `${(memoryIncrease / 1024 / 1024).toFixed(2)}MB`,
|
|
573
|
+
initialMemory: `${(initialMemory / 1024 / 1024).toFixed(2)}MB`,
|
|
574
|
+
finalMemory: `${(finalMemory / 1024 / 1024).toFixed(2)}MB`,
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
}, [componentName]);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// Usage
|
|
582
|
+
function MyComponent() {
|
|
583
|
+
useMemoryLeakDetection('MyComponent');
|
|
584
|
+
|
|
585
|
+
// Component logic
|
|
586
|
+
return <div>Content</div>;
|
|
587
|
+
}
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
### 2. Performance Monitoring
|
|
591
|
+
|
|
592
|
+
```typescript
|
|
593
|
+
// utils/performanceDebugger.ts
|
|
594
|
+
export function usePerformanceDebug(componentName: string) {
|
|
595
|
+
const renderStartTime = useRef<number>();
|
|
596
|
+
|
|
597
|
+
useEffect(() => {
|
|
598
|
+
renderStartTime.current = performance.now();
|
|
599
|
+
|
|
600
|
+
return () => {
|
|
601
|
+
if (renderStartTime.current) {
|
|
602
|
+
const renderTime = performance.now() - renderStartTime.current;
|
|
603
|
+
|
|
604
|
+
if (renderTime > 16) { // 60fps threshold
|
|
605
|
+
console.warn(`${componentName} took ${renderTime.toFixed(2)}ms to render`);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
// Track re-renders
|
|
612
|
+
const renderCount = useRef(0);
|
|
613
|
+
useEffect(() => {
|
|
614
|
+
renderCount.current += 1;
|
|
615
|
+
|
|
616
|
+
if (renderCount.current > 10) {
|
|
617
|
+
console.warn(`${componentName} has rendered ${renderCount.current} times`);
|
|
618
|
+
}
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// Performance observer for custom metrics
|
|
623
|
+
export function setupPerformanceObserver() {
|
|
624
|
+
if (typeof PerformanceObserver !== 'undefined') {
|
|
625
|
+
const observer = new PerformanceObserver((list) => {
|
|
626
|
+
for (const entry of list.getEntries()) {
|
|
627
|
+
if (entry.entryType === 'measure') {
|
|
628
|
+
console.log('Performance measure:', {
|
|
629
|
+
name: entry.name,
|
|
630
|
+
duration: entry.duration,
|
|
631
|
+
startTime: entry.startTime,
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
observer.observe({ entryTypes: ['measure'] });
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
## Error Debugging
|
|
643
|
+
|
|
644
|
+
### 1. Error Tracking and Analysis
|
|
645
|
+
|
|
646
|
+
```typescript
|
|
647
|
+
// utils/errorDebugger.ts
|
|
648
|
+
export class ErrorDebugger {
|
|
649
|
+
private static errors: Error[] = [];
|
|
650
|
+
private static maxErrors = 100;
|
|
651
|
+
|
|
652
|
+
static trackError(error: Error, context?: Record<string, any>) {
|
|
653
|
+
const errorInfo = {
|
|
654
|
+
error,
|
|
655
|
+
context,
|
|
656
|
+
timestamp: new Date().toISOString(),
|
|
657
|
+
stack: error.stack,
|
|
658
|
+
userAgent: navigator.userAgent,
|
|
659
|
+
url: window.location.href,
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
this.errors.push(error);
|
|
663
|
+
|
|
664
|
+
// Keep only the last maxErrors
|
|
665
|
+
if (this.errors.length > this.maxErrors) {
|
|
666
|
+
this.errors.shift();
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
if (process.env.NODE_ENV === 'development') {
|
|
670
|
+
console.error('Error tracked:', errorInfo);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
return errorInfo;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
static getErrors() {
|
|
677
|
+
return this.errors;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
static clearErrors() {
|
|
681
|
+
this.errors = [];
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
static getErrorStats() {
|
|
685
|
+
const errorTypes = this.errors.reduce((acc, error) => {
|
|
686
|
+
const type = error.constructor.name;
|
|
687
|
+
acc[type] = (acc[type] || 0) + 1;
|
|
688
|
+
return acc;
|
|
689
|
+
}, {} as Record<string, number>);
|
|
690
|
+
|
|
691
|
+
return {
|
|
692
|
+
totalErrors: this.errors.length,
|
|
693
|
+
errorTypes,
|
|
694
|
+
recentErrors: this.errors.slice(-10),
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
// Global error handler
|
|
700
|
+
export function setupGlobalErrorHandler() {
|
|
701
|
+
window.addEventListener('error', (event) => {
|
|
702
|
+
ErrorDebugger.trackError(event.error, {
|
|
703
|
+
filename: event.filename,
|
|
704
|
+
lineno: event.lineno,
|
|
705
|
+
colno: event.colno,
|
|
706
|
+
});
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
window.addEventListener('unhandledrejection', (event) => {
|
|
710
|
+
ErrorDebugger.trackError(new Error(event.reason), {
|
|
711
|
+
type: 'unhandledrejection',
|
|
712
|
+
});
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
### 2. Debug Console
|
|
718
|
+
|
|
719
|
+
```typescript
|
|
720
|
+
// utils/debugConsole.ts
|
|
721
|
+
export class DebugConsole {
|
|
722
|
+
private static logs: any[] = [];
|
|
723
|
+
private static maxLogs = 1000;
|
|
724
|
+
|
|
725
|
+
static log(message: string, data?: any) {
|
|
726
|
+
const logEntry = {
|
|
727
|
+
message,
|
|
728
|
+
data,
|
|
729
|
+
timestamp: new Date().toISOString(),
|
|
730
|
+
level: 'log',
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
this.logs.push(logEntry);
|
|
734
|
+
|
|
735
|
+
if (this.logs.length > this.maxLogs) {
|
|
736
|
+
this.logs.shift();
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
if (process.env.NODE_ENV === 'development') {
|
|
740
|
+
console.log(message, data);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
static warn(message: string, data?: any) {
|
|
745
|
+
const logEntry = {
|
|
746
|
+
message,
|
|
747
|
+
data,
|
|
748
|
+
timestamp: new Date().toISOString(),
|
|
749
|
+
level: 'warn',
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
this.logs.push(logEntry);
|
|
753
|
+
|
|
754
|
+
if (process.env.NODE_ENV === 'development') {
|
|
755
|
+
console.warn(message, data);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
static error(message: string, error?: Error, data?: any) {
|
|
760
|
+
const logEntry = {
|
|
761
|
+
message,
|
|
762
|
+
error,
|
|
763
|
+
data,
|
|
764
|
+
timestamp: new Date().toISOString(),
|
|
765
|
+
level: 'error',
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
this.logs.push(logEntry);
|
|
769
|
+
|
|
770
|
+
if (process.env.NODE_ENV === 'development') {
|
|
771
|
+
console.error(message, error, data);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
static getLogs() {
|
|
776
|
+
return this.logs;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
static clearLogs() {
|
|
780
|
+
this.logs = [];
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
static exportLogs() {
|
|
784
|
+
return {
|
|
785
|
+
logs: this.logs,
|
|
786
|
+
errorStats: ErrorDebugger.getErrorStats(),
|
|
787
|
+
timestamp: new Date().toISOString(),
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// Make debug console available globally in development
|
|
793
|
+
if (process.env.NODE_ENV === 'development') {
|
|
794
|
+
(window as any).debugConsole = DebugConsole;
|
|
795
|
+
(window as any).errorDebugger = ErrorDebugger;
|
|
796
|
+
}
|
|
797
|
+
```
|
|
798
|
+
|
|
799
|
+
## Debugging Tools and Utilities
|
|
800
|
+
|
|
801
|
+
### 1. Debug Panel Component
|
|
802
|
+
|
|
803
|
+
```typescript
|
|
804
|
+
// components/DebugPanel.tsx
|
|
805
|
+
import { useState } from 'react';
|
|
806
|
+
import { DebugConsole, ErrorDebugger } from '../utils';
|
|
807
|
+
|
|
808
|
+
export function DebugPanel() {
|
|
809
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
810
|
+
const [activeTab, setActiveTab] = useState('logs');
|
|
811
|
+
|
|
812
|
+
if (process.env.NODE_ENV !== 'development') {
|
|
813
|
+
return null;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
const logs = DebugConsole.getLogs();
|
|
817
|
+
const errorStats = ErrorDebugger.getErrorStats();
|
|
818
|
+
|
|
819
|
+
return (
|
|
820
|
+
<div className="debug-panel">
|
|
821
|
+
<button onClick={() => setIsOpen(!isOpen)}>
|
|
822
|
+
Debug Panel {isOpen ? '▼' : '▲'}
|
|
823
|
+
</button>
|
|
824
|
+
|
|
825
|
+
{isOpen && (
|
|
826
|
+
<div className="debug-content">
|
|
827
|
+
<div className="debug-tabs">
|
|
828
|
+
<button
|
|
829
|
+
className={activeTab === 'logs' ? 'active' : ''}
|
|
830
|
+
onClick={() => setActiveTab('logs')}
|
|
831
|
+
>
|
|
832
|
+
Logs ({logs.length})
|
|
833
|
+
</button>
|
|
834
|
+
<button
|
|
835
|
+
className={activeTab === 'errors' ? 'active' : ''}
|
|
836
|
+
onClick={() => setActiveTab('errors')}
|
|
837
|
+
>
|
|
838
|
+
Errors ({errorStats.totalErrors})
|
|
839
|
+
</button>
|
|
840
|
+
<button
|
|
841
|
+
className={activeTab === 'performance' ? 'active' : ''}
|
|
842
|
+
onClick={() => setActiveTab('performance')}
|
|
843
|
+
>
|
|
844
|
+
Performance
|
|
845
|
+
</button>
|
|
846
|
+
</div>
|
|
847
|
+
|
|
848
|
+
<div className="debug-content-area">
|
|
849
|
+
{activeTab === 'logs' && (
|
|
850
|
+
<div className="logs-tab">
|
|
851
|
+
{logs.slice(-20).map((log, index) => (
|
|
852
|
+
<div key={index} className={`log-entry ${log.level}`}>
|
|
853
|
+
<span className="timestamp">{log.timestamp}</span>
|
|
854
|
+
<span className="message">{log.message}</span>
|
|
855
|
+
{log.data && (
|
|
856
|
+
<pre className="data">{JSON.stringify(log.data, null, 2)}</pre>
|
|
857
|
+
)}
|
|
858
|
+
</div>
|
|
859
|
+
))}
|
|
860
|
+
</div>
|
|
861
|
+
)}
|
|
862
|
+
|
|
863
|
+
{activeTab === 'errors' && (
|
|
864
|
+
<div className="errors-tab">
|
|
865
|
+
<h3>Error Statistics</h3>
|
|
866
|
+
<pre>{JSON.stringify(errorStats, null, 2)}</pre>
|
|
867
|
+
|
|
868
|
+
<h3>Recent Errors</h3>
|
|
869
|
+
{errorStats.recentErrors.map((error, index) => (
|
|
870
|
+
<div key={index} className="error-entry">
|
|
871
|
+
<div className="error-message">{error.message}</div>
|
|
872
|
+
<div className="error-stack">{error.stack}</div>
|
|
873
|
+
</div>
|
|
874
|
+
))}
|
|
875
|
+
</div>
|
|
876
|
+
)}
|
|
877
|
+
|
|
878
|
+
{activeTab === 'performance' && (
|
|
879
|
+
<div className="performance-tab">
|
|
880
|
+
<h3>Memory Usage</h3>
|
|
881
|
+
<div>
|
|
882
|
+
Used: {(performance.memory?.usedJSHeapSize || 0) / 1024 / 1024}MB
|
|
883
|
+
</div>
|
|
884
|
+
<div>
|
|
885
|
+
Total: {(performance.memory?.totalJSHeapSize || 0) / 1024 / 1024}MB
|
|
886
|
+
</div>
|
|
887
|
+
<div>
|
|
888
|
+
Limit: {(performance.memory?.jsHeapSizeLimit || 0) / 1024 / 1024}MB
|
|
889
|
+
</div>
|
|
890
|
+
</div>
|
|
891
|
+
)}
|
|
892
|
+
</div>
|
|
893
|
+
|
|
894
|
+
<div className="debug-actions">
|
|
895
|
+
<button onClick={() => DebugConsole.clearLogs()}>Clear Logs</button>
|
|
896
|
+
<button onClick={() => ErrorDebugger.clearErrors()}>Clear Errors</button>
|
|
897
|
+
<button onClick={() => {
|
|
898
|
+
const data = DebugConsole.exportLogs();
|
|
899
|
+
const blob = new Blob([JSON.stringify(data, null, 2)], {
|
|
900
|
+
type: 'application/json',
|
|
901
|
+
});
|
|
902
|
+
const url = URL.createObjectURL(blob);
|
|
903
|
+
const a = document.createElement('a');
|
|
904
|
+
a.href = url;
|
|
905
|
+
a.download = `debug-logs-${new Date().toISOString()}.json`;
|
|
906
|
+
a.click();
|
|
907
|
+
}}>Export Logs</button>
|
|
908
|
+
</div>
|
|
909
|
+
</div>
|
|
910
|
+
)}
|
|
911
|
+
</div>
|
|
912
|
+
);
|
|
913
|
+
}
|
|
914
|
+
```
|
|
915
|
+
|
|
916
|
+
### 2. Debug Styles
|
|
917
|
+
|
|
918
|
+
```css
|
|
919
|
+
/* styles/debug.css */
|
|
920
|
+
.debug-panel {
|
|
921
|
+
position: fixed;
|
|
922
|
+
bottom: 0;
|
|
923
|
+
right: 0;
|
|
924
|
+
width: 400px;
|
|
925
|
+
max-height: 500px;
|
|
926
|
+
background: #1a1a1a;
|
|
927
|
+
color: #fff;
|
|
928
|
+
border: 1px solid #333;
|
|
929
|
+
z-index: 9999;
|
|
930
|
+
font-family: monospace;
|
|
931
|
+
font-size: 12px;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.debug-content {
|
|
935
|
+
max-height: 400px;
|
|
936
|
+
overflow: hidden;
|
|
937
|
+
display: flex;
|
|
938
|
+
flex-direction: column;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
.debug-tabs {
|
|
942
|
+
display: flex;
|
|
943
|
+
border-bottom: 1px solid #333;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.debug-tabs button {
|
|
947
|
+
flex: 1;
|
|
948
|
+
padding: 8px;
|
|
949
|
+
background: #2a2a2a;
|
|
950
|
+
border: none;
|
|
951
|
+
color: #fff;
|
|
952
|
+
cursor: pointer;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
.debug-tabs button.active {
|
|
956
|
+
background: #444;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
.debug-content-area {
|
|
960
|
+
flex: 1;
|
|
961
|
+
overflow-y: auto;
|
|
962
|
+
padding: 8px;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
.log-entry {
|
|
966
|
+
margin-bottom: 4px;
|
|
967
|
+
padding: 4px;
|
|
968
|
+
border-radius: 2px;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
.log-entry.error {
|
|
972
|
+
background: #4a1a1a;
|
|
973
|
+
color: #ff6b6b;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
.log-entry.warn {
|
|
977
|
+
background: #4a3a1a;
|
|
978
|
+
color: #ffd93d;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.log-entry.log {
|
|
982
|
+
background: #1a4a1a;
|
|
983
|
+
color: #6bff6b;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
.timestamp {
|
|
987
|
+
color: #888;
|
|
988
|
+
margin-right: 8px;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
.data {
|
|
992
|
+
margin-top: 4px;
|
|
993
|
+
padding: 4px;
|
|
994
|
+
background: #2a2a2a;
|
|
995
|
+
border-radius: 2px;
|
|
996
|
+
font-size: 10px;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
.error-entry {
|
|
1000
|
+
margin-bottom: 8px;
|
|
1001
|
+
padding: 8px;
|
|
1002
|
+
background: #4a1a1a;
|
|
1003
|
+
border-radius: 4px;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
.error-message {
|
|
1007
|
+
color: #ff6b6b;
|
|
1008
|
+
font-weight: bold;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
.error-stack {
|
|
1012
|
+
margin-top: 4px;
|
|
1013
|
+
font-size: 10px;
|
|
1014
|
+
color: #ccc;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
.debug-actions {
|
|
1018
|
+
padding: 8px;
|
|
1019
|
+
border-top: 1px solid #333;
|
|
1020
|
+
display: flex;
|
|
1021
|
+
gap: 8px;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.debug-actions button {
|
|
1025
|
+
padding: 4px 8px;
|
|
1026
|
+
background: #444;
|
|
1027
|
+
border: none;
|
|
1028
|
+
color: #fff;
|
|
1029
|
+
cursor: pointer;
|
|
1030
|
+
border-radius: 2px;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
.debug-actions button:hover {
|
|
1034
|
+
background: #555;
|
|
1035
|
+
}
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
## Debugging Best Practices
|
|
1039
|
+
|
|
1040
|
+
### 1. Debugging Checklist
|
|
1041
|
+
|
|
1042
|
+
- [ ] Enable React DevTools
|
|
1043
|
+
- [ ] Use console.log strategically
|
|
1044
|
+
- [ ] Implement error boundaries
|
|
1045
|
+
- [ ] Track component renders
|
|
1046
|
+
- [ ] Monitor hook dependencies
|
|
1047
|
+
- [ ] Debug authentication flow
|
|
1048
|
+
- [ ] Check permission logic
|
|
1049
|
+
- [ ] Monitor API calls
|
|
1050
|
+
- [ ] Track performance metrics
|
|
1051
|
+
- [ ] Use debug panels in development
|
|
1052
|
+
|
|
1053
|
+
### 2. Common Debugging Scenarios
|
|
1054
|
+
|
|
1055
|
+
```typescript
|
|
1056
|
+
// Debugging authentication issues
|
|
1057
|
+
function debugAuthFlow() {
|
|
1058
|
+
const auth = useUnifiedAuth();
|
|
1059
|
+
|
|
1060
|
+
useEffect(() => {
|
|
1061
|
+
console.log('Auth state:', {
|
|
1062
|
+
user: auth.user,
|
|
1063
|
+
loading: auth.loading,
|
|
1064
|
+
error: auth.error,
|
|
1065
|
+
});
|
|
1066
|
+
}, [auth.user, auth.loading, auth.error]);
|
|
1067
|
+
|
|
1068
|
+
// Debug specific auth actions
|
|
1069
|
+
const debugSignIn = async (credentials: any) => {
|
|
1070
|
+
console.log('Attempting sign in with:', credentials);
|
|
1071
|
+
try {
|
|
1072
|
+
const result = await auth.signIn(credentials);
|
|
1073
|
+
console.log('Sign in result:', result);
|
|
1074
|
+
} catch (error) {
|
|
1075
|
+
console.error('Sign in failed:', error);
|
|
1076
|
+
}
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
// Debugging permission issues
|
|
1081
|
+
function debugPermissions() {
|
|
1082
|
+
const rbac = useRBAC();
|
|
1083
|
+
|
|
1084
|
+
useEffect(() => {
|
|
1085
|
+
console.log('RBAC state:', {
|
|
1086
|
+
permissions: rbac.permissions,
|
|
1087
|
+
roles: rbac.roles,
|
|
1088
|
+
});
|
|
1089
|
+
}, [rbac.permissions, rbac.roles]);
|
|
1090
|
+
|
|
1091
|
+
// Test specific permissions
|
|
1092
|
+
const testPermission = (permission: string) => {
|
|
1093
|
+
const hasPermission = rbac.hasPermission(permission);
|
|
1094
|
+
console.log(`Permission test: ${permission} = ${hasPermission}`);
|
|
1095
|
+
return hasPermission;
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
// Debugging API issues
|
|
1100
|
+
function debugAPI() {
|
|
1101
|
+
const { supabase } = useSupabase();
|
|
1102
|
+
|
|
1103
|
+
const debugQuery = async (table: string) => {
|
|
1104
|
+
console.log(`Querying ${table}...`);
|
|
1105
|
+
try {
|
|
1106
|
+
const { data, error } = await supabase.from(table).select('*');
|
|
1107
|
+
console.log(`${table} query result:`, { data, error });
|
|
1108
|
+
return { data, error };
|
|
1109
|
+
} catch (error) {
|
|
1110
|
+
console.error(`${table} query failed:`, error);
|
|
1111
|
+
throw error;
|
|
1112
|
+
}
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
```
|
|
1116
|
+
|
|
1117
|
+
For more information about debugging your application, see the [Common Issues Guide](./common-issues.md) and [Migration Guide](./migration.md).
|