-
-
Notifications
You must be signed in to change notification settings - Fork 43
Modernize frontend code #885
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
Merged
Changes from 45 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
48d31ad
Switch from Yarn to npm
jake-low b96f262
Make .tool-versions use Node 22 (matches production Dockerfile)
jake-low d7e6da3
Switch from Flow to TypeScript
jake-low 374b9dc
Switch from react-scripts to Vite
jake-low c863136
Remove enzyme
jake-low 4bcd4f0
Switch from Jest to Vitest
jake-low d96cab6
Fix broken tests
jake-low 74db0fa
Remove unused and unnecessary dependencies
jake-low ec66a1d
Add type: module to package.json
jake-low c5afa2a
Switch from ESLint to Biome
jake-low 0a003b5
Fix Biome lint errors
jake-low d3fc194
Upgrade to React 18
jake-low fb14bd2
Migrate from redux + immutable.js to tanstack query + zustand
jake-low 793d76d
Remove dead code
jake-low bc2cb24
Simplify vite code splitting config
jake-low 3adf8fd
Remove lint-staged
jake-low 841c48a
Support runtime configuration
jake-low b160e44
Fix some type errors and formatting
jake-low 902d63e
Remove dead toastr.min.css file
jake-low ba6756c
Organize package.json
jake-low 38ee9a1
Tweak Biome config
jake-low 3176e20
Replace react-anchorify-text (unmaintained) with linkify-react
jake-low 496b874
Make TypeScript annotations more idiomatic
jake-low 458d953
Replace showdown with react-markdown; convert /about page to redirect
jake-low 5ca7d17
Dismiss element info panel when switching changesets
jake-low 54ad450
Refactor network layer to simplify auth and error handling
jake-low 3461035
Remove unused (blank) stats page
jake-low dace4f1
Unify AppDesktop and AppMobile components
jake-low 6e26f61
Port remaining JS files to TypeScript
jake-low 5241736
Clean up utils
jake-low 4896767
Upgrade to react-router v7
jake-low ab6c937
Refactor dropdown component; remove react-click-outside dependency
jake-low 1d863bf
Upgrade diff to v8
jake-low a85dd23
Re-enable some linter checks (and fix existing violations)
jake-low 7ee4449
Rename configuration env vars to all start with OSMCHA_
jake-low 6bca629
Move toast position to top-left
jake-low 8523475
Remove some unused CSS classes left over from changeset-map
jake-low dc41715
Remove dead code from app.tsx
jake-low 691016e
Remove unused props from changeset/box.tsx
jake-low 73a02e0
Improve type annotations for some components
jake-low 2197ba6
Use file extensions in import paths
jake-low e475a04
Update README
jake-low c5f9374
Add GitHub Actions CI workflow (checks tsc, linting, test suite on PRs)
jake-low 3616ebc
Remove legacy OAuth 1.0 code and safe_storage.ts (IE <8 compatibility)
jake-low 9bae540
Fix navigation bug affecting 'My Reviews' link in nav menu
jake-low 5858412
Fix tests failing in CI due to dependency on system timezone
jake-low bf052d4
Restrict GH token permissions for CI workflow
jake-low fa32975
Prevent trying to fetch changeset list when not logged in
jake-low 2328ae0
Update README now that OAuth login works on localhost
jake-low File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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,18 @@ | ||
| # These values can be overridden at build time using an .env.local file, or at | ||
| # run time when using Docker, by setting environment variables on the container. | ||
|
|
||
| # API URL for OSMCha backend | ||
| OSMCHA_API_URL=https://osmcha.org/api/v1 | ||
|
|
||
| OSMCHA_OSM_URL=https://www.openstreetmap.org | ||
| OSMCHA_OSM_API=https://api.openstreetmap.org/api/0.6 | ||
|
|
||
| OSMCHA_ADIFF_SERVICE_URL=https://adiffs.osmcha.org | ||
| OSMCHA_OVERPASS_BASE=https://overpass-api.de/api/interpreter | ||
| OSMCHA_NOMINATIM_URL=https://nominatim.openstreetmap.org/search.php | ||
|
|
||
| OSMCHA_PAGE_SIZE=25 | ||
|
|
||
| # default filter "from" (in days) and "to" (in minutes) | ||
| OSMCHA_DEFAULT_FROM_DATE=2 | ||
| OSMCHA_DEFAULT_TO_DATE=5 |
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 |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| checks: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: npm clean-install | ||
|
|
||
| - run: npm run typecheck | ||
|
|
||
| - run: npx biome format . | ||
|
|
||
| - run: npm run lint | ||
|
|
||
| - run: npm test | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| nodejs 18 | ||
| yarn 1.22 | ||
| nodejs 22 |
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 |
|---|---|---|
| @@ -1,24 +1,20 @@ | ||
| FROM node:22-alpine as builder | ||
|
|
||
| ENV DEBIAN_FRONTEND noninteractive | ||
|
|
||
| ARG BUILD_ENV=prod | ||
|
|
||
| WORKDIR /app | ||
| COPY package.json yarn.lock /app/ | ||
| RUN yarn set version stable | ||
| RUN yarn install | ||
|
|
||
| COPY src/ /app/src | ||
| COPY public/ /app/public | ||
| ENV REACT_APP_PRODUCTION_API_URL /api/v1 | ||
| RUN apk update && apk add curl git jq | ||
|
|
||
| # fix for openssl ERR_OSSL_EVP_UNSUPPORTED | ||
| # 'error:03000086:digital envelope routines::initialization error' | ||
| ENV NODE_OPTIONS --openssl-legacy-provider | ||
| COPY package.json package-lock.json . | ||
| RUN npm clean-install | ||
|
|
||
| RUN yarn run build:${BUILD_ENV} | ||
| COPY . . | ||
| RUN npm run build | ||
|
|
||
| FROM nginx:alpine | ||
|
|
||
| RUN apk update && apk add jq | ||
|
|
||
| COPY --from=builder /app/build /srv/www | ||
| COPY nginx.conf /etc/nginx/templates/default.conf.template | ||
| COPY docker/nginx.conf /etc/nginx/templates/default.conf.template | ||
| COPY docker/90-write-env-to-json.sh /docker-entrypoint.d | ||
|
|
||
| EXPOSE 80 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| { | ||
| "$schema": "https://biomejs.dev/schemas/2.3.11/schema.json", | ||
| "vcs": { | ||
| "enabled": true, | ||
| "clientKind": "git", | ||
| "useIgnoreFile": true | ||
| }, | ||
| "files": { | ||
| "includes": ["**", "!build", "!public", "!**/*.css"] | ||
| }, | ||
| "formatter": { | ||
| "enabled": true, | ||
| "indentStyle": "space", | ||
| "indentWidth": 2, | ||
| "lineWidth": 80 | ||
| }, | ||
| "linter": { | ||
| "enabled": true, | ||
| "rules": { | ||
| "recommended": true, | ||
| "suspicious": { | ||
| "noExplicitAny": "off", | ||
| "noArrayIndexKey": "off" | ||
| }, | ||
| "correctness": { | ||
| "noUnusedVariables": "error", | ||
| "noUnusedFunctionParameters": "off" | ||
| }, | ||
| "style": { | ||
| "useTemplate": "off", | ||
| "noNonNullAssertion": "off" | ||
| }, | ||
| "a11y": { | ||
| "useButtonType": "off", | ||
| "noSvgWithoutTitle": "off", | ||
| "noStaticElementInteractions": "off", | ||
| "useKeyWithClickEvents": "off", | ||
| "useSemanticElements": "off", | ||
| "noLabelWithoutControl": "off" | ||
| } | ||
| } | ||
| } | ||
| } |
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,7 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Convert env to json and write out to overrides file | ||
| jq -n 'env | with_entries(select(.key | startswith("OSMCHA_")))' > /tmp/env.overrides.json | ||
| # Merge overrides and defaults together | ||
| cp /srv/www/env.json /tmp/env.default.json | ||
| jq -s '.[0] * .[1]' /tmp/env.default.json /tmp/env.overrides.json > /srv/www/env.json |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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.