@jmruthers/pace-core 0.5.53 → 0.5.55
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/README.md +0 -4
- package/dist/{DataTable-7FMFXA7A.js → DataTable-4T627QFJ.js} +11 -11
- package/dist/{PublicLoadingSpinner-Bq_-BeK-.d.ts → PublicLoadingSpinner-SL8WaQN7.d.ts} +2 -21
- package/dist/{api-H5A3H4IR.js → api-LUNF5O6M.js} +3 -3
- package/dist/{appConfig-BVGyuvI7.d.ts → appConfig-DjpeG6P-.d.ts} +9 -1
- package/dist/{appNameResolver-7GHF5ED2.js → appNameResolver-UURKN7NF.js} +2 -2
- package/dist/{audit-BUW3LMJB.js → audit-6TOCAMKO.js} +2 -2
- package/dist/{chunk-MZBUOP4P.js → chunk-5BSLGBYI.js} +4 -3
- package/dist/chunk-5BSLGBYI.js.map +1 -0
- package/dist/{chunk-I5Z3QH5X.js → chunk-66C4BSAY.js} +2 -2
- package/dist/{chunk-I5Z3QH5X.js.map → chunk-66C4BSAY.js.map} +1 -1
- package/dist/{chunk-MYP2EGHX.js → chunk-AJ2KMES7.js} +21 -14
- package/dist/chunk-AJ2KMES7.js.map +1 -0
- package/dist/{chunk-EL2O4IUX.js → chunk-AQFRLC7K.js} +16 -24
- package/dist/{chunk-EL2O4IUX.js.map → chunk-AQFRLC7K.js.map} +1 -1
- package/dist/{chunk-7BNPOCLL.js → chunk-B2WTCLCV.js} +6 -2
- package/dist/chunk-B2WTCLCV.js.map +1 -0
- package/dist/{chunk-WJARTBCT.js → chunk-D7ARGIA3.js} +16 -7
- package/dist/chunk-D7ARGIA3.js.map +1 -0
- package/dist/{chunk-NRK4AIHQ.js → chunk-KBRACSJI.js} +3 -3
- package/dist/{chunk-NYUJ4FJR.js → chunk-KJDPSM64.js} +7 -7
- package/dist/chunk-KJDPSM64.js.map +1 -0
- package/dist/{chunk-GWSBHC4J.js → chunk-KLPVOPRI.js} +261 -38
- package/dist/chunk-KLPVOPRI.js.map +1 -0
- package/dist/{chunk-TRIZ7IB7.js → chunk-MPQDF75X.js} +148 -288
- package/dist/chunk-MPQDF75X.js.map +1 -0
- package/dist/{chunk-MSFACPQQ.js → chunk-PAEM3OWN.js} +11 -11
- package/dist/{chunk-MSFACPQQ.js.map → chunk-PAEM3OWN.js.map} +1 -1
- package/dist/{chunk-GIO7BFE7.js → chunk-RQD3D2CO.js} +66 -169
- package/dist/{chunk-GIO7BFE7.js.map → chunk-RQD3D2CO.js.map} +1 -1
- package/dist/{chunk-YDJW5XTN.js → chunk-STT7INZR.js} +25 -1
- package/dist/chunk-STT7INZR.js.map +1 -0
- package/dist/{chunk-6MTY77WU.js → chunk-TNMXZLDR.js} +3 -3
- package/dist/{chunk-BC3S53OZ.js → chunk-UQE2Y64H.js} +30 -14
- package/dist/chunk-UQE2Y64H.js.map +1 -0
- package/dist/{chunk-22KLBHPS.js → chunk-W66AZIOH.js} +2 -2
- package/dist/chunk-W66AZIOH.js.map +1 -0
- package/dist/{chunk-SS3E6QLB.js → chunk-YNUBMSMV.js} +2 -2
- package/dist/chunk-YNUBMSMV.js.map +1 -0
- package/dist/{chunk-NZ655MWE.js → chunk-ZOD2ZY6X.js} +5 -4
- package/dist/chunk-ZOD2ZY6X.js.map +1 -0
- package/dist/{chunk-74C6SNEC.js → chunk-ZPK5656W.js} +3 -3
- package/dist/{chunk-74C6SNEC.js.map → chunk-ZPK5656W.js.map} +1 -1
- package/dist/components.d.ts +22 -899
- package/dist/components.js +436 -3118
- package/dist/components.js.map +1 -1
- package/dist/file-reference-9xUOnwyt.d.ts +70 -0
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +10 -10
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +49 -9
- package/dist/index.js +190 -25
- package/dist/index.js.map +1 -1
- package/dist/{organisation-CO3Sh3_D.d.ts → organisation-t-vvQC3g.d.ts} +1 -8
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +5 -5
- package/dist/rbac/index.d.ts +65 -46
- package/dist/rbac/index.js +10 -12
- package/dist/styles/core.css +0 -125
- package/dist/types.d.ts +2 -1
- package/dist/types.js +3 -1
- package/dist/types.js.map +1 -1
- package/dist/{usePublicRouteParams-B2OcAsur.d.ts → usePublicRouteParams-CdoFxnJK.d.ts} +1 -1
- package/dist/utils.d.ts +3 -4
- package/dist/utils.js +44 -13
- package/dist/utils.js.map +1 -1
- package/docs/FILE_REFERENCE_SYSTEM.md +440 -0
- package/docs/INDEX.md +7 -5
- package/docs/README.md +0 -1
- package/docs/api/README.md +0 -4
- 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 +2 -2
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +12 -12
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +6 -6
- 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 +281 -0
- 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 +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 +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +4 -4
- 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 +1 -1
- 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 +2 -2
- package/docs/api/interfaces/RouteConfig.md +2 -2
- 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/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 +204 -200
- package/docs/api-reference/components.md +141 -163
- package/docs/api-reference/hooks.md +347 -0
- package/docs/core-concepts/rbac-system.md +69 -16
- package/docs/getting-started/examples/basic-auth-app.md +0 -1
- package/docs/implementation-guides/datatable-rbac-usage.md +12 -11
- package/docs/implementation-guides/file-upload-storage.md +733 -0
- package/docs/implementation-guides/inactivity-tracking.md +779 -0
- package/docs/implementation-guides/organisation-security.md +748 -0
- package/docs/implementation-guides/public-pages-advanced.md +1022 -0
- package/docs/migration/MIGRATION_GUIDE.md +684 -0
- package/docs/migration/README.md +13 -2
- package/docs/migration/rbac-migration.md +73 -0
- package/docs/rbac/examples/rbac-rls-integration-example.md +11 -13
- package/docs/style-guide.md +269 -1
- package/package.json +1 -1
- package/src/__tests__/TESTING_GUIDELINES.md +331 -18
- package/src/__tests__/helpers/supabaseMock.ts +99 -0
- package/src/__tests__/rbac/PagePermissionGuard.test.tsx +10 -7
- package/src/__tests__/shared.ts +6 -0
- package/src/components/DataTable/components/ActionButtons.tsx +2 -2
- package/src/components/DataTable/components/DataTableCore.tsx +2 -2
- package/src/components/DataTable/components/UnifiedTableBody.tsx +1 -1
- package/src/components/DataTable/utils/debugTools.ts +2 -2
- package/src/components/Dialog/Dialog.test.tsx +12 -2
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +6 -6
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +2 -2
- package/src/components/FileDisplay.tsx +233 -0
- package/src/components/FileUpload.tsx +176 -0
- package/src/components/Footer/Footer.test.tsx +7 -7
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +13 -6
- package/src/components/OrganisationSelector/OrganisationSelector.test.tsx +30 -3
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +1 -1
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +558 -0
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +1 -1
- package/src/components/PublicLayout/PublicPageDebugger.tsx +2 -2
- package/src/components/PublicLayout/PublicPageDiagnostic.tsx +2 -2
- package/src/components/PublicLayout/PublicPageProvider.tsx +2 -2
- package/src/components/Select/Select.test.tsx +50 -15
- package/src/components/SuperAdminGuard.tsx +2 -2
- package/src/components/__tests__/SuperAdminGuard.test.tsx +559 -0
- package/src/components/index.ts +0 -183
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +2 -2
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +1 -1
- package/src/hooks/__tests__/useRBAC.unit.test.ts +191 -138
- package/src/hooks/public/usePublicEvent.ts +2 -2
- package/src/hooks/useAppConfig.ts +3 -3
- package/src/hooks/useComponentPerformance.ts +1 -1
- package/src/hooks/useDataTablePerformance.ts +1 -1
- package/src/hooks/useFileReference.ts +232 -0
- package/src/hooks/useOrganisationPermissions.test.ts +254 -344
- package/src/hooks/useOrganisationPermissions.ts +15 -7
- package/src/hooks/useOrganisationSecurity.test.ts +390 -402
- package/src/hooks/usePerformanceMonitor.ts +1 -1
- package/src/hooks/usePermissionCache.test.ts +264 -395
- package/src/hooks/usePermissionCache.ts +34 -4
- package/src/hooks/useSecureDataAccess.test.ts +486 -0
- package/src/hooks/useSecureDataAccess.ts +4 -1
- package/src/providers/InactivityProvider.tsx +2 -2
- package/src/providers/OrganisationProvider.test.simple.tsx +168 -0
- package/src/providers/OrganisationProvider.test.tsx +168 -0
- package/src/providers/OrganisationProvider.tsx +18 -31
- package/src/providers/UnifiedAuthProvider.test.simple.tsx +205 -0
- package/src/providers/UnifiedAuthProvider.test.tsx +128 -0
- package/src/providers/__tests__/InactivityProvider.test.tsx +3 -4
- package/src/providers/__tests__/OrganisationProvider.test.tsx +19 -14
- package/src/rbac/__tests__/integration.authflow.test.tsx +123 -0
- package/src/rbac/__tests__/integration.navigation.test.tsx +72 -0
- package/src/rbac/__tests__/integration.securedata.test.tsx +92 -0
- package/src/rbac/__tests__/integration.smoke.test.tsx +73 -0
- package/src/rbac/__tests__/rbac-core.test.tsx +26 -22
- package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +411 -0
- package/src/rbac/__tests__/rbac-engine-simplified.test.ts +285 -0
- package/src/rbac/__tests__/rbac-functions.test.ts +655 -0
- package/src/rbac/__tests__/rbac-integration.test.ts +532 -0
- package/src/rbac/__tests__/scenarios.user-role.test.tsx +196 -0
- package/src/rbac/api.test.ts +6 -6
- package/src/rbac/api.ts +2 -2
- package/src/rbac/audit.test.ts +485 -0
- package/src/rbac/audit.ts +7 -1
- package/src/rbac/cache-invalidation.ts +318 -0
- package/src/rbac/cache.test.ts +286 -0
- package/src/rbac/components/EnhancedNavigationMenu.test.tsx +559 -0
- package/src/rbac/components/EnhancedNavigationMenu.tsx +29 -23
- package/src/rbac/components/NavigationProvider.test.tsx +449 -0
- package/src/rbac/components/PagePermissionGuard.tsx +4 -4
- package/src/rbac/components/PagePermissionProvider.test.tsx +479 -0
- package/src/rbac/components/SecureDataProvider.test.tsx +511 -0
- package/src/rbac/components/__tests__/PagePermissionGuard.race-condition.test.tsx +159 -430
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +4 -5
- package/src/rbac/components/__tests__/PagePermissionGuard.verification.test.tsx +112 -118
- package/src/rbac/config.test.ts +410 -0
- package/src/rbac/engine.test.simple.ts +237 -0
- package/src/rbac/engine.test.ts +233 -0
- package/src/rbac/engine.ts +37 -41
- package/src/rbac/examples/CompleteRBACExample.tsx +3 -3
- package/src/rbac/examples/EventBasedApp.tsx +4 -4
- package/src/rbac/hooks/useRBAC.simple.test.ts +16 -0
- package/src/rbac/hooks/useRBAC.test.ts +207 -455
- package/src/rbac/hooks/useRBAC.ts +30 -22
- package/src/rbac/permissions.test.ts +128 -0
- package/src/rbac/permissions.ts +56 -141
- package/src/rbac/providers/RBACProvider.tsx +1 -1
- package/src/rbac/secureClient.test.ts +444 -0
- package/src/rbac/security.test.ts +390 -0
- package/src/rbac/security.ts +1 -1
- package/src/rbac/types.test.ts +382 -0
- package/src/rbac/types.ts +2 -2
- package/src/styles/base.css +208 -0
- package/src/styles/core.css +0 -125
- package/src/styles/semantic.css +24 -0
- package/src/types/file-reference.ts +77 -0
- package/src/types/rbac-functions.ts +290 -0
- package/src/types/supabase.ts +10 -28
- package/src/types/unified.ts +4 -1
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +81 -55
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +21 -12
- package/src/utils/__tests__/organisationContext.unit.test.ts +13 -7
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +3 -3
- package/src/utils/__tests__/sessionTracking.unit.test.ts +32 -12
- package/src/utils/appConfig.ts +1 -1
- package/src/utils/appIdResolver.test.ts +503 -0
- package/src/utils/appIdResolver.ts +1 -1
- package/src/utils/appNameResolver.test.ts +494 -0
- package/src/utils/appNameResolver.ts +3 -2
- package/src/utils/bundleAnalysis.ts +3 -3
- package/src/utils/debugLogger.ts +1 -1
- package/src/utils/file-reference.ts +263 -0
- package/src/utils/formatDate.test.ts +2 -2
- package/src/utils/organisationContext.test.ts +340 -0
- package/src/utils/organisationContext.ts +19 -6
- package/src/utils/performanceBudgets.ts +2 -2
- package/src/utils/permissionUtils.test.ts +393 -0
- package/src/utils/permissionUtils.ts +5 -2
- package/src/utils/secureDataAccess.test.ts +715 -0
- package/src/utils/secureDataAccess.ts +21 -5
- package/src/utils/sessionTracking.ts +34 -4
- package/src/utils/storage/__tests__/helpers.unit.test.ts +328 -0
- package/src/utils/storage/__tests__/index.unit.test.ts +16 -0
- package/src/utils/storage/helpers.ts +20 -25
- package/src/utils/storage/index.ts +29 -1
- package/src/vite-env.d.ts +17 -0
- package/dist/chunk-22KLBHPS.js.map +0 -1
- package/dist/chunk-7BNPOCLL.js.map +0 -1
- package/dist/chunk-BC3S53OZ.js.map +0 -1
- package/dist/chunk-GWSBHC4J.js.map +0 -1
- package/dist/chunk-MYP2EGHX.js.map +0 -1
- package/dist/chunk-MZBUOP4P.js.map +0 -1
- package/dist/chunk-NYUJ4FJR.js.map +0 -1
- package/dist/chunk-NZ655MWE.js.map +0 -1
- package/dist/chunk-SS3E6QLB.js.map +0 -1
- package/dist/chunk-TRIZ7IB7.js.map +0 -1
- package/dist/chunk-WJARTBCT.js.map +0 -1
- package/dist/chunk-YDJW5XTN.js.map +0 -1
- package/docs/print-components/README.md +0 -258
- package/docs/print-components/api-reference.md +0 -636
- package/docs/print-components/examples/README.md +0 -204
- package/docs/print-components/examples/basic-report.tsx +0 -92
- package/docs/print-components/examples/card-catalog.tsx +0 -149
- package/docs/print-components/examples/cover-page-report.tsx +0 -163
- package/docs/print-components/quick-start.md +0 -363
- package/src/components/PrintButton/PrintButton.tsx +0 -321
- package/src/components/PrintButton/PrintButtonGroup.tsx +0 -84
- package/src/components/PrintButton/PrintToolbar.tsx +0 -94
- package/src/components/PrintButton/__tests__/PrintButton.test.tsx +0 -271
- package/src/components/PrintButton/examples/PrintButtonShowcase.tsx +0 -438
- package/src/components/PrintButton/index.ts +0 -33
- package/src/components/PrintButton/types.ts +0 -173
- package/src/components/PrintCard/PrintCard.tsx +0 -154
- package/src/components/PrintCard/PrintCardContent.tsx +0 -57
- package/src/components/PrintCard/PrintCardFooter.tsx +0 -60
- package/src/components/PrintCard/PrintCardGrid.tsx +0 -91
- package/src/components/PrintCard/PrintCardHeader.tsx +0 -78
- package/src/components/PrintCard/PrintCardImage.tsx +0 -81
- package/src/components/PrintCard/examples/PrintCardShowcase.tsx +0 -239
- package/src/components/PrintCard/index.ts +0 -34
- package/src/components/PrintCard/types.ts +0 -171
- package/src/components/PrintDataTable/PrintDataTable.tsx +0 -215
- package/src/components/PrintDataTable/PrintTableGroup.tsx +0 -90
- package/src/components/PrintDataTable/PrintTableRow.tsx +0 -76
- package/src/components/PrintDataTable/index.ts +0 -25
- package/src/components/PrintDataTable/types.ts +0 -67
- package/src/components/PrintFooter/PrintFooter.tsx +0 -183
- package/src/components/PrintFooter/PrintFooterContent.tsx +0 -71
- package/src/components/PrintFooter/PrintFooterInfo.tsx +0 -86
- package/src/components/PrintFooter/PrintPageNumber.tsx +0 -90
- package/src/components/PrintFooter/examples/PrintFooterShowcase.tsx +0 -390
- package/src/components/PrintFooter/index.ts +0 -30
- package/src/components/PrintFooter/types.ts +0 -149
- package/src/components/PrintGrid/PrintGrid.tsx +0 -180
- package/src/components/PrintGrid/PrintGridBreakpoint.tsx +0 -109
- package/src/components/PrintGrid/PrintGridContainer.tsx +0 -128
- package/src/components/PrintGrid/PrintGridItem.tsx +0 -220
- package/src/components/PrintGrid/examples/PrintGridShowcase.tsx +0 -359
- package/src/components/PrintGrid/index.ts +0 -31
- package/src/components/PrintGrid/types.ts +0 -159
- package/src/components/PrintHeader/PrintCoverHeader.tsx +0 -230
- package/src/components/PrintHeader/PrintHeader.tsx +0 -150
- package/src/components/PrintHeader/index.ts +0 -17
- package/src/components/PrintHeader/types.ts +0 -42
- package/src/components/PrintLayout/PrintLayout.tsx +0 -122
- package/src/components/PrintLayout/PrintLayoutContext.tsx +0 -66
- package/src/components/PrintLayout/PrintPageBreak.tsx +0 -52
- package/src/components/PrintLayout/examples/PrintShowcase.tsx +0 -230
- package/src/components/PrintLayout/index.ts +0 -19
- package/src/components/PrintLayout/types.ts +0 -37
- package/src/components/PrintPageBreak/PrintPageBreak.tsx +0 -120
- package/src/components/PrintPageBreak/PrintPageBreakGroup.tsx +0 -90
- package/src/components/PrintPageBreak/PrintPageBreakIndicator.tsx +0 -112
- package/src/components/PrintPageBreak/examples/PrintPageBreakShowcase.tsx +0 -279
- package/src/components/PrintPageBreak/index.ts +0 -23
- package/src/components/PrintPageBreak/types.ts +0 -94
- package/src/components/PrintSection/PrintColumn.tsx +0 -104
- package/src/components/PrintSection/PrintDivider.tsx +0 -101
- package/src/components/PrintSection/PrintSection.tsx +0 -129
- package/src/components/PrintSection/PrintSectionContent.tsx +0 -75
- package/src/components/PrintSection/PrintSectionHeader.tsx +0 -97
- package/src/components/PrintSection/examples/PrintSectionShowcase.tsx +0 -258
- package/src/components/PrintSection/index.ts +0 -33
- package/src/components/PrintSection/types.ts +0 -155
- package/src/components/PrintText/PrintText.tsx +0 -116
- package/src/components/PrintText/index.ts +0 -16
- package/src/components/PrintText/types.ts +0 -24
- package/src/rbac/__tests__/integration.test.tsx +0 -218
- package/src/utils/print/PrintDataProcessor.ts +0 -390
- package/src/utils/print/examples/PrintUtilitiesShowcase.tsx +0 -397
- package/src/utils/print/index.ts +0 -29
- package/src/utils/print/types.ts +0 -196
- package/src/utils/print/usePrintOptimization.ts +0 -272
- /package/dist/{DataTable-7FMFXA7A.js.map → DataTable-4T627QFJ.js.map} +0 -0
- /package/dist/{api-H5A3H4IR.js.map → api-LUNF5O6M.js.map} +0 -0
- /package/dist/{appNameResolver-7GHF5ED2.js.map → appNameResolver-UURKN7NF.js.map} +0 -0
- /package/dist/{audit-BUW3LMJB.js.map → audit-6TOCAMKO.js.map} +0 -0
- /package/dist/{chunk-NRK4AIHQ.js.map → chunk-KBRACSJI.js.map} +0 -0
- /package/dist/{chunk-6MTY77WU.js.map → chunk-TNMXZLDR.js.map} +0 -0
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
# PACE Core Migration Guide
|
|
2
|
+
|
|
3
|
+
> **🔄 Complete Migration Reference** | [← Back to Documentation](../README.md) | [↑ Table of Contents](#table-of-contents)
|
|
4
|
+
|
|
5
|
+
Comprehensive migration guide for upgrading PACE Core across all versions with detailed instructions, breaking changes, and troubleshooting.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This guide covers all PACE Core migrations from version 0.1.0 to the latest version. Use the version-specific sections to find the exact migration steps for your upgrade path.
|
|
10
|
+
|
|
11
|
+
## Quick Reference
|
|
12
|
+
|
|
13
|
+
| From Version | To Version | Breaking Changes | Migration Time | Key Changes |
|
|
14
|
+
|--------------|------------|------------------|----------------|-------------|
|
|
15
|
+
| v0.4.14 | v0.4.15 | ⚠️ Minor | 5-10 min | Tailwind scanning fix |
|
|
16
|
+
| v0.4.15 | v0.4.16 | ⚠️ Minor | 5-10 min | CSS-first approach |
|
|
17
|
+
| v0.4.16 | v0.4.17 | ⚠️ Minor | 5-10 min | Source path fix |
|
|
18
|
+
| v0.4.x | v0.5.x | ⚠️ Minor | 10-15 min | File reference system |
|
|
19
|
+
| v0.3.x | v0.5.x | ⚠️ Major | 30-45 min | RBAC system, providers |
|
|
20
|
+
| v0.2.x | v0.5.x | ⚠️ Major | 45-60 min | Complete restructure |
|
|
21
|
+
|
|
22
|
+
## Current Version Migration (v0.5.x)
|
|
23
|
+
|
|
24
|
+
### Latest Changes in v0.5.x
|
|
25
|
+
|
|
26
|
+
**New Features:**
|
|
27
|
+
- File Upload & Storage System
|
|
28
|
+
- Inactivity Tracking
|
|
29
|
+
- Public Pages System
|
|
30
|
+
- Organisation Security
|
|
31
|
+
- Enhanced RBAC
|
|
32
|
+
|
|
33
|
+
**Breaking Changes:**
|
|
34
|
+
- None in v0.5.x series
|
|
35
|
+
- All changes are additive
|
|
36
|
+
|
|
37
|
+
### Recommended Upgrade Path
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Update to latest version
|
|
41
|
+
npm install @jmruthers/pace-core@latest
|
|
42
|
+
|
|
43
|
+
# Update peer dependencies if needed
|
|
44
|
+
npm install @tanstack/react-table@^8.0.0 @radix-ui/react-checkbox@^1.0.0
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### New Features Usage
|
|
48
|
+
|
|
49
|
+
**File Upload System:**
|
|
50
|
+
```tsx
|
|
51
|
+
// New in v0.5.x
|
|
52
|
+
import { FileUpload, FileDisplay, useFileReference } from '@jmruthers/pace-core';
|
|
53
|
+
|
|
54
|
+
function MyComponent() {
|
|
55
|
+
const { uploadFile } = useFileReference(supabase);
|
|
56
|
+
// Use new file upload features
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Inactivity Tracking:**
|
|
61
|
+
```tsx
|
|
62
|
+
// New in v0.5.x
|
|
63
|
+
import { useInactivityTracker, InactivityWarningModal } from '@jmruthers/pace-core';
|
|
64
|
+
|
|
65
|
+
function MyApp() {
|
|
66
|
+
const { isIdle, showWarning, resetActivity } = useInactivityTracker({
|
|
67
|
+
idleTimeoutMs: 30 * 60 * 1000
|
|
68
|
+
});
|
|
69
|
+
// Use inactivity tracking
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Version History
|
|
74
|
+
|
|
75
|
+
### v0.5.54 (Latest)
|
|
76
|
+
|
|
77
|
+
**Changes:**
|
|
78
|
+
- File reference system improvements
|
|
79
|
+
- Enhanced error handling
|
|
80
|
+
- Performance optimizations
|
|
81
|
+
|
|
82
|
+
**Migration:** No action required - fully backward compatible.
|
|
83
|
+
|
|
84
|
+
### v0.5.0 - v0.5.53
|
|
85
|
+
|
|
86
|
+
**New Features:**
|
|
87
|
+
- File Upload & Storage System
|
|
88
|
+
- Inactivity Tracking
|
|
89
|
+
- Public Pages System
|
|
90
|
+
- Organisation Security
|
|
91
|
+
|
|
92
|
+
**Migration:** No breaking changes - all features are additive.
|
|
93
|
+
|
|
94
|
+
### v0.4.17 - Source Path Fix
|
|
95
|
+
|
|
96
|
+
**Issue Fixed:** @source directive paths in core.css were incorrect, preventing Tailwind v4 from scanning pace-core source files.
|
|
97
|
+
|
|
98
|
+
**Before (v0.4.16):**
|
|
99
|
+
```css
|
|
100
|
+
@source "./src/**/*.{js,ts,jsx,tsx}";
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**After (v0.4.17):**
|
|
104
|
+
```css
|
|
105
|
+
@source "../src/**/*.{js,ts,jsx,tsx}";
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Migration Steps:**
|
|
109
|
+
|
|
110
|
+
1. **Update pace-core:**
|
|
111
|
+
```bash
|
|
112
|
+
npm install @jmruthers/pace-core@^0.4.17
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
2. **Verify CSS file size:**
|
|
116
|
+
```bash
|
|
117
|
+
# Should be 50-100+ KB (not 20-30 KB)
|
|
118
|
+
ls -la dist/assets/*.css
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
3. **Test component styling:**
|
|
122
|
+
```tsx
|
|
123
|
+
import { Button, Card } from '@jmruthers/pace-core';
|
|
124
|
+
|
|
125
|
+
function TestComponent() {
|
|
126
|
+
return (
|
|
127
|
+
<div className="p-8 space-y-4">
|
|
128
|
+
<h1 className="text-2xl font-bold text-main-900">Path Fix Test</h1>
|
|
129
|
+
<Card className="p-4 border border-main-300">
|
|
130
|
+
<Button variant="primary" className="bg-main-600 text-main-50">
|
|
131
|
+
Primary Button
|
|
132
|
+
</Button>
|
|
133
|
+
</Card>
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Expected Result:** Components should render with proper PACE Core styling.
|
|
140
|
+
|
|
141
|
+
### v0.4.16 - CSS-First Approach
|
|
142
|
+
|
|
143
|
+
**Change:** Simplified Tailwind v4 configuration using CSS-first approach with @source directives.
|
|
144
|
+
|
|
145
|
+
**Before (v0.4.15):**
|
|
146
|
+
```typescript
|
|
147
|
+
// vite.config.ts
|
|
148
|
+
export default defineConfig({
|
|
149
|
+
plugins: [
|
|
150
|
+
react(),
|
|
151
|
+
tailwindcss({
|
|
152
|
+
content: [
|
|
153
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
154
|
+
'./node_modules/@jmruthers/pace-core/src/**/*.{js,ts,jsx,tsx}'
|
|
155
|
+
]
|
|
156
|
+
})
|
|
157
|
+
],
|
|
158
|
+
})
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**After (v0.4.16):**
|
|
162
|
+
```typescript
|
|
163
|
+
// vite.config.ts
|
|
164
|
+
export default defineConfig({
|
|
165
|
+
plugins: [
|
|
166
|
+
react(),
|
|
167
|
+
tailwindcss({
|
|
168
|
+
content: [
|
|
169
|
+
'./src/**/*.{js,ts,jsx,tsx}'
|
|
170
|
+
// pace-core source files are automatically scanned via @source directives
|
|
171
|
+
]
|
|
172
|
+
})
|
|
173
|
+
],
|
|
174
|
+
})
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Migration Steps:**
|
|
178
|
+
|
|
179
|
+
1. **Update pace-core:**
|
|
180
|
+
```bash
|
|
181
|
+
npm install @jmruthers/pace-core@^0.4.16
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
2. **Simplify Vite configuration:**
|
|
185
|
+
```typescript
|
|
186
|
+
// vite.config.ts
|
|
187
|
+
import { defineConfig } from 'vite'
|
|
188
|
+
import react from '@vitejs/plugin-react'
|
|
189
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
190
|
+
|
|
191
|
+
export default defineConfig({
|
|
192
|
+
plugins: [
|
|
193
|
+
react(),
|
|
194
|
+
tailwindcss({
|
|
195
|
+
content: [
|
|
196
|
+
'./src/**/*.{js,ts,jsx,tsx}'
|
|
197
|
+
]
|
|
198
|
+
})
|
|
199
|
+
],
|
|
200
|
+
})
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
3. **Test the configuration:**
|
|
204
|
+
```tsx
|
|
205
|
+
// Test component
|
|
206
|
+
import { Button } from '@jmruthers/pace-core';
|
|
207
|
+
|
|
208
|
+
function TestComponent() {
|
|
209
|
+
return (
|
|
210
|
+
<Button className="bg-main-600 text-main-50">
|
|
211
|
+
Test Button
|
|
212
|
+
</Button>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### v0.4.15 - Tailwind Scanning Fix
|
|
218
|
+
|
|
219
|
+
**Issue Fixed:** Components appeared unstyled due to missing Tailwind class scanning.
|
|
220
|
+
|
|
221
|
+
**Root Cause:** Tailwind v4 needs to scan source files, not compiled JavaScript.
|
|
222
|
+
|
|
223
|
+
**Migration Steps:**
|
|
224
|
+
|
|
225
|
+
1. **Update pace-core:**
|
|
226
|
+
```bash
|
|
227
|
+
npm install @jmruthers/pace-core@^0.4.15
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
2. **Update Vite configuration:**
|
|
231
|
+
```typescript
|
|
232
|
+
// vite.config.ts
|
|
233
|
+
export default defineConfig({
|
|
234
|
+
plugins: [
|
|
235
|
+
react(),
|
|
236
|
+
tailwindcss({
|
|
237
|
+
content: [
|
|
238
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
239
|
+
'./node_modules/@jmruthers/pace-core/src/**/*.{js,ts,jsx,tsx}'
|
|
240
|
+
]
|
|
241
|
+
})
|
|
242
|
+
],
|
|
243
|
+
})
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
3. **Clear build cache:**
|
|
247
|
+
```bash
|
|
248
|
+
rm -rf dist .vite node_modules
|
|
249
|
+
npm install
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
4. **Verify CSS generation:**
|
|
253
|
+
```bash
|
|
254
|
+
# Should generate 800+ CSS rules (not 292)
|
|
255
|
+
npm run build
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### v0.4.14 and Earlier
|
|
259
|
+
|
|
260
|
+
**Legacy Configuration:**
|
|
261
|
+
```typescript
|
|
262
|
+
// Old configuration (v0.4.14 and below)
|
|
263
|
+
export default defineConfig({
|
|
264
|
+
plugins: [
|
|
265
|
+
react(),
|
|
266
|
+
tailwindcss({
|
|
267
|
+
content: [
|
|
268
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
269
|
+
'./node_modules/@jmruthers/pace-core/**/*.{js,ts,jsx,tsx}'
|
|
270
|
+
]
|
|
271
|
+
})
|
|
272
|
+
],
|
|
273
|
+
})
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Major Version Migrations
|
|
277
|
+
|
|
278
|
+
### v0.3.x to v0.5.x
|
|
279
|
+
|
|
280
|
+
**Breaking Changes:**
|
|
281
|
+
- Provider hierarchy changes
|
|
282
|
+
- RBAC system updates
|
|
283
|
+
- New authentication patterns
|
|
284
|
+
|
|
285
|
+
**Migration Steps:**
|
|
286
|
+
|
|
287
|
+
1. **Update dependencies:**
|
|
288
|
+
```bash
|
|
289
|
+
npm install @jmruthers/pace-core@^0.5.0
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
2. **Update provider hierarchy:**
|
|
293
|
+
```tsx
|
|
294
|
+
// Before (v0.3.x)
|
|
295
|
+
<AuthProvider>
|
|
296
|
+
<OrganisationProvider>
|
|
297
|
+
<EventProvider>
|
|
298
|
+
<App />
|
|
299
|
+
</EventProvider>
|
|
300
|
+
</OrganisationProvider>
|
|
301
|
+
</AuthProvider>
|
|
302
|
+
|
|
303
|
+
// After (v0.5.x)
|
|
304
|
+
<UnifiedAuthProvider supabaseClient={supabase} appName="my-app">
|
|
305
|
+
<OrganisationProvider>
|
|
306
|
+
<EventProvider>
|
|
307
|
+
<App />
|
|
308
|
+
</EventProvider>
|
|
309
|
+
</OrganisationProvider>
|
|
310
|
+
</UnifiedAuthProvider>
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
3. **Update authentication hooks:**
|
|
314
|
+
```tsx
|
|
315
|
+
// Before
|
|
316
|
+
import { useAuth } from '@jmruthers/pace-core';
|
|
317
|
+
|
|
318
|
+
// After
|
|
319
|
+
import { useUnifiedAuth } from '@jmruthers/pace-core';
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
4. **Update RBAC usage:**
|
|
323
|
+
```tsx
|
|
324
|
+
// Before
|
|
325
|
+
import { useRBAC } from '@jmruthers/pace-core';
|
|
326
|
+
|
|
327
|
+
// After
|
|
328
|
+
import { useCan } from '@jmruthers/pace-core/rbac';
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### v0.2.x to v0.5.x
|
|
332
|
+
|
|
333
|
+
**Breaking Changes:**
|
|
334
|
+
- Complete component restructure
|
|
335
|
+
- New import paths
|
|
336
|
+
- Updated prop interfaces
|
|
337
|
+
|
|
338
|
+
**Migration Steps:**
|
|
339
|
+
|
|
340
|
+
1. **Update all imports:**
|
|
341
|
+
```tsx
|
|
342
|
+
// Before (v0.2.x)
|
|
343
|
+
import { Button, Card, useAuth } from '@jmruthers/pace-core/components';
|
|
344
|
+
|
|
345
|
+
// After (v0.5.x)
|
|
346
|
+
import { Button, Card, useUnifiedAuth } from '@jmruthers/pace-core';
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
2. **Update component props:**
|
|
350
|
+
```tsx
|
|
351
|
+
// Check component documentation for prop changes
|
|
352
|
+
// Most components maintain backward compatibility
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
3. **Update authentication:**
|
|
356
|
+
```tsx
|
|
357
|
+
// Follow v0.3.x to v0.5.x migration steps
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
## Breaking Changes Reference
|
|
361
|
+
|
|
362
|
+
### Authentication Changes
|
|
363
|
+
|
|
364
|
+
| Version | Change | Before | After |
|
|
365
|
+
|---------|--------|--------|-------|
|
|
366
|
+
| v0.4.0 | Provider consolidation | `AuthProvider` | `UnifiedAuthProvider` |
|
|
367
|
+
| v0.4.0 | Hook consolidation | `useAuth` | `useUnifiedAuth` |
|
|
368
|
+
| v0.3.0 | Provider hierarchy | Individual providers | Nested providers |
|
|
369
|
+
|
|
370
|
+
### RBAC Changes
|
|
371
|
+
|
|
372
|
+
| Version | Change | Before | After |
|
|
373
|
+
|---------|--------|--------|-------|
|
|
374
|
+
| v0.5.0 | Hook location | `useRBAC` | `useCan` from `/rbac` |
|
|
375
|
+
| v0.4.0 | Permission format | `"read users"` | `"read:users"` |
|
|
376
|
+
| v0.3.0 | Scope format | `{ userId, orgId }` | `{ organisationId }` |
|
|
377
|
+
|
|
378
|
+
### Component Changes
|
|
379
|
+
|
|
380
|
+
| Version | Change | Before | After |
|
|
381
|
+
|---------|--------|--------|-------|
|
|
382
|
+
| v0.4.0 | Import paths | `/components` | Main export |
|
|
383
|
+
| v0.3.0 | Prop interfaces | Legacy props | Updated interfaces |
|
|
384
|
+
| v0.2.0 | Component names | Old names | New naming convention |
|
|
385
|
+
|
|
386
|
+
## RBAC System Migration
|
|
387
|
+
|
|
388
|
+
### Legacy to New RBAC
|
|
389
|
+
|
|
390
|
+
**Database Schema Changes:**
|
|
391
|
+
```sql
|
|
392
|
+
-- New RBAC tables (v0.4.0+)
|
|
393
|
+
CREATE TABLE rbac_apps (
|
|
394
|
+
id UUID PRIMARY KEY,
|
|
395
|
+
name TEXT NOT NULL,
|
|
396
|
+
requires_event BOOLEAN DEFAULT false
|
|
397
|
+
);
|
|
398
|
+
|
|
399
|
+
CREATE TABLE rbac_page_permissions (
|
|
400
|
+
id UUID PRIMARY KEY,
|
|
401
|
+
app_id UUID REFERENCES rbac_apps(id),
|
|
402
|
+
page_name TEXT NOT NULL,
|
|
403
|
+
operation TEXT NOT NULL,
|
|
404
|
+
required_permissions TEXT[] NOT NULL
|
|
405
|
+
);
|
|
406
|
+
|
|
407
|
+
-- Migration from old system
|
|
408
|
+
INSERT INTO rbac_apps (id, name, requires_event)
|
|
409
|
+
VALUES ('your-app-id', 'Your App Name', false);
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
**Code Migration:**
|
|
413
|
+
```tsx
|
|
414
|
+
// Before (Legacy RBAC)
|
|
415
|
+
import { useRBAC } from '@jmruthers/pace-core';
|
|
416
|
+
|
|
417
|
+
function MyComponent() {
|
|
418
|
+
const { hasPermission } = useRBAC();
|
|
419
|
+
const canEdit = hasPermission('edit', 'users');
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// After (New RBAC)
|
|
423
|
+
import { useCan } from '@jmruthers/pace-core/rbac';
|
|
424
|
+
|
|
425
|
+
function MyComponent() {
|
|
426
|
+
const { hasPermission } = useCan();
|
|
427
|
+
const canEdit = await hasPermission('update:users', { organisationId });
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### Permission Format Changes
|
|
432
|
+
|
|
433
|
+
**Old Format:**
|
|
434
|
+
```tsx
|
|
435
|
+
// v0.3.x and earlier
|
|
436
|
+
hasPermission('read', 'users')
|
|
437
|
+
hasPermission('edit', 'organisations')
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
**New Format:**
|
|
441
|
+
```tsx
|
|
442
|
+
// v0.4.x and later
|
|
443
|
+
hasPermission('read:users', { organisationId })
|
|
444
|
+
hasPermission('update:organisations', { organisationId })
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
## Organisation Context Changes
|
|
448
|
+
|
|
449
|
+
### Provider Hierarchy Updates
|
|
450
|
+
|
|
451
|
+
**Timing Fix (v0.4.0):**
|
|
452
|
+
```tsx
|
|
453
|
+
// Before - Race condition possible
|
|
454
|
+
<AuthProvider>
|
|
455
|
+
<OrganisationProvider>
|
|
456
|
+
<EventProvider>
|
|
457
|
+
<App />
|
|
458
|
+
</EventProvider>
|
|
459
|
+
</OrganisationProvider>
|
|
460
|
+
</AuthProvider>
|
|
461
|
+
|
|
462
|
+
// After - Proper timing
|
|
463
|
+
<UnifiedAuthProvider supabaseClient={supabase} appName="my-app">
|
|
464
|
+
<OrganisationProvider>
|
|
465
|
+
<EventProvider>
|
|
466
|
+
<App />
|
|
467
|
+
</EventProvider>
|
|
468
|
+
</OrganisationProvider>
|
|
469
|
+
</UnifiedAuthProvider>
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Context Resolution
|
|
473
|
+
|
|
474
|
+
**Automatic Database Context:**
|
|
475
|
+
```tsx
|
|
476
|
+
// The OrganisationProvider now automatically sets database context
|
|
477
|
+
// No manual setup required
|
|
478
|
+
<OrganisationProvider>
|
|
479
|
+
<YourApp />
|
|
480
|
+
</OrganisationProvider>
|
|
481
|
+
|
|
482
|
+
// Database context is automatically set via:
|
|
483
|
+
// SELECT set_organisation_context(organisation_id);
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
## Troubleshooting Common Migration Issues
|
|
487
|
+
|
|
488
|
+
### Styling Issues After Upgrade
|
|
489
|
+
|
|
490
|
+
**Problem:** Components appear unstyled after upgrade.
|
|
491
|
+
|
|
492
|
+
**Solutions:**
|
|
493
|
+
1. **Check Vite configuration:**
|
|
494
|
+
```typescript
|
|
495
|
+
// Ensure pace-core source files are included
|
|
496
|
+
export default defineConfig({
|
|
497
|
+
plugins: [
|
|
498
|
+
react(),
|
|
499
|
+
tailwindcss({
|
|
500
|
+
content: [
|
|
501
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
502
|
+
'./node_modules/@jmruthers/pace-core/src/**/*.{js,ts,jsx,tsx}'
|
|
503
|
+
]
|
|
504
|
+
})
|
|
505
|
+
],
|
|
506
|
+
})
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
2. **Clear build cache:**
|
|
510
|
+
```bash
|
|
511
|
+
rm -rf dist .vite node_modules
|
|
512
|
+
npm install
|
|
513
|
+
npm run build
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
3. **Verify CSS file size:**
|
|
517
|
+
```bash
|
|
518
|
+
# Should be 50-100+ KB
|
|
519
|
+
ls -la dist/assets/*.css
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### Import Path Changes
|
|
523
|
+
|
|
524
|
+
**Problem:** Import errors after upgrade.
|
|
525
|
+
|
|
526
|
+
**Solutions:**
|
|
527
|
+
1. **Update import paths:**
|
|
528
|
+
```tsx
|
|
529
|
+
// Old
|
|
530
|
+
import { Button } from '@jmruthers/pace-core/components';
|
|
531
|
+
|
|
532
|
+
// New
|
|
533
|
+
import { Button } from '@jmruthers/pace-core';
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
2. **Check for moved exports:**
|
|
537
|
+
```tsx
|
|
538
|
+
// RBAC hooks moved
|
|
539
|
+
import { useCan } from '@jmruthers/pace-core/rbac';
|
|
540
|
+
|
|
541
|
+
// Storage hooks
|
|
542
|
+
import { useStorage } from '@jmruthers/pace-core';
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
### Authentication Issues
|
|
546
|
+
|
|
547
|
+
**Problem:** Authentication not working after upgrade.
|
|
548
|
+
|
|
549
|
+
**Solutions:**
|
|
550
|
+
1. **Update provider hierarchy:**
|
|
551
|
+
```tsx
|
|
552
|
+
// Use UnifiedAuthProvider
|
|
553
|
+
<UnifiedAuthProvider supabaseClient={supabase} appName="my-app">
|
|
554
|
+
<OrganisationProvider>
|
|
555
|
+
<EventProvider>
|
|
556
|
+
<App />
|
|
557
|
+
</EventProvider>
|
|
558
|
+
</OrganisationProvider>
|
|
559
|
+
</UnifiedAuthProvider>
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
2. **Update hook usage:**
|
|
563
|
+
```tsx
|
|
564
|
+
// Use useUnifiedAuth
|
|
565
|
+
const { user, signIn, signOut } = useUnifiedAuth();
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### RBAC Permission Issues
|
|
569
|
+
|
|
570
|
+
**Problem:** Permissions not working after RBAC migration.
|
|
571
|
+
|
|
572
|
+
**Solutions:**
|
|
573
|
+
1. **Update permission format:**
|
|
574
|
+
```tsx
|
|
575
|
+
// Old format
|
|
576
|
+
hasPermission('read', 'users')
|
|
577
|
+
|
|
578
|
+
// New format
|
|
579
|
+
hasPermission('read:users', { organisationId })
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
2. **Check scope requirements:**
|
|
583
|
+
```tsx
|
|
584
|
+
// Always include organisation context
|
|
585
|
+
const canEdit = await hasPermission('update:users', {
|
|
586
|
+
organisationId: currentOrg.id
|
|
587
|
+
});
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
3. **Verify database setup:**
|
|
591
|
+
```sql
|
|
592
|
+
-- Ensure RBAC tables exist
|
|
593
|
+
SELECT * FROM rbac_apps;
|
|
594
|
+
SELECT * FROM rbac_page_permissions;
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
### Build Errors
|
|
598
|
+
|
|
599
|
+
**Problem:** Build fails after upgrade.
|
|
600
|
+
|
|
601
|
+
**Solutions:**
|
|
602
|
+
1. **Update peer dependencies:**
|
|
603
|
+
```bash
|
|
604
|
+
npm install @tanstack/react-table@^8.0.0
|
|
605
|
+
npm install @radix-ui/react-checkbox@^1.0.0
|
|
606
|
+
npm install @radix-ui/react-dialog@^1.0.0
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
2. **Check TypeScript errors:**
|
|
610
|
+
```bash
|
|
611
|
+
npm run type-check
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
3. **Update tsconfig.json:**
|
|
615
|
+
```json
|
|
616
|
+
{
|
|
617
|
+
"compilerOptions": {
|
|
618
|
+
"skipLibCheck": true,
|
|
619
|
+
"moduleResolution": "node"
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
## Migration Checklist
|
|
625
|
+
|
|
626
|
+
### Pre-Migration
|
|
627
|
+
|
|
628
|
+
- [ ] Backup current codebase
|
|
629
|
+
- [ ] Document current version
|
|
630
|
+
- [ ] Test current functionality
|
|
631
|
+
- [ ] Check for custom configurations
|
|
632
|
+
|
|
633
|
+
### During Migration
|
|
634
|
+
|
|
635
|
+
- [ ] Update package.json
|
|
636
|
+
- [ ] Update import statements
|
|
637
|
+
- [ ] Update component usage
|
|
638
|
+
- [ ] Update configuration files
|
|
639
|
+
- [ ] Run type checking
|
|
640
|
+
- [ ] Test build process
|
|
641
|
+
|
|
642
|
+
### Post-Migration
|
|
643
|
+
|
|
644
|
+
- [ ] Test all functionality
|
|
645
|
+
- [ ] Verify styling
|
|
646
|
+
- [ ] Check authentication
|
|
647
|
+
- [ ] Test RBAC permissions
|
|
648
|
+
- [ ] Performance testing
|
|
649
|
+
- [ ] Update documentation
|
|
650
|
+
|
|
651
|
+
## Getting Help
|
|
652
|
+
|
|
653
|
+
### Common Resources
|
|
654
|
+
|
|
655
|
+
- **[Troubleshooting Guide](../troubleshooting/README.md)** - Detailed problem solving
|
|
656
|
+
- **[API Reference](../api-reference/)** - Complete API documentation
|
|
657
|
+
- **[Examples](../getting-started/examples/)** - Working code examples
|
|
658
|
+
- **[GitHub Issues](https://github.com/jmruthers/pace-core/issues)** - Bug reports
|
|
659
|
+
|
|
660
|
+
### Migration Support
|
|
661
|
+
|
|
662
|
+
If you encounter issues during migration:
|
|
663
|
+
|
|
664
|
+
1. **Check this guide** for your specific version
|
|
665
|
+
2. **Review troubleshooting section** for common issues
|
|
666
|
+
3. **Test with minimal example** to isolate problems
|
|
667
|
+
4. **Check GitHub issues** for similar problems
|
|
668
|
+
5. **Create new issue** with detailed information
|
|
669
|
+
|
|
670
|
+
### Version-Specific Help
|
|
671
|
+
|
|
672
|
+
- **v0.4.17+**: [Source Path Fix Guide](./v0.4.17-source-path-fix.md)
|
|
673
|
+
- **v0.4.16**: [CSS-First Migration Guide](./v0.4.16-css-first-approach.md)
|
|
674
|
+
- **v0.4.15**: [Tailwind Scanning Guide](./v0.4.15-tailwind-scanning.md)
|
|
675
|
+
- **RBAC**: [RBAC Migration Guide](./rbac-migration.md)
|
|
676
|
+
|
|
677
|
+
## Next Steps
|
|
678
|
+
|
|
679
|
+
After successful migration:
|
|
680
|
+
|
|
681
|
+
- **[Getting Started](../getting-started/quick-start.md)** - Learn new features
|
|
682
|
+
- **[Implementation Guides](../implementation-guides/)** - Advanced patterns
|
|
683
|
+
- **[Best Practices](../best-practices/)** - Production guidelines
|
|
684
|
+
- **[API Reference](../api-reference/)** - Complete documentation
|
package/docs/migration/README.md
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
# Migration Guide
|
|
2
2
|
|
|
3
|
-
> **🔄 Upgrade and Migration** | [
|
|
3
|
+
> **🔄 Upgrade and Migration** | [Unified Migration Guide](./MIGRATION_GUIDE.md) | [RBAC Migration](./rbac-migration.md)
|
|
4
4
|
|
|
5
|
-
[← Back to Documentation](../README.md) | [↑ Table of Contents](#table-of-contents) | [Next:
|
|
5
|
+
[← Back to Documentation](../README.md) | [↑ Table of Contents](#table-of-contents) | [Next: Unified Migration Guide →](./MIGRATION_GUIDE.md)
|
|
6
6
|
|
|
7
7
|
Complete migration guides for upgrading to and between versions of `@jmruthers/pace-core`.
|
|
8
8
|
|
|
9
|
+
## 📚 Start Here: Unified Migration Guide
|
|
10
|
+
|
|
11
|
+
**For all migrations, start with:** [Complete Migration Guide](./MIGRATION_GUIDE.md)
|
|
12
|
+
|
|
13
|
+
The unified guide provides:
|
|
14
|
+
- Quick reference table for all versions
|
|
15
|
+
- Step-by-step migration instructions
|
|
16
|
+
- Breaking changes reference
|
|
17
|
+
- Troubleshooting common issues
|
|
18
|
+
- Complete migration checklist
|
|
19
|
+
|
|
9
20
|
## 📋 Table of Contents
|
|
10
21
|
|
|
11
22
|
- [Migration Overview](#-migration-overview)
|