-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config: Migrate from CRA to Vite (wait for release 1.9.0 to merge) (#688
) * config: Add Vite configuration and update environment variables * chore: Update meta tags and link references in index.html * config: Update import paths for Timer module * fix: Update favicon link in index.html and fix path in tsconfig.json * config: Use Vite as core builder for Storybook * refactor: Migrate to vitest * fix: Add eslint-plugin-chai-friendly and update package.json * fix(test): Fix fn() call in Consent test * fix(test): Convert most tests to be vitest/chai based testing * fix(tests): Fix FloatingActionButton tests * config(env): Migrate frontend environment variables from REACT_APP_ prefix to VITE_ * config: Update frontend ci test command * fix(lint): Add correct imports and remove unused imports * fix(cov): Fix frontend coverage generation * fix(story): Fix storybook component imports after vite migration * config: Fix test commands after vite migration * fix(test): Fix frontend tests by binding vitest configuration to container * revert: onTick call * fix: Fix timer imports * chore: Resolve yarn after rebase onto develop * config: Configure frontend to be a module, according to [Vite's recommendation](https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated) * fix: Add bind mount for index.html file * fix: Expose vite dev server to the outside * chore: Migrate index.tsx to use import.meta.env * chore: Remove typescript step from build * fix: Change build directory from dist/ to build/ * refactor: Update frontend tsconfig.json and add tsconfig.node.json * feat: Add build-front script * fix: Migrate tests to vitest * fix: Update storybook deps & config to support react vite with jsx * fix: Fix frontend linting * feat: Add linting script for front-end code * config: Start using FRONTEND_ instead of REACT_APP_ / VITE_ * fix: Fix tests & imports after rebase onto develop * refactor/fix: Remove unused dependencies and update test assertions after rebase onto develop * fix(lint): Add vi import for vitest
- Loading branch information
1 parent
1a04fc9
commit 2c303a0
Showing
62 changed files
with
3,056 additions
and
9,042 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,40 @@ | ||
import type { StorybookConfig } from '@storybook/react-vite'; | ||
import { mergeConfig } from 'vite'; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-onboarding", | ||
"@storybook/addon-interactions", | ||
], | ||
core: { | ||
builder: '@storybook/builder-vite', | ||
}, | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
viteFinal: (config) => { | ||
return mergeConfig(config, { | ||
esbuild: { | ||
loader: 'jsx', | ||
}, | ||
resolve: { | ||
alias: { | ||
'@/': '/src/', | ||
}, | ||
}, | ||
}); | ||
}, | ||
framework: { | ||
name: "@storybook/react-vite", | ||
options: { }, | ||
}, | ||
staticDirs: ["../public"], | ||
env: { | ||
VITE_API_ROOT: "http://localhost:8000", | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains 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 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,40 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%VITE_HTML_FAVICON%" /> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" | ||
/> | ||
<meta name="mobile-web-app-capable" content="yes" /> | ||
<meta name="theme-color" content="#212529" /> | ||
<meta name="description" content="%VITE_HTML_OG_DESCRIPTION%" /> | ||
<meta property="og:title" content="%VITE_HTML_OG_TITLE%" /> | ||
<meta property="og:image" content="%VITE_HTML_OG_IMAGE%" /> | ||
<meta property="og:image:url" content="%VITE_HTML_OG_IMAGE%" /> | ||
<meta property="og:image:height" content="628" /> | ||
<meta property="og:image:width" content="1200"/> | ||
<meta property="og:image:type" content="image/png"/> | ||
<meta property="twitter:image" content="%VITE_HTML_OG_IMAGE%" /> | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
<meta | ||
property="og:description" | ||
content="%VITE_HTML_OG_DESCRIPTION%" | ||
/> | ||
<meta property="og:url" content="%VITE_HTML_OG_URL%" /> | ||
|
||
<link rel="apple-touch-icon" href="/logo192.png" /> | ||
<link rel="manifest" href="/manifest.json" /> | ||
<link | ||
rel="stylesheet" | ||
href="/vendor/bootstrap/bootstrap.min.css" | ||
/> | ||
<title>%VITE_HTML_PAGE_TITLE%</title> | ||
</head> | ||
<body class="root %VITE_HTML_BODY_CLASS%"> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
<script type="module" src="/src/index.tsx"></script> | ||
</body> | ||
</html> |
This file contains 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.