Skip to content

Commit 49c5ad2

Browse files
Merge pull request #1396 from opentripplanner/build-with-vite
Build with Vite
2 parents 5000cda + 7f04d57 commit 49c5ad2

33 files changed

+1534
-1198
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
"@babel/preset-react"
1111
],
1212
"env": {
13-
"development": {
14-
"plugins": ["react-refresh/babel"]
15-
},
1613
"test": {
1714
"presets": [["@babel/preset-env", { "targets": { "node": "current" } }]]
1815
}

.github/workflows/node-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
with:
1616
# This allows us to work with the repository during the lint step
1717
fetch-depth: 2
18-
- name: Use Node.js 21.x
18+
- name: Use Node.js 22.x
1919
uses: actions/setup-node@v1
2020
with:
21-
node-version: 21.x
21+
node-version: 22.x
2222
- name: Install npm packages using cache
2323
uses: bahmutov/npm-install@v1
2424
- name: Lint code

.github/workflows/percy.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ jobs:
1515
with:
1616
# This allows us to work with the repository during the lint step
1717
fetch-depth: 2
18-
- name: Use Node.js 21.x
18+
- name: Use Node.js 22.x
1919
uses: actions/setup-node@v1
2020
with:
21-
node-version: 21.x
21+
node-version: 22.x
2222
- name: Install npm packages using cache
2323
uses: bahmutov/npm-install@v1
2424
- name: Build OTP-RR
2525
# Artifacts are shared between desktop and mobile tests (but not call-taker).
2626
run: yarn build
2727
env:
28-
YAML_CONFIG: ../percy/har-mock-config.yml
28+
YAML_CONFIG: ./percy/har-mock-config.yml
2929
JS_CONFIG: ./percy/har-mock-config.js
3030
- name: Take Percy Snapshots (Desktop + Mobile)
3131
run: npx percy exec -- npx jest percy/percy.test.js --force-exit
@@ -39,21 +39,22 @@ jobs:
3939
with:
4040
# This allows us to work with the repository during the lint step
4141
fetch-depth: 2
42-
- name: Use Node.js 21.x
42+
- name: Use Node.js 22.x
4343
uses: actions/setup-node@v1
4444
with:
45-
node-version: 21.x
45+
node-version: 22.x
4646
- name: Install npm packages using cache
4747
uses: bahmutov/npm-install@v1
4848
- name: Download OTP2 config file
49-
run: curl $PERCY_OTP2_CONFIG_URL --output /tmp/otp2config.yml
49+
# Download into repo root, not /tmp (/tmp gets wiped at the beginning of the build process)
50+
run: curl $PERCY_OTP2_CONFIG_URL --output ./otp2config.yml
5051
env:
5152
PERCY_OTP2_CONFIG_URL: ${{ secrets.PERCY_MOCK_OTP2_GEOCODER_CALLTAKER_CONFIG }}
5253
- name: Build OTP-RR Calltaker
5354
# Calltaker has a separate config file, so another build should be produced.
5455
run: yarn build
5556
env:
56-
YAML_CONFIG: /tmp/otp2config.yml
57+
YAML_CONFIG: ./otp2config.yml
5758
JS_CONFIG: ./percy/har-mock-config-call-taker.js
5859
- name: Take Percy Snapshots (Calltaker)
5960
run: npx percy exec -- npx jest percy/percy.test.js --force-exit

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ dist
2121
!test-config.yml
2222
!har-mock-config.yml
2323

24+
# Ignore index.html at the root (it gets copied over during build)
25+
index.html
26+
2427
# vscode extensions
2528
.vscode

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
21
1+
22
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export async function loadLocaleData(matchedLocale, customMessages) {
2+
return {}
3+
}

a11y/a11y.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import routes from '../lib/util/webapp-routes'
1010

1111
import { mockServer } from './mock-server'
1212

13-
const OTP_RR_TEST_CONFIG_PATH = '../a11y/test-config.yml'
13+
// Path relative to OTP-RR repo root.
14+
const OTP_RR_TEST_CONFIG_PATH = './a11y/test-config.yml'
1415

1516
const MOCK_SERVER_PORT = 9999
1617

craco.config.js

Lines changed: 0 additions & 228 deletions
This file was deleted.

lib/config.js renamed to example/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
BatchRoutingPanel,
1616
BatchSearchScreen,
1717
MetroItinerary
18-
} from './index'
18+
} from '../lib/index'
1919

2020
const ItineraryBody = MetroItinerary
2121
const LegIcon = ClassicLegIcon
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)