create-packer 1.31.2 → 1.32.0
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 +14 -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 +79 -78
- package/template/web-app/react/pages/home/home.styled.ts +7 -0
- package/template/web-app/react/pages/home/home.tsx +2 -2
- 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/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 +14 -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 +7 -0
- 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 +87 -86
- package/template/web-app/react-webpack/pages/home/home.styled.ts +7 -0
- package/template/web-app/react-webpack/pages/home/home.tsx +2 -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/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/package.json +70 -70
- 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 +77 -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 +7 -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 -7
- 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
package/bin/createTemp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTemp =
|
|
3
|
+
exports.createTemp = createTemp;
|
|
4
4
|
const inquirer = require("inquirer");
|
|
5
5
|
const fsExtra = require("fs-extra");
|
|
6
6
|
const path = require("path");
|
|
@@ -61,4 +61,3 @@ async function createTemp(dirname) {
|
|
|
61
61
|
createTempEnd(output);
|
|
62
62
|
creating.succeed();
|
|
63
63
|
}
|
|
64
|
-
exports.createTemp = createTemp;
|
package/bin/utils/index.js
CHANGED
|
@@ -23,7 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.hasPnpm = hasPnpm;
|
|
27
|
+
exports.hasYarn = hasYarn;
|
|
28
|
+
exports.onGenCommand = onGenCommand;
|
|
29
|
+
exports.genTemplateInfoList = genTemplateInfoList;
|
|
27
30
|
const path = __importStar(require("path"));
|
|
28
31
|
const child_process_1 = require("child_process");
|
|
29
32
|
const fs_1 = require("fs");
|
|
@@ -36,7 +39,6 @@ function hasPnpm() {
|
|
|
36
39
|
return false;
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
|
-
exports.hasPnpm = hasPnpm;
|
|
40
42
|
function hasYarn() {
|
|
41
43
|
try {
|
|
42
44
|
(0, child_process_1.execSync)('yarnpkg --version');
|
|
@@ -46,7 +48,6 @@ function hasYarn() {
|
|
|
46
48
|
return false;
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
|
-
exports.hasYarn = hasYarn;
|
|
50
51
|
function onGenCommand() {
|
|
51
52
|
if (hasPnpm()) {
|
|
52
53
|
return 'pnpm';
|
|
@@ -56,7 +57,6 @@ function onGenCommand() {
|
|
|
56
57
|
}
|
|
57
58
|
return 'npm';
|
|
58
59
|
}
|
|
59
|
-
exports.onGenCommand = onGenCommand;
|
|
60
60
|
function genTemplateInfoList(root) {
|
|
61
61
|
const temps = [];
|
|
62
62
|
(0, fs_1.readdirSync)(root, { withFileTypes: true }).forEach(o => {
|
|
@@ -71,4 +71,3 @@ function genTemplateInfoList(root) {
|
|
|
71
71
|
});
|
|
72
72
|
return temps;
|
|
73
73
|
}
|
|
74
|
-
exports.genTemplateInfoList = genTemplateInfoList;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-packer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": "https://github.com/kevily/create-packer",
|
|
6
6
|
"author": "1k <bug_zero@163.com>",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"commitizen": "4.3.0",
|
|
33
33
|
"eslint": "8.56.0",
|
|
34
34
|
"rimraf": "3.0.2",
|
|
35
|
-
"typescript": "5.
|
|
35
|
+
"typescript": "5.5.2"
|
|
36
36
|
},
|
|
37
37
|
"config": {
|
|
38
38
|
"commitizen": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"@storybook/react": "7.1.0",
|
|
28
28
|
"@storybook/react-vite": "7.1.0",
|
|
29
29
|
"@storybook/testing-library": "0.0.14-next.2",
|
|
30
|
-
"@types/react": "18.
|
|
31
|
-
"@types/react-dom": "18.
|
|
30
|
+
"@types/react": "18.3.3",
|
|
31
|
+
"@types/react-dom": "18.3.0",
|
|
32
32
|
"@typescript-eslint/eslint-plugin": "7.0.2",
|
|
33
33
|
"@typescript-eslint/parser": "7.0.2",
|
|
34
34
|
"eslint": "8.56.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"storybook": "7.1.0",
|
|
46
46
|
"stylelint": "16.2.1",
|
|
47
47
|
"stylelint-config-standard-scss": "13.0.0",
|
|
48
|
-
"typescript": "5.
|
|
48
|
+
"typescript": "5.5.2",
|
|
49
49
|
"vite-plugin-svgr": "4.2.0"
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "next",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"prepare": "husky install",
|
|
7
|
-
"dev": "next dev",
|
|
8
|
-
"build": "next build",
|
|
9
|
-
"start": "next start",
|
|
10
|
-
"lint": "next lint",
|
|
11
|
-
"format": "prettier --write \"{app,components,pages,domain,providers}/**/*.{ts,js,tsx,jsx,css,scss,less}\" \"./package.json\"",
|
|
12
|
-
"cz": "cz",
|
|
13
|
-
"push": "npm run commit && git push",
|
|
14
|
-
"commit": "git add . && npm run cz"
|
|
15
|
-
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@types/node": "20.4.2",
|
|
18
|
-
"@types/react": "18.
|
|
19
|
-
"@types/react-dom": "18.
|
|
20
|
-
"autoprefixer": "10.4.14",
|
|
21
|
-
"eslint": "8.56.0",
|
|
22
|
-
"eslint-config-next": "14.1.0",
|
|
23
|
-
"next": "13.4.10",
|
|
24
|
-
"postcss": "8.4.35",
|
|
25
|
-
"react": "18.2.0",
|
|
26
|
-
"react-dom": "18.2.0",
|
|
27
|
-
"tailwindcss": "3.4.3",
|
|
28
|
-
"typescript": "5.
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@commitlint/cli": "17.6.7",
|
|
32
|
-
"@commitlint/config-conventional": "17.6.7",
|
|
33
|
-
"@commitlint/cz-commitlint": "17.6.7",
|
|
34
|
-
"commitizen": "4.3.0",
|
|
35
|
-
"eslint-plugin-import": "2.29.1",
|
|
36
|
-
"eslint-plugin-prettier": "5.1.3",
|
|
37
|
-
"husky": "8.0.3",
|
|
38
|
-
"prettier": "3.2.5",
|
|
39
|
-
"stylelint": "16.2.1",
|
|
40
|
-
"stylelint-config-standard": "36.0.0"
|
|
41
|
-
},
|
|
42
|
-
"config": {
|
|
43
|
-
"commitizen": {
|
|
44
|
-
"path": "@commitlint/cz-commitlint"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "next",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"prepare": "husky install",
|
|
7
|
+
"dev": "next dev",
|
|
8
|
+
"build": "next build",
|
|
9
|
+
"start": "next start",
|
|
10
|
+
"lint": "next lint",
|
|
11
|
+
"format": "prettier --write \"{app,components,pages,domain,providers}/**/*.{ts,js,tsx,jsx,css,scss,less}\" \"./package.json\"",
|
|
12
|
+
"cz": "cz",
|
|
13
|
+
"push": "npm run commit && git push",
|
|
14
|
+
"commit": "git add . && npm run cz"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/node": "20.4.2",
|
|
18
|
+
"@types/react": "18.3.3",
|
|
19
|
+
"@types/react-dom": "18.3.0",
|
|
20
|
+
"autoprefixer": "10.4.14",
|
|
21
|
+
"eslint": "8.56.0",
|
|
22
|
+
"eslint-config-next": "14.1.0",
|
|
23
|
+
"next": "13.4.10",
|
|
24
|
+
"postcss": "8.4.35",
|
|
25
|
+
"react": "18.2.0",
|
|
26
|
+
"react-dom": "18.2.0",
|
|
27
|
+
"tailwindcss": "3.4.3",
|
|
28
|
+
"typescript": "5.5.2"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@commitlint/cli": "17.6.7",
|
|
32
|
+
"@commitlint/config-conventional": "17.6.7",
|
|
33
|
+
"@commitlint/cz-commitlint": "17.6.7",
|
|
34
|
+
"commitizen": "4.3.0",
|
|
35
|
+
"eslint-plugin-import": "2.29.1",
|
|
36
|
+
"eslint-plugin-prettier": "5.1.3",
|
|
37
|
+
"husky": "8.0.3",
|
|
38
|
+
"prettier": "3.2.5",
|
|
39
|
+
"stylelint": "16.2.1",
|
|
40
|
+
"stylelint-config-standard": "36.0.0"
|
|
41
|
+
},
|
|
42
|
+
"config": {
|
|
43
|
+
"commitizen": {
|
|
44
|
+
"path": "@commitlint/cz-commitlint"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -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,14 @@
|
|
|
1
|
+
import { FunctionComponent, StrictMode } from 'react'
|
|
2
|
+
import { ThemeProvider } from 'styled-components'
|
|
3
|
+
import { theme } from '@/shared/theme'
|
|
4
|
+
|
|
5
|
+
export interface propsType {
|
|
6
|
+
children: React.ReactNode
|
|
7
|
+
}
|
|
8
|
+
export const Root: FunctionComponent<propsType> = props => {
|
|
9
|
+
return (
|
|
10
|
+
<StrictMode>
|
|
11
|
+
<ThemeProvider theme={theme}>{props.children}</ThemeProvider>
|
|
12
|
+
</StrictMode>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -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,4 @@
|
|
|
1
1
|
import { createRoot } from 'react-dom/client'
|
|
2
2
|
import { App } from '@/domain/app'
|
|
3
|
-
import './index.css'
|
|
4
3
|
|
|
5
|
-
createRoot(document.getElementById('root') as HTMLElement).render(
|
|
4
|
+
createRoot(document.getElementById('root') as HTMLElement).render(<App.Root />)
|
|
@@ -1,78 +1,79 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-vite",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"prepare": "husky install",
|
|
8
|
-
"dev": "vite",
|
|
9
|
-
"build": "tsc --noEmit && vite build",
|
|
10
|
-
"build:analyse": "tsc --noEmit && vite build --mode analyse",
|
|
11
|
-
"preview": "vite preview",
|
|
12
|
-
"up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L",
|
|
13
|
-
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
14
|
-
"lint": "tsc --noEmit && eslint **/*.{tsx,ts,jsx,js} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
|
|
15
|
-
"lint:fix": "eslint **/*.{tsx,ts,jsx,js} --fix && stylelint **/*.{css,scss,less} --fix",
|
|
16
|
-
"cz": "cz",
|
|
17
|
-
"push": "npm run commit && git push",
|
|
18
|
-
"commit": "git add . && npm run cz"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"1k-types": "1.2.0",
|
|
22
|
-
"axios": "1.3.6",
|
|
23
|
-
"define-zustand": "3.1.1",
|
|
24
|
-
"immer": "10.0.1",
|
|
25
|
-
"lodash-es": "4.17.21",
|
|
26
|
-
"qs": "6.11.2",
|
|
27
|
-
"react": "18.3.1",
|
|
28
|
-
"react-dom": "18.3.1",
|
|
29
|
-
"react-router-dom": "6.14.0",
|
|
30
|
-
"react-use": "17.5.0",
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"@commitlint/
|
|
36
|
-
"@commitlint/
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@types/
|
|
40
|
-
"@types/
|
|
41
|
-
"@types/
|
|
42
|
-
"@types/
|
|
43
|
-
"@types/react
|
|
44
|
-
"@
|
|
45
|
-
"@typescript-eslint/
|
|
46
|
-
"@
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"eslint
|
|
52
|
-
"eslint-
|
|
53
|
-
"eslint-plugin-
|
|
54
|
-
"eslint-plugin-
|
|
55
|
-
"eslint-plugin-react
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"postcss
|
|
61
|
-
"postcss-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"vite
|
|
70
|
-
"vite-plugin-
|
|
71
|
-
"vite-plugin-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-vite",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"prepare": "husky install",
|
|
8
|
+
"dev": "vite",
|
|
9
|
+
"build": "tsc --noEmit && vite build",
|
|
10
|
+
"build:analyse": "tsc --noEmit && vite build --mode analyse",
|
|
11
|
+
"preview": "vite preview",
|
|
12
|
+
"up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L",
|
|
13
|
+
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
|
|
14
|
+
"lint": "tsc --noEmit && eslint **/*.{tsx,ts,jsx,js} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,ts,tsx}",
|
|
15
|
+
"lint:fix": "eslint **/*.{tsx,ts,jsx,js} --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
|
|
16
|
+
"cz": "cz",
|
|
17
|
+
"push": "npm run commit && git push",
|
|
18
|
+
"commit": "git add . && npm run cz"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"1k-types": "1.2.0",
|
|
22
|
+
"axios": "1.3.6",
|
|
23
|
+
"define-zustand": "3.1.1",
|
|
24
|
+
"immer": "10.0.1",
|
|
25
|
+
"lodash-es": "4.17.21",
|
|
26
|
+
"qs": "6.11.2",
|
|
27
|
+
"react": "18.3.1",
|
|
28
|
+
"react-dom": "18.3.1",
|
|
29
|
+
"react-router-dom": "6.14.0",
|
|
30
|
+
"react-use": "17.5.0",
|
|
31
|
+
"styled-components": "6.1.11",
|
|
32
|
+
"zustand": "4.4.1"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@commitlint/cli": "17.6.1",
|
|
36
|
+
"@commitlint/config-conventional": "17.6.1",
|
|
37
|
+
"@commitlint/cz-commitlint": "17.5.0",
|
|
38
|
+
"@rollup/plugin-eslint": "9.0.5",
|
|
39
|
+
"@types/lodash-es": "4.17.7",
|
|
40
|
+
"@types/mockjs": "1.0.7",
|
|
41
|
+
"@types/node": "18.16.0",
|
|
42
|
+
"@types/qs": "6.9.7",
|
|
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
|
+
"@vitejs/plugin-react": "4.3.1",
|
|
48
|
+
"autoprefixer": "10.4.14",
|
|
49
|
+
"commitizen": "4.3.0",
|
|
50
|
+
"cssnano": "6.0.0",
|
|
51
|
+
"eslint": "8.56.0",
|
|
52
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
|
53
|
+
"eslint-plugin-import": "2.29.1",
|
|
54
|
+
"eslint-plugin-prettier": "5.1.3",
|
|
55
|
+
"eslint-plugin-react": "7.33.2",
|
|
56
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
57
|
+
"husky": "8.0.3",
|
|
58
|
+
"inquirer": "^8.1.2",
|
|
59
|
+
"mockjs": "1.1.0",
|
|
60
|
+
"postcss": "8.4.35",
|
|
61
|
+
"postcss-import": "16.0.1",
|
|
62
|
+
"postcss-nesting": "12.0.3",
|
|
63
|
+
"postcss-styled-syntax": "0.6.4",
|
|
64
|
+
"prettier": "3.2.5",
|
|
65
|
+
"rollup-plugin-visualizer": "5.12.0",
|
|
66
|
+
"stylelint": "16.2.1",
|
|
67
|
+
"stylelint-config-standard-scss": "13.0.0",
|
|
68
|
+
"typescript": "5.5.2",
|
|
69
|
+
"vite": "5.3.3",
|
|
70
|
+
"vite-plugin-mock-dev-server": "1.5.1",
|
|
71
|
+
"vite-plugin-stylelint": "5.3.1",
|
|
72
|
+
"vite-plugin-svgr": "4.2.0"
|
|
73
|
+
},
|
|
74
|
+
"config": {
|
|
75
|
+
"commitizen": {
|
|
76
|
+
"path": "@commitlint/cz-commitlint"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import './home.css'
|
|
2
1
|
import { useEffect } from 'react'
|
|
3
2
|
import { request, API } from '@/shared/service'
|
|
3
|
+
import { StyledRoot } from './home.styled'
|
|
4
4
|
|
|
5
5
|
export default function Home() {
|
|
6
6
|
useEffect(() => {
|
|
@@ -9,5 +9,5 @@ export default function Home() {
|
|
|
9
9
|
})
|
|
10
10
|
}, [])
|
|
11
11
|
|
|
12
|
-
return <
|
|
12
|
+
return <StyledRoot>sdfs</StyledRoot>
|
|
13
13
|
}
|
|
@@ -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
|
|
@@ -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
|