@jmruthers/pace-core 0.5.120 → 0.5.123
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/{AuthService-D4646R4b.d.ts → AuthService-DYuQPJj6.d.ts} +0 -9
- package/dist/{DataTable-DGZDJUYM.js → DataTable-WTS4IRF2.js} +7 -8
- package/dist/{PublicLoadingSpinner-DgDWTFqn.d.ts → PublicLoadingSpinner-CaoRbHvJ.d.ts} +30 -4
- package/dist/{UnifiedAuthProvider-UACKFATV.js → UnifiedAuthProvider-6C47WIML.js} +3 -4
- package/dist/{chunk-D6BOFXYR.js → chunk-35ZDPMBM.js} +3 -3
- package/dist/{chunk-CGURJ27Z.js → chunk-4MXVZVNS.js} +2 -2
- package/dist/{chunk-ZYJ6O5CA.js → chunk-C43QIDN3.js} +2 -2
- package/dist/{chunk-VKOCWWVY.js → chunk-CX5M4ZAG.js} +1 -6
- package/dist/{chunk-VKOCWWVY.js.map → chunk-CX5M4ZAG.js.map} +1 -1
- package/dist/{chunk-HFBOFZ3Z.js → chunk-DHMFMXFV.js} +258 -243
- package/dist/chunk-DHMFMXFV.js.map +1 -0
- package/dist/{chunk-RIEJGKD3.js → chunk-ESJTIADP.js} +15 -6
- package/dist/{chunk-RIEJGKD3.js.map → chunk-ESJTIADP.js.map} +1 -1
- package/dist/{chunk-SMJZMKYN.js → chunk-GEVIB2UB.js} +43 -10
- package/dist/chunk-GEVIB2UB.js.map +1 -0
- package/dist/{chunk-TDNI6ZWL.js → chunk-IJOZZOGT.js} +7 -7
- package/dist/chunk-IJOZZOGT.js.map +1 -0
- package/dist/{chunk-GZRXOUBE.js → chunk-M6DDYFUD.js} +2 -2
- package/dist/chunk-M6DDYFUD.js.map +1 -0
- package/dist/{chunk-B4GZ2BXO.js → chunk-NZGLXZGP.js} +3 -3
- package/dist/{chunk-NZ32EONV.js → chunk-QWNJCQXZ.js} +2 -2
- package/dist/{chunk-FKFHZUGF.js → chunk-XN6GWKMV.js} +43 -56
- package/dist/chunk-XN6GWKMV.js.map +1 -0
- package/dist/{chunk-BHWIUEYH.js → chunk-ZBLK676C.js} +1 -61
- package/dist/chunk-ZBLK676C.js.map +1 -0
- package/dist/{chunk-QPI2CCBA.js → chunk-ZPJMYGEP.js} +149 -96
- package/dist/chunk-ZPJMYGEP.js.map +1 -0
- package/dist/components.d.ts +1 -1
- package/dist/components.js +11 -11
- package/dist/{formatting-B1jSqgl-.d.ts → formatting-DFcCxUEk.d.ts} +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +9 -8
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +19 -17
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +2 -3
- package/dist/rbac/index.js +7 -8
- package/dist/styles/index.d.ts +1 -1
- package/dist/styles/index.js +5 -3
- package/dist/theming/runtime.d.ts +73 -1
- package/dist/theming/runtime.js +5 -5
- package/dist/{usePublicRouteParams-BdF8bZgs.d.ts → usePublicRouteParams-Dyt1tzI9.d.ts} +60 -8
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +5 -5
- 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 +6 -6
- 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 +6 -6
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.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/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/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- 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/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/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/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +7 -7
- package/docs/api/interfaces/PublicErrorBoundaryState.md +5 -5
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +7 -7
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +51 -12
- package/docs/api/interfaces/PublicPageLayoutProps.md +72 -12
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.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 +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/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.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 +140 -30
- package/docs/best-practices/README.md +1 -1
- package/docs/implementation-guides/datatable-filtering.md +313 -0
- package/docs/implementation-guides/datatable-rbac-usage.md +317 -0
- package/docs/implementation-guides/hierarchical-datatable.md +850 -0
- package/docs/implementation-guides/large-datasets.md +281 -0
- package/docs/implementation-guides/performance.md +403 -0
- package/docs/implementation-guides/public-pages.md +4 -4
- package/docs/migration/quick-migration-guide.md +320 -0
- package/docs/rbac/quick-start.md +16 -16
- package/docs/troubleshooting/README.md +4 -4
- package/docs/troubleshooting/cake-page-permission-guard-issue-summary.md +1 -1
- package/docs/troubleshooting/debugging.md +1117 -0
- package/docs/troubleshooting/migration.md +918 -0
- package/examples/public-pages/CorrectPublicPageImplementation.tsx +30 -30
- package/examples/public-pages/PublicEventPage.tsx +41 -41
- package/examples/public-pages/PublicPageApp.tsx +33 -33
- package/examples/public-pages/PublicPageUsageExample.tsx +30 -30
- package/package.json +4 -4
- package/src/__tests__/hooks/usePermissions.test.ts +265 -0
- package/src/components/DataTable/DataTable.test.tsx +9 -38
- package/src/components/DataTable/DataTable.tsx +0 -7
- package/src/components/DataTable/components/DataTableCore.tsx +66 -136
- package/src/components/DataTable/components/DataTableModals.tsx +25 -22
- package/src/components/DataTable/components/EditableRow.tsx +118 -42
- package/src/components/DataTable/components/UnifiedTableBody.tsx +129 -76
- package/src/components/DataTable/components/__tests__/DataTableModals.test.tsx +33 -14
- package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +17 -5
- package/src/components/DataTable/utils/exportUtils.ts +3 -2
- package/src/components/DataTable/utils/flexibleImport.ts +27 -6
- package/src/components/Dialog/Dialog.tsx +1 -1
- package/src/components/Dialog/README.md +24 -24
- package/src/components/Dialog/examples/BasicHtmlTest.tsx +2 -2
- package/src/components/Dialog/examples/DebugHtmlExample.tsx +6 -6
- package/src/components/Dialog/examples/HtmlDialogExample.tsx +2 -2
- package/src/components/Dialog/examples/SimpleHtmlTest.tsx +3 -3
- package/src/components/Dialog/examples/__tests__/SimpleHtmlTest.test.tsx +4 -4
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +12 -1
- package/src/components/PublicLayout/EventLogo.tsx +175 -0
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +22 -18
- package/src/components/PublicLayout/PublicLoadingSpinner.tsx +22 -14
- package/src/components/PublicLayout/PublicPageHeader.tsx +133 -40
- package/src/components/PublicLayout/PublicPageLayout.tsx +75 -72
- package/src/components/PublicLayout/__tests__/PublicErrorBoundary.test.tsx +1 -1
- package/src/components/PublicLayout/__tests__/PublicLoadingSpinner.test.tsx +8 -8
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +23 -16
- package/src/components/PublicLayout/__tests__/PublicPageLayout.test.tsx +86 -14
- package/src/examples/CorrectPublicPageImplementation.tsx +30 -30
- package/src/examples/PublicEventPage.tsx +41 -41
- package/src/examples/PublicPageApp.tsx +33 -33
- package/src/examples/PublicPageUsageExample.tsx +30 -30
- package/src/hooks/__tests__/usePublicEvent.unit.test.ts +583 -0
- package/src/hooks/__tests__/usePublicRouteParams.unit.test.ts +10 -3
- package/src/hooks/index.ts +1 -1
- package/src/hooks/public/usePublicEventLogo.ts +285 -0
- package/src/hooks/public/usePublicRouteParams.ts +21 -4
- package/src/hooks/useEventTheme.test.ts +119 -43
- package/src/hooks/useEventTheme.ts +84 -55
- package/src/index.ts +3 -1
- package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +630 -0
- package/src/rbac/components/__tests__/NavigationProvider.test.tsx +667 -0
- package/src/rbac/components/__tests__/PagePermissionProvider.test.tsx +647 -0
- package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +496 -0
- package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +496 -0
- package/src/rbac/secureClient.ts +4 -2
- package/src/services/EventService.ts +0 -66
- package/src/services/__tests__/EventService.eventColours.test.ts +44 -40
- package/src/styles/index.ts +1 -1
- package/src/theming/__tests__/parseEventColours.test.ts +209 -0
- package/src/theming/parseEventColours.ts +123 -0
- package/src/theming/runtime.ts +3 -0
- package/src/types/__tests__/file-reference.test.ts +447 -0
- package/src/types/database.generated.ts +1515 -424
- package/src/utils/formatDate.test.ts +11 -11
- package/src/utils/formatting.ts +3 -2
- package/dist/chunk-BHWIUEYH.js.map +0 -1
- package/dist/chunk-FKFHZUGF.js.map +0 -1
- package/dist/chunk-GZRXOUBE.js.map +0 -1
- package/dist/chunk-HFBOFZ3Z.js.map +0 -1
- package/dist/chunk-QPI2CCBA.js.map +0 -1
- package/dist/chunk-SMJZMKYN.js.map +0 -1
- package/dist/chunk-TDNI6ZWL.js.map +0 -1
- package/src/styles/semantic.css +0 -24
- /package/dist/{DataTable-DGZDJUYM.js.map → DataTable-WTS4IRF2.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-UACKFATV.js.map → UnifiedAuthProvider-6C47WIML.js.map} +0 -0
- /package/dist/{chunk-D6BOFXYR.js.map → chunk-35ZDPMBM.js.map} +0 -0
- /package/dist/{chunk-CGURJ27Z.js.map → chunk-4MXVZVNS.js.map} +0 -0
- /package/dist/{chunk-ZYJ6O5CA.js.map → chunk-C43QIDN3.js.map} +0 -0
- /package/dist/{chunk-B4GZ2BXO.js.map → chunk-NZGLXZGP.js.map} +0 -0
- /package/dist/{chunk-NZ32EONV.js.map → chunk-QWNJCQXZ.js.map} +0 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# Quick Migration Guide
|
|
2
|
+
|
|
3
|
+
> **🚀 Fast Track Migration** | [Full Migration Guide](./README.md) | [Breaking Changes](./breaking-changes.md)
|
|
4
|
+
|
|
5
|
+
Quick migration guide for common PACE Core upgrade scenarios. For detailed migration instructions, see the [Full Migration Guide](./README.md).
|
|
6
|
+
|
|
7
|
+
## 🎯 Quick Migration Checklist
|
|
8
|
+
|
|
9
|
+
### Before You Start
|
|
10
|
+
- [ ] **Backup your project** - Always backup before major updates
|
|
11
|
+
- [ ] **Check current version** - `npm list @jmruthers/pace-core`
|
|
12
|
+
- [ ] **Review changelog** - Check for breaking changes
|
|
13
|
+
- [ ] **Test in development** - Never migrate directly in production
|
|
14
|
+
|
|
15
|
+
### Common Migration Scenarios
|
|
16
|
+
|
|
17
|
+
## 📦 Package Updates
|
|
18
|
+
|
|
19
|
+
### Minor Version Updates (e.g., v0.4.16 → v0.4.17)
|
|
20
|
+
|
|
21
|
+
**Usually safe, but check for:**
|
|
22
|
+
- New features
|
|
23
|
+
- Bug fixes
|
|
24
|
+
- Performance improvements
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Update to latest
|
|
28
|
+
npm update @jmruthers/pace-core
|
|
29
|
+
|
|
30
|
+
# Or specific version
|
|
31
|
+
npm install @jmruthers/pace-core@0.4.17
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**What to check:**
|
|
35
|
+
- [ ] App still builds successfully
|
|
36
|
+
- [ ] No console errors
|
|
37
|
+
- [ ] Components render correctly
|
|
38
|
+
- [ ] Authentication still works
|
|
39
|
+
|
|
40
|
+
### Major Version Updates (e.g., v0.x → v1.x)
|
|
41
|
+
|
|
42
|
+
**Requires more attention:**
|
|
43
|
+
- Breaking API changes
|
|
44
|
+
- New required props
|
|
45
|
+
- Deprecated features
|
|
46
|
+
- Configuration changes
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Check what's new
|
|
50
|
+
npm info @jmruthers/pace-core versions --json
|
|
51
|
+
|
|
52
|
+
# Update to latest
|
|
53
|
+
npm install @jmruthers/pace-core@latest
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**What to check:**
|
|
57
|
+
- [ ] Review [Breaking Changes](./breaking-changes.md)
|
|
58
|
+
- [ ] Update import statements
|
|
59
|
+
- [ ] Fix deprecated API usage
|
|
60
|
+
- [ ] Update configuration files
|
|
61
|
+
- [ ] Test all functionality
|
|
62
|
+
|
|
63
|
+
## 🔧 Configuration Updates
|
|
64
|
+
|
|
65
|
+
### Tailwind v4 Migration
|
|
66
|
+
|
|
67
|
+
**From v0.4.15 to v0.4.16+ (CSS-First Approach):**
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Remove old dependencies
|
|
71
|
+
npm uninstall tailwindcss postcss autoprefixer
|
|
72
|
+
|
|
73
|
+
# Install new dependencies
|
|
74
|
+
npm install @tailwindcss/vite tailwindcss@^4.0.0
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Update vite.config.ts:**
|
|
78
|
+
```ts
|
|
79
|
+
// Before (v0.4.15)
|
|
80
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
81
|
+
export default defineConfig({
|
|
82
|
+
plugins: [
|
|
83
|
+
react(),
|
|
84
|
+
tailwindcss({
|
|
85
|
+
content: [
|
|
86
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
87
|
+
'./node_modules/@jmruthers/pace-core/src/**/*.{js,ts,jsx,tsx}'
|
|
88
|
+
]
|
|
89
|
+
})
|
|
90
|
+
],
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
// After (v0.4.16+)
|
|
94
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
95
|
+
export default defineConfig({
|
|
96
|
+
plugins: [
|
|
97
|
+
react(),
|
|
98
|
+
tailwindcss({
|
|
99
|
+
content: [
|
|
100
|
+
'./src/**/*.{js,ts,jsx,tsx}' // Only app files, pace-core scanned via @source
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
],
|
|
104
|
+
})
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Update CSS imports:**
|
|
108
|
+
```tsx
|
|
109
|
+
// Before
|
|
110
|
+
import '@jmruthers/pace-core/src/styles/core.css';
|
|
111
|
+
|
|
112
|
+
// After
|
|
113
|
+
import '@jmruthers/pace-core/src/styles/core.css';
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Source Path Fix (v0.4.17+)
|
|
117
|
+
|
|
118
|
+
**Critical fix for @source directive paths:**
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
// vite.config.ts
|
|
122
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
123
|
+
export default defineConfig({
|
|
124
|
+
plugins: [
|
|
125
|
+
react(),
|
|
126
|
+
tailwindcss({
|
|
127
|
+
content: [
|
|
128
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
129
|
+
'./node_modules/@jmruthers/pace-core/**/*.{js,ts,jsx,tsx}'
|
|
130
|
+
]
|
|
131
|
+
})
|
|
132
|
+
],
|
|
133
|
+
})
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## 🔄 API Changes
|
|
137
|
+
|
|
138
|
+
### Component Props
|
|
139
|
+
|
|
140
|
+
**Common prop changes:**
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
// Before (v0.x)
|
|
144
|
+
<DataTable
|
|
145
|
+
data={data}
|
|
146
|
+
columns={columns}
|
|
147
|
+
enableSearch={true}
|
|
148
|
+
enablePagination={true}
|
|
149
|
+
/>
|
|
150
|
+
|
|
151
|
+
// After (v1.x)
|
|
152
|
+
<DataTable
|
|
153
|
+
data={data}
|
|
154
|
+
columns={columns}
|
|
155
|
+
features={{
|
|
156
|
+
search: true,
|
|
157
|
+
pagination: true,
|
|
158
|
+
sorting: true,
|
|
159
|
+
filtering: true
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Hook Changes
|
|
165
|
+
|
|
166
|
+
**RBAC hooks moved to separate module:**
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
// Before
|
|
170
|
+
import { useCan, usePermissions } from '@jmruthers/pace-core';
|
|
171
|
+
|
|
172
|
+
// After
|
|
173
|
+
import { useCan, usePermissions } from '@jmruthers/pace-core/rbac';
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Import Changes
|
|
177
|
+
|
|
178
|
+
**Consolidated imports:**
|
|
179
|
+
|
|
180
|
+
```tsx
|
|
181
|
+
// Before
|
|
182
|
+
import { Button } from '@jmruthers/pace-core/components';
|
|
183
|
+
import { useUnifiedAuth } from '@jmruthers/pace-core/hooks';
|
|
184
|
+
|
|
185
|
+
// After
|
|
186
|
+
import { Button, useUnifiedAuth } from '@jmruthers/pace-core';
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## 🐛 Common Migration Issues
|
|
190
|
+
|
|
191
|
+
### Styling Issues
|
|
192
|
+
|
|
193
|
+
**Problem**: Components appear unstyled after update
|
|
194
|
+
|
|
195
|
+
**Solution**:
|
|
196
|
+
```tsx
|
|
197
|
+
// Ensure CSS import is first
|
|
198
|
+
import '@jmruthers/pace-core/src/styles/core.css';
|
|
199
|
+
import { Button } from '@jmruthers/pace-core';
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Build Errors
|
|
203
|
+
|
|
204
|
+
**Problem**: Build fails with Tailwind errors
|
|
205
|
+
|
|
206
|
+
**Solution**:
|
|
207
|
+
```bash
|
|
208
|
+
# Clear all caches
|
|
209
|
+
rm -rf node_modules package-lock.json
|
|
210
|
+
npm install
|
|
211
|
+
|
|
212
|
+
# Check Tailwind config
|
|
213
|
+
npm run build -- --debug
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### TypeScript Errors
|
|
217
|
+
|
|
218
|
+
**Problem**: Type errors after update
|
|
219
|
+
|
|
220
|
+
**Solution**:
|
|
221
|
+
```bash
|
|
222
|
+
# Update TypeScript types
|
|
223
|
+
npm install @types/react@latest @types/react-dom@latest
|
|
224
|
+
|
|
225
|
+
# Regenerate types
|
|
226
|
+
npm run type-check
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Authentication Issues
|
|
230
|
+
|
|
231
|
+
**Problem**: Login not working after update
|
|
232
|
+
|
|
233
|
+
**Solution**:
|
|
234
|
+
```tsx
|
|
235
|
+
// Check provider hierarchy
|
|
236
|
+
<UnifiedAuthProvider supabaseClient={supabase} appName="my-app">
|
|
237
|
+
<OrganisationProvider>
|
|
238
|
+
<EventProvider>
|
|
239
|
+
<YourApp />
|
|
240
|
+
</EventProvider>
|
|
241
|
+
</OrganisationProvider>
|
|
242
|
+
</UnifiedAuthProvider>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## ✅ Post-Migration Testing
|
|
246
|
+
|
|
247
|
+
### Essential Tests
|
|
248
|
+
- [ ] **Build succeeds** - `npm run build`
|
|
249
|
+
- [ ] **App starts** - `npm run dev`
|
|
250
|
+
- [ ] **Authentication works** - Login/logout
|
|
251
|
+
- [ ] **Components render** - All UI components display
|
|
252
|
+
- [ ] **Permissions work** - RBAC functions correctly
|
|
253
|
+
- [ ] **Forms work** - Form validation and submission
|
|
254
|
+
- [ ] **Data tables work** - CRUD operations
|
|
255
|
+
- [ ] **Styling correct** - No visual regressions
|
|
256
|
+
|
|
257
|
+
### Performance Tests
|
|
258
|
+
- [ ] **Bundle size** - Check for size increases
|
|
259
|
+
- [ ] **Load time** - Measure initial load
|
|
260
|
+
- [ ] **Runtime performance** - Check for slowdowns
|
|
261
|
+
- [ ] **Memory usage** - Monitor for leaks
|
|
262
|
+
|
|
263
|
+
### Browser Tests
|
|
264
|
+
- [ ] **Chrome** - Latest version
|
|
265
|
+
- [ ] **Firefox** - Latest version
|
|
266
|
+
- [ ] **Safari** - Latest version
|
|
267
|
+
- [ ] **Mobile browsers** - iOS Safari, Chrome Mobile
|
|
268
|
+
|
|
269
|
+
## 🆘 Getting Help
|
|
270
|
+
|
|
271
|
+
### If Migration Fails
|
|
272
|
+
|
|
273
|
+
1. **Check the logs** - Look for specific error messages
|
|
274
|
+
2. **Revert changes** - Go back to working version
|
|
275
|
+
3. **Check documentation** - Look for migration guides
|
|
276
|
+
4. **Search issues** - Check GitHub issues
|
|
277
|
+
5. **Ask for help** - Create detailed issue report
|
|
278
|
+
|
|
279
|
+
### Debug Information
|
|
280
|
+
|
|
281
|
+
When asking for help, include:
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
# Version information
|
|
285
|
+
npm list @jmruthers/pace-core
|
|
286
|
+
node --version
|
|
287
|
+
npm --version
|
|
288
|
+
|
|
289
|
+
# Build output
|
|
290
|
+
npm run build 2>&1 | tee build.log
|
|
291
|
+
|
|
292
|
+
# Error details
|
|
293
|
+
# Include full error messages and stack traces
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Emergency Rollback
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
# Rollback to previous version
|
|
300
|
+
npm install @jmruthers/pace-core@0.4.16
|
|
301
|
+
|
|
302
|
+
# Or specific working version
|
|
303
|
+
npm install @jmruthers/pace-core@0.4.15
|
|
304
|
+
|
|
305
|
+
# Clear caches
|
|
306
|
+
rm -rf node_modules package-lock.json
|
|
307
|
+
npm install
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## 📚 Additional Resources
|
|
311
|
+
|
|
312
|
+
- **[Full Migration Guide](./README.md)** - Detailed migration instructions
|
|
313
|
+
- **[Breaking Changes](./breaking-changes.md)** - Complete list of breaking changes
|
|
314
|
+
- **[Changelog](../CHANGELOG.md)** - Version history and changes
|
|
315
|
+
- **[Troubleshooting](../troubleshooting/README.md)** - Common issues and solutions
|
|
316
|
+
- **[GitHub Issues](https://github.com/jmruthers/pace-core/issues)** - Report bugs and get help
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
**Remember**: Always test migrations in a development environment first!
|
package/docs/rbac/quick-start.md
CHANGED
|
@@ -356,10 +356,10 @@ export function Login() {
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
return (
|
|
359
|
-
<div className="min-h-screen flex items-center justify-center bg-
|
|
359
|
+
<div className="min-h-screen flex items-center justify-center bg-sec-50">
|
|
360
360
|
<div className="max-w-md w-full space-y-8">
|
|
361
361
|
<div>
|
|
362
|
-
<h2 className="mt-6 text-center text-3xl font-extrabold text-
|
|
362
|
+
<h2 className="mt-6 text-center text-3xl font-extrabold text-sec-900">
|
|
363
363
|
Sign in to your account
|
|
364
364
|
</h2>
|
|
365
365
|
</div>
|
|
@@ -373,7 +373,7 @@ export function Login() {
|
|
|
373
373
|
name="email"
|
|
374
374
|
type="email"
|
|
375
375
|
required
|
|
376
|
-
className="appearance-none rounded-md relative block w-full px-3 py-2 border border-
|
|
376
|
+
className="appearance-none rounded-md relative block w-full px-3 py-2 border border-sec-300 placeholder-sec-500 text-sec-900 focus:outline-none focus:ring-sec-500 focus:border-sec-500 focus:z-10 sm:text-sm"
|
|
377
377
|
placeholder="Email address"
|
|
378
378
|
value={email}
|
|
379
379
|
onChange={(e) => setEmail(e.target.value)}
|
|
@@ -388,7 +388,7 @@ export function Login() {
|
|
|
388
388
|
name="password"
|
|
389
389
|
type="password"
|
|
390
390
|
required
|
|
391
|
-
className="appearance-none rounded-md relative block w-full px-3 py-2 border border-
|
|
391
|
+
className="appearance-none rounded-md relative block w-full px-3 py-2 border border-sec-300 placeholder-sec-500 text-sec-900 focus:outline-none focus:ring-sec-500 focus:border-sec-500 focus:z-10 sm:text-sm"
|
|
392
392
|
placeholder="Password"
|
|
393
393
|
value={password}
|
|
394
394
|
onChange={(e) => setPassword(e.target.value)}
|
|
@@ -398,7 +398,7 @@ export function Login() {
|
|
|
398
398
|
<button
|
|
399
399
|
type="submit"
|
|
400
400
|
disabled={loading}
|
|
401
|
-
className="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-
|
|
401
|
+
className="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-main-50 bg-sec-600 hover:bg-sec-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sec-500 disabled:opacity-50"
|
|
402
402
|
>
|
|
403
403
|
{loading ? 'Signing in...' : 'Sign in'}
|
|
404
404
|
</button>
|
|
@@ -430,7 +430,7 @@ export function Dashboard() {
|
|
|
430
430
|
}
|
|
431
431
|
|
|
432
432
|
return (
|
|
433
|
-
<div className="min-h-screen bg-
|
|
433
|
+
<div className="min-h-screen bg-sec-50">
|
|
434
434
|
<nav className="bg-white shadow">
|
|
435
435
|
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
436
436
|
<div className="flex justify-between h-16">
|
|
@@ -438,12 +438,12 @@ export function Dashboard() {
|
|
|
438
438
|
<h1 className="text-xl font-semibold">Dashboard</h1>
|
|
439
439
|
</div>
|
|
440
440
|
<div className="flex items-center space-x-4">
|
|
441
|
-
<span className="text-sm text-
|
|
441
|
+
<span className="text-sm text-sec-700">
|
|
442
442
|
{user.email} | Org: {selectedOrganisationId}
|
|
443
443
|
</span>
|
|
444
444
|
<button
|
|
445
445
|
onClick={() => supabase.auth.signOut()}
|
|
446
|
-
className="text-sm text-
|
|
446
|
+
className="text-sm text-sec-500 hover:text-sec-700"
|
|
447
447
|
>
|
|
448
448
|
Sign out
|
|
449
449
|
</button>
|
|
@@ -454,7 +454,7 @@ export function Dashboard() {
|
|
|
454
454
|
|
|
455
455
|
<main className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
|
|
456
456
|
<div className="px-4 py-6 sm:px-0">
|
|
457
|
-
<div className="border-4 border-dashed border-
|
|
457
|
+
<div className="border-4 border-dashed border-sec-200 rounded-lg h-96 p-8">
|
|
458
458
|
<h2 className="text-2xl font-bold mb-4">Welcome to your Dashboard</h2>
|
|
459
459
|
|
|
460
460
|
{/* CRITICAL: Use PagePermissionGuard for page-level permissions */}
|
|
@@ -469,7 +469,7 @@ export function Dashboard() {
|
|
|
469
469
|
<div className="space-x-4">
|
|
470
470
|
<Link
|
|
471
471
|
to="/users"
|
|
472
|
-
className="bg-
|
|
472
|
+
className="bg-main-500 text-main-50 px-4 py-2 rounded hover:bg-main-600"
|
|
473
473
|
>
|
|
474
474
|
View Users
|
|
475
475
|
</Link>
|
|
@@ -504,23 +504,23 @@ export function Users() {
|
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
return (
|
|
507
|
-
<div className="min-h-screen bg-
|
|
507
|
+
<div className="min-h-screen bg-sec-50">
|
|
508
508
|
<nav className="bg-white shadow">
|
|
509
509
|
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
510
510
|
<div className="flex justify-between h-16">
|
|
511
511
|
<div className="flex items-center">
|
|
512
|
-
<Link to="/" className="text-
|
|
512
|
+
<Link to="/" className="text-main-600 hover:text-main-800 mr-4">
|
|
513
513
|
← Back to Dashboard
|
|
514
514
|
</Link>
|
|
515
515
|
<h1 className="text-xl font-semibold">Users</h1>
|
|
516
516
|
</div>
|
|
517
517
|
<div className="flex items-center space-x-4">
|
|
518
|
-
<span className="text-sm text-
|
|
518
|
+
<span className="text-sm text-sec-700">
|
|
519
519
|
{user.email} | Org: {selectedOrganisationId}
|
|
520
520
|
</span>
|
|
521
521
|
<button
|
|
522
522
|
onClick={() => supabase.auth.signOut()}
|
|
523
|
-
className="text-sm text-
|
|
523
|
+
className="text-sm text-sec-500 hover:text-sec-700"
|
|
524
524
|
>
|
|
525
525
|
Sign out
|
|
526
526
|
</button>
|
|
@@ -531,7 +531,7 @@ export function Users() {
|
|
|
531
531
|
|
|
532
532
|
<main className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
|
|
533
533
|
<div className="px-4 py-6 sm:px-0">
|
|
534
|
-
<div className="border-4 border-dashed border-
|
|
534
|
+
<div className="border-4 border-dashed border-sec-200 rounded-lg h-96 p-8">
|
|
535
535
|
<h2 className="text-2xl font-bold mb-4">User Management</h2>
|
|
536
536
|
|
|
537
537
|
{/* CRITICAL: Use PagePermissionGuard for page-level permissions */}
|
|
@@ -544,7 +544,7 @@ export function Users() {
|
|
|
544
544
|
<p>You have access to the users page!</p>
|
|
545
545
|
<p>This means your RBAC system is working correctly.</p>
|
|
546
546
|
|
|
547
|
-
<div className="bg-
|
|
547
|
+
<div className="bg-main-100 border border-main-400 text-main-700 px-4 py-3 rounded">
|
|
548
548
|
<strong>Success!</strong> Your RBAC setup is working correctly.
|
|
549
549
|
</div>
|
|
550
550
|
</div>
|
|
@@ -777,13 +777,13 @@ class DebugErrorBoundary extends React.Component {
|
|
|
777
777
|
render() {
|
|
778
778
|
if (this.state.hasError) {
|
|
779
779
|
return (
|
|
780
|
-
<div className="p-4 border border-
|
|
781
|
-
<h2 className="text-
|
|
780
|
+
<div className="p-4 border border-acc-500 bg-acc-50">
|
|
781
|
+
<h2 className="text-acc-800 font-bold">Something went wrong</h2>
|
|
782
782
|
<details className="mt-2">
|
|
783
|
-
<summary className="cursor-pointer text-
|
|
783
|
+
<summary className="cursor-pointer text-acc-700">
|
|
784
784
|
Error Details (Click to expand)
|
|
785
785
|
</summary>
|
|
786
|
-
<pre className="mt-2 text-xs text-
|
|
786
|
+
<pre className="mt-2 text-xs text-acc-600 whitespace-pre-wrap">
|
|
787
787
|
{this.state.error && this.state.error.toString()}
|
|
788
788
|
{this.state.errorInfo.componentStack}
|
|
789
789
|
</pre>
|
|
@@ -135,7 +135,7 @@ export function Meals() {
|
|
|
135
135
|
fallback={
|
|
136
136
|
<div className="min-h-screen flex items-center justify-center">
|
|
137
137
|
<div className="text-center">
|
|
138
|
-
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-
|
|
138
|
+
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-sec-900 mx-auto mb-4"></div>
|
|
139
139
|
<p>Loading permissions...</p>
|
|
140
140
|
</div>
|
|
141
141
|
</div>
|