create-lik-app 1.1.3 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. package/dist/index.mjs +45 -45
  2. package/package.json +1 -1
  3. package/templates/template-react/eslint.config.mjs +32 -14
  4. package/templates/template-react/package.json +1 -1
  5. package/templates/template-react-tanstack-jotai/eslint.config.mjs +32 -14
  6. package/templates/template-react-tanstack-jotai/package.json +9 -9
  7. package/templates/template-react-tanstack-jotai-tailwindcss/.husky/commit-msg +6 -0
  8. package/templates/template-react-tanstack-jotai-tailwindcss/.husky/lintstagedrc.cjs +8 -0
  9. package/templates/template-react-tanstack-jotai-tailwindcss/.husky/pre-commit +10 -0
  10. package/templates/template-react-tanstack-jotai-tailwindcss/.prettierignore +13 -0
  11. package/templates/template-react-tanstack-jotai-tailwindcss/.vscode/extensions.json +5 -0
  12. package/templates/template-react-tanstack-jotai-tailwindcss/README.md +40 -0
  13. package/templates/template-react-tanstack-jotai-tailwindcss/_gitignore +27 -0
  14. package/templates/template-react-tanstack-jotai-tailwindcss/commitlint.config.mjs +28 -0
  15. package/templates/template-react-tanstack-jotai-tailwindcss/config/build/_base.ts +36 -0
  16. package/templates/template-react-tanstack-jotai-tailwindcss/config/build/development.ts +7 -0
  17. package/templates/template-react-tanstack-jotai-tailwindcss/config/build/production.ts +1 -0
  18. package/templates/template-react-tanstack-jotai-tailwindcss/config/build/test.ts +1 -0
  19. package/templates/template-react-tanstack-jotai-tailwindcss/env/.env +0 -0
  20. package/templates/template-react-tanstack-jotai-tailwindcss/env/.env.development +2 -0
  21. package/templates/template-react-tanstack-jotai-tailwindcss/env/.env.production +1 -0
  22. package/templates/template-react-tanstack-jotai-tailwindcss/eslint.config.mjs +62 -0
  23. package/templates/template-react-tanstack-jotai-tailwindcss/index.html +13 -0
  24. package/templates/template-react-tanstack-jotai-tailwindcss/package.json +50 -0
  25. package/templates/template-react-tanstack-jotai-tailwindcss/postcss.config.js +6 -0
  26. package/templates/template-react-tanstack-jotai-tailwindcss/prettier.config.mjs +11 -0
  27. package/templates/template-react-tanstack-jotai-tailwindcss/public/lic.svg +1263 -0
  28. package/templates/template-react-tanstack-jotai-tailwindcss/public/react.svg +1 -0
  29. package/templates/template-react-tanstack-jotai-tailwindcss/public/vite.svg +1 -0
  30. package/templates/template-react-tanstack-jotai-tailwindcss/src/assets/react.svg +1 -0
  31. package/templates/template-react-tanstack-jotai-tailwindcss/src/components/Lic/index.tsx +12 -0
  32. package/templates/template-react-tanstack-jotai-tailwindcss/src/main.tsx +21 -0
  33. package/templates/template-react-tanstack-jotai-tailwindcss/src/routeTree.gen.ts +145 -0
  34. package/templates/template-react-tanstack-jotai-tailwindcss/src/routes/__root.tsx +11 -0
  35. package/templates/template-react-tanstack-jotai-tailwindcss/src/routes/_layout/about.tsx +6 -0
  36. package/templates/template-react-tanstack-jotai-tailwindcss/src/routes/_layout/index.tsx +6 -0
  37. package/templates/template-react-tanstack-jotai-tailwindcss/src/routes/_layout.tsx +23 -0
  38. package/templates/template-react-tanstack-jotai-tailwindcss/src/store/index.ts +1 -0
  39. package/templates/template-react-tanstack-jotai-tailwindcss/src/store/module/favorite.ts +5 -0
  40. package/templates/template-react-tanstack-jotai-tailwindcss/src/styles/animation.css +8 -0
  41. package/templates/template-react-tanstack-jotai-tailwindcss/src/styles/main.css +11 -0
  42. package/templates/template-react-tanstack-jotai-tailwindcss/src/styles/tailwind.css +30 -0
  43. package/templates/template-react-tanstack-jotai-tailwindcss/src/styles/variable.css +21 -0
  44. package/templates/template-react-tanstack-jotai-tailwindcss/src/types/auto-imports.d.ts +33 -0
  45. package/templates/template-react-tanstack-jotai-tailwindcss/src/types/color.d.ts +1 -0
  46. package/templates/template-react-tanstack-jotai-tailwindcss/src/utils/rainbow-print.ts +10 -0
  47. package/templates/template-react-tanstack-jotai-tailwindcss/src/views/404/index.tsx +18 -0
  48. package/templates/template-react-tanstack-jotai-tailwindcss/src/views/About/index.tsx +7 -0
  49. package/templates/template-react-tanstack-jotai-tailwindcss/src/views/Index/Button/index.tsx +24 -0
  50. package/templates/template-react-tanstack-jotai-tailwindcss/src/views/Index/React/index.tsx +18 -0
  51. package/templates/template-react-tanstack-jotai-tailwindcss/src/views/Index/Vite/index.tsx +20 -0
  52. package/templates/template-react-tanstack-jotai-tailwindcss/src/views/Index/index.tsx +50 -0
  53. package/templates/template-react-tanstack-jotai-tailwindcss/tailwind.config.js +8 -0
  54. package/templates/template-react-tanstack-jotai-tailwindcss/tsconfig.app.json +36 -0
  55. package/templates/template-react-tanstack-jotai-tailwindcss/tsconfig.json +7 -0
  56. package/templates/template-react-tanstack-jotai-tailwindcss/tsconfig.node.json +24 -0
  57. package/templates/template-react-tanstack-jotai-tailwindcss/types/vite-env.d.ts +10 -0
  58. package/templates/template-react-tanstack-jotai-tailwindcss/vite.config.ts +15 -0
  59. package/templates/template-react18-tanstack-jotai-tailwindcss/.husky/commit-msg +6 -0
  60. package/templates/template-react18-tanstack-jotai-tailwindcss/.husky/lintstagedrc.cjs +8 -0
  61. package/templates/template-react18-tanstack-jotai-tailwindcss/.husky/pre-commit +10 -0
  62. package/templates/template-react18-tanstack-jotai-tailwindcss/.prettierignore +13 -0
  63. package/templates/template-react18-tanstack-jotai-tailwindcss/.vscode/extensions.json +5 -0
  64. package/templates/template-react18-tanstack-jotai-tailwindcss/README.md +40 -0
  65. package/templates/template-react18-tanstack-jotai-tailwindcss/_gitignore +27 -0
  66. package/templates/template-react18-tanstack-jotai-tailwindcss/commitlint.config.mjs +28 -0
  67. package/templates/template-react18-tanstack-jotai-tailwindcss/config/build/_base.ts +36 -0
  68. package/templates/template-react18-tanstack-jotai-tailwindcss/config/build/development.ts +7 -0
  69. package/templates/template-react18-tanstack-jotai-tailwindcss/config/build/production.ts +1 -0
  70. package/templates/template-react18-tanstack-jotai-tailwindcss/config/build/test.ts +1 -0
  71. package/templates/template-react18-tanstack-jotai-tailwindcss/env/.env +0 -0
  72. package/templates/template-react18-tanstack-jotai-tailwindcss/env/.env.development +2 -0
  73. package/templates/template-react18-tanstack-jotai-tailwindcss/env/.env.production +1 -0
  74. package/templates/template-react18-tanstack-jotai-tailwindcss/eslint.config.mjs +62 -0
  75. package/templates/template-react18-tanstack-jotai-tailwindcss/index.html +13 -0
  76. package/templates/template-react18-tanstack-jotai-tailwindcss/package.json +50 -0
  77. package/templates/template-react18-tanstack-jotai-tailwindcss/postcss.config.js +6 -0
  78. package/templates/template-react18-tanstack-jotai-tailwindcss/prettier.config.mjs +11 -0
  79. package/templates/template-react18-tanstack-jotai-tailwindcss/public/lic.svg +1263 -0
  80. package/templates/template-react18-tanstack-jotai-tailwindcss/public/react.svg +1 -0
  81. package/templates/template-react18-tanstack-jotai-tailwindcss/public/vite.svg +1 -0
  82. package/templates/template-react18-tanstack-jotai-tailwindcss/src/assets/react.svg +1 -0
  83. package/templates/template-react18-tanstack-jotai-tailwindcss/src/components/Lic/index.tsx +12 -0
  84. package/templates/template-react18-tanstack-jotai-tailwindcss/src/main.tsx +21 -0
  85. package/templates/template-react18-tanstack-jotai-tailwindcss/src/routeTree.gen.ts +145 -0
  86. package/templates/template-react18-tanstack-jotai-tailwindcss/src/routes/__root.tsx +11 -0
  87. package/templates/template-react18-tanstack-jotai-tailwindcss/src/routes/_layout/about.tsx +6 -0
  88. package/templates/template-react18-tanstack-jotai-tailwindcss/src/routes/_layout/index.tsx +6 -0
  89. package/templates/template-react18-tanstack-jotai-tailwindcss/src/routes/_layout.tsx +23 -0
  90. package/templates/template-react18-tanstack-jotai-tailwindcss/src/store/index.ts +1 -0
  91. package/templates/template-react18-tanstack-jotai-tailwindcss/src/store/module/favorite.ts +5 -0
  92. package/templates/template-react18-tanstack-jotai-tailwindcss/src/styles/animation.css +8 -0
  93. package/templates/template-react18-tanstack-jotai-tailwindcss/src/styles/main.css +11 -0
  94. package/templates/template-react18-tanstack-jotai-tailwindcss/src/styles/tailwind.css +30 -0
  95. package/templates/template-react18-tanstack-jotai-tailwindcss/src/styles/variable.css +21 -0
  96. package/templates/template-react18-tanstack-jotai-tailwindcss/src/types/auto-imports.d.ts +33 -0
  97. package/templates/template-react18-tanstack-jotai-tailwindcss/src/types/color.d.ts +1 -0
  98. package/templates/template-react18-tanstack-jotai-tailwindcss/src/utils/rainbow-print.ts +10 -0
  99. package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/404/index.tsx +18 -0
  100. package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/About/index.tsx +7 -0
  101. package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/Index/Button/index.tsx +24 -0
  102. package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/Index/React/index.tsx +18 -0
  103. package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/Index/Vite/index.tsx +20 -0
  104. package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/Index/index.tsx +50 -0
  105. package/templates/template-react18-tanstack-jotai-tailwindcss/tailwind.config.js +8 -0
  106. package/templates/template-react18-tanstack-jotai-tailwindcss/tsconfig.app.json +36 -0
  107. package/templates/template-react18-tanstack-jotai-tailwindcss/tsconfig.json +7 -0
  108. package/templates/template-react18-tanstack-jotai-tailwindcss/tsconfig.node.json +24 -0
  109. package/templates/template-react18-tanstack-jotai-tailwindcss/types/vite-env.d.ts +10 -0
  110. package/templates/template-react18-tanstack-jotai-tailwindcss/vite.config.ts +15 -0
  111. package/templates/template-vue/eslint.config.js +59 -21
  112. package/templates/template-vue/package.json +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lik-app",
3
- "version": "1.1.3",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "licheung228 <licheung228@163.com>",
@@ -1,10 +1,10 @@
1
- import js from '@eslint/js'
2
- import globals from 'globals'
3
- import reactHooks from 'eslint-plugin-react-hooks'
4
- import reactRefresh from 'eslint-plugin-react-refresh'
5
- import tseslint from 'typescript-eslint'
6
- import prettier from 'eslint-plugin-prettier'
7
- import prettierConfig from './prettier.config.mjs'
1
+ import js from '@eslint/js';
2
+ import globals from 'globals';
3
+ import reactHooks from 'eslint-plugin-react-hooks';
4
+ import reactRefresh from 'eslint-plugin-react-refresh';
5
+ import tseslint from 'typescript-eslint';
6
+ import prettier from 'eslint-plugin-prettier';
7
+ import prettierConfig from './prettier.config.mjs';
8
8
 
9
9
  export default tseslint.config(
10
10
  { ignores: ['dist', 'node_modules'] },
@@ -23,14 +23,32 @@ export default tseslint.config(
23
23
  rules: {
24
24
  'prettier/prettier': ['error', prettierConfig],
25
25
  'no-useless-escape': 'error',
26
- // 'no-undef': 'error', // for unplugin-auto-import
27
- 'no-unused-vars': 'error',
28
- '@typescript-eslint/consistent-type-imports': 'error', // 要求 import type
29
- '@typescript-eslint/no-use-before-define': 'error',
26
+ // 'no-undef': 'error', // - for unplugin-auto-import
27
+ // '@typescript-eslint/no-non-null-assertion': 'error',
28
+ 'no-unused-vars': [
29
+ 'error',
30
+ // - 未使用的变量都以 _ 开头, 则忽略
31
+ {
32
+ argsIgnorePattern: '^_',
33
+ varsIgnorePattern: '^_'
34
+ }
35
+ ],
36
+ '@typescript-eslint/no-unused-vars': [
37
+ 'error',
38
+ {
39
+ argsIgnorePattern: '^_',
40
+ varsIgnorePattern: '^_'
41
+ }
42
+ ],
43
+ '@typescript-eslint/consistent-type-imports': 'error', // - 要求 import type
44
+ '@typescript-eslint/no-use-before-define': [
45
+ 'error',
46
+ {
47
+ functions: false
48
+ }
49
+ ],
30
50
  '@typescript-eslint/ban-ts-comment': 'error',
31
- '@typescript-eslint/no-non-null-assertion': 'error',
32
51
  '@typescript-eslint/explicit-module-boundary-types': 'error',
33
- '@typescript-eslint/no-unused-vars': 'error',
34
52
  '@typescript-eslint/no-explicit-any': 'error',
35
53
  '@typescript-eslint/no-var-requires': 'error',
36
54
  '@typescript-eslint/no-empty-function': 'error',
@@ -41,4 +59,4 @@ export default tseslint.config(
41
59
  ]
42
60
  }
43
61
  }
44
- )
62
+ );
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "new-lic-blog",
2
+ "name": "lik-create-app",
3
3
  "private": true,
4
4
  "version": "0.0.0",
5
5
  "type": "module",
@@ -1,10 +1,10 @@
1
- import js from '@eslint/js'
2
- import globals from 'globals'
3
- import reactHooks from 'eslint-plugin-react-hooks'
4
- import reactRefresh from 'eslint-plugin-react-refresh'
5
- import tseslint from 'typescript-eslint'
6
- import prettier from 'eslint-plugin-prettier'
7
- import prettierConfig from './prettier.config.mjs'
1
+ import js from '@eslint/js';
2
+ import globals from 'globals';
3
+ import reactHooks from 'eslint-plugin-react-hooks';
4
+ import reactRefresh from 'eslint-plugin-react-refresh';
5
+ import tseslint from 'typescript-eslint';
6
+ import prettier from 'eslint-plugin-prettier';
7
+ import prettierConfig from './prettier.config.mjs';
8
8
 
9
9
  export default tseslint.config(
10
10
  { ignores: ['dist', 'node_modules'] },
@@ -23,14 +23,32 @@ export default tseslint.config(
23
23
  rules: {
24
24
  'prettier/prettier': ['error', prettierConfig],
25
25
  'no-useless-escape': 'error',
26
- // 'no-undef': 'error', // for unplugin-auto-import
27
- 'no-unused-vars': 'error',
28
- '@typescript-eslint/consistent-type-imports': 'error', // 要求 import type
29
- '@typescript-eslint/no-use-before-define': 'error',
26
+ // 'no-undef': 'error', // - for unplugin-auto-import
27
+ // '@typescript-eslint/no-non-null-assertion': 'error',
28
+ 'no-unused-vars': [
29
+ 'error',
30
+ // - 未使用的变量都以 _ 开头, 则忽略
31
+ {
32
+ argsIgnorePattern: '^_',
33
+ varsIgnorePattern: '^_'
34
+ }
35
+ ],
36
+ '@typescript-eslint/no-unused-vars': [
37
+ 'error',
38
+ {
39
+ argsIgnorePattern: '^_',
40
+ varsIgnorePattern: '^_'
41
+ }
42
+ ],
43
+ '@typescript-eslint/consistent-type-imports': 'error', // - 要求 import type
44
+ '@typescript-eslint/no-use-before-define': [
45
+ 'error',
46
+ {
47
+ functions: false
48
+ }
49
+ ],
30
50
  '@typescript-eslint/ban-ts-comment': 'error',
31
- '@typescript-eslint/no-non-null-assertion': 'error',
32
51
  '@typescript-eslint/explicit-module-boundary-types': 'error',
33
- '@typescript-eslint/no-unused-vars': 'error',
34
52
  '@typescript-eslint/no-explicit-any': 'error',
35
53
  '@typescript-eslint/no-var-requires': 'error',
36
54
  '@typescript-eslint/no-empty-function': 'error',
@@ -41,4 +59,4 @@ export default tseslint.config(
41
59
  ]
42
60
  }
43
61
  }
44
- )
62
+ );
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "new-lic-blog",
2
+ "name": "lik-create-app",
3
3
  "private": true,
4
4
  "version": "0.0.0",
5
5
  "type": "module",
@@ -14,13 +14,13 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@gsap/react": "^2.1.1",
17
- "@tanstack/react-router": "^1.92.3",
17
+ "@tanstack/react-router": "^1.92.6",
18
18
  "@unocss/reset": "^0.64.1",
19
19
  "gsap": "^3.12.5",
20
20
  "jotai": "^2.11.0",
21
21
  "rainbow-print": "0.0.1-alpha.2",
22
- "react": "^18.3.1",
23
- "react-dom": "^18.3.1"
22
+ "react": "^19.0.0",
23
+ "react-dom": "^19.0.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@babel/plugin-proposal-decorators": "^7.25.9",
@@ -30,10 +30,10 @@
30
30
  "@tanstack/router-devtools": "^1.92.3",
31
31
  "@tanstack/router-plugin": "^1.91.1",
32
32
  "@types/node": "^22.9.1",
33
- "@types/react": "^18.3.12",
34
- "@types/react-dom": "^18.3.1",
33
+ "@types/react": "^19.0.2",
34
+ "@types/react-dom": "^19.0.2",
35
35
  "@typescript-eslint/eslint-plugin": "^8.15.0",
36
- "@vitejs/plugin-react": "^4.3.3",
36
+ "@vitejs/plugin-react": "^4.3.4",
37
37
  "eslint": "^9.14.0",
38
38
  "eslint-config-prettier": "^9.1.0",
39
39
  "eslint-plugin-prettier": "^5.2.1",
@@ -45,8 +45,8 @@
45
45
  "only-allow": "^1.2.1",
46
46
  "typescript": "~5.6.2",
47
47
  "typescript-eslint": "^8.13.0",
48
- "unocss": "^0.64.0",
48
+ "unocss": "^0.65.3",
49
49
  "unplugin-auto-import": "^0.18.6",
50
- "vite": "^5.4.10"
50
+ "vite": "^6.0.6"
51
51
  }
52
52
  }
@@ -0,0 +1,6 @@
1
+ BG_COLOR='\e[42m'
2
+ RESET='\e[0m'
3
+
4
+ npx --no -- commitlint --edit $1
5
+
6
+ printf "\n${BG_COLOR}${FG_COLOR} >>>>>> Commit Lint Success <<<<<< ${RESET}\n"
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ '*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
3
+ '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --parser json --write'],
4
+ 'package.json': ['prettier --write'],
5
+ // '*.{scss,less,styl,css,html}': ['stylelint --fix', 'prettier --write'],
6
+ '*.md': ['prettier --write'],
7
+ '*.hbs': ['prettier --write']
8
+ }
@@ -0,0 +1,10 @@
1
+ BG_COLOR='\e[42m' # 背景色
2
+ RESET='\e[0m' # 重置所有格式
3
+
4
+ npx tsc
5
+
6
+ printf "\n${BG_COLOR}${FG_COLOR} >>>>>> TS Check Success <<<<<< ${RESET}\r\n\n"
7
+
8
+ pnpm run lint
9
+
10
+ printf "\n${BG_COLOR}${FG_COLOR} >>>>>> Code Lint Success <<<<<< ${RESET}\r\n\n"
@@ -0,0 +1,13 @@
1
+ node_modules
2
+ .idea
3
+ .vscode
4
+ .DS_Store
5
+
6
+ .git/node_modules/**
7
+ /dist/
8
+ /dist*
9
+ /public/*
10
+ /docs/*
11
+ /docs/**/*
12
+ /plop/**/*
13
+ CHANGELOG
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "bradlc.vscode-tailwindcss"
4
+ ]
5
+ }
@@ -0,0 +1,40 @@
1
+ # Lic-Blog
2
+
3
+ ## @/components
4
+
5
+ the common components / pages components
6
+
7
+ ### Naming
8
+
9
+ **common components**
10
+
11
+ dirname start with lower case
12
+
13
+ **views components**
14
+
15
+ - in the views directory
16
+ - dirname start with upper case
17
+ - correspondence to the layout route name
18
+
19
+ ## commit standard
20
+
21
+ ### lint
22
+
23
+ - eslint
24
+ - prettier
25
+ - lint-staged
26
+
27
+ ### commit lint
28
+
29
+ - @commitlint/cli
30
+ - @commitlint/config-conventional
31
+
32
+ ## the commit message should be
33
+
34
+ - "feat: xxx" add xxx
35
+ - "fix: xxx" fix bug xxx
36
+ - "docs: xxx" add docs
37
+ - "style: xxx" style change
38
+ - "refactor: xxx" refactor code
39
+
40
+ ... and more in /commitlint.config.mjs
@@ -0,0 +1,27 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
25
+
26
+ # types
27
+ types/auto-imports.d.ts
@@ -0,0 +1,28 @@
1
+ export default {
2
+ extends: ['@commitlint/config-conventional'],
3
+ rules: {
4
+ 'type-enum': [
5
+ 2,
6
+ 'always',
7
+ [
8
+ 'feat', // 新功能(feature)
9
+ 'fix', // 修补bug
10
+ 'docs', // 文档(documentation)
11
+ 'style', // 格式、样式(不影响代码运行的变动)
12
+ 'refactor', // 重构(即不是新增功能,也不是修改BUG的代码)
13
+ 'perf', // 优化相关,比如提升性能、体验
14
+ 'test', // 添加测试
15
+ 'ci', // 持续集成修改
16
+ 'chore', // 构建过程或辅助工具的变动
17
+ 'revert', // 回滚到上一个版本
18
+ 'workflow', // 工作流改进
19
+ 'mod', // 不确定分类的修改
20
+ 'wip', // 开发中
21
+ 'types', // 类型修改
22
+ 'release' // 版本发布
23
+ ]
24
+ ],
25
+ 'subject-full-stop': [0, 'never'],
26
+ 'subject-case': [0, 'never']
27
+ }
28
+ }
@@ -0,0 +1,36 @@
1
+ import { defineConfig } from 'vite';
2
+ import type { Plugin } from 'vite';
3
+ import react from '@vitejs/plugin-react';
4
+ import { TanStackRouterVite } from '@tanstack/router-plugin/vite';
5
+ import AutoImport from 'unplugin-auto-import/vite';
6
+ import path from 'node:path';
7
+ import process from 'node:process';
8
+
9
+ const basePlugins: Plugin[] = [
10
+ react({
11
+ babel: {
12
+ plugins: [
13
+ ['@babel/plugin-proposal-decorators', { legacy: true }]
14
+ // ['@babel/plugin-proposal-class-properties', { loose: true }]
15
+ ]
16
+ }
17
+ }),
18
+ TanStackRouterVite(),
19
+ AutoImport({
20
+ include: [
21
+ /\.[tj]sx?$/ // .ts, .tsx, .js, .jsx
22
+ ],
23
+ imports: ['react', 'jotai'],
24
+ // 为true时在项目根目录自动创建
25
+ dts: 'src/types/auto-imports.d.ts'
26
+ })
27
+ ];
28
+
29
+ export default defineConfig({
30
+ plugins: basePlugins,
31
+ resolve: {
32
+ alias: {
33
+ '@': path.resolve(process.cwd(), 'src')
34
+ }
35
+ }
36
+ });
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite';
2
+
3
+ export default defineConfig({
4
+ server: {
5
+ port: 8220
6
+ }
7
+ });
@@ -0,0 +1,2 @@
1
+ VITE_APP_DOMAIN="https://api.example.com"
2
+ VITE_APP_SSL=""
@@ -0,0 +1 @@
1
+ VITE_APP_DOMAIN="https://api.example.com"
@@ -0,0 +1,62 @@
1
+ import js from '@eslint/js';
2
+ import globals from 'globals';
3
+ import reactHooks from 'eslint-plugin-react-hooks';
4
+ import reactRefresh from 'eslint-plugin-react-refresh';
5
+ import tseslint from 'typescript-eslint';
6
+ import prettier from 'eslint-plugin-prettier';
7
+ import prettierConfig from './prettier.config.mjs';
8
+
9
+ export default tseslint.config(
10
+ { ignores: ['dist', 'node_modules'] },
11
+ {
12
+ extends: [js.configs.recommended, ...tseslint.configs.recommended],
13
+ files: ['**/*.{ts,tsx}'],
14
+ languageOptions: {
15
+ ecmaVersion: 2020,
16
+ globals: globals.browser
17
+ },
18
+ plugins: {
19
+ prettier,
20
+ 'react-hooks': reactHooks,
21
+ 'react-refresh': reactRefresh
22
+ },
23
+ rules: {
24
+ 'prettier/prettier': ['error', prettierConfig],
25
+ 'no-useless-escape': 'error',
26
+ // 'no-undef': 'error', // - for unplugin-auto-import
27
+ // '@typescript-eslint/no-non-null-assertion': 'error',
28
+ 'no-unused-vars': [
29
+ 'error',
30
+ // - 未使用的变量都以 _ 开头, 则忽略
31
+ {
32
+ argsIgnorePattern: '^_',
33
+ varsIgnorePattern: '^_'
34
+ }
35
+ ],
36
+ '@typescript-eslint/no-unused-vars': [
37
+ 'error',
38
+ {
39
+ argsIgnorePattern: '^_',
40
+ varsIgnorePattern: '^_'
41
+ }
42
+ ],
43
+ '@typescript-eslint/consistent-type-imports': 'error', // - 要求 import type
44
+ '@typescript-eslint/no-use-before-define': [
45
+ 'error',
46
+ {
47
+ functions: false
48
+ }
49
+ ],
50
+ '@typescript-eslint/ban-ts-comment': 'error',
51
+ '@typescript-eslint/explicit-module-boundary-types': 'error',
52
+ '@typescript-eslint/no-explicit-any': 'error',
53
+ '@typescript-eslint/no-var-requires': 'error',
54
+ '@typescript-eslint/no-empty-function': 'error',
55
+ ...reactHooks.configs.recommended.rules,
56
+ 'react-refresh/only-export-components': [
57
+ 'warn',
58
+ { allowConstantExport: true }
59
+ ]
60
+ }
61
+ }
62
+ );
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/lic.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Lic-Vite-React-Jotai-Tanstack</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.tsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "lik-create-app",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "dev:test": "vite --mode test",
9
+ "build": "tsc -b && vite build",
10
+ "preview": "vite preview",
11
+ "lint": "eslint .",
12
+ "preinstall": "npx only-allow pnpm",
13
+ "prepare": "husky"
14
+ },
15
+ "dependencies": {
16
+ "@tanstack/react-router": "^1.92.6",
17
+ "jotai": "^2.11.0",
18
+ "rainbow-print": "0.0.1-alpha.2",
19
+ "react": "^19.0.0",
20
+ "react-dom": "^19.0.0"
21
+ },
22
+ "devDependencies": {
23
+ "@babel/plugin-proposal-decorators": "^7.25.9",
24
+ "@commitlint/cli": "^19.6.0",
25
+ "@commitlint/config-conventional": "^19.6.0",
26
+ "@eslint/js": "^9.13.0",
27
+ "@tanstack/router-devtools": "^1.92.3",
28
+ "@tanstack/router-plugin": "^1.91.1",
29
+ "@types/node": "^22.9.1",
30
+ "@types/react": "^19.0.2",
31
+ "@types/react-dom": "^19.0.2",
32
+ "@typescript-eslint/eslint-plugin": "^8.15.0",
33
+ "@vitejs/plugin-react": "^4.3.4",
34
+ "autoprefixer": "^10.4.20",
35
+ "eslint": "^9.14.0",
36
+ "eslint-config-prettier": "^9.1.0",
37
+ "eslint-plugin-prettier": "^5.2.1",
38
+ "eslint-plugin-react-hooks": "^5.0.0",
39
+ "eslint-plugin-react-refresh": "^0.4.14",
40
+ "globals": "^15.11.0",
41
+ "husky": "^9.1.7",
42
+ "lint-staged": "^15.2.10",
43
+ "only-allow": "^1.2.1",
44
+ "tailwindcss": "^3.4.17",
45
+ "typescript": "~5.6.2",
46
+ "typescript-eslint": "^8.13.0",
47
+ "unplugin-auto-import": "^0.18.6",
48
+ "vite": "^6.0.6"
49
+ }
50
+ }
@@ -0,0 +1,6 @@
1
+ export default {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ }
@@ -0,0 +1,11 @@
1
+ export default {
2
+ singleQuote: true,
3
+ semi: true,
4
+ bracketSpacing: true,
5
+ htmlWhitespaceSensitivity: 'ignore',
6
+ endOfLine: 'auto',
7
+ trailingComma: 'none',
8
+ tabWidth: 2,
9
+ printWidth: 80,
10
+ proseWrap: 'preserve'
11
+ }