Skip to content

Commit

Permalink
Merge branch 'tt/vite' into tt/reduce-github-actions-build-time
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadain committed Oct 17, 2022
2 parents 9b4a422 + 4860c5c commit 256ba52
Show file tree
Hide file tree
Showing 58 changed files with 2,388 additions and 9,498 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ vendor.bundle.js
bundle.js.map
dist/
yarn-error.log
src/app/public/data
src/app/data

# Bundled JS
src/app/build
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ services:
stdin_open: true
working_dir: /usr/local/src
environment:
- REACT_APP_GIT_COMMIT=${REACT_APP_GIT_COMMIT:-latest}
- VITE_GIT_COMMIT=${VITE_GIT_COMMIT:-latest}
- CHOKIDAR_USEPOLLING=true
- CHOKIDAR_INTERVAL=100
- PORT=4545
- NODE_OPTIONS=--openssl-legacy-provider
volumes:
- ./src/app:/usr/local/src
- ./src/django/static:/usr/local/src/build
- ./src/django/static:/usr/local/src/dist
# Ensure node_modules cache doesn't clash with other jobs on CI.
- node-modules-volume:/usr/local/src/node_modules
command: yarn start
Expand Down
19 changes: 0 additions & 19 deletions src/app/craco.config.js

This file was deleted.

File renamed without changes.
File renamed without changes.
16 changes: 4 additions & 12 deletions src/app/public/index.html → src/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,25 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="iow-boundary-tool"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="apple-touch-icon" href="/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<link rel="manifest" href="/manifest.json" />
<title>Boundary Sync</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes.
15 changes: 7 additions & 8 deletions src/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@
"react-redux": "^8.0.2",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"react-scripts": "^5.0.1",
"react-use": "^17.3.2",
"redux": "^4.2.0",
"redux-logger": "^3.0.6"
},
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test"
"start": "vite",
"build": "vite build",
"test": "vite test"
},
"eslintConfig": {
"extends": "react-app"
Expand All @@ -59,10 +58,10 @@
]
},
"devDependencies": {
"@babel/core": "^7.17.12",
"@craco/craco": "^6.4.3",
"babel-jest": "28.1.0",
"@vitejs/plugin-react": "^2.0.1",
"eslint": "^8.25.0",
"eslint-config-react-app": "^7.0.1",
"prettier": "^2.6.2",
"prettier-loader": "^3.3.0"
"vite": "^3.0.7"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ import {
} from '@heroicons/react/outline';
import { CursorClickIcon } from '@heroicons/react/solid';

import AddPolygonIcon from '../../img/AddPolygonIcon.js';
import DeletePolygonConfirmModal from './DeletePolygonConfirmModal.js';
import { useDialogController } from '../../hooks.js';
import EditPolygonModal from './EditPolygonModal.js';
import AddPolygonIcon from '../../img/AddPolygonIcon';
import DeletePolygonConfirmModal from './DeletePolygonConfirmModal';
import { useDialogController } from '../../hooks';
import EditPolygonModal from './EditPolygonModal';
import {
cancelAddPolygon,
startAddPolygon,
toggleEditMode,
togglePolygonVisibility,
} from '../../store/mapSlice.js';
} from '../../store/mapSlice';

const POLYGON_BUTTON_WIDTH = 40;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function MunicipalBoundariesLayer() {
});

useEffect(() => {
fetch(`${process.env.PUBLIC_URL}/data/muni.geo.json`)
fetch(new URL('../../../data/muni.geo.json', import.meta.url).href)
.then(response => response.json())
.then(setLayerData);
}, []);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions src/app/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
server: {
port: process.env.PORT,
host: true,
},
});
Loading

0 comments on commit 256ba52

Please sign in to comment.