Skip to content

Commit

Permalink
First attempt at deploying with vite
Browse files Browse the repository at this point in the history
  • Loading branch information
entrotech committed Oct 23, 2024
1 parent cf527ed commit 5bcbd4c
Show file tree
Hide file tree
Showing 37 changed files with 7,313 additions and 14,493 deletions.
4 changes: 2 additions & 2 deletions client/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REACT_APP_TENANT_ID=1
REACT_APP_MAPBOX_ACCESS_TOKEN=pk.eyJ1IjoibHVjYXNob21lciIsImEiOiJjazFqcnRjcm0wNmZ1M2JwZXg2eDFzMXd3In0.yYpkKLrFCxF-qyBfZH1a8w
VITE_TENANT_ID=1
VITE_MAPBOX_ACCESS_TOKEN=pk.eyJ1IjoibHVjYXNob21lciIsImEiOiJjazFqcnRjcm0wNmZ1M2JwZXg2eDFzMXd3In0.yYpkKLrFCxF-qyBfZH1a8w
SKIP_PREFLIGHT_CHECK=true
1 change: 1 addition & 0 deletions client/__mocks__/fileMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = "test-file-stub";
1 change: 1 addition & 0 deletions client/__mocks__/styleMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
15 changes: 15 additions & 0 deletions client/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"presets": [
["@babel/preset-env", { "targets": { "node": "current" } }],

"@babel/preset-react",

[
"babel-preset-vite",
{
"env": true,
"glob": false
}
]
]
}
7 changes: 0 additions & 7 deletions client/craco.config.js

This file was deleted.

18 changes: 5 additions & 13 deletions client/public/index.html → client/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html lang="en" height="100%">
<head>
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name="viewport" content="minimum-scale=1, initial-scale=1" />
<!-- <meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/> -->
<meta name="theme-color" content="#000000" />
<meta property="og:image" content="%PUBLIC_URL%/FoodOasisLogo.png" />
<meta property="og:image" content="/FoodOasisLogo.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="639" />
<meta property="og:image:height" content="162" />
Expand All @@ -17,7 +17,7 @@
content="Food Oasis is a non-profit, volunteer-run directory of free food resources in the Los Angeles area."
/>
<meta property="og:locale" content="en_US" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="apple-touch-icon" href="/favicon.ico" />
<link
href="https://api.tiles.mapbox.com/mapbox-gl-js/v1.4.0/mapbox-gl.css"
rel="stylesheet"
Expand All @@ -27,16 +27,7 @@
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" />
<style>
html,
#body,
Expand Down Expand Up @@ -107,5 +98,6 @@
<div class="spinner"></div>
</div>
</div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
15 changes: 15 additions & 0 deletions client/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { pathsToModuleNameMapper } = require("ts-jest");
const { compilerOptions } = require("./tsconfig");

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
roots: ["<rootDir>"],
preset: "ts-jest",
testEnvironment: "jsdom",
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths ?? {}),
transform: {
".+\\.(css|less|sass|scss|png|jpg|gif|ttf|woff|woff2|svg)$":
"jest-transform-stub",
},
};
Loading

0 comments on commit 5bcbd4c

Please sign in to comment.