Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
  • Loading branch information
TinsFox committed Nov 29, 2024
1 parent 087c6cb commit ecd2817
Show file tree
Hide file tree
Showing 42 changed files with 302 additions and 929 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ coverage/
# typescript
*.tsbuildinfo
next-env.d.ts

storybook-static
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"hyoban",
"lucide",
"ofetch",
"sonner",
"tanstack",
"tsup"
],
Expand Down
1 change: 0 additions & 1 deletion apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
"postcss": "^8.4.47",
"storybook": "^8.4.5",
"tailwindcss": "^3.4.14",
"turbo": "^2.2.3",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vite-plugin-html": "^3.2.2",
Expand Down
5 changes: 0 additions & 5 deletions apps/admin/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,5 @@ export default defineConfig(({ mode }) => {
},
},
},
build: {
rollupOptions: {
// external: ["react-hook-form"],
},
},
}
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
"type": "git"
},
"scripts": {
"admin:build": "pnpm --filter admin build",
"admin:dev": "pnpm --filter admin dev",
"api:dev": "turbo dev --filter api",
"build": "tsc && vite build",
"build": "turbo build",
"build-storybook": "storybook build",
"coverage": "vitest run --coverage",
"dev": "turbo dev",
Expand Down
51 changes: 1 addition & 50 deletions packages/pro-components/README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```

- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:

```js
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
// Set the react version
settings: { react: { version: '18.3' } },
plugins: {
// Add the react plugin
react,
},
rules: {
// other rules...
// Enable its recommended rules
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
```
# Pro Components
10 changes: 8 additions & 2 deletions packages/pro-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"./pro-table": "./src/components/pro-table/index.tsx"
},
"scripts": {
"build": "tsc -b && vite build",
"build": "tsc -b && vite build -d",
"build-storybook": "storybook build",
"dev": "vite",
"lint": "eslint .",
Expand Down Expand Up @@ -38,15 +38,21 @@
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
"eslint": "^9.13.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-storybook": "^0.11.0",
"globals": "^15.11.0",
"postcss": "^8.4.49",
"storybook": "^8.4.5",
"tailwind-merge": "^2.5.4",
"tailwindcss": "^3.4.15",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10"
"vite": "^5.4.10",
"vite-tsconfig-paths": "^5.0.1"
},
"eslintConfig": {
"extends": [
Expand Down
6 changes: 6 additions & 0 deletions packages/pro-components/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
2 changes: 2 additions & 0 deletions packages/pro-components/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "./App.css"

import { Button } from "@repo/ui/button"
import { useState } from "react"

import viteLogo from "/vite.svg"
Expand Down Expand Up @@ -31,6 +32,7 @@ function App() {
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
<Button>123</Button>
</>
)
}
Expand Down
7 changes: 7 additions & 0 deletions packages/pro-components/src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { ClassValue } from "clsx"
import { clsx } from "clsx"
import { twMerge } from "tailwind-merge"

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
1 change: 1 addition & 0 deletions packages/pro-components/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "./index.css"
import "@repo/ui/globals.css"

import { StrictMode } from "react"
import { createRoot } from "react-dom/client"
Expand Down
53 changes: 0 additions & 53 deletions packages/pro-components/src/stories/Button.stories.ts

This file was deleted.

37 changes: 0 additions & 37 deletions packages/pro-components/src/stories/Button.tsx

This file was deleted.

Loading

0 comments on commit ecd2817

Please sign in to comment.