@jmruthers/pace-core 0.6.4 → 0.6.6
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 +104 -0
- package/README.md +5 -403
- package/core-usage-manifest.json +93 -0
- package/cursor-rules/00-pace-core-compliance.mdc +128 -26
- package/cursor-rules/01-standards-compliance.mdc +49 -8
- package/cursor-rules/02-project-structure.mdc +6 -0
- package/cursor-rules/03-solid-principles.mdc +2 -0
- package/cursor-rules/04-testing-standards.mdc +2 -0
- package/cursor-rules/05-bug-reports-and-features.mdc +2 -0
- package/cursor-rules/06-code-quality.mdc +2 -0
- package/cursor-rules/07-tech-stack-compliance.mdc +2 -0
- package/cursor-rules/08-markup-quality.mdc +52 -27
- package/cursor-rules/09-rbac-compliance.mdc +462 -0
- package/cursor-rules/10-error-handling-patterns.mdc +179 -0
- package/cursor-rules/11-performance-optimization.mdc +169 -0
- package/cursor-rules/12-ci-cd-integration.mdc +150 -0
- package/dist/{AuthService-Cb34EQs3.d.ts → AuthService-DmfO5rGS.d.ts} +10 -0
- package/dist/{DataTable-BMRU8a1j.d.ts → DataTable-2N_tqbfq.d.ts} +1 -1
- package/dist/DataTable-LRJL4IRV.js +15 -0
- package/dist/{PublicPageProvider-DEMpysFR.d.ts → PublicPageProvider-BBH6Vqg7.d.ts} +72 -139
- package/dist/UnifiedAuthProvider-ZT6TIGM7.js +7 -0
- package/dist/api-Y4MQWOFW.js +4 -0
- package/dist/audit-MYQXYZFU.js +3 -0
- package/dist/{chunk-J36DSWQK.js → chunk-2HGJFNAH.js} +8 -28
- package/dist/{chunk-OEWDTMG7.js → chunk-3O3WHILE.js} +38 -121
- package/dist/{chunk-M43Y4SSO.js → chunk-3QC3KRHK.js} +1 -14
- package/dist/{chunk-DGUM43GV.js → chunk-3RG5ZIWI.js} +1 -4
- package/dist/{chunk-QXHPKYJV.js → chunk-4SXLQIZO.js} +1 -26
- package/dist/chunk-4T7OBVTU.js +62 -0
- package/dist/{chunk-E66EQZE6.js → chunk-6GLLNA6U.js} +3 -9
- package/dist/{chunk-ZSAAAMVR.js → chunk-6QYDGKQY.js} +1 -4
- package/dist/{chunk-NN6WWZ5U.js → chunk-7TYHROIV.js} +579 -563
- package/dist/{chunk-M7MPQISP.js → chunk-A55DK444.js} +9 -16
- package/dist/{chunk-63FOKYGO.js → chunk-AHU7G2R5.js} +2 -11
- package/dist/{chunk-L4OXEN46.js → chunk-BVP2BCJF.js} +2 -16
- package/dist/chunk-C7NSAPTL.js +1 -0
- package/dist/{chunk-YKRAFF5K.js → chunk-FENMYN2U.js} +73 -149
- package/dist/{chunk-AVMLPIM7.js → chunk-FTCRZOG2.js} +284 -432
- package/dist/{chunk-G37KK66H.js → chunk-FYHN4DD5.js} +60 -19
- package/dist/{chunk-VBXEHIUJ.js → chunk-HF6O3O37.js} +6 -88
- package/dist/{chunk-I6DAQMWX.js → chunk-LAZMKTTF.js} +930 -891
- package/dist/{chunk-5EC5MEWX.js → chunk-MAGBIDNS.js} +77 -222
- package/dist/chunk-MBADTM7L.js +64 -0
- package/dist/chunk-OHIK3MIO.js +994 -0
- package/dist/{chunk-6SOIHG6Z.js → chunk-S7DKJPLT.js} +115 -44
- package/dist/{chunk-FMUCXFII.js → chunk-SD6WQY43.js} +1 -5
- package/dist/{chunk-PWLANIRT.js → chunk-TTRFSOKR.js} +1 -7
- package/dist/{chunk-5DRSZLL2.js → chunk-UH3NTO3F.js} +1 -6
- package/dist/{chunk-FFQEQTNW.js → chunk-UIYSCEV7.js} +134 -45
- package/dist/{chunk-3LPHPB62.js → chunk-ZFYPMX46.js} +271 -87
- package/dist/{chunk-7JPAB3T5.js → chunk-ZS5VO5JB.js} +1989 -1283
- package/dist/components.d.ts +6 -6
- package/dist/components.js +57 -267
- package/dist/{database.generated-CzIvgcPu.d.ts → database.generated-CcnC_DRc.d.ts} +4795 -3691
- package/dist/eslint-rules/index.cjs +22 -0
- package/dist/eslint-rules/rules/compliance.cjs +348 -0
- package/dist/eslint-rules/rules/components.cjs +113 -0
- package/dist/eslint-rules/rules/imports.cjs +102 -0
- package/dist/eslint-rules/rules/rbac.cjs +790 -0
- package/dist/eslint-rules/utils/helpers.cjs +42 -0
- package/dist/eslint-rules/utils/manifest-loader.cjs +75 -0
- package/dist/hooks.d.ts +5 -5
- package/dist/hooks.js +62 -270
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +36 -26
- package/dist/index.js +87 -690
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +8 -35
- package/dist/rbac/eslint-rules.d.ts +46 -44
- package/dist/rbac/eslint-rules.js +7 -4
- package/dist/rbac/index.d.ts +124 -594
- package/dist/rbac/index.js +14 -207
- package/dist/styles/index.js +2 -12
- package/dist/theming/runtime.js +3 -19
- package/dist/{timezone-CHhWg6b4.d.ts → timezone-BZe_eUxx.d.ts} +175 -1
- package/dist/{types-CkbwOr4Y.d.ts → types-B-K_5VnO.d.ts} +4 -0
- package/dist/types-t9H8qKRw.d.ts +55 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +7 -94
- package/dist/{usePublicRouteParams-i3qtoBgg.d.ts → usePublicRouteParams-COZ28Mvq.d.ts} +9 -9
- package/dist/utils.d.ts +24 -117
- package/dist/utils.js +54 -392
- package/docs/README.md +16 -6
- package/docs/api/README.md +4 -402
- package/docs/api/modules.md +454 -930
- package/docs/api-reference/components.md +3 -1
- package/docs/api-reference/deprecated.md +31 -6
- package/docs/api-reference/rpc-functions.md +78 -3
- package/docs/best-practices/accessibility.md +6 -3
- package/docs/getting-started/cursor-rules.md +3 -23
- package/docs/getting-started/dependencies.md +650 -0
- package/docs/getting-started/installation-guide.md +20 -7
- package/docs/getting-started/quick-start.md +23 -12
- package/docs/implementation-guides/permission-enforcement.md +4 -0
- package/docs/rbac/MIGRATION_GUIDE.md +819 -0
- package/docs/rbac/RBAC_CONTRACT.md +724 -0
- package/docs/rbac/README.md +12 -3
- package/docs/rbac/edge-functions-guide.md +376 -0
- package/docs/rbac/secure-client-protection.md +0 -34
- package/docs/standards/00-pace-core-compliance.md +967 -0
- package/docs/standards/01-standards-compliance.md +188 -0
- package/docs/standards/02-project-structure.md +985 -0
- package/docs/standards/03-solid-principles.md +39 -0
- package/docs/standards/04-testing-standards.md +36 -0
- package/docs/standards/05-bug-reports-and-features.md +27 -0
- package/docs/standards/{04-code-style-standard.md → 06-code-quality.md} +2 -0
- package/docs/standards/07-tech-stack-compliance.md +30 -0
- package/docs/standards/08-markup-quality.md +345 -0
- package/docs/standards/{07-rbac-and-rls-standard.md → 09-rbac-compliance.md} +149 -54
- package/docs/standards/10-error-handling-patterns.md +401 -0
- package/docs/standards/11-performance-optimization.md +348 -0
- package/docs/standards/12-ci-cd-integration.md +370 -0
- package/docs/standards/ALIGNMENT_REVIEW_SUMMARY.md +192 -0
- package/docs/standards/README.md +62 -33
- package/docs/troubleshooting/organisation-context-setup.md +42 -19
- package/eslint-config-pace-core.cjs +20 -4
- package/package.json +31 -21
- package/scripts/audit/audit-compliance.cjs +1295 -0
- package/scripts/audit/audit-components.cjs +260 -0
- package/scripts/audit/audit-dependencies.cjs +395 -0
- package/scripts/audit/audit-rbac.cjs +954 -0
- package/scripts/audit/audit-standards.cjs +1268 -0
- package/scripts/audit/index.cjs +1898 -194
- package/scripts/install-cursor-rules.cjs +259 -8
- package/scripts/validate-master.js +1 -1
- package/src/__tests__/fixtures/supabase.ts +1 -1
- package/src/__tests__/helpers/__tests__/component-test-utils.test.tsx +1 -1
- package/src/__tests__/helpers/__tests__/optimized-test-setup.test.ts +1 -1
- package/src/__tests__/helpers/__tests__/supabaseMock.test.ts +1 -1
- package/src/__tests__/helpers/__tests__/test-utils.test.tsx +3 -3
- package/src/__tests__/helpers/component-test-utils.tsx +1 -1
- package/src/__tests__/helpers/supabaseMock.ts +2 -2
- package/src/__tests__/public-recipe-view.test.ts +38 -9
- package/src/components/Button/Button.tsx +5 -1
- package/src/components/ContextSelector/ContextSelector.tsx +42 -39
- package/src/components/DataTable/__tests__/keyboard.test.tsx +15 -2
- package/src/components/DataTable/components/DataTableBody.tsx +55 -31
- package/src/components/DataTable/components/DataTableCore.tsx +186 -13
- package/src/components/DataTable/components/DataTableLayout.tsx +30 -5
- package/src/components/DataTable/components/EditFields.tsx +23 -3
- package/src/components/DataTable/components/EditableRow.tsx +7 -2
- package/src/components/DataTable/components/ImportModal.tsx +4 -6
- package/src/components/DataTable/components/RowComponent.tsx +12 -0
- package/src/components/DataTable/components/ViewRowModal.tsx +4 -4
- package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +455 -96
- package/src/components/DataTable/components/__tests__/ViewRowModal.test.tsx +122 -58
- package/src/components/DataTable/components/hooks/usePermissionTracking.ts +0 -4
- package/src/components/DataTable/core/DataTableContext.tsx +1 -1
- package/src/components/DataTable/hooks/__tests__/useDataTableState.test.ts +51 -47
- package/src/components/DataTable/hooks/useDataTablePermissions.ts +24 -21
- package/src/components/DataTable/hooks/useDataTableState.ts +125 -9
- package/src/components/DataTable/hooks/useTableColumns.ts +40 -2
- package/src/components/DataTable/hooks/useTableHandlers.ts +11 -0
- package/src/components/DataTable/types.ts +5 -0
- package/src/components/DateTimeField/DateTimeField.tsx +20 -20
- package/src/components/DateTimeField/README.md +5 -2
- package/src/components/Dialog/Dialog.test.tsx +361 -318
- package/src/components/Dialog/Dialog.tsx +1154 -323
- package/src/components/Dialog/index.ts +3 -3
- package/src/components/FileDisplay/FileDisplay.test.tsx +45 -2
- package/src/components/FileDisplay/FileDisplay.tsx +28 -22
- package/src/components/Form/Form.test.tsx +9 -10
- package/src/components/Form/Form.tsx +369 -9
- package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +28 -28
- package/src/components/InactivityWarningModal/InactivityWarningModal.tsx +40 -54
- package/src/components/LoginForm/LoginForm.tsx +2 -2
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +14 -13
- package/src/components/NavigationMenu/NavigationMenu.tsx +2 -2
- package/src/components/NavigationMenu/useNavigationFiltering.ts +11 -21
- package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +6 -4
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +30 -41
- package/src/components/PaceAppLayout/README.md +10 -9
- package/src/components/PaceAppLayout/test-setup.tsx +40 -31
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +108 -61
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +27 -3
- package/src/components/PasswordChange/PasswordChangeForm.test.tsx +61 -0
- package/src/components/PasswordChange/PasswordChangeForm.tsx +20 -13
- package/src/components/PublicLayout/PublicLayout.test.tsx +7 -3
- package/src/components/PublicLayout/PublicPageLayout.tsx +5 -8
- package/src/components/Select/Select.tsx +23 -21
- package/src/components/Select/types.ts +1 -1
- package/src/components/UserMenu/UserMenu.test.tsx +38 -6
- package/src/components/UserMenu/UserMenu.tsx +39 -34
- package/src/components/index.ts +3 -4
- package/src/eslint-rules/index.cjs +22 -0
- package/src/eslint-rules/rules/compliance.cjs +348 -0
- package/src/eslint-rules/rules/components.cjs +113 -0
- package/src/eslint-rules/rules/imports.cjs +102 -0
- package/src/eslint-rules/rules/rbac.cjs +790 -0
- package/src/eslint-rules/utils/helpers.cjs +42 -0
- package/src/eslint-rules/utils/manifest-loader.cjs +75 -0
- package/src/hooks/__tests__/hooks.integration.test.tsx +6 -8
- package/src/hooks/__tests__/useAppConfig.unit.test.ts +129 -67
- package/src/hooks/__tests__/usePublicEvent.simple.test.ts +149 -67
- package/src/hooks/__tests__/usePublicEvent.test.ts +149 -79
- package/src/hooks/__tests__/usePublicEvent.unit.test.ts +158 -109
- package/src/hooks/__tests__/useSessionDraft.test.ts +163 -0
- package/src/hooks/__tests__/useSessionRestoration.unit.test.tsx +10 -5
- package/src/hooks/public/usePublicEvent.ts +62 -190
- package/src/hooks/public/usePublicEventLogo.test.ts +70 -17
- package/src/hooks/public/usePublicEventLogo.ts +19 -9
- package/src/hooks/useAppConfig.ts +26 -24
- package/src/hooks/useEventTheme.test.ts +211 -233
- package/src/hooks/useEventTheme.ts +19 -28
- package/src/hooks/useEvents.ts +11 -7
- package/src/hooks/useKeyboardShortcuts.ts +1 -1
- package/src/hooks/useOrganisationPermissions.ts +9 -11
- package/src/hooks/useOrganisations.ts +13 -7
- package/src/hooks/useQueryCache.ts +0 -1
- package/src/hooks/useSessionDraft.ts +380 -0
- package/src/hooks/useSessionRestoration.ts +3 -1
- package/src/icons/index.ts +27 -0
- package/src/index.ts +16 -1
- package/src/providers/OrganisationProvider.tsx +23 -14
- package/src/providers/services/EventServiceProvider.tsx +1 -24
- package/src/providers/services/UnifiedAuthProvider.tsx +5 -48
- package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +3 -0
- package/src/rbac/README.md +20 -20
- package/src/rbac/__tests__/adapters.comprehensive.test.tsx +7 -457
- package/src/rbac/__tests__/auth-rbac.e2e.test.tsx +33 -7
- package/src/rbac/adapters.tsx +7 -295
- package/src/rbac/api.test.ts +44 -56
- package/src/rbac/api.ts +10 -17
- package/src/rbac/cache-invalidation.ts +0 -1
- package/src/rbac/compliance/index.ts +10 -0
- package/src/rbac/compliance/pattern-detector.ts +553 -0
- package/src/rbac/compliance/runtime-compliance.ts +22 -0
- package/src/rbac/components/AccessDenied.tsx +150 -0
- package/src/rbac/components/NavigationGuard.tsx +12 -20
- package/src/rbac/components/PagePermissionGuard.tsx +4 -24
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +21 -8
- package/src/rbac/components/index.ts +3 -41
- package/src/rbac/eslint-rules.js +1 -1
- package/src/rbac/hooks/index.ts +0 -3
- package/src/rbac/hooks/permissions/index.ts +0 -3
- package/src/rbac/hooks/permissions/useAccessLevel.ts +4 -8
- package/src/rbac/hooks/usePermissions.ts +0 -3
- package/src/rbac/hooks/useRBAC.test.ts +21 -3
- package/src/rbac/hooks/useRBAC.ts +4 -3
- package/src/rbac/hooks/useResolvedScope.test.ts +57 -47
- package/src/rbac/hooks/useResolvedScope.ts +58 -140
- package/src/rbac/hooks/useResourcePermissions.test.ts +241 -60
- package/src/rbac/hooks/useResourcePermissions.ts +182 -63
- package/src/rbac/hooks/useRoleManagement.test.ts +65 -22
- package/src/rbac/hooks/useRoleManagement.ts +147 -19
- package/src/rbac/hooks/useSecureSupabase.ts +4 -8
- package/src/rbac/index.ts +7 -9
- package/src/rbac/permissions.ts +17 -17
- package/src/rbac/utils/contextValidator.ts +45 -7
- package/src/services/AuthService.ts +132 -23
- package/src/services/EventService.ts +4 -97
- package/src/services/InactivityService.ts +155 -58
- package/src/services/OrganisationService.ts +7 -44
- package/src/services/__tests__/OrganisationService.test.ts +26 -8
- package/src/services/base/BaseService.ts +0 -3
- package/src/styles/core.css +4 -0
- package/src/types/database.generated.ts +4733 -3809
- package/src/utils/__tests__/organisationContext.unit.test.ts +9 -10
- package/src/utils/context/organisationContext.test.ts +13 -28
- package/src/utils/context/organisationContext.ts +21 -52
- package/src/utils/dynamic/dynamicUtils.ts +1 -1
- package/src/utils/file-reference/index.ts +39 -15
- package/src/utils/formatting/formatDateTime.test.ts +3 -2
- package/src/utils/formatting/formatTime.test.ts +3 -2
- package/src/utils/google-places/loadGoogleMapsScript.ts +29 -4
- package/src/utils/index.ts +4 -1
- package/src/utils/persistence/__tests__/keyDerivation.test.ts +135 -0
- package/src/utils/persistence/__tests__/sensitiveFieldDetection.test.ts +123 -0
- package/src/utils/persistence/keyDerivation.ts +304 -0
- package/src/utils/persistence/sensitiveFieldDetection.ts +212 -0
- package/src/utils/security/secureStorage.ts +5 -5
- package/src/utils/storage/helpers.ts +3 -3
- package/src/utils/supabase/createBaseClient.ts +147 -0
- package/src/utils/timezone/timezone.test.ts +1 -2
- package/src/utils/timezone/timezone.ts +1 -1
- package/src/utils/validation/csrf.ts +4 -4
- package/cursor-rules/CHANGELOG.md +0 -119
- package/cursor-rules/README.md +0 -192
- package/dist/DataTable-E7YQZD7D.js +0 -175
- package/dist/DataTable-E7YQZD7D.js.map +0 -1
- package/dist/UnifiedAuthProvider-QPXO24B4.js +0 -18
- package/dist/UnifiedAuthProvider-QPXO24B4.js.map +0 -1
- package/dist/api-6LVZTHDS.js +0 -52
- package/dist/api-6LVZTHDS.js.map +0 -1
- package/dist/audit-V53FV5AG.js +0 -17
- package/dist/audit-V53FV5AG.js.map +0 -1
- package/dist/chunk-36LVWXB2.js +0 -227
- package/dist/chunk-36LVWXB2.js.map +0 -1
- package/dist/chunk-3LPHPB62.js.map +0 -1
- package/dist/chunk-5DRSZLL2.js.map +0 -1
- package/dist/chunk-5EC5MEWX.js.map +0 -1
- package/dist/chunk-63FOKYGO.js.map +0 -1
- package/dist/chunk-6SOIHG6Z.js.map +0 -1
- package/dist/chunk-7JPAB3T5.js.map +0 -1
- package/dist/chunk-ATKZM7RX.js +0 -2053
- package/dist/chunk-ATKZM7RX.js.map +0 -1
- package/dist/chunk-AVMLPIM7.js.map +0 -1
- package/dist/chunk-DGUM43GV.js.map +0 -1
- package/dist/chunk-E66EQZE6.js.map +0 -1
- package/dist/chunk-FFQEQTNW.js.map +0 -1
- package/dist/chunk-FMUCXFII.js.map +0 -1
- package/dist/chunk-G37KK66H.js.map +0 -1
- package/dist/chunk-I6DAQMWX.js.map +0 -1
- package/dist/chunk-J36DSWQK.js.map +0 -1
- package/dist/chunk-KQCRWDSA.js +0 -1
- package/dist/chunk-KQCRWDSA.js.map +0 -1
- package/dist/chunk-L4OXEN46.js.map +0 -1
- package/dist/chunk-LMC26NLJ.js +0 -84
- package/dist/chunk-LMC26NLJ.js.map +0 -1
- package/dist/chunk-M43Y4SSO.js.map +0 -1
- package/dist/chunk-M7MPQISP.js.map +0 -1
- package/dist/chunk-NN6WWZ5U.js.map +0 -1
- package/dist/chunk-OEWDTMG7.js.map +0 -1
- package/dist/chunk-PWLANIRT.js.map +0 -1
- package/dist/chunk-QXHPKYJV.js.map +0 -1
- package/dist/chunk-VBXEHIUJ.js.map +0 -1
- package/dist/chunk-YKRAFF5K.js.map +0 -1
- package/dist/chunk-ZSAAAMVR.js.map +0 -1
- package/dist/components.js.map +0 -1
- package/dist/contextValidator-OOPCLPZW.js +0 -9
- package/dist/contextValidator-OOPCLPZW.js.map +0 -1
- package/dist/eslint-rules/pace-core-compliance.cjs +0 -510
- package/dist/hooks.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/providers.js.map +0 -1
- package/dist/rbac/eslint-rules.js.map +0 -1
- package/dist/rbac/index.js.map +0 -1
- package/dist/styles/index.js.map +0 -1
- package/dist/theming/runtime.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils.js.map +0 -1
- package/docs/standards/01-architecture-standard.md +0 -44
- package/docs/standards/02-api-and-rpc-standard.md +0 -39
- package/docs/standards/03-component-standard.md +0 -32
- package/docs/standards/05-security-standard.md +0 -44
- package/docs/standards/06-testing-and-docs-standard.md +0 -29
- package/docs/standards/pace-core-compliance.md +0 -432
- package/scripts/audit/core/checks/accessibility.cjs +0 -197
- package/scripts/audit/core/checks/api-usage.cjs +0 -191
- package/scripts/audit/core/checks/bundle.cjs +0 -142
- package/scripts/audit/core/checks/compliance.cjs +0 -2706
- package/scripts/audit/core/checks/config.cjs +0 -54
- package/scripts/audit/core/checks/coverage.cjs +0 -84
- package/scripts/audit/core/checks/dependencies.cjs +0 -994
- package/scripts/audit/core/checks/documentation.cjs +0 -268
- package/scripts/audit/core/checks/environment.cjs +0 -116
- package/scripts/audit/core/checks/error-handling.cjs +0 -340
- package/scripts/audit/core/checks/forms.cjs +0 -172
- package/scripts/audit/core/checks/heuristics.cjs +0 -68
- package/scripts/audit/core/checks/hooks.cjs +0 -334
- package/scripts/audit/core/checks/imports.cjs +0 -244
- package/scripts/audit/core/checks/performance.cjs +0 -325
- package/scripts/audit/core/checks/routes.cjs +0 -117
- package/scripts/audit/core/checks/state.cjs +0 -130
- package/scripts/audit/core/checks/structure.cjs +0 -65
- package/scripts/audit/core/checks/style.cjs +0 -584
- package/scripts/audit/core/checks/testing.cjs +0 -122
- package/scripts/audit/core/checks/typescript.cjs +0 -61
- package/scripts/audit/core/scanner.cjs +0 -199
- package/scripts/audit/core/utils.cjs +0 -137
- package/scripts/audit/reporters/console.cjs +0 -151
- package/scripts/audit/reporters/json.cjs +0 -54
- package/scripts/audit/reporters/markdown.cjs +0 -124
- package/scripts/audit-consuming-app.cjs +0 -86
- package/src/eslint-rules/pace-core-compliance.cjs +0 -510
- package/src/eslint-rules/pace-core-compliance.js +0 -638
- package/src/rbac/components/EnhancedNavigationMenu.test.tsx +0 -555
- package/src/rbac/components/EnhancedNavigationMenu.tsx +0 -293
- package/src/rbac/components/NavigationProvider.test.tsx +0 -481
- package/src/rbac/components/NavigationProvider.tsx +0 -345
- package/src/rbac/components/PagePermissionProvider.test.tsx +0 -476
- package/src/rbac/components/PagePermissionProvider.tsx +0 -279
- package/src/rbac/components/PermissionEnforcer.tsx +0 -312
- package/src/rbac/components/RoleBasedRouter.tsx +0 -440
- package/src/rbac/components/SecureDataProvider.test.tsx +0 -543
- package/src/rbac/components/SecureDataProvider.tsx +0 -339
- package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +0 -620
- package/src/rbac/components/__tests__/NavigationProvider.test.tsx +0 -726
- package/src/rbac/components/__tests__/PagePermissionProvider.test.tsx +0 -661
- package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +0 -881
- package/src/rbac/components/__tests__/RoleBasedRouter.test.tsx +0 -783
- package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +0 -645
- package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +0 -659
- package/src/rbac/hooks/permissions/useCachedPermissions.ts +0 -79
- package/src/rbac/hooks/permissions/useHasAllPermissions.ts +0 -90
- package/src/rbac/hooks/permissions/useHasAnyPermission.ts +0 -90
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Base Supabase Client Creation Utility
|
|
3
|
+
* @package @jmruthers/pace-core
|
|
4
|
+
* @module Utils/Supabase
|
|
5
|
+
* @since 0.6.6
|
|
6
|
+
*
|
|
7
|
+
* Restricted wrapper for creating the base Supabase client for UnifiedAuthProvider.
|
|
8
|
+
* This is the ONLY acceptable way to create a Supabase client in consuming apps.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* // ✅ CORRECT: In main.tsx, App.tsx, or lib/supabase.ts
|
|
13
|
+
* import { createBaseClient } from '@jmruthers/pace-core';
|
|
14
|
+
*
|
|
15
|
+
* const supabase = createBaseClient(
|
|
16
|
+
* import.meta.env.VITE_SUPABASE_URL,
|
|
17
|
+
* import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY
|
|
18
|
+
* );
|
|
19
|
+
*
|
|
20
|
+
* // Pass to UnifiedAuthProvider
|
|
21
|
+
* <UnifiedAuthProvider supabaseClient={supabase} ... />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { createClient, SupabaseClient } from '@supabase/supabase-js';
|
|
26
|
+
import { Database } from '../../types/database';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Allowed file patterns for base client creation
|
|
30
|
+
*
|
|
31
|
+
* Note: Patterns allow optional query parameters (e.g., ?t=timestamp) and line numbers
|
|
32
|
+
* that Vite and other bundlers add in stack traces
|
|
33
|
+
*/
|
|
34
|
+
const ALLOWED_FILE_PATTERNS = [
|
|
35
|
+
/[\/\\]main\.(tsx?|jsx?)(\?|:|\s|$)/i,
|
|
36
|
+
/[\/\\]App\.(tsx?|jsx?)(\?|:|\s|$)/i,
|
|
37
|
+
/[\/\\]lib[\/\\]supabase\.(tsx?|jsx?)(\?|:|\s|$)/i,
|
|
38
|
+
/[\/\\]src[\/\\]supabase\.(tsx?|jsx?)(\?|:|\s|$)/i,
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Check if the current file is in an allowed location for base client creation
|
|
43
|
+
*
|
|
44
|
+
* This uses Error.stack to detect the caller's file path.
|
|
45
|
+
* Only works in development/build time, not at runtime.
|
|
46
|
+
*/
|
|
47
|
+
function isAllowedContext(): boolean {
|
|
48
|
+
// In production builds, we can't reliably detect the caller
|
|
49
|
+
// So we allow it but document the restriction
|
|
50
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'production') {
|
|
51
|
+
return true; // Allow in production (documentation/ESLint enforces)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
const stack = new Error().stack;
|
|
56
|
+
if (!stack) return false;
|
|
57
|
+
|
|
58
|
+
// Check if any stack frame matches allowed patterns
|
|
59
|
+
const stackLines = stack.split('\n');
|
|
60
|
+
for (const line of stackLines) {
|
|
61
|
+
for (const pattern of ALLOWED_FILE_PATTERNS) {
|
|
62
|
+
if (pattern.test(line)) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
} catch {
|
|
69
|
+
// If we can't check, allow it (documentation/ESLint enforces)
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Create a base Supabase client for UnifiedAuthProvider
|
|
76
|
+
*
|
|
77
|
+
* **CRITICAL**: This function can ONLY be called from:
|
|
78
|
+
* - `src/main.tsx` (or `main.jsx`)
|
|
79
|
+
* - `src/App.tsx` (or `App.jsx`)
|
|
80
|
+
* - `src/lib/supabase.ts` (or `supabase.js`)
|
|
81
|
+
* - `src/supabase.ts` (or `supabase.js`)
|
|
82
|
+
*
|
|
83
|
+
* **DO NOT** use this client directly for queries. Always use `useSecureSupabase()` hook instead.
|
|
84
|
+
*
|
|
85
|
+
* The client is configured with explicit auth options to ensure consistent session persistence:
|
|
86
|
+
* - `persistSession: true` - Sessions are saved to localStorage and restored on page load/refresh
|
|
87
|
+
* - `autoRefreshToken: true` - Tokens are automatically refreshed before expiry
|
|
88
|
+
* - `detectSessionInUrl: true` - Detects and handles OAuth callback URLs
|
|
89
|
+
* - `flowType: 'pkce'` - Uses PKCE flow for enhanced security
|
|
90
|
+
*
|
|
91
|
+
* This configuration ensures that users remain logged in after hard refresh (Cmd+Shift+R)
|
|
92
|
+
* and other browser navigation scenarios across all consuming apps.
|
|
93
|
+
*
|
|
94
|
+
* @param supabaseUrl - Supabase project URL
|
|
95
|
+
* @param supabaseKey - Supabase publishable key or anon key (accepts both legacy anon keys and modern publishable keys)
|
|
96
|
+
* @returns Supabase client instance with auth configuration
|
|
97
|
+
*
|
|
98
|
+
* @throws {Error} If called from an unauthorized file location (development only)
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* // main.tsx
|
|
103
|
+
* import { createBaseClient } from '@jmruthers/pace-core';
|
|
104
|
+
* import { UnifiedAuthProvider } from '@jmruthers/pace-core';
|
|
105
|
+
*
|
|
106
|
+
* const supabase = createBaseClient(
|
|
107
|
+
* import.meta.env.VITE_SUPABASE_URL,
|
|
108
|
+
* import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY
|
|
109
|
+
* );
|
|
110
|
+
*
|
|
111
|
+
* function App() {
|
|
112
|
+
* return (
|
|
113
|
+
* <UnifiedAuthProvider supabaseClient={supabase} appName="MyApp">
|
|
114
|
+
* <YourApp />
|
|
115
|
+
* </UnifiedAuthProvider>
|
|
116
|
+
* );
|
|
117
|
+
* }
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export function createBaseClient(
|
|
121
|
+
supabaseUrl: string,
|
|
122
|
+
supabaseKey: string
|
|
123
|
+
): SupabaseClient<Database> {
|
|
124
|
+
// Check context in development
|
|
125
|
+
if (!isAllowedContext()) {
|
|
126
|
+
const error = new Error(
|
|
127
|
+
'createBaseClient() can only be called from main.tsx, App.tsx, or lib/supabase.ts.\n' +
|
|
128
|
+
'This is a security requirement to ensure the base client is only created once and passed to UnifiedAuthProvider.\n' +
|
|
129
|
+
'See: https://github.com/jmruthers/pace-core/blob/main/packages/core/docs/standards/00-pace-core-compliance.md'
|
|
130
|
+
);
|
|
131
|
+
console.error('[pace-core Security Error]', error);
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Create and return the base client with explicit auth configuration
|
|
136
|
+
// These options ensure consistent session persistence across all consuming apps,
|
|
137
|
+
// especially important for hard refresh (Cmd+Shift+R) scenarios
|
|
138
|
+
return createClient<Database>(supabaseUrl, supabaseKey, {
|
|
139
|
+
auth: {
|
|
140
|
+
autoRefreshToken: true,
|
|
141
|
+
persistSession: true,
|
|
142
|
+
detectSessionInUrl: true,
|
|
143
|
+
flowType: 'pkce'
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
@@ -247,7 +247,7 @@ describe('Timezone Utilities', () => {
|
|
|
247
247
|
|
|
248
248
|
it('returns original date for invalid minutesStep', () => {
|
|
249
249
|
const date = new Date('2024-01-15T10:23:00Z');
|
|
250
|
-
|
|
250
|
+
roundToNearestMinutes(date, 0);
|
|
251
251
|
expect(date).toBe(date);
|
|
252
252
|
});
|
|
253
253
|
|
|
@@ -296,7 +296,6 @@ describe('Timezone Utilities', () => {
|
|
|
296
296
|
|
|
297
297
|
it('handles DST correctly', () => {
|
|
298
298
|
// Test in summer (EDT vs PDT = 3 hours)
|
|
299
|
-
const summerDate = new Date('2024-07-15T10:00:00Z');
|
|
300
299
|
const result = getTimeZoneDifference('America/New_York', 'America/Los_Angeles');
|
|
301
300
|
// Should be negative (LA behind NY)
|
|
302
301
|
expect(result).toBeLessThan(0);
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
-
import {
|
|
35
|
+
import { parseISO, addMinutes, differenceInHours, isValid } from 'date-fns';
|
|
36
36
|
import { formatInTimeZone as fnsFormatInTimeZone, toZonedTime as fnsToZonedTime, fromZonedTime as fnsFromZonedTime } from 'date-fns-tz';
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -54,7 +54,7 @@ class CSRFManager {
|
|
|
54
54
|
await this.persistTokens();
|
|
55
55
|
|
|
56
56
|
return token;
|
|
57
|
-
} catch (
|
|
57
|
+
} catch (_error) {
|
|
58
58
|
throw new Error('CSRF token generation failed');
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -98,7 +98,7 @@ class CSRFManager {
|
|
|
98
98
|
await this.persistTokens();
|
|
99
99
|
|
|
100
100
|
return true;
|
|
101
|
-
} catch (
|
|
101
|
+
} catch (_error) {
|
|
102
102
|
return false;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -158,7 +158,7 @@ class CSRFManager {
|
|
|
158
158
|
JSON.stringify(tokensArray),
|
|
159
159
|
{ encrypt: true, expiry: this.TOKEN_EXPIRY }
|
|
160
160
|
);
|
|
161
|
-
} catch (
|
|
161
|
+
} catch (_error) {
|
|
162
162
|
// Silent fail - tokens will be regenerated if needed
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -175,7 +175,7 @@ class CSRFManager {
|
|
|
175
175
|
// Clean up on load
|
|
176
176
|
await this.cleanupExpiredTokens();
|
|
177
177
|
}
|
|
178
|
-
} catch (
|
|
178
|
+
} catch (_error) {
|
|
179
179
|
this.tokenCache.clear();
|
|
180
180
|
}
|
|
181
181
|
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# Cursor Rules Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to pace-core cursor rules will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [Unreleased]
|
|
9
|
-
|
|
10
|
-
### Added
|
|
11
|
-
- **08-markup-quality.mdc** - Enforces clean markup standards, semantic HTML usage, and pace-core component patterns
|
|
12
|
-
|
|
13
|
-
## [1.1.0] - 2025-01-28
|
|
14
|
-
|
|
15
|
-
### Added
|
|
16
|
-
- **08-markup-quality.mdc** - Comprehensive guide for markup quality, semantic HTML, and pace-core component usage patterns
|
|
17
|
-
- Enforces pace-core component usage over custom solutions
|
|
18
|
-
- Prohibits `<div>` elements (except first child of `<body>` in `index.html`)
|
|
19
|
-
- Requires semantic HTML elements (`<main>`, `<section>`, `<article>`, etc.)
|
|
20
|
-
- Prohibits typography styling (relies on pace-core core.css)
|
|
21
|
-
- Requires React Fragments for grouping without semantic meaning
|
|
22
|
-
- Enforces minimal element nesting and clear semantic purpose
|
|
23
|
-
- Includes decision tree and comprehensive checklist
|
|
24
|
-
|
|
25
|
-
## [1.0.0] - 2025-01-15
|
|
26
|
-
|
|
27
|
-
### Added
|
|
28
|
-
- Initial release of cursor rules system
|
|
29
|
-
- 8 comprehensive rule files covering compliance, standards, structure, SOLID, testing, bug reports, code quality, and tech stack
|
|
30
|
-
- Installation script with safety guards
|
|
31
|
-
- Comprehensive audit tool with Phase 1 (deterministic) and Phase 2 (heuristic) checks
|
|
32
|
-
- Markdown report generation with timestamps
|
|
33
|
-
|
|
34
|
-
## [1.0.0] - 2025-01-15
|
|
35
|
-
|
|
36
|
-
### Added
|
|
37
|
-
- **00-pace-core-compliance.mdc** - Enforces pace-core usage patterns
|
|
38
|
-
- **01-standards-compliance.mdc** - Maps to all pace-core standards
|
|
39
|
-
- **02-project-structure.mdc** - Defines standard folder structure
|
|
40
|
-
- **03-solid-principles.mdc** - Enforces SOLID architecture principles
|
|
41
|
-
- **04-testing-standards.mdc** - Enforces testing framework consistency
|
|
42
|
-
- **05-bug-reports-and-features.mdc** - Templates for bug reports and feature requests
|
|
43
|
-
- **06-code-quality.mdc** - Enforces code quality standards
|
|
44
|
-
- **07-tech-stack-compliance.mdc** - Enforces tech stack versions and patterns
|
|
45
|
-
|
|
46
|
-
### Features
|
|
47
|
-
- Opt-in installation script (not automatic postinstall)
|
|
48
|
-
- Safety guards (environment variable, git check)
|
|
49
|
-
- Version tracking in rule files
|
|
50
|
-
- Rule numbering system (pace-core: 00-09, apps: 50+)
|
|
51
|
-
- Targeted globs for efficient rule application
|
|
52
|
-
- MUST/SHOULD/MAY semantics for clear guidance
|
|
53
|
-
- Comprehensive audit tool with markdown reports
|
|
54
|
-
- Phase-based audit approach (deterministic vs heuristic)
|
|
55
|
-
|
|
56
|
-
### Documentation
|
|
57
|
-
- README.md with installation and usage guide
|
|
58
|
-
- Getting started guide in docs
|
|
59
|
-
- Updated standards README with cursor rules section
|
|
60
|
-
|
|
61
|
-
## Migration Guide
|
|
62
|
-
|
|
63
|
-
### From No Rules to Cursor Rules
|
|
64
|
-
|
|
65
|
-
1. Install pace-core (if not already installed):
|
|
66
|
-
```bash
|
|
67
|
-
npm install @jmruthers/pace-core
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
2. Install cursor rules:
|
|
71
|
-
```bash
|
|
72
|
-
node node_modules/@jmruthers/pace-core/scripts/install-cursor-rules.cjs
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
3. Restart Cursor to load rules
|
|
76
|
-
|
|
77
|
-
4. Run audit to check compliance:
|
|
78
|
-
```bash
|
|
79
|
-
node node_modules/@jmruthers/pace-core/scripts/audit-consuming-app.cjs
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Updating Rules
|
|
83
|
-
|
|
84
|
-
When pace-core is updated:
|
|
85
|
-
|
|
86
|
-
1. Update pace-core:
|
|
87
|
-
```bash
|
|
88
|
-
npm update @jmruthers/pace-core
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
2. Update rules:
|
|
92
|
-
```bash
|
|
93
|
-
npm run setup:cursor-rules
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
3. Review any changes in rule files
|
|
97
|
-
|
|
98
|
-
### Custom Rules
|
|
99
|
-
|
|
100
|
-
If you have custom rules, number them starting at 50:
|
|
101
|
-
- `50-my-custom-rule.mdc`
|
|
102
|
-
- `51-another-rule.mdc`
|
|
103
|
-
- etc.
|
|
104
|
-
|
|
105
|
-
This ensures pace-core rules (00-09) load first.
|
|
106
|
-
|
|
107
|
-
## Version History
|
|
108
|
-
|
|
109
|
-
- **1.1.0** (2025-01-28) - Added markup quality rule (08-markup-quality.mdc)
|
|
110
|
-
- **1.0.0** (2025-01-15) - Initial release
|
|
111
|
-
|
|
112
|
-
## Future Enhancements
|
|
113
|
-
|
|
114
|
-
Potential future enhancements:
|
|
115
|
-
- CLI for rule validation
|
|
116
|
-
- GitHub Action template for PR audits
|
|
117
|
-
- Rule update notification system
|
|
118
|
-
- Interactive rule configuration
|
|
119
|
-
- Rule effectiveness metrics
|
package/cursor-rules/README.md
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
# pace-core Cursor Rules
|
|
2
|
-
|
|
3
|
-
This directory contains Cursor rules that ensure consuming apps maintain quality, consistency, and compliance with pace-core standards.
|
|
4
|
-
|
|
5
|
-
## What are Cursor Rules?
|
|
6
|
-
|
|
7
|
-
Cursor rules are `.mdc` (Markdown Cursor) files that guide AI assistants (like Cursor) to follow specific patterns and standards when writing code. These rules are automatically loaded by Cursor when present in `.cursor/rules/` directory.
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
### Automatic Installation (Recommended)
|
|
12
|
-
|
|
13
|
-
Run the installation script from your consuming app root:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
node node_modules/@jmruthers/pace-core/scripts/install-cursor-rules.cjs
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Or add to your `package.json`:
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"scripts": {
|
|
24
|
-
"setup:cursor-rules": "node node_modules/@jmruthers/pace-core/scripts/install-cursor-rules.cjs"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Then run:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm run setup:cursor-rules
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Manual Installation
|
|
36
|
-
|
|
37
|
-
Copy all `.mdc` files from `node_modules/@jmruthers/pace-core/cursor-rules/` to your `.cursor/rules/` directory.
|
|
38
|
-
|
|
39
|
-
## Rule Files
|
|
40
|
-
|
|
41
|
-
The rules are numbered for ordering (00-08):
|
|
42
|
-
|
|
43
|
-
- **00-pace-core-compliance.mdc** - Enforce pace-core usage patterns
|
|
44
|
-
- **01-standards-compliance.mdc** - Enforce all pace-core standards
|
|
45
|
-
- **02-project-structure.mdc** - Define standard folder structure
|
|
46
|
-
- **03-solid-principles.mdc** - Enforce SOLID architecture principles
|
|
47
|
-
- **04-testing-standards.mdc** - Enforce testing framework consistency
|
|
48
|
-
- **05-bug-reports-and-features.mdc** - Templates for bug reports and feature requests (guidance-only)
|
|
49
|
-
- **06-code-quality.mdc** - Enforce code quality standards
|
|
50
|
-
- **07-tech-stack-compliance.mdc** - Enforce tech stack versions and patterns
|
|
51
|
-
- **08-markup-quality.mdc** - Enforce clean markup standards, semantic HTML usage, and pace-core component patterns
|
|
52
|
-
|
|
53
|
-
## Rule Numbering System
|
|
54
|
-
|
|
55
|
-
- **pace-core rules**: `00-09` (reserved for pace-core)
|
|
56
|
-
- **Your app rules**: `50+` (create your own rules starting at 50)
|
|
57
|
-
|
|
58
|
-
This ensures pace-core rules load first, and your custom rules load after.
|
|
59
|
-
|
|
60
|
-
## Customization
|
|
61
|
-
|
|
62
|
-
### Adding Your Own Rules
|
|
63
|
-
|
|
64
|
-
Create your own rules in `.cursor/rules/` with numbers starting at `50`:
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
.cursor/rules/
|
|
68
|
-
├── 00-pace-core-compliance.mdc # pace-core rule
|
|
69
|
-
├── 01-standards-compliance.mdc # pace-core rule
|
|
70
|
-
├── ...
|
|
71
|
-
├── 50-my-custom-rule.mdc # Your custom rule
|
|
72
|
-
└── 51-another-custom-rule.mdc # Your custom rule
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Updating Rules
|
|
76
|
-
|
|
77
|
-
When pace-core is updated, run the installation script again. The script will:
|
|
78
|
-
- **Automatically update** pace-core rules (00-09) if they've changed (version or content differs)
|
|
79
|
-
- Preserve your custom rules (50+)
|
|
80
|
-
- Skip files that are already up to date
|
|
81
|
-
|
|
82
|
-
### Force Update
|
|
83
|
-
|
|
84
|
-
To force update all rules (even when versions match):
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
node node_modules/@jmruthers/pace-core/scripts/install-cursor-rules.cjs --force
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
**Note**: Normally, pace-core rules (00-09) are automatically updated when they change. The `--force` flag forces an update even when versions match (useful if content changed but version metadata wasn't updated).
|
|
91
|
-
|
|
92
|
-
## How Cursor Uses Rules
|
|
93
|
-
|
|
94
|
-
Cursor automatically loads all `.mdc` files from `.cursor/rules/` when:
|
|
95
|
-
- You open a file that matches the rule's `globs` pattern
|
|
96
|
-
- You ask Cursor to write or modify code
|
|
97
|
-
- Cursor needs context for code generation
|
|
98
|
-
|
|
99
|
-
Rules with `alwaysApply: true` are always considered, while rules with `alwaysApply: false` are only referenced when relevant.
|
|
100
|
-
|
|
101
|
-
## Explicitly Referencing Rules
|
|
102
|
-
|
|
103
|
-
When working with Cursor, you can explicitly reference rules:
|
|
104
|
-
|
|
105
|
-
> "Use pace-core components and follow rules 00–04."
|
|
106
|
-
|
|
107
|
-
This helps Cursor focus on specific rule sets.
|
|
108
|
-
|
|
109
|
-
## Rule Format
|
|
110
|
-
|
|
111
|
-
Each rule file follows this format:
|
|
112
|
-
|
|
113
|
-
```markdown
|
|
114
|
-
---
|
|
115
|
-
description: Brief description
|
|
116
|
-
globs: ["targeted/path/**/*.{ts,tsx}"] # Files this rule applies to
|
|
117
|
-
alwaysApply: true # or false
|
|
118
|
-
paceCoreVersion: "0.5.x" # pace-core version
|
|
119
|
-
rulesVersion: "2025-01-15" # Rule update date
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
# Rule Title
|
|
123
|
-
|
|
124
|
-
Content with examples and guidelines.
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Safety Guards
|
|
128
|
-
|
|
129
|
-
The installation script includes safety guards:
|
|
130
|
-
|
|
131
|
-
- **Environment variable**: Set `PACE_CURSOR_RULES_DISABLED=1` to skip installation
|
|
132
|
-
- **Git check**: Skips if no `.git` folder exists (CI/safety)
|
|
133
|
-
- **Auto-update**: Automatically updates pace-core rules (00-09) when they change
|
|
134
|
-
- **Protection**: Never overwrites custom app rules (50+)
|
|
135
|
-
|
|
136
|
-
## Monorepo Support
|
|
137
|
-
|
|
138
|
-
For monorepos, run the installation script from each app's root directory. Each app maintains its own `.cursor/rules/` directory.
|
|
139
|
-
|
|
140
|
-
## Troubleshooting
|
|
141
|
-
|
|
142
|
-
### Rules Not Loading
|
|
143
|
-
|
|
144
|
-
1. Verify rules are in `.cursor/rules/` directory
|
|
145
|
-
2. Check file extensions are `.mdc`
|
|
146
|
-
3. Restart Cursor if rules were just installed
|
|
147
|
-
4. Check rule frontmatter is valid YAML
|
|
148
|
-
|
|
149
|
-
### Rules Conflicting
|
|
150
|
-
|
|
151
|
-
1. Check rule numbering (pace-core: 00-09, yours: 50+)
|
|
152
|
-
2. Verify `globs` patterns don't overlap unnecessarily
|
|
153
|
-
3. Review rule priorities in frontmatter
|
|
154
|
-
|
|
155
|
-
### Installation Fails
|
|
156
|
-
|
|
157
|
-
1. Check you're in the app root directory
|
|
158
|
-
2. Verify `node_modules/@jmruthers/pace-core/` exists
|
|
159
|
-
3. Check file permissions
|
|
160
|
-
4. Try with `--force` flag if needed
|
|
161
|
-
|
|
162
|
-
## Audit Tool
|
|
163
|
-
|
|
164
|
-
Run the audit tool to check compliance:
|
|
165
|
-
|
|
166
|
-
```bash
|
|
167
|
-
node node_modules/@jmruthers/pace-core/scripts/audit-consuming-app.cjs
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
This generates a timestamped markdown report in `audit/` directory.
|
|
171
|
-
|
|
172
|
-
## Version Tracking
|
|
173
|
-
|
|
174
|
-
Each rule file includes version metadata:
|
|
175
|
-
- `paceCoreVersion`: pace-core version these rules target
|
|
176
|
-
- `rulesVersion`: Date when rules were last updated
|
|
177
|
-
|
|
178
|
-
Check these to see if rules need updating.
|
|
179
|
-
|
|
180
|
-
## Related Documentation
|
|
181
|
-
|
|
182
|
-
- [pace-core Standards](../docs/standards/README.md)
|
|
183
|
-
- [Getting Started Guide](../docs/getting-started/cursor-rules.md)
|
|
184
|
-
- [pace-core Exports](../docs/api-reference/README.md)
|
|
185
|
-
|
|
186
|
-
## Support
|
|
187
|
-
|
|
188
|
-
For issues with cursor rules:
|
|
189
|
-
1. Check this README
|
|
190
|
-
2. Review rule files for guidance
|
|
191
|
-
3. File an issue in pace-core repository
|
|
192
|
-
4. Check pace-core documentation
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ActionButtons,
|
|
3
|
-
BulkOperationsDropdown,
|
|
4
|
-
ColumnFactory,
|
|
5
|
-
ColumnVisibilityDropdown,
|
|
6
|
-
DataTable,
|
|
7
|
-
DataTableCore,
|
|
8
|
-
DataTableErrorBoundary,
|
|
9
|
-
DataTableModals,
|
|
10
|
-
DataTableToolbar,
|
|
11
|
-
EditableRow,
|
|
12
|
-
EmptyState,
|
|
13
|
-
EnhancedPaginationControls,
|
|
14
|
-
GroupHeader,
|
|
15
|
-
GroupingDropdown,
|
|
16
|
-
ImportModal,
|
|
17
|
-
LoadingState,
|
|
18
|
-
PaginationControls,
|
|
19
|
-
UnifiedTableBody,
|
|
20
|
-
announce,
|
|
21
|
-
announceBulkOperation,
|
|
22
|
-
announceFilterChange,
|
|
23
|
-
announceLoadingState,
|
|
24
|
-
announcePaginationChange,
|
|
25
|
-
announceSearchResults,
|
|
26
|
-
announceSelectionChange,
|
|
27
|
-
announceSortChange,
|
|
28
|
-
average,
|
|
29
|
-
calculateAllDepths,
|
|
30
|
-
calculateAllIndentation,
|
|
31
|
-
calculateIndentation,
|
|
32
|
-
calculateOptimalPageSize,
|
|
33
|
-
cleanupLiveRegion,
|
|
34
|
-
count,
|
|
35
|
-
createHierarchicalStructure,
|
|
36
|
-
defaultDataTableFeatures,
|
|
37
|
-
exportToCSV,
|
|
38
|
-
exportToCSVWithTableRows,
|
|
39
|
-
generateCSVContent,
|
|
40
|
-
getAriaSortValue,
|
|
41
|
-
getCellRenderer,
|
|
42
|
-
getColumnHeaderText,
|
|
43
|
-
getHierarchicalSortConfig,
|
|
44
|
-
getPageSizeOptions,
|
|
45
|
-
getPaginationBinding,
|
|
46
|
-
getRowDepth,
|
|
47
|
-
getRowDescription,
|
|
48
|
-
getRowIdSafe,
|
|
49
|
-
getSortButtonLabel,
|
|
50
|
-
groupHierarchicalData,
|
|
51
|
-
hasValidRowId,
|
|
52
|
-
initializeLiveRegion,
|
|
53
|
-
isHierarchicalSortableColumn,
|
|
54
|
-
max,
|
|
55
|
-
min,
|
|
56
|
-
normalizeDataTableFeatures,
|
|
57
|
-
shouldShowColumnForRow,
|
|
58
|
-
sortHierarchicalDataByStructure,
|
|
59
|
-
sortHierarchicalDataWithSorting,
|
|
60
|
-
sum,
|
|
61
|
-
validateHierarchicalData,
|
|
62
|
-
validatePaginationConfig
|
|
63
|
-
} from "./chunk-7JPAB3T5.js";
|
|
64
|
-
import "./chunk-NN6WWZ5U.js";
|
|
65
|
-
import {
|
|
66
|
-
CircuitBreaker,
|
|
67
|
-
DEFAULT_FALLBACK_CONFIG,
|
|
68
|
-
DataChunkManager,
|
|
69
|
-
DataTableError,
|
|
70
|
-
DataTableErrorType,
|
|
71
|
-
ErrorRecoveryManager,
|
|
72
|
-
MemoryMonitor,
|
|
73
|
-
SearchIndex,
|
|
74
|
-
VisibilityTracker,
|
|
75
|
-
chunkData,
|
|
76
|
-
debounce,
|
|
77
|
-
determinePaginationMode,
|
|
78
|
-
getOptimalPageSizeOptions,
|
|
79
|
-
safeExecute,
|
|
80
|
-
throttle,
|
|
81
|
-
useDataTablePerformance
|
|
82
|
-
} from "./chunk-6SOIHG6Z.js";
|
|
83
|
-
import "./chunk-OEWDTMG7.js";
|
|
84
|
-
import "./chunk-KQCRWDSA.js";
|
|
85
|
-
import "./chunk-AVMLPIM7.js";
|
|
86
|
-
import "./chunk-3LPHPB62.js";
|
|
87
|
-
import "./chunk-63FOKYGO.js";
|
|
88
|
-
import "./chunk-36LVWXB2.js";
|
|
89
|
-
import "./chunk-QXHPKYJV.js";
|
|
90
|
-
import "./chunk-M43Y4SSO.js";
|
|
91
|
-
import "./chunk-M7MPQISP.js";
|
|
92
|
-
import "./chunk-FMUCXFII.js";
|
|
93
|
-
import "./chunk-VBXEHIUJ.js";
|
|
94
|
-
import "./chunk-PWLANIRT.js";
|
|
95
|
-
import "./chunk-DGUM43GV.js";
|
|
96
|
-
export {
|
|
97
|
-
ActionButtons,
|
|
98
|
-
BulkOperationsDropdown,
|
|
99
|
-
CircuitBreaker,
|
|
100
|
-
ColumnFactory,
|
|
101
|
-
ColumnVisibilityDropdown,
|
|
102
|
-
DEFAULT_FALLBACK_CONFIG,
|
|
103
|
-
DataChunkManager,
|
|
104
|
-
DataTable,
|
|
105
|
-
DataTableCore,
|
|
106
|
-
DataTableError,
|
|
107
|
-
DataTableErrorBoundary,
|
|
108
|
-
DataTableErrorType,
|
|
109
|
-
DataTableModals,
|
|
110
|
-
DataTableToolbar,
|
|
111
|
-
EditableRow,
|
|
112
|
-
EmptyState,
|
|
113
|
-
EnhancedPaginationControls,
|
|
114
|
-
ErrorRecoveryManager,
|
|
115
|
-
GroupHeader,
|
|
116
|
-
GroupingDropdown,
|
|
117
|
-
ImportModal,
|
|
118
|
-
LoadingState,
|
|
119
|
-
MemoryMonitor,
|
|
120
|
-
PaginationControls,
|
|
121
|
-
SearchIndex,
|
|
122
|
-
UnifiedTableBody,
|
|
123
|
-
VisibilityTracker,
|
|
124
|
-
announce,
|
|
125
|
-
announceBulkOperation,
|
|
126
|
-
announceFilterChange,
|
|
127
|
-
announceLoadingState,
|
|
128
|
-
announcePaginationChange,
|
|
129
|
-
announceSearchResults,
|
|
130
|
-
announceSelectionChange,
|
|
131
|
-
announceSortChange,
|
|
132
|
-
average,
|
|
133
|
-
calculateAllDepths,
|
|
134
|
-
calculateAllIndentation,
|
|
135
|
-
calculateIndentation,
|
|
136
|
-
calculateOptimalPageSize,
|
|
137
|
-
chunkData,
|
|
138
|
-
cleanupLiveRegion,
|
|
139
|
-
count,
|
|
140
|
-
createHierarchicalStructure,
|
|
141
|
-
debounce,
|
|
142
|
-
defaultDataTableFeatures,
|
|
143
|
-
determinePaginationMode,
|
|
144
|
-
exportToCSV,
|
|
145
|
-
exportToCSVWithTableRows,
|
|
146
|
-
generateCSVContent,
|
|
147
|
-
getAriaSortValue,
|
|
148
|
-
getCellRenderer,
|
|
149
|
-
getColumnHeaderText,
|
|
150
|
-
getHierarchicalSortConfig,
|
|
151
|
-
getOptimalPageSizeOptions,
|
|
152
|
-
getPageSizeOptions,
|
|
153
|
-
getPaginationBinding,
|
|
154
|
-
getRowDepth,
|
|
155
|
-
getRowDescription,
|
|
156
|
-
getRowIdSafe,
|
|
157
|
-
getSortButtonLabel,
|
|
158
|
-
groupHierarchicalData,
|
|
159
|
-
hasValidRowId,
|
|
160
|
-
initializeLiveRegion,
|
|
161
|
-
isHierarchicalSortableColumn,
|
|
162
|
-
max,
|
|
163
|
-
min,
|
|
164
|
-
normalizeDataTableFeatures,
|
|
165
|
-
safeExecute,
|
|
166
|
-
shouldShowColumnForRow,
|
|
167
|
-
sortHierarchicalDataByStructure,
|
|
168
|
-
sortHierarchicalDataWithSorting,
|
|
169
|
-
sum,
|
|
170
|
-
throttle,
|
|
171
|
-
useDataTablePerformance,
|
|
172
|
-
validateHierarchicalData,
|
|
173
|
-
validatePaginationConfig
|
|
174
|
-
};
|
|
175
|
-
//# sourceMappingURL=DataTable-E7YQZD7D.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|