@jmruthers/pace-core 0.5.191 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +7 -1
- package/cursor-rules/00-pace-core-compliance.mdc +372 -0
- package/cursor-rules/01-standards-compliance.mdc +275 -0
- package/cursor-rules/02-project-structure.mdc +200 -0
- package/cursor-rules/03-solid-principles.mdc +341 -0
- package/cursor-rules/04-testing-standards.mdc +315 -0
- package/cursor-rules/05-bug-reports-and-features.mdc +246 -0
- package/cursor-rules/06-code-quality.mdc +392 -0
- package/cursor-rules/07-tech-stack-compliance.mdc +309 -0
- package/cursor-rules/CHANGELOG.md +101 -0
- package/cursor-rules/README.md +191 -0
- package/dist/{AuthService-CbP_utw2.d.ts → AuthService-DjnJHDtC.d.ts} +1 -0
- package/dist/{DataTable-Be6dH_dR.d.ts → DataTable-CH1U5Tpy.d.ts} +1 -1
- package/dist/{DataTable-WKRZD47S.js → DataTable-DQ7RSOHE.js} +8 -7
- package/dist/{PublicPageProvider-ULXC_u6U.d.ts → PublicPageProvider-ce4xlHYA.d.ts} +37 -156
- package/dist/{UnifiedAuthProvider-BYA9qB-o.d.ts → UnifiedAuthProvider-185Ih4dj.d.ts} +2 -0
- package/dist/{UnifiedAuthProvider-FTSG5XH7.js → UnifiedAuthProvider-ATAP5UTR.js} +3 -3
- package/dist/{api-IHKALJZD.js → api-N774RPUA.js} +2 -2
- package/dist/{chunk-6C4YBBJM.js → chunk-3QRJFVBR.js} +1 -1
- package/dist/chunk-3QRJFVBR.js.map +1 -0
- package/dist/{chunk-OETXORNB.js → chunk-3XTALGJF.js} +211 -136
- package/dist/chunk-3XTALGJF.js.map +1 -0
- package/dist/{chunk-6TQDD426.js → chunk-4N5C5XZU.js} +47 -228
- package/dist/chunk-4N5C5XZU.js.map +1 -0
- package/dist/{chunk-LOMZXPSN.js → chunk-4ZC4GX36.js} +47 -74
- package/dist/chunk-4ZC4GX36.js.map +1 -0
- package/dist/{chunk-6LTQQAT6.js → chunk-BYFSK72L.js} +357 -158
- package/dist/chunk-BYFSK72L.js.map +1 -0
- package/dist/{chunk-XYXSXPUK.js → chunk-EXUD6RNJ.js} +50 -10
- package/dist/chunk-EXUD6RNJ.js.map +1 -0
- package/dist/{chunk-VKB2CO4Z.js → chunk-GLK6VM3F.js} +244 -249
- package/dist/chunk-GLK6VM3F.js.map +1 -0
- package/dist/{chunk-HW3OVDUF.js → chunk-J36DSWQK.js} +1 -1
- package/dist/{chunk-HW3OVDUF.js.map → chunk-J36DSWQK.js.map} +1 -1
- package/dist/{chunk-XNYQOL3Z.js → chunk-JBKQ3SAO.js} +9 -18
- package/dist/chunk-JBKQ3SAO.js.map +1 -0
- package/dist/{chunk-ROXMHMY2.js → chunk-KNC55RTG.js} +13 -3
- package/dist/{chunk-ROXMHMY2.js.map → chunk-KNC55RTG.js.map} +1 -1
- package/dist/{chunk-QWWZ5CAQ.js → chunk-LXQLPRQ2.js} +2 -2
- package/dist/{chunk-ULHIJK66.js → chunk-T33XF5ZC.js} +255 -140
- package/dist/chunk-T33XF5ZC.js.map +1 -0
- package/dist/{chunk-VRGWKHDB.js → chunk-XM25TVIE.js} +100 -33
- package/dist/chunk-XM25TVIE.js.map +1 -0
- package/dist/components.d.ts +4 -4
- package/dist/components.js +9 -9
- package/dist/hooks.d.ts +6 -6
- package/dist/hooks.js +20 -25
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +18 -21
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts +3 -3
- package/dist/providers.js +2 -2
- package/dist/rbac/index.d.ts +2 -20
- package/dist/rbac/index.js +7 -9
- package/dist/{usePublicRouteParams-TZe0gy-4.d.ts → usePublicRouteParams-BJAlWfuJ.d.ts} +3 -3
- package/dist/{useToast-C8gR5ir4.d.ts → useToast-AyaT-x7p.d.ts} +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +3 -3
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/Logger.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +2 -2
- package/docs/api/classes/RBACAuditManager.md +2 -2
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +2 -2
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +10 -10
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/enums/LogLevel.md +1 -1
- package/docs/api/enums/RBACErrorCode.md +1 -1
- package/docs/api/enums/RPCFunction.md +1 -1
- package/docs/api/interfaces/AddressFieldProps.md +1 -1
- package/docs/api/interfaces/AddressFieldRef.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/AutocompleteOptions.md +1 -1
- package/docs/api/interfaces/AvatarProps.md +1 -1
- package/docs/api/interfaces/BadgeProps.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CalendarProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/ComplianceResult.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/DatabaseComplianceResult.md +1 -1
- package/docs/api/interfaces/DatabaseIssue.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/ExportColumn.md +1 -1
- package/docs/api/interfaces/ExportOptions.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +24 -11
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/FormFieldProps.md +1 -1
- package/docs/api/interfaces/FormProps.md +1 -1
- package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoggerConfig.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +2 -2
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +2 -2
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/ParsedAddress.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +4 -4
- package/docs/api/interfaces/ProgressProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/QuickFix.md +1 -1
- package/docs/api/interfaces/RBACAccessValidateParams.md +1 -1
- package/docs/api/interfaces/RBACAccessValidateResult.md +1 -1
- package/docs/api/interfaces/RBACAuditLogParams.md +1 -1
- package/docs/api/interfaces/RBACAuditLogResult.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +2 -2
- package/docs/api/interfaces/RBACContext.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACPageAccessCheckParams.md +1 -1
- package/docs/api/interfaces/RBACPerformanceMetrics.md +1 -1
- package/docs/api/interfaces/RBACPermissionCheckParams.md +1 -1
- package/docs/api/interfaces/RBACPermissionCheckResult.md +2 -2
- package/docs/api/interfaces/RBACPermissionsGetParams.md +1 -1
- package/docs/api/interfaces/RBACPermissionsGetResult.md +1 -1
- package/docs/api/interfaces/RBACResult.md +1 -1
- package/docs/api/interfaces/RBACRoleGrantParams.md +2 -2
- package/docs/api/interfaces/RBACRoleGrantResult.md +1 -1
- package/docs/api/interfaces/RBACRoleRevokeParams.md +2 -2
- package/docs/api/interfaces/RBACRoleRevokeResult.md +1 -1
- package/docs/api/interfaces/RBACRoleValidateParams.md +2 -2
- package/docs/api/interfaces/RBACRoleValidateResult.md +1 -1
- package/docs/api/interfaces/RBACRolesListParams.md +1 -1
- package/docs/api/interfaces/RBACRolesListResult.md +2 -2
- package/docs/api/interfaces/RBACSessionTrackParams.md +1 -1
- package/docs/api/interfaces/RBACSessionTrackResult.md +1 -1
- package/docs/api/interfaces/ResourcePermissions.md +1 -1
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RoleManagementResult.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +2 -2
- package/docs/api/interfaces/RouteConfig.md +2 -2
- package/docs/api/interfaces/RuntimeComplianceResult.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +1 -1
- package/docs/api/interfaces/SetupIssue.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/TabsContentProps.md +1 -1
- package/docs/api/interfaces/TabsListProps.md +1 -1
- package/docs/api/interfaces/TabsProps.md +1 -1
- package/docs/api/interfaces/TabsTriggerProps.md +1 -1
- package/docs/api/interfaces/TextareaProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +60 -38
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +13 -13
- package/docs/api/interfaces/UseFormDialogOptions.md +1 -1
- package/docs/api/interfaces/UseFormDialogReturn.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +2 -2
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +2 -2
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +2 -2
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UseResourcePermissionsOptions.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +194 -209
- package/docs/getting-started/cursor-rules.md +262 -0
- package/docs/getting-started/installation-guide.md +6 -1
- package/docs/getting-started/quick-start.md +6 -1
- package/docs/migration/MIGRATION_GUIDE.md +4 -4
- package/docs/migration/REACT_19_MIGRATION.md +227 -0
- package/docs/migration/database-changes-december-2025.md +2 -1
- package/docs/rbac/event-based-apps.md +124 -6
- package/docs/standards/README.md +39 -0
- package/docs/troubleshooting/migration.md +4 -4
- package/examples/PublicPages/PublicEventPage.tsx +1 -1
- package/package.json +11 -6
- package/scripts/audit-consuming-app.cjs +961 -0
- package/scripts/check-pace-core-compliance.cjs +315 -61
- package/scripts/install-cursor-rules.cjs +236 -0
- package/src/__tests__/helpers/test-providers.tsx +1 -1
- package/src/__tests__/helpers/test-utils.tsx +1 -1
- package/src/__tests__/rls-policies.test.ts +3 -1
- package/src/components/Badge/Badge.tsx +2 -4
- package/src/components/Button/Button.tsx +5 -4
- package/src/components/Calendar/Calendar.tsx +1 -1
- package/src/components/DataTable/DataTable.test.tsx +57 -93
- package/src/components/DataTable/DataTable.tsx +2 -2
- package/src/components/DataTable/__tests__/DataTable.default-state.test.tsx +172 -45
- package/src/components/DataTable/__tests__/DataTable.grouping-aggregation.test.tsx +121 -28
- package/src/components/DataTable/__tests__/DataTableCore.test-setup.ts +9 -8
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +20 -52
- package/src/components/DataTable/__tests__/a11y.basic.test.tsx +170 -34
- package/src/components/DataTable/__tests__/keyboard.test.tsx +75 -12
- package/src/components/DataTable/__tests__/pagination.modes.test.tsx +88 -16
- package/src/components/DataTable/__tests__/ssr.strict-mode.test.tsx +12 -12
- package/src/components/DataTable/components/AccessDeniedPage.tsx +1 -1
- package/src/components/DataTable/components/BulkOperationsDropdown.tsx +1 -1
- package/src/components/DataTable/components/DataTableCore.tsx +4 -7
- package/src/components/DataTable/components/DataTableModals.tsx +1 -1
- package/src/components/DataTable/components/EditableRow.tsx +1 -1
- package/src/components/DataTable/components/UnifiedTableBody.tsx +86 -17
- package/src/components/DataTable/components/__tests__/DataTableModals.test.tsx +23 -23
- package/src/components/DataTable/components/__tests__/EditableRow.test.tsx +11 -11
- package/src/components/DataTable/components/__tests__/ExpandButton.test.tsx +36 -36
- package/src/components/DataTable/components/__tests__/GroupHeader.test.tsx +27 -27
- package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +39 -39
- package/src/components/DataTable/components/__tests__/UnifiedTableBody.test.tsx +33 -33
- package/src/components/DataTable/components/__tests__/ViewRowModal.test.tsx +29 -29
- package/src/components/DataTable/hooks/useColumnReordering.ts +2 -2
- package/src/components/DataTable/hooks/useDataTablePermissions.ts +75 -10
- package/src/components/DataTable/hooks/useKeyboardNavigation.ts +2 -2
- package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.test.tsx +8 -14
- package/src/components/Dialog/Dialog.tsx +6 -5
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +1 -1
- package/src/components/EventSelector/EventSelector.tsx +1 -1
- package/src/components/FileDisplay/FileDisplay.test.tsx +4 -3
- package/src/components/FileDisplay/FileDisplay.tsx +16 -4
- package/src/components/Footer/Footer.tsx +1 -1
- package/src/components/Form/Form.test.tsx +36 -15
- package/src/components/Form/Form.tsx +30 -26
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +40 -40
- package/src/components/InactivityWarningModal/InactivityWarningModal.tsx +1 -1
- package/src/components/Input/Input.tsx +28 -30
- package/src/components/Label/Label.tsx +1 -1
- package/src/components/LoadingSpinner/LoadingSpinner.tsx +1 -1
- package/src/components/LoginForm/LoginForm.test.tsx +42 -42
- package/src/components/LoginForm/LoginForm.tsx +8 -8
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +6 -4
- package/src/components/NavigationMenu/NavigationMenu.tsx +2 -11
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +0 -1
- package/src/components/PaceAppLayout/PaceAppLayout.performance.test.tsx +1 -1
- package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +75 -52
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +98 -69
- package/src/components/PaceAppLayout/README.md +1 -1
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +1 -8
- package/src/components/PasswordChange/PasswordChangeForm.test.tsx +33 -33
- package/src/components/PasswordChange/PasswordChangeForm.tsx +1 -1
- package/src/components/Progress/Progress.tsx +1 -1
- package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +5 -9
- package/src/components/ProtectedRoute/ProtectedRoute.tsx +0 -1
- package/src/components/PublicLayout/PublicPageLayout.tsx +1 -1
- package/src/components/PublicLayout/PublicPageProvider.tsx +0 -1
- package/src/components/Select/Select.tsx +33 -22
- package/src/components/SessionRestorationLoader/SessionRestorationLoader.tsx +1 -1
- package/src/components/Table/Table.tsx +1 -1
- package/src/components/Textarea/Textarea.tsx +27 -29
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/UserMenu/UserMenu.tsx +1 -1
- package/src/hooks/__tests__/hooks.integration.test.tsx +80 -55
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +14 -7
- package/src/hooks/__tests__/useStorage.unit.test.ts +36 -36
- package/src/hooks/public/usePublicEvent.ts +1 -1
- package/src/hooks/public/usePublicEventLogo.ts +1 -1
- package/src/hooks/public/usePublicRouteParams.ts +1 -1
- package/src/hooks/services/useAuthService.ts +21 -3
- package/src/hooks/services/useEventService.ts +21 -3
- package/src/hooks/services/useInactivityService.ts +21 -3
- package/src/hooks/services/useOrganisationService.ts +21 -3
- package/src/hooks/useDataTableState.ts +8 -18
- package/src/hooks/useFileDisplay.ts +10 -17
- package/src/hooks/useFocusManagement.ts +2 -2
- package/src/hooks/useFocusTrap.ts +4 -4
- package/src/hooks/useFormDialog.ts +8 -7
- package/src/hooks/useInactivityTracker.ts +1 -1
- package/src/hooks/usePermissionCache.ts +1 -1
- package/src/hooks/useSecureDataAccess.test.ts +16 -9
- package/src/hooks/useSecureDataAccess.ts +22 -6
- package/src/hooks/useToast.ts +2 -2
- package/src/providers/__tests__/OrganisationProvider.test.tsx +57 -13
- package/src/providers/__tests__/ProviderLifecycle.test.tsx +21 -6
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +10 -10
- package/src/providers/services/EventServiceProvider.tsx +0 -8
- package/src/providers/services/UnifiedAuthProvider.tsx +196 -46
- package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +13 -3
- package/src/rbac/__tests__/adapters.comprehensive.test.tsx +34 -40
- package/src/rbac/__tests__/isSuperAdmin.real.test.ts +82 -0
- package/src/rbac/adapters.tsx +3 -22
- package/src/rbac/api.test.ts +2 -2
- package/src/rbac/api.ts +7 -1
- package/src/rbac/components/EnhancedNavigationMenu.tsx +3 -16
- package/src/rbac/components/NavigationGuard.tsx +2 -11
- package/src/rbac/components/NavigationProvider.tsx +1 -2
- package/src/rbac/components/PagePermissionGuard.tsx +1 -1
- package/src/rbac/components/PagePermissionProvider.tsx +1 -1
- package/src/rbac/components/PermissionEnforcer.tsx +46 -13
- package/src/rbac/components/RoleBasedRouter.tsx +1 -1
- package/src/rbac/components/SecureDataProvider.tsx +1 -2
- package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +7 -43
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +4 -11
- package/src/rbac/components/__tests__/NavigationProvider.test.tsx +3 -3
- package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +1 -1
- package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +1 -1
- package/src/rbac/engine.ts +14 -2
- package/src/rbac/hooks/index.ts +0 -3
- package/src/rbac/hooks/usePermissions.ts +51 -11
- package/src/rbac/hooks/useRBAC.ts +3 -13
- package/src/rbac/hooks/useResolvedScope.test.ts +75 -54
- package/src/rbac/hooks/useResolvedScope.ts +58 -33
- package/src/rbac/hooks/useSecureSupabase.ts +4 -9
- package/src/rbac/secureClient.ts +43 -0
- package/src/services/EventService.ts +4 -57
- package/src/services/InactivityService.ts +127 -34
- package/src/services/OrganisationService.ts +68 -10
- package/src/utils/security/secureDataAccess.test.ts +31 -20
- package/src/utils/security/secureDataAccess.ts +4 -3
- package/dist/chunk-6C4YBBJM.js.map +0 -1
- package/dist/chunk-6LTQQAT6.js.map +0 -1
- package/dist/chunk-6TQDD426.js.map +0 -1
- package/dist/chunk-LOMZXPSN.js.map +0 -1
- package/dist/chunk-OETXORNB.js.map +0 -1
- package/dist/chunk-ULHIJK66.js.map +0 -1
- package/dist/chunk-VKB2CO4Z.js.map +0 -1
- package/dist/chunk-VRGWKHDB.js.map +0 -1
- package/dist/chunk-XNYQOL3Z.js.map +0 -1
- package/dist/chunk-XYXSXPUK.js.map +0 -1
- package/scripts/check-pace-core-compliance.js +0 -512
- package/src/rbac/hooks/useSuperAdminBypass.ts +0 -126
- package/src/utils/context/superAdminOverride.ts +0 -58
- /package/dist/{DataTable-WKRZD47S.js.map → DataTable-DQ7RSOHE.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-FTSG5XH7.js.map → UnifiedAuthProvider-ATAP5UTR.js.map} +0 -0
- /package/dist/{api-IHKALJZD.js.map → api-N774RPUA.js.map} +0 -0
- /package/dist/{chunk-QWWZ5CAQ.js.map → chunk-LXQLPRQ2.js.map} +0 -0
- /package/examples/{rbac → RBAC}/CompleteRBACExample.tsx +0 -0
- /package/examples/{rbac → RBAC}/EventBasedApp.tsx +0 -0
- /package/examples/{rbac → RBAC}/PermissionExample.tsx +0 -0
- /package/examples/{rbac → RBAC}/index.ts +0 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
# Cursor Rules Quick Start Guide
|
|
2
|
+
|
|
3
|
+
This guide helps you get started with pace-core cursor rules in your consuming app.
|
|
4
|
+
|
|
5
|
+
## What are Cursor Rules?
|
|
6
|
+
|
|
7
|
+
Cursor rules are `.mdc` (Markdown Cursor) files that guide AI assistants (like Cursor) to follow specific patterns and standards when writing code. pace-core provides a comprehensive set of rules that ensure your app maintains quality, consistency, and compliance with pace-core standards.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
### Step 1: Install pace-core
|
|
12
|
+
|
|
13
|
+
Make sure pace-core is installed in your project:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @jmruthers/pace-core
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Step 2: Install Cursor Rules
|
|
20
|
+
|
|
21
|
+
Run the installation script from your app root:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
node node_modules/@jmruthers/pace-core/scripts/install-cursor-rules.cjs
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or add to your `package.json`:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"scripts": {
|
|
32
|
+
"setup:cursor-rules": "node node_modules/@jmruthers/pace-core/scripts/install-cursor-rules.cjs"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Then run:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm run setup:cursor-rules
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The script will:
|
|
44
|
+
- Create `.cursor/rules/` directory if it doesn't exist
|
|
45
|
+
- Copy all pace-core rules (00-07) to your project
|
|
46
|
+
- **Automatically update** pace-core rules (00-09) if they've changed
|
|
47
|
+
- Preserve any existing custom rules (50+)
|
|
48
|
+
- Skip files that are already up to date
|
|
49
|
+
|
|
50
|
+
## Quick Start Snippet
|
|
51
|
+
|
|
52
|
+
When working with Cursor, you can explicitly reference rules:
|
|
53
|
+
|
|
54
|
+
> "Use pace-core components and follow rules 00–04."
|
|
55
|
+
|
|
56
|
+
This helps Cursor focus on specific rule sets and ensures consistency.
|
|
57
|
+
|
|
58
|
+
## Rule Files Overview
|
|
59
|
+
|
|
60
|
+
The installed rules are numbered for ordering:
|
|
61
|
+
|
|
62
|
+
- **00-pace-core-compliance.mdc** - Enforce pace-core usage patterns
|
|
63
|
+
- **01-standards-compliance.mdc** - Enforce all pace-core standards
|
|
64
|
+
- **02-project-structure.mdc** - Define standard folder structure
|
|
65
|
+
- **03-solid-principles.mdc** - Enforce SOLID architecture principles
|
|
66
|
+
- **04-testing-standards.mdc** - Enforce testing framework consistency
|
|
67
|
+
- **05-bug-reports-and-features.mdc** - Templates for bug reports (guidance-only)
|
|
68
|
+
- **06-code-quality.mdc** - Enforce code quality standards
|
|
69
|
+
- **07-tech-stack-compliance.mdc** - Enforce tech stack versions and patterns
|
|
70
|
+
|
|
71
|
+
## Using Rules with Cursor
|
|
72
|
+
|
|
73
|
+
### Automatic Loading
|
|
74
|
+
|
|
75
|
+
Cursor automatically loads all `.mdc` files from `.cursor/rules/` when:
|
|
76
|
+
- You open a file that matches the rule's `globs` pattern
|
|
77
|
+
- You ask Cursor to write or modify code
|
|
78
|
+
- Cursor needs context for code generation
|
|
79
|
+
|
|
80
|
+
### Explicit References
|
|
81
|
+
|
|
82
|
+
You can explicitly reference rules in your prompts:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
"Create a new component following rules 00, 01, and 03"
|
|
86
|
+
"Refactor this code to follow SOLID principles (rule 03)"
|
|
87
|
+
"Write tests following rule 04"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Rule Semantics
|
|
91
|
+
|
|
92
|
+
Rules use clear semantics:
|
|
93
|
+
- **MUST** - Hard requirement, non-negotiable
|
|
94
|
+
- **SHOULD** - Strong recommendation, best practice
|
|
95
|
+
- **MAY** - Optional, acceptable alternative
|
|
96
|
+
|
|
97
|
+
## Custom Rules
|
|
98
|
+
|
|
99
|
+
### Creating Your Own Rules
|
|
100
|
+
|
|
101
|
+
Create your own rules in `.cursor/rules/` with numbers starting at `50`:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
.cursor/rules/
|
|
105
|
+
├── 00-pace-core-compliance.mdc # pace-core rule
|
|
106
|
+
├── 01-standards-compliance.mdc # pace-core rule
|
|
107
|
+
├── ...
|
|
108
|
+
├── 50-my-custom-rule.mdc # Your custom rule
|
|
109
|
+
└── 51-another-custom-rule.mdc # Your custom rule
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Rule Format
|
|
113
|
+
|
|
114
|
+
Your custom rules should follow the same format:
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
---
|
|
118
|
+
description: Brief description of your rule
|
|
119
|
+
globs: ["targeted/path/**/*.{ts,tsx}"]
|
|
120
|
+
alwaysApply: true
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
# Your Rule Title
|
|
124
|
+
|
|
125
|
+
Content with examples and guidelines.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Running Audits
|
|
129
|
+
|
|
130
|
+
### Comprehensive Audit
|
|
131
|
+
|
|
132
|
+
Run the comprehensive audit tool to check compliance:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
node node_modules/@jmruthers/pace-core/scripts/audit-consuming-app.cjs
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Or add to your `package.json`:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"scripts": {
|
|
143
|
+
"audit:pace-core": "node node_modules/@jmruthers/pace-core/scripts/audit-consuming-app.cjs"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
This generates a timestamped markdown report in `audit/` directory.
|
|
149
|
+
|
|
150
|
+
### Compliance Check
|
|
151
|
+
|
|
152
|
+
For a quick compliance check:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
node node_modules/@jmruthers/pace-core/scripts/check-pace-core-compliance.cjs
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Updating Rules
|
|
159
|
+
|
|
160
|
+
When pace-core is updated, run the installation script again:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
npm run setup:cursor-rules
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
The script will:
|
|
167
|
+
- **Automatically update** pace-core rules (00-09) if they've changed (version or content differs)
|
|
168
|
+
- Preserve your custom rules (50+)
|
|
169
|
+
- Skip files that are already up to date
|
|
170
|
+
|
|
171
|
+
### Force Update
|
|
172
|
+
|
|
173
|
+
To force update all rules (even when versions match):
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
node node_modules/@jmruthers/pace-core/scripts/install-cursor-rules.cjs --force
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Note**: Normally, pace-core rules are automatically updated when they change. The `--force` flag forces an update even when versions match (useful if content changed but version metadata wasn't updated).
|
|
180
|
+
|
|
181
|
+
## Monorepo Setup
|
|
182
|
+
|
|
183
|
+
For monorepos, run the installation script from each app's root directory:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
monorepo/
|
|
187
|
+
├── apps/
|
|
188
|
+
│ ├── app1/
|
|
189
|
+
│ │ └── .cursor/rules/ # Run script here
|
|
190
|
+
│ └── app2/
|
|
191
|
+
│ └── .cursor/rules/ # Run script here
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Each app maintains its own `.cursor/rules/` directory.
|
|
195
|
+
|
|
196
|
+
## Troubleshooting
|
|
197
|
+
|
|
198
|
+
### Rules Not Loading
|
|
199
|
+
|
|
200
|
+
1. Verify rules are in `.cursor/rules/` directory
|
|
201
|
+
2. Check file extensions are `.mdc`
|
|
202
|
+
3. Restart Cursor if rules were just installed
|
|
203
|
+
4. Check rule frontmatter is valid YAML
|
|
204
|
+
|
|
205
|
+
### Rules Conflicting
|
|
206
|
+
|
|
207
|
+
1. Check rule numbering (pace-core: 00-09, yours: 50+)
|
|
208
|
+
2. Verify `globs` patterns don't overlap unnecessarily
|
|
209
|
+
3. Review rule priorities in frontmatter
|
|
210
|
+
|
|
211
|
+
### Installation Fails
|
|
212
|
+
|
|
213
|
+
1. Check you're in the app root directory
|
|
214
|
+
2. Verify `node_modules/@jmruthers/pace-core/` exists
|
|
215
|
+
3. Check file permissions
|
|
216
|
+
4. Try with `--force` flag if needed
|
|
217
|
+
|
|
218
|
+
## Best Practices
|
|
219
|
+
|
|
220
|
+
1. **Run audits regularly** - Check compliance before major commits
|
|
221
|
+
2. **Update rules** - Keep pace-core rules up to date
|
|
222
|
+
3. **Reference rules explicitly** - Tell Cursor which rules to follow
|
|
223
|
+
4. **Create custom rules** - Add app-specific rules starting at 50
|
|
224
|
+
5. **Review audit reports** - Address issues systematically
|
|
225
|
+
|
|
226
|
+
## Example Workflow
|
|
227
|
+
|
|
228
|
+
1. **Initial Setup:**
|
|
229
|
+
```bash
|
|
230
|
+
npm install @jmruthers/pace-core
|
|
231
|
+
npm run setup:cursor-rules
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
2. **Daily Development:**
|
|
235
|
+
- Cursor automatically uses rules when writing code
|
|
236
|
+
- Explicitly reference rules when needed: "Follow rules 00-04"
|
|
237
|
+
|
|
238
|
+
3. **Before Committing:**
|
|
239
|
+
```bash
|
|
240
|
+
npm run audit:pace-core
|
|
241
|
+
```
|
|
242
|
+
Review the generated report in `audit/` directory
|
|
243
|
+
|
|
244
|
+
4. **After pace-core Updates:**
|
|
245
|
+
```bash
|
|
246
|
+
npm update @jmruthers/pace-core
|
|
247
|
+
npm run setup:cursor-rules
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Related Documentation
|
|
251
|
+
|
|
252
|
+
- [Cursor Rules README](../../cursor-rules/README.md)
|
|
253
|
+
- [pace-core Standards](../standards/README.md)
|
|
254
|
+
- [pace-core Exports](../api-reference/README.md)
|
|
255
|
+
|
|
256
|
+
## Support
|
|
257
|
+
|
|
258
|
+
For issues with cursor rules:
|
|
259
|
+
1. Check this guide
|
|
260
|
+
2. Review rule files for guidance
|
|
261
|
+
3. File an issue in pace-core repository
|
|
262
|
+
4. Check pace-core documentation
|
|
@@ -71,7 +71,12 @@ import path from 'path'
|
|
|
71
71
|
|
|
72
72
|
export default defineConfig({
|
|
73
73
|
plugins: [
|
|
74
|
-
react(
|
|
74
|
+
react({
|
|
75
|
+
// React Compiler for automatic optimizations (React 19+)
|
|
76
|
+
babel: {
|
|
77
|
+
plugins: ['babel-plugin-react-compiler'],
|
|
78
|
+
},
|
|
79
|
+
}),
|
|
75
80
|
tailwindcss({
|
|
76
81
|
// CRITICAL: Include pace-core source files for Tailwind scanning
|
|
77
82
|
content: [
|
|
@@ -57,7 +57,12 @@ import path from 'path';
|
|
|
57
57
|
|
|
58
58
|
export default defineConfig({
|
|
59
59
|
plugins: [
|
|
60
|
-
react(
|
|
60
|
+
react({
|
|
61
|
+
// React Compiler for automatic optimizations (React 19+)
|
|
62
|
+
babel: {
|
|
63
|
+
plugins: ['babel-plugin-react-compiler'],
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
61
66
|
tailwindcss({
|
|
62
67
|
content: [
|
|
63
68
|
'./src/**/*.{js,ts,jsx,tsx}',
|
|
@@ -933,8 +933,8 @@ export default defineConfig({
|
|
|
933
933
|
|
|
934
934
|
// New dependencies
|
|
935
935
|
"@jmruthers/pace-core": "^2.0.0",
|
|
936
|
-
"react": "^
|
|
937
|
-
"react-dom": "^
|
|
936
|
+
"react": "^19.2.3",
|
|
937
|
+
"react-dom": "^19.2.3",
|
|
938
938
|
"@supabase/supabase-js": "^2.38.0",
|
|
939
939
|
"zod": "^3.22.0"
|
|
940
940
|
},
|
|
@@ -944,8 +944,8 @@ export default defineConfig({
|
|
|
944
944
|
"@types/react-dom": "^17.0.0",
|
|
945
945
|
|
|
946
946
|
// New dev dependencies
|
|
947
|
-
"@types/react": "^
|
|
948
|
-
"@types/react-dom": "^
|
|
947
|
+
"@types/react": "^19.2.7",
|
|
948
|
+
"@types/react-dom": "^19.2.3",
|
|
949
949
|
"@vitejs/plugin-react": "^4.0.0",
|
|
950
950
|
"vite": "^4.4.0",
|
|
951
951
|
"typescript": "^5.0.0"
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
lastUpdated: 2025-01-28T00:00:00+11:00
|
|
3
|
+
version: 0.5.193
|
|
4
|
+
reviewedBy: react-19-upgrade
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# React 19 Migration Guide
|
|
8
|
+
|
|
9
|
+
This guide documents the React 19 upgrade for `@jmruthers/pace-core` and provides migration instructions for consuming apps.
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
PACE Core has been upgraded from React 18.3.1 to React 19.2.3, including the React Compiler for automatic optimizations. This upgrade provides improved performance, better type safety, and new features.
|
|
14
|
+
|
|
15
|
+
## What Changed
|
|
16
|
+
|
|
17
|
+
### Core Upgrades
|
|
18
|
+
|
|
19
|
+
- **React**: `^18.3.1` → `^19.2.3`
|
|
20
|
+
- **React DOM**: `^18.3.1` → `^19.2.3`
|
|
21
|
+
- **@types/react**: `^18.3.17` → `^19.2.7`
|
|
22
|
+
- **@types/react-dom**: `^18.3.5` → `^19.2.3`
|
|
23
|
+
- **@vitejs/plugin-react**: `^4.5.1` → `^5.1.2`
|
|
24
|
+
- **React Compiler**: Added `babel-plugin-react-compiler@^1.0.0`
|
|
25
|
+
|
|
26
|
+
### React Compiler
|
|
27
|
+
|
|
28
|
+
The React Compiler is now configured in pace-core's build setup. It automatically optimizes React components by:
|
|
29
|
+
- Automatically memoizing components and values
|
|
30
|
+
- Reducing the need for manual `useMemo` and `useCallback`
|
|
31
|
+
- Optimizing re-renders based on actual dependencies
|
|
32
|
+
|
|
33
|
+
## Breaking Changes
|
|
34
|
+
|
|
35
|
+
### TypeScript Type Stricter
|
|
36
|
+
|
|
37
|
+
React 19 has stricter TypeScript types. The main change affects accessing `child.props` in React elements:
|
|
38
|
+
|
|
39
|
+
**Before (React 18)**:
|
|
40
|
+
```tsx
|
|
41
|
+
React.Children.map(children, (child) => {
|
|
42
|
+
if (React.isValidElement(child)) {
|
|
43
|
+
const variant = child.props.variant; // Works
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**After (React 19)**:
|
|
49
|
+
```tsx
|
|
50
|
+
React.Children.map(children, (child) => {
|
|
51
|
+
if (React.isValidElement(child)) {
|
|
52
|
+
const props = child.props as { variant?: string; [key: string]: unknown };
|
|
53
|
+
const variant = props.variant; // Type-safe
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Error Handling
|
|
59
|
+
|
|
60
|
+
React 19 changes how errors are handled:
|
|
61
|
+
- Errors during render are no longer re-thrown
|
|
62
|
+
- Uncaught errors are reported to `window.reportError`
|
|
63
|
+
- Error boundaries continue to work as before
|
|
64
|
+
|
|
65
|
+
### StrictMode Behavior
|
|
66
|
+
|
|
67
|
+
React 19 StrictMode changes:
|
|
68
|
+
- `useMemo` and `useCallback` reuse results from first render during second render
|
|
69
|
+
- Ref callbacks are double-invoked on initial mount
|
|
70
|
+
|
|
71
|
+
## Migration Steps for Consuming Apps
|
|
72
|
+
|
|
73
|
+
### Step 1: Update React Dependencies
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm install react@^19.2.3 react-dom@^19.2.3
|
|
77
|
+
npm install -D @types/react@^19.2.7 @types/react-dom@^19.2.3
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Step 2: Update Vite Plugin
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm install -D @vitejs/plugin-react@^5.1.2
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Step 3: Install React Compiler (Recommended)
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm install -D babel-plugin-react-compiler@latest
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Step 4: Configure React Compiler in Vite
|
|
93
|
+
|
|
94
|
+
Update your `vite.config.ts`:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
import { defineConfig } from 'vite'
|
|
98
|
+
import react from '@vitejs/plugin-react'
|
|
99
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
100
|
+
|
|
101
|
+
export default defineConfig({
|
|
102
|
+
plugins: [
|
|
103
|
+
react({
|
|
104
|
+
babel: {
|
|
105
|
+
plugins: ['babel-plugin-react-compiler'],
|
|
106
|
+
},
|
|
107
|
+
}),
|
|
108
|
+
tailwindcss()
|
|
109
|
+
],
|
|
110
|
+
// ... rest of config
|
|
111
|
+
})
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Step 5: Update TypeScript Types
|
|
115
|
+
|
|
116
|
+
If you have custom components that access `child.props`, update them:
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
// Before
|
|
120
|
+
const props = child.props;
|
|
121
|
+
|
|
122
|
+
// After
|
|
123
|
+
const props = child.props as { [key: string]: unknown };
|
|
124
|
+
// Or with specific types
|
|
125
|
+
const props = child.props as { variant?: string; size?: string; [key: string]: unknown };
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Step 6: Test Your Application
|
|
129
|
+
|
|
130
|
+
1. Run your test suite
|
|
131
|
+
2. Check for TypeScript errors
|
|
132
|
+
3. Verify components render correctly
|
|
133
|
+
4. Test error boundaries
|
|
134
|
+
5. Use React DevTools to verify React Compiler is working (look for "Memo ✨" badge)
|
|
135
|
+
|
|
136
|
+
## React Compiler Benefits
|
|
137
|
+
|
|
138
|
+
The React Compiler automatically:
|
|
139
|
+
- Memoizes components that don't need to re-render
|
|
140
|
+
- Optimizes `useMemo` and `useCallback` usage
|
|
141
|
+
- Reduces unnecessary re-renders
|
|
142
|
+
- Improves performance without manual optimization
|
|
143
|
+
|
|
144
|
+
### When to Keep Manual Optimizations
|
|
145
|
+
|
|
146
|
+
You can still use manual `useMemo`/`useCallback` for:
|
|
147
|
+
- Complex dependencies that the compiler can't analyze
|
|
148
|
+
- Performance-critical code where you want explicit control
|
|
149
|
+
- Cases where the compiler optimization doesn't match your needs
|
|
150
|
+
|
|
151
|
+
The compiler will work alongside your manual optimizations.
|
|
152
|
+
|
|
153
|
+
## Verification
|
|
154
|
+
|
|
155
|
+
### Check React Compiler is Working
|
|
156
|
+
|
|
157
|
+
1. Install React DevTools browser extension
|
|
158
|
+
2. Open your app in development mode
|
|
159
|
+
3. Open React DevTools
|
|
160
|
+
4. Look for components with "Memo ✨" badge - these are optimized by the compiler
|
|
161
|
+
|
|
162
|
+
### Build Verification
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Type checking
|
|
166
|
+
npm run type-check
|
|
167
|
+
|
|
168
|
+
# Build
|
|
169
|
+
npm run build
|
|
170
|
+
|
|
171
|
+
# Tests
|
|
172
|
+
npm run test
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Troubleshooting
|
|
176
|
+
|
|
177
|
+
### TypeScript Errors with child.props
|
|
178
|
+
|
|
179
|
+
If you see errors like `'child.props' is of type 'unknown'`, add type assertions:
|
|
180
|
+
|
|
181
|
+
```tsx
|
|
182
|
+
const props = child.props as { [key: string]: unknown };
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### React Compiler Not Working
|
|
186
|
+
|
|
187
|
+
1. Verify `babel-plugin-react-compiler` is installed
|
|
188
|
+
2. Check `vite.config.ts` has the compiler configured
|
|
189
|
+
3. Restart your dev server
|
|
190
|
+
4. Check React DevTools for "Memo ✨" badges
|
|
191
|
+
|
|
192
|
+
### Test Failures
|
|
193
|
+
|
|
194
|
+
If tests fail after upgrading:
|
|
195
|
+
1. Update `@testing-library/react` to latest version
|
|
196
|
+
2. Check for StrictMode-related test issues
|
|
197
|
+
3. Verify error boundaries still work correctly
|
|
198
|
+
|
|
199
|
+
## Rollback Plan
|
|
200
|
+
|
|
201
|
+
If you encounter issues:
|
|
202
|
+
|
|
203
|
+
1. **Disable React Compiler**: Remove from `vite.config.ts`:
|
|
204
|
+
```typescript
|
|
205
|
+
react() // Remove babel config
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
2. **Downgrade React**: Temporarily downgrade to React 18.3.1 if needed
|
|
209
|
+
3. **Report Issues**: Open an issue with details about the problem
|
|
210
|
+
|
|
211
|
+
## Additional Resources
|
|
212
|
+
|
|
213
|
+
- [React 19 Upgrade Guide](https://react.dev/blog/2024/04/25/react-19-upgrade-guide)
|
|
214
|
+
- [React Compiler Documentation](https://react.dev/learn/react-compiler)
|
|
215
|
+
- [PACE Core Installation Guide](../getting-started/installation-guide.md)
|
|
216
|
+
|
|
217
|
+
## Support
|
|
218
|
+
|
|
219
|
+
If you encounter issues migrating to React 19:
|
|
220
|
+
1. Check this guide first
|
|
221
|
+
2. Review [Troubleshooting](../troubleshooting/README.md)
|
|
222
|
+
3. Open an issue on GitHub with:
|
|
223
|
+
- Package version
|
|
224
|
+
- React version
|
|
225
|
+
- Error messages
|
|
226
|
+
- Migration attempt details
|
|
227
|
+
|
|
@@ -260,9 +260,10 @@ The following RPC functions have been updated to use the new table names:
|
|
|
260
260
|
- `app_cake_unit_create` - Now queries `core_events`
|
|
261
261
|
- `app_base_application_create` - Now queries `core_person` and `core_events`
|
|
262
262
|
- `app_pace_contact_update` - Now queries `core_contact`, `core_person`, `core_member`, `core_phone`
|
|
263
|
-
- `set_super_admin_override` - Now queries `core_organisations`
|
|
264
263
|
- `get_organisation_members` - Now uses `core_organisation_memberships` view
|
|
265
264
|
|
|
265
|
+
**Note**: `set_super_admin_override` function has been **removed** (as of migration `20251208133718_remove_super_admin_override_mechanism.sql`). Super admin access is now determined solely by the `is_super_admin()` function in RLS policies. If you were using this function, remove those calls as they are no longer needed or available.
|
|
266
|
+
|
|
266
267
|
**Note**: RPC function signatures have not changed - only internal table references. Your RPC calls should continue to work, but ensure you're using the correct table names in any direct queries.
|
|
267
268
|
|
|
268
269
|
### TypeScript Type Updates
|