create-bubbles 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/template-react-rsbuild/.env +3 -0
- package/template-react-rsbuild/.env.development +0 -0
- package/template-react-rsbuild/.env.production +0 -0
- package/template-react-rsbuild/.prettierignore +34 -0
- package/template-react-rsbuild/.prettierrc +17 -0
- package/template-react-rsbuild/biome.json +101 -0
- package/template-react-rsbuild/commitlint.config.js +1 -0
- package/template-react-rsbuild/index.en-US.md +0 -0
- package/template-react-rsbuild/index.html +7 -0
- package/template-react-rsbuild/index.zh-CN.md +0 -0
- package/template-react-rsbuild/lefthook.yml +14 -0
- package/template-react-rsbuild/package.json +39 -0
- package/template-react-rsbuild/pnpm-lock.yaml +3615 -0
- package/template-react-rsbuild/postcss.config.mjs +5 -0
- package/template-react-rsbuild/public/.gitkeep +0 -0
- package/template-react-rsbuild/rsbuild.config.ts +28 -0
- package/template-react-rsbuild/src/App.tsx +9 -0
- package/template-react-rsbuild/src/components/Loading/PageLoading.tsx +11 -0
- package/template-react-rsbuild/src/env.d.ts +1 -0
- package/template-react-rsbuild/src/index.tsx +20 -0
- package/template-react-rsbuild/src/pages/home/index.tsx +26 -0
- package/template-react-rsbuild/src/router/index.tsx +27 -0
- package/template-react-rsbuild/src/styles/index.css +16 -0
- package/template-react-rsbuild/src/types/auto-import.d.ts +47 -0
- package/template-react-rsbuild/src/utils/request/axios.ts +93 -0
- package/template-react-rsbuild/src/utils/request/index.ts +60 -0
- package/template-react-rsbuild/tsconfig.json +29 -0
- package/template-react-rsbuild/uno.config.ts +8 -0
- package/template-vue-rsbuild/.env +3 -0
- package/template-vue-rsbuild/.env.development +0 -0
- package/template-vue-rsbuild/.env.production +0 -0
- package/template-vue-rsbuild/.prettierignore +4 -0
- package/template-vue-rsbuild/.prettierrc +17 -0
- package/template-vue-rsbuild/biome.json +112 -0
- package/template-vue-rsbuild/index.html +7 -0
- package/template-vue-rsbuild/package.json +30 -0
- package/template-vue-rsbuild/postcss.config.mjs +5 -0
- package/template-vue-rsbuild/public/.gitkeep +0 -0
- package/template-vue-rsbuild/rsbuild.config.ts +28 -0
- package/template-vue-rsbuild/src/App.vue +29 -0
- package/template-vue-rsbuild/src/env.d.ts +9 -0
- package/template-vue-rsbuild/src/index.css +6 -0
- package/template-vue-rsbuild/src/index.ts +7 -0
- package/template-vue-rsbuild/src/styles/index.css +16 -0
- package/template-vue-rsbuild/src/types/auto-import.d.ts +91 -0
- package/template-vue-rsbuild/tsconfig.json +29 -0
- package/template-vue-rsbuild/uno.config.ts +9 -0
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineConfig } from '@rsbuild/core';
|
|
2
|
+
import { pluginReact } from '@rsbuild/plugin-react';
|
|
3
|
+
import AutoImport from 'unplugin-auto-import/rspack';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
html: {
|
|
7
|
+
template: './index.html',
|
|
8
|
+
},
|
|
9
|
+
resolve: {
|
|
10
|
+
alias: {
|
|
11
|
+
'@': './src',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
server: {
|
|
15
|
+
port: process.env.PUBLIC_PORT,
|
|
16
|
+
},
|
|
17
|
+
plugins: [pluginReact()],
|
|
18
|
+
tools: {
|
|
19
|
+
rspack: {
|
|
20
|
+
plugins: [
|
|
21
|
+
AutoImport({
|
|
22
|
+
imports: ['react', 'react-router', 'react-router-dom'],
|
|
23
|
+
dts: './src/types/auto-import.d.ts',
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="@rsbuild/core/types" />
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
|
+
|
|
4
|
+
import App from './App';
|
|
5
|
+
|
|
6
|
+
import '@/styles/index.css';
|
|
7
|
+
|
|
8
|
+
import Loading from './components/Loading/PageLoading';
|
|
9
|
+
|
|
10
|
+
const rootEl = document.getElementById('root');
|
|
11
|
+
if (rootEl) {
|
|
12
|
+
const root = ReactDOM.createRoot(rootEl);
|
|
13
|
+
root.render(
|
|
14
|
+
<React.StrictMode>
|
|
15
|
+
<Suspense fallback={<Loading />}>
|
|
16
|
+
<App />
|
|
17
|
+
</Suspense>
|
|
18
|
+
</React.StrictMode>,
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { use } from 'react';
|
|
2
|
+
|
|
3
|
+
const fetchData = () => {
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
|
+
setTimeout(() => {
|
|
6
|
+
resolve({
|
|
7
|
+
data: [
|
|
8
|
+
{
|
|
9
|
+
id: 1,
|
|
10
|
+
title: 'Album 1',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 2,
|
|
14
|
+
title: 'Album 2',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
});
|
|
18
|
+
}, 1000);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const Home = () => {
|
|
23
|
+
return <h1>111</h1>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default Home;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Suspense } from 'react';
|
|
2
|
+
import { createBrowserRouter, type RouteObject } from 'react-router';
|
|
3
|
+
|
|
4
|
+
import Loading from '@/components/Loading/PageLoading';
|
|
5
|
+
|
|
6
|
+
export const lazyLoad = (path: string) => {
|
|
7
|
+
const Module = lazy(() => import(`@/pages/${path}.tsx`));
|
|
8
|
+
return (
|
|
9
|
+
<Suspense fallback={<Loading />}>
|
|
10
|
+
<Module />
|
|
11
|
+
</Suspense>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const routes: RouteObject[] = [
|
|
16
|
+
{
|
|
17
|
+
path: '/',
|
|
18
|
+
id: 'home',
|
|
19
|
+
element: lazyLoad('home/index'),
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
export const router = createBrowserRouter(routes, {
|
|
24
|
+
basename: import.meta.env.PUBLIC_PATH,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export default router;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* prettier-ignore */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
// noinspection JSUnusedGlobalSymbols
|
|
5
|
+
// Generated by unplugin-auto-import
|
|
6
|
+
// biome-ignore lint: disable
|
|
7
|
+
export {};
|
|
8
|
+
declare global {
|
|
9
|
+
const Link: typeof import('react-router-dom')['Link'];
|
|
10
|
+
const NavLink: typeof import('react-router-dom')['NavLink'];
|
|
11
|
+
const Navigate: typeof import('react-router-dom')['Navigate'];
|
|
12
|
+
const Outlet: typeof import('react-router-dom')['Outlet'];
|
|
13
|
+
const Route: typeof import('react-router-dom')['Route'];
|
|
14
|
+
const Routes: typeof import('react-router-dom')['Routes'];
|
|
15
|
+
const createRef: typeof import('react')['createRef'];
|
|
16
|
+
const forwardRef: typeof import('react')['forwardRef'];
|
|
17
|
+
const lazy: typeof import('react')['lazy'];
|
|
18
|
+
const memo: typeof import('react')['memo'];
|
|
19
|
+
const startTransition: typeof import('react')['startTransition'];
|
|
20
|
+
const useCallback: typeof import('react')['useCallback'];
|
|
21
|
+
const useContext: typeof import('react')['useContext'];
|
|
22
|
+
const useDebugValue: typeof import('react')['useDebugValue'];
|
|
23
|
+
const useDeferredValue: typeof import('react')['useDeferredValue'];
|
|
24
|
+
const useEffect: typeof import('react')['useEffect'];
|
|
25
|
+
const useHref: typeof import('react-router-dom')['useHref'];
|
|
26
|
+
const useId: typeof import('react')['useId'];
|
|
27
|
+
const useImperativeHandle: typeof import('react')['useImperativeHandle'];
|
|
28
|
+
const useInRouterContext: typeof import('react-router-dom')['useInRouterContext'];
|
|
29
|
+
const useInsertionEffect: typeof import('react')['useInsertionEffect'];
|
|
30
|
+
const useLayoutEffect: typeof import('react')['useLayoutEffect'];
|
|
31
|
+
const useLinkClickHandler: typeof import('react-router-dom')['useLinkClickHandler'];
|
|
32
|
+
const useLocation: typeof import('react-router-dom')['useLocation'];
|
|
33
|
+
const useMemo: typeof import('react')['useMemo'];
|
|
34
|
+
const useNavigate: typeof import('react-router-dom')['useNavigate'];
|
|
35
|
+
const useNavigationType: typeof import('react-router-dom')['useNavigationType'];
|
|
36
|
+
const useOutlet: typeof import('react-router-dom')['useOutlet'];
|
|
37
|
+
const useOutletContext: typeof import('react-router-dom')['useOutletContext'];
|
|
38
|
+
const useParams: typeof import('react-router-dom')['useParams'];
|
|
39
|
+
const useReducer: typeof import('react')['useReducer'];
|
|
40
|
+
const useRef: typeof import('react')['useRef'];
|
|
41
|
+
const useResolvedPath: typeof import('react-router-dom')['useResolvedPath'];
|
|
42
|
+
const useRoutes: typeof import('react-router-dom')['useRoutes'];
|
|
43
|
+
const useSearchParams: typeof import('react-router-dom')['useSearchParams'];
|
|
44
|
+
const useState: typeof import('react')['useState'];
|
|
45
|
+
const useSyncExternalStore: typeof import('react')['useSyncExternalStore'];
|
|
46
|
+
const useTransition: typeof import('react')['useTransition'];
|
|
47
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { message } from 'ant-design-vue';
|
|
2
|
+
import axios, { type AxiosResponse } from 'axios';
|
|
3
|
+
import _ from 'lodash-es';
|
|
4
|
+
|
|
5
|
+
import { router } from '@/router';
|
|
6
|
+
import { useUserStoreWithOut } from '@/store/modules/user';
|
|
7
|
+
|
|
8
|
+
export interface CustomConfig {
|
|
9
|
+
/** 直接返回响应体 */
|
|
10
|
+
isTransformResponse?: boolean;
|
|
11
|
+
// 成功需要提示
|
|
12
|
+
isShowSuccessMsg?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export enum CodeEnum {
|
|
16
|
+
SUCCESS = 200,
|
|
17
|
+
UNAUTHORIZED = 401,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const unAuthFunc = _.debounce(() => {
|
|
21
|
+
message.error('暂未登录或登录已过期,请重新登录');
|
|
22
|
+
router.push('/login');
|
|
23
|
+
}, 500);
|
|
24
|
+
|
|
25
|
+
export default (customConfig?: CustomConfig) => {
|
|
26
|
+
// const { getToken } = useUserStore()
|
|
27
|
+
const userStore = useUserStoreWithOut();
|
|
28
|
+
|
|
29
|
+
const instance = axios.create({
|
|
30
|
+
baseURL: import.meta.env.PUBLIC_API_AFFIX,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
instance.interceptors.request.use(
|
|
34
|
+
(config) => {
|
|
35
|
+
// config.headers = {
|
|
36
|
+
// 'X-Access-Token': userStore.token,
|
|
37
|
+
// 'Allow-Control-Allow-Origin': '*',
|
|
38
|
+
// ...config?.headers,
|
|
39
|
+
// } as any
|
|
40
|
+
config.headers.set('X-Access-Token', userStore.token);
|
|
41
|
+
config.headers.set('Allow-Control-Allow-Origin', '*');
|
|
42
|
+
return config;
|
|
43
|
+
},
|
|
44
|
+
(error) => {
|
|
45
|
+
message.error('请求错误');
|
|
46
|
+
return Promise.reject(error);
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
interface ResponseData<T = any> {
|
|
51
|
+
code: number;
|
|
52
|
+
message: string;
|
|
53
|
+
requestId: string;
|
|
54
|
+
responseTime: number;
|
|
55
|
+
result: T;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
instance.interceptors.response.use(
|
|
59
|
+
(response: AxiosResponse<ResponseData>) => {
|
|
60
|
+
const { status, data } = response;
|
|
61
|
+
if (status === 200) {
|
|
62
|
+
if (customConfig?.isTransformResponse === false) return data;
|
|
63
|
+
const { code, message: msg } = data;
|
|
64
|
+
if (code === CodeEnum.SUCCESS) {
|
|
65
|
+
if (customConfig?.isShowSuccessMsg) {
|
|
66
|
+
message.success(msg);
|
|
67
|
+
}
|
|
68
|
+
return data.result;
|
|
69
|
+
}
|
|
70
|
+
message.error(msg);
|
|
71
|
+
return Promise.reject(data);
|
|
72
|
+
}
|
|
73
|
+
if (status === CodeEnum.UNAUTHORIZED) {
|
|
74
|
+
// _.debounce(() => {
|
|
75
|
+
message.error(data.message);
|
|
76
|
+
router.push('/login');
|
|
77
|
+
// }, 500)
|
|
78
|
+
} else return Promise.reject(data.message);
|
|
79
|
+
},
|
|
80
|
+
(error) => {
|
|
81
|
+
const response = error.response;
|
|
82
|
+
const { status, data } = response;
|
|
83
|
+
if (status === CodeEnum.UNAUTHORIZED) {
|
|
84
|
+
unAuthFunc();
|
|
85
|
+
} else {
|
|
86
|
+
message.error(data?.message || '系统异常');
|
|
87
|
+
return Promise.reject(error);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
return instance;
|
|
93
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
+
|
|
3
|
+
import request, { type CustomConfig } from './axios';
|
|
4
|
+
|
|
5
|
+
interface createAxiosType {
|
|
6
|
+
get: (
|
|
7
|
+
config: {
|
|
8
|
+
url: string;
|
|
9
|
+
params?: AxiosRequestConfig['params'];
|
|
10
|
+
config?: AxiosRequestConfig<any>;
|
|
11
|
+
},
|
|
12
|
+
option?: CustomConfig,
|
|
13
|
+
) => Promise<any>;
|
|
14
|
+
post: (
|
|
15
|
+
config: {
|
|
16
|
+
url: string;
|
|
17
|
+
data?: AxiosRequestConfig['data'];
|
|
18
|
+
config?: AxiosRequestConfig<any>;
|
|
19
|
+
},
|
|
20
|
+
option?: CustomConfig,
|
|
21
|
+
) => Promise<any>;
|
|
22
|
+
put: (
|
|
23
|
+
config: {
|
|
24
|
+
url: string;
|
|
25
|
+
data?: AxiosRequestConfig['data'];
|
|
26
|
+
config?: AxiosRequestConfig<any>;
|
|
27
|
+
},
|
|
28
|
+
option?: CustomConfig,
|
|
29
|
+
) => Promise<any>;
|
|
30
|
+
delete: (
|
|
31
|
+
config: {
|
|
32
|
+
url: string;
|
|
33
|
+
data?: AxiosRequestConfig['data'];
|
|
34
|
+
config?: AxiosRequestConfig<any>;
|
|
35
|
+
},
|
|
36
|
+
option?: CustomConfig,
|
|
37
|
+
) => Promise<any>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const createAxios: createAxiosType = {
|
|
41
|
+
get: (config, option) =>
|
|
42
|
+
request(option).get(config.url, {
|
|
43
|
+
params: config.params,
|
|
44
|
+
...config?.config,
|
|
45
|
+
}),
|
|
46
|
+
post: (
|
|
47
|
+
config: { url: string; data?: any; config?: AxiosRequestConfig<any> },
|
|
48
|
+
option?: CustomConfig,
|
|
49
|
+
) => request(option).post(config.url, config?.data, config?.config),
|
|
50
|
+
put: (
|
|
51
|
+
config: { url: string; data?: any; config?: AxiosRequestConfig<any> },
|
|
52
|
+
option?: CustomConfig,
|
|
53
|
+
) => request(option).put(config.url, config?.data, config?.config),
|
|
54
|
+
delete: (
|
|
55
|
+
config: { url: string; config?: AxiosRequestConfig<any> },
|
|
56
|
+
customConfig?: CustomConfig,
|
|
57
|
+
) => request(customConfig).delete(config.url, config?.config),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default createAxios;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": ["DOM", "ES2020"],
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"target": "ES2020",
|
|
6
|
+
"noEmit": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"useDefineForClassFields": true,
|
|
9
|
+
|
|
10
|
+
/* modules */
|
|
11
|
+
"module": "ESNext",
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"moduleResolution": "Bundler",
|
|
15
|
+
"allowImportingTsExtensions": true,
|
|
16
|
+
|
|
17
|
+
/* type checking */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
|
|
22
|
+
"baseUrl": "./",
|
|
23
|
+
"paths": {
|
|
24
|
+
"@/*": ["src/*"]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"include": ["src"],
|
|
28
|
+
"exclude": ["node_modules", "dist"]
|
|
29
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"singleQuote": true,
|
|
3
|
+
"jsxSingleQuote": false,
|
|
4
|
+
"trailingComma": "all",
|
|
5
|
+
"printWidth": 100,
|
|
6
|
+
"proseWrap": "never",
|
|
7
|
+
"importOrder": ["^(vue|vue-router)$", "^([a-z]|@[a-z])", "", ".*"],
|
|
8
|
+
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
|
|
9
|
+
"overrides": [
|
|
10
|
+
{
|
|
11
|
+
"files": ".prettierrc",
|
|
12
|
+
"options": {
|
|
13
|
+
"parser": "json"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": {
|
|
3
|
+
"ignoreUnknown": true,
|
|
4
|
+
"ignore": [
|
|
5
|
+
".dumi/tmp*",
|
|
6
|
+
".dumi/scripts/clarity.js",
|
|
7
|
+
"dist/*",
|
|
8
|
+
"es/**/*",
|
|
9
|
+
"lib/**/*",
|
|
10
|
+
"_site/**/*",
|
|
11
|
+
"node_modules",
|
|
12
|
+
"server",
|
|
13
|
+
"scripts/previewEditor/**/*",
|
|
14
|
+
"package.json"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"formatter": {
|
|
18
|
+
"enabled": true,
|
|
19
|
+
"indentStyle": "space",
|
|
20
|
+
"lineWidth": 100,
|
|
21
|
+
"indentWidth": 2
|
|
22
|
+
},
|
|
23
|
+
"javascript": {
|
|
24
|
+
"formatter": {
|
|
25
|
+
"quoteStyle": "single"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"organizeImports": {
|
|
29
|
+
"enabled": false
|
|
30
|
+
},
|
|
31
|
+
"linter": {
|
|
32
|
+
"rules": {
|
|
33
|
+
"style": {
|
|
34
|
+
"useImportType": "off",
|
|
35
|
+
"useNumberNamespace": "off",
|
|
36
|
+
"useNodejsImportProtocol": "off",
|
|
37
|
+
"noNonNullAssertion": "off",
|
|
38
|
+
"noUnusedTemplateLiteral": "off"
|
|
39
|
+
},
|
|
40
|
+
"complexity": {
|
|
41
|
+
"noUselessTypeConstraint": "off",
|
|
42
|
+
"noForEach": "off"
|
|
43
|
+
},
|
|
44
|
+
"correctness": {
|
|
45
|
+
"useExhaustiveDependencies": "off"
|
|
46
|
+
},
|
|
47
|
+
"suspicious": {
|
|
48
|
+
"noGlobalIsNan": "off",
|
|
49
|
+
"noGlobalIsFinite": "off",
|
|
50
|
+
"noExplicitAny": "off",
|
|
51
|
+
"noArrayIndexKey": "off",
|
|
52
|
+
"noConfusingVoidType": "off",
|
|
53
|
+
"noThenProperty": "off"
|
|
54
|
+
},
|
|
55
|
+
"performance": {
|
|
56
|
+
"noDelete": "off",
|
|
57
|
+
"noAccumulatingSpread": "off"
|
|
58
|
+
},
|
|
59
|
+
"a11y": {
|
|
60
|
+
"noAriaHiddenOnFocusable": "off",
|
|
61
|
+
"noLabelWithoutControl": "off",
|
|
62
|
+
"useFocusableInteractive": "off",
|
|
63
|
+
"useKeyWithClickEvents": "off",
|
|
64
|
+
"useSemanticElements": "off"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"css": {
|
|
69
|
+
"formatter": {
|
|
70
|
+
"quoteStyle": "single"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"overrides": [
|
|
74
|
+
{
|
|
75
|
+
"include": ["**/*.test.ts", "**/*.test.tsx", "tests/**/*", "scripts/**/*", ".dumi/**/*"],
|
|
76
|
+
"linter": {
|
|
77
|
+
"rules": {
|
|
78
|
+
"style": {
|
|
79
|
+
"noParameterAssign": "off"
|
|
80
|
+
},
|
|
81
|
+
"suspicious": {
|
|
82
|
+
"noThenProperty": "off",
|
|
83
|
+
"noImplicitAnyLet": "off"
|
|
84
|
+
},
|
|
85
|
+
"complexity": {
|
|
86
|
+
"noUselessFragments": "off"
|
|
87
|
+
},
|
|
88
|
+
"a11y": {
|
|
89
|
+
"useValidAnchor": "off",
|
|
90
|
+
"useAnchorContent": "off",
|
|
91
|
+
"useKeyWithClickEvents": "off"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"include": ["components/*/demo/*"],
|
|
98
|
+
"linter": {
|
|
99
|
+
"rules": {
|
|
100
|
+
"correctness": {
|
|
101
|
+
"noVoidTypeReturn": "off"
|
|
102
|
+
},
|
|
103
|
+
"a11y": {
|
|
104
|
+
"useValidAnchor": "off",
|
|
105
|
+
"useAnchorContent": "off",
|
|
106
|
+
"useKeyWithClickEvents": "off"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template-vue",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rsbuild build",
|
|
8
|
+
"check": "biome check --write",
|
|
9
|
+
"dev": "rsbuild dev --open",
|
|
10
|
+
"format": "prettier --write .",
|
|
11
|
+
"preview": "rsbuild preview"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"pinia": "^3.0.1",
|
|
15
|
+
"vue": "^3.5.13",
|
|
16
|
+
"vue-router": "^4.5.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@biomejs/biome": "^1.9.4",
|
|
20
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
21
|
+
"@rsbuild/core": "^1.2.4",
|
|
22
|
+
"@rsbuild/plugin-vue": "^1.0.5",
|
|
23
|
+
"@unocss/postcss": "^65.5.0",
|
|
24
|
+
"lefthook": "^1.10.1",
|
|
25
|
+
"prettier": "^3.4.2",
|
|
26
|
+
"typescript": "^5.7.3",
|
|
27
|
+
"unocss": "^65.5.0",
|
|
28
|
+
"unplugin-auto-import": "^19.1.0"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineConfig } from '@rsbuild/core';
|
|
2
|
+
import { pluginVue } from '@rsbuild/plugin-vue';
|
|
3
|
+
import AutoImport from 'unplugin-auto-import/rspack';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
html: {
|
|
7
|
+
template: './index.html',
|
|
8
|
+
},
|
|
9
|
+
resolve: {
|
|
10
|
+
alias: {
|
|
11
|
+
'@': './src',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
server: {
|
|
15
|
+
port: process.env.PUBLIC_PORT,
|
|
16
|
+
},
|
|
17
|
+
plugins: [pluginVue()],
|
|
18
|
+
tools: {
|
|
19
|
+
rspack: {
|
|
20
|
+
plugins: [
|
|
21
|
+
AutoImport({
|
|
22
|
+
imports: ['vue', 'vue-router'],
|
|
23
|
+
dts: './src/types/auto-import.d.ts',
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="content">
|
|
3
|
+
<h1 class="text-#fff">Rsbuild with Vue</h1>
|
|
4
|
+
<p class="text-50px text-amber">Start building amazing things with Rsbuild.</p>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<style scoped>
|
|
9
|
+
.content {
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100vh;
|
|
12
|
+
line-height: 1.1;
|
|
13
|
+
text-align: center;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
background-color: #000;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.content h1 {
|
|
20
|
+
font-size: 3.6rem;
|
|
21
|
+
font-weight: 700;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.content p {
|
|
25
|
+
font-size: 1.2rem;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
opacity: 0.5;
|
|
28
|
+
}
|
|
29
|
+
</style>
|