Repository navigation
Tech Debt and Fixes #567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Tech Debt and Fixes #567
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
8800cc6
chore: implement UGRC PNPM standards
stdavis d32d1f3
chore: node v22 -> v24
stdavis 76baa97
chore: remove husky precommit hook
stdavis f2adcc6
dev(deps): bump storybook
stdavis 1ee9c97
deps: bump NPM dependencies 🌲
stdavis 8a9e2d1
fix: repoint to AGOL geometry service and better error logging
stdavis 115077e
chore: onboard copilot
stdavis 59c2cec
deps: @arcgis/core v4 -> v5
stdavis 68ddcda
deps: bump utah design system
stdavis 1d28b1d
chore: JavaScript -> TypeScript
stdavis c8407e2
ci: add type check to pr checks and remove unneeded pnpm run
stdavis 5dabc9f
chore: prettier format
stdavis 25be33f
chore: add references to shared package
stdavis d129d59
chore: release v3.6.17-rc.1
ugrc-release-bot[bot] eff0443
chore: format
stdavis b573e84
feat: add better busy indicator to map
stdavis baaa2d3
fix: default MMRC project toggle to yes
stdavis 341da26
fix: remove skip button on "Location Information" screen
stdavis f1e91a1
fix: make menu ribbon more visible and functional on mobile
stdavis 9d82808
fix: better layout for quick finder tools dialog
stdavis 06b726c
fix: more natural sorting of TRS ranges with decimals
stdavis 6e7790a
chore: release v3.6.17-rc.2
ugrc-release-bot[bot] a13005e
fix: test artifact registry policy
stdavis 2e8d29c
chore: release v3.6.17-rc.3
ugrc-release-bot[bot] 0f3f788
Revert "fix: test artifact registry policy"
stdavis 80f8d79
fix: allow tasks.arcgisonline.com in content security policy
stdavis cb81e68
chore: release v3.6.17-rc.4
ugrc-release-bot[bot] 8cb3972
fix: prevent form from going back to step 1 after a successful submis…
stdavis 4576ab4
chore: tell copilot about pnpm check
stdavis d4bb10d
chore: fix type issue
stdavis f14fe19
chore: release v3.6.17-rc.5
ugrc-release-bot[bot] e6a75cb
fix(functions): create the monument firestore prop for new sheets
stdavis 0658c32
chore: release v3.6.17-rc.6
ugrc-release-bot[bot] 9d7789f
chore: one-time script to fix missing submission artifacts
stdavis 60af4f9
fix(functions): better error handling for submissions
stdavis 46a7ae4
chore: release v3.6.17-rc.8
ugrc-release-bot[bot] a36ea41
chore: fix typo in changelog
stdavis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # PLSS Cloud-Agent Guide | ||
|
|
||
| ## Project at a glance | ||
|
|
||
| This is the Utah GIS Public Lands Survey System (PLSS) application: a React map for viewing PLSS monuments and submitting monument records. It is a pnpm workspace with two Node 24 packages: | ||
|
|
||
| - The root package is a React 19, Vite 8, Tailwind 4, ArcGIS JavaScript SDK web app. It deploys as Firebase Hosting. | ||
| - `functions/` contains ESM Firebase Functions v2 (HTTP callables plus Auth, Firestore, and Storage triggers). Firebase Hosting and Functions both target Node 24 (`firebase.json`, `package.json`, and `functions/package.json`). | ||
|
|
||
| The repository is small application source plus a large generated/installed ArcGIS asset surface. Do not inspect or edit `public/assets/`, `dist/`, coverage output, `node_modules/`, or `.emulator-data/`; they are generated or local data. Trust this guide and search only when it is incomplete or demonstrably wrong. | ||
|
|
||
| ## Bootstrap and commands | ||
|
|
||
| Always use pnpm 11 and Node 24. CI installs Java 21 for Firebase emulators; a Java 21-or-newer runtime is required locally for storage-rules tests. From the repository root, run: | ||
|
|
||
| ```sh | ||
| pnpm install --frozen-lockfile | ||
| ``` | ||
|
|
||
| This is the CI bootstrap and succeeds with the committed lockfile. `pnpm-workspace.yaml` has strict package-age and approved-build policies; do not use another package manager or rewrite the lockfile unless the task changes dependencies. | ||
|
|
||
| Run validation in this order after relevant changes: | ||
|
|
||
| ```sh | ||
| CI=1 pnpm test:ci | ||
| pnpm lint | ||
| pnpm check | ||
| pnpm build | ||
| ``` | ||
|
|
||
| - `test:ci` starts a temporary Firebase Storage emulator on port 9199 and runs all Vitest suites, including Functions, shared schemas, state machines, UI utilities, and `storage.rules.test.mjs`. It passed locally with 9 files / 323 tests in about 17 seconds after emulator startup. `CI=1` is essential locally because `pnpm test` includes `--ui --open`; without CI it opens the Vitest UI and remains interactive. Firebase may report a nonfatal Java `Unsafe` deprecation warning or use logging port 4501 if 4500 is occupied. | ||
| - `lint` is the PR gate: root ESLint uses `@ugrc/eslint-config` and fails on any warning. The Functions package has a legacy local lint script, but root `pnpm lint` covers repository CI. | ||
| - `build` runs Vite and writes the deployable Firebase Hosting bundle to `dist/`, including copied ArcGIS assets. The production build passed locally. A generated-CSS pseudo-class warning can appear and is currently nonfatal. | ||
| - `pnpm format` modifies files. Run `pnpm exec prettier --write <modified-files>` as appropriate for changed files that Prettier supports. Use `pnpm exec prettier --check <changed-files>` when a formatting-only validation is needed; Prettier organizes imports and Tailwind classes. | ||
|
|
||
| For interactive development, first authenticate with Firebase, copy `.env` to `.env.local`, and copy `functions/.secret` to `functions/.secret.local`; populate the existing placeholders with authorized development values. Never commit either local file or secrets. Then run `pnpm start` and use `http://localhost:5173/`. It starts Vite and Auth/Functions/Firestore/Storage emulators; it waits for the Firebase emulator UI at port 4000. It is a long-running command, not a PR validation. `pnpm dev:firebase-state` imports and exports `.emulator-data`; use it only when persistent emulator data is wanted. Deploy commands require repository/cloud credentials and should not be run by a cloud agent. | ||
|
|
||
| ## Architecture and change locations | ||
|
|
||
| - `src/main.jsx` configures Firebase and React Query providers, then renders `src/components/app/App.jsx`. Firebase configuration is parsed from `VITE_FIREBASE_CONFIG`; other browser-visible variables must use the `VITE_` prefix. | ||
| - `src/components/pageElements/` contains map-oriented screens and the corner-submission wizard; `formElements/` contains reusable inputs; `layoutElements/` has navigation/drawer; `machines/` contains XState logic; `reducers/AppReducer.js` owns app-level UI/map state. Add or update nearby `*.test.js` / `*.stories.jsx` using existing patterns. | ||
| - `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. | ||
|
|
||
| ## CI and delivery | ||
|
|
||
| `.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. | ||
|
|
||
| Pushes to `main` and `dev` use the release automation. Published prereleases deploy to staging and releases deploy to production through protected credentials; both build with `pnpm build`. Repository root also contains `README.md` (local setup and domain context), `firebase.json`, rules/index configuration, `vite.config.js`, `eslint.config.js`, `pnpm-lock.yaml`, `CHANGELOG.md`, and `AI_ATTESTATION.md`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,4 @@ | |
| /dist | ||
| /public/assets | ||
| CHANGELOG.md | ||
| pnpm-lock.yaml | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.