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.
Files changed (107) hide show
  1. package/bin/createTemp.js +1 -2
  2. package/bin/utils/index.js +4 -5
  3. package/package.json +2 -2
  4. package/template/docusaurus/package.json +1 -1
  5. package/template/lib/react/package.json +3 -3
  6. package/template/lib/ts/package.json +1 -1
  7. package/template/nest/package.json +1 -1
  8. package/template/web-app/next/package.json +47 -47
  9. package/template/web-app/react/.gitignore +1 -0
  10. package/template/web-app/react/.stylelintrc +3 -7
  11. package/template/web-app/react/.vscode/extensions.json +3 -2
  12. package/template/web-app/react/.vscode/settings.json +18 -0
  13. package/template/web-app/react/domain/app/app.styled.ts +3 -0
  14. package/template/web-app/react/domain/app/components/app-context.tsx +14 -0
  15. package/template/web-app/react/domain/app/components/app.tsx +8 -7
  16. package/template/web-app/react/domain/app/components/index.ts +1 -1
  17. package/template/web-app/react/index.html +1 -1
  18. package/template/web-app/react/main.tsx +1 -2
  19. package/template/web-app/react/package.json +79 -78
  20. package/template/web-app/react/pages/home/home.styled.ts +7 -0
  21. package/template/web-app/react/pages/home/home.tsx +2 -2
  22. package/template/web-app/react/pages/index.tsx +4 -8
  23. package/template/web-app/react/postcss.config.cjs +0 -2
  24. package/template/web-app/react/shared/theme/index.ts +1 -0
  25. package/template/web-app/react/shared/theme/theme.styled.ts +56 -0
  26. package/template/web-app/react/vite-env.d.ts +6 -0
  27. package/template/web-app/react/vite.config.ts +3 -6
  28. package/template/web-app/react-webpack/.gitignore +1 -0
  29. package/template/web-app/react-webpack/.stylelintrc +3 -7
  30. package/template/web-app/react-webpack/.vscode/extensions.json +3 -2
  31. package/template/web-app/react-webpack/.vscode/settings.json +18 -0
  32. package/template/web-app/react-webpack/domain/app/app.styled.ts +3 -0
  33. package/template/web-app/react-webpack/domain/app/components/app-context.tsx +14 -0
  34. package/template/web-app/react-webpack/domain/app/components/app.tsx +8 -7
  35. package/template/web-app/react-webpack/domain/app/components/index.ts +1 -1
  36. package/template/web-app/react-webpack/global.d.ts +7 -0
  37. package/template/web-app/react-webpack/index.html +1 -1
  38. package/template/web-app/react-webpack/main.tsx +1 -2
  39. package/template/web-app/react-webpack/package.json +87 -86
  40. package/template/web-app/react-webpack/pages/home/home.styled.ts +7 -0
  41. package/template/web-app/react-webpack/pages/home/home.tsx +2 -3
  42. package/template/web-app/react-webpack/pages/index.tsx +4 -8
  43. package/template/web-app/react-webpack/postcss.config.js +0 -2
  44. package/template/web-app/react-webpack/shared/theme/index.ts +1 -0
  45. package/template/web-app/react-webpack/shared/theme/theme.styled.ts +56 -0
  46. package/template/web-app/solid/package.json +51 -51
  47. package/template/web-app/svelte/package.json +12 -8
  48. package/template/web-app/svelte/svelte.config.js +3 -4
  49. package/template/web-app/svelte/vite-env.d.ts +0 -1
  50. package/template/web-app/svelte/vite.config.ts +7 -1
  51. package/template/web-app/vue/.stylelintrc +1 -1
  52. package/template/web-app/vue/index.html +1 -1
  53. package/template/web-app/vue/package.json +70 -70
  54. package/template/web-app/vue/tailwind.config.cjs +0 -1
  55. package/template/web-app/vue/vite.config.ts +2 -5
  56. package/template/web-extension/.env +1 -0
  57. package/template/web-extension/.eslintrc +34 -9
  58. package/template/web-extension/.gitignore +1 -0
  59. package/template/web-extension/.stylelintrc +3 -7
  60. package/template/web-extension/.vscode/extensions.json +3 -2
  61. package/template/web-extension/.vscode/settings.json +18 -0
  62. package/template/web-extension/content_script/constants/base.ts +1 -0
  63. package/template/web-extension/content_script/constants/index.ts +1 -0
  64. package/template/web-extension/content_script/domain/app/index.ts +1 -0
  65. package/template/web-extension/content_script/domain/app/tools/index.ts +1 -0
  66. package/template/web-extension/content_script/domain/app/tools/insertApp.tsx +55 -0
  67. package/template/web-extension/content_script/index.tsx +2 -14
  68. package/template/web-extension/content_script/modules/common/common.tsx +10 -0
  69. package/template/web-extension/content_script/modules/common/index.ts +2 -0
  70. package/template/web-extension/content_script/modules/common/insert.tsx +9 -0
  71. package/template/web-extension/content_script/modules/index.ts +1 -0
  72. package/template/web-extension/defineManifest.ts +1 -1
  73. package/template/web-extension/package.json +77 -76
  74. package/template/web-extension/popup/index.tsx +3 -1
  75. package/template/web-extension/popup/popup.container.tsx +1 -3
  76. package/template/web-extension/postcss.config.cjs +0 -2
  77. package/template/web-extension/shared/components/app-context.tsx +7 -0
  78. package/template/web-extension/shared/components/index.ts +1 -0
  79. package/template/web-extension/shared/service/request.ts +3 -3
  80. package/template/web-extension/shared/styles/global.styled.ts +8 -0
  81. package/template/web-extension/shared/styles/index.ts +2 -0
  82. package/template/web-extension/shared/styles/theme.styled.ts +56 -0
  83. package/template/web-extension/tsconfig.json +23 -7
  84. package/template/web-extension/vite-env.d.ts +7 -0
  85. package/template/web-extension/vite.config.ts +2 -5
  86. package/template/workspace/pnpm/node_modules/.pnpm/node_modules/test/.gitignore +25 -0
  87. package/template/workspace/pnpm/package.json +1 -1
  88. package/template/workspace/pnpm/scripts/build.ts +9 -3
  89. package/template/workspace/pnpm/tsconfig.json +7 -3
  90. package/template/web-app/react/index.css +0 -3
  91. package/template/web-app/react/pages/home/home.css +0 -1
  92. package/template/web-app/react/tailwind.config.cjs +0 -18
  93. package/template/web-app/react-webpack/pages/home/home.module.css +0 -3
  94. package/template/web-app/react-webpack/tailwind.config.js +0 -18
  95. package/template/web-extension/content_script/content.css +0 -3
  96. package/template/web-extension/content_script/content.tsx +0 -5
  97. package/template/web-extension/domain/app/components/app-context.tsx +0 -7
  98. package/template/web-extension/domain/app/components/index.ts +0 -1
  99. package/template/web-extension/domain/app/index.ts +0 -1
  100. package/template/web-extension/popup/popup.css +0 -3
  101. package/template/web-extension/shared/service/tools/base.ts +0 -43
  102. package/template/web-extension/shared/service/tools/createRequestActions.ts +0 -80
  103. package/template/web-extension/shared/service/tools/createService.ts +0 -50
  104. package/template/web-extension/shared/service/tools/hooks.ts +0 -73
  105. package/template/web-extension/shared/service/tools/index.ts +0 -4
  106. package/template/web-extension/shared/service/types.ts +0 -42
  107. 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 = void 0;
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;
@@ -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.genTemplateInfoList = exports.onGenCommand = exports.hasYarn = exports.hasPnpm = void 0;
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.31.2",
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.3.3"
35
+ "typescript": "5.5.2"
36
36
  },
37
37
  "config": {
38
38
  "commitizen": {
@@ -32,7 +32,7 @@
32
32
  "@easyops-cn/docusaurus-search-local": "^0.36.0",
33
33
  "@tsconfig/docusaurus": "1.0.5",
34
34
  "prettier": "3.2.5",
35
- "typescript": "5.3.3"
35
+ "typescript": "5.5.2"
36
36
  },
37
37
  "browserslist": {
38
38
  "production": [
@@ -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.2.14",
31
- "@types/react-dom": "18.2.6",
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.3.3",
48
+ "typescript": "5.5.2",
49
49
  "vite-plugin-svgr": "4.2.0"
50
50
  }
51
51
  }
@@ -23,7 +23,7 @@
23
23
  "prettier": "3.2.5",
24
24
  "stylelint": "16.2.1",
25
25
  "stylelint-config-standard-scss": "13.0.0",
26
- "typescript": "5.3.3",
26
+ "typescript": "5.5.2",
27
27
  "vitest": "0.34.2"
28
28
  }
29
29
  }
@@ -57,7 +57,7 @@
57
57
  "ts-loader": "9.4.2",
58
58
  "ts-node": "10.9.1",
59
59
  "tsconfig-paths": "4.1.2",
60
- "typescript": "5.3.3"
60
+ "typescript": "5.5.2"
61
61
  },
62
62
  "jest": {
63
63
  "moduleFileExtensions": [
@@ -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.2.15",
19
- "@types/react-dom": "18.2.7",
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.3.3"
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
+ }
@@ -17,6 +17,7 @@ vite.config.ts.*
17
17
  # Editor directories and files
18
18
  .vscode/*
19
19
  !.vscode/extensions.json
20
+ !.vscode/settings.json
20
21
  .history
21
22
  .idea
22
23
  .DS_Store
@@ -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": ["tailwind", "apply", "use"]
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
  }
@@ -2,6 +2,7 @@
2
2
  "recommendations": [
3
3
  "dbaeumer.vscode-eslint",
4
4
  "stylelint.vscode-stylelint",
5
- "esbenp.prettier-vscode"
5
+ "esbenp.prettier-vscode",
6
+ "styled-components.vscode-styled-components"
6
7
  ]
7
- }
8
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "stylelint.validate": [
3
+ "css",
4
+ "less",
5
+ "postcss",
6
+ "scss",
7
+ "typescript",
8
+ "typescriptreact"
9
+ ],
10
+ "stylelint.snippet": [
11
+ "css",
12
+ "less",
13
+ "postcss",
14
+ "scss",
15
+ "typescript",
16
+ "typescriptreact"
17
+ ]
18
+ }
@@ -0,0 +1,3 @@
1
+ import { createGlobalStyle } from 'styled-components'
2
+
3
+ export const GlobalStyle = createGlobalStyle``
@@ -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 { StrictMode, useLayoutEffect } from 'react'
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 App = () => {
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
- <StrictMode>
18
- <RouterProvider router={routerInstance} />
19
- </StrictMode>
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 { default as App } from './app'
1
+ export * as App from './app'
@@ -6,7 +6,7 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Vite + React + TS</title>
8
8
  </head>
9
- <body id="my-app">
9
+ <body>
10
10
  <div id="root"></div>
11
11
  <script type="module" src="/main.tsx"></script>
12
12
  </body>
@@ -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((<App />) as never)
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
- "zustand": "4.4.1"
32
- },
33
- "devDependencies": {
34
- "@commitlint/cli": "17.6.1",
35
- "@commitlint/config-conventional": "17.6.1",
36
- "@commitlint/cz-commitlint": "17.5.0",
37
- "@nabla/vite-plugin-eslint": "2.0.2",
38
- "@types/lodash-es": "4.17.7",
39
- "@types/mockjs": "1.0.7",
40
- "@types/node": "18.16.0",
41
- "@types/qs": "6.9.7",
42
- "@types/react": "18.0.38",
43
- "@types/react-dom": "18.0.11",
44
- "@typescript-eslint/eslint-plugin": "7.0.2",
45
- "@typescript-eslint/parser": "7.0.2",
46
- "@vitejs/plugin-react": "4.2.1",
47
- "autoprefixer": "10.4.14",
48
- "commitizen": "4.3.0",
49
- "cssnano": "6.0.0",
50
- "eslint": "8.56.0",
51
- "eslint-import-resolver-typescript": "3.6.1",
52
- "eslint-plugin-import": "2.29.1",
53
- "eslint-plugin-prettier": "5.1.3",
54
- "eslint-plugin-react": "7.33.2",
55
- "eslint-plugin-react-hooks": "4.6.0",
56
- "husky": "8.0.3",
57
- "inquirer": "^8.1.2",
58
- "mockjs": "1.1.0",
59
- "postcss": "8.4.35",
60
- "postcss-import": "16.0.1",
61
- "postcss-nesting": "12.0.3",
62
- "prettier": "3.2.5",
63
- "rollup-plugin-visualizer": "5.9.2",
64
- "stylelint": "16.2.1",
65
- "stylelint-config-standard-scss": "13.0.0",
66
- "tailwindcss": "3.4.3",
67
- "typescript": "5.3.3",
68
- "vite": "4.5.2",
69
- "vite-plugin-mock-dev-server": "1.4.7",
70
- "vite-plugin-stylelint": "5.3.1",
71
- "vite-plugin-svgr": "4.2.0"
72
- },
73
- "config": {
74
- "commitizen": {
75
- "path": "@commitlint/cz-commitlint"
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
+ }
@@ -0,0 +1,7 @@
1
+ import styled, { css } from 'styled-components'
2
+
3
+ export const StyledRoot = styled.div(({ theme }) => {
4
+ return css`
5
+ ${theme.tools.flex('center', 'center')};
6
+ `
7
+ })
@@ -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 <div className={'flex justify-center items-center'}>sdfs</div>
12
+ return <StyledRoot>sdfs</StyledRoot>
13
13
  }
@@ -1,8 +1,8 @@
1
- import { Suspense, useEffect } from 'react'
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 View = () => {
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 View
18
+ export default Layout
@@ -1,8 +1,6 @@
1
1
  module.exports = {
2
2
  plugins: {
3
3
  'postcss-import': {},
4
- 'tailwindcss/nesting': 'postcss-nesting',
5
- tailwindcss: {},
6
4
  autoprefixer: {},
7
5
  ...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {})
8
6
  }
@@ -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