@jmruthers/pace-core 0.5.76 → 0.5.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/{RBACService-C4udt_Zp.d.ts → AuthService-Df3IozMG.d.ts} +10 -118
- package/dist/{DataTable-ntgmhO2W.d.ts → DataTable-BE0OXZKQ.d.ts} +9 -2
- package/dist/{DataTable-4GAVPIEG.js → DataTable-ETGVF4Y5.js} +50 -13
- package/dist/{PublicLoadingSpinner-BiNER8F5.d.ts → PublicLoadingSpinner-CnUaz0vG.d.ts} +5 -2
- package/dist/{UnifiedAuthProvider-Bj6YCf7c.d.ts → UnifiedAuthProvider-B391Aqum.d.ts} +42 -45
- package/dist/{UnifiedAuthProvider-3NKDOSOK.js → UnifiedAuthProvider-P5SOJAQ6.js} +4 -5
- package/dist/{api-DDMUKIUD.js → api-KG4A2X7P.js} +9 -3
- package/dist/{audit-6TOCAMKO.js → audit-65VNHEV2.js} +2 -2
- package/dist/{chunk-K34IM5CT.js → chunk-2OGV6IRV.js} +196 -626
- package/dist/chunk-2OGV6IRV.js.map +1 -0
- package/dist/{chunk-NTNILOBC.js → chunk-5BO3MI5Y.js} +4 -4
- package/dist/{chunk-XLZ7U46Z.js → chunk-CVMVPYAL.js} +9 -60
- package/dist/chunk-CVMVPYAL.js.map +1 -0
- package/dist/{chunk-URUTVZ7N.js → chunk-FL4ZCQLD.js} +2 -2
- package/dist/{chunk-LW7MMEAQ.js → chunk-FT2M4R4F.js} +2 -2
- package/dist/{chunk-5BSLGBYI.js → chunk-JCQZ6LA7.js} +2 -8
- package/dist/{chunk-5BSLGBYI.js.map → chunk-JCQZ6LA7.js.map} +1 -1
- package/dist/{chunk-KHJS6VIA.js → chunk-LRQ6RBJC.js} +157 -112
- package/dist/chunk-LRQ6RBJC.js.map +1 -0
- package/dist/{chunk-WN6XJWOS.js → chunk-MNJXXD6C.js} +274 -743
- package/dist/chunk-MNJXXD6C.js.map +1 -0
- package/dist/{chunk-KK73ZB4E.js → chunk-PTR5PMPE.js} +153 -132
- package/dist/chunk-PTR5PMPE.js.map +1 -0
- package/dist/{chunk-B2WTCLCV.js → chunk-Q7APDV6H.js} +18 -8
- package/dist/chunk-Q7APDV6H.js.map +1 -0
- package/dist/{chunk-A4FUBC7B.js → chunk-QGVSOUJ2.js} +2 -4
- package/dist/{chunk-A4FUBC7B.js.map → chunk-QGVSOUJ2.js.map} +1 -1
- package/dist/{chunk-FGMFQSHX.js → chunk-S63MFSY6.js} +500 -551
- package/dist/chunk-S63MFSY6.js.map +1 -0
- package/dist/{chunk-AFGTSUAD.js → chunk-VSOKOFRF.js} +4 -4
- package/dist/chunk-WUXCWRL6.js +20 -0
- package/dist/chunk-WUXCWRL6.js.map +1 -0
- package/dist/{chunk-Y6TXWPJO.js → chunk-YVVGHRGI.js} +105 -31
- package/dist/chunk-YVVGHRGI.js.map +1 -0
- package/dist/{chunk-M5IWZRBT.js → chunk-ZMNXIJP4.js} +2187 -981
- package/dist/chunk-ZMNXIJP4.js.map +1 -0
- package/dist/components.d.ts +6 -6
- package/dist/components.js +14 -18
- package/dist/components.js.map +1 -1
- package/dist/{database-C3Szpi5J.d.ts → database-BXAfr2Y_.d.ts} +18 -0
- package/dist/hooks.d.ts +5 -5
- package/dist/hooks.js +8 -9
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +19 -27
- package/dist/index.js +21 -29
- package/dist/index.js.map +1 -1
- package/dist/{organisation-BtshODVF.d.ts → organisation-D6qRDtbF.d.ts} +1 -1
- package/dist/providers.d.ts +7 -21
- package/dist/providers.js +3 -10
- package/dist/rbac/index.d.ts +71 -221
- package/dist/rbac/index.js +15 -16
- package/dist/{types-CGX9Vyf5.d.ts → types-BDg1mAGG.d.ts} +36 -6
- package/dist/types.d.ts +3 -3
- package/dist/types.js +61 -18
- package/dist/types.js.map +1 -1
- package/dist/{unified-CM7T0aTK.d.ts → unified-DQ4VcT7H.d.ts} +1 -1
- package/dist/{usePublicRouteParams-B-CumWRc.d.ts → usePublicRouteParams-BlgwXweB.d.ts} +3 -3
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +52 -9
- package/dist/utils.js.map +1 -1
- package/docs/CONTENT_AUDIT_REPORT.md +253 -0
- package/docs/DOCUMENTATION_AUDIT.md +172 -0
- package/docs/README.md +142 -147
- package/docs/STYLE_GUIDE.md +37 -0
- package/docs/api/classes/ColumnFactory.md +17 -17
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +4 -4
- package/docs/api/classes/MissingUserContextError.md +4 -4
- package/docs/api/classes/OrganisationContextRequiredError.md +4 -4
- package/docs/api/classes/PermissionDeniedError.md +5 -5
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +8 -8
- package/docs/api/classes/RBACCache.md +35 -5
- package/docs/api/classes/RBACEngine.md +49 -20
- package/docs/api/classes/RBACError.md +4 -4
- package/docs/api/classes/RBACNotInitializedError.md +4 -4
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +4 -4
- 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 +11 -0
- package/docs/api/interfaces/DataTableAction.md +65 -29
- package/docs/api/interfaces/DataTableColumn.md +36 -23
- package/docs/api/interfaces/DataTableProps.md +80 -38
- package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
- package/docs/api/interfaces/EmptyStateConfig.md +5 -5
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventLogoProps.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/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 +11 -11
- package/docs/api/interfaces/NavigationContextType.md +9 -9
- 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 +7 -7
- 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 +16 -3
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +2 -2
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/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/RBACLogger.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/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 +94 -521
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +16 -16
- 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/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +11 -11
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +251 -269
- package/docs/api-reference/components.md +193 -0
- package/docs/api-reference/hooks.md +265 -0
- package/docs/api-reference/providers.md +6 -0
- package/docs/api-reference/types.md +6 -0
- package/docs/api-reference/utilities.md +207 -0
- package/docs/architecture/README.md +6 -0
- package/docs/{database-schema-requirements.md → architecture/database-schema-requirements.md} +6 -0
- package/docs/architecture/rbac-security-architecture.md +258 -0
- package/docs/architecture/services.md +9 -1
- package/docs/best-practices/README.md +6 -0
- package/docs/best-practices/accessibility.md +6 -0
- package/docs/{common-patterns.md → best-practices/common-patterns.md} +6 -0
- package/docs/best-practices/deployment.md +6 -0
- package/docs/best-practices/performance.md +475 -2
- package/docs/best-practices/security.md +6 -0
- package/docs/best-practices/testing.md +6 -0
- package/docs/core-concepts/authentication.md +6 -0
- package/docs/core-concepts/events.md +6 -0
- package/docs/core-concepts/organisations.md +6 -0
- package/docs/core-concepts/permissions.md +6 -0
- package/docs/core-concepts/rbac-system.md +8 -0
- package/docs/documentation-index.md +121 -182
- package/docs/{consuming-app-vite-config.md → getting-started/consuming-app-vite-config.md} +6 -0
- package/docs/getting-started/documentation-index.md +40 -0
- package/docs/getting-started/examples/README.md +878 -35
- package/docs/{faq.md → getting-started/faq.md} +7 -1
- package/docs/getting-started/installation-guide.md +6 -0
- package/docs/{quick-reference.md → getting-started/quick-reference.md} +6 -0
- package/docs/implementation-guides/app-layout.md +6 -0
- package/docs/implementation-guides/authentication.md +1021 -0
- package/docs/implementation-guides/component-styling.md +6 -0
- package/docs/implementation-guides/data-tables.md +1264 -2076
- package/docs/implementation-guides/dynamic-colors.md +6 -0
- package/docs/implementation-guides/event-theming-summary.md +6 -0
- package/docs/{file-reference-system.md → implementation-guides/file-reference-system.md} +6 -0
- package/docs/implementation-guides/file-upload-storage.md +6 -0
- package/docs/implementation-guides/forms.md +6 -0
- package/docs/implementation-guides/inactivity-tracking.md +6 -0
- package/docs/implementation-guides/navigation.md +6 -0
- package/docs/implementation-guides/organisation-security.md +6 -0
- package/docs/implementation-guides/permission-enforcement.md +6 -0
- package/docs/implementation-guides/public-pages-advanced.md +6 -0
- package/docs/implementation-guides/public-pages.md +6 -0
- package/docs/migration/MIGRATION_GUIDE.md +827 -351
- package/docs/migration/README.md +7 -1
- package/docs/migration/organisation-context-timing-fix.md +6 -0
- package/docs/migration/rbac-migration.md +44 -1
- package/docs/migration/service-architecture.md +6 -0
- package/docs/migration/v0.4.15-tailwind-scanning.md +6 -0
- package/docs/migration/v0.4.16-css-first-approach.md +6 -0
- package/docs/migration/v0.4.17-source-path-fix.md +6 -0
- package/docs/rbac/README-rbac-rls-integration.md +6 -0
- package/docs/rbac/README.md +6 -0
- package/docs/rbac/advanced-patterns.md +6 -0
- package/docs/rbac/api-reference.md +7 -1
- package/docs/rbac/breaking-changes-v3.md +222 -0
- package/docs/rbac/examples/rbac-rls-integration-example.md +6 -0
- package/docs/rbac/examples.md +6 -0
- package/docs/rbac/getting-started.md +6 -0
- package/docs/rbac/migration-guide.md +260 -0
- package/docs/rbac/quick-start.md +70 -13
- package/docs/rbac/rbac-rls-integration.md +6 -0
- package/docs/rbac/super-admin-guide.md +6 -0
- package/docs/rbac/troubleshooting.md +6 -0
- package/docs/security/README.md +6 -0
- package/docs/security/checklist.md +6 -0
- package/docs/styles/README.md +7 -1
- package/docs/{usage.md → styles/usage.md} +6 -0
- package/docs/testing/README.md +6 -0
- package/docs/{visual-testing.md → testing/visual-testing.md} +6 -0
- package/docs/troubleshooting/README.md +387 -5
- package/docs/troubleshooting/cake-page-permission-guard-issue-summary.md +6 -0
- package/docs/troubleshooting/common-issues.md +6 -0
- package/docs/troubleshooting/database-view-compatibility.md +6 -0
- package/docs/troubleshooting/organisation-context-setup.md +6 -0
- package/docs/troubleshooting/react-hooks-issue-analysis.md +6 -0
- package/docs/troubleshooting/styling-issues.md +6 -0
- package/docs/troubleshooting/tailwind-content-scanning.md +6 -0
- package/package.json +1 -1
- package/src/__tests__/helpers/__tests__/test-providers.test.tsx +2 -1
- package/src/__tests__/helpers/test-providers.tsx +3 -53
- package/src/components/DataTable/DataTable.test.tsx +319 -0
- package/src/components/DataTable/DataTable.tsx +32 -11
- package/src/components/DataTable/__tests__/{DataTable.comprehensive.test.tsx → DataTable.comprehensive.test.tsx.skip} +6 -4
- package/src/components/DataTable/__tests__/{DataTable.test.tsx → DataTable.test.tsx.skip} +6 -4
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +31 -9
- package/src/components/DataTable/__tests__/a11y.basic.test.tsx +601 -0
- package/src/components/DataTable/__tests__/keyboard.test.tsx +615 -0
- package/src/components/DataTable/__tests__/pagination.modes.test.tsx +639 -0
- package/src/components/DataTable/__tests__/ssr.strict-mode.test.tsx.skip +330 -0
- package/src/components/DataTable/components/AccessDeniedPage.tsx +2 -2
- package/src/components/DataTable/components/ActionButtons.tsx +88 -104
- package/src/components/DataTable/components/DataTableCore.tsx +309 -337
- package/src/components/DataTable/components/DataTableErrorBoundary.tsx +4 -2
- package/src/components/DataTable/components/DataTableModals.tsx +22 -1
- package/src/components/DataTable/components/EditableRow.tsx +69 -84
- package/src/components/DataTable/components/EmptyState.tsx +5 -1
- package/src/components/DataTable/components/ImportModal.tsx +65 -36
- package/src/components/DataTable/components/PaginationControls.tsx +40 -100
- package/src/components/DataTable/components/UnifiedTableBody.tsx +125 -148
- package/src/components/DataTable/context/DataTableContext.tsx +1 -1
- package/src/components/DataTable/core/ColumnFactory.ts +5 -0
- package/src/components/DataTable/examples/HierarchicalActionsExample.tsx +12 -10
- package/src/components/DataTable/examples/HierarchicalExample.tsx +1 -1
- package/src/components/DataTable/examples/InitialPageSizeExample.tsx +1 -0
- package/src/components/DataTable/examples/PerformanceExample.tsx +1 -0
- package/src/components/DataTable/hooks/__tests__/useColumnOrderPersistence.test.ts +1 -5
- package/src/components/DataTable/hooks/__tests__/useColumnVisibilityPersistence.test.ts +167 -0
- package/src/components/DataTable/hooks/index.ts +7 -0
- package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +32 -15
- package/src/components/DataTable/hooks/useColumnVisibilityPersistence.ts +102 -0
- package/src/components/DataTable/hooks/useDataTableConfiguration.ts +89 -0
- package/src/components/DataTable/hooks/useDataTableDataPipeline.ts +117 -0
- package/src/components/DataTable/hooks/useDataTablePermissions.ts +71 -27
- package/src/components/DataTable/hooks/useDataTableState.ts +39 -11
- package/src/components/DataTable/hooks/useEffectiveColumnOrder.ts +33 -0
- package/src/components/DataTable/hooks/useHierarchicalState.ts +15 -1
- package/src/components/DataTable/hooks/useKeyboardNavigation.ts +447 -0
- package/src/components/DataTable/hooks/useServerSideDataEffect.ts +94 -0
- package/src/components/DataTable/hooks/useTableColumns.ts +10 -7
- package/src/components/DataTable/hooks/useTableHandlers.ts +174 -0
- package/src/components/DataTable/index.ts +12 -3
- package/src/components/DataTable/types.ts +129 -9
- package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +159 -22
- package/src/components/DataTable/utils/__tests__/flexibleImport.test.ts +111 -0
- package/src/components/DataTable/utils/__tests__/rowUtils.test.ts +15 -29
- package/src/components/DataTable/utils/a11yUtils.ts +244 -0
- package/src/components/DataTable/utils/debugTools.ts +609 -0
- package/src/components/DataTable/utils/exportUtils.ts +114 -16
- package/src/components/DataTable/utils/flexibleImport.ts +202 -32
- package/src/components/DataTable/utils/hierarchicalUtils.ts +1 -1
- package/src/components/DataTable/utils/index.ts +2 -0
- package/src/components/DataTable/utils/paginationUtils.ts +350 -0
- package/src/components/DataTable/utils/rowUtils.ts +6 -5
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +19 -24
- package/src/components/NavigationMenu/NavigationMenu.tsx +19 -8
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +1 -23
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +56 -6
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +137 -13
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +1 -1
- package/src/components/Select/Select.tsx +1 -0
- package/src/components/examples/PermissionExample.tsx +173 -0
- package/src/examples/CorrectPublicPageImplementation.tsx +301 -0
- package/src/examples/PublicEventPage.tsx +274 -0
- package/src/examples/PublicPageApp.tsx +308 -0
- package/src/examples/PublicPageUsageExample.tsx +216 -0
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +12 -1
- package/src/hooks/__tests__/useOrganisationSecurity.unit.test.tsx +129 -17
- package/src/hooks/__tests__/useRBAC.unit.test.ts +151 -846
- package/src/hooks/useOrganisationPermissions.test.ts +42 -18
- package/src/hooks/useOrganisationPermissions.ts +12 -6
- package/src/hooks/useOrganisationSecurity.test.ts +138 -85
- package/src/hooks/useOrganisationSecurity.ts +41 -10
- package/src/index.ts +0 -1
- package/src/providers/AuthProvider.simplified.tsx +880 -0
- package/src/providers/UnifiedAuthProvider.test.simple.tsx +8 -8
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +29 -19
- package/src/providers/index.ts +0 -1
- package/src/providers/services/EventServiceProvider.tsx +19 -15
- package/src/providers/services/InactivityServiceProvider.tsx +19 -15
- package/src/providers/services/OrganisationServiceProvider.tsx +19 -15
- package/src/providers/services/UnifiedAuthProvider.tsx +156 -127
- package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +1 -1
- package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +3 -3
- package/src/rbac/README.md +1 -1
- package/src/rbac/__tests__/adapters.comprehensive.test.tsx +25 -27
- package/src/rbac/__tests__/auth-rbac-security.integration.test.tsx +313 -0
- package/src/rbac/__tests__/engine.comprehensive.test.ts +114 -348
- package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +28 -110
- package/src/rbac/__tests__/rbac-engine-simplified.test.ts +33 -85
- package/src/rbac/__tests__/scenarios.user-role.test.tsx +2 -2
- package/src/rbac/adapters.tsx +26 -69
- package/src/rbac/api.test.ts +90 -27
- package/src/rbac/api.ts +61 -10
- package/src/rbac/audit.test.ts +33 -38
- package/src/rbac/audit.ts +21 -6
- package/src/rbac/cache.ts +33 -1
- package/src/rbac/components/NavigationGuard.tsx +11 -11
- package/src/rbac/components/NavigationProvider.test.tsx +11 -5
- package/src/rbac/components/NavigationProvider.tsx +37 -13
- package/src/rbac/components/PagePermissionGuard.tsx +111 -50
- package/src/rbac/components/PagePermissionProvider.tsx +5 -5
- package/src/rbac/components/PermissionEnforcer.tsx +11 -11
- package/src/rbac/components/RoleBasedRouter.tsx +5 -5
- package/src/rbac/components/SecureDataProvider.tsx +5 -5
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +8 -8
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +14 -14
- package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +12 -12
- package/src/rbac/components/__tests__/RoleBasedRouter.test.tsx +6 -6
- package/src/rbac/engine.test.simple.ts +19 -13
- package/src/rbac/engine.test.ts +1 -0
- package/src/rbac/engine.ts +330 -766
- package/src/rbac/errors.ts +156 -0
- package/src/rbac/hooks/usePermissions.ts +32 -10
- package/src/rbac/hooks/useRBAC.test.ts +126 -512
- package/src/rbac/hooks/useRBAC.ts +147 -193
- package/src/rbac/hooks/useResolvedScope.ts +12 -0
- package/src/rbac/index.ts +7 -4
- package/src/rbac/security.ts +109 -18
- package/src/rbac/types.ts +12 -1
- package/src/services/AuthService.ts +2 -15
- package/src/services/EventService.ts +43 -46
- package/src/services/OrganisationService.ts +51 -31
- package/src/services/__tests__/AuthService.test.ts +1 -1
- package/src/services/__tests__/EventService.test.ts +1 -1
- package/src/services/__tests__/OrganisationService.test.ts +1 -1
- package/src/services/base/BaseService.ts +8 -0
- package/src/styles/base.css +208 -0
- package/src/styles/semantic.css +24 -0
- package/src/types/database.generated.ts +7347 -0
- package/src/types/database.ts +20 -0
- package/src/utils/logger.ts +179 -0
- package/src/utils/organisationContext.ts +11 -4
- package/src/utils/storage/__tests__/helpers.unit.test.ts +6 -2
- package/dist/appNameResolver-UURKN7NF.js +0 -22
- package/dist/audit-6TOCAMKO.js.map +0 -1
- package/dist/chunk-B2WTCLCV.js.map +0 -1
- package/dist/chunk-FGMFQSHX.js.map +0 -1
- package/dist/chunk-K34IM5CT.js.map +0 -1
- package/dist/chunk-KHJS6VIA.js.map +0 -1
- package/dist/chunk-KK73ZB4E.js.map +0 -1
- package/dist/chunk-M5IWZRBT.js.map +0 -1
- package/dist/chunk-ULBI5JGB.js +0 -109
- package/dist/chunk-ULBI5JGB.js.map +0 -1
- package/dist/chunk-WN6XJWOS.js.map +0 -1
- package/dist/chunk-XLZ7U46Z.js.map +0 -1
- package/dist/chunk-Y6TXWPJO.js.map +0 -1
- package/docs/DOCUMENTATION_CHECKLIST.md +0 -281
- package/docs/TERMINOLOGY.md +0 -231
- package/docs/api/interfaces/RBACContextType.md +0 -468
- package/docs/api/interfaces/RBACProviderProps.md +0 -107
- package/docs/best-practices/performance-expansion.md +0 -473
- package/docs/breaking-changes.md +0 -179
- package/docs/consuming-app-example.md +0 -290
- package/docs/documentation-templates.md +0 -539
- package/docs/examples/navigation-menu-auth-fix.md +0 -344
- package/docs/getting-started/examples/basic-auth-app.md +0 -520
- package/docs/getting-started/examples/full-featured-app.md +0 -616
- package/docs/getting-started/quick-start.md +0 -376
- package/docs/implementation-guides/datatable-filtering.md +0 -313
- package/docs/implementation-guides/datatable-rbac-usage.md +0 -317
- package/docs/implementation-guides/hierarchical-datatable.md +0 -850
- package/docs/implementation-guides/large-datasets.md +0 -281
- package/docs/implementation-guides/performance.md +0 -403
- package/docs/migration/quick-migration-guide.md +0 -320
- package/docs/migration-guide.md +0 -193
- package/docs/migration-guides/unified-auth-provider-mandatory-timeouts.md +0 -226
- package/docs/performance/README.md +0 -551
- package/docs/style-guide.md +0 -964
- package/docs/troubleshooting/authentication-issues.md +0 -334
- package/docs/troubleshooting/debugging.md +0 -1117
- package/docs/troubleshooting/migration.md +0 -918
- package/src/__tests__/hooks/usePermissions.test.ts +0 -261
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +0 -574
- package/src/hooks/__tests__/ServiceHooks.test.tsx +0 -613
- package/src/hooks/services/__tests__/useServiceHooks.test.tsx +0 -137
- package/src/hooks/services/usePermissions.ts +0 -70
- package/src/hooks/services/useRBACService.ts +0 -30
- package/src/hooks/usePermissionCheck.ts +0 -150
- package/src/providers/__tests__/ServiceProviders.test.tsx +0 -477
- package/src/providers/services/RBACServiceProvider.tsx +0 -79
- package/src/rbac/__tests__/integration.authflow.test.tsx +0 -119
- package/src/rbac/__tests__/integration.navigation.test.tsx +0 -69
- package/src/rbac/__tests__/integration.securedata.test.tsx +0 -92
- package/src/rbac/__tests__/integration.smoke.test.tsx +0 -73
- package/src/rbac/providers/RBACProvider.tsx +0 -645
- package/src/rbac/providers/__tests__/RBACProvider.integration.test.tsx +0 -688
- package/src/rbac/providers/__tests__/RBACProvider.test.tsx +0 -1186
- package/src/rbac/providers/index.ts +0 -11
- package/src/services/RBACService.ts +0 -522
- package/src/services/__tests__/RBACService.test.ts +0 -492
- package/src/services/interfaces/IRBACService.ts +0 -62
- package/src/utils/appNameResolver.test 2.ts +0 -494
- /package/dist/{DataTable-4GAVPIEG.js.map → DataTable-ETGVF4Y5.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-3NKDOSOK.js.map → UnifiedAuthProvider-P5SOJAQ6.js.map} +0 -0
- /package/dist/{api-DDMUKIUD.js.map → api-KG4A2X7P.js.map} +0 -0
- /package/dist/{appNameResolver-UURKN7NF.js.map → audit-65VNHEV2.js.map} +0 -0
- /package/dist/{chunk-NTNILOBC.js.map → chunk-5BO3MI5Y.js.map} +0 -0
- /package/dist/{chunk-URUTVZ7N.js.map → chunk-FL4ZCQLD.js.map} +0 -0
- /package/dist/{chunk-LW7MMEAQ.js.map → chunk-FT2M4R4F.js.map} +0 -0
- /package/dist/{chunk-AFGTSUAD.js.map → chunk-VSOKOFRF.js.map} +0 -0
- /package/docs/{app.css.example → styles/app.css.example} +0 -0
package/docs/style-guide.md
DELETED
|
@@ -1,964 +0,0 @@
|
|
|
1
|
-
# PACE Core Documentation Style Guide
|
|
2
|
-
|
|
3
|
-
This comprehensive style guide ensures consistency, clarity, and maintainability across all PACE Core documentation. This is the single source of truth for documentation standards.
|
|
4
|
-
|
|
5
|
-
> **📚 Navigation:** [← Documentation Home](./README.md) | [Review Report](../DOCUMENTATION_REVIEW_REPORT.md)
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
**Last Updated:** 2025-01-XX | **Version:** v0.5.65+
|
|
10
|
-
|
|
11
|
-
## 📋 Table of Contents
|
|
12
|
-
|
|
13
|
-
1. [Writing Principles](#writing-principles)
|
|
14
|
-
2. [Formatting Standards](#formatting-standards)
|
|
15
|
-
3. [Content Structure](#content-structure)
|
|
16
|
-
4. [Code Examples](#code-examples)
|
|
17
|
-
5. [Cross-References](#cross-references)
|
|
18
|
-
6. [Component Documentation](#component-documentation)
|
|
19
|
-
7. [API Reference Standards](#api-reference-standards)
|
|
20
|
-
8. [Troubleshooting Guidelines](#troubleshooting-guidelines)
|
|
21
|
-
9. [Maintenance Checklist](#maintenance-checklist)
|
|
22
|
-
10. [Quality Assurance](#quality-assurance)
|
|
23
|
-
|
|
24
|
-
## 📝 Writing Principles
|
|
25
|
-
|
|
26
|
-
### 1. Clarity First
|
|
27
|
-
- **Use simple, clear language** - Avoid jargon and technical complexity
|
|
28
|
-
- **Be specific** - Provide concrete examples and exact code snippets
|
|
29
|
-
- **Explain the "why"** - Don't just show what to do, explain why it's important
|
|
30
|
-
- **Use active voice** - "Create a component" not "A component should be created"
|
|
31
|
-
- **Write for the user's context** - Consider their experience level and use case
|
|
32
|
-
|
|
33
|
-
### 2. Developer-Focused
|
|
34
|
-
- **Start with practical examples** - Show working code first
|
|
35
|
-
- **Provide complete examples** - Include imports, setup, and usage
|
|
36
|
-
- **Include error handling** - Show how to handle common issues
|
|
37
|
-
- **Use realistic data** - Use meaningful variable names and values
|
|
38
|
-
- **Show the complete flow** - From installation to implementation
|
|
39
|
-
|
|
40
|
-
### 3. Consistent Structure
|
|
41
|
-
- **Use consistent headings** - Follow the established hierarchy
|
|
42
|
-
- **Standardize code blocks** - Use consistent formatting and syntax highlighting
|
|
43
|
-
- **Maintain uniform examples** - Use consistent variable names and patterns
|
|
44
|
-
- **Follow the template structure** - Use provided templates for consistency
|
|
45
|
-
|
|
46
|
-
## 🎨 Formatting Standards
|
|
47
|
-
|
|
48
|
-
### Headings
|
|
49
|
-
|
|
50
|
-
```markdown
|
|
51
|
-
# Main Title (H1) - Only in README files
|
|
52
|
-
## Section Title (H2) - Major sections
|
|
53
|
-
### Subsection (H3) - Subsections
|
|
54
|
-
#### Detail (H4) - Specific details
|
|
55
|
-
##### Note (H5) - Important notes
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Code Blocks
|
|
59
|
-
|
|
60
|
-
**TypeScript/JavaScript:**
|
|
61
|
-
```tsx
|
|
62
|
-
// ✅ Good - Complete, runnable example
|
|
63
|
-
import { useCan } from '@jmruthers/pace-core';
|
|
64
|
-
|
|
65
|
-
function UserActions({ userId, scope }) {
|
|
66
|
-
const { hasPermission, isLoading } = useCan();
|
|
67
|
-
const [canEdit, setCanEdit] = useState(false);
|
|
68
|
-
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
const checkPermission = async () => {
|
|
71
|
-
if (!isLoading) {
|
|
72
|
-
const editPerm = await hasPermission('update:users', { userId, scope });
|
|
73
|
-
setCanEdit(editPerm);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
checkPermission();
|
|
78
|
-
}, [hasPermission, isLoading, userId, scope]);
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<div>
|
|
82
|
-
{canEdit && <EditButton />}
|
|
83
|
-
</div>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**SQL:**
|
|
89
|
-
```sql
|
|
90
|
-
-- ✅ Good - Clear, commented SQL
|
|
91
|
-
SELECT
|
|
92
|
-
user_id,
|
|
93
|
-
organisation_id,
|
|
94
|
-
role,
|
|
95
|
-
status
|
|
96
|
-
FROM rbac_organisation_roles
|
|
97
|
-
WHERE user_id = 'user-123'
|
|
98
|
-
AND organisation_id = 'org-456'
|
|
99
|
-
AND status = 'active';
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Callouts and Alerts
|
|
103
|
-
|
|
104
|
-
```markdown
|
|
105
|
-
> **📚 New Developer?** Start with the [Quick Start Guide](./quick-start.md) to get up and running in 5 minutes.
|
|
106
|
-
|
|
107
|
-
> **🔄 Migrating?** If you're upgrading from the legacy RBAC system, see the [Migration Guide](./migration/rbac-migration.md) for step-by-step instructions.
|
|
108
|
-
|
|
109
|
-
> **⚠️ Important**: Always include organisation context in permission checks.
|
|
110
|
-
|
|
111
|
-
> **💡 Tip**: Use batch permission checking for better performance when checking multiple permissions.
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Lists and Bullets
|
|
115
|
-
|
|
116
|
-
```markdown
|
|
117
|
-
- **Use bold for key terms** - Makes scanning easier
|
|
118
|
-
- **Keep items parallel** - Use consistent grammar and structure
|
|
119
|
-
- **Limit to 7 items** - Break longer lists into subsections
|
|
120
|
-
- **Use numbered lists for steps** - When order matters
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## 📚 Content Structure
|
|
124
|
-
|
|
125
|
-
### File Organisation
|
|
126
|
-
|
|
127
|
-
```
|
|
128
|
-
docs/
|
|
129
|
-
├── README.md # Main entry point
|
|
130
|
-
├── INDEX.md # Complete documentation index
|
|
131
|
-
├── getting-started/ # Onboarding content
|
|
132
|
-
│ ├── installation.md
|
|
133
|
-
│ ├── quick-start.md
|
|
134
|
-
│ └── examples/
|
|
135
|
-
├── core-concepts/ # Fundamental concepts
|
|
136
|
-
│ ├── authentication.md
|
|
137
|
-
│ ├── rbac-system.md
|
|
138
|
-
│ └── permissions.md
|
|
139
|
-
├── rbac/ # RBAC module docs
|
|
140
|
-
│ ├── README.md
|
|
141
|
-
│ ├── quick-start.md
|
|
142
|
-
│ ├── api-reference.md
|
|
143
|
-
│ ├── examples.md
|
|
144
|
-
│ ├── advanced-patterns.md
|
|
145
|
-
│ └── troubleshooting.md
|
|
146
|
-
├── implementation-guides/ # Practical guides
|
|
147
|
-
│ ├── app-layout.md
|
|
148
|
-
│ ├── permission-enforcement.md
|
|
149
|
-
│ ├── data-tables.md
|
|
150
|
-
│ ├── file-upload-storage.md # NEW
|
|
151
|
-
│ ├── inactivity-tracking.md # NEW
|
|
152
|
-
│ ├── organisation-security.md # NEW
|
|
153
|
-
│ └── public-pages-advanced.md # NEW
|
|
154
|
-
├── api-reference/ # Complete API docs
|
|
155
|
-
│ ├── components.md
|
|
156
|
-
│ ├── hooks.md
|
|
157
|
-
│ └── types.md
|
|
158
|
-
├── best-practices/ # Production patterns
|
|
159
|
-
│ ├── security.md
|
|
160
|
-
│ ├── performance.md
|
|
161
|
-
│ └── testing.md
|
|
162
|
-
├── migration/ # Migration guides
|
|
163
|
-
│ ├── MIGRATION_GUIDE.md # NEW - Unified guide
|
|
164
|
-
│ └── rbac-migration.md
|
|
165
|
-
└── troubleshooting/ # Problem solving
|
|
166
|
-
├── common-issues.md
|
|
167
|
-
└── debugging.md
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### File Naming Conventions
|
|
171
|
-
|
|
172
|
-
**Implementation Guides:**
|
|
173
|
-
- `kebab-case.md` - Use hyphens for multi-word files
|
|
174
|
-
- `feature-name.md` - Descriptive, feature-focused names
|
|
175
|
-
- `advanced-feature-name.md` - For advanced/comprehensive guides
|
|
176
|
-
|
|
177
|
-
**API Reference:**
|
|
178
|
-
- `components.md` - Plural for main API files
|
|
179
|
-
- `hooks.md` - Plural for hook collections
|
|
180
|
-
- `types.md` - Plural for type collections
|
|
181
|
-
|
|
182
|
-
**Migration Guides:**
|
|
183
|
-
- `MIGRATION_GUIDE.md` - All caps for main reference
|
|
184
|
-
- `v0.4.17-source-path-fix.md` - Version-specific with descriptive name
|
|
185
|
-
- `rbac-migration.md` - Feature-specific migration
|
|
186
|
-
|
|
187
|
-
**Troubleshooting:**
|
|
188
|
-
- `common-issues.md` - General troubleshooting
|
|
189
|
-
- `specific-issue-name.md` - Specific problem guides
|
|
190
|
-
|
|
191
|
-
### Standard Sections
|
|
192
|
-
|
|
193
|
-
Each documentation file should include:
|
|
194
|
-
|
|
195
|
-
1. **Title and Description** - Clear purpose and overview
|
|
196
|
-
2. **Prerequisites** - What readers need to know first
|
|
197
|
-
3. **Quick Start** - Get up and running quickly
|
|
198
|
-
4. **Detailed Guide** - Comprehensive coverage
|
|
199
|
-
5. **Examples** - Practical, working examples
|
|
200
|
-
6. **API Reference** - Complete technical details
|
|
201
|
-
7. **Troubleshooting** - Common issues and solutions
|
|
202
|
-
8. **Next Steps** - What to read next
|
|
203
|
-
|
|
204
|
-
## 💻 Code Examples
|
|
205
|
-
|
|
206
|
-
### Example Standards
|
|
207
|
-
|
|
208
|
-
1. **Complete and Runnable**
|
|
209
|
-
```tsx
|
|
210
|
-
// ✅ Good - Complete example with imports
|
|
211
|
-
import React, { useState, useEffect } from 'react';
|
|
212
|
-
import { useCan } from '@jmruthers/pace-core';
|
|
213
|
-
|
|
214
|
-
function UserActions({ userId, scope }) {
|
|
215
|
-
const { hasPermission, isLoading } = useCan();
|
|
216
|
-
const [canEdit, setCanEdit] = useState(false);
|
|
217
|
-
|
|
218
|
-
useEffect(() => {
|
|
219
|
-
const checkPermission = async () => {
|
|
220
|
-
if (!isLoading) {
|
|
221
|
-
const editPerm = await hasPermission('update:users', { userId, scope });
|
|
222
|
-
setCanEdit(editPerm);
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
checkPermission();
|
|
227
|
-
}, [hasPermission, isLoading, userId, scope]);
|
|
228
|
-
|
|
229
|
-
if (isLoading) return <div>Loading permissions...</div>;
|
|
230
|
-
|
|
231
|
-
return (
|
|
232
|
-
<div>
|
|
233
|
-
{canEdit && <button>Edit User</button>}
|
|
234
|
-
</div>
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
2. **Error Handling Included**
|
|
240
|
-
```tsx
|
|
241
|
-
// ✅ Good - Includes error handling
|
|
242
|
-
try {
|
|
243
|
-
const canEdit = await hasPermission('update:users', { userId, scope });
|
|
244
|
-
setCanEdit(canEdit);
|
|
245
|
-
} catch (error) {
|
|
246
|
-
console.error('Permission check failed:', error);
|
|
247
|
-
setCanEdit(false);
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
3. **Consistent Naming**
|
|
252
|
-
```tsx
|
|
253
|
-
// ✅ Good - Consistent variable names
|
|
254
|
-
const userId = 'user-123';
|
|
255
|
-
const scope = { organisationId: 'org-456' };
|
|
256
|
-
const permission = 'update:users';
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### Code Block Guidelines
|
|
260
|
-
|
|
261
|
-
- **Use TypeScript** - Always use `.tsx` for React components
|
|
262
|
-
- **Include imports** - Show all necessary imports
|
|
263
|
-
- **Add comments** - Explain complex logic
|
|
264
|
-
- **Handle edge cases** - Show loading states, error handling
|
|
265
|
-
- **Use realistic data** - Use meaningful variable names and values
|
|
266
|
-
|
|
267
|
-
## 🔗 Cross-References
|
|
268
|
-
|
|
269
|
-
### Internal Links
|
|
270
|
-
|
|
271
|
-
```markdown
|
|
272
|
-
<!-- ✅ Good - Clear, descriptive links -->
|
|
273
|
-
See the [RBAC Quick Start Guide](./rbac/quick-start.md) for a complete example.
|
|
274
|
-
|
|
275
|
-
<!-- ❌ Avoid - Vague links -->
|
|
276
|
-
See [this guide](./rbac/quick-start.md) for more info.
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Link Patterns
|
|
280
|
-
|
|
281
|
-
- **Use descriptive text** - Link text should explain what the reader will find
|
|
282
|
-
- **Keep links current** - Update links when files are moved or renamed
|
|
283
|
-
- **Use relative paths** - Use `./` for same directory, `../` for parent directory
|
|
284
|
-
- **Test all links** - Verify links work before publishing
|
|
285
|
-
|
|
286
|
-
## 🧩 Component Documentation
|
|
287
|
-
|
|
288
|
-
### Component Structure
|
|
289
|
-
|
|
290
|
-
Each component should be documented with:
|
|
291
|
-
|
|
292
|
-
1. **Overview** - What the component does
|
|
293
|
-
2. **Props** - Complete prop interface with types
|
|
294
|
-
3. **Usage** - Basic usage example
|
|
295
|
-
4. **Variants** - Different variants and states
|
|
296
|
-
5. **Accessibility** - Accessibility features and requirements
|
|
297
|
-
6. **Examples** - Practical usage examples
|
|
298
|
-
7. **Troubleshooting** - Common issues and solutions
|
|
299
|
-
|
|
300
|
-
### Example Component Documentation
|
|
301
|
-
|
|
302
|
-
```markdown
|
|
303
|
-
## Button
|
|
304
|
-
|
|
305
|
-
A versatile button component with multiple variants and states.
|
|
306
|
-
|
|
307
|
-
### Props
|
|
308
|
-
|
|
309
|
-
```typescript
|
|
310
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
311
|
-
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
312
|
-
size?: 'default' | 'sm' | 'lg' | 'icon';
|
|
313
|
-
asChild?: boolean;
|
|
314
|
-
className?: string;
|
|
315
|
-
}
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
### Usage
|
|
319
|
-
|
|
320
|
-
```tsx
|
|
321
|
-
import { Button } from '@jmruthers/pace-core';
|
|
322
|
-
|
|
323
|
-
// Default button
|
|
324
|
-
<Button onClick={handleClick}>
|
|
325
|
-
Click me
|
|
326
|
-
</Button>
|
|
327
|
-
|
|
328
|
-
// Destructive button
|
|
329
|
-
<Button variant="destructive" size="lg">
|
|
330
|
-
Delete
|
|
331
|
-
</Button>
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
### Variants
|
|
335
|
-
|
|
336
|
-
- **default**: Primary button with solid background
|
|
337
|
-
- **destructive**: Red button for dangerous actions
|
|
338
|
-
- **outline**: Bordered button with transparent background
|
|
339
|
-
- **secondary**: Secondary button with muted styling
|
|
340
|
-
- **ghost**: Transparent button with hover effects
|
|
341
|
-
- **link**: Button styled as a link
|
|
342
|
-
|
|
343
|
-
### Accessibility
|
|
344
|
-
|
|
345
|
-
- Supports keyboard navigation
|
|
346
|
-
- Proper ARIA attributes
|
|
347
|
-
- Focus management
|
|
348
|
-
- Screen reader support
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
## 📋 API Reference Standards
|
|
352
|
-
|
|
353
|
-
### Hook Documentation
|
|
354
|
-
|
|
355
|
-
```markdown
|
|
356
|
-
## useCan
|
|
357
|
-
|
|
358
|
-
Hook for checking user permissions with caching and error handling.
|
|
359
|
-
|
|
360
|
-
### Signature
|
|
361
|
-
|
|
362
|
-
```typescript
|
|
363
|
-
function useCan(): {
|
|
364
|
-
hasPermission: (permission: Permission, scope?: Scope) => Promise<boolean>;
|
|
365
|
-
hasAnyPermission: (permissions: Permission[], scope?: Scope) => Promise<boolean>;
|
|
366
|
-
hasAllPermissions: (permissions: Permission[], scope?: Scope) => Promise<boolean>;
|
|
367
|
-
isLoading: boolean;
|
|
368
|
-
error: Error | null;
|
|
369
|
-
}
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
### Parameters
|
|
373
|
-
|
|
374
|
-
- **permission**: The permission to check
|
|
375
|
-
- **scope**: Optional scope context (organisation, event, etc.)
|
|
376
|
-
|
|
377
|
-
### Returns
|
|
378
|
-
|
|
379
|
-
- **hasPermission**: Function to check a single permission
|
|
380
|
-
- **hasAnyPermission**: Function to check if user has any of the permissions
|
|
381
|
-
- **hasAllPermissions**: Function to check if user has all permissions
|
|
382
|
-
- **isLoading**: Whether the permission check is in progress
|
|
383
|
-
- **error**: Any error that occurred during the check
|
|
384
|
-
|
|
385
|
-
### Example
|
|
386
|
-
|
|
387
|
-
```tsx
|
|
388
|
-
import { useCan } from '@jmruthers/pace-core';
|
|
389
|
-
|
|
390
|
-
function UserActions({ userId }) {
|
|
391
|
-
const { hasPermission, isLoading } = useCan();
|
|
392
|
-
const [canEdit, setCanEdit] = useState(false);
|
|
393
|
-
|
|
394
|
-
useEffect(() => {
|
|
395
|
-
const checkPermission = async () => {
|
|
396
|
-
const editPerm = await hasPermission('update:users', { userId });
|
|
397
|
-
setCanEdit(editPerm);
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
checkPermission();
|
|
401
|
-
}, [hasPermission, userId]);
|
|
402
|
-
|
|
403
|
-
if (isLoading) return <div>Loading...</div>;
|
|
404
|
-
|
|
405
|
-
return (
|
|
406
|
-
<div>
|
|
407
|
-
{canEdit && <EditButton />}
|
|
408
|
-
</div>
|
|
409
|
-
);
|
|
410
|
-
}
|
|
411
|
-
```
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
## 🆘 Troubleshooting Guidelines
|
|
415
|
-
|
|
416
|
-
### Common Issues Structure
|
|
417
|
-
|
|
418
|
-
```markdown
|
|
419
|
-
## Common Issues
|
|
420
|
-
|
|
421
|
-
### Issue: Permission Check Always Returns False
|
|
422
|
-
|
|
423
|
-
**Symptoms:**
|
|
424
|
-
- Permission checks return false even for valid permissions
|
|
425
|
-
- No error messages are displayed
|
|
426
|
-
|
|
427
|
-
**Causes:**
|
|
428
|
-
1. Missing organisation context
|
|
429
|
-
2. Incorrect permission format
|
|
430
|
-
3. User not authenticated
|
|
431
|
-
|
|
432
|
-
**Solutions:**
|
|
433
|
-
|
|
434
|
-
1. **Check Organisation Context**
|
|
435
|
-
```tsx
|
|
436
|
-
// ❌ Wrong - Missing organisation context
|
|
437
|
-
const canEdit = await hasPermission('update:users');
|
|
438
|
-
|
|
439
|
-
// ✅ Correct - Include organisation context
|
|
440
|
-
const canEdit = await hasPermission('update:users', {
|
|
441
|
-
organisationId: currentOrganisation.id
|
|
442
|
-
});
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
2. **Verify Permission Format**
|
|
446
|
-
```tsx
|
|
447
|
-
// ❌ Wrong - Incorrect format
|
|
448
|
-
const canEdit = await hasPermission('update users');
|
|
449
|
-
|
|
450
|
-
// ✅ Correct - Use colon format
|
|
451
|
-
const canEdit = await hasPermission('update:users');
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
3. **Check Authentication**
|
|
455
|
-
```tsx
|
|
456
|
-
const { user, isLoading } = useUnifiedAuth();
|
|
457
|
-
|
|
458
|
-
if (isLoading) return <div>Loading...</div>;
|
|
459
|
-
if (!user) return <div>Please log in</div>;
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
**Prevention:**
|
|
463
|
-
- Always include organisation context in permission checks
|
|
464
|
-
- Use TypeScript for permission type safety
|
|
465
|
-
- Test permission checks in development
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
## 🔧 Maintenance Checklist
|
|
469
|
-
|
|
470
|
-
### Before Publishing
|
|
471
|
-
|
|
472
|
-
- [ ] **Accuracy** - All code examples work and are current
|
|
473
|
-
- [ ] **Completeness** - All necessary information is included
|
|
474
|
-
- [ ] **Clarity** - Content is easy to understand
|
|
475
|
-
- [ ] **Consistency** - Follows style guide and patterns
|
|
476
|
-
- [ ] **Code examples** - All code is tested and working
|
|
477
|
-
- [ ] **Links** - All internal and external links work
|
|
478
|
-
- [ ] **Formatting** - Consistent markdown formatting
|
|
479
|
-
- [ ] **Images** - All images are optimized and accessible
|
|
480
|
-
- [ ] **Navigation** - Clear path through the content
|
|
481
|
-
- [ ] **Examples** - Practical, real-world examples
|
|
482
|
-
- [ ] **Troubleshooting** - Common issues are addressed
|
|
483
|
-
- [ ] **Next steps** - Clear guidance on what to do next
|
|
484
|
-
|
|
485
|
-
### Regular Updates
|
|
486
|
-
|
|
487
|
-
1. **Review quarterly** - Check for outdated information
|
|
488
|
-
2. **Update examples** - Ensure code examples work with current versions
|
|
489
|
-
3. **Test links** - Verify all links are still valid
|
|
490
|
-
4. **Gather feedback** - Ask developers about confusing sections
|
|
491
|
-
|
|
492
|
-
### Version Control
|
|
493
|
-
|
|
494
|
-
- **Update with code changes** - Documentation should reflect current implementation
|
|
495
|
-
- **Maintain changelog** - Track documentation changes
|
|
496
|
-
- **Test before merging** - Verify all examples work
|
|
497
|
-
- **Review with team** - Get feedback from other developers
|
|
498
|
-
|
|
499
|
-
## 🎯 Quality Assurance
|
|
500
|
-
|
|
501
|
-
### Content Review
|
|
502
|
-
|
|
503
|
-
1. **Technical Accuracy**
|
|
504
|
-
- All code examples compile and run
|
|
505
|
-
- API references match actual implementation
|
|
506
|
-
- Import paths are correct
|
|
507
|
-
- Environment variables are accurate
|
|
508
|
-
|
|
509
|
-
2. **Completeness**
|
|
510
|
-
- All exported components are documented
|
|
511
|
-
- All hooks have usage examples
|
|
512
|
-
- All props are documented with types
|
|
513
|
-
- Common use cases are covered
|
|
514
|
-
|
|
515
|
-
3. **Consistency**
|
|
516
|
-
- Terminology is consistent throughout
|
|
517
|
-
- Code examples follow the same patterns
|
|
518
|
-
- Formatting is uniform
|
|
519
|
-
- Cross-references are accurate
|
|
520
|
-
|
|
521
|
-
4. **User Experience**
|
|
522
|
-
- Clear navigation path
|
|
523
|
-
- Practical examples
|
|
524
|
-
- Troubleshooting guidance
|
|
525
|
-
- Next steps provided
|
|
526
|
-
|
|
527
|
-
### Testing Process
|
|
528
|
-
|
|
529
|
-
1. **Code Examples** - Test all code examples in isolation
|
|
530
|
-
2. **Links** - Verify all internal and external links
|
|
531
|
-
3. **Cross-References** - Check all cross-references are accurate
|
|
532
|
-
4. **Import Paths** - Verify all import paths work
|
|
533
|
-
5. **Environment Variables** - Check environment variable names
|
|
534
|
-
|
|
535
|
-
### Review Process
|
|
536
|
-
|
|
537
|
-
1. **Self-Review** - Author reviews against checklist
|
|
538
|
-
2. **Technical Review** - Another developer reviews for accuracy
|
|
539
|
-
3. **User Testing** - Test with new developers
|
|
540
|
-
4. **Final Review** - Final check before publishing
|
|
541
|
-
|
|
542
|
-
## 📊 Metrics and Monitoring
|
|
543
|
-
|
|
544
|
-
### Documentation Health
|
|
545
|
-
|
|
546
|
-
- **Broken Links** - Monitor and fix broken links
|
|
547
|
-
- **Outdated Examples** - Track examples that need updates
|
|
548
|
-
- **User Feedback** - Collect and act on user feedback
|
|
549
|
-
- **Search Success** - Monitor search success rates
|
|
550
|
-
|
|
551
|
-
### Improvement Areas
|
|
552
|
-
|
|
553
|
-
- **Common Questions** - Document frequently asked questions
|
|
554
|
-
- **Pain Points** - Address common developer pain points
|
|
555
|
-
- **Missing Content** - Identify and fill content gaps
|
|
556
|
-
- **Outdated Information** - Keep information current
|
|
557
|
-
|
|
558
|
-
## 📋 Documentation Templates
|
|
559
|
-
|
|
560
|
-
### Implementation Guide Template
|
|
561
|
-
|
|
562
|
-
```markdown
|
|
563
|
-
# [Feature Name]
|
|
564
|
-
|
|
565
|
-
> **📝 Brief Description** | [← Back to Documentation](../README.md) | [↑ Table of Contents](#table-of-contents)
|
|
566
|
-
|
|
567
|
-
[Brief overview of the feature and its purpose]
|
|
568
|
-
|
|
569
|
-
## Overview
|
|
570
|
-
|
|
571
|
-
[Detailed explanation of what the feature does and why it's useful]
|
|
572
|
-
|
|
573
|
-
## Quick Start
|
|
574
|
-
|
|
575
|
-
### 1. Basic Usage
|
|
576
|
-
|
|
577
|
-
```tsx
|
|
578
|
-
// Complete working example
|
|
579
|
-
import { ComponentName } from '@jmruthers/pace-core';
|
|
580
|
-
|
|
581
|
-
function MyComponent() {
|
|
582
|
-
return <ComponentName />;
|
|
583
|
-
}
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
### 2. [Advanced Usage Pattern]
|
|
587
|
-
|
|
588
|
-
```tsx
|
|
589
|
-
// More complex example
|
|
590
|
-
```
|
|
591
|
-
|
|
592
|
-
## Components
|
|
593
|
-
|
|
594
|
-
### [ComponentName]
|
|
595
|
-
|
|
596
|
-
[Description of component]
|
|
597
|
-
|
|
598
|
-
#### Props
|
|
599
|
-
|
|
600
|
-
```typescript
|
|
601
|
-
interface ComponentProps {
|
|
602
|
-
// Props interface
|
|
603
|
-
}
|
|
604
|
-
```
|
|
605
|
-
|
|
606
|
-
#### Usage Examples
|
|
607
|
-
|
|
608
|
-
[Multiple usage examples]
|
|
609
|
-
|
|
610
|
-
## Hooks
|
|
611
|
-
|
|
612
|
-
### [useHookName]
|
|
613
|
-
|
|
614
|
-
[Description of hook]
|
|
615
|
-
|
|
616
|
-
#### Interface
|
|
617
|
-
|
|
618
|
-
```typescript
|
|
619
|
-
interface UseHookReturn {
|
|
620
|
-
// Return type interface
|
|
621
|
-
}
|
|
622
|
-
```
|
|
623
|
-
|
|
624
|
-
#### Usage Examples
|
|
625
|
-
|
|
626
|
-
[Multiple usage examples]
|
|
627
|
-
|
|
628
|
-
## [Additional Sections]
|
|
629
|
-
|
|
630
|
-
[Feature-specific sections]
|
|
631
|
-
|
|
632
|
-
## Troubleshooting
|
|
633
|
-
|
|
634
|
-
### Common Issues
|
|
635
|
-
|
|
636
|
-
[Common problems and solutions]
|
|
637
|
-
|
|
638
|
-
## Next Steps
|
|
639
|
-
|
|
640
|
-
- [Related documentation links]
|
|
641
|
-
```
|
|
642
|
-
|
|
643
|
-
### API Reference Template
|
|
644
|
-
|
|
645
|
-
```markdown
|
|
646
|
-
# [API Section] API Reference
|
|
647
|
-
|
|
648
|
-
> **📚 Complete API Reference** | [← Back to Documentation](../README.md) | [↑ Table of Contents](#table-of-contents)
|
|
649
|
-
|
|
650
|
-
[Brief description of the API section]
|
|
651
|
-
|
|
652
|
-
## [Item Name]
|
|
653
|
-
|
|
654
|
-
[Description of the item]
|
|
655
|
-
|
|
656
|
-
### Props/Interface
|
|
657
|
-
|
|
658
|
-
```typescript
|
|
659
|
-
interface ItemProps {
|
|
660
|
-
// Interface definition
|
|
661
|
-
}
|
|
662
|
-
```
|
|
663
|
-
|
|
664
|
-
### Usage
|
|
665
|
-
|
|
666
|
-
```tsx
|
|
667
|
-
// Basic usage example
|
|
668
|
-
```
|
|
669
|
-
|
|
670
|
-
### [Additional Sections]
|
|
671
|
-
|
|
672
|
-
[Item-specific sections]
|
|
673
|
-
```
|
|
674
|
-
|
|
675
|
-
### Migration Guide Template
|
|
676
|
-
|
|
677
|
-
```markdown
|
|
678
|
-
# Migration Guide: [Version/Feature]
|
|
679
|
-
|
|
680
|
-
> **🔄 Migration Instructions** | [← Back to Documentation](../README.md) | [↑ Table of Contents](#table-of-contents)
|
|
681
|
-
|
|
682
|
-
[Brief description of what changed and why migration is needed]
|
|
683
|
-
|
|
684
|
-
## Overview
|
|
685
|
-
|
|
686
|
-
[Detailed explanation of changes]
|
|
687
|
-
|
|
688
|
-
## Breaking Changes
|
|
689
|
-
|
|
690
|
-
[List of breaking changes]
|
|
691
|
-
|
|
692
|
-
## Migration Steps
|
|
693
|
-
|
|
694
|
-
### 1. [Step Name]
|
|
695
|
-
|
|
696
|
-
[Detailed step instructions]
|
|
697
|
-
|
|
698
|
-
### 2. [Step Name]
|
|
699
|
-
|
|
700
|
-
[Detailed step instructions]
|
|
701
|
-
|
|
702
|
-
## Code Examples
|
|
703
|
-
|
|
704
|
-
### Before
|
|
705
|
-
|
|
706
|
-
```tsx
|
|
707
|
-
// Old code
|
|
708
|
-
```
|
|
709
|
-
|
|
710
|
-
### After
|
|
711
|
-
|
|
712
|
-
```tsx
|
|
713
|
-
// New code
|
|
714
|
-
```
|
|
715
|
-
|
|
716
|
-
## Troubleshooting
|
|
717
|
-
|
|
718
|
-
### Common Issues
|
|
719
|
-
|
|
720
|
-
[Common migration problems and solutions]
|
|
721
|
-
|
|
722
|
-
## Next Steps
|
|
723
|
-
|
|
724
|
-
[What to do after migration]
|
|
725
|
-
```
|
|
726
|
-
|
|
727
|
-
### Troubleshooting Guide Template
|
|
728
|
-
|
|
729
|
-
```markdown
|
|
730
|
-
# [Issue Category] Troubleshooting
|
|
731
|
-
|
|
732
|
-
> **🆘 Problem Solving** | [← Back to Documentation](../README.md) | [↑ Table of Contents](#table-of-contents)
|
|
733
|
-
|
|
734
|
-
[Brief description of the issue category]
|
|
735
|
-
|
|
736
|
-
## Common Issues
|
|
737
|
-
|
|
738
|
-
### Issue: [Problem Description]
|
|
739
|
-
|
|
740
|
-
**Symptoms:**
|
|
741
|
-
- [Symptom 1]
|
|
742
|
-
- [Symptom 2]
|
|
743
|
-
|
|
744
|
-
**Causes:**
|
|
745
|
-
1. [Cause 1]
|
|
746
|
-
2. [Cause 2]
|
|
747
|
-
|
|
748
|
-
**Solutions:**
|
|
749
|
-
|
|
750
|
-
1. **[Solution Name]**
|
|
751
|
-
```tsx
|
|
752
|
-
// Code solution
|
|
753
|
-
```
|
|
754
|
-
|
|
755
|
-
2. **[Solution Name]**
|
|
756
|
-
```bash
|
|
757
|
-
# Command solution
|
|
758
|
-
```
|
|
759
|
-
|
|
760
|
-
**Prevention:**
|
|
761
|
-
- [Prevention tip 1]
|
|
762
|
-
- [Prevention tip 2]
|
|
763
|
-
|
|
764
|
-
## Debug Mode
|
|
765
|
-
|
|
766
|
-
[How to enable debug mode]
|
|
767
|
-
|
|
768
|
-
## Getting Help
|
|
769
|
-
|
|
770
|
-
[Additional resources]
|
|
771
|
-
```
|
|
772
|
-
|
|
773
|
-
## 🎯 Naming Conventions
|
|
774
|
-
|
|
775
|
-
### File Names
|
|
776
|
-
- **Implementation guides**: `kebab-case.md` (e.g., `file-upload-storage.md`)
|
|
777
|
-
- **API references**: `plural-noun.md` (e.g., `components.md`, `hooks.md`)
|
|
778
|
-
- **Migration guides**: `MIGRATION_GUIDE.md` or `v0.4.17-feature-name.md`
|
|
779
|
-
- **Troubleshooting**: `common-issues.md` or `specific-issue-name.md`
|
|
780
|
-
|
|
781
|
-
### Section Headings
|
|
782
|
-
- **Use sentence case** - "Quick Start" not "Quick start"
|
|
783
|
-
- **Be descriptive** - "File Upload & Storage System" not "Files"
|
|
784
|
-
- **Use consistent hierarchy** - H2 for main sections, H3 for subsections
|
|
785
|
-
|
|
786
|
-
### Code Examples
|
|
787
|
-
- **Use realistic names** - `userId`, `organisationId`, `permission`
|
|
788
|
-
- **Be consistent** - Same variable names across all examples
|
|
789
|
-
- **Use meaningful values** - `'user-123'` not `'test'`
|
|
790
|
-
|
|
791
|
-
### Cross-References
|
|
792
|
-
- **Use descriptive link text** - "RBAC Quick Start Guide" not "this guide"
|
|
793
|
-
- **Keep links current** - Update when files move
|
|
794
|
-
- **Use relative paths** - `./file.md` for same directory
|
|
795
|
-
|
|
796
|
-
## 📌 Quick Reference Standards
|
|
797
|
-
|
|
798
|
-
### Essential Information Always Include
|
|
799
|
-
|
|
800
|
-
Every documentation file should start with:
|
|
801
|
-
|
|
802
|
-
```markdown
|
|
803
|
-
# [Feature Name]
|
|
804
|
-
|
|
805
|
-
> **🎯 Use Case**: When to use this
|
|
806
|
-
> **⏱️ Time Required**: How long to implement
|
|
807
|
-
> **Prerequisites**: What you need to know first
|
|
808
|
-
|
|
809
|
-
[Brief overview - one paragraph]
|
|
810
|
-
```
|
|
811
|
-
|
|
812
|
-
### Standard File Structure
|
|
813
|
-
|
|
814
|
-
Every guide should include:
|
|
815
|
-
|
|
816
|
-
1. **Quick Start** - Complete, runnable code example that works immediately
|
|
817
|
-
2. **Detailed Guide** - Comprehensive coverage
|
|
818
|
-
3. **Examples** - Multiple real-world examples
|
|
819
|
-
4. **Troubleshooting** - Common issues and solutions
|
|
820
|
-
5. **Next Steps** - Links to related documentation
|
|
821
|
-
|
|
822
|
-
## 📋 Pre-Publishing Checklist
|
|
823
|
-
|
|
824
|
-
Before publishing any documentation, verify:
|
|
825
|
-
|
|
826
|
-
### Content Quality
|
|
827
|
-
- [ ] **Completeness**: All necessary information included
|
|
828
|
-
- [ ] **Accuracy**: Information is current and correct
|
|
829
|
-
- [ ] **Clarity**: Language is clear and accessible
|
|
830
|
-
- [ ] **Consistency**: Follows style guide and conventions
|
|
831
|
-
|
|
832
|
-
### Code Examples
|
|
833
|
-
- [ ] **Complete Examples** - All code examples are runnable and complete
|
|
834
|
-
- [ ] **Error Handling** - Examples include proper error handling
|
|
835
|
-
- [ ] **TypeScript** - All examples use TypeScript with proper types
|
|
836
|
-
- [ ] **Imports** - All necessary imports are shown
|
|
837
|
-
- [ ] **Comments** - Complex logic is explained with comments
|
|
838
|
-
- [ ] **Best Practices** - Examples follow PACE Core best practices
|
|
839
|
-
|
|
840
|
-
### Navigation & Cross-References
|
|
841
|
-
- [ ] **Navigation**: Proper breadcrumbs and cross-references
|
|
842
|
-
- [ ] **Version Metadata**: Up-to-date version information
|
|
843
|
-
- [ ] **Links**: All internal and external links verified
|
|
844
|
-
- [ ] **Headings**: Proper heading hierarchy (H1 → H2 → H3)
|
|
845
|
-
|
|
846
|
-
### Formatting & Structure
|
|
847
|
-
- [ ] **Headings**: Use proper heading hierarchy
|
|
848
|
-
- [ ] **Lists**: Use consistent list formatting
|
|
849
|
-
- [ ] **Code Blocks**: Use proper language tags
|
|
850
|
-
- [ ] **Tables**: Use proper table formatting
|
|
851
|
-
- [ ] **Accessibility**: Proper formatting for screen readers
|
|
852
|
-
|
|
853
|
-
### Review Process
|
|
854
|
-
- [ ] **Self-Review**: Read aloud for clarity, test all examples
|
|
855
|
-
- [ ] **Link Check**: Verify all links work
|
|
856
|
-
- [ ] **Spell Check**: Use spell check tools
|
|
857
|
-
- [ ] **Grammar Check**: Use grammar check tools
|
|
858
|
-
|
|
859
|
-
---
|
|
860
|
-
|
|
861
|
-
## 🔄 Maintenance Procedures
|
|
862
|
-
|
|
863
|
-
### When to Update Documentation
|
|
864
|
-
|
|
865
|
-
**Automatically Update**:
|
|
866
|
-
- When introducing breaking changes
|
|
867
|
-
- When adding new features
|
|
868
|
-
- When fixing bugs that affect documented behavior
|
|
869
|
-
- When deprecating functionality
|
|
870
|
-
|
|
871
|
-
**Regularly Review**:
|
|
872
|
-
- Quarterly comprehensive audit
|
|
873
|
-
- Monthly link verification
|
|
874
|
-
- After major version releases
|
|
875
|
-
|
|
876
|
-
### Deprecation Process
|
|
877
|
-
|
|
878
|
-
```markdown
|
|
879
|
-
> **⚠️ Deprecated**: This pattern is deprecated as of v0.5.65
|
|
880
|
-
|
|
881
|
-
## Deprecated Pattern
|
|
882
|
-
|
|
883
|
-
[Old way - marked as deprecated]
|
|
884
|
-
|
|
885
|
-
## Recommended Replacement
|
|
886
|
-
|
|
887
|
-
[New way - with migration guide]
|
|
888
|
-
|
|
889
|
-
See [Migration Guide](./migration/) for details.
|
|
890
|
-
```
|
|
891
|
-
|
|
892
|
-
### Version References
|
|
893
|
-
|
|
894
|
-
Always include version information:
|
|
895
|
-
|
|
896
|
-
```markdown
|
|
897
|
-
> **Version**: 0.5.65+
|
|
898
|
-
> **Breaking Changes**: None
|
|
899
|
-
> **New Features**: Auto-save functionality
|
|
900
|
-
|
|
901
|
-
> **Version**: v2.0.0+
|
|
902
|
-
> **Breaking Changes**: Service architecture changes
|
|
903
|
-
> **Migration Required**: Yes - see [Migration Guide](./migration/)
|
|
904
|
-
```
|
|
905
|
-
|
|
906
|
-
## 🤖 Documentation Automation
|
|
907
|
-
|
|
908
|
-
### Recommended Tools
|
|
909
|
-
|
|
910
|
-
1. **Link Checking**: Automatic broken link detection
|
|
911
|
-
2. **Code Validation**: Test code examples
|
|
912
|
-
3. **Spell Checking**: Automated grammar/spell check
|
|
913
|
-
4. **Version Checking**: Ensure version references are current
|
|
914
|
-
|
|
915
|
-
### CI/CD Integration
|
|
916
|
-
|
|
917
|
-
```yaml
|
|
918
|
-
# Example GitHub Actions workflow
|
|
919
|
-
name: Documentation Checks
|
|
920
|
-
|
|
921
|
-
on: [push, pull_request]
|
|
922
|
-
|
|
923
|
-
jobs:
|
|
924
|
-
docs:
|
|
925
|
-
runs-on: ubuntu-latest
|
|
926
|
-
steps:
|
|
927
|
-
- uses: actions/checkout@v3
|
|
928
|
-
- run: npm install
|
|
929
|
-
- run: npm run docs:check # Check all examples
|
|
930
|
-
- run: npm run docs:links # Check all links
|
|
931
|
-
- run: npm run docs:spell # Spell check
|
|
932
|
-
```
|
|
933
|
-
|
|
934
|
-
## 📊 Metrics and Success
|
|
935
|
-
|
|
936
|
-
### Quality Metrics
|
|
937
|
-
|
|
938
|
-
**Quantitative**:
|
|
939
|
-
- 100% of exported features documented
|
|
940
|
-
- 100% of code examples runnable
|
|
941
|
-
- 0 broken internal links
|
|
942
|
-
- 95%+ terminology consistency
|
|
943
|
-
|
|
944
|
-
**Qualitative**:
|
|
945
|
-
- Developer feedback scores
|
|
946
|
-
- Time to first success
|
|
947
|
-
- Support ticket reduction
|
|
948
|
-
- Onboarding completion rate
|
|
949
|
-
|
|
950
|
-
### Improvement Process
|
|
951
|
-
|
|
952
|
-
1. **Collect Feedback**: Developer surveys, support tickets
|
|
953
|
-
2. **Analyze Issues**: Identify pain points
|
|
954
|
-
3. **Plan Updates**: Prioritize improvements
|
|
955
|
-
4. **Implement Changes**: Update documentation
|
|
956
|
-
5. **Measure Impact**: Track improvements
|
|
957
|
-
|
|
958
|
-
---
|
|
959
|
-
|
|
960
|
-
This comprehensive style guide ensures that PACE Core documentation is consistent, helpful, and maintainable. Follow these guidelines to create excellent developer documentation that helps users succeed with the library.
|
|
961
|
-
|
|
962
|
-
**Related Resources**:
|
|
963
|
-
- [Documentation Style Checklist](./documentation-style-checklist.md) - Quick checklist for reviews
|
|
964
|
-
- [Quick Reference](./quick-reference.md) - Common patterns and examples
|