create-young-proj 1.5.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/package.json +1 -1
  3. package/template-nuxt-admin/README.md +1 -1
  4. package/template-nuxt-admin/nuxt.config.ts +4 -5
  5. package/template-nuxt-admin/package.json +0 -1
  6. package/template-nuxt-admin/server/plugins/env.ts +8 -0
  7. package/template-nuxt-admin/yarn.lock +0 -5
  8. package/template-nuxt-mobile/.nvmrc +1 -0
  9. package/{template-vue-mobile → template-nuxt-mobile}/.vscode/extensions.json +5 -3
  10. package/template-nuxt-mobile/.vscode/settings.json +39 -0
  11. package/{template-vue-mobile → template-nuxt-mobile}/Dockerfile +12 -13
  12. package/template-nuxt-mobile/README.md +90 -0
  13. package/template-nuxt-mobile/_gitignore +26 -0
  14. package/template-nuxt-mobile/_npmrc +2 -0
  15. package/template-nuxt-mobile/_nvmrc +1 -0
  16. package/template-nuxt-mobile/app.vue +79 -0
  17. package/template-nuxt-mobile/boot.mjs +17 -0
  18. package/template-nuxt-mobile/components/young/CodeInput.vue +72 -0
  19. package/template-nuxt-mobile/composables/api.ts +57 -0
  20. package/template-nuxt-mobile/composables/apis/get.ts +22 -0
  21. package/template-nuxt-mobile/composables/apis/index.ts +8 -0
  22. package/template-nuxt-mobile/composables/apis/post.ts +39 -0
  23. package/template-nuxt-mobile/composables/share.ts +22 -0
  24. package/template-nuxt-mobile/composables/user.ts +48 -0
  25. package/template-nuxt-mobile/composables/utils.ts +80 -0
  26. package/template-nuxt-mobile/config/.devrc +2 -0
  27. package/template-nuxt-mobile/env.d.ts +65 -0
  28. package/template-nuxt-mobile/error.vue +69 -0
  29. package/template-nuxt-mobile/eslint.config.js +33 -0
  30. package/template-nuxt-mobile/layouts/blank.vue +11 -0
  31. package/template-nuxt-mobile/layouts/default.vue +32 -0
  32. package/template-nuxt-mobile/layouts/tabbar.vue +29 -0
  33. package/template-nuxt-mobile/middleware/auth.global.ts +34 -0
  34. package/template-nuxt-mobile/nuxt.config.ts +78 -0
  35. package/template-nuxt-mobile/package.json +40 -0
  36. package/template-nuxt-mobile/pages/base/login.vue +124 -0
  37. package/template-nuxt-mobile/pages/base/resetPasswd.vue +84 -0
  38. package/template-nuxt-mobile/pages/index.vue +22 -0
  39. package/template-nuxt-mobile/pages/my.vue +18 -0
  40. package/template-nuxt-mobile/pages/sub/[id].vue +21 -0
  41. package/template-nuxt-mobile/public/favicon.ico +0 -0
  42. package/template-nuxt-mobile/public/robots.txt +2 -0
  43. package/template-nuxt-mobile/server/plugins/init.ts +94 -0
  44. package/template-nuxt-mobile/server/routes/get/env.ts +13 -0
  45. package/template-nuxt-mobile/server/tsconfig.json +3 -0
  46. package/template-nuxt-mobile/server/utils/index.ts +12 -0
  47. package/template-nuxt-mobile/server/utils/proxy.ts +59 -0
  48. package/template-nuxt-mobile/tsconfig.json +4 -0
  49. package/template-nuxt-mobile/typings/system.d.ts +22 -0
  50. package/template-nuxt-mobile/uno.config.ts +40 -0
  51. package/template-nuxt-mobile/utils/tool.ts +153 -0
  52. package/template-nuxt-mobile/yarn.lock +7737 -0
  53. package/template-nuxt-website/README.md +3 -1
  54. package/template-nuxt-website/nuxt.config.ts +4 -5
  55. package/template-vitepress/.vitepress/components/HomePage.vue +9 -7
  56. package/template-vitepress/.vitepress/components/TodoItem.vue +7 -3
  57. package/template-vitepress/.vscode/settings.json +39 -0
  58. package/template-vitepress/README.md +2 -0
  59. package/template-vitepress/boot.mjs +7 -8
  60. package/template-vitepress/eslint.config.js +46 -0
  61. package/template-vitepress/nitro.config.ts +1 -2
  62. package/template-vitepress/package.json +19 -6
  63. package/template-vitepress/tsconfig.json +1 -1
  64. package/template-vitepress/yarn.lock +5459 -0
  65. package/template-vue-mobile/.vscode/base.code-snippets +0 -24
  66. package/template-vue-mobile/.vscode/settings.json +0 -7
  67. package/template-vue-mobile/README.md +0 -71
  68. package/template-vue-mobile/_env +0 -6
  69. package/template-vue-mobile/_gitignore +0 -30
  70. package/template-vue-mobile/boot.mjs +0 -16
  71. package/template-vue-mobile/build/custom-plugin.ts +0 -30
  72. package/template-vue-mobile/build/index.ts +0 -7
  73. package/template-vue-mobile/build/plugins.ts +0 -68
  74. package/template-vue-mobile/config/.devrc +0 -2
  75. package/template-vue-mobile/index.html +0 -25
  76. package/template-vue-mobile/nitro.config.ts +0 -19
  77. package/template-vue-mobile/package.json +0 -48
  78. package/template-vue-mobile/plugins/env.ts +0 -26
  79. package/template-vue-mobile/public/vite.svg +0 -1
  80. package/template-vue-mobile/rome.json +0 -24
  81. package/template-vue-mobile/routes/[...all].ts +0 -11
  82. package/template-vue-mobile/routes/get/env.ts +0 -25
  83. package/template-vue-mobile/src/App.vue +0 -29
  84. package/template-vue-mobile/src/auto-components.d.ts +0 -24
  85. package/template-vue-mobile/src/auto-imports.d.ts +0 -289
  86. package/template-vue-mobile/src/components/Init.vue +0 -36
  87. package/template-vue-mobile/src/global.d.ts +0 -7
  88. package/template-vue-mobile/src/hooks/useVerifyCode.ts +0 -46
  89. package/template-vue-mobile/src/layouts/blank.vue +0 -9
  90. package/template-vue-mobile/src/layouts/default.vue +0 -27
  91. package/template-vue-mobile/src/layouts/sub.vue +0 -20
  92. package/template-vue-mobile/src/main.ts +0 -35
  93. package/template-vue-mobile/src/modules/1-router.ts +0 -40
  94. package/template-vue-mobile/src/modules/2-pinia.ts +0 -10
  95. package/template-vue-mobile/src/modules/3-net.ts +0 -46
  96. package/template-vue-mobile/src/modules/4-auth.ts +0 -64
  97. package/template-vue-mobile/src/views/[...all_404].vue +0 -557
  98. package/template-vue-mobile/src/views/base/login.vue +0 -110
  99. package/template-vue-mobile/src/views/base/resetPasswd.vue +0 -88
  100. package/template-vue-mobile/src/views/index.vue +0 -18
  101. package/template-vue-mobile/src/views/my.vue +0 -15
  102. package/template-vue-mobile/src/views/sub.vue +0 -18
  103. package/template-vue-mobile/src/vite-env.d.ts +0 -43
  104. package/template-vue-mobile/tsconfig.json +0 -21
  105. package/template-vue-mobile/tsconfig.node.json +0 -9
  106. package/template-vue-mobile/unocss.config.ts +0 -47
  107. package/template-vue-mobile/vite.config.ts +0 -32
  108. package/template-vue-mobile/yarn.lock +0 -4395
  109. /package/{template-vue-mobile → template-nuxt-mobile}/config/.onlinerc +0 -0
  110. /package/{template-vue-mobile → template-nuxt-mobile}/config/.testrc +0 -0
@@ -75,7 +75,9 @@ npm i -g young-commit
75
75
 
76
76
  兼容 `PC` 端与移动端
77
77
 
78
- **移动端最低兼容钉钉浏览器**
78
+ **理论上最低兼容 `chrome58`**
79
+
80
+ **`ios` 支付宝内置浏览器,切页面会出问题**
79
81
 
80
82
  ## 常用的操作
81
83
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-09-21 15:57:55
4
- * @LastEditTime: 2023-11-15 11:53:36
4
+ * @LastEditTime: 2023-11-30 11:05:04
5
5
  * @Description:
6
6
  */
7
7
  import { resolve } from 'node:path'
@@ -97,11 +97,10 @@ export default defineNuxtConfig({
97
97
 
98
98
  'vite': {
99
99
  build: {
100
- // 兼容钉钉浏览器
101
- target: 'es2015',
102
100
  sourcemap: false,
103
- /* hack fix 360 极速浏览器 13.5 不支持 inset */
104
- cssTarget: 'chrome61',
101
+ // 兼容旧浏览器
102
+ target: ['chrome58'],
103
+ cssTarget: ['chrome58'],
105
104
  },
106
105
  },
107
106
  'runtimeConfig': {
@@ -19,17 +19,17 @@ const teamMembers = [
19
19
  },
20
20
  {
21
21
  icon: {
22
- svg: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="#C71D23" d="M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12a12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296Z"/></svg>'
22
+ svg: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="#C71D23" d="M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12a12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296Z"/></svg>',
23
23
  },
24
24
  link: 'https://gitee.com/BluesYoung-web',
25
25
  },
26
26
  {
27
27
  icon: {
28
- svg: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32"><g fill="none"><rect width="30" height="22" x="1" y="5" fill="#B4ACBC" rx="1.5"/><rect width="28" height="18" x="2" y="7" fill="#CDC4D6" rx="1"/><path fill="#E1D8EC" d="m30 23.4l-12.971-7.782a2 2 0 0 0-2.058 0L2 23.4V25a1 1 0 0 0 1 1h26a1 1 0 0 0 1-1v-1.6Z"/><path fill="#998EA4" d="M2 9.766V8h28v1.766L17.544 17.24a3 3 0 0 1-3.088 0L2 9.766Z"/><path fill="#F3EEF8" d="M2 8.6V7a1 1 0 0 1 1-1h26a1 1 0 0 1 1 1v1.6l-12.971 7.783a2 2 0 0 1-2.058 0L2 8.6Z"/><path fill="#00A6ED" d="M16 23a7 7 0 1 0 0-14a7 7 0 0 0 0 14Z"/><path fill="#F4F4F4" d="M16 11.5c-1.21-.02-2.36.44-3.22 1.3c-.87.85-1.34 1.99-1.34 3.2c0 2.48 2.02 4.5 4.5 4.5a.47.47 0 1 0 0-.94c-1.96 0-3.56-1.6-3.56-3.56c0-.96.38-1.86 1.06-2.53c.68-.67 1.59-1.03 2.55-1.03c1.93.03 3.51 1.65 3.51 3.62v.81a.67.67 0 0 1-1.34 0v-3.08a.47.47 0 0 0-.47-.47c-.26 0-.49.21-.49.47v.09c-.44-.35-.99-.57-1.6-.57c-1.4 0-2.54 1.14-2.54 2.54c0 1.4 1.14 2.54 2.54 2.54c.7 0 1.34-.29 1.8-.75c.28.5.81.84 1.42.84c.89 0 1.62-.73 1.62-1.62v-.81c0-2.47-1.99-4.52-4.44-4.55Zm-.39 5.96c-.88 0-1.6-.72-1.6-1.6c0-.88.72-1.6 1.6-1.6c.88 0 1.6.72 1.6 1.6c0 .88-.72 1.6-1.6 1.6Z"/></g></svg>'
28
+ svg: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32"><g fill="none"><rect width="30" height="22" x="1" y="5" fill="#B4ACBC" rx="1.5"/><rect width="28" height="18" x="2" y="7" fill="#CDC4D6" rx="1"/><path fill="#E1D8EC" d="m30 23.4l-12.971-7.782a2 2 0 0 0-2.058 0L2 23.4V25a1 1 0 0 0 1 1h26a1 1 0 0 0 1-1v-1.6Z"/><path fill="#998EA4" d="M2 9.766V8h28v1.766L17.544 17.24a3 3 0 0 1-3.088 0L2 9.766Z"/><path fill="#F3EEF8" d="M2 8.6V7a1 1 0 0 1 1-1h26a1 1 0 0 1 1 1v1.6l-12.971 7.783a2 2 0 0 1-2.058 0L2 8.6Z"/><path fill="#00A6ED" d="M16 23a7 7 0 1 0 0-14a7 7 0 0 0 0 14Z"/><path fill="#F4F4F4" d="M16 11.5c-1.21-.02-2.36.44-3.22 1.3c-.87.85-1.34 1.99-1.34 3.2c0 2.48 2.02 4.5 4.5 4.5a.47.47 0 1 0 0-.94c-1.96 0-3.56-1.6-3.56-3.56c0-.96.38-1.86 1.06-2.53c.68-.67 1.59-1.03 2.55-1.03c1.93.03 3.51 1.65 3.51 3.62v.81a.67.67 0 0 1-1.34 0v-3.08a.47.47 0 0 0-.47-.47c-.26 0-.49.21-.49.47v.09c-.44-.35-.99-.57-1.6-.57c-1.4 0-2.54 1.14-2.54 2.54c0 1.4 1.14 2.54 2.54 2.54c.7 0 1.34-.29 1.8-.75c.28.5.81.84 1.42.84c.89 0 1.62-.73 1.62-1.62v-.81c0-2.47-1.99-4.52-4.44-4.55Zm-.39 5.96c-.88 0-1.6-.72-1.6-1.6c0-.88.72-1.6 1.6-1.6c.88 0 1.6.72 1.6 1.6c0 .88-.72 1.6-1.6 1.6Z"/></g></svg>',
29
29
  },
30
30
  link: 'mailto:bluesyoung_web@163.com',
31
31
  },
32
- ]
32
+ ],
33
33
  },
34
34
  ]
35
35
  </script>
@@ -42,10 +42,12 @@ const teamMembers = [
42
42
  <h2 id="meet-the-team" op50 font-normal p="t-10 b-2">
43
43
  贡献者
44
44
  </h2>
45
- <div w-full p-10 :class="{
46
- 'flex justify-center items-center': teamMembers.length === 1
47
- }">
48
- <VPTeamMembers :members="teamMembers" />
45
+ <div
46
+ w-full p-10 :class="{
47
+ 'flex justify-center items-center': teamMembers.length === 1,
48
+ }"
49
+ >
50
+ <VPTeamMembers :members="teamMembers" />
49
51
  </div>
50
52
  </div>
51
53
  </main>
@@ -2,15 +2,19 @@
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-11-17 10:56:27
4
4
  * @LastEditTime: 2023-11-17 14:05:37
5
- * @Description:
5
+ * @Description:
6
6
  -->
7
7
  <script lang="ts" setup>
8
8
  import { ref } from 'vue'
9
+
9
10
  const checked = ref(false)
10
11
  </script>
12
+
11
13
  <template>
12
14
  <div class="flex items-center cursor-pointer my-2" @click="checked = !checked">
13
- <div class="mr-2">{{ checked ? '✅' : '⬜️' }}</div>
15
+ <div class="mr-2">
16
+ {{ checked ? '✅' : '⬜️' }}
17
+ </div>
14
18
  <slot />
15
19
  </div>
16
- </template>
20
+ </template>
@@ -0,0 +1,39 @@
1
+ {
2
+ "prettier.enable": false,
3
+ "editor.formatOnSave": false,
4
+
5
+ // Enable the ESlint flat config support
6
+ "eslint.experimental.useFlatConfig": true,
7
+ // Auto fix
8
+ "editor.codeActionsOnSave": {
9
+ "source.fixAll.eslint": "explicit",
10
+ "source.organizeImports": "never"
11
+ },
12
+
13
+ // Silent the stylistic rules in you IDE, but still auto fix them
14
+ "eslint.rules.customizations": [
15
+ { "rule": "style/*", "severity": "off" },
16
+ { "rule": "*-indent", "severity": "off" },
17
+ { "rule": "*-spacing", "severity": "off" },
18
+ { "rule": "*-spaces", "severity": "off" },
19
+ { "rule": "*-order", "severity": "off" },
20
+ { "rule": "*-dangle", "severity": "off" },
21
+ { "rule": "*-newline", "severity": "off" },
22
+ { "rule": "*quotes", "severity": "off" },
23
+ { "rule": "*semi", "severity": "off" }
24
+ ],
25
+
26
+ // Enable eslint for all supported languages
27
+ "eslint.validate": [
28
+ "javascript",
29
+ "javascriptreact",
30
+ "typescript",
31
+ "typescriptreact",
32
+ "vue",
33
+ "html",
34
+ "markdown",
35
+ "json",
36
+ "jsonc",
37
+ "yaml"
38
+ ]
39
+ }
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![](https://img.shields.io/badge/Author-BluesYoung--web-blue)](https://gitee.com/BluesYoung-web)
4
4
 
5
+ [![code style](https://antfu.me/badge-code-style.svg)](https://github.com/antfu/eslint-config)
6
+
5
7
  ## 本地运行
6
8
 
7
9
  ::: code-group
@@ -5,13 +5,12 @@
5
5
  * @Description:
6
6
  */
7
7
  (async () => {
8
- const env = process.env.DEPLOY_ENV || 'dev';
9
- const listenPort = process.env.LISTEN_PORT || 3333;
10
- console.log('当前环境:', env);
11
- console.log('服务监听端口:', listenPort);
8
+ const env = process.env.DEPLOY_ENV || 'dev'
9
+ const listenPort = process.env.LISTEN_PORT || 3333
10
+ console.log('当前环境:', env)
11
+ console.log('服务监听端口:', listenPort)
12
12
 
13
- process.env.NITRO_PORT = listenPort;
14
-
15
- await import('./.output/server/index.mjs');
16
- })();
13
+ process.env.NITRO_PORT = listenPort
17
14
 
15
+ await import('./.output/server/index.mjs')
16
+ })()
@@ -0,0 +1,46 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2023-11-01 10:13:50
4
+ * @LastEditTime: 2023-11-30 11:34:48
5
+ * @Description:
6
+ */
7
+ import antfu from '@antfu/eslint-config'
8
+
9
+ export default antfu({
10
+ overrides: {
11
+ vue: {
12
+ 'vue/valid-v-model': 'off',
13
+ 'vue/no-unused-refs': 'off',
14
+ 'vue/no-lone-template': 'off',
15
+ 'vue/valid-attribute-name': 'off',
16
+ },
17
+ typescript: {
18
+ 'ts/no-use-before-define': 'off',
19
+ 'ts/no-unused-vars': 'off',
20
+ 'ts/ban-types': 'off',
21
+ 'ts/ban-ts-comment': 'off',
22
+ 'ts/no-unnecessary-type-constraint': 'off',
23
+ 'import/no-duplicates': 'off',
24
+ },
25
+ jsonc: {
26
+ 'jsonc/no-dupe-keys': 'off',
27
+ },
28
+ },
29
+ rules: {
30
+ 'no-console': 'off',
31
+ 'node/prefer-global/process': 'off',
32
+ 'unused-imports/no-unused-vars': 'off',
33
+ 'no-throw-literal': 'off',
34
+ 'antfu/consistent-list-newline': 'off',
35
+ 'style/jsx-indent': 'off',
36
+ 'node/handle-callback-err': 'off',
37
+ 'no-new': 'off',
38
+ 'no-async-promise-executor': 'off',
39
+ 'no-alert': 'off',
40
+ },
41
+ }, {
42
+ ignores: [
43
+ 'public',
44
+ 'bun.lockb',
45
+ ],
46
+ })
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2022-12-28 11:59:56
4
- * @LastEditTime: 2023-11-14 09:18:38
4
+ * @LastEditTime: 2023-11-30 12:08:40
5
5
  * @Description:
6
6
  */
7
7
  export default defineNitroConfig({
@@ -14,6 +14,5 @@ export default defineNitroConfig({
14
14
  dir: '.vitepress/dist',
15
15
  },
16
16
  ],
17
- preset: 'bun'
18
17
  });
19
18
 
@@ -1,26 +1,39 @@
1
1
  {
2
+ "type": "module",
3
+ "version": "0.0.0",
2
4
  "scripts": {
5
+ "lint": "eslint .",
6
+ "lint:fix": "eslint . --fix",
3
7
  "dev": "vitepress dev",
4
8
  "docs:dev": "vitepress dev",
5
9
  "docs:build": "vitepress build",
6
10
  "docs:preview": "vitepress preview",
7
11
  "build": "vitepress build && nitropack build",
8
- "postinstall": "nitropack prepare"
12
+ "postinstall": "nitropack prepare && simple-git-hooks"
13
+ },
14
+ "dependencies": {
15
+ "c12": "^1.5.1",
16
+ "md5": "^2.3.0"
9
17
  },
10
18
  "devDependencies": {
19
+ "@antfu/eslint-config": "^2.1.1",
11
20
  "@iconify/json": "^2.2.139",
12
21
  "@types/md5": "^2.3.5",
13
22
  "@types/node": "20",
23
+ "eslint": "^8.54.0",
24
+ "lint-staged": "^15.1.0",
14
25
  "nitropack": "^2.7.2",
15
26
  "pathe": "^1.1.1",
27
+ "simple-git-hooks": "^2.9.0",
16
28
  "unocss": "^0.57.2",
17
29
  "unplugin-vue-components": "^0.25.2",
18
- "vitepress": "^1.0.0-rc.25",
30
+ "vitepress": "1.0.0-rc.25",
19
31
  "vue": "^3.3.8"
20
32
  },
21
- "dependencies": {
22
- "c12": "^1.5.1",
23
- "md5": "^2.3.0"
33
+ "simple-git-hooks": {
34
+ "pre-commit": "npx lint-staged"
24
35
  },
25
- "version": "1.0.0"
36
+ "lint-staged": {
37
+ "*": "eslint --fix"
38
+ }
26
39
  }
@@ -1,3 +1,3 @@
1
1
  {
2
2
  "extends": "./.nitro/types/tsconfig.json"
3
- }
3
+ }