Skip to content
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

chore: Migrate maas-ui from CRA to Vite #5207

Merged
merged 94 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from 92 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
12c0d03
chore!: Migrate maas-ui from CRA to Vite
ndv99 Nov 10, 2023
666581b
remove option from test script
ndv99 Nov 10, 2023
4d8b8e6
fix package linting
ndv99 Nov 10, 2023
e965b91
add eslint
ndv99 Nov 10, 2023
02c07ac
fix package lint again
ndv99 Nov 10, 2023
d666cab
fix linting but I ACTUALLY DID IT THIS TIME LET'S GOOOOOOOO
ndv99 Nov 10, 2023
8cfdba8
use node v18 in ci
ndv99 Nov 10, 2023
dfdd466
fix types... time is a flat circle
ndv99 Nov 10, 2023
b52031c
replace button with Button in node hooks test
ndv99 Nov 10, 2023
b658ff5
target esnext instead of es6
ndv99 Nov 10, 2023
fcf5282
drop jest and install vitest
ndv99 Nov 13, 2023
20be5f7
package lint
ndv99 Nov 13, 2023
3465061
fix ci test script
ndv99 Nov 13, 2023
7b93f81
actually use vi methods instead of jest methods
ndv99 Nov 13, 2023
a67ec09
include vitest globals and exclude playwright tests from unit test ru…
ndv99 Nov 14, 2023
1f4929b
Remove unneeded vi imports
ndv99 Nov 14, 2023
19799bb
Fix imports from testing folder and fix types
ndv99 Nov 14, 2023
f8b4c36
fix intro tests
ndv99 Nov 14, 2023
2b5fe7b
fix callid mock
ndv99 Nov 14, 2023
7cb878b
fix dashboard tests
ndv99 Nov 14, 2023
99298b1
fix detailscard test
ndv99 Nov 14, 2023
ee99a3f
fix side navigation test
ndv99 Nov 14, 2023
f2b8230
fix js-file-download mocking
ndv99 Nov 14, 2023
f3aafca
fix formikformcontent navigation mocking
ndv99 Nov 14, 2023
f133665
fix debouncesearchbox mock timers
ndv99 Nov 14, 2023
43414ab
Fix waitFors in base components tests
ndv99 Nov 14, 2023
aaca237
Fix MachineLink loading state test
ndv99 Nov 14, 2023
7ffceeb
Fix controller tests
ndv99 Nov 14, 2023
5fd445b
fix archselect tooltip test
ndv99 Nov 14, 2023
3dcde54
fix tag form fields callid mocking
ndv99 Nov 15, 2023
534b491
fix mocking in add tag form
ndv99 Nov 15, 2023
ce2c9e1
fix mocking in clone form fields
ndv99 Nov 15, 2023
5276e7a
actually fix callid mocking everywhere and deprecate enableCallIdMocks
ndv99 Nov 15, 2023
6f9bb5d
revert fix for "act" warnings because types
ndv99 Nov 15, 2023
a4ad433
fix remaining base tests
ndv99 Nov 15, 2023
cc8b542
fix flakey tooltip hover test in controllerstatus
ndv99 Nov 15, 2023
f287f50
fix settings tests
ndv99 Nov 15, 2023
1a8ef34
fix subnets tests
ndv99 Nov 15, 2023
854c2b2
fix bad mocking in app test
ndv99 Nov 15, 2023
5d851eb
update root reducer test snapshot
ndv99 Nov 15, 2023
71ce980
add some waitfors around tooltip tests
ndv99 Nov 15, 2023
62d833a
align vite(st) config with site manager
ndv99 Nov 15, 2023
b20a3f3
run test + lint on node v20
ndv99 Nov 15, 2023
bd282fa
add some more waitfors on some more tooltip tests
ndv99 Nov 15, 2023
4d5efc6
fix react act environment warnings
ndv99 Nov 15, 2023
d5a90e9
fixing flakey flakey tooltips
ndv99 Nov 15, 2023
9f596aa
fix these flakey tooltip tests hopefully once and for all
ndv99 Nov 16, 2023
4fa9708
remove a `screen.debug` that I forgot about
ndv99 Nov 16, 2023
3a99e6d
fix controller test - incorrect text content expectation
ndv99 Nov 16, 2023
8edaf65
Merge branch 'main' into migrate-to-vite
ndv99 Nov 16, 2023
807d486
workaround vite issue with Accept header
ndv99 Nov 16, 2023
05aff38
Change build output directory to "build"
ndv99 Nov 16, 2023
945027c
Modify deps based on #5209
ndv99 Nov 16, 2023
60f2206
Merge branch 'main' into migrate-to-vite
ndv99 Nov 20, 2023
7e1b9bd
fix lockfile
ndv99 Nov 20, 2023
c547298
fix static font imports
ndv99 Nov 21, 2023
d0b9db1
add another vi.waitfor to another flakey tooltip test
ndv99 Nov 21, 2023
b3e513a
remove explicit "public" from asset path (see desc)
ndv99 Nov 21, 2023
e2fc4cd
remove a commented out console.log that i randomly found
ndv99 Nov 21, 2023
6cfc8cf
more flakey tooltip tests
ndv99 Nov 22, 2023
2d0895a
Merge branch 'main' into migrate-to-vite
ndv99 Dec 4, 2023
07b7bf1
Quick lint fix
ndv99 Dec 4, 2023
c33f520
add relative imports in GroupSelect
ndv99 Dec 4, 2023
e4a4bcf
Merge branch 'main' into migrate-to-vite
ndv99 Dec 4, 2023
8e8cec1
test: fix failing tests
ndv99 Dec 4, 2023
d0dc1fe
Merge remote-tracking branch 'ndv99/migrate-to-vite' into migrate-to-…
ndv99 Dec 4, 2023
05179df
Merge branch 'main' into migrate-to-vite
ndv99 Dec 6, 2023
21d4f1d
fix GroupRow import in SubnetsTable components
ndv99 Dec 6, 2023
c5a7747
fix DoubleRow import in GroupRow
ndv99 Dec 6, 2023
a68e2a3
Merge branch 'main' into migrate-to-vite
ndv99 Dec 12, 2023
75975cd
upgrade vite to v5.0.7
ndv99 Dec 12, 2023
cf3dc74
upgrade vite to v5.0.8
ndv99 Dec 13, 2023
afeaced
move fonts back to /assets/fonts
ndv99 Dec 13, 2023
7bc000e
use esm instead of cjs
ndv99 Dec 13, 2023
87a410e
use cjs for eslintrc
ndv99 Dec 13, 2023
b0cb261
configure build options (see desc)
ndv99 Dec 13, 2023
9bbb9fd
Merge remote-tracking branch 'canonical/main' into migrate-to-vite
ndv99 Dec 13, 2023
566b53a
test: react type errors
petermakowski Dec 13, 2023
35c1777
Merge branch 'main' into migrate-to-vite
ndv99 Dec 15, 2023
d987198
ci: replace dotrun check with build test
ndv99 Dec 15, 2023
318819a
Add install step to build
ndv99 Dec 15, 2023
b27a149
use serve instead of serve-static-demo
ndv99 Dec 15, 2023
1899efc
set correct port for build
ndv99 Dec 15, 2023
bcc530f
set base to "/" in ci build
ndv99 Dec 15, 2023
26e515a
serve and wait concurrently
ndv99 Dec 15, 2023
e6fbfd9
add "--host" to build serve
ndv99 Jan 10, 2024
78fcb65
Merge remote-tracking branch 'canonical/main' into migrate-to-vite
ndv99 Jan 12, 2024
02c66fd
separate serve and wait commands in build ci
ndv99 Jan 12, 2024
ad6adc3
replace jest with vi in tags header test
ndv99 Jan 12, 2024
4d49d76
refactor proxy scripts to use import instead of require
ndv99 Jan 15, 2024
3aa43d5
fix address import in proxy-ready
ndv99 Jan 15, 2024
22f882b
remove accept header 404 workaround
ndv99 Jan 15, 2024
b6a0b22
roll back react-redux to 8.0.5
ndv99 Jan 15, 2024
104aa23
set base to / for config, and /MAAS/r for build
ndv99 Jan 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ MAAS_URL = "http://bolla.internal:5240/"
MAAS_WEBSOCKET_HOST=
MAAS_WEBSOCKET_PORT=
BASENAME="/MAAS"
REACT_BASENAME="/r"
REACT_APP_BASENAME=${BASENAME}
REACT_APP_REACT_BASENAME=${REACT_BASENAME}
REACT_APP_WEBSOCKET_DEBUG=false
REACT_APP_USABILLA_ID=5735097911c0
VITE_BASENAME="/r"
VITE_APP_BASENAME=${BASENAME}
VITE_APP_VITE_BASENAME=${VITE_BASENAME}
VITE_APP_WEBSOCKET_DEBUG=false
VITE_APP_USABILLA_ID=5735097911c0
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
REACT_APP_CHECK_MIDDLEWARE=true
REACT_APP_WEBSOCKET_DEBUG=true
VITE_APP_CHECK_MIDDLEWARE=true
VITE_APP_WEBSOCKET_DEBUG=true
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PUBLIC_URL="/MAAS/r/"
REACT_APP_SENTRY_DSN="https://901f18f8af164718b5cb34c869e6885d@sentry.is.canonical.com//22"
VITE_APP_SENTRY_DSN="https://901f18f8af164718b5cb34c869e6885d@sentry.is.canonical.com//22"
7 changes: 7 additions & 0 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const path = require("path");

module.exports = {
root: true,
plugins: ["unused-imports", "prettier"],
Expand All @@ -20,6 +22,11 @@ module.exports = {
react: {
version: "detect",
},
"import/resolver": {
typescript: {
alias: { "@": path.resolve(__dirname, "src") },
},
},
},
globals: {
usabilla_live: false,
Expand Down
30 changes: 20 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,28 @@ jobs:
run: CYPRESS_INSTALL_BINARY=0 yarn install
- run: yarn test:ci

run-dotrun:
build:
name: Build
timeout-minutes: 15
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dotrun
uses: canonical/install-dotrun@main
- name: Install dependencies
run: dotrun install
- name: Restore node_modules
id: yarn-cache
uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: CYPRESS_INSTALL_BINARY=0 yarn install
- name: Build assets
run: dotrun --env CI=false build
- name: Run dotrun
run: dotrun &
- name: Wait for MAAS UI to be ready
run: dotrun wait-on-ui
run: yarn build
- name: Serve build
run: yarn serve --host --port=8400 --base=/ &
- name: Wait for UI to be ready
run: yarn wait-on-ui
4 changes: 2 additions & 2 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-22.04
env:
PACKAGE_NAME: maas-ui-${{ github.sha }}.tar.gz
REACT_APP_GIT_SHA: ${{ github.sha }}
VITE_APP_GIT_SHA: ${{ github.sha }}
steps:
- uses: actions/checkout@v4
- name: Get branch name
Expand All @@ -30,7 +30,7 @@ jobs:
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: CYPRESS_INSTALL_BINARY=0 yarn install
- name: Build
run: REACT_APP_GIT_SHA=${{env.REACT_APP_GIT_SHA}} yarn build
run: VITE_APP_GIT_SHA=${{env.VITE_APP_GIT_SHA}} yarn build
env:
CI: false
- name: Compress
Expand Down
1 change: 1 addition & 0 deletions __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 __mocks__/styleMock.js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {}
2 changes: 1 addition & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default defineConfig({
},
env: {
BASENAME: "/MAAS",
REACT_BASENAME: "/r",
VITE_BASENAME: "/r",
nonAdminPassword: "test",
nonAdminUsername: "user",
password: "test",
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export const generateName = (name?: string) =>
`cy-${name ? `${name}-` : ""}${generateId()}`;

export const generateMAASURL = (route?: string): string =>
`${Cypress.env("BASENAME")}${Cypress.env("REACT_BASENAME")}${route || ""}`;
`${Cypress.env("BASENAME")}${Cypress.env("VITE_BASENAME")}${route || ""}`;
4 changes: 2 additions & 2 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Create new branch protection rules for the new version branch, copying the rules

Usabilla button IDs can be found in the Usabilla dashboard.

Update the `REACT_APP_USABILLA_ID` on the new release branch with a Usabilla button ID that matches the new version (e.g. "MAAS 3.4").
Update the `VITE_APP_USABILLA_ID` on the new release branch with a Usabilla button ID that matches the new version (e.g. "MAAS 3.4").

Update the `REACT_APP_USABILLA_ID` on the main branch with a Usabilla button ID that matches the next expected version, e.g. "MAAS 3.5" button id.
Update the `VITE_APP_USABILLA_ID` on the main branch with a Usabilla button ID that matches the next expected version, e.g. "MAAS 3.5" button id.

You may need to create new buttons in Usabilla if they don't yet exist.
3 changes: 2 additions & 1 deletion public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>MAAS</title>
<link rel="shortcut icon" href="%PUBLIC_URL%/maas-favicon-32px.png" />
<link rel="shortcut icon" href="/maas-favicon-32px.png" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down Expand Up @@ -46,5 +46,6 @@
</div>
</header>
</div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
41 changes: 24 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "maas-ui",
"type": "module",
"version": "3.5.0",
"homepage": "/MAAS/r/",
"license": "AGPL-3.0",
Expand All @@ -11,7 +12,7 @@
"scripts": {
"analyze": "npx -y source-map-explorer 'build/static/js/*.js'",
"build-all": "yarn build",
"build": "CYPRESS_INSTALL_BINARY=0 yarn install && react-scripts build",
"build": "CYPRESS_INSTALL_BINARY=0 yarn install && vite build",
"clean-all": "yarn clean",
"clean": "rm -rf node_modules build",
"cleanbuild": "yarn clean-all && yarn build",
Expand All @@ -24,18 +25,18 @@
"percy": "./cypress/percy.sh",
"release": "yarn clean && yarn install && CI=true yarn test && yarn build && yarn version --new-version",
"serve-proxy": "nodemon ./scripts/proxy.js",
"serve-react": "BROWSER=none PORT=8401 react-scripts start",
"serve-react": "vite --host",
"serve-static-demo": "STATIC_DEMO=true PROXY_PORT=80 nodemon ./scripts/proxy.js",
"serve": "yarn start",
"serve": "vite preview",
"show-ready": "wait-on http-get://0.0.0.0:8401 && nodemon ./scripts/proxy-ready.js",
"sitespeed:ci": "docker run -v \"$(pwd)/sitespeed.io:/sitespeed.io\" --network=host sitespeedio/sitespeed.io:25.2.1 --config /sitespeed.io/config.json /sitespeed.io/scripts/machines.js --multi --spa",
"sitespeed": "docker run -v \"$(pwd)/sitespeed.io:/sitespeed.io\" --add-host=host.docker.internal:host-gateway sitespeedio/sitespeed.io:25.2.1 --config /sitespeed.io/config.json /sitespeed.io/scripts/machines.js --multi --spa --browsertime.domain=host.docker.internal --browsertime.port=8400 --browsertime.iterations=1",
"start": "concurrently \"yarn serve-proxy\" \"yarn serve-react\" \"yarn show-ready\"",
"test-cypress": "start-server-and-test start '8401' serve-base 'tcp:8400' cypress-run",
"test-ui": "TZ=UTC react-scripts test --testURL http://example.com/MAAS/r --watchAll=false",
"test:debug": "react-scripts --inspect-brk test --runInBand --no-cache --testTimeout=100000000",
"test-ui": "TZ=UTC vitest",
"test:debug": "vitest --inspect-brk test --runInBand --no-cache --testTimeout=100000000",
"test": "yarn test-ui",
"test:ci": "yarn test-ui --runInBand",
"test:ci": "yarn test-ui",
"unlink-components": "yarn unlink react && yarn unlink \"@canonical/react-components\"",
"wait-on-ui": "wait-on http-get://0.0.0.0:8400/MAAS/r",
"storybook": "storybook dev -p 6006",
Expand All @@ -47,6 +48,7 @@
"@canonical/react-components": "0.46.0",
"@reduxjs/toolkit": "1.9.3",
"@sentry/browser": "5.30.0",
"@vitejs/plugin-react-swc": "3.4.1",
"classnames": "2.3.2",
"clone-deep": "4.0.1",
"date-fns": "2.29.3",
Expand All @@ -62,10 +64,9 @@
"react-dom": "18.2.0",
"react-dropzone": "14.2.3",
"react-portal": "4.2.2",
"react-redux": "8.0.5",
"react-redux": "9.0.4",
petermakowski marked this conversation as resolved.
Show resolved Hide resolved
"react-router-dom": "5.3.4",
"react-router-dom-v5-compat": "6.8.1",
"react-scripts": "5.0.1",
"react-storage-hooks": "4.0.1",
"react-useportal": "1.0.18",
"reconnecting-websocket": "4.4.0",
Expand All @@ -77,6 +78,9 @@
"typed-redux-saga": "1.5.0",
"typescript": "5.1.3",
"vanilla-framework": "4.0.0",
"vite": "5.0.8",
"vite-plugin-svgr": "4.1.0",
"vite-tsconfig-paths": "4.2.1",
"yup": "0.32.11"
},
"devDependencies": {
Expand All @@ -100,11 +104,11 @@
"@testing-library/user-event": "14.4.3",
"@types/classnames": "2.3.0",
"@types/clone-deep": "4.0.1",
"@types/jest": "27.5.2",
"@types/node": "20.10.3",
"@types/path-parse": "1.0.19",
"@types/pluralize": "0.0.29",
"@types/react-dom": "18.2.6",
"@types/react": "18.2.45",
"@types/react-dom": "18.2.17",
"@types/react-portal": "4.0.4",
"@types/react-redux": "7.1.25",
"@types/react-router": "5.1.20",
Expand All @@ -121,7 +125,10 @@
"cypress-axe": "1.4.0",
"cypress-wait-until": "2.0.1",
"dotenv-flow": "3.2.0",
"eslint": "8.53.0",
"eslint-config-prettier": "9.0.0",
"eslint-config-react-app": "7.0.1",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-cypress": "2.12.1",
"eslint-plugin-no-only-tests": "3.1.0",
"eslint-plugin-playwright": "0.15.3",
Expand All @@ -131,7 +138,7 @@
"formik-devtools-extension": "0.1.8",
"http-proxy-middleware": "2.0.6",
"immer": "10.0.2",
"jest-fetch-mock": "3.0.3",
"jsdom": "22.1.0",
"mock-socket": "9.2.1",
"mockdate": "3.0.5",
"nanoid": "4.0.1",
Expand All @@ -145,16 +152,19 @@
"start-server-and-test": "2.0.0",
"storybook": "7.4.1",
"timezone-mock": "1.3.6",
"vite-plugin-eslint": "1.8.1",
"vitest": "0.34.6",
"vitest-fetch-mock": "0.2.2",
"wait-on": "7.0.1",
"webpack": "5.88.2"
},
"resolutions": {
"node_modules/@types/react-router-dom/@types/react": "^18.0.0",
"@types/react": "*",
"node_modules/@types/react-router-dom/@types/react": "18.2.14",
"@types/react": "18.2.45",
"@types/react-dom": "*"
},
"peerDependencies": {
"@types/react": "^18.0.0"
"@types/react": "18.2.45"
},
"browserslist": {
"production": [
Expand All @@ -173,9 +183,6 @@
"path": "./node_modules/cz-conventional-changelog"
}
},
"jest": {
"resetMocks": false
},
"npmpackagejsonlint": {
"rules": {
"prefer-absolute-version-dependencies": "error",
Expand Down
4 changes: 2 additions & 2 deletions scripts/proxy-ready.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const address = require("address");
require("colors");
import * as address from "address";
import "colors";

console.log("");
console.log("*****************");
Expand Down
24 changes: 13 additions & 11 deletions scripts/proxy.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
require("dotenv-flow").config();
var express = require("express");
var { createProxyMiddleware } = require("http-proxy-middleware");
import express from "express";
import { createProxyMiddleware } from "http-proxy-middleware";
import { config } from "dotenv-flow";

config();

const BASENAME = process.env.BASENAME;
const REACT_BASENAME = process.env.REACT_BASENAME;
const VITE_BASENAME = process.env.VITE_BASENAME;

var app = express();

const PROXY_PORT = process.env.PROXY_PORT || 8400;
const REACT_PORT = 8401;
const VITE_PORT = 8401;

app.get(BASENAME, (req, res) => res.redirect(`${BASENAME}${REACT_BASENAME}`));
app.get("/", (req, res) => res.redirect(`${BASENAME}${REACT_BASENAME}`));
app.get(BASENAME, (req, res) => res.redirect(`${BASENAME}${VITE_BASENAME}`));
app.get("/", (req, res) => res.redirect(`${BASENAME}${VITE_BASENAME}`));
app.get(`${BASENAME}/`, (req, res) =>
res.redirect(`${BASENAME}${REACT_BASENAME}`)
res.redirect(`${BASENAME}${VITE_BASENAME}`)
);

const DOCS = `${BASENAME}/docs`;
Expand Down Expand Up @@ -50,7 +52,7 @@ app.use(
// Proxy the HMR endpoint to the React client.
app.use(
createProxyMiddleware("/sockjs-node", {
target: `http://localhost:${REACT_PORT}/`,
target: `http://localhost:${VITE_PORT}/`,
ws: true,
})
);
Expand All @@ -59,13 +61,13 @@ app.use(
if (process.env.STATIC_DEMO !== "true") {
app.use(
createProxyMiddleware("/", {
target: `http://localhost:${REACT_PORT}/`,
target: `http://localhost:${VITE_PORT}/`,
})
);
}

if (process.env.STATIC_DEMO === "true") {
app.use(`${BASENAME}${REACT_BASENAME}`, express.static("./build"));
app.use(`${BASENAME}${VITE_BASENAME}`, express.static("./build"));
app.use(`*`, express.static("./build"));
}

Expand Down
4 changes: 3 additions & 1 deletion src/__mocks__/@reduxjs/toolkit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const toolkit = jest.requireActual("@reduxjs/toolkit");
import { vi } from "vitest";

const toolkit = vi.importActual("@reduxjs/toolkit");

let id = 0;

Expand Down
Loading