create-packer 1.31.3 → 1.32.1
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/bin/createTemp.js +1 -2
- package/bin/utils/index.js +4 -5
- package/package.json +2 -2
- package/template/docusaurus/package.json +1 -1
- package/template/lib/react/package.json +3 -3
- package/template/lib/ts/package.json +1 -1
- package/template/nest/package.json +1 -1
- package/template/web-app/next/package.json +47 -47
- package/template/web-app/react/.gitignore +1 -0
- package/template/web-app/react/.stylelintrc +3 -7
- package/template/web-app/react/.vscode/extensions.json +3 -2
- package/template/web-app/react/.vscode/settings.json +18 -0
- package/template/web-app/react/domain/app/app.styled.ts +3 -0
- package/template/web-app/react/domain/app/components/app-context.tsx +17 -0
- package/template/web-app/react/domain/app/components/app.tsx +8 -7
- package/template/web-app/react/domain/app/components/index.ts +1 -1
- package/template/web-app/react/index.html +1 -1
- package/template/web-app/react/main.tsx +1 -2
- package/template/web-app/react/package.json +80 -78
- package/template/web-app/react/pages/home/home.styled.ts +7 -0
- package/template/web-app/react/pages/home/home.tsx +6 -9
- package/template/web-app/react/pages/index.tsx +4 -8
- package/template/web-app/react/postcss.config.cjs +0 -2
- package/template/web-app/react/shared/service/home.ts +10 -0
- package/template/web-app/react/shared/service/index.ts +2 -1
- package/template/web-app/react/shared/service/request.ts +1 -3
- package/template/web-app/react/shared/theme/index.ts +1 -0
- package/template/web-app/react/shared/theme/theme.styled.ts +56 -0
- package/template/web-app/react/vite-env.d.ts +6 -0
- package/template/web-app/react/vite.config.ts +3 -6
- package/template/web-app/react-webpack/.gitignore +1 -0
- package/template/web-app/react-webpack/.stylelintrc +3 -7
- package/template/web-app/react-webpack/.vscode/extensions.json +3 -2
- package/template/web-app/react-webpack/.vscode/settings.json +18 -0
- package/template/web-app/react-webpack/domain/app/app.styled.ts +3 -0
- package/template/web-app/react-webpack/domain/app/components/app-context.tsx +17 -0
- package/template/web-app/react-webpack/domain/app/components/app.tsx +8 -7
- package/template/web-app/react-webpack/domain/app/components/index.ts +1 -1
- package/template/web-app/react-webpack/global.d.ts +11 -2
- package/template/web-app/react-webpack/index.html +1 -1
- package/template/web-app/react-webpack/main.tsx +1 -2
- package/template/web-app/react-webpack/package.json +88 -86
- package/template/web-app/react-webpack/pages/home/home.styled.ts +7 -0
- package/template/web-app/react-webpack/pages/home/home.tsx +7 -3
- package/template/web-app/react-webpack/pages/index.tsx +4 -8
- package/template/web-app/react-webpack/postcss.config.js +0 -2
- package/template/web-app/react-webpack/shared/service/home.ts +8 -0
- package/template/web-app/react-webpack/shared/service/index.ts +2 -1
- package/template/web-app/react-webpack/shared/service/request.ts +1 -3
- package/template/web-app/react-webpack/shared/theme/index.ts +1 -0
- package/template/web-app/react-webpack/shared/theme/theme.styled.ts +56 -0
- package/template/web-app/solid/package.json +51 -51
- package/template/web-app/svelte/package.json +12 -8
- package/template/web-app/svelte/svelte.config.js +3 -4
- package/template/web-app/svelte/vite-env.d.ts +0 -1
- package/template/web-app/svelte/vite.config.ts +7 -1
- package/template/web-app/vue/.stylelintrc +1 -1
- package/template/web-app/vue/index.html +1 -1
- package/template/web-app/vue/main.ts +2 -1
- package/template/web-app/vue/package.json +71 -70
- package/template/web-app/vue/pages/home/home.vue +10 -7
- package/template/web-app/vue/shared/service/home.ts +10 -0
- package/template/web-app/vue/shared/service/index.ts +2 -1
- package/template/web-app/vue/shared/service/request.ts +1 -3
- package/template/web-app/vue/tailwind.config.cjs +0 -1
- package/template/web-app/vue/vite.config.ts +2 -5
- package/template/web-extension/.env +1 -0
- package/template/web-extension/.eslintrc +34 -9
- package/template/web-extension/.gitignore +1 -0
- package/template/web-extension/.stylelintrc +3 -7
- package/template/web-extension/.vscode/extensions.json +3 -2
- package/template/web-extension/.vscode/settings.json +18 -0
- package/template/web-extension/content_script/constants/base.ts +1 -0
- package/template/web-extension/content_script/constants/index.ts +1 -0
- package/template/web-extension/content_script/domain/app/index.ts +1 -0
- package/template/web-extension/content_script/domain/app/tools/index.ts +1 -0
- package/template/web-extension/content_script/domain/app/tools/insertApp.tsx +55 -0
- package/template/web-extension/content_script/index.tsx +2 -14
- package/template/web-extension/content_script/modules/common/common.tsx +10 -0
- package/template/web-extension/content_script/modules/common/index.ts +2 -0
- package/template/web-extension/content_script/modules/common/insert.tsx +9 -0
- package/template/web-extension/content_script/modules/index.ts +1 -0
- package/template/web-extension/defineManifest.ts +1 -1
- package/template/web-extension/package.json +78 -76
- package/template/web-extension/popup/index.tsx +3 -1
- package/template/web-extension/popup/popup.container.tsx +1 -3
- package/template/web-extension/postcss.config.cjs +0 -2
- package/template/web-extension/shared/components/app-context.tsx +14 -0
- package/template/web-extension/shared/components/index.ts +1 -0
- package/template/web-extension/shared/service/request.ts +3 -3
- package/template/web-extension/shared/styles/global.styled.ts +8 -0
- package/template/web-extension/shared/styles/index.ts +2 -0
- package/template/web-extension/shared/styles/theme.styled.ts +56 -0
- package/template/web-extension/tsconfig.json +23 -7
- package/template/web-extension/vite-env.d.ts +7 -0
- package/template/web-extension/vite.config.ts +2 -5
- package/template/workspace/pnpm/node_modules/.pnpm/node_modules/test/.gitignore +25 -0
- package/template/workspace/pnpm/package.json +1 -1
- package/template/workspace/pnpm/scripts/build.ts +9 -3
- package/template/workspace/pnpm/tsconfig.json +7 -3
- package/template/web-app/react/index.css +0 -3
- package/template/web-app/react/pages/home/home.css +0 -1
- package/template/web-app/react/tailwind.config.cjs +0 -18
- package/template/web-app/react-webpack/pages/home/home.module.css +0 -3
- package/template/web-app/react-webpack/tailwind.config.js +0 -18
- package/template/web-extension/content_script/content.css +0 -3
- package/template/web-extension/content_script/content.tsx +0 -5
- package/template/web-extension/domain/app/components/app-context.tsx +0 -10
- package/template/web-extension/domain/app/components/index.ts +0 -1
- package/template/web-extension/domain/app/index.ts +0 -1
- package/template/web-extension/popup/popup.css +0 -3
- package/template/web-extension/shared/service/tools/base.ts +0 -43
- package/template/web-extension/shared/service/tools/createRequestActions.ts +0 -80
- package/template/web-extension/shared/service/tools/createService.ts +0 -50
- package/template/web-extension/shared/service/tools/hooks.ts +0 -73
- package/template/web-extension/shared/service/tools/index.ts +0 -4
- package/template/web-extension/shared/service/types.ts +0 -42
- package/template/web-extension/tailwind.config.cjs +0 -14
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CSSProperties } from 'react'
|
|
2
|
+
import { AnyFunc } from '1k-types'
|
|
3
|
+
import { isString } from 'lodash-es'
|
|
4
|
+
|
|
5
|
+
export const theme = {
|
|
6
|
+
tools: {
|
|
7
|
+
ellipsis: () => ({
|
|
8
|
+
overflow: 'hidden',
|
|
9
|
+
textOverflow: 'ellipsis',
|
|
10
|
+
whiteSpace: 'nowrap'
|
|
11
|
+
}),
|
|
12
|
+
lineClamp: (n: number) => ({
|
|
13
|
+
'-webkit-line-clamp': `${n}`,
|
|
14
|
+
'-webkit-box-orient': 'vertical',
|
|
15
|
+
overflow: 'hidden',
|
|
16
|
+
display: '-webkit-box'
|
|
17
|
+
}),
|
|
18
|
+
size: (s: string) => ({ width: s, height: s }),
|
|
19
|
+
py: (s: string) => ({ paddingTop: s, paddingBottom: s }),
|
|
20
|
+
px: (s: string) => ({ paddingLeft: s, paddingRight: s }),
|
|
21
|
+
my: (s: string) => ({ marginTop: s, marginBottom: s }),
|
|
22
|
+
mx: (s: string) => ({ marginLeft: s, marginRight: s }),
|
|
23
|
+
flex: (
|
|
24
|
+
align: CSSProperties['alignItems'],
|
|
25
|
+
justify: CSSProperties['justifyContent'],
|
|
26
|
+
vertical?: boolean
|
|
27
|
+
) => {
|
|
28
|
+
return {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
alignItems: align,
|
|
31
|
+
justifyContent: justify,
|
|
32
|
+
flexDirection: vertical ? 'column' : 'row'
|
|
33
|
+
} satisfies CSSProperties
|
|
34
|
+
},
|
|
35
|
+
/** 数字为元素数量,字符串为对应css的值 */
|
|
36
|
+
grid: {
|
|
37
|
+
grid: (rows: number | string, cols: number | string, gap?: number) => ({
|
|
38
|
+
display: 'grid',
|
|
39
|
+
gridTemplateRows: isString(rows) ? rows : `repeat(${rows}, minmax(0, 1fr))`,
|
|
40
|
+
gridTemplateColumns: isString(cols) ? cols : `repeat(${cols}, minmax(0, 1fr))`,
|
|
41
|
+
gap: gap ? `${gap}px` : void 0
|
|
42
|
+
}),
|
|
43
|
+
rows: (rows: number | string, gap?: number) => ({
|
|
44
|
+
display: 'grid',
|
|
45
|
+
gridTemplateRows: isString(rows) ? rows : `repeat(${rows}, minmax(0, 1fr))`,
|
|
46
|
+
rowGap: gap ? `${gap}px` : void 0
|
|
47
|
+
}),
|
|
48
|
+
cols: (cols: number | string, gap?: number) => ({
|
|
49
|
+
display: 'grid',
|
|
50
|
+
gridTemplateColumns: isString(cols) ? cols : `repeat(${cols}, minmax(0, 1fr))`,
|
|
51
|
+
columnGap: gap ? `${gap}px` : void 0
|
|
52
|
+
})
|
|
53
|
+
} satisfies Record<string, AnyFunc<CSSProperties>>
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export type themeType = typeof theme
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
/// <reference types="vite-plugin-svgr/client" />
|
|
3
|
+
import 'styled-components'
|
|
4
|
+
import { themeType } from './shared/theme'
|
|
3
5
|
|
|
4
6
|
interface ImportMetaEnv {
|
|
5
7
|
readonly VITE_BASE_URL: string
|
|
@@ -10,3 +12,7 @@ interface ImportMetaEnv {
|
|
|
10
12
|
interface ImportMeta {
|
|
11
13
|
readonly env: ImportMetaEnv
|
|
12
14
|
}
|
|
15
|
+
|
|
16
|
+
declare module 'styled-components' {
|
|
17
|
+
export interface DefaultTheme extends themeType {}
|
|
18
|
+
}
|
|
@@ -3,7 +3,7 @@ import react from '@vitejs/plugin-react'
|
|
|
3
3
|
import svgr from 'vite-plugin-svgr'
|
|
4
4
|
import mockDevServer from 'vite-plugin-mock-dev-server'
|
|
5
5
|
import stylelint from 'vite-plugin-stylelint'
|
|
6
|
-
import
|
|
6
|
+
import eslint from '@rollup/plugin-eslint'
|
|
7
7
|
import { visualizer } from 'rollup-plugin-visualizer'
|
|
8
8
|
import { includes } from 'lodash-es'
|
|
9
9
|
import { createChunks } from './scripts'
|
|
@@ -14,11 +14,8 @@ export default defineConfig(({ mode }) => {
|
|
|
14
14
|
const proxyBaseUrl = env.VITE_BASE_URL + env.VITE_API_HOST
|
|
15
15
|
const plugins: any[] = [
|
|
16
16
|
svgr(),
|
|
17
|
-
stylelint({ cache: false, include: ['**/*.{css,scss,sass,less,styl,
|
|
18
|
-
|
|
19
|
-
eslintOptions: { cache: false, useEslintrc: true },
|
|
20
|
-
shouldLint: path => /\/[^?]*\.(vue|svelte|m?[jt]sx?)$/.test(path)
|
|
21
|
-
}),
|
|
17
|
+
stylelint({ cache: false, include: ['**/*.{css,scss,sass,less,styl,ts,tsx}'] }),
|
|
18
|
+
eslint({ include: ['**/*.{ts,tsx,js,jsx}'] }),
|
|
22
19
|
react(),
|
|
23
20
|
mockDevServer({
|
|
24
21
|
include: ['**/*.mock.{ts,js}']
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "stylelint-config-standard-scss",
|
|
3
|
+
"customSyntax": "postcss-styled-syntax",
|
|
3
4
|
"rules": {
|
|
4
5
|
"comment-empty-line-before": "never",
|
|
5
6
|
"no-empty-source": null,
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
"at-rule-no-unknown": [
|
|
9
10
|
true,
|
|
10
11
|
{
|
|
11
|
-
"ignoreAtRules": ["
|
|
12
|
+
"ignoreAtRules": ["use"]
|
|
12
13
|
}
|
|
13
14
|
],
|
|
14
15
|
"declaration-block-no-redundant-longhand-properties": null,
|
|
@@ -19,11 +20,6 @@
|
|
|
19
20
|
}
|
|
20
21
|
],
|
|
21
22
|
"selector-class-pattern": null,
|
|
22
|
-
"scss/at-rule-no-unknown":
|
|
23
|
-
true,
|
|
24
|
-
{
|
|
25
|
-
"ignoreAtRules": ["tailwind", "a pply"]
|
|
26
|
-
}
|
|
27
|
-
]
|
|
23
|
+
"scss/at-rule-no-unknown": true
|
|
28
24
|
}
|
|
29
25
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react'
|
|
2
|
+
import { ThemeProvider } from 'styled-components'
|
|
3
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
4
|
+
import { theme } from '@/shared/theme'
|
|
5
|
+
|
|
6
|
+
const queryClient = new QueryClient()
|
|
7
|
+
|
|
8
|
+
export interface propsType {
|
|
9
|
+
children: React.ReactNode
|
|
10
|
+
}
|
|
11
|
+
export const Root: FunctionComponent<propsType> = props => {
|
|
12
|
+
return (
|
|
13
|
+
<QueryClientProvider client={queryClient}>
|
|
14
|
+
<ThemeProvider theme={theme}>{props.children}</ThemeProvider>
|
|
15
|
+
</QueryClientProvider>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLayoutEffect } from 'react'
|
|
2
2
|
import { RouterProvider } from 'react-router-dom'
|
|
3
3
|
import { request } from '@/shared/service'
|
|
4
4
|
import { routerInstance } from '@/domain/router'
|
|
5
|
+
import { GlobalStyle } from '../app.styled'
|
|
6
|
+
import * as AppContext from './app-context'
|
|
5
7
|
|
|
6
|
-
const
|
|
8
|
+
export const Root = () => {
|
|
7
9
|
useLayoutEffect(() => {
|
|
8
10
|
request.interceptors.response.use(
|
|
9
11
|
res => res,
|
|
@@ -14,10 +16,9 @@ const App = () => {
|
|
|
14
16
|
}, [])
|
|
15
17
|
|
|
16
18
|
return (
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
|
|
19
|
+
<AppContext.Root>
|
|
20
|
+
<GlobalStyle />
|
|
21
|
+
<RouterProvider router={routerInstance} fallbackElement={<>loading...</>} />
|
|
22
|
+
</AppContext.Root>
|
|
20
23
|
)
|
|
21
24
|
}
|
|
22
|
-
|
|
23
|
-
export default App
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * as App from './app'
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import 'styled-components'
|
|
2
|
+
import { themeType } from './shared/theme'
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
const ENV_BASE_URL: string
|
|
6
|
+
const ENV_API_HOST: string
|
|
7
|
+
}
|
|
3
8
|
|
|
4
9
|
declare module '*.css'
|
|
5
10
|
declare module '*.less'
|
|
@@ -15,3 +20,7 @@ declare module '*.svg' {
|
|
|
15
20
|
function ReactComponent(props: React.SVGProps<SVGSVGElement>): React.ReactElement
|
|
16
21
|
export default ReactComponent
|
|
17
22
|
}
|
|
23
|
+
|
|
24
|
+
declare module 'styled-components' {
|
|
25
|
+
export interface DefaultTheme extends themeType {}
|
|
26
|
+
}
|
|
@@ -1,86 +1,88 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-app-webpack",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"main": "./dist/index",
|
|
5
|
-
"module": "./dist/index.esm.js",
|
|
6
|
-
"private": true,
|
|
7
|
-
"author": "1K",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"prepare": "husky install",
|
|
10
|
-
"dev": "webpack serve --env mode=dev",
|
|
11
|
-
"build": "webpack --env mode=prod",
|
|
12
|
-
"build:analyzer": "webpack --env mode=analyzer",
|
|
13
|
-
"up:webpack": "pnpm up webpackbar webpackbar-* -L",
|
|
14
|
-
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
15
|
-
"lint": "tsc --noEmit && eslint **/*.{tsx,ts,jsx,js} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
|
|
16
|
-
"lint:fix": "eslint **/*.{tsx,ts,jsx,js} --fix && stylelint **/*.{css,scss,less} --fix",
|
|
17
|
-
"cz": "cz",
|
|
18
|
-
"push": "npm run commit && git push",
|
|
19
|
-
"commit": "git add . && npm run cz"
|
|
20
|
-
},
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"1k-types": "1.2.0",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"react
|
|
30
|
-
"react-
|
|
31
|
-
"react-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"@commitlint/
|
|
38
|
-
"@commitlint/
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@types/
|
|
42
|
-
"@types/
|
|
43
|
-
"@types/react
|
|
44
|
-
"@
|
|
45
|
-
"@typescript-eslint/
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"eslint
|
|
54
|
-
"eslint-
|
|
55
|
-
"eslint-plugin-
|
|
56
|
-
"eslint-plugin-
|
|
57
|
-
"eslint-plugin-react
|
|
58
|
-
"eslint-
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"postcss-
|
|
65
|
-
"postcss-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"stylelint
|
|
74
|
-
"
|
|
75
|
-
"webpack": "5.
|
|
76
|
-
"
|
|
77
|
-
"webpack
|
|
78
|
-
"webpack-
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-app-webpack",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "./dist/index",
|
|
5
|
+
"module": "./dist/index.esm.js",
|
|
6
|
+
"private": true,
|
|
7
|
+
"author": "1K",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"prepare": "husky install",
|
|
10
|
+
"dev": "webpack serve --env mode=dev",
|
|
11
|
+
"build": "webpack --env mode=prod",
|
|
12
|
+
"build:analyzer": "webpack --env mode=analyzer",
|
|
13
|
+
"up:webpack": "pnpm up webpackbar webpackbar-* -L",
|
|
14
|
+
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
15
|
+
"lint": "tsc --noEmit && eslint **/*.{tsx,ts,jsx,js} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,ts,tsx}",
|
|
16
|
+
"lint:fix": "eslint **/*.{tsx,ts,jsx,js} --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
|
|
17
|
+
"cz": "cz",
|
|
18
|
+
"push": "npm run commit && git push",
|
|
19
|
+
"commit": "git add . && npm run cz"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"1k-types": "1.2.0",
|
|
23
|
+
"@tanstack/react-query": "5.51.15",
|
|
24
|
+
"axios": "1.6.7",
|
|
25
|
+
"define-zustand": "3.1.1",
|
|
26
|
+
"immer": "10.0.3",
|
|
27
|
+
"lodash-es": "4.17.21",
|
|
28
|
+
"qs": "6.11.2",
|
|
29
|
+
"react": "18.3.1",
|
|
30
|
+
"react-dom": "18.3.1",
|
|
31
|
+
"react-router-dom": "6.14.0",
|
|
32
|
+
"react-use": "17.5.0",
|
|
33
|
+
"styled-components": "6.1.11",
|
|
34
|
+
"zustand": "4.4.1"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@commitlint/cli": "18.6.1",
|
|
38
|
+
"@commitlint/config-conventional": "18.6.2",
|
|
39
|
+
"@commitlint/cz-commitlint": "18.6.1",
|
|
40
|
+
"@svgr/webpack": "8.1.0",
|
|
41
|
+
"@types/lodash-es": "4.17.12",
|
|
42
|
+
"@types/qs": "6.9.11",
|
|
43
|
+
"@types/react": "18.3.3",
|
|
44
|
+
"@types/react-dom": "18.3.0",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "7.0.2",
|
|
46
|
+
"@typescript-eslint/parser": "7.0.2",
|
|
47
|
+
"autoprefixer": "10.4.17",
|
|
48
|
+
"commitizen": "4.3.0",
|
|
49
|
+
"css-loader": "6.10.0",
|
|
50
|
+
"cssnano": "6.0.3",
|
|
51
|
+
"dotenv": "16.4.5",
|
|
52
|
+
"esbuild-loader": "^3.2.0",
|
|
53
|
+
"eslint": "8.56.0",
|
|
54
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
|
55
|
+
"eslint-plugin-import": "2.29.1",
|
|
56
|
+
"eslint-plugin-prettier": "5.1.3",
|
|
57
|
+
"eslint-plugin-react": "7.33.2",
|
|
58
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
59
|
+
"eslint-webpack-plugin": "4.0.1",
|
|
60
|
+
"fork-ts-checker-webpack-plugin": "9.0.2",
|
|
61
|
+
"html-webpack-plugin": "5.6.0",
|
|
62
|
+
"husky": "9.0.11",
|
|
63
|
+
"mini-css-extract-plugin": "2.8.0",
|
|
64
|
+
"postcss-import": "16.0.1",
|
|
65
|
+
"postcss-loader": "8.1.0",
|
|
66
|
+
"postcss-nesting": "12.0.3",
|
|
67
|
+
"postcss-styled-syntax": "0.6.4",
|
|
68
|
+
"prettier": "3.2.5",
|
|
69
|
+
"react-css-modules": "4.7.11",
|
|
70
|
+
"react-test-renderer": "18.2.0",
|
|
71
|
+
"rimraf": "5.0.5",
|
|
72
|
+
"style-loader": "3.3.4",
|
|
73
|
+
"stylelint": "16.2.1",
|
|
74
|
+
"stylelint-config-standard-scss": "13.0.0",
|
|
75
|
+
"stylelint-webpack-plugin": "5.0.0",
|
|
76
|
+
"typescript": "5.5.2",
|
|
77
|
+
"webpack": "5.91.0",
|
|
78
|
+
"webpack-bundle-analyzer": "4.10.1",
|
|
79
|
+
"webpack-cli": "5.1.4",
|
|
80
|
+
"webpack-dev-server": "5.0.4",
|
|
81
|
+
"webpackbar": "6.0.1"
|
|
82
|
+
},
|
|
83
|
+
"config": {
|
|
84
|
+
"commitizen": {
|
|
85
|
+
"path": "@commitlint/cz-commitlint"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useHomeQuery } from '@/shared/service'
|
|
2
|
+
import { StyledRoot } from './home.styled'
|
|
2
3
|
|
|
3
4
|
export default function Home() {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
const homeQuery = useHomeQuery()
|
|
6
|
+
|
|
7
|
+
console.log('data', homeQuery.data?.data)
|
|
8
|
+
|
|
9
|
+
return <StyledRoot>sdsddds</StyledRoot>
|
|
6
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect } from 'react'
|
|
2
2
|
import { Outlet, useLocation } from 'react-router-dom'
|
|
3
3
|
import { useRouter, routerIds } from '@/domain/router'
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const Layout = () => {
|
|
6
6
|
const location = useLocation()
|
|
7
7
|
const navigate = useRouter(state => state.navigate)
|
|
8
8
|
|
|
@@ -12,11 +12,7 @@ const View = () => {
|
|
|
12
12
|
}
|
|
13
13
|
}, [location])
|
|
14
14
|
|
|
15
|
-
return
|
|
16
|
-
<Suspense fallback={<>loading...</>}>
|
|
17
|
-
<Outlet />
|
|
18
|
-
</Suspense>
|
|
19
|
-
)
|
|
15
|
+
return <Outlet />
|
|
20
16
|
}
|
|
21
17
|
|
|
22
|
-
export default
|
|
18
|
+
export default Layout
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './request'
|
|
2
|
+
export * from './home'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './theme.styled'
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CSSProperties } from 'react'
|
|
2
|
+
import { AnyFunc } from '1k-types'
|
|
3
|
+
import { isString } from 'lodash-es'
|
|
4
|
+
|
|
5
|
+
export const theme = {
|
|
6
|
+
tools: {
|
|
7
|
+
ellipsis: () => ({
|
|
8
|
+
overflow: 'hidden',
|
|
9
|
+
textOverflow: 'ellipsis',
|
|
10
|
+
whiteSpace: 'nowrap'
|
|
11
|
+
}),
|
|
12
|
+
lineClamp: (n: number) => ({
|
|
13
|
+
'-webkit-line-clamp': `${n}`,
|
|
14
|
+
'-webkit-box-orient': 'vertical',
|
|
15
|
+
overflow: 'hidden',
|
|
16
|
+
display: '-webkit-box'
|
|
17
|
+
}),
|
|
18
|
+
size: (s: string) => ({ width: s, height: s }),
|
|
19
|
+
py: (s: string) => ({ paddingTop: s, paddingBottom: s }),
|
|
20
|
+
px: (s: string) => ({ paddingLeft: s, paddingRight: s }),
|
|
21
|
+
my: (s: string) => ({ marginTop: s, marginBottom: s }),
|
|
22
|
+
mx: (s: string) => ({ marginLeft: s, marginRight: s }),
|
|
23
|
+
flex: (
|
|
24
|
+
align: CSSProperties['alignItems'],
|
|
25
|
+
justify: CSSProperties['justifyContent'],
|
|
26
|
+
vertical?: boolean
|
|
27
|
+
) => {
|
|
28
|
+
return {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
alignItems: align,
|
|
31
|
+
justifyContent: justify,
|
|
32
|
+
flexDirection: vertical ? 'column' : 'row'
|
|
33
|
+
} satisfies CSSProperties
|
|
34
|
+
},
|
|
35
|
+
/** 数字为元素数量,字符串为对应css的值 */
|
|
36
|
+
grid: {
|
|
37
|
+
grid: (rows: number | string, cols: number | string, gap?: number) => ({
|
|
38
|
+
display: 'grid',
|
|
39
|
+
gridTemplateRows: isString(rows) ? rows : `repeat(${rows}, minmax(0, 1fr))`,
|
|
40
|
+
gridTemplateColumns: isString(cols) ? cols : `repeat(${cols}, minmax(0, 1fr))`,
|
|
41
|
+
gap: gap ? `${gap}px` : void 0
|
|
42
|
+
}),
|
|
43
|
+
rows: (rows: number | string, gap?: number) => ({
|
|
44
|
+
display: 'grid',
|
|
45
|
+
gridTemplateRows: isString(rows) ? rows : `repeat(${rows}, minmax(0, 1fr))`,
|
|
46
|
+
rowGap: gap ? `${gap}px` : void 0
|
|
47
|
+
}),
|
|
48
|
+
cols: (cols: number | string, gap?: number) => ({
|
|
49
|
+
display: 'grid',
|
|
50
|
+
gridTemplateColumns: isString(cols) ? cols : `repeat(${cols}, minmax(0, 1fr))`,
|
|
51
|
+
columnGap: gap ? `${gap}px` : void 0
|
|
52
|
+
})
|
|
53
|
+
} satisfies Record<string, AnyFunc<CSSProperties>>
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export type themeType = typeof theme
|