Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
  • Loading branch information
callqh committed Jun 12, 2024
2 parents a727a5a + 52a69dd commit 0528be3
Show file tree
Hide file tree
Showing 38 changed files with 6,943 additions and 3,859 deletions.
45 changes: 0 additions & 45 deletions README.cn.md

This file was deleted.

48 changes: 48 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<div align="center">

<!-- <h3>Farm-react Starter Template</h3> -->
<p>
<img src="./src/assets/logo.png" width="30" align="center" />
An out-of-the-box Farm-react development template
</p>
<p align="center">
<a href="https://discord.gg/mDErq9aFnF">
<img src="https://img.shields.io/badge/chat-discord-blueviolet?style=flat&logo=discord&colorA=ffe3f5&colorB=711a5f" alt="discord chat" />
</a>
<a href="https://npmjs.com/package/@farmfe/core">
<img src="https://img.shields.io/npm/v/@farmfe/core.svg?style=flat-square&colorA=ffe3f5&colorB=711a5f" alt="npm package">
</a>
<a href="https://nodejs.org/en/about/releases/">
<img src="https://img.shields.io/node/v/@farmfe/core.svg?style=flat-square&colorA=ffe3f5&colorB=711a5f" alt="node compatibility">
</a>
<a href="https://github.com/farm-fe/farm/blob/main/LICENSE">
<img src="https://img.shields.io/npm/l/@farmfe/core?style=flat-square&colorA=ffe3f5&colorB=711a5f" alt="license" />
</a>
</p>
<br/>
</div>

<p>
<img src="https://github.com/jstors/assets/blob/main/home.jpeg" align="center" />
</p>

> For a better development experience, please install the [**Biome plugin**](https://biomejs.dev/en/reference/vscode/) on your local development tool.

## RoadMap

[RoadMap](https://github.com/jstors/farm-react-template/issues/21)

## Usage

### User Configuration

All configuration files are located in the `config` directory and can be modified according to your needs.
- `config/const.ts`: Contains constants used in the project.
- `config/menu.ts`: Menu configuration

## Integrated Features
- [Farm](https://farm-fe.github.io/en/docs/quick-start): A Rust-based foundation framework that provides a complete development experience.
- [Biome](https://biomejs.dev/en/reference/configuration/#javascriptformatterjsxquotestyle): A Rust-based linting and formatting tool that enhances the development experience.
- [Ant Design](https://ant.design/components/overview-cn/): An out-of-the-box React component library, use version 5.x.
- [vite-plugin-pages](https://github.com/hannoeru/vite-plugin-pages?tab=readme-ov-file#react-1): Provides a routing system based on conventions.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- <h3>Farm-react Starter Template</h3> -->
<p>
<img src="./src/assets/logo.png" width="30" align="center" />
An out-of-the-box Farm-react development template
开箱即用的 Farm-react-admin 开发模板
</p>
<p align="center">
<a href="https://discord.gg/mDErq9aFnF">
Expand All @@ -22,25 +22,27 @@
<br/>
</div>

---
<p>
<img src="https://github.com/jstors/assets/blob/main/home.jpeg" align="center" />
</p>

> 为获得更好的开发体验,请在本地开发工具上安装 [**Biome 插件**](https://biomejs.dev/en/reference/vscode/)

> For a better development experience, please install the [**Biome plugin**](https://biomejs.dev/en/reference/vscode/) on your local development tool.
>
## RoadMap

[RoadMap](https://github.com/jstors/farm-react-template/issues/21)

## Usage
## 使用

### User Configuration
### 用户配置

All configuration files are located in the `config` directory and can be modified according to your needs.
- `config/const.ts`: Contains constants used in the project.
- `config/menu.ts`: Menu configuration
-
所有配置文件都位于 `config` 目录中,可以根据需要进行修改。
- `config/const.ts`: 包含在项目中使用的常量
- `config/menu.ts`: 菜单配置

## Integrated Features
- [Farm](https://farm-fe.github.io/en/docs/quick-start): A Rust-based foundation framework that provides a complete development experience.
- [Biome](https://biomejs.dev/en/reference/configuration/#javascriptformatterjsxquotestyle): A Rust-based linting and formatting tool that enhances the development experience.
- [arco-design](https://arco.design/en/docs/start): An out-of-the-box React component library.
- [vite-plugin-pages](https://github.com/hannoeru/vite-plugin-pages?tab=readme-ov-file#react-1): Provides a routing system based on conventions.
- [Farm](https://farm-fe.github.io/en/docs/quick-start): 一个基于Rust的基础框架,提供完整的开发体验
- [Biome](https://biomejs.dev/en/reference/configuration/#javascriptformatterjsxquotestyle): 一个基于Rust的代码检查和格式化工具,可以增强开发体验
- [Ant Design](https://ant.design/components/overview-cn/): 开箱即用的 React 组件库,使用版本 5.x
- [vite-plugin-pages](https://github.com/hannoeru/vite-plugin-pages?tab=readme-ov-file#react-1): 基于约定的路由系统
56 changes: 28 additions & 28 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.1/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"a11y": {
"useButtonType": "off",
"useKeyWithClickEvents": "off"
},
"correctness": {
"useExhaustiveDependencies": "warn"
}
}
},
"formatter": {
"enabled": true,
"lineWidth": 120,
"indentStyle": "space",
"indentWidth": 2
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
}
"$schema": "https://biomejs.dev/schemas/1.6.1/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"a11y": {
"useButtonType": "off",
"useKeyWithClickEvents": "off"
},
"correctness": {
"useExhaustiveDependencies": "off"
}
}
},
"formatter": {
"enabled": true,
"lineWidth": 120,
"indentStyle": "space",
"indentWidth": 2
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
}
}
29 changes: 20 additions & 9 deletions farm.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import path from 'node:path';
import { vitePluginForArco } from '@arco-plugins/vite-react';
import { defineConfig } from '@farmfe/core';
import less from '@farmfe/js-plugin-less';
import postcss from '@farmfe/js-plugin-postcss';
import { theme } from 'antd';
import { viteMockServe } from 'vite-plugin-mock';
import Pages from 'vite-plugin-pages';
import { adminInfo, theme as themeConfig } from './global.config';

const { getDesignToken } = theme;
const globalToken = getDesignToken(themeConfig);

export default defineConfig({
compilation: {
Expand All @@ -14,9 +18,7 @@ export default defineConfig({
'@/': path.join(process.cwd(), 'src'),
},
},
persistentCache: {
buildDependencies: ['tailwind.config.js'],
},
persistentCache: false,
runtime: {
isolate: true,
},
Expand All @@ -28,17 +30,26 @@ export default defineConfig({
runtime: 'automatic',
},
],
'farm-plugin-remove-console',
less(),
less({
lessOptions: {
modifyVars: globalToken,
},
}),
postcss(),
'farm-plugin-remove-console',
[
'@jstors/farm-plugin-html-template',
{
template: path.resolve(__dirname, 'index.html'),
data: adminInfo,
},
],
],
vitePlugins: [
Pages({
resolver: 'react',
moduleId: '~react-pages',
}),
vitePluginForArco({
theme: '@arco-themes/react-juzi001',
importMode: 'async',
}),
viteMockServe({
mockPath: 'mock',
Expand Down
21 changes: 21 additions & 0 deletions global.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* 系统信息
*/
const adminInfo = {
title: 'Farm React Admin',
};

/**
* 主题配置
*/
const theme = {
token: {
colorPrimary: '#9d4edc',
colorInfo: '#9d4edc',
},
cssVar: {
prefix: 'farm',
},
};

export { adminInfo, theme };
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<title>${title}$</title>
</head>

<body>
<div id="root"></div>
<script src="./src/index.tsx"></script>
</body>

</html>
</html>
38 changes: 22 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,40 @@
"@arco-design/web-react": "^2.61.3",
"@arco-themes/react-juzi001": "^0.0.1",
"@tanstack/react-query": "^5.32.0",
"classnames": "^2.5.1",
"dayjs": "^1.11.10",
"mockjs": "^1.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^6.22.3",
"react-router-dom": "^6.22.3"
"@ant-design/icons": "^5.3.7",
"@ant-design/plots": "^2.2.2",
"antd": "^5.17.3",
"classnames": "^2.5.1",
"dayjs": "^1.11.11",
"framer-motion": "^11.2.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router": "^6.23.1",
"react-router-dom": "^6.23.1"
},
"devDependencies": {
"@arco-plugins/vite-react": "^1.3.3",
"@biomejs/biome": "1.7.0",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@farmfe/cli": "^1.0.1",
"@farmfe/core": "^1.1.2",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@emotion/is-prop-valid": "^1.2.2",
"@farmfe/cli": "^1.0.2",
"@farmfe/core": "^1.1.13",
"@farmfe/js-plugin-less": "^1.7.0",
"@farmfe/js-plugin-postcss": "^1.6.0",
"@farmfe/plugin-react": "^1.0.1",
"@tanstack/react-query-devtools": "^5.32.0",
"@types/react": "^18.2.78",
"@types/react-dom": "^18.2.25",
"@farmfe/plugin-react": "^1.1.0",
"@jstors/farm-plugin-html-template": "^0.0.3",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"core-js": "^3.36.1",
"farm-plugin-remove-console": "^0.1.2",
"core-js": "^3.37.1",
"farm-plugin-remove-console": "^0.1.6",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"postcss": "^8.4.38",
"react-refresh": "^0.14.0",
"react-refresh": "^0.14.2",
"tailwindcss": "^3.4.3",
"vite-plugin-mock": "^3.0.2",
"vite-plugin-pages": "^0.32.1"
Expand Down
Loading

0 comments on commit 0528be3

Please sign in to comment.