@propriety/court-calendar 1.0.128 → 1.0.131

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.
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: library-api-reviewer
3
+ description: Reviews changes to @propriety/court-calendar for public API compatibility — breaking prop changes, removed exports, peer dep violations. Invoke before opening a PR or publishing.
4
+ ---
5
+
6
+ You are a library API compatibility reviewer for `@propriety/court-calendar`.
7
+
8
+ Analyze the current diff or staged changes and identify:
9
+
10
+ 1. **Removed or renamed exports** — check `src/index.ts` for anything removed or renamed that consumers may depend on
11
+ 2. **Breaking prop changes** — removed props, changed types (stricter or different), new required props added to existing components
12
+ 3. **Peer dependency violations** — code that directly imports from `@mui/`, `@emotion/`, `react`, `react-dom` without accounting for them being peer deps (they must not be bundled)
13
+ 4. **Type regressions** — public TypeScript types that became more restrictive or were removed
14
+ 5. **Dexie schema changes** — any changes to IndexedDB stores in `src/` must handle version migrations
15
+ 6. **Context API surface** — changes to `ReferenceDataContext` shape affect all consumers of `useReferenceData()`
16
+
17
+ Output a verdict:
18
+ - **BREAKING** — consumers on the previous version will break on upgrade; needs a major version bump
19
+ - **NON-BREAKING** — new features or additions only; minor version bump appropriate
20
+ - **PATCH** — bug fixes with no API surface changes
21
+
22
+ Include specifics: which files changed, what the impact is, and the recommended semver bump.
@@ -0,0 +1,19 @@
1
+ {
2
+ "hooks": {
3
+ "PostToolUse": [
4
+ {
5
+ "matcher": "Edit|Write",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node -e \"const i=JSON.parse(process.env.CLAUDE_TOOL_INPUT||'{}');const f=i.file_path||'';if((f.endsWith('.ts')||f.endsWith('.tsx'))&&!f.includes('dist/')){const cp=require('child_process');try{cp.execSync('npx biome format --write '+JSON.stringify(f),{stdio:'pipe',cwd:'c:/Users/Optiplex-BFHN/projects/court-calendar'})}catch(e){}}\""
10
+ },
11
+ {
12
+ "type": "command",
13
+ "command": "node -e \"const i=JSON.parse(process.env.CLAUDE_TOOL_INPUT||'{}');const f=i.file_path||'';if((f.endsWith('.ts')||f.endsWith('.tsx'))&&!f.includes('.test.')&&f.includes('src/')){const cp=require('child_process');try{cp.execSync('npx vitest run --related '+JSON.stringify(f),{stdio:'pipe',cwd:'c:/Users/Optiplex-BFHN/projects/court-calendar',timeout:30000})}catch(e){}}\""
14
+ }
15
+ ]
16
+ }
17
+ ]
18
+ }
19
+ }
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: gen-test
3
+ description: Generate Vitest + React Testing Library tests for a court-calendar component or hook
4
+ ---
5
+
6
+ Generate tests for the `@propriety/court-calendar` library targeting the file or subject passed as $ARGUMENTS.
7
+
8
+ ## Project Test Conventions
9
+ - Test files live in `src/__tests__/` named `<subject>.test.ts(x)`
10
+ - Shared fixtures: `src/__tests__/fixtures.ts` — read this first for reusable test data
11
+ - Shared helpers: `src/__tests__/helpers/`
12
+ - Hook test utilities: `src/__tests__/hooks/`
13
+ - Vitest globals (`describe`, `it`, `expect`, `vi`) are auto-imported — no import needed
14
+ - Use `renderHook` from `@testing-library/react` for custom hooks
15
+ - Mock context modules: `vi.mock('@/context/ReferenceDataContext', () => ({ useReferenceData: vi.fn(() => ({ allUsers: [], allHearingOfficers: [], allMuniNames: [], isLoading: false })) }))`
16
+
17
+ ## Steps
18
+ 1. Read the target file to understand its props, return values, and side effects
19
+ 2. Read `src/__tests__/fixtures.ts` for available court case / event test data
20
+ 3. Scan `src/__tests__/helpers/` and `src/__tests__/hooks/` for setup utilities to reuse
21
+ 4. Write tests covering: happy path, edge cases, null/undefined inputs, and loading states
22
+ 5. Place output in `src/__tests__/<subject>.test.ts(x)`
23
+
24
+ Target: $ARGUMENTS
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: release-prep
3
+ description: Prepare @propriety/court-calendar for npm publish — runs all checks, prompts for version bump, builds dist
4
+ ---
5
+
6
+ Run the full release checklist for `@propriety/court-calendar`. Stop and report on first failure.
7
+
8
+ ## Steps (sequential — stop on failure)
9
+ 1. `npx tsc --noEmit` — type check must pass with zero errors
10
+ 2. `npx vitest run` — all tests must pass
11
+ 3. `npx biome check src/` — no lint or format violations
12
+ 4. Ask the user: **patch / minor / major** version bump? (default: patch)
13
+ - Update the `version` field in `package.json` accordingly
14
+ 5. `npm run build` — must succeed
15
+ 6. Verify `dist/index.mjs` and `dist/index.d.ts` exist and are non-empty
16
+ 7. Report: new version number, dist file sizes, ready to `npm publish`
17
+
18
+ Bump type from $ARGUMENTS (default: patch if not provided).
package/CLAUDE.md ADDED
@@ -0,0 +1,41 @@
1
+ # court-calendar
2
+
3
+ Published npm package: `@propriety/court-calendar` — a React component library built with Vite in library mode.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ npm run build # tsc -b && vite build → dist/
9
+ npx vitest run # run all tests
10
+ npx biome format --write <file> # format a file
11
+ npx biome check src/ # lint entire src
12
+ ```
13
+
14
+ ## Architecture
15
+
16
+ - **Entry**: `src/index.ts` → exports `CCalendar` component from `src/_components/CCalendar.tsx`
17
+ - **Path alias**: `@/` resolves to `./src/`
18
+ - **Build output**: `dist/index.mjs` (ES module) + `dist/index.d.ts` (types)
19
+ - **Peer deps** (not bundled): React, react-dom, MUI 5, Emotion — `vite.config.ts` externalizes these
20
+
21
+ ## Key Pattern: ReferenceDataContext
22
+
23
+ Reference data (users, hearing officers, municipalities) is fetched once in `ReferenceDataProvider` (wrapped inside `CCalendar`) and consumed via `useReferenceData()` in child components. Do **not** fetch this data at the module level or use top-level await.
24
+
25
+ Context is at `src/context/ReferenceDataContext.tsx` and provides: `allUsers`, `allHearingOfficers`, `allMuniNames`, `getTownshipName`, `getCountyName`, `isLoading`.
26
+
27
+ ## Runtime Config
28
+
29
+ `import.meta.env` values are baked in at **library build time**, not consumer runtime. Pass runtime config (API keys, endpoints) as React props and thread them through context — never read env vars in library code.
30
+
31
+ ## Component Props
32
+
33
+ `CCalendar` accepts:
34
+ - `apiKey` — runtime API key (passed through context, not env var)
35
+ - `activeUser` — the currently logged-in user object
36
+
37
+ ## Tooling
38
+
39
+ - **Formatter/Linter**: Biome — not Prettier or ESLint
40
+ - **Tests**: Vitest + @testing-library/react. Files: `src/__tests__/`, fixtures: `src/__tests__/fixtures.ts`
41
+ - **Pre-commit**: Husky runs on commit — run `npx biome format --write` before staging
@@ -1,3 +1,3 @@
1
- export default function NoticeFileLink({ fileKey }: {
2
- fileKey: string | null;
1
+ export default function NoticeFileLink({ fileKeys }: {
2
+ fileKeys: string[] | null;
3
3
  }): import("react/jsx-runtime").JSX.Element;
@@ -7,5 +7,7 @@ declare const CreateEditCase: import('react').NamedExoticComponent<{
7
7
  setEditedCases: (cases: Case[]) => void;
8
8
  modalMode: ModalMode;
9
9
  activeUser: number;
10
+ pendingNoticeFiles: File[];
11
+ setPendingNoticeFiles: (files: File[]) => void;
10
12
  }>;
11
13
  export default CreateEditCase;
@@ -1,7 +1,8 @@
1
1
  import { DateType, CourtDate, DateEditLog } from '../../types';
2
2
  export declare function getAllDates(apiKey: string, type?: DateType): Promise<Array<CourtDate>>;
3
- export declare function updateCourtDate(courtDateId: number, updatedData: Partial<CourtDate>, apiKey: string, courtCases?: string[], user?: number, type?: DateType, skipMotion?: boolean): Promise<boolean>;
3
+ export declare function updateCourtDate(courtDateId: number, updatedData: Partial<CourtDate>, apiKey: string, courtCases?: string[], user?: number, type?: DateType, skipMotion?: boolean, noticeFiles?: File[]): Promise<boolean>;
4
+ export declare function getCourtDate(courtDateId: number, apiKey: string, type?: DateType): Promise<CourtDate | null>;
4
5
  export declare function deleteCourtDate(courtDateId: number, apiKey: string, type?: DateType): Promise<boolean>;
5
- export declare function createCourtDate(courtDate: Date, muniCode: string, apiKey: string, courtCases?: string[], hearingTime?: string, multipleDates?: Date[], type?: DateType): Promise<number | null>;
6
+ export declare function createCourtDate(courtDate: Date, muniCode: string, apiKey: string, courtCases?: string[], hearingTime?: string, multipleDates?: Date[], type?: DateType, noticeFiles?: File[]): Promise<number | null>;
6
7
  export declare function snoozeUploadDeadline(courtDateId: number, apiKey: string): Promise<boolean>;
7
8
  export declare function getDateEditLogs(courtDateId: number, apiKey: string, type?: DateType): Promise<DateEditLog | null>;
@@ -21,7 +21,7 @@ import { ModalMode } from '../_components/Modal/types';
21
21
  * - `handleViewUpdateChair` – Optimistically updates a first/second chair in view mode.
22
22
  * - `handleSelectedCasesAdjournmentChange` – Updates the adjournment date for a set of cases.
23
23
  */
24
- export declare function useModalActions({ modalMode, selectedCourtDate, selectedCases, editedData, editedCases, setEditedData, setIsOpen, }: {
24
+ export declare function useModalActions({ modalMode, selectedCourtDate, selectedCases, editedData, editedCases, setEditedData, setIsOpen, pendingNoticeFiles, }: {
25
25
  modalMode: ModalMode;
26
26
  selectedCourtDate: CourtDate | null;
27
27
  selectedCases: Case[];
@@ -29,6 +29,7 @@ export declare function useModalActions({ modalMode, selectedCourtDate, selected
29
29
  editedCases: Case[];
30
30
  setEditedData: (data: CourtDate) => void;
31
31
  setIsOpen: (isOpen: boolean) => void;
32
+ pendingNoticeFiles?: File[];
32
33
  }): {
33
34
  handleSave: () => Promise<boolean>;
34
35
  handleDelete: () => Promise<void>;