Skip to content

Commit

Permalink
release (#42)
Browse files Browse the repository at this point in the history
1. update packages
2. migrate storybook 7 to 8
3. remove unocss
4. install shadcn-ui
5. init docker
6. fix example aside
  • Loading branch information
0plan authored Mar 21, 2024
1 parent 8dc0bc0 commit 470556d
Show file tree
Hide file tree
Showing 145 changed files with 4,518 additions and 4,691 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
3 changes: 1 addition & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ module.exports = {
"import/resolver": {
alias: {
map: [
["@components", "./src/components"],
["~", "./src"],
["@", "./src"],
],
},
},
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ storybook-static
*.njsproj
*.sln
*.sw?

._*
5 changes: 2 additions & 3 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { StorybookConfig } from '@storybook/react-vite'
import Unocss from 'unocss/vite'

const config: StorybookConfig = {
"stories": [
Expand All @@ -10,7 +9,8 @@ const config: StorybookConfig = {
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions"
"@storybook/addon-interactions",
"@storybook/addon-mdx-gfm"
],
"framework": {
"name": "@storybook/react-vite",
Expand All @@ -20,7 +20,6 @@ const config: StorybookConfig = {
"autodocs": "tag"
},
viteFinal(config){
config.plugins?.push(Unocss())
// Add other configuration here depending on your use case
return config
}
Expand Down
3 changes: 1 addition & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Preview } from '@storybook/react'
import '~/index.css'
import 'uno.css'
import '@/index.css'

const preview: Preview = {
parameters: {
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:18-alpine as build-stage

WORKDIR /app
RUN corepack enable

COPY package.json pnpm-lock.yaml ./
RUN pnpm install

COPY . .
RUN pnpm build

FROM nginx:stable-alpine as production-stage

COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80/tcp

CMD ["nginx", "-g", "daemon off;"]
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@ VRTN is Vite React Typescript i18n template
## 🚀 Features

- React 18, Typescript, [Vite](https://github.com/vitejs/vite), [pnpm](https://pnpm.io/)
- [Tailwind CSS](https://tailwindcss.com/), [Unocss](https://unocss.dev/), [radix-ui](https://www.radix-ui.com/)
- [Tailwind CSS](https://tailwindcss.com/), [shadcn/ui](https://ui.shadcn.com/)
- [Components](./src/components)
- [Zustand](https://zustand-demo.pmnd.rs/)
- [I18n ready](./public/locales)
- [Use icons](https://unocss.dev/presets/icons)
- [Deploy on Vercel](https://vercel.com)
- [File based routing](https://github.com/oedotme/generouted)
- [Layout](https://github.com/oedotme/generouted?tab=readme-ov-file#file-and-directories-naming-and-conventions)
- [Storybook](https://storybook.js.org/)
- Docker

## 🚧 TO-DO

- [PWA]()
- [Markdown Support]()
- Unit Testing with [Vitest](https://github.com/vitest-dev/vitest), E2E Testing with [Cypress](https://cypress.io/)
- Unit Testing with [Vitest](https://github.com/vitest-dev/vitest), E2E Testing with [Playwright](https://playwright.dev/)
on [GitHub Actions](https://github.com/features/actions)
- Docker

[//]: # (## Try it now!)

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": "default",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/index.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
13 changes: 13 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
server {
listen 80;
listen [::]:80;

location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html = 404;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
60 changes: 34 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@
"version": "0.0.0",
"type": "module",
"engines": {
"node": ">=16",
"pnpm": ">=7"
"node": ">=18",
"pnpm": ">=8"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"tsc": "tsc",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"storybook": "storybook dev -p 6006 -s public",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build -s public -o dist/storybook",
"serve-storybook": "serve dist"
"serve-storybook": "serve dist",
"update:shadcn-ui": "npx shadcn-ui@latest add -a -y -o"
},
"dependencies": {
"@generouted/react-router": "^1.18.5",
"@radix-ui/react-accessible-icon": "^1.0.3",
"@hookform/resolvers": "^3.3.4",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-aspect-ratio": "^1.0.3",
Expand Down Expand Up @@ -54,59 +55,66 @@
"clsx": "^2.1.0",
"cmdk": "^0.2.1",
"date-fns": "^2.30.0",
"embla-carousel-react": "^8.0.0",
"i18next": "^23.10.1",
"i18next-browser-languagedetector": "^7.2.0",
"i18next-http-backend": "^2.5.0",
"input-otp": "^1.2.2",
"js-yaml": "^4.1.0",
"localforage": "^1.10.0",
"lucide-react": "^0.359.0",
"match-sorter": "^6.3.4",
"next-themes": "^0.3.0",
"react": "^18.2.0",
"react-day-picker": "^8.10.0",
"react-dom": "^18.2.0",
"react-helmet-async": "^2.0.4",
"react-hook-form": "^7.51.1",
"react-i18next": "^13.5.0",
"react-i18next": "^14.1.0",
"react-markdown": "^9.0.1",
"react-resizable-panels": "^2.0.13",
"react-router-dom": "^6.22.3",
"sonner": "^1.4.32",
"tailwind-merge": "^2.2.2",
"tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^2.16.0",
"vaul": "^0.9.0",
"zod": "^3.22.4",
"zustand": "^4.5.2"
},
"devDependencies": {
"@iconify/json": "^2.2.193",
"@storybook/addon-essentials": "^7.6.17",
"@storybook/addon-interactions": "^7.6.17",
"@storybook/addon-links": "^7.6.17",
"@storybook/addon-onboarding": "^1.0.11",
"@storybook/blocks": "^7.6.17",
"@storybook/builder-vite": "^7.6.17",
"@storybook/react": "^7.6.17",
"@storybook/react-vite": "^7.6.17",
"@storybook/test": "^7.6.17",
"@iconify/json": "^2.2.194",
"@storybook/addon-essentials": "^8.0.2",
"@storybook/addon-interactions": "^8.0.2",
"@storybook/addon-links": "^8.0.2",
"@storybook/addon-mdx-gfm": "^8.0.2",
"@storybook/addon-onboarding": "^8.0.2",
"@storybook/blocks": "^8.0.2",
"@storybook/react": "^8.0.2",
"@storybook/react-vite": "^8.0.2",
"@storybook/test": "^8.0.2",
"@tailwindcss/forms": "^0.5.7",
"@types/js-yaml": "^4.0.9",
"@types/react": "^18.2.67",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@unocss/preset-icons": "^0.58.6",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"@vitejs/plugin-react": "^4.2.1",
"@vitejs/plugin-react-swc": "^3.6.0",
"autoprefixer": "^10.4.18",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-storybook": "^0.8.0",
"nprogress": "^0.2.0",
"postcss": "^8.4.36",
"postcss": "^8.4.38",
"sass": "^1.72.0",
"storybook": "^7.6.17",
"storybook": "^8.0.2",
"tailwindcss": "^3.4.1",
"typescript": "^5.4.2",
"unocss": "^0.58.6",
"vite": "^5.1.6",
"typescript": "^5.4.3",
"vite": "^5.2.2",
"vite-tsconfig-paths": "^4.3.2"
}
}
Loading

0 comments on commit 470556d

Please sign in to comment.