create-bubbles 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/template-react-rsbuild-biome/.prettierrc +1 -2
- package/template-react-rsbuild-biome/biome.json +14 -1
- package/template-react-rsbuild-biome/package.json +16 -17
- package/template-react-rsbuild-biome/rsbuild.config.ts +2 -2
- package/template-react-rsbuild-biome/src/App.tsx +5 -6
- package/template-react-rsbuild-biome/src/index.tsx +1 -3
- package/template-react-rsbuild-biome/uno.config.ts +3 -5
- package/template-vue-rolldown-oxc/.gitlab-ci.yml +10 -2
- package/template-vue-rolldown-oxc/.oxlintrc.json +1 -14
- package/template-vue-rolldown-oxc/.vscode/settings.json +11 -0
- package/template-vue-rolldown-oxc/README.md +2 -30
- package/template-vue-rolldown-oxc/package.json +18 -16
- package/template-vue-rolldown-oxc/src/App.vue +12 -2
- package/template-vue-rolldown-oxc/src/utils/request/index.ts +1 -3
- package/template-vue-rolldown-oxc/src/views/home/index.vue +3 -2
- package/template-vue-rolldown-oxc/tsconfig.json +34 -2
- package/template-vue-rolldown-oxc/uno.config.ts +2 -5
- package/template-vue-rolldown-oxc/vite.config.ts +4 -3
- package/template-vue-vite-biome/.env +4 -0
- package/template-vue-vite-biome/.env.development +1 -0
- package/template-vue-vite-biome/.env.production +1 -0
- package/template-vue-vite-biome/.gitlab-ci.yml +84 -0
- package/template-vue-vite-biome/.vscode/settings.json +10 -0
- package/template-vue-vite-biome/README.md +3 -0
- package/template-vue-vite-biome/biome.json +104 -0
- package/template-vue-vite-biome/commitlint.config.js +1 -0
- package/template-vue-vite-biome/index.html +13 -0
- package/template-vue-vite-biome/lefthook.yml +11 -0
- package/template-vue-vite-biome/package.json +50 -0
- package/template-vue-vite-biome/public/vite.svg +1 -0
- package/template-vue-vite-biome/src/App.vue +19 -0
- package/template-vue-vite-biome/src/assets/icon/vue.svg +1 -0
- package/template-vue-vite-biome/src/components/Icon/svg-icon.vue +29 -0
- package/template-vue-vite-biome/src/layout/default/index.vue +3 -0
- package/template-vue-vite-biome/src/main.ts +15 -0
- package/template-vue-vite-biome/src/router/guard/index.ts +7 -0
- package/template-vue-vite-biome/src/router/guard/permissionGuard.ts +13 -0
- package/template-vue-vite-biome/src/router/index.ts +17 -0
- package/template-vue-vite-biome/src/router/modules/index.ts +31 -0
- package/template-vue-vite-biome/src/store/index.ts +10 -0
- package/template-vue-vite-biome/src/store/modules/user.ts +17 -0
- package/template-vue-vite-biome/src/styles/element-plus-variables.css +4 -0
- package/template-vue-vite-biome/src/styles/font.scss +0 -0
- package/template-vue-vite-biome/src/styles/index.scss +31 -0
- package/template-vue-vite-biome/src/styles/variables.scss +3 -0
- package/template-vue-vite-biome/src/types/vite-env.d.ts +13 -0
- package/template-vue-vite-biome/src/utils/env.ts +10 -0
- package/template-vue-vite-biome/src/utils/request/core/index.ts +166 -0
- package/template-vue-vite-biome/src/utils/request/core/utils.ts +38 -0
- package/template-vue-vite-biome/src/utils/request/index.ts +39 -0
- package/template-vue-vite-biome/src/views/home/index.vue +16 -0
- package/template-vue-vite-biome/src/views/login/index.vue +11 -0
- package/template-vue-vite-biome/src/views/model/index.vue +7 -0
- package/{template-vue-rolldown-oxc/tsconfig.app.json → template-vue-vite-biome/tsconfig.json} +15 -4
- package/template-vue-vite-biome/uno.config.ts +10 -0
- package/template-vue-vite-biome/vite.config.ts +51 -0
- package/template-vue-vite-eslint/.env +4 -0
- package/template-vue-vite-eslint/.env.development +1 -0
- package/template-vue-vite-eslint/.env.production +1 -0
- package/template-vue-vite-eslint/.gitlab-ci.yml +84 -0
- package/template-vue-vite-eslint/.vscode/settings.json +54 -0
- package/template-vue-vite-eslint/README.md +3 -0
- package/template-vue-vite-eslint/commitlint.config.js +1 -0
- package/template-vue-vite-eslint/eslint.config.js +64 -0
- package/template-vue-vite-eslint/index.html +13 -0
- package/template-vue-vite-eslint/lefthook.yml +11 -0
- package/template-vue-vite-eslint/package.json +54 -0
- package/template-vue-vite-eslint/public/vite.svg +1 -0
- package/template-vue-vite-eslint/src/App.vue +19 -0
- package/template-vue-vite-eslint/src/assets/icon/vue.svg +1 -0
- package/template-vue-vite-eslint/src/components/Icon/svg-icon.vue +29 -0
- package/template-vue-vite-eslint/src/layout/default/index.vue +3 -0
- package/template-vue-vite-eslint/src/main.ts +16 -0
- package/template-vue-vite-eslint/src/router/guard/index.ts +7 -0
- package/template-vue-vite-eslint/src/router/guard/permissionGuard.ts +13 -0
- package/template-vue-vite-eslint/src/router/index.ts +18 -0
- package/template-vue-vite-eslint/src/router/modules/index.ts +31 -0
- package/template-vue-vite-eslint/src/store/index.ts +11 -0
- package/template-vue-vite-eslint/src/store/modules/user.ts +20 -0
- package/template-vue-vite-eslint/src/styles/element-plus-variables.css +4 -0
- package/template-vue-vite-eslint/src/styles/font.scss +0 -0
- package/template-vue-vite-eslint/src/styles/index.scss +30 -0
- package/template-vue-vite-eslint/src/styles/variables.scss +3 -0
- package/template-vue-vite-eslint/src/types/vite-env.d.ts +15 -0
- package/template-vue-vite-eslint/src/utils/env.ts +10 -0
- package/template-vue-vite-eslint/src/utils/request/core/index.ts +172 -0
- package/template-vue-vite-eslint/src/utils/request/core/utils.ts +41 -0
- package/template-vue-vite-eslint/src/utils/request/index.ts +39 -0
- package/template-vue-vite-eslint/src/views/home/index.vue +24 -0
- package/template-vue-vite-eslint/src/views/login/index.vue +9 -0
- package/template-vue-vite-eslint/src/views/model/index.vue +7 -0
- package/{template-vue-rolldown-oxc/tsconfig.node.json → template-vue-vite-eslint/tsconfig.json} +20 -9
- package/template-vue-vite-eslint/uno.config.ts +17 -0
- package/template-vue-vite-eslint/vite.config.ts +53 -0
- package/template-vue-rolldown-oxc/components.d.ts +0 -18
- package/template-vue-rolldown-oxc/src/types/auto-import.d.ts +0 -78
- 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-
|
|
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
|
@@ -74,7 +74,20 @@
|
|
|
74
74
|
"enabled": true,
|
|
75
75
|
"actions": {
|
|
76
76
|
"source": {
|
|
77
|
-
"organizeImports":
|
|
77
|
+
"organizeImports": {
|
|
78
|
+
"level": "on",
|
|
79
|
+
"options": {
|
|
80
|
+
"identifierOrder": "natural",
|
|
81
|
+
"groups": [
|
|
82
|
+
[":NODE:", ":BUN:"],
|
|
83
|
+
":BLANK_LINE:",
|
|
84
|
+
["react", "react-dom/**", "react-dom", "react-router", "react-router-dom"],
|
|
85
|
+
["vue", "vue-router"],
|
|
86
|
+
":BLANK_LINE:",
|
|
87
|
+
["@/**", "**"]
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
78
91
|
}
|
|
79
92
|
}
|
|
80
93
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "bubbles-project",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"scripts": {
|
|
@@ -16,28 +16,27 @@
|
|
|
16
16
|
"@ant-design/icons-vue": "^7.0.1",
|
|
17
17
|
"ahooks": "^3.9.5",
|
|
18
18
|
"alova": "^3.3.4",
|
|
19
|
-
"antd": "^5.27.
|
|
19
|
+
"antd": "^5.27.5",
|
|
20
20
|
"dayjs": "^1.11.18",
|
|
21
|
-
"react": "^19.
|
|
22
|
-
"react-dom": "^19.
|
|
23
|
-
"react-router": "^7.
|
|
21
|
+
"react": "^19.2.0",
|
|
22
|
+
"react-dom": "^19.2.0",
|
|
23
|
+
"react-router": "^7.9.4",
|
|
24
24
|
"zustand": "^5.0.8"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@biomejs/biome": "^2.2.
|
|
28
|
-
"@commitlint/config-conventional": "^
|
|
29
|
-
"@
|
|
30
|
-
"@rsbuild/
|
|
31
|
-
"@rsbuild/plugin-react": "^1.4.0",
|
|
27
|
+
"@biomejs/biome": "^2.2.6",
|
|
28
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
29
|
+
"@rsbuild/core": "^1.5.17",
|
|
30
|
+
"@rsbuild/plugin-react": "^1.4.1",
|
|
32
31
|
"@rsbuild/plugin-sass": "^1.4.0",
|
|
33
32
|
"@rsbuild/plugin-svgr": "^1.2.2",
|
|
34
|
-
"@types/react": "^19.
|
|
35
|
-
"@types/react-dom": "^19.
|
|
36
|
-
"@unocss/postcss": "^66.5.
|
|
37
|
-
"lefthook": "^1.13.
|
|
33
|
+
"@types/react": "^19.2.2",
|
|
34
|
+
"@types/react-dom": "^19.2.2",
|
|
35
|
+
"@unocss/postcss": "^66.5.4",
|
|
36
|
+
"lefthook": "^1.13.6",
|
|
38
37
|
"prettier": "^3.6.2",
|
|
39
|
-
"typescript": "^5.9.
|
|
40
|
-
"unocss": "^66.5.
|
|
41
|
-
"unplugin-auto-import": "^20.
|
|
38
|
+
"typescript": "^5.9.3",
|
|
39
|
+
"unocss": "^66.5.4",
|
|
40
|
+
"unplugin-auto-import": "^20.2.0"
|
|
42
41
|
}
|
|
43
42
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineConfig } from '@rsbuild/core'
|
|
2
2
|
import { pluginReact } from '@rsbuild/plugin-react'
|
|
3
|
-
import AutoImport from 'unplugin-auto-import/rspack'
|
|
4
|
-
import UnoCSS from '@unocss/postcss'
|
|
5
3
|
import { pluginSass } from '@rsbuild/plugin-sass'
|
|
6
4
|
import { pluginSvgr } from '@rsbuild/plugin-svgr'
|
|
5
|
+
import UnoCSS from '@unocss/postcss'
|
|
6
|
+
import AutoImport from 'unplugin-auto-import/rspack'
|
|
7
7
|
|
|
8
8
|
export default defineConfig({
|
|
9
9
|
html: {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { RouterProvider } from 'react-router'
|
|
2
|
-
|
|
3
|
-
import router from './router';
|
|
1
|
+
import { RouterProvider } from 'react-router'
|
|
2
|
+
import router from './router'
|
|
4
3
|
|
|
5
4
|
const App = () => {
|
|
6
|
-
return <RouterProvider router={router}
|
|
7
|
-
}
|
|
5
|
+
return <RouterProvider router={router} />
|
|
6
|
+
}
|
|
8
7
|
|
|
9
|
-
export default App
|
|
8
|
+
export default App
|
|
@@ -2,10 +2,8 @@ import React, { Suspense } from 'react'
|
|
|
2
2
|
import ReactDOM from 'react-dom/client'
|
|
3
3
|
|
|
4
4
|
import App from './App'
|
|
5
|
-
|
|
6
|
-
import '@/styles/index.scss'
|
|
7
|
-
|
|
8
5
|
import Loading from './components/Loading/PageLoading'
|
|
6
|
+
import '@/styles/index.scss'
|
|
9
7
|
|
|
10
8
|
const rootEl = document.getElementById('root')
|
|
11
9
|
if (rootEl) {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { defineConfig,
|
|
1
|
+
import { defineConfig, presetUno } from 'unocss'
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
content: {
|
|
5
|
-
filesystem: ['
|
|
5
|
+
filesystem: ['./src/**/*.{html,js,ts,jsx,tsx}'],
|
|
6
6
|
},
|
|
7
|
-
presets: [
|
|
8
|
-
rules: [],
|
|
9
|
-
shortcuts: [['flex-center', 'flex items-center justify-center']],
|
|
7
|
+
presets: [presetUno()],
|
|
10
8
|
})
|
|
@@ -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
|
-
|
|
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
|
-
"
|
|
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
|
-
|
|
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.
|
|
22
|
+
"axios": "^1.12.2",
|
|
23
23
|
"dayjs": "^1.11.18",
|
|
24
24
|
"echarts": "^6.0.0",
|
|
25
|
-
"element-plus": "^2.11.
|
|
25
|
+
"element-plus": "^2.11.5",
|
|
26
26
|
"pinia": "^3.0.3",
|
|
27
27
|
"pinia-plugin-persistedstate": "^4.5.0",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"vue
|
|
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": "^
|
|
34
|
-
"@commitlint/config-conventional": "^
|
|
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.
|
|
41
|
-
"oxlint": "^1.
|
|
42
|
+
"lefthook": "^1.13.6",
|
|
43
|
+
"oxlint": "^1.23.0",
|
|
42
44
|
"prettier": "^3.6.2",
|
|
43
|
-
"sass": "^1.
|
|
44
|
-
"typescript": "~5.9.
|
|
45
|
-
"unocss": "^66.5.
|
|
46
|
-
"unplugin-auto-import": "^20.
|
|
47
|
-
"unplugin-vue-components": "^
|
|
48
|
-
"vite": "npm:rolldown-vite@
|
|
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.
|
|
53
|
+
"vue-tsc": "^3.1.1"
|
|
52
54
|
}
|
|
53
55
|
}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
<script setup lang="ts"
|
|
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
|
-
<
|
|
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
|
-
<
|
|
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
|
-
"
|
|
3
|
-
|
|
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
|
-
|
|
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
|
})
|
|
@@ -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
|
+
}
|