@jmruthers/pace-core 0.5.68 → 0.5.69
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/dist/{DataTable-4IUY7BXB.js → DataTable-MPBSXUC6.js} +5 -6
- package/dist/{PublicLoadingSpinner-DdKXTkCZ.d.ts → PublicLoadingSpinner-BOdyU3u-.d.ts} +1 -1
- package/dist/{chunk-PXWEDX7Y.js → chunk-2ARQW6VX.js} +3 -3
- package/dist/{chunk-MOJXHWDE.js → chunk-6JILXFEA.js} +335 -5
- package/dist/chunk-6JILXFEA.js.map +1 -0
- package/dist/{chunk-D7ARGIA3.js → chunk-6RBH67W7.js} +23 -6
- package/dist/chunk-6RBH67W7.js.map +1 -0
- package/dist/{chunk-ZMS23NS5.js → chunk-FJTAWPAQ.js} +3 -5
- package/dist/{chunk-ZMS23NS5.js.map → chunk-FJTAWPAQ.js.map} +1 -1
- package/dist/{chunk-OPCWH3A4.js → chunk-NO5QHMDX.js} +7 -6
- package/dist/chunk-NO5QHMDX.js.map +1 -0
- package/dist/{chunk-ZPK5656W.js → chunk-O3NWNXDY.js} +4 -5
- package/dist/chunk-O3NWNXDY.js.map +1 -0
- package/dist/{chunk-UYA6U6H7.js → chunk-Q2UP3ZWQ.js} +4 -4
- package/dist/{chunk-KRCRNXPD.js → chunk-RVYGJPOD.js} +79 -18
- package/dist/chunk-RVYGJPOD.js.map +1 -0
- package/dist/{chunk-NN45OBIS.js → chunk-UCMHBF7Y.js} +3 -5
- package/dist/{chunk-NN45OBIS.js.map → chunk-UCMHBF7Y.js.map} +1 -1
- package/dist/{chunk-ZPG4XPV5.js → chunk-V3QO3LL7.js} +5 -7
- package/dist/chunk-V3QO3LL7.js.map +1 -0
- package/dist/{chunk-U6GPOF6J.js → chunk-ZXJGZLLO.js} +17 -17
- package/dist/{chunk-U6GPOF6J.js.map → chunk-ZXJGZLLO.js.map} +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +8 -9
- package/dist/components.js.map +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +9 -6
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/providers.js +5 -7
- package/dist/rbac/index.js +5 -6
- package/dist/{usePublicRouteParams-CdoFxnJK.d.ts → usePublicRouteParams-Ua1Vz-HG.d.ts} +35 -1
- package/dist/utils.d.ts +4 -1
- package/dist/utils.js +3 -3
- package/docs/DOCUMENTATION_CHECKLIST.md +281 -0
- package/docs/README.md +22 -10
- 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/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/ButtonProps.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/DataAccessRecord.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/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventContextType.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/EventProviderProps.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.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/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- 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 +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +2 -2
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACContextType.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACProviderProps.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.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/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.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 +1 -1
- 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/UsePublicRouteParamsReturn.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 +39 -14
- package/docs/architecture/services.md +374 -0
- package/docs/best-practices/README.md +1 -1
- package/docs/best-practices/testing.md +1 -1
- package/docs/breaking-changes.md +182 -0
- package/docs/common-patterns.md +445 -0
- package/docs/core-concepts/authentication.md +26 -11
- package/docs/core-concepts/events.md +2 -0
- package/docs/core-concepts/organisations.md +2 -0
- package/docs/core-concepts/permissions.md +2 -0
- package/docs/{INDEX.md → documentation-index.md} +26 -38
- package/docs/faq.md +286 -0
- package/docs/{FILE_REFERENCE_SYSTEM.md → file-reference-system.md} +1 -1
- package/docs/getting-started/installation-guide.md +284 -0
- package/docs/getting-started/quick-start.md +8 -1
- package/docs/implementation-guides/app-layout.md +3 -1
- package/docs/implementation-guides/data-tables.md +2 -0
- package/docs/implementation-guides/dynamic-colors.md +47 -2
- package/docs/implementation-guides/event-theming-summary.md +220 -0
- package/docs/implementation-guides/forms.md +9 -7
- package/docs/implementation-guides/navigation.md +2 -0
- package/docs/migration/service-architecture.md +351 -0
- package/docs/rbac/README-rbac-rls-integration.md +2 -2
- package/docs/rbac/README.md +1 -1
- package/docs/rbac/examples/rbac-rls-integration-example.md +3 -3
- package/docs/rbac/quick-start.md +2 -0
- package/docs/rbac/rbac-rls-integration.md +2 -2
- package/docs/style-guide.md +136 -1
- package/docs/testing/README.md +1 -1
- package/docs/troubleshooting/authentication-issues.md +334 -0
- package/docs/troubleshooting/common-issues.md +2 -0
- package/docs/troubleshooting/styling-issues.md +199 -144
- package/docs/usage.md +23 -2
- package/package.json +1 -1
- package/src/__tests__/{TESTING_GUIDELINES.md → TEST_GUIDE_CURSOR.md} +20 -0
- package/src/__tests__/TEST_GUIDE_HUMAN.md +103 -0
- package/src/__tests__/fixtures/test-data.ts +90 -0
- package/src/__tests__/helpers/__tests__/component-test-utils.test.tsx +260 -0
- package/src/__tests__/helpers/__tests__/optimized-test-setup.test.ts +224 -0
- package/src/__tests__/helpers/__tests__/supabaseMock.test.ts +273 -0
- package/src/__tests__/helpers/__tests__/test-providers.test.tsx +98 -0
- package/src/__tests__/helpers/__tests__/test-utils.test.tsx +436 -0
- package/src/__tests__/helpers/__tests__/timer-utils.test.ts +371 -0
- package/src/__tests__/helpers/component-test-utils.tsx +14 -4
- package/src/__tests__/helpers/optimized-test-setup.ts +68 -0
- package/src/__tests__/helpers/test-providers.tsx +329 -0
- package/src/__tests__/helpers/test-utils.tsx +91 -45
- package/src/__tests__/helpers/timer-utils.ts +71 -0
- package/src/__tests__/hooks/usePermissions.test.ts +1 -5
- package/src/__tests__/integration/UserProfile.test.tsx +1 -5
- package/src/__tests__/rbac/PagePermissionGuard.test.tsx +42 -12
- package/src/__tests__/setup.ts +34 -28
- package/src/components/Alert/Alert.test.tsx +1 -5
- package/src/components/Avatar/Avatar.test.tsx +1 -5
- package/src/components/Button/Button.test.tsx +4 -20
- package/src/components/Card/Card.test.tsx +1 -5
- package/src/components/Checkbox/Checkbox.test.tsx +1 -5
- package/src/components/DataTable/__tests__/DataTable.comprehensive.test.tsx +1 -5
- package/src/components/DataTable/__tests__/DataTable.test.tsx +45 -49
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +1 -5
- package/src/components/DataTable/__tests__/styles.test.ts +382 -0
- package/src/components/DataTable/context/__tests__/DataTableContext.test.tsx +409 -0
- package/src/components/DataTable/core/__tests__/ActionManager.test.ts +634 -0
- package/src/components/DataTable/core/__tests__/DataManager.test.ts +519 -0
- package/src/components/DataTable/core/__tests__/StateManager.test.ts +714 -0
- package/src/components/DataTable/hooks/__tests__/useDataTableState.test.ts +592 -0
- package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +354 -0
- package/src/components/DataTable/utils/__tests__/hierarchicalUtils.test.ts +539 -0
- package/src/components/Dialog/examples/__tests__/SmartDialogExample.unit.test.tsx +1 -5
- package/src/components/Dialog/utils/__tests__/safeHtml.unit.test.ts +1 -8
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +34 -38
- package/src/components/Footer/Footer.test.tsx +1 -5
- package/src/components/Form/Form.test.tsx +22 -35
- package/src/components/Header/Header.test.tsx +1 -9
- package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +1 -5
- package/src/components/Input/Input.test.tsx +2 -10
- package/src/components/LoginForm/LoginForm.test.tsx +1 -5
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +24 -24
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.accessibility.test.tsx +1 -6
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +6 -16
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.performance.test.tsx +1 -5
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +1 -5
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +1 -7
- package/src/components/PasswordReset/PasswordChangeForm.test.tsx +1 -9
- package/src/components/PasswordReset/PasswordResetForm.test.tsx +1 -9
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +4 -5
- package/src/components/PublicLayout/PublicPageHeader.tsx +13 -9
- package/src/components/PublicLayout/__tests__/EventLogo.test.tsx +666 -0
- package/src/components/PublicLayout/__tests__/PublicErrorBoundary.test.tsx +457 -0
- package/src/components/PublicLayout/__tests__/PublicLoadingSpinner.test.tsx +393 -0
- package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +351 -0
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +374 -0
- package/src/components/PublicLayout/__tests__/PublicPageLayout.test.tsx +388 -0
- package/src/components/Select/Select.bug-test.tsx +69 -0
- package/src/components/Select/Select.refactored.tsx +497 -0
- package/src/components/Select/Select.test.tsx +42 -49
- package/src/components/Select/Select.tsx +5 -2
- package/src/components/Select/hooks.ts +254 -0
- package/src/components/Switch/Switch.test.tsx +1 -5
- package/src/components/Table/__tests__/Table.test.tsx +775 -0
- package/src/components/Toast/Toast.test.tsx +15 -8
- package/src/components/Tooltip/Tooltip.test.tsx +1 -5
- package/src/components/UserMenu/UserMenu.test.tsx +3 -15
- package/src/components/__tests__/FileDisplay.test.tsx +575 -0
- package/src/components/__tests__/FileUpload.test.tsx +446 -0
- package/src/components/__tests__/SuperAdminGuard.test.tsx +422 -354
- package/src/hooks/__tests__/ServiceHooks.test.tsx +613 -0
- package/src/hooks/__tests__/hooks.integration.test.tsx +1 -10
- package/src/hooks/__tests__/useApiFetch.unit.test.ts +10 -14
- package/src/hooks/__tests__/useAppConfig.unit.test.ts +307 -0
- package/src/hooks/__tests__/useComponentPerformance.unit.test.tsx +1 -6
- package/src/hooks/__tests__/useFocusTrap.unit.test.tsx +1 -5
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +6 -9
- package/src/hooks/__tests__/usePublicEvent.simple.test.ts +321 -0
- package/src/hooks/__tests__/usePublicEvent.unit.test.ts +583 -0
- package/src/hooks/__tests__/usePublicEventLogo.unit.test.ts +640 -0
- package/src/hooks/__tests__/usePublicRouteParams.unit.test.ts +435 -0
- package/src/hooks/__tests__/useRBAC.unit.test.ts +10 -10
- package/src/hooks/__tests__/useStorage.unit.test.ts +751 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/public/usePublicEvent.ts +30 -9
- package/src/hooks/public/usePublicRouteParams.ts +13 -3
- package/src/hooks/services/useAuth.ts +50 -0
- package/src/hooks/services/useAuthService.ts +30 -0
- package/src/hooks/services/useCurrentEvent.ts +36 -0
- package/src/hooks/services/useCurrentOrganisation.ts +52 -0
- package/src/hooks/services/useEventService.ts +30 -0
- package/src/hooks/services/useInactivityService.ts +30 -0
- package/src/hooks/services/useOrganisationService.ts +30 -0
- package/src/hooks/services/usePermissions.ts +70 -0
- package/src/hooks/services/useRBACService.ts +30 -0
- package/src/hooks/useCounter.test.ts +1 -5
- package/src/hooks/useEventTheme.ts +86 -0
- package/src/hooks/useOrganisationPermissions.test.ts +2 -5
- package/src/hooks/useOrganisationSecurity.test.ts +1 -5
- package/src/hooks/usePermissionCache.test.ts +1 -5
- package/src/hooks/usePermissionCheck.ts +150 -0
- package/src/hooks/useSecureDataAccess.test.ts +1 -5
- package/src/index.ts +1 -0
- package/src/providers/OrganisationProvider.test.tsx +1 -5
- package/src/providers/OrganisationProvider.tsx +56 -4
- package/src/providers/UnifiedAuthProvider.test.tsx +1 -5
- package/src/providers/__tests__/AuthProvider.test.tsx +105 -439
- package/src/providers/__tests__/AuthProvider.test.tsx.backup +771 -0
- package/src/providers/__tests__/EventProvider.test.tsx +211 -110
- package/src/providers/__tests__/EventProvider.test.tsx.backup +824 -0
- package/src/providers/__tests__/InactivityProvider.test.tsx +1 -5
- package/src/providers/__tests__/OrganisationProvider.test.tsx +97 -261
- package/src/providers/__tests__/OrganisationProvider.test.tsx.backup +820 -0
- package/src/providers/__tests__/ServiceProviders.test.tsx +477 -0
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +72 -504
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx.backup +911 -0
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx.backup2 +166 -0
- package/src/providers/services/AuthServiceProvider.tsx +65 -0
- package/src/providers/services/EventServiceProvider.tsx +83 -0
- package/src/providers/services/InactivityServiceProvider.tsx +83 -0
- package/src/providers/services/OrganisationServiceProvider.tsx +77 -0
- package/src/providers/services/RBACServiceProvider.tsx +79 -0
- package/src/providers/services/UnifiedAuthProvider.tsx +368 -0
- package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +210 -0
- package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +269 -0
- package/src/rbac/__tests__/adapters.comprehensive.test.tsx +892 -0
- package/src/rbac/__tests__/engine.comprehensive.test.ts +954 -0
- package/src/rbac/__tests__/integration.authflow.test.tsx +1 -5
- package/src/rbac/__tests__/integration.navigation.test.tsx +1 -4
- package/src/rbac/__tests__/rbac-core.test.tsx +2 -7
- package/src/rbac/__tests__/rbac-functions.test.ts +1 -9
- package/src/rbac/__tests__/rbac-integration.test.ts +1 -9
- package/src/rbac/api.test.ts +1 -9
- package/src/rbac/cache.test.ts +10 -8
- package/src/rbac/cli/__tests__/policy-manager.test.ts +339 -0
- package/src/rbac/components/EnhancedNavigationMenu.test.tsx +1 -5
- package/src/rbac/components/NavigationProvider.test.tsx +1 -5
- package/src/rbac/components/PagePermissionProvider.test.tsx +1 -5
- package/src/rbac/components/SecureDataProvider.test.tsx +1 -5
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +25 -29
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +27 -30
- package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +23 -27
- package/src/rbac/components/__tests__/RoleBasedRouter.test.tsx +18 -22
- package/src/rbac/config.test.ts +1 -5
- package/src/rbac/hooks/useCan.test.ts +262 -9
- package/src/rbac/hooks/usePermissions.test.ts +246 -6
- package/src/rbac/hooks/useRBAC.simple.test.ts +1 -5
- package/src/rbac/hooks/useRBAC.test.ts +472 -198
- package/src/rbac/providers/__tests__/RBACProvider.test.tsx +1 -9
- package/src/services/AuthService.ts +416 -0
- package/src/services/EventService.ts +366 -0
- package/src/services/InactivityService.ts +388 -0
- package/src/services/OrganisationService.ts +592 -0
- package/src/services/RBACService.ts +522 -0
- package/src/services/__tests__/AuthService.test.ts +356 -0
- package/src/services/__tests__/BaseService.test.ts +314 -0
- package/src/services/__tests__/EventService.test.ts +489 -0
- package/src/services/__tests__/InactivityService.test.ts +403 -0
- package/src/services/__tests__/OrganisationService.test.ts +660 -0
- package/src/services/__tests__/RBACService.test.ts +492 -0
- package/src/services/base/BaseService.ts +87 -0
- package/src/services/interfaces/IAuthService.ts +39 -0
- package/src/services/interfaces/IEventService.ts +30 -0
- package/src/services/interfaces/IInactivityService.ts +31 -0
- package/src/services/interfaces/IOrganisationService.ts +41 -0
- package/src/services/interfaces/IRBACService.ts +62 -0
- package/src/theming/__tests__/runtime.test.ts +540 -0
- package/src/types/__tests__/file-reference.test.ts +447 -0
- package/src/types/__tests__/organisation.test.ts +1133 -0
- package/src/types/__tests__/theme.test.ts +830 -0
- package/src/types/__tests__/type-validation.test.ts +527 -0
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +1 -5
- package/src/utils/__tests__/debugLogger.test.ts +417 -0
- package/src/utils/__tests__/deviceFingerprint.unit.test.ts +1 -6
- package/src/utils/__tests__/dynamicUtils.unit.test.ts +1 -5
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +35 -35
- package/src/utils/__tests__/organisationContext.unit.test.ts +1 -5
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +5 -11
- package/src/utils/__tests__/secureErrors.unit.test.ts +1 -6
- package/src/utils/__tests__/secureStorage.unit.test.ts +1 -5
- package/src/utils/__tests__/securityMonitor.unit.test.ts +1 -5
- package/src/utils/__tests__/sessionTracking.unit.test.ts +1 -5
- package/src/utils/appIdResolver.test.ts +6 -10
- package/src/utils/appNameResolver.simple.test.ts +142 -0
- package/src/utils/appNameResolver.test.ts +31 -458
- package/src/utils/appNameResolver.test.ts.backup +494 -0
- package/src/utils/debugLogger.ts +26 -5
- package/src/utils/formatDate.test.ts +1 -5
- package/src/utils/organisationContext.test.ts +1 -5
- package/src/utils/performanceBudgets.ts +3 -4
- package/src/utils/secureDataAccess.test.ts +1 -5
- package/src/utils/storage/__tests__/helpers.unit.test.ts +1 -5
- package/src/validation/__tests__/sqlInjectionProtection.unit.test.ts +1 -5
- package/dist/chunk-D7ARGIA3.js.map +0 -1
- package/dist/chunk-IPCH4YPT.js +0 -315
- package/dist/chunk-IPCH4YPT.js.map +0 -1
- package/dist/chunk-KRCRNXPD.js.map +0 -1
- package/dist/chunk-MOJXHWDE.js.map +0 -1
- package/dist/chunk-OPCWH3A4.js.map +0 -1
- package/dist/chunk-ZPG4XPV5.js.map +0 -1
- package/dist/chunk-ZPK5656W.js.map +0 -1
- package/docs/getting-started/installation.md +0 -269
- package/src/__tests__/REBUILD_PLAN.md +0 -223
- /package/dist/{DataTable-4IUY7BXB.js.map → DataTable-MPBSXUC6.js.map} +0 -0
- /package/dist/{chunk-PXWEDX7Y.js.map → chunk-2ARQW6VX.js.map} +0 -0
- /package/dist/{chunk-UYA6U6H7.js.map → chunk-Q2UP3ZWQ.js.map} +0 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
# Service Architecture Documentation
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The pace-core library now uses a service-based architecture that follows SOLID principles and provides better testability, maintainability, and separation of concerns. This architecture separates business logic into pure TypeScript service classes and provides React integration through providers and hooks.
|
|
6
|
+
|
|
7
|
+
## Architecture Design
|
|
8
|
+
|
|
9
|
+
### Service Layer (Pure TypeScript Classes)
|
|
10
|
+
|
|
11
|
+
The service layer contains pure TypeScript classes that handle business logic without any React dependencies:
|
|
12
|
+
|
|
13
|
+
- **AuthService**: Authentication operations (sign in, sign out, session management)
|
|
14
|
+
- **RBACService**: Role and permission management
|
|
15
|
+
- **OrganisationService**: Organisation management and selection
|
|
16
|
+
- **EventService**: Event management and selection
|
|
17
|
+
- **InactivityService**: User inactivity tracking
|
|
18
|
+
|
|
19
|
+
### Provider Layer (React Context)
|
|
20
|
+
|
|
21
|
+
Each service has its own React provider that:
|
|
22
|
+
- Creates and manages service instances
|
|
23
|
+
- Provides services to React components via context
|
|
24
|
+
- Handles service lifecycle (initialization, cleanup)
|
|
25
|
+
|
|
26
|
+
### Hook Layer (React Integration)
|
|
27
|
+
|
|
28
|
+
Each service has corresponding hooks that:
|
|
29
|
+
- Access services from context
|
|
30
|
+
- Subscribe to service state changes
|
|
31
|
+
- Trigger React re-renders when state changes
|
|
32
|
+
|
|
33
|
+
## Service Interfaces
|
|
34
|
+
|
|
35
|
+
All services implement clear interfaces that define their contracts:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
// Example: AuthService interface
|
|
39
|
+
export interface IAuthService {
|
|
40
|
+
// State getters
|
|
41
|
+
getUser(): User | null;
|
|
42
|
+
getSession(): Session | null;
|
|
43
|
+
isAuthenticated(): boolean;
|
|
44
|
+
isLoading(): boolean;
|
|
45
|
+
getError(): AuthError | null;
|
|
46
|
+
|
|
47
|
+
// Methods
|
|
48
|
+
signIn(email: string, password?: string): Promise<AuthResult>;
|
|
49
|
+
signOut(): Promise<AuthResult>;
|
|
50
|
+
// ... other methods
|
|
51
|
+
|
|
52
|
+
// Lifecycle
|
|
53
|
+
initialize(): Promise<void>;
|
|
54
|
+
cleanup(): void;
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Base Service Class
|
|
59
|
+
|
|
60
|
+
All services extend the `BaseService` class which provides:
|
|
61
|
+
|
|
62
|
+
- **Observable Pattern**: Services can notify subscribers of state changes
|
|
63
|
+
- **Lifecycle Management**: Standardized initialization and cleanup
|
|
64
|
+
- **State Management**: Consistent state update patterns
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
export abstract class BaseService {
|
|
68
|
+
// Subscribe to state changes
|
|
69
|
+
subscribe(callback: StateChangeCallback): () => void;
|
|
70
|
+
|
|
71
|
+
// Notify subscribers of state changes
|
|
72
|
+
protected notify(): void;
|
|
73
|
+
|
|
74
|
+
// Lifecycle methods
|
|
75
|
+
async initialize(): Promise<void>;
|
|
76
|
+
cleanup(): void;
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Usage Examples
|
|
81
|
+
|
|
82
|
+
### Basic Setup
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import { NewUnifiedAuthProvider } from '@core/providers/services/NewUnifiedAuthProvider';
|
|
86
|
+
|
|
87
|
+
function App() {
|
|
88
|
+
return (
|
|
89
|
+
<NewUnifiedAuthProvider
|
|
90
|
+
supabaseClient={supabase}
|
|
91
|
+
appName="MY_APP"
|
|
92
|
+
idleTimeoutMs={30 * 60 * 1000} // 30 minutes
|
|
93
|
+
warnBeforeMs={60 * 1000} // 60 seconds
|
|
94
|
+
onIdleLogout={() => window.location.href = '/login'}
|
|
95
|
+
>
|
|
96
|
+
<YourAppContent />
|
|
97
|
+
</NewUnifiedAuthProvider>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Using Services in Components
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
import { useNewUnifiedAuth } from '@core/providers/services/NewUnifiedAuthProvider';
|
|
106
|
+
|
|
107
|
+
function MyComponent() {
|
|
108
|
+
const auth = useNewUnifiedAuth();
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<div>
|
|
112
|
+
<h1>Welcome, {auth.user?.email}</h1>
|
|
113
|
+
<p>Your role: {auth.roles.join(', ')}</p>
|
|
114
|
+
<p>Organisation: {auth.selectedOrganisation?.display_name}</p>
|
|
115
|
+
<p>Events: {auth.events.length}</p>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Using Individual Service Hooks
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
import { useAuth } from '@core/hooks/services/useAuth';
|
|
125
|
+
import { usePermissions } from '@core/hooks/services/usePermissions';
|
|
126
|
+
import { useCurrentOrganisation } from '@core/hooks/services/useCurrentOrganisation';
|
|
127
|
+
import { useCurrentEvent } from '@core/hooks/services/useCurrentEvent';
|
|
128
|
+
|
|
129
|
+
function MyComponent() {
|
|
130
|
+
const auth = useAuth();
|
|
131
|
+
const permissions = usePermissions();
|
|
132
|
+
const organisation = useCurrentOrganisation();
|
|
133
|
+
const events = useCurrentEvent();
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<div>
|
|
137
|
+
{auth.isAuthenticated && (
|
|
138
|
+
<div>
|
|
139
|
+
<h1>{organisation.selectedOrganisation?.display_name}</h1>
|
|
140
|
+
{permissions.hasPermission('events:read') && (
|
|
141
|
+
<EventList events={events.events} />
|
|
142
|
+
)}
|
|
143
|
+
</div>
|
|
144
|
+
)}
|
|
145
|
+
</div>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Testing
|
|
151
|
+
|
|
152
|
+
### Unit Tests for Services
|
|
153
|
+
|
|
154
|
+
Services are pure TypeScript classes, making them easy to unit test:
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
describe('AuthService', () => {
|
|
158
|
+
let mockSupabase: SupabaseClient;
|
|
159
|
+
let authService: AuthService;
|
|
160
|
+
|
|
161
|
+
beforeEach(() => {
|
|
162
|
+
mockSupabase = createMockSupabaseClient();
|
|
163
|
+
authService = new AuthService(mockSupabase);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it('signs in user successfully', async () => {
|
|
167
|
+
mockSupabase.auth.signInWithPassword.mockResolvedValue({
|
|
168
|
+
data: { user: mockUser, session: mockSession },
|
|
169
|
+
error: null
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
const result = await authService.signIn('test@example.com', 'password');
|
|
173
|
+
|
|
174
|
+
expect(result.user).toEqual(mockUser);
|
|
175
|
+
expect(authService.getUser()).toEqual(mockUser);
|
|
176
|
+
expect(authService.isAuthenticated()).toBe(true);
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Integration Tests for Providers
|
|
182
|
+
|
|
183
|
+
Providers can be tested with React Testing Library:
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
describe('AuthServiceProvider Integration', () => {
|
|
187
|
+
it('provides auth service to components', async () => {
|
|
188
|
+
render(
|
|
189
|
+
<AuthServiceProvider supabaseClient={mockSupabase}>
|
|
190
|
+
<TestComponent />
|
|
191
|
+
</AuthServiceProvider>
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
await waitFor(() => {
|
|
195
|
+
expect(screen.getByTestId('user-id')).toHaveTextContent('test-user-id');
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Benefits
|
|
202
|
+
|
|
203
|
+
### 1. SOLID Principles
|
|
204
|
+
|
|
205
|
+
- **Single Responsibility**: Each service has one clear purpose
|
|
206
|
+
- **Open/Closed**: Easy to extend without modifying existing code
|
|
207
|
+
- **Liskov Substitution**: Services implement clear interfaces
|
|
208
|
+
- **Interface Segregation**: Components depend only on what they need
|
|
209
|
+
- **Dependency Inversion**: Services depend on interfaces, not concrete implementations
|
|
210
|
+
|
|
211
|
+
### 2. Testability
|
|
212
|
+
|
|
213
|
+
- Services are pure TypeScript classes (easy unit testing)
|
|
214
|
+
- No React dependencies in business logic
|
|
215
|
+
- Easy to mock services in tests
|
|
216
|
+
- Clear separation between unit and integration tests
|
|
217
|
+
|
|
218
|
+
### 3. Maintainability
|
|
219
|
+
|
|
220
|
+
- Clear service boundaries
|
|
221
|
+
- Easy to understand and reason about
|
|
222
|
+
- Easy to add new services
|
|
223
|
+
- Easy to modify existing services
|
|
224
|
+
|
|
225
|
+
### 4. Performance
|
|
226
|
+
|
|
227
|
+
- Services instantiated once and reused
|
|
228
|
+
- Efficient state updates via observable pattern
|
|
229
|
+
- No unnecessary re-renders
|
|
230
|
+
|
|
231
|
+
### 5. Type Safety
|
|
232
|
+
|
|
233
|
+
- Full TypeScript support
|
|
234
|
+
- Clear interfaces for all services
|
|
235
|
+
- Type-safe method calls
|
|
236
|
+
|
|
237
|
+
## Migration Guide
|
|
238
|
+
|
|
239
|
+
### From Old Architecture
|
|
240
|
+
|
|
241
|
+
The new architecture provides backward compatibility through the `NewUnifiedAuthProvider` which maintains the same API as the old `UnifiedAuthProvider`:
|
|
242
|
+
|
|
243
|
+
```tsx
|
|
244
|
+
// Old way
|
|
245
|
+
import { UnifiedAuthProvider } from '@core/providers';
|
|
246
|
+
|
|
247
|
+
// New way
|
|
248
|
+
import { NewUnifiedAuthProvider } from '@core/providers/services/NewUnifiedAuthProvider';
|
|
249
|
+
|
|
250
|
+
// Same API, better architecture
|
|
251
|
+
<NewUnifiedAuthProvider
|
|
252
|
+
supabaseClient={supabase}
|
|
253
|
+
appName="MY_APP"
|
|
254
|
+
idleTimeoutMs={30 * 60 * 1000}
|
|
255
|
+
warnBeforeMs={60 * 1000}
|
|
256
|
+
onIdleLogout={() => window.location.href = '/login'}
|
|
257
|
+
>
|
|
258
|
+
<YourAppContent />
|
|
259
|
+
</NewUnifiedAuthProvider>
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Gradual Migration
|
|
263
|
+
|
|
264
|
+
You can migrate gradually by:
|
|
265
|
+
|
|
266
|
+
1. **Start with new apps**: Use `NewUnifiedAuthProvider` for new applications
|
|
267
|
+
2. **Migrate existing apps**: Replace `UnifiedAuthProvider` with `NewUnifiedAuthProvider`
|
|
268
|
+
3. **Use individual services**: Gradually move to individual service hooks for better performance
|
|
269
|
+
4. **Remove old providers**: Once migration is complete, remove old provider imports
|
|
270
|
+
|
|
271
|
+
## File Structure
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
packages/core/src/
|
|
275
|
+
├── services/
|
|
276
|
+
│ ├── interfaces/
|
|
277
|
+
│ │ ├── IAuthService.ts
|
|
278
|
+
│ │ ├── IRBACService.ts
|
|
279
|
+
│ │ ├── IOrganisationService.ts
|
|
280
|
+
│ │ ├── IEventService.ts
|
|
281
|
+
│ │ └── IInactivityService.ts
|
|
282
|
+
│ ├── base/
|
|
283
|
+
│ │ └── BaseService.ts
|
|
284
|
+
│ ├── AuthService.ts
|
|
285
|
+
│ ├── RBACService.ts
|
|
286
|
+
│ ├── OrganisationService.ts
|
|
287
|
+
│ ├── EventService.ts
|
|
288
|
+
│ ├── InactivityService.ts
|
|
289
|
+
│ └── __tests__/
|
|
290
|
+
│ ├── AuthService.test.ts
|
|
291
|
+
│ └── RBACService.test.ts
|
|
292
|
+
├── providers/
|
|
293
|
+
│ └── services/
|
|
294
|
+
│ ├── AuthServiceProvider.tsx
|
|
295
|
+
│ ├── RBACServiceProvider.tsx
|
|
296
|
+
│ ├── OrganisationServiceProvider.tsx
|
|
297
|
+
│ ├── EventServiceProvider.tsx
|
|
298
|
+
│ ├── InactivityServiceProvider.tsx
|
|
299
|
+
│ ├── NewUnifiedAuthProvider.tsx
|
|
300
|
+
│ └── __tests__/
|
|
301
|
+
│ ├── AuthServiceProvider.integration.test.tsx
|
|
302
|
+
│ └── NewUnifiedAuthProvider.integration.test.tsx
|
|
303
|
+
└── hooks/
|
|
304
|
+
└── services/
|
|
305
|
+
├── useAuthService.ts
|
|
306
|
+
├── useRBACService.ts
|
|
307
|
+
├── useOrganisationService.ts
|
|
308
|
+
├── useEventService.ts
|
|
309
|
+
├── useInactivityService.ts
|
|
310
|
+
├── useAuth.ts
|
|
311
|
+
├── usePermissions.ts
|
|
312
|
+
├── useCurrentOrganisation.ts
|
|
313
|
+
└── useCurrentEvent.ts
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Best Practices
|
|
317
|
+
|
|
318
|
+
### 1. Service Usage
|
|
319
|
+
|
|
320
|
+
- Use individual service hooks for better performance
|
|
321
|
+
- Use convenience hooks for common patterns
|
|
322
|
+
- Use the unified provider for backward compatibility
|
|
323
|
+
|
|
324
|
+
### 2. Testing
|
|
325
|
+
|
|
326
|
+
- Write unit tests for services
|
|
327
|
+
- Write integration tests for providers
|
|
328
|
+
- Mock services in component tests
|
|
329
|
+
|
|
330
|
+
### 3. Error Handling
|
|
331
|
+
|
|
332
|
+
- Services handle their own errors
|
|
333
|
+
- Providers expose error states
|
|
334
|
+
- Components handle error display
|
|
335
|
+
|
|
336
|
+
### 4. State Management
|
|
337
|
+
|
|
338
|
+
- Services manage their own state
|
|
339
|
+
- Use the observable pattern for updates
|
|
340
|
+
- Avoid direct state manipulation
|
|
341
|
+
|
|
342
|
+
## Troubleshooting
|
|
343
|
+
|
|
344
|
+
### Common Issues
|
|
345
|
+
|
|
346
|
+
1. **Service not initialized**: Ensure the service is properly initialized in the provider
|
|
347
|
+
2. **State not updating**: Check that components are subscribed to service changes
|
|
348
|
+
3. **Memory leaks**: Ensure services are properly cleaned up on unmount
|
|
349
|
+
4. **Test failures**: Mock services properly in tests
|
|
350
|
+
|
|
351
|
+
### Debug Tips
|
|
352
|
+
|
|
353
|
+
1. **Check service state**: Use service getters to inspect current state
|
|
354
|
+
2. **Verify subscriptions**: Ensure components are subscribed to service changes
|
|
355
|
+
3. **Check provider setup**: Verify all required providers are present
|
|
356
|
+
4. **Inspect errors**: Check service error states for debugging information
|
|
357
|
+
|
|
358
|
+
## Future Enhancements
|
|
359
|
+
|
|
360
|
+
### Planned Features
|
|
361
|
+
|
|
362
|
+
1. **Service Middleware**: Add middleware support for cross-cutting concerns
|
|
363
|
+
2. **Service Composition**: Better service composition patterns
|
|
364
|
+
3. **Performance Monitoring**: Add performance monitoring to services
|
|
365
|
+
4. **Service Registry**: Centralized service registration and discovery
|
|
366
|
+
|
|
367
|
+
### Contributing
|
|
368
|
+
|
|
369
|
+
When contributing to the service architecture:
|
|
370
|
+
|
|
371
|
+
1. **Follow interfaces**: Always implement service interfaces
|
|
372
|
+
2. **Write tests**: Include unit and integration tests
|
|
373
|
+
3. **Document changes**: Update documentation for new features
|
|
374
|
+
4. **Maintain compatibility**: Ensure backward compatibility when possible
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# PACE Core Breaking Changes
|
|
2
|
+
|
|
3
|
+
> **📢 Important**: This document tracks all breaking changes in PACE Core.
|
|
4
|
+
> **Check this file** before upgrading to a new major version.
|
|
5
|
+
|
|
6
|
+
## Recent Breaking Changes
|
|
7
|
+
|
|
8
|
+
### v0.5.65+ - Mandatory Inactivity Timeouts
|
|
9
|
+
|
|
10
|
+
**Status**: ⚠️ **BREAKING CHANGE**
|
|
11
|
+
**Date**: January 2025
|
|
12
|
+
**Impact**: High - Affects all apps using `UnifiedAuthProvider`
|
|
13
|
+
|
|
14
|
+
#### What Changed
|
|
15
|
+
|
|
16
|
+
The `UnifiedAuthProvider` now requires mandatory inactivity timeout configuration. These props were previously optional but are now required for security and TypeScript compliance.
|
|
17
|
+
|
|
18
|
+
#### Before (Old Code)
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
// ❌ This will now cause TypeScript errors
|
|
22
|
+
<UnifiedAuthProvider supabaseClient={supabase} appName="my-app">
|
|
23
|
+
<App />
|
|
24
|
+
</UnifiedAuthProvider>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### After (New Code)
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
// ✅ Required configuration
|
|
31
|
+
<UnifiedAuthProvider
|
|
32
|
+
supabaseClient={supabase}
|
|
33
|
+
appName="my-app"
|
|
34
|
+
idleTimeoutMs={30 * 60 * 1000} // Required: 30 minutes
|
|
35
|
+
warnBeforeMs={5 * 60 * 1000} // Required: 5 minutes warning
|
|
36
|
+
onIdleLogout={() => window.location.href = '/login'} // Required
|
|
37
|
+
>
|
|
38
|
+
<App />
|
|
39
|
+
</UnifiedAuthProvider>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### Required Props
|
|
43
|
+
|
|
44
|
+
| Prop | Type | Required | Description |
|
|
45
|
+
|------|------|----------|-------------|
|
|
46
|
+
| `idleTimeoutMs` | `number` | ✅ Yes | Idle timeout in milliseconds |
|
|
47
|
+
| `warnBeforeMs` | `number` | ✅ Yes | Warning before logout in milliseconds |
|
|
48
|
+
| `onIdleLogout` | `() => void` | ✅ Yes | Callback when user is logged out |
|
|
49
|
+
|
|
50
|
+
#### Migration Steps
|
|
51
|
+
|
|
52
|
+
1. **Identify all UnifiedAuthProvider instances** in your codebase
|
|
53
|
+
2. **Add the three required props** to each instance
|
|
54
|
+
3. **Choose appropriate timeout values** for your application
|
|
55
|
+
4. **Test the inactivity warning and logout flow**
|
|
56
|
+
|
|
57
|
+
#### Migration Guide
|
|
58
|
+
|
|
59
|
+
See the complete [Migration Guide](./migration-guides/unified-auth-provider-mandatory-timeouts.md) for detailed instructions.
|
|
60
|
+
|
|
61
|
+
#### Why This Change
|
|
62
|
+
|
|
63
|
+
This breaking change was made for security reasons:
|
|
64
|
+
- Ensures all apps have automatic logout functionality
|
|
65
|
+
- Prevents security vulnerabilities from idle sessions
|
|
66
|
+
- Provides consistent user experience across all apps
|
|
67
|
+
- Improves overall security posture
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
### v2.0.0 - Service Architecture Changes
|
|
72
|
+
|
|
73
|
+
**Status**: ⚠️ **BREAKING CHANGE**
|
|
74
|
+
**Date**: December 2024
|
|
75
|
+
**Impact**: Medium - Affects apps using service architecture
|
|
76
|
+
|
|
77
|
+
#### What Changed
|
|
78
|
+
|
|
79
|
+
The library now uses a service-based architecture with pure TypeScript service classes and React integration through providers and hooks.
|
|
80
|
+
|
|
81
|
+
#### Key Changes
|
|
82
|
+
|
|
83
|
+
- ✅ **New Service Layer**: Pure TypeScript classes for business logic
|
|
84
|
+
- ✅ **Provider Layer**: React context integration for services
|
|
85
|
+
- ✅ **Hook Layer**: Reactive hooks for component integration
|
|
86
|
+
- ✅ **Backward Compatible**: `UnifiedAuthProvider` maintained for compatibility
|
|
87
|
+
|
|
88
|
+
#### Migration
|
|
89
|
+
|
|
90
|
+
Migration is optional. Existing code continues to work. To adopt new architecture:
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
// Old way (still works)
|
|
94
|
+
import { UnifiedAuthProvider } from '@jmruthers/pace-core';
|
|
95
|
+
|
|
96
|
+
// New way (optional)
|
|
97
|
+
import { NewUnifiedAuthProvider } from '@core/providers/services/NewUnifiedAuthProvider';
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
See [Service Architecture Guide](./architecture/services.md) for details.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Version History
|
|
105
|
+
|
|
106
|
+
### v0.5.65+
|
|
107
|
+
- ⚠️ Mandatory inactivity timeouts in UnifiedAuthProvider
|
|
108
|
+
- ⚠️ Breaking TypeScript interface changes
|
|
109
|
+
|
|
110
|
+
### v2.0.0
|
|
111
|
+
- ⚠️ Service architecture introduced (backward compatible)
|
|
112
|
+
- ⚠️ New provider patterns available
|
|
113
|
+
|
|
114
|
+
### v0.4.17
|
|
115
|
+
- ⚠️ Source path fixes for Tailwind scanning
|
|
116
|
+
- Migration guide: [v0.4.17 Source Path Fix](./migration/v0.4.17-source-path-fix.md)
|
|
117
|
+
|
|
118
|
+
### v0.4.16
|
|
119
|
+
- ⚠️ CSS-first approach for Tailwind v4
|
|
120
|
+
- Migration guide: [CSS-First Migration](./migration/v0.4.16-css-first-approach.md)
|
|
121
|
+
|
|
122
|
+
### v0.4.15
|
|
123
|
+
- ⚠️ Tailwind content scanning requirements
|
|
124
|
+
- Migration guide: [Tailwind Scanning](./migration/v0.4.15-tailwind-scanning.md)
|
|
125
|
+
|
|
126
|
+
## Checking for Breaking Changes
|
|
127
|
+
|
|
128
|
+
### Before Upgrading
|
|
129
|
+
|
|
130
|
+
1. **Check this file** for breaking changes in your target version
|
|
131
|
+
2. **Review migration guides** for each breaking change
|
|
132
|
+
3. **Test in development environment** before production
|
|
133
|
+
4. **Update TypeScript** to catch type errors early
|
|
134
|
+
|
|
135
|
+
### Finding Your Current Version
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npm list @jmruthers/pace-core
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Or check your `package.json`:
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"dependencies": {
|
|
145
|
+
"@jmruthers/pace-core": "^0.5.65"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Migration Resources
|
|
151
|
+
|
|
152
|
+
- [Unified Migration Guide](./migration/MIGRATION_GUIDE.md)
|
|
153
|
+
- [Service Architecture Migration](./migration/service-architecture.md)
|
|
154
|
+
- [RBAC Migration](./migration/rbac-migration.md)
|
|
155
|
+
- [All Migration Guides](./migration/)
|
|
156
|
+
|
|
157
|
+
## Getting Help
|
|
158
|
+
|
|
159
|
+
If you encounter issues during migration:
|
|
160
|
+
|
|
161
|
+
1. Check the specific migration guide for your breaking change
|
|
162
|
+
2. Review [Troubleshooting](./troubleshooting/common-issues.md)
|
|
163
|
+
3. See [Common Issues](./troubleshooting/common-issues.md)
|
|
164
|
+
4. File an issue with version and error details
|
|
165
|
+
|
|
166
|
+
## Staying Updated
|
|
167
|
+
|
|
168
|
+
To stay informed about breaking changes:
|
|
169
|
+
|
|
170
|
+
- 📢 **Check this file** before each upgrade
|
|
171
|
+
- 📢 **Review release notes** on GitHub
|
|
172
|
+
- 📢 **Subscribe to notifications** for major versions
|
|
173
|
+
- 📢 **Follow migration guides** step-by-step
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
**Remember**: Always test breaking changes in a development environment before deploying to production.
|
|
178
|
+
|
|
179
|
+
**Last Updated**: January 2025
|
|
180
|
+
**Current Stable Version**: v0.5.65+
|
|
181
|
+
**Next Major Version**: v1.0.0 (TBD)
|
|
182
|
+
|