create-bubbles 0.1.2 → 0.1.4

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 (116) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/template-react-rsbuild-biome/biome.json +19 -4
  4. package/template-vue-rolldown-oxc/.gitlab-ci.yml +10 -2
  5. package/template-vue-rolldown-oxc/.oxlintrc.json +1 -14
  6. package/template-vue-rolldown-oxc/.vscode/settings.json +11 -0
  7. package/template-vue-rolldown-oxc/README.md +2 -30
  8. package/template-vue-rolldown-oxc/package.json +18 -16
  9. package/template-vue-rolldown-oxc/src/App.vue +12 -2
  10. package/template-vue-rolldown-oxc/src/utils/request/index.ts +1 -3
  11. package/template-vue-rolldown-oxc/src/views/home/index.vue +3 -2
  12. package/template-vue-rolldown-oxc/tsconfig.json +34 -2
  13. package/template-vue-rolldown-oxc/uno.config.ts +2 -5
  14. package/template-vue-rolldown-oxc/vite.config.ts +4 -3
  15. package/template-vue-rsbuild-biome/biome.json +33 -5
  16. package/template-vue-vite-biome/.env +4 -0
  17. package/template-vue-vite-biome/.env.development +1 -0
  18. package/template-vue-vite-biome/.env.production +1 -0
  19. package/template-vue-vite-biome/.gitlab-ci.yml +84 -0
  20. package/template-vue-vite-biome/.vscode/settings.json +10 -0
  21. package/template-vue-vite-biome/README.md +3 -0
  22. package/template-vue-vite-biome/biome.json +109 -0
  23. package/template-vue-vite-biome/commitlint.config.js +1 -0
  24. package/template-vue-vite-biome/index.html +13 -0
  25. package/template-vue-vite-biome/lefthook.yml +11 -0
  26. package/template-vue-vite-biome/package.json +50 -0
  27. package/template-vue-vite-biome/public/vite.svg +1 -0
  28. package/template-vue-vite-biome/src/App.vue +19 -0
  29. package/template-vue-vite-biome/src/assets/icon/vue.svg +1 -0
  30. package/template-vue-vite-biome/src/components/Icon/svg-icon.vue +29 -0
  31. package/template-vue-vite-biome/src/layout/default/index.vue +3 -0
  32. package/template-vue-vite-biome/src/main.ts +15 -0
  33. package/template-vue-vite-biome/src/router/guard/index.ts +7 -0
  34. package/template-vue-vite-biome/src/router/guard/permissionGuard.ts +13 -0
  35. package/template-vue-vite-biome/src/router/index.ts +17 -0
  36. package/template-vue-vite-biome/src/router/modules/index.ts +31 -0
  37. package/template-vue-vite-biome/src/store/index.ts +10 -0
  38. package/template-vue-vite-biome/src/store/modules/user.ts +17 -0
  39. package/template-vue-vite-biome/src/styles/element-plus-variables.css +4 -0
  40. package/template-vue-vite-biome/src/styles/font.scss +0 -0
  41. package/template-vue-vite-biome/src/styles/index.scss +31 -0
  42. package/template-vue-vite-biome/src/styles/variables.scss +3 -0
  43. package/template-vue-vite-biome/src/types/vite-env.d.ts +13 -0
  44. package/template-vue-vite-biome/src/utils/env.ts +10 -0
  45. package/template-vue-vite-biome/src/utils/request/core/index.ts +166 -0
  46. package/template-vue-vite-biome/src/utils/request/core/utils.ts +38 -0
  47. package/template-vue-vite-biome/src/utils/request/index.ts +39 -0
  48. package/template-vue-vite-biome/src/views/home/index.vue +16 -0
  49. package/template-vue-vite-biome/src/views/login/index.vue +11 -0
  50. package/template-vue-vite-biome/src/views/model/index.vue +7 -0
  51. package/{template-vue-rolldown-oxc/tsconfig.app.json → template-vue-vite-biome/tsconfig.json} +15 -4
  52. package/template-vue-vite-biome/uno.config.ts +10 -0
  53. package/template-vue-vite-biome/vite.config.ts +51 -0
  54. package/template-vue-vite-eslint/.env +6 -0
  55. package/template-vue-vite-eslint/.env.development +2 -0
  56. package/template-vue-vite-eslint/.env.production +1 -0
  57. package/template-vue-vite-eslint/.vscode/settings.json +62 -0
  58. package/template-vue-vite-eslint/README.md +3 -0
  59. package/template-vue-vite-eslint/commitlint.config.js +1 -0
  60. package/template-vue-vite-eslint/eslint.config.js +69 -0
  61. package/template-vue-vite-eslint/index.html +13 -0
  62. package/template-vue-vite-eslint/lefthook.yml +11 -0
  63. package/template-vue-vite-eslint/package.json +62 -0
  64. package/template-vue-vite-eslint/public/vite.svg +1 -0
  65. package/template-vue-vite-eslint/src/App.vue +19 -0
  66. package/template-vue-vite-eslint/src/api/index.ts +12 -0
  67. package/template-vue-vite-eslint/src/assets/icon/computer-data.svg +3 -0
  68. package/template-vue-vite-eslint/src/assets/icon/cpu.svg +3 -0
  69. package/template-vue-vite-eslint/src/assets/icon/data-search.svg +3 -0
  70. package/template-vue-vite-eslint/src/assets/icon/home.svg +3 -0
  71. package/template-vue-vite-eslint/src/assets/icon/knowledge-graph.svg +3 -0
  72. package/template-vue-vite-eslint/src/assets/icon/robot.svg +3 -0
  73. package/template-vue-vite-eslint/src/assets/icon/vue.svg +1 -0
  74. package/template-vue-vite-eslint/src/assets/image/.gitkeep +0 -0
  75. package/template-vue-vite-eslint/src/components/Icon/svg-icon.vue +29 -0
  76. package/template-vue-vite-eslint/src/hooks/chart/lib.ts +57 -0
  77. package/template-vue-vite-eslint/src/hooks/chart/useEcharts.ts +65 -0
  78. package/template-vue-vite-eslint/src/layout/default/header/index.vue +12 -0
  79. package/template-vue-vite-eslint/src/layout/default/index.vue +55 -0
  80. package/template-vue-vite-eslint/src/main.ts +17 -0
  81. package/template-vue-vite-eslint/src/router/guard/index.ts +7 -0
  82. package/template-vue-vite-eslint/src/router/guard/permissionGuard.ts +13 -0
  83. package/template-vue-vite-eslint/src/router/index.ts +18 -0
  84. package/template-vue-vite-eslint/src/router/interface.ts +9 -0
  85. package/template-vue-vite-eslint/src/router/modules/example.ts +21 -0
  86. package/template-vue-vite-eslint/src/router/modules/index.ts +79 -0
  87. package/template-vue-vite-eslint/src/store/index.ts +11 -0
  88. package/template-vue-vite-eslint/src/store/modules/user.ts +20 -0
  89. package/template-vue-vite-eslint/src/styles/element-plus-variables.css +3 -0
  90. package/template-vue-vite-eslint/src/styles/font.scss +0 -0
  91. package/template-vue-vite-eslint/src/styles/index.scss +32 -0
  92. package/template-vue-vite-eslint/src/styles/plus-pro-components-variables.css +3 -0
  93. package/template-vue-vite-eslint/src/styles/variables.scss +3 -0
  94. package/template-vue-vite-eslint/src/types/index.d.ts +1 -0
  95. package/template-vue-vite-eslint/src/types/vite-env.d.ts +15 -0
  96. package/template-vue-vite-eslint/src/utils/env.ts +11 -0
  97. package/template-vue-vite-eslint/src/utils/request/core/index.ts +186 -0
  98. package/template-vue-vite-eslint/src/utils/request/core/utils.ts +41 -0
  99. package/template-vue-vite-eslint/src/utils/request/index.ts +42 -0
  100. package/template-vue-vite-eslint/src/views/data-statistics/config.ts +11 -0
  101. package/template-vue-vite-eslint/src/views/data-statistics/index.vue +23 -0
  102. package/template-vue-vite-eslint/src/views/data-statistics/right/abc.vue +11 -0
  103. package/template-vue-vite-eslint/src/views/example/echart/config.ts +1794 -0
  104. package/template-vue-vite-eslint/src/views/example/echart/index.vue +22 -0
  105. package/template-vue-vite-eslint/src/views/example/h-full.vue +24 -0
  106. package/template-vue-vite-eslint/src/views/example/tree-chart.vue +94 -0
  107. package/template-vue-vite-eslint/src/views/home/index.vue +25 -0
  108. package/template-vue-vite-eslint/src/views/knowledge-graph/index.vue +11 -0
  109. package/template-vue-vite-eslint/src/views/login/index.vue +9 -0
  110. package/template-vue-vite-eslint/src/views/model/index.vue +7 -0
  111. package/{template-vue-rolldown-oxc/tsconfig.node.json → template-vue-vite-eslint/tsconfig.json} +20 -9
  112. package/template-vue-vite-eslint/uno.config.ts +21 -0
  113. package/template-vue-vite-eslint/vite.config.ts +62 -0
  114. package/template-vue-rolldown-oxc/components.d.ts +0 -18
  115. package/template-vue-rolldown-oxc/src/types/auto-import.d.ts +0 -78
  116. package/template-vue-rolldown-oxc/src/types/components.d.ts +0 -16
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ Available templates:
11
11
  ${s.vue(`vue-rsbuild-biome vue`)}
12
12
  ${s.vue(`vue-rolldown-oxc vue`)}
13
13
  ${s.react(`react-rsbuild-biome react`)}
14
- ${s.react(`react-rolldown-oxc react`)}`,d=e=>e.trim().replace(/\/+$/g,``),f=e=>{if(!e)return;let t=e.split(` `)[0].split(`/`);return{name:t[0],version:t[1]}},p=t=>{let n=e.readdirSync(t);return n.length===0||n.length===1&&n[0]===`.git`},m=async n=>{await Promise.all(e.readdirSync(n).filter(e=>e!==`.git`).map(r=>e.promises.rm(t.resolve(n,r),{recursive:!0,force:!0})))},h=e=>/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e),g=e=>e.trim().toLowerCase().replace(/\s+/g,`-`).replace(/^[._]/,``).replace(/[^a-z\d\-~]+g/,`-`),_=[{name:`vue`,display:`Vue`,color:s.vue,variants:[{name:`vue-rsbuild-biome`,display:`rsbuild + biome`,color:s.vue},{name:`vue-rolldown-oxc`,display:`rolldown + oxc`,color:s.vue}]},{name:`react`,display:`React`,color:s.react,variants:[{name:`react-rsbuild-biome`,display:`rsbuild-biome`,color:s.react}]},{name:`others`,display:`Others`,color:s.others,variants:[{name:`create-eletron-vite`,display:`Electron ↗`,color:s.others,customCommand:`pnpm create electron-vite@latest TARGET_DIR`}]}],v=_.map(e=>e.variants.map(e=>`${e.name}`)).reduce((e,t)=>e.concat(t),[]),y=(e,t)=>{console.log(`💦customCommand`,e,t);let n=t?t.name:`npm`,r=n===`yarn`&&t?.version.startsWith(`1.`);return e.replace(/^npm create (?:-- )?/,()=>n===`bun`?`bun x create-`:n===`pnpm`?`pnpm create `:e.startsWith(`npm create -- `)?`${n} create -- `:`${n} create `).replace(`@latest`,()=>r?``:`@latest`).replace(/^npm exec/,()=>n===`pnpm`?`pnpm dlx`:n===`yarn`&&!r?`yarn dlx`:n===`bun`?`bun x`:`npm exec`)},b={_gitignore:`.gitignore`},x=(n,r)=>{e.mkdirSync(r,{recursive:!0});for(let i of e.readdirSync(n))S(t.resolve(n,i),t.resolve(r,i))},S=(t,n)=>{e.statSync(t).isDirectory()?x(t,n):e.copyFileSync(t,n)},C=(t,n)=>{let r=e.readFileSync(t,`utf-8`);e.writeFileSync(t,n(r),`utf-8`)},w=(e,n)=>{C(t.resolve(e,`package.json`),e=>e.replace(/"@vitejs\/plugin-react": ".+?"/,`"@vitejs/plugin-react-swc": "^4.0.1"`)),C(t.resolve(e,`vite.config.${n?`ts`:`js`}`),e=>e.replace(`@vitejs/plugin-react`,`@vitejs/plugin-react-swc`))};(async()=>{console.log(c);let i=c._[0]?d(c._[0]):void 0,x=c.template,C=c.overwrite,T=`bubbles-project`;if(c.help){console.log(u);return}let E=f(process.env.npm_config_user_agent),D=()=>n.cancel(`Operation cancelled`),O=i;if(!O){let e=await n.text({message:`Project name`,defaultValue:T,placeholder:T,validate:e=>e.length===0||d(e).length>0?void 0:`Invalid project name`});if(n.isCancel(e))return D();O=d(e)}if(e.existsSync(O)&&!p(O)){let e=C?`yes`:await n.select({message:O===`.`?`Current directory`:`Target directory "${O}" is not empty. Please choose how to proceed:`,options:[{label:`${s.vue(`Cancel operation`)}`,value:`no`},{label:`Remove existing files and continue`,value:`yes`},{label:`Ignore files and continue`,value:`ignore`}]});if(n.isCancel(e))return D();switch(e){case`yes`:m(O);break;case`no`:D();return}}let k=t.basename(t.resolve(O));if(!h(k)){let e=await n.text({message:`Package name is invalid. please input again:`,defaultValue:g(k),placeholder:g(k),validate(e){if(!h(e))return`Invalid package.json name`}});if(n.isCancel(e))return D();k=e}let A=x,j=!1;if(x&&!v.includes(x)&&(A=void 0,j=!0),!A){let e=await n.select({message:j?`"${x}" isn't a valia template. please choose from below:`:`Select a framework`,options:_.map(e=>{let t=e.color;return{label:t(e.display),value:e}})});if(n.isCancel(e))return D();console.log(`💦pkgInfo`,E);let t=await n.select({message:`Select a variant:`,options:e.variants.map(e=>{let t=e.color,n=e.customCommand?y(e.customCommand,E).replace(/ TARGET_DIR$/,``):void 0;return{label:t(e.display||e.name),value:e.name,hint:n}})});if(n.isCancel(t))return D();A=t}let M=t.join(l,O);e.mkdirSync(M,{recursive:!0});let N=!1;A.includes(`-swc`)&&(N=!0,A=A.replace(`-swc`,``));let P=E?E.name:`npm`,{customCommand:F}=_.flatMap(e=>e.variants).find(e=>e.name===A)??{};if(F){let[e,...t]=y(F,E).split(` `),n=t.map(e=>e.replace(`TARGET_DIR`,()=>O));console.log(`💦replacedArgs`,n);let{status:r}=a.sync(e,n,{stdio:`inherit`});process.exit(r??0)}n.log.step(`scaffolding project in ${M}...`);let I=t.resolve(o(import.meta.url),`../..`,`template-${A}`),L=(n,r)=>{let i=t.join(M,b[n]??n);r?e.writeFileSync(i,r):S(t.join(I,n),i)},R=e.readdirSync(I);for(let e of R)e!==`package.json`&&L(e);let z=JSON.parse(e.readFileSync(t.join(I,`package.json`),`utf-8`));z.name=k,L(`package.json`,`${JSON.stringify(z,null,2)}\n`),N&&w(M,A.endsWith(`-ts`));let B=``,V=t.relative(l,M);switch(console.log(`💦cwd`,l),console.log(`💦root`,M),console.log(`💦cdProjectName`,V),B+=`Done. Now run:
14
+ ${s.react(`react-rolldown-oxc react`)}`,d=e=>e.trim().replace(/\/+$/g,``),f=e=>{if(!e)return;let t=e.split(` `)[0].split(`/`);return{name:t[0],version:t[1]}},p=t=>{let n=e.readdirSync(t);return n.length===0||n.length===1&&n[0]===`.git`},m=async n=>{await Promise.all(e.readdirSync(n).filter(e=>e!==`.git`).map(r=>e.promises.rm(t.resolve(n,r),{recursive:!0,force:!0})))},h=e=>/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e),g=e=>e.trim().toLowerCase().replace(/\s+/g,`-`).replace(/^[._]/,``).replace(/[^a-z\d\-~]+g/,`-`),_=[{name:`vue`,display:`Vue`,color:s.vue,variants:[{name:`vue-vite-eslint`,display:`vite + eslint`,color:s.vue},{name:`vue-rsbuild-biome`,display:`rsbuild + biome`,color:s.vue},{name:`vue-vite-oxc`,display:`rolldown + oxc`,color:s.vue},{name:`vue-vite-biome`,display:`vite + biome`,color:s.vue}]},{name:`react`,display:`React`,color:s.react,variants:[{name:`react-rsbuild-biome`,display:`rsbuild-biome`,color:s.react}]},{name:`others`,display:`Others`,color:s.others,variants:[{name:`create-eletron-vite`,display:`Electron ↗`,color:s.others,customCommand:`pnpm create electron-vite@latest TARGET_DIR`}]}],v=_.map(e=>e.variants.map(e=>`${e.name}`)).reduce((e,t)=>e.concat(t),[]),y=(e,t)=>{console.log(`💦customCommand`,e,t);let n=t?t.name:`npm`,r=n===`yarn`&&t?.version.startsWith(`1.`);return e.replace(/^npm create (?:-- )?/,()=>n===`bun`?`bun x create-`:n===`pnpm`?`pnpm create `:e.startsWith(`npm create -- `)?`${n} create -- `:`${n} create `).replace(`@latest`,()=>r?``:`@latest`).replace(/^npm exec/,()=>n===`pnpm`?`pnpm dlx`:n===`yarn`&&!r?`yarn dlx`:n===`bun`?`bun x`:`npm exec`)},b={_gitignore:`.gitignore`},x=(n,r)=>{e.mkdirSync(r,{recursive:!0});for(let i of e.readdirSync(n))S(t.resolve(n,i),t.resolve(r,i))},S=(t,n)=>{e.statSync(t).isDirectory()?x(t,n):e.copyFileSync(t,n)},C=(t,n)=>{let r=e.readFileSync(t,`utf-8`);e.writeFileSync(t,n(r),`utf-8`)},w=(e,n)=>{C(t.resolve(e,`package.json`),e=>e.replace(/"@vitejs\/plugin-react": ".+?"/,`"@vitejs/plugin-react-swc": "^4.0.1"`)),C(t.resolve(e,`vite.config.${n?`ts`:`js`}`),e=>e.replace(`@vitejs/plugin-react`,`@vitejs/plugin-react-swc`))};(async()=>{console.log(c);let i=c._[0]?d(c._[0]):void 0,x=c.template,C=c.overwrite,T=`bubbles-project`;if(c.help){console.log(u);return}let E=f(process.env.npm_config_user_agent),D=()=>n.cancel(`Operation cancelled`),O=i;if(!O){let e=await n.text({message:`Project name`,defaultValue:T,placeholder:T,validate:e=>e.length===0||d(e).length>0?void 0:`Invalid project name`});if(n.isCancel(e))return D();O=d(e)}if(e.existsSync(O)&&!p(O)){let e=C?`yes`:await n.select({message:O===`.`?`Current directory`:`Target directory "${O}" is not empty. Please choose how to proceed:`,options:[{label:`${s.vue(`Cancel operation`)}`,value:`no`},{label:`Remove existing files and continue`,value:`yes`},{label:`Ignore files and continue`,value:`ignore`}]});if(n.isCancel(e))return D();switch(e){case`yes`:m(O);break;case`no`:D();return}}let k=t.basename(t.resolve(O));if(!h(k)){let e=await n.text({message:`Package name is invalid. please input again:`,defaultValue:g(k),placeholder:g(k),validate(e){if(!h(e))return`Invalid package.json name`}});if(n.isCancel(e))return D();k=e}let A=x,j=!1;if(x&&!v.includes(x)&&(A=void 0,j=!0),!A){let e=await n.select({message:j?`"${x}" isn't a valia template. please choose from below:`:`Select a framework`,options:_.map(e=>{let t=e.color;return{label:t(e.display),value:e}})});if(n.isCancel(e))return D();console.log(`💦pkgInfo`,E);let t=await n.select({message:`Select a variant:`,options:e.variants.map(e=>{let t=e.color,n=e.customCommand?y(e.customCommand,E).replace(/ TARGET_DIR$/,``):void 0;return{label:t(e.display||e.name),value:e.name,hint:n}})});if(n.isCancel(t))return D();A=t}let M=t.join(l,O);e.mkdirSync(M,{recursive:!0});let N=!1;A.includes(`-swc`)&&(N=!0,A=A.replace(`-swc`,``));let P=E?E.name:`npm`,{customCommand:F}=_.flatMap(e=>e.variants).find(e=>e.name===A)??{};if(F){let[e,...t]=y(F,E).split(` `),n=t.map(e=>e.replace(`TARGET_DIR`,()=>O));console.log(`💦replacedArgs`,n);let{status:r}=a.sync(e,n,{stdio:`inherit`});process.exit(r??0)}n.log.step(`scaffolding project in ${M}...`);let I=t.resolve(o(import.meta.url),`../..`,`template-${A}`),L=(n,r)=>{let i=t.join(M,b[n]??n);r?e.writeFileSync(i,r):S(t.join(I,n),i)},R=e.readdirSync(I);for(let e of R)e!==`package.json`&&L(e);let z=JSON.parse(e.readFileSync(t.join(I,`package.json`),`utf-8`));z.name=k,L(`package.json`,`${JSON.stringify(z,null,2)}\n`),N&&w(M,A.endsWith(`-ts`));let B=``,V=t.relative(l,M);switch(console.log(`💦cwd`,l),console.log(`💦root`,M),console.log(`💦cdProjectName`,V),B+=`Done. Now run:
15
15
  `,M!==l&&(B+=`\n cd ${V.includes(` `)?`"${V}"`:V} `),P){case`yarn`:B+=`
16
16
  yarn`,B+=`
17
17
  yarn dev`;break;default:B+=r([`pink`,`white`])(`\n ${P} install`),B+=r([`pink`,`white`])(`\n ${P} run dev`);break}n.outro(B)})().catch(e=>{console.error(`💦`,e)});export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bubbles",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "author": "bubbles plant",
6
6
  "bin": {
@@ -17,7 +17,11 @@
17
17
  "useNumberNamespace": "off",
18
18
  "useNodejsImportProtocol": "off",
19
19
  "noNonNullAssertion": "off",
20
- "noUnusedTemplateLiteral": "off"
20
+ "noUnusedTemplateLiteral": "off",
21
+ "useConst": {
22
+ "level": "warn",
23
+ "fix": "unsafe"
24
+ }
21
25
  },
22
26
  "complexity": {
23
27
  "noUselessTypeConstraint": "off",
@@ -28,7 +32,12 @@
28
32
  "useExhaustiveDependencies": "off",
29
33
  "useHookAtTopLevel": "off",
30
34
  "noUnusedFunctionParameters": "off",
31
- "noUnusedVariables": "off"
35
+ "noUnusedVariables": "off",
36
+ "useUniqueElementIds": "off",
37
+ "useParseIntRadix": "off"
38
+ },
39
+ "security": {
40
+ "noDangerouslySetInnerHtml": "off"
32
41
  },
33
42
  "suspicious": {
34
43
  "noGlobalIsNan": "off",
@@ -53,9 +62,15 @@
53
62
  "noStaticElementInteractions": "off",
54
63
  "useAriaPropsSupportedByRole": "off",
55
64
  "useAriaPropsForRole": "off",
56
- "useValidAnchor": "off"
65
+ "useValidAnchor": "off",
66
+ "useMediaCaption": "off"
57
67
  },
58
- "nursery": "off"
68
+ "nursery": {
69
+ "useSortedClasses": {
70
+ "level": "warn",
71
+ "fix": "safe"
72
+ }
73
+ }
59
74
  }
60
75
  },
61
76
  "css": {
@@ -20,7 +20,7 @@
20
20
  \"msgtype\": \"markdown\",
21
21
  \"markdown\": {
22
22
  \"title\": \"GitLab CI/CD 通知\",
23
- \"text\": \"### ${title}\n\n- **阶段**: ${stage_name}\n- **任务**: [查看详情](${CI_JOB_URL})\n- **分支**: ${CI_COMMIT_REF_NAME}\n- **提交人**: ${CI_COMMIT_AUTHOR}\n- **提交信息**: ${CI_COMMIT_MESSAGE}\n- **时间**: $(date '+%Y-%m-%d %H:%M:%S')\"
23
+ \"text\": \"### ${title}\n\n- **项目**: ${CI_PROJECT_NAME}\n- **项目地址**: ${CI_PROJECT_URL}\n- **阶段**: ${stage_name}\n- **任务**: [查看详情](${CI_JOB_URL})\n- **分支**: ${CI_COMMIT_REF_NAME}\n- **提交人**: ${CI_COMMIT_AUTHOR}\n- **提交信息**: ${CI_COMMIT_MESSAGE}\n- **时间**: $(date '+%Y-%m-%d %H:%M:%S')\"
24
24
  }
25
25
  }"
26
26
 
@@ -30,6 +30,7 @@ stages:
30
30
 
31
31
  variables:
32
32
  DEPLOY_PATH: '/usr/local/bee/web/pipe-network/pipe-network-model'
33
+ MOCK_DEPLOY_PATH: '/usr/local/bee/web/pipe-network/pipe-network-model-mock'
33
34
  DINGTALK_WEBHOOK: 'https://oapi.dingtalk.com/robot/send?access_token=${DING_TALK_ACCESS_TOKEN}'
34
35
 
35
36
  cache:
@@ -48,6 +49,7 @@ build:
48
49
  - echo "===== 构建完成 ====="
49
50
  only:
50
51
  - dev
52
+ - mock
51
53
  artifacts:
52
54
  paths:
53
55
  - dist/
@@ -59,6 +61,9 @@ build:
59
61
  deploy:
60
62
  stage: deploy
61
63
  needs: ['build']
64
+ only:
65
+ - dev
66
+ - mock
62
67
  script:
63
68
  - echo "-----------------开始部署------------------"
64
69
  - |
@@ -67,7 +72,10 @@ deploy:
67
72
  scp -r dist/* root@192.168.2.245:$DEPLOY_PATH || { echo "❌ 传输到245失败"; exit 1; }
68
73
  ssh root@192.168.2.57 "rm -rf $DEPLOY_PATH/*" || { echo "❌ 清理57失败"; exit 1; }
69
74
  scp -r dist/* root@192.168.2.57:$DEPLOY_PATH || { echo "❌ 传输到57失败"; exit 1; }
70
- else
75
+ elif [ "$CI_COMMIT_BRANCH" == "mock" ]; then
76
+ ssh root@192.168.2.57 "rm -rf $MOCK_DEPLOY_PATH/*" || { echo "❌ 清理57失败"; exit 1; }
77
+ scp -r dist/* root@192.168.2.57:$MOCK_DEPLOY_PATH || { echo "❌ 传输到57失败"; exit 1; }
78
+ else
71
79
  echo "没有匹配到需要部署的分支或标签,跳过部署"
72
80
  exit 0
73
81
  fi
@@ -1,17 +1,4 @@
1
1
  {
2
- "$schema": "./node_modules/oxlint/configuration_schema.json",
3
- "plugins": ["typescript", "import", "unicorn"],
4
- "env": {
5
- "browser": true,
6
- "es2022": true,
7
- "node": true
8
- },
9
- "parserOptions": {
10
- "ecmaVersion": "latest",
11
- "sourceType": "module"
12
- },
13
- "rules": {
14
- "@typescript-eslint/no-unused-vars": "warn"
15
- },
2
+ "plugins": ["vue", "import", "oxc", "unicorn"],
16
3
  "ignorePatterns": ["node_modules", "dist", "public", "*.d.ts"]
17
4
  }
@@ -0,0 +1,11 @@
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
4
+ "editor.codeActionsOnSave": {
5
+ "source.fixAll.oxc": "explicit",
6
+ "source.organizeImports.prettier": "explicit"
7
+ },
8
+ "cSpell.words": ["Alova", "alove", "AMAP", "autofit", "unocss", "VITE"],
9
+ "biome.enabled": false,
10
+ "eslint.enable": false
11
+ }
@@ -1,31 +1,3 @@
1
- ### 安装依赖
1
+ ### ui 组件库
2
2
 
3
- > pnpm install
4
-
5
- ### 启动
6
-
7
- > pnpm dev
8
-
9
- ### css 全局变量
10
-
11
- @/styles/variables.scss
12
-
13
- ### 字体 引入
14
-
15
- @/styles/font/\*
16
-
17
- ### css 方案
18
-
19
- unocss
20
-
21
- ### 时间方案
22
-
23
- dayjs
24
-
25
- ### 工具库
26
-
27
- radash
28
-
29
- ### 发布
30
-
31
- 待补充
3
+ element-plus pro-components
@@ -19,35 +19,37 @@
19
19
  "@element-plus/icons-vue": "^2.3.2",
20
20
  "@vueuse/core": "^13.9.0",
21
21
  "alova": "^3.3.4",
22
- "axios": "^1.12.1",
22
+ "axios": "^1.12.2",
23
23
  "dayjs": "^1.11.18",
24
24
  "echarts": "^6.0.0",
25
- "element-plus": "^2.11.2",
25
+ "element-plus": "^2.11.5",
26
26
  "pinia": "^3.0.3",
27
27
  "pinia-plugin-persistedstate": "^4.5.0",
28
- "radash": "^12.1.1",
29
- "vue": "^3.5.21",
30
- "vue-router": "^4.5.1"
28
+ "plus-pro-components": "^0.1.30",
29
+ "radashi": "^12.7.0",
30
+ "vue": "^3.5.22",
31
+ "vue-router": "^4.6.3"
31
32
  },
32
33
  "devDependencies": {
33
- "@commitlint/cli": "^19.8.1",
34
- "@commitlint/config-conventional": "^19.8.1",
34
+ "@commitlint/cli": "^20.1.0",
35
+ "@commitlint/config-conventional": "^20.0.0",
35
36
  "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
37
+ "@plus-pro-components/resolver": "^0.0.3",
36
38
  "@prettier/plugin-oxc": "^0.0.4",
37
39
  "@vitejs/plugin-vue": "^6.0.1",
38
40
  "@vue/tsconfig": "^0.8.1",
39
41
  "fast-glob": "^3.3.3",
40
- "lefthook": "^1.13.0",
41
- "oxlint": "^1.15.0",
42
+ "lefthook": "^1.13.6",
43
+ "oxlint": "^1.23.0",
42
44
  "prettier": "^3.6.2",
43
- "sass": "^1.92.1",
44
- "typescript": "~5.9.2",
45
- "unocss": "^66.5.1",
46
- "unplugin-auto-import": "^20.1.0",
47
- "unplugin-vue-components": "^29.0.0",
48
- "vite": "npm:rolldown-vite@latest",
45
+ "sass": "^1.93.2",
46
+ "typescript": "~5.9.3",
47
+ "unocss": "^66.5.4",
48
+ "unplugin-auto-import": "^20.2.0",
49
+ "unplugin-vue-components": "^30.0.0",
50
+ "vite": "npm:rolldown-vite@7.1.17",
49
51
  "vite-plugin-inspect": "^11.3.3",
50
52
  "vite-plugin-svg-icons": "^2.0.1",
51
- "vue-tsc": "^3.0.7"
53
+ "vue-tsc": "^3.1.1"
52
54
  }
53
55
  }
@@ -1,7 +1,17 @@
1
- <script setup lang="ts"></script>
1
+ <script setup lang="ts">
2
+ import zhCn from 'element-plus/es/locale/lang/zh-cn'
3
+ import plusZhCn from 'plus-pro-components/es/locale/lang/zh-cn'
4
+ </script>
2
5
 
3
6
  <template>
4
- <RouterView />
7
+ <el-config-provider
8
+ :locale="{
9
+ ...zhCn,
10
+ ...plusZhCn,
11
+ }"
12
+ >
13
+ <RouterView />
14
+ </el-config-provider>
5
15
  </template>
6
16
 
7
17
  <style scoped></style>
@@ -7,7 +7,6 @@ import vueHook from 'alova/vue'
7
7
  import { axiosRequestAdapter } from '@alova/adapter-axios'
8
8
 
9
9
  const getBaseConfig = (): Parameters<typeof createDualCallInstance>[0] => {
10
-
11
10
  return {
12
11
  baseUrl: `/${envVariables.PUBLIC_PORT}`,
13
12
  statusMap: {
@@ -19,8 +18,7 @@ const getBaseConfig = (): Parameters<typeof createDualCallInstance>[0] => {
19
18
  },
20
19
  responseDataKey: 'data',
21
20
  responseMessageKey: 'msg',
22
- commonHeaders: {
23
- },
21
+ commonHeaders: {},
24
22
  successMessageFunc: (msg: string) => {
25
23
  ElMessage.success(msg)
26
24
  },
@@ -5,9 +5,10 @@ const a = ref()
5
5
  </script>
6
6
 
7
7
  <template>
8
- <div>
8
+ <div class="text-red flex-center">
9
9
  home
10
- <SvgIcon name="vue" class="text-red" />
10
+ <el-date-picker v-model="a" type="date" value-format="yyyy-MM-dd" />
11
+ <SvgIcon name="vue" class="text-green" />
11
12
  <el-button type="primary">按钮</el-button>
12
13
  </div>
13
14
  </template>
@@ -1,4 +1,36 @@
1
1
  {
2
- "files": [],
3
- "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "types": ["vite/client"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "erasableSyntaxOnly": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedSideEffectImports": true,
24
+
25
+ "baseUrl": ".",
26
+ "paths": {
27
+ "@/*": ["src/*"]
28
+ }
29
+ },
30
+ "include": [
31
+ "src/**/*.tsx",
32
+ "src/**/*.vue",
33
+ "src/types/**/*",
34
+ "./node_modules/element-plus/global.d.ts"
35
+ ]
4
36
  }
@@ -1,10 +1,7 @@
1
- import { defineConfig, presetWind3 } from 'unocss'
1
+ // uno.config.ts
2
+ import { defineConfig } from 'unocss'
2
3
 
3
4
  export default defineConfig({
4
- content: {
5
- filesystem: ['**/*.{html,js,ts,jsx,tsx,vue,svelte,astro}'],
6
- },
7
- presets: [presetWind3()],
8
5
  shortcuts: [
9
6
  {
10
7
  'flex-center': 'flex justify-center items-center',
@@ -7,6 +7,7 @@ import Components from 'unplugin-vue-components/vite'
7
7
  import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
8
8
  import Inspect from 'vite-plugin-inspect'
9
9
  import UnoCSS from 'unocss/vite'
10
+ import { PlusProComponentsResolver } from '@plus-pro-components/resolver'
10
11
 
11
12
  // https://vite.dev/config/
12
13
  export default defineConfig(({ command, mode }) => {
@@ -21,7 +22,7 @@ export default defineConfig(({ command, mode }) => {
21
22
  },
22
23
  },
23
24
  server: {
24
- port: VITE_PORT,
25
+ port: Number(VITE_PORT),
25
26
  host: '0.0.0.0',
26
27
  open: false,
27
28
  proxy: {},
@@ -34,7 +35,7 @@ export default defineConfig(({ command, mode }) => {
34
35
  dts: './src/types/auto-import.d.ts',
35
36
  }),
36
37
  Components({
37
- resolvers: [ElementPlusResolver()],
38
+ resolvers: [ElementPlusResolver(), PlusProComponentsResolver()],
38
39
  dts: './src/types/components.d.ts',
39
40
  }),
40
41
  createSvgIconsPlugin({
@@ -43,8 +44,8 @@ export default defineConfig(({ command, mode }) => {
43
44
  // Specify symbolId format
44
45
  symbolId: 'icon-[dir]-[name]',
45
46
  }),
47
+ UnoCSS(),
46
48
  Inspect(),
47
- UnoCSS()
48
49
  ],
49
50
  }
50
51
  })
@@ -17,7 +17,11 @@
17
17
  "useNumberNamespace": "off",
18
18
  "useNodejsImportProtocol": "off",
19
19
  "noNonNullAssertion": "off",
20
- "noUnusedTemplateLiteral": "off"
20
+ "noUnusedTemplateLiteral": "off",
21
+ "useConst": {
22
+ "level": "warn",
23
+ "fix": "unsafe"
24
+ }
21
25
  },
22
26
  "complexity": {
23
27
  "noUselessTypeConstraint": "off",
@@ -28,7 +32,12 @@
28
32
  "useExhaustiveDependencies": "off",
29
33
  "useHookAtTopLevel": "off",
30
34
  "noUnusedFunctionParameters": "off",
31
- "noUnusedVariables": "off"
35
+ "noUnusedVariables": "off",
36
+ "useUniqueElementIds": "off",
37
+ "useParseIntRadix": "off"
38
+ },
39
+ "security": {
40
+ "noDangerouslySetInnerHtml": "off"
32
41
  },
33
42
  "suspicious": {
34
43
  "noGlobalIsNan": "off",
@@ -53,9 +62,15 @@
53
62
  "noStaticElementInteractions": "off",
54
63
  "useAriaPropsSupportedByRole": "off",
55
64
  "useAriaPropsForRole": "off",
56
- "useValidAnchor": "off"
65
+ "useValidAnchor": "off",
66
+ "useMediaCaption": "off"
57
67
  },
58
- "nursery": "off"
68
+ "nursery": {
69
+ "useSortedClasses": {
70
+ "level": "warn",
71
+ "fix": "safe"
72
+ }
73
+ }
59
74
  }
60
75
  },
61
76
  "css": {
@@ -74,7 +89,20 @@
74
89
  "enabled": true,
75
90
  "actions": {
76
91
  "source": {
77
- "organizeImports": "off"
92
+ "organizeImports": {
93
+ "level": "on",
94
+ "options": {
95
+ "identifierOrder": "natural",
96
+ "groups": [
97
+ [":NODE:", ":BUN:"],
98
+ ":BLANK_LINE:",
99
+ ["react", "react-dom/**", "react-dom", "react-router", "react-router-dom"],
100
+ ["vue", "vue-router"],
101
+ ":BLANK_LINE:",
102
+ ["@/**", "**"]
103
+ ]
104
+ }
105
+ }
78
106
  }
79
107
  }
80
108
  }
@@ -0,0 +1,4 @@
1
+ VITE_PORT = 9405
2
+ VITE_PATH = '/'
3
+ VITE_APP_NAME = "xxx"
4
+ VITE_API_AFFIX = 'api'
@@ -0,0 +1 @@
1
+ PUBLIC_API_URL = 'http://localhost:8080'
@@ -0,0 +1 @@
1
+ PUBLIC_API_URL = 'http://localhost:8080'
@@ -0,0 +1,84 @@
1
+ .send_dingtalk_notification: &send_dingtalk_notification |
2
+ case "$CI_JOB_STAGE" in
3
+ "build")
4
+ stage_name="构建"
5
+ ;;
6
+ "deploy")
7
+ stage_name="部署"
8
+ ;;
9
+ esac
10
+
11
+ if [ "$CI_JOB_STATUS" == "success" ]; then
12
+ title="==✅ ${stage_name}成功=="
13
+ else
14
+ title="==❌ ${stage_name}失败=="
15
+ fi
16
+
17
+ curl -s -X POST ${DINGTALK_WEBHOOK} \
18
+ -H "Content-Type: application/json" \
19
+ -d "{
20
+ \"msgtype\": \"markdown\",
21
+ \"markdown\": {
22
+ \"title\": \"GitLab CI/CD 通知\",
23
+ \"text\": \"### ${title}\n\n- **项目**: ${CI_PROJECT_NAME}\n- **项目地址**: ${CI_PROJECT_URL}\n- **阶段**: ${stage_name}\n- **任务**: [查看详情](${CI_JOB_URL})\n- **分支**: ${CI_COMMIT_REF_NAME}\n- **提交人**: ${CI_COMMIT_AUTHOR}\n- **提交信息**: ${CI_COMMIT_MESSAGE}\n- **时间**: $(date '+%Y-%m-%d %H:%M:%S')\"
24
+ }
25
+ }"
26
+
27
+ stages:
28
+ - build
29
+ - deploy
30
+
31
+ variables:
32
+ DEPLOY_PATH: '/usr/local/bee/web/pipe-network/pipe-network-model'
33
+ MOCK_DEPLOY_PATH: '/usr/local/bee/web/pipe-network/pipe-network-model-mock'
34
+ DINGTALK_WEBHOOK: 'https://oapi.dingtalk.com/robot/send?access_token=${DING_TALK_ACCESS_TOKEN}'
35
+
36
+ cache:
37
+ paths:
38
+ - node_modules/
39
+
40
+ # 打包
41
+ build:
42
+ stage: build
43
+ script:
44
+ - cd ${CI_PROJECT_DIR}
45
+ - whoami
46
+ - echo "===== 开始构建 ====="
47
+ - pnpm install
48
+ - pnpm build
49
+ - echo "===== 构建完成 ====="
50
+ only:
51
+ - dev
52
+ - mock
53
+ artifacts:
54
+ paths:
55
+ - dist/
56
+ after_script:
57
+ #钉钉通知
58
+ - *send_dingtalk_notification
59
+
60
+ # 部署
61
+ deploy:
62
+ stage: deploy
63
+ needs: ['build']
64
+ only:
65
+ - dev
66
+ - mock
67
+ script:
68
+ - echo "-----------------开始部署------------------"
69
+ - |
70
+ if [ "$CI_COMMIT_BRANCH" == "dev" ]; then
71
+ ssh root@192.168.2.245 "rm -rf $DEPLOY_PATH/*" || { echo "❌ 清理245失败"; exit 1; }
72
+ scp -r dist/* root@192.168.2.245:$DEPLOY_PATH || { echo "❌ 传输到245失败"; exit 1; }
73
+ ssh root@192.168.2.57 "rm -rf $DEPLOY_PATH/*" || { echo "❌ 清理57失败"; exit 1; }
74
+ scp -r dist/* root@192.168.2.57:$DEPLOY_PATH || { echo "❌ 传输到57失败"; exit 1; }
75
+ elif [ "$CI_COMMIT_BRANCH" == "mock" ]; then
76
+ ssh root@192.168.2.57 "rm -rf $MOCK_DEPLOY_PATH/*" || { echo "❌ 清理57失败"; exit 1; }
77
+ scp -r dist/* root@192.168.2.57:$MOCK_DEPLOY_PATH || { echo "❌ 传输到57失败"; exit 1; }
78
+ else
79
+ echo "没有匹配到需要部署的分支或标签,跳过部署"
80
+ exit 0
81
+ fi
82
+ after_script:
83
+ #钉钉通知
84
+ - *send_dingtalk_notification
@@ -0,0 +1,10 @@
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "editor.defaultFormatter": "biomejs.biome",
4
+ "editor.codeActionsOnSave": {
5
+ "source.organizeImports.biome": "explicit",
6
+ "source.fixAll.biome": "explicit"
7
+ },
8
+ "oxc.enable": false,
9
+ "typescript.tsdk": "node_modules\\typescript\\lib"
10
+ }
@@ -0,0 +1,3 @@
1
+ ### ui 组件库
2
+
3
+ element-plus pro-components