Skip to content

Tech Debt and Fixes - #567

Merged
stdavis merged 37 commits into
mainfrom
dev
Sep 10, 2026
Merged

stdavis merged 37 commits into
mainfrom
dev

Conversation

@stdavis

@stdavis stdavis commented Sep 10, 2026

Copy link
Copy Markdown
Member

No description provided.

stdavis and others added 30 commits August 14, 2026 08:46
this is annoying and non-standard
Address some breaking changes
Plus other dominos such as the @ugrc packages
Pinned TypeScript 6.0.3 with Atlas-style composite configs.
Converted vite.config.ts and added pnpm run check.
Created deploy-contained @ugrc/plss-shared under shared.
Replaced cross-boundary relative imports with package exports.
Added the shared package TypeScript build and declaration output.
Converted Options.ts as the first production TypeScript module.
Ignored generated functions/lib and shared dist output.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The cross-stack TypeScript migration, major runtime upgrades, and deployment changes warrant final human validation, with documentation corrections still outstanding.

Pull request overview

Modernizes the PLSS application through TypeScript migration, dependency/runtime upgrades, and fixes across submission, mapping, and Firebase workflows.

Changes:

  • Migrates frontend and Functions code to TypeScript with shared schemas and stronger typing.
  • Upgrades Node, Firebase, Ky, pdfmake, CI, and workspace configuration.
  • Fixes submission completion, monument generation, mobile layout, CSP, and MRRC defaults.
File summaries
File Description
vite.config.ts Adds typed Vite/Vitest configuration.
vite.config.js Removes JavaScript configuration.
vite-plugin-eslint.d.ts Declares ESLint plugin types.
tsconfig.vite-config.json Configures Vite type checking.
tsconfig.json Adds TypeScript project references.
tsconfig.browser.json Configures browser TypeScript sources.
src/vite-env.d.ts Adds Node type references.
src/main.tsx Types application initialization.
src/index.css Improves viewport and drawer sizing.
src/components/reducers/AppReducer.ts Types application state and actions.
src/components/pageElements/Welcome.tsx Types welcome-screen dispatch.
src/components/pageElements/utils.ts Types sorting and ID normalization.
src/components/pageElements/utils.test.ts Updates utility test import.
src/components/pageElements/TieSheetList.tsx Types tie-sheet retrieval.
src/components/pageElements/SubmissionStatus.stories.tsx Updates typed story imports.
src/components/pageElements/Profile.tsx Types profile forms and callables.
src/components/pageElements/MyContent.stories.tsx Updates typed story imports.
src/components/pageElements/mapElements/useGeoLocation.ts Adds typed geolocation hook.
src/components/pageElements/mapElements/useGeoLocation.js Removes JavaScript hook.
src/components/pageElements/mapElements/townships.ts Makes township values immutable literals.
src/components/pageElements/mapElements/Township.stories.tsx Updates typed story imports.
src/components/pageElements/mapElements/MyLocation.tsx Types and relocates GPS control.
src/components/pageElements/mapElements/MyLocation.stories.tsx Updates story import.
src/components/pageElements/mapElements/MonumentRecord.tsx Types monument queries and geometry.
src/components/pageElements/mapElements/MonumentRecord.stories.tsx Updates typed story imports.
src/components/pageElements/mapElements/HomeButton.tsx Adds typed map-home control.
src/components/pageElements/mapElements/HomeButton.jsx Removes JavaScript control.
src/components/pageElements/mapElements/GroupButton.tsx Types and improves tool dialog layout.
src/components/pageElements/mapElements/GroupButton.stories.tsx Updates story import.
src/components/pageElements/Logo.tsx Types logo properties.
src/components/pageElements/Login.tsx Types login profile handling.
src/components/pageElements/Legend.tsx Types legend data.
src/components/pageElements/Legend.stories.tsx Updates typed story imports.
src/components/pageElements/Identify.tsx Types identify results and dispatch.
src/components/pageElements/Identify.stories.tsx Updates typed story imports.
src/components/pageElements/ErrorMessage.tsx Adds typed error component.
src/components/pageElements/ErrorMessage.jsx Removes JavaScript component.
src/components/pageElements/ErrorBoundary.tsx Safely formats unknown errors.
src/components/pageElements/CornerSubmission/Wizard.tsx Types wizard navigation.
src/components/pageElements/CornerSubmission/Wizard.stories.tsx Updates story import.
src/components/pageElements/CornerSubmission/SubmissionSuccess.tsx Types success-screen dispatch.
src/components/pageElements/CornerSubmission/SubmissionReview.stories.tsx Updates typed story imports.
src/components/pageElements/CornerSubmission/SubmissionNotice.tsx Types submission profile summary.
src/components/pageElements/CornerSubmission/Pdf.tsx Types existing-sheet form and MRRC default.
src/components/pageElements/CornerSubmission/Metadata.tsx Types metadata form and MRRC default.
src/components/pageElements/CornerSubmission/Images.tsx Types image fields and fixes error mapping.
src/components/pageElements/CornerSubmission/GridCoordinates.tsx Types grid-coordinate workflow.
src/components/pageElements/CornerSubmission/Datum.tsx Types datum selection and removes skipping.
src/components/pageElements/CornerSubmission/CornerSubmission.tsx Types and fixes wizard-state rendering.
src/components/pageElements/CornerSubmission/4-Images.stories.tsx Updates typed story imports.
src/components/pageElements/CornerSubmission/3c-Height.stories.tsx Updates typed story imports.
src/components/pageElements/CornerSubmission/3b-Longitude.stories.tsx Updates typed story imports.
src/components/pageElements/CornerSubmission/3a-Latitude.stories.tsx Updates typed story imports.
src/components/pageElements/CornerSubmission/3-Grid.stories.tsx Updates typed story imports.
src/components/pageElements/CornerSubmission/2-Datum.stories.tsx Updates typed story imports.
src/components/pageElements/CornerSubmission/1b-Existing.stories.tsx Updates typed story imports.
src/components/pageElements/CornerSubmission/1-Metadata.stories.tsx Updates typed story imports.
src/components/pageElements/CornerSubmission/0-CornerSubmission.stories.tsx Updates typed story imports.
src/components/pageElements/contentTypes.ts Defines shared page-content types.
src/components/pageElements/AddPoint.stories.tsx Updates typed story import.
src/components/machines/index.test.ts Expands typed state-machine tests.
src/components/machines/index.test.js Removes JavaScript tests.
src/components/machines/geolocation.ts Types geolocation state machine.
src/components/layoutElements/Menu.tsx Types menu and improves visibility.
src/components/layoutElements/Drawer.tsx Adds typed lazy-loaded drawer.
src/components/layoutElements/Drawer.jsx Removes JavaScript drawer.
src/components/hooks/usePageView.ts Adds typed analytics hook.
src/components/hooks/usePageView.jsx Removes JavaScript hook.
src/components/formElements/Switch.tsx Types toggle properties.
src/components/formElements/Switch.stories.tsx Updates story import.
src/components/formElements/Spacer.tsx Adds typed spacer.
src/components/formElements/Spacer.jsx Removes JavaScript spacer.
src/components/formElements/Select.tsx Adds typed listbox implementation.
src/components/formElements/Select.stories.tsx Updates story import.
src/components/formElements/Select.jsx Removes JavaScript select.
src/components/formElements/Note.tsx Adds typed note component.
src/components/formElements/Note.jsx Removes JavaScript note.
src/components/formElements/LimitedTextarea.tsx Types controlled textarea behavior.
src/components/formElements/LimitedTextarea.stories.tsx Updates story import.
src/components/formElements/Inputs.tsx Types native input properties.
src/components/formElements/Input.stories.tsx Updates story import.
src/components/formElements/Form.tsx Types numbered forms.
src/components/formElements/FileUpload.tsx Types upload validation and state.
src/components/formElements/Card.tsx Types card content.
src/components/formElements/Buttons.tsx Types buttons and links.
src/components/formElements/Button.stories.tsx Updates story import.
src/components/contexts/SubmissionContext.tsx Adds typed submission context hook.
src/components/contexts/SubmissionContext.jsx Removes JavaScript context.
src/components/app/App.tsx Updates typed application composition.
src/arcgis-elements.d.ts Declares ArcGIS custom elements.
pnpm-workspace.yaml Adds shared workspace and dependency policies.
index.html Uses the TypeScript entry point.
functions/types.d.ts Adds Functions type-module marker.
functions/tsconfig.json Configures Functions type checking.
functions/tsconfig.build.json Configures Functions compilation.
functions/storage/onDelete.ts Types profile-image synchronization.
functions/storage/onCreateNotify.ts Types notification generation.
functions/shared/tsconfig.json Configures shared package compilation.
functions/shared/package.json Defines the shared workspace package.
functions/shared/cornerSubmission/Schema.ts Types schemas and exports inferred models.
functions/shared/cornerSubmission/Schema.test.ts Modernizes schema test helpers.
functions/shared/cornerSubmission/Options.ts Adds immutable option literals.
functions/shared/cornerSubmission/blmPointId.ts Types township parsing.
functions/shared/cornerSubmission/blmPointId.test.ts Updates typed parser test.
functions/scripts/repair-missing-monuments.test.ts Tests monument repair selection.
functions/pdfHelpers.test.ts Tests upgraded PDF generation.
functions/package.json Adds builds and upgrades runtime dependencies.
functions/index.ts Types triggers and fixes authorization checks.
functions/https/postProfile.ts Saves validated profile values.
functions/https/postPoint.ts Saves validated reference points.
functions/https/postGeneratePreview.ts Types preview generation.
functions/https/postCancelCorner.ts Types cancellation and storage cleanup.
functions/https/getMyProfile.ts Types profile retrieval.
functions/https/getMyContent.ts Types user-content retrieval.
functions/firebase.ts Adds typed Firebase initialization.
functions/firebase.js Removes JavaScript initializer.
functions/emailHelpers.ts Types SendGrid and contact helpers.
functions/emailHelper.test.ts Adds contact-selection tests.
functions/drive.ts Types Google Drive operations.
functions/database/submissions/onDelete.ts Types attachment cleanup.
functions/database/submissions/onCreateMonument.ts Persists generated monument paths.
functions/database/submissions/onCreateMonument.test.ts Tests monument-path persistence.
functions/database/submissions/onCreateAddLocation.ts Types ArcGIS location lookup.
functions/database/submissions/onCancelSubmission.ts Types cancellation emails.
functions/converters.ts Types Firestore converters.
functions/auth/onCreate.ts Types user creation.
firebase.json Moves Functions to Node 24 and updates CSP.
eslint.config.js Ignores generated output.
commitlint.config.js Removes commit-message configuration.
CHANGELOG.md Records release-candidate changes.
.storybook/preview.ts Adds typed Storybook preview settings.
.storybook/main.ts Restricts stories to TypeScript.
.prettierignore Excludes the lockfile.
.husky/pre-commit Removes the pre-commit hook.
.husky/commit-msg Removes the commit-message hook.
.husky/.gitignore Removes obsolete Husky ignore entry.
.gitignore Ignores generated TypeScript and Storybook output.
.github/workflows/release.yml Simplifies release build commands.
.github/workflows/pull_request.yml Pins tooling and adds type checking.
.github/copilot-instructions.md Adds repository agent guidance.
Review details

Suppressed comments (2)

.github/copilot-instructions.md:45

  • The backend and Vite path references use filenames removed by this PR (functions/index.js, functions/firebase.js, and vite.config.js). Point the guide at their new TypeScript counterparts so future changes target the actual source files.
- `functions/index.js` is the Functions export and authorization boundary. Keep its lazy imports and v2 trigger/callable conventions; implement endpoint bodies in `functions/https/`, document-trigger code in `functions/database/submissions/`, and reusable validation/formatting in `functions/shared/`. Sensitive integrations use `defineSecret` (`SENDGRID_API_KEY`, `SHARED_DRIVE_ID`), not client environment variables.
- `functions/firebase.js` intentionally configures localhost and the dev Firebase project for `NODE_ENV=development` or `test`.
- `firestore.rules`, `storage.rules`, and `firestore.indexes.json` are deployed Firebase configuration. Storage rules have the executable root test above; preserve the 5 MB and authenticated-user constraints unless requirements intentionally change. Firestore submissions/stats require an authenticated, elevated submitter.
- `vite.config.js` is Vite/Vitest configuration and hardcodes `FIREBASE_STORAGE_EMULATOR_HOST=127.0.0.1:9199` for tests. `firebase.json` controls Functions runtime, Hosting `dist/`, rewrites, security headers, and emulator ports. `eslint.config.js`, `.prettierrc`, and `pnpm-workspace.yaml` are the style and package-policy configuration.

.github/copilot-instructions.md:49

  • This pipeline description omits the new type-check step and gives a different order from the workflow below, which runs lint, type check, then tests. Keep the agent guide aligned with the executable workflow.
`.github/workflows/pull_request.yml` is the required PR pipeline: pnpm 11, Node from `package.json`, frozen install, Java 21, `pnpm test:ci`, then `pnpm lint`. Preview deployment occurs only after those pass and only for eligible non-`dev` PR authors; it builds with `pnpm build --mode dev` and protected Firebase credentials. Do not depend on previews to validate a change.
  • Files reviewed: 146/157 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/copilot-instructions.md
Comment thread CHANGELOG.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread src/components/formElements/Select.tsx
@stdavis
stdavis merged commit 05a2804 into main Sep 10, 2026
8 checks passed
@stdavis
stdavis deleted the dev branch September 10, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants