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

build: Migrate to Vite 🚀 #6713

Merged
merged 88 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
3c19128
init
Apr 10, 2023
6f7cfe5
add: vite dev build working
Apr 10, 2023
dca0306
fix: href serving from public
Apr 10, 2023
dbe3123
feat: add ejs plugin
Apr 10, 2023
b7558ff
feat: migrated env files and ejs templating
Apr 10, 2023
1320a21
chore: add types related to envs
Apr 10, 2023
da8a52b
chore: add vite-env types
Apr 10, 2023
a7f1e98
feat: support vite pwa
Apr 12, 2023
1a0c288
chore: upgrade vite pwa
Apr 12, 2023
a7a593d
chore: pin node version to 16.18.1
Apr 12, 2023
0aae517
chore: preserve use of nodejs 14
Apr 12, 2023
8ffae42
refactor: preserve REACT_APP as env prefix
Apr 15, 2023
709692a
chore: support esm environment variables
Apr 16, 2023
0a41133
Merge remote-tracking branch 'origin/master' into use-vite
ad1992 Jun 13, 2023
5c5760a
fix ts config
ad1992 Jun 13, 2023
beecdda
Merge remote-tracking branch 'origin/master' into use-vite
ad1992 Jun 19, 2023
316203a
use VITE prefix and remove vite-plugin-env-compatible
ad1992 Jun 20, 2023
2436bf6
introduce import-meta-loader for building pacakge as webpack isn't co…
ad1992 Jun 20, 2023
6aad614
lint
ad1992 Jun 21, 2023
09a9176
remove import.meta.env in main.js
ad1992 Jun 21, 2023
fdb86e2
set debug flag to false
ad1992 Jun 21, 2023
6c516c2
migrate to vitest and use jest-canvas-mock 2.4.0 so its comp
ad1992 Jun 22, 2023
0c8d402
integrate vitest-ui
ad1992 Jun 22, 2023
16d47f1
fix most of teh test
ad1992 Jun 22, 2023
f80199f
snaps
ad1992 Jun 22, 2023
666880f
Add script for testing with vite ui
ad1992 Jun 27, 2023
bc2d29f
fix all tests related to mocking
ad1992 Jun 27, 2023
9dbc0dc
fix more test
ad1992 Jun 28, 2023
b4e22ad
fix more
ad1992 Jun 28, 2023
88f55e8
fix flip.test.tsx
ad1992 Jul 3, 2023
3128698
fix contentxmenu snaps
ad1992 Jul 3, 2023
e3cb1a0
fix regression snaps
ad1992 Jul 3, 2023
7a89c4f
fix excalidraw.test.tsx and this makes all tests finally pass :)
ad1992 Jul 3, 2023
717fe4e
Merge remote-tracking branch 'origin/master' into aakansha-vite
ad1992 Jul 3, 2023
9a0ec57
use node 16
ad1992 Jul 3, 2023
b9284fb
specify node version
ad1992 Jul 3, 2023
2a0b069
use node 16 in lint as well
ad1992 Jul 3, 2023
449eb29
fix mobile.test.tsx
ad1992 Jul 3, 2023
d95e45e
use node 16
ad1992 Jul 3, 2023
5358d7c
add style-loader
ad1992 Jul 3, 2023
eadc00b
upgrade to node 18
ad1992 Jul 3, 2023
db87f6b
fix lint package.json
ad1992 Jul 3, 2023
63525d8
support eslint with vite
ad1992 Jul 3, 2023
4eade57
fix lint
ad1992 Jul 3, 2023
c51452e
fix lint
ad1992 Jul 3, 2023
d4c247f
fix ts
ad1992 Jul 3, 2023
dee2c13
remove pwa/sw stuff
ad1992 Jul 4, 2023
b2f58b0
use env vars in EJS the vite way
ad1992 Jul 5, 2023
8fb64e2
fix lint
ad1992 Jul 5, 2023
1b7c069
move remainig jest mock/spy to vite
ad1992 Jul 5, 2023
298b977
don't cache locales
ad1992 Jul 10, 2023
e89cd11
fix regex
ad1992 Jul 10, 2023
ae3c0b1
add fonts cache
ad1992 Jul 10, 2023
28e81f8
tweak
ad1992 Jul 10, 2023
4564242
add custom service worker
ad1992 Jul 10, 2023
be75dcc
upgrade vite and create font cache again
ad1992 Jul 11, 2023
584acb7
cache fonts.css and locales
ad1992 Jul 11, 2023
93b95fb
tweak
ad1992 Jul 11, 2023
3616a2e
use manifestTransforms for filtering locales
ad1992 Jul 11, 2023
579dc6f
use assets js pattern for locales
ad1992 Jul 11, 2023
0cfed6a
Merge remote-tracking branch 'origin/master' into aakansha-vite
ad1992 Jul 12, 2023
1cf371c
add font.css to globIgnore so its pushed to fonts cache
ad1992 Jul 12, 2023
50acfed
create a separate chunk for locales with rollup
ad1992 Jul 12, 2023
096f2e5
remove manifestTransforms and fix glob pattern for locales to filter …
ad1992 Jul 12, 2023
f9039c2
Merge remote-tracking branch 'origin/master' into aakansha-vite
ad1992 Jul 17, 2023
47b8293
push sourcemaps in production
ad1992 Jul 17, 2023
d973a75
add comments in config
ad1992 Jul 17, 2023
ec5b8da
Merge remote-tracking branch 'origin/master' into aakansha-vite
ad1992 Jul 21, 2023
d089d44
lint
ad1992 Jul 21, 2023
cf1fedf
use node 18
ad1992 Jul 21, 2023
bdce658
Merge remote-tracking branch 'origin/master' into aakansha-vite
ad1992 Jul 21, 2023
99d56b5
Merge branch 'master' into aakansha-vite
dwelle Jul 24, 2023
512a26c
disable pwa in dev
ad1992 Jul 24, 2023
3c515d4
Merge remote-tracking branch 'origin/master' into aakansha-vite
ad1992 Jul 24, 2023
3b4bd16
fix
ad1992 Jul 24, 2023
033e1dc
fix
ad1992 Jul 24, 2023
ee3ebaf
increase limit of bundle
ad1992 Jul 24, 2023
254d47e
upgrade vite-pwa to latest
ad1992 Jul 25, 2023
d75b546
remove public/workbox so workbox assets are not precached
ad1992 Jul 25, 2023
01c79c6
fon't club en.json and percentages.json with manual locales chunk to …
ad1992 Jul 25, 2023
118b706
tweak regex
ad1992 Jul 25, 2023
d7c2377
remove happy-dom as its not used
ad1992 Jul 25, 2023
fdf7c6d
add comment
ad1992 Jul 25, 2023
a29ff88
use any instead of ts-ignore
ad1992 Jul 26, 2023
db8806b
Merge remote-tracking branch 'origin/master' into aakansha-vite
ad1992 Jul 26, 2023
480157e
cleanup
ad1992 Jul 26, 2023
b098c07
remove jest-canvas-mock resolution as vite-canvas-mock was patched lo…
ad1992 Jul 26, 2023
a9dcbbc
use same theme color present in entry point
ad1992 Jul 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
REACT_APP_BACKEND_V2_GET_URL=https://json-dev.excalidraw.com/api/v2/
REACT_APP_BACKEND_V2_POST_URL=https://json-dev.excalidraw.com/api/v2/post/
VITE_APP_BACKEND_V2_GET_URL=https://json-dev.excalidraw.com/api/v2/
VITE_APP_BACKEND_V2_POST_URL=https://json-dev.excalidraw.com/api/v2/post/

REACT_APP_LIBRARY_URL=https://libraries.excalidraw.com
REACT_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries
VITE_APP_LIBRARY_URL=https://libraries.excalidraw.com
VITE_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries

# collaboration WebSocket server (https://github.com/excalidraw/excalidraw-room)
REACT_APP_WS_SERVER_URL=http://localhost:3002
VITE_APP_WS_SERVER_URL=http://localhost:3002

# set this only if using the collaboration workflow we use on excalidraw.com
REACT_APP_PORTAL_URL=
VITE_APP_PORTAL_URL=

REACT_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}'
VITE_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}'

# put these in your .env.local, or make sure you don't commit!
# must be lowercase `true` when turned on
#
# whether to enable Service Workers in development
REACT_APP_DEV_ENABLE_SW=
VITE_APP_DEV_ENABLE_SW=
# whether to disable live reload / HMR. Usuaully what you want to do when
# debugging Service Workers.
REACT_APP_DEV_DISABLE_LIVE_RELOAD=
REACT_APP_DISABLE_TRACKING=true
VITE_APP_DEV_DISABLE_LIVE_RELOAD=
VITE_APP_DISABLE_TRACKING=true

FAST_REFRESH=false

#Debug flags

# To enable bounding box for text containers
REACT_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX=
VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX=
16 changes: 8 additions & 8 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
REACT_APP_BACKEND_V2_GET_URL=https://json.excalidraw.com/api/v2/
REACT_APP_BACKEND_V2_POST_URL=https://json.excalidraw.com/api/v2/post/

REACT_APP_LIBRARY_URL=https://libraries.excalidraw.com
REACT_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries
VITE_APP_LIBRARY_URL=https://libraries.excalidraw.com
VITE_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries

REACT_APP_PORTAL_URL=https://portal.excalidraw.com
VITE_APP_PORTAL_URL=https://portal.excalidraw.com
# Fill to set socket server URL used for collaboration.
# Meant for forks only: excalidraw.com uses custom REACT_APP_PORTAL_URL flow
REACT_APP_WS_SERVER_URL=
# Meant for forks only: excalidraw.com uses custom VITE_APP_PORTAL_URL flow
VITE_APP_WS_SERVER_URL=

REACT_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}'
VITE_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}'

REACT_APP_PLUS_APP=https://app.excalidraw.com
REACT_APP_DISABLE_TRACKING=
VITE_APP_PLUS_APP=https://app.excalidraw.com
VITE_APP_DISABLE_TRACKING=
4 changes: 2 additions & 2 deletions .github/workflows/autorelease-excalidraw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup Node.js 14.x
- name: Setup Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 18.x
- name: Set up publish access
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/autorelease-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
with:
ref: ${{ steps.sha.outputs.result }}
fetch-depth: 2
- name: Setup Node.js 14.x
- name: Setup Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 18.x
- name: Set up publish access
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Setup Node.js 14.x
- name: Setup Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 18.x

- name: Install and lint
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/locales-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
with:
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}

- name: Setup Node.js 14.x
- name: Setup Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 18.x

- name: Create report file
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sentry-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js 14.x
- name: Setup Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 18.x
- name: Install and build
run: |
yarn --frozen-lockfile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js 14.x
- name: Setup Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 18.x
- name: Install and test
run: |
yarn --frozen-lockfile
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ src/packages/excalidraw/example/public/bundle.js
src/packages/excalidraw/example/public/excalidraw-assets-dev
src/packages/excalidraw/example/public/excalidraw.development.js
coverage
dev-dist
html
24 changes: 9 additions & 15 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@
}
</style>
<!------------------------------------------------------------------------->

<% if (process.env.NODE_ENV === "production") { %>
<% if ("%PROD%" === "true") { %>
<script>
// Redirect Excalidraw+ users which have auto-redirect enabled.
//
Expand All @@ -100,41 +99,35 @@
</script>
<% } %>

<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

<!-- Excalidraw version -->
<meta name="version" content="{version}" />

<link
rel="preload"
href="Virgil.woff2"
href="/Virgil.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="Cascadia.woff2"
href="/Cascadia.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>

<link
rel="manifest"
href="manifest.json"
style="--pwacompat-splash-font: 24px Virgil"
/>

<link rel="stylesheet" href="fonts.css" type="text/css" />
<% if (process.env.REACT_APP_DEV_DISABLE_LIVE_RELOAD==="true" ) { %>
<link rel="stylesheet" href="/fonts.css" type="text/css" />
<% if ("%VITE_APP_DEV_DISABLE_LIVE_RELOAD%"==="true" ) { %>
<script>
{
const _WebSocket = window.WebSocket;
window.WebSocket = function (url) {
if (/ws:\/\/localhost:.+?\/sockjs-node/.test(url)) {
console.info(
"[!!!] Live reload is disabled via process.env.REACT_APP_DEV_DISABLE_LIVE_RELOAD [!!!]",
"[!!!] Live reload is disabled via VITE_APP_DEV_DISABLE_LIVE_RELOAD [!!!]",
);
} else {
return new _WebSocket(url);
Expand Down Expand Up @@ -200,7 +193,8 @@
<h1 class="visually-hidden">Excalidraw</h1>
</header>
<div id="root"></div>
<% if (process.env.REACT_APP_DISABLE_TRACKING !== 'true') { %>
<script type="module" src="/src/index.tsx"></script>
<% if ("%VITE_APP_DEV_DISABLE_LIVE_RELOAD%" !== 'true') { %>
<!-- 100% privacy friendly analytics -->
<script>
// need to load this script dynamically bcs. of iframe embed tracking
Expand Down
53 changes: 26 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"canvas-roundrect-polyfill": "0.0.1",
"clsx": "1.1.1",
"cross-env": "7.0.3",
"eslint-plugin-react": "7.32.2",
"fake-indexeddb": "3.1.7",
"firebase": "8.3.3",
"i18next-browser-languagedetector": "6.1.4",
Expand All @@ -51,7 +52,6 @@
"pwacompat": "2.0.17",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-scripts": "5.0.1",
"roughjs": "4.5.2",
"sass": "1.51.0",
"socket.io-client": "2.3.1",
Expand All @@ -70,7 +70,7 @@
"workbox-streams": "^6.5.4"
},
"devDependencies": {
"@excalidraw/eslint-config": "1.0.0",
"@excalidraw/eslint-config": "1.0.3",
"@excalidraw/prettier-config": "1.0.2",
"@types/chai": "4.3.0",
"@types/jest": "27.4.0",
Expand All @@ -81,68 +81,67 @@
"@types/react-dom": "18.0.6",
"@types/resize-observer-browser": "0.1.7",
"@types/socket.io-client": "1.4.36",
"@vitejs/plugin-react": "3.1.0",
"@vitest/ui": "0.32.2",
"chai": "4.3.6",
"dotenv": "16.0.1",
"eslint-config-prettier": "8.5.0",
"eslint-config-react-app": "7.0.1",
"eslint-plugin-prettier": "3.3.1",
"happy-dom": "9.20.3",
ad1992 marked this conversation as resolved.
Show resolved Hide resolved
"http-server": "14.1.1",
"husky": "7.0.4",
"jest-canvas-mock": "2.4.0",
"jsdom": "22.1.0",
"lint-staged": "12.3.7",
"pepjs": "0.5.3",
"prettier": "2.6.2",
"rewire": "6.0.0",
"typescript": "4.9.4"
"typescript": "4.9.4",
"vite": "4.4.2",
"vite-plugin-ejs": "1.6.4",
"vite-plugin-eslint": "1.8.1",
"vite-plugin-pwa": "0.14.7",
"vite-plugin-svgr": "2.4.0",
"vitest": "0.32.2",
"vitest-canvas-mock": "0.3.1"
},
"resolutions": {
"jest-canvas-mock": "2.4.0"
},
"engines": {
"node": ">=14.0.0"
},
"homepage": ".",
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}"
],
"coveragePathIgnorePatterns": [
"<rootDir>/locales",
"<rootDir>/src/packages/excalidraw/dist/",
"<rootDir>/src/packages/excalidraw/types",
"<rootDir>/src/packages/excalidraw/example"
],
"transformIgnorePatterns": [
"node_modules/(?!(roughjs|points-on-curve|path-data-parser|points-on-path|browser-fs-access|canvas-roundrect-polyfill)/)"
],
"resetMocks": false
},
"name": "excalidraw",
"prettier": "@excalidraw/prettier-config",
"private": true,
"scripts": {
"build-node": "node ./scripts/build-node.js",
"build:app:docker": "cross-env REACT_APP_DISABLE_SENTRY=true REACT_APP_DISABLE_TRACKING=true react-scripts build",
"build:app": "cross-env REACT_APP_GIT_SHA=$VERCEL_GIT_COMMIT_SHA react-scripts build",
"build:app:docker": "cross-env REACT_APP_DISABLE_SENTRY=true REACT_APP_DISABLE_TRACKING=true vite build",
"build:app": "cross-env REACT_APP_GIT_SHA=$VERCEL_GIT_COMMIT_SHA vite build",
"build:version": "node ./scripts/build-version.js",
"build": "yarn build:app && yarn build:version",
"eject": "react-scripts eject",
"fix:code": "yarn test:code --fix",
"fix:other": "yarn prettier --write",
"fix": "yarn fix:other && yarn fix:code",
"locales-coverage": "node scripts/build-locales-coverage.js",
"locales-coverage:description": "node scripts/locales-coverage-description.js",
"prepare": "husky install",
"prettier": "prettier \"**/*.{css,scss,json,md,html,yml}\" --ignore-path=.eslintignore",
"start": "react-scripts start",
"start": "vite --port 3000",
"start:production": "npm run build && npx http-server build -a localhost -p 5001 -o",
"test:all": "yarn test:typecheck && yarn test:code && yarn test:other && yarn test:app --watchAll=false",
"test:app": "react-scripts test --passWithNoTests",
"test:app": "vitest --config vitest.config.ts",
"test:code": "eslint --max-warnings=0 --ext .js,.ts,.tsx .",
"test:debug": "react-scripts --inspect-brk test --runInBand --no-cache",
"test:other": "yarn prettier --list-different",
"test:typecheck": "tsc",
"test:update": "yarn test:app --updateSnapshot --watchAll=false",
"test:update": "yarn test:app --update --watch=false",
"test": "yarn test:app",
"test:coverage": "react-scripts test --passWithNoTests --coverage --watchAll",
"test:coverage": "vitest --coverage --watchAll",
"test:ui": "yarn test --ui",
"autorelease": "node scripts/autorelease.js",
"prerelease": "node scripts/prerelease.js",
"build:preview": "yarn build && vite preview --port 5000",
"release": "node scripts/release.js"
}
}
2 changes: 1 addition & 1 deletion src/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const trackEvent = (
// Uncomment the next line to track locally
// console.log("Track Event", { category, action, label, value });

if (typeof window === "undefined" || process.env.JEST_WORKER_ID) {
if (typeof window === "undefined" || import.meta.env.VITE_WORKER_ID) {
return;
}

Expand Down
5 changes: 2 additions & 3 deletions src/charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
import {
DEFAULT_FONT_FAMILY,
DEFAULT_FONT_SIZE,
ENV,
VERTICAL_ALIGN,
} from "./constants";
import { newElement, newLinearElement, newTextElement } from "./element";
Expand Down Expand Up @@ -384,7 +383,7 @@ const chartTypeBar = (
y,
groupId,
backgroundColor,
process.env.NODE_ENV === ENV.DEVELOPMENT,
import.meta.env.DEV,
),
];
};
Expand Down Expand Up @@ -473,7 +472,7 @@ const chartTypeLine = (
y,
groupId,
backgroundColor,
process.env.NODE_ENV === ENV.DEVELOPMENT,
import.meta.env.DEV,
),
line,
...lines,
Expand Down
3 changes: 2 additions & 1 deletion src/components/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { reseed } from "../random";
import { render, queryByTestId } from "../tests/test-utils";

import ExcalidrawApp from "../excalidraw-app";
import { vi } from "vitest";

const renderScene = jest.spyOn(Renderer, "renderScene");
const renderScene = vi.spyOn(Renderer, "renderScene");

describe("Test <App/>", () => {
beforeEach(async () => {
Expand Down