Skip to content

Commit

Permalink
Migrate CRA to Vite and upgrade dependencies (#127)
Browse files Browse the repository at this point in the history
- [x] Migrate CRA to Vite
- [x] Upgrade node version to 18 in Github actions
- [x] Upgrade node version to 18 in Docker
- [x] Migrate styled-jsx to tailwind
- [x] Upgrade dependencies
  - [x] Upgrade `@sentry/react`. Remove `@sentry/tracing` because we don't need to measure performance by Sentry.
  - [x] Upgrade `jotai`. Add `jotai-immer` because the `jotai` package no longer includes `jotai/immer`.
  - [x] Upgrade `typescirpt`
- [x] Migrate jest to vitest
- [x] Migrate `geist-ui` to `shadcn-ui`
- [x] Check all Todos
  • Loading branch information
Bowen7 authored Aug 12, 2024
1 parent dd008e3 commit 9b6d917
Show file tree
Hide file tree
Showing 167 changed files with 12,955 additions and 17,766 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,26 @@ on:
- dev

jobs:
build:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v3
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
node-version: "16"
version: 9
run_install: false

- name: Cache pnpm modules
uses: actions/cache@v3
- name: Install Node.js
uses: actions/setup-node@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
node-version: 18
cache: 'pnpm'

- uses: pnpm/[email protected]
with:
version: 6.0.2
run_install: true
- name: Install dependencies
run: pnpm install

- run: pnpm test
18 changes: 0 additions & 18 deletions .jest.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16
FROM node:18

# Install pnpm
RUN npm install -g pnpm
Expand Down
17 changes: 17 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "global.css",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/utils"
}
}
40 changes: 0 additions & 40 deletions config-overrides.js

This file was deleted.

8 changes: 8 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import antfu from '@antfu/eslint-config'

export default antfu({ react: true, rules: {
'react-refresh/only-export-components': 'off',
'style/brace-style': ['error', '1tbs'],
'antfu/top-level-function': 'off',
'@typescript-eslint/consistent-type-definitions': ['warn', 'type'],
} })
26 changes: 26 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Regex visualizer & editor, make the regular expression easier."
/>
<meta name="keywords" content="editor,regex,regexp,visualizer" />
<link rel="icon" href="/favicon.png" />
<title>Regex Vis</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<div id="portal"></div>
<% if (!isDev) { %>
<!-- Cloudflare Web Analytics -->
<script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "f684c9449da14b2396a0a944c9acb39f"}'></script>
<!-- End Cloudflare Web Analytics -->
<% } %>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
89 changes: 49 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,53 @@
{
"name": "regex-vis",
"type": "module",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "vite",
"build": "tsc && vite build",
"serve": "vite preview",
"test": "vitest",
"test:ui": "vitest --ui"
},
"dependencies": {
"@babel/core": "^7.0.0",
"@geist-ui/core": "^2.3.8",
"@geist-ui/icons": "^1.0.2",
"@sentry/react": "^7.7.0",
"@sentry/tracing": "^7.7.0",
"@phosphor-icons/react": "^2.1.7",
"@radix-ui/react-checkbox": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@sentry/react": "^8.17.0",
"@vercel/analytics": "^1.0.0",
"hex-rgb": "^5.0.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"i18next": "^21.6.16",
"i18next-browser-languagedetector": "^6.1.4",
"i18next-http-backend": "^1.4.0",
"immer": "^9.0.6",
"jotai": "^1.7.1",
"jotai": "^2.9.0",
"jotai-immer": "^0.4.1",
"nanoid": "^3.1.16",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-i18next": "^11.16.7",
"react-router-dom": "^6.3.0",
"react-scripts": "4.0.3",
"react-use": "^17.4.0",
"styled-jsx": "^5.0.2",
"tilg": "^0.1.1",
"typescript": "^5.0.0",
"web-vitals": "^3.3.0"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "jest --config .jest.config.js --no-cache",
"test:watch": "jest --config .jest.config.js --no-cache --watch --",
"test:single": "jest --config .jest.config.js --no-cache --",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
"tailwind-merge": "^2.4.0",
"tailwindcss": "^3.4.4",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.5.0",
"usehooks-ts": "^3.1.0",
"vite": "^5.3.3",
"vite-tsconfig-paths": "^4.3.2",
"web-vitals": "^3.3.0",
"zod": "^3.23.8"
},
"browserslist": {
"production": [
Expand All @@ -51,26 +62,24 @@
]
},
"devDependencies": {
"@babel/preset-env": "^7.14.2",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@svgr/webpack": "^5.5.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^14.0.0",
"@types/jest": "^26.0.13",
"@antfu/eslint-config": "^2.22.2",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@types/node": "^18.0.0",
"@types/react": "^18.0.11",
"@types/react-dom": "^18.0.5",
"@types/styled-jsx": "^2.2.8",
"@types/testing-library__jest-dom": "^5.14.4",
"babel-plugin-import": "^1.13.3",
"customize-cra": "^1.0.0",
"jest": "^26.6.0",
"jest-canvas-mock": "^2.5.0",
"react-app-rewired": "^2.1.6",
"regenerator-runtime": "^0.14.0",
"ts-jest": "^26.5.6",
"ts-node": "^10.0.0",
"webpack-bundle-analyzer": "^4.8.0"
"@vitejs/plugin-react-swc": "^3.7.0",
"@vitest/ui": "^2.0.5",
"autoprefixer": "^10.4.19",
"eslint": "^9.7.0",
"eslint-plugin-react-hooks": "5.1.0-rc-df5f2736-20240712",
"eslint-plugin-react-refresh": "^0.4.8",
"jsdom": "^24.1.1",
"postcss": "^8.4.39",
"vite-plugin-ejs": "^1.7.0",
"vitest": "^2.0.5",
"vitest-canvas-mock": "^0.3.3"
}
}
9 changes: 0 additions & 9 deletions paths.json

This file was deleted.

Loading

0 comments on commit 9b6d917

Please sign in to comment.