From ca2296d20f28a86a04cf09d6e03c910f6e67b19d Mon Sep 17 00:00:00 2001 From: Hui Miao Date: Mon, 2 Sep 2024 16:18:12 +0800 Subject: [PATCH] fix: migrate the dashboard tab js template to vite (#12313) --- templates/js/dashboard-tab/.vscode/tasks.json | 2 +- templates/js/dashboard-tab/README.md | 12 +++++++----- .../js/dashboard-tab/{public => }/index.html | 8 ++++---- templates/js/dashboard-tab/package.json.tpl | 13 +++++++------ templates/js/dashboard-tab/public/favicon.ico | Bin 0 -> 91302 bytes .../dashboard-tab/src/{index.css => main.css} | 0 .../dashboard-tab/src/{index.jsx => main.jsx} | 2 +- templates/js/dashboard-tab/teamsapp.yml.tpl | 4 ++-- templates/js/dashboard-tab/vite.config.js | 15 +++++++++++++++ templates/ts/dashboard-tab/README.md | 12 +++++++----- templates/ts/dashboard-tab/package.json.tpl | 1 - 11 files changed, 44 insertions(+), 25 deletions(-) rename templates/js/dashboard-tab/{public => }/index.html (73%) create mode 100644 templates/js/dashboard-tab/public/favicon.ico rename templates/js/dashboard-tab/src/{index.css => main.css} (100%) rename templates/js/dashboard-tab/src/{index.jsx => main.jsx} (90%) create mode 100644 templates/js/dashboard-tab/vite.config.js diff --git a/templates/js/dashboard-tab/.vscode/tasks.json b/templates/js/dashboard-tab/.vscode/tasks.json index 72413ddb7b..7272ec795e 100644 --- a/templates/js/dashboard-tab/.vscode/tasks.json +++ b/templates/js/dashboard-tab/.vscode/tasks.json @@ -75,7 +75,7 @@ "background": { "activeOnStart": true, "beginsPattern": ".*", - "endsPattern": "Compiled|Failed|compiled|failed" + "endsPattern": "Compiled|Failed|compiled|failed|ready" } } } diff --git a/templates/js/dashboard-tab/README.md b/templates/js/dashboard-tab/README.md index 2ed6dda262..79fffb69d2 100644 --- a/templates/js/dashboard-tab/README.md +++ b/templates/js/dashboard-tab/README.md @@ -52,11 +52,13 @@ The following files can be customized and demonstrate an example implementation The following are project-related files. You generally will not need to customize these files. -| File | Contents | -| -------------------------- | ------------------------------------ | -| `src/index.css` | The style of application entry point | -| `src/index.jsx` | Application entry point | -| `src/internal/context.jsx` | TeamsFx Context | +| File | Contents | +| -------------------------- | ------------------------------------------ | +| `src/main.css` | The style of React application entry point | +| `src/main.jsx` | The entry point for a React application | +| `src/internal/context.jsx` | TeamsFx Context | +| `index.html` | The entry point of the application | +| `vite.config.js` | Vite configuration file | The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works. diff --git a/templates/js/dashboard-tab/public/index.html b/templates/js/dashboard-tab/index.html similarity index 73% rename from templates/js/dashboard-tab/public/index.html rename to templates/js/dashboard-tab/index.html index c61bcb4424..a72c470202 100644 --- a/templates/js/dashboard-tab/public/index.html +++ b/templates/js/dashboard-tab/index.html @@ -1,17 +1,17 @@ + - + Microsoft Teams Tab - -
+ - + \ No newline at end of file diff --git a/templates/js/dashboard-tab/package.json.tpl b/templates/js/dashboard-tab/package.json.tpl index 6836dbf579..02d6fec293 100644 --- a/templates/js/dashboard-tab/package.json.tpl +++ b/templates/js/dashboard-tab/package.json.tpl @@ -4,6 +4,7 @@ "engines": { "node": "16 || 18" }, + "type": "module", "private": true, "dependencies": { "@fluentui/react-charting": "^5.14.10", @@ -14,17 +15,17 @@ "@microsoft/teamsfx-react": "^3.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.8.0", - "react-scripts": "^5.0.1" + "react-router-dom": "^6.8.0" }, "devDependencies": { - "env-cmd": "^10.1.0" + "@vitejs/plugin-react": "^4.3.1", + "env-cmd": "^10.1.0", + "vite": "^5.4.0" }, "scripts": { "dev:teamsfx": "env-cmd --silent -f .localConfigs npm run start", - "start": "react-scripts start", - "build": "react-scripts build", - "eject": "react-scripts eject", + "start": "vite", + "build": "vite build", "test": "echo \"Error: no test specified\" && exit 1" }, "eslintConfig": { diff --git a/templates/js/dashboard-tab/public/favicon.ico b/templates/js/dashboard-tab/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..ef5ef2b4b028da06704021fe28884aaa3bf313c6 GIT binary patch literal 91302 zcmeHQ2RxPE8-K46O*GW6WTm~dhmoWrvQ=gxG!#WfF0PDdD-B7s*RMqx*`>&CiOeJ; zdu4n7=Ui?--Q4S5?oIx^_v1L@J>z-4&vV9m){7uGgcE^393qIgPeKqkqVGTdD89}B z((`l65JX?U^Z9Kr1mRah5Gkon{|spac~y)cqM}{Try@w@OpsEr%g>D<=ag^=H?U!T zJJ=9JQXhwSC@ZcXIc(xEP|`>_Ss7LM6dKMUz|z@&+Zb3w&1E$$5M9(@M?CLERiu_(l!&og8b9@*d)Zt!-6<@?Sd&Cw zD5P3$woeuCAALz)Nog~BH!RYxxJISq+uh)-JJ#Q7@6D2$dBaO}Ll6I69t~o>T`fD$ z^N50W8QZesyZkshaLAMr(L*N`Mog}Bcf0@EwmiUBX zocT7mS8KNC`wdm)4Clz7i_^OmQ@2;MJhbq`Q@dfKb-teEm2z2}lj*>B@ZkJ01$e@( zQO^QQj*gXDs#eW5x`t!C!^7_t;Ypj>6^HxBPCdWDJ2;|Yf6a>Zf`0R37Y=>E8uEVf z)<*r>Nebf(yk{-bLZ*Iu5OzHvBDg_YIAqA71)HR~#bmQ}Cz& z$K0!n*4}rVEqRfB$0J`3g!9Q;|C*rYk&S1@X4$@v12JR+Lieb?N}a?McO=K zclPWv$EWB8`L3Pp&#ugJT6kJcxSb?HM20WRc8JVD5wiouAD2v*%d@(4`yI=S{mIF` z>n-JXg}Prd6iZY-rK6n^AU|o+J;_JDQxl#bM>00%<=Nf69x z8!h}aC~$<2?0p;Wt-0amADe@&$#_<>jP>^6t&ms~o;06*MxgIhKhEnVAzQUX9SiF~ zdJm93w6xVusbNuW-P9VNsQKH&_W3TVzaaH_2X3rKQBlg2XYKD3UxugpjXac-WgwQiicfgIB5<$E zT5(m%8Yew3GkfXGx!xnM2z)+oc76OcF^$6`Ipl*8X$6@JHH(f;39e-&x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lh(akRb$?~a9Q zqR@c5gs&#*XiTREmwl_m3dz_1p??oBZX4DT_hC?y!516zU(S2O@$PF))$NdmaCHT@ z2zB`udgnC4z`5MB>!ne6KRLvPQu&nj9RN(46Sb6=_N8nRt&j$Y1GVxYU8MJ0avRVP zOv#Ilx*_&^z>sr#U;;=Uca}7a>YBV zy(QqiJ%G~rH+XkF=z9~v{5kl}iE<+8E_+B%fBT=4N*jLcAq3;Ic0k8Z^YE}N@_q;U zNi_7Q|GlOphd$8nTtguBzmSIRICS#;^L!U9ABOiNkKV%4EKNhm=W=tv`W&fzXhT_$ z@`0H5#6Jut#i7RrWACEwW%cL=aY%VGntyuB?@j(BI%%~bwmtIPZ7kj$f0!?%p%aH+ z^`F*qN%4s1Qh|<9qJdohNa+}9!#W1cFLQZ4)jvj-+dVHL4p0`I-{dTUn0K#t-Q)hr zZelwRr)c2xOf;BAfCf&{5Wp!t0+>3W`v+$sxSYZ44M@w1L#ux>&cNR}CDhjW`C>Rv z0jDJdfg#OPNU;G=FTZjZmq}p0^E!Ah1!t1*rNDia*6;k)ySk1Cy7HA=hd~|%FyCH^ zMq*5j?{|L}ePL?+U;78n~bLYlS;|RDGO))(P+|i zsHKOr{3+=n-`#&C9JkX-VaylvbA-|n@;On4G;=iZ()vFLBU!cptR*8~<(wKrEO(X--H39QK%ou`? literal 0 HcmV?d00001 diff --git a/templates/js/dashboard-tab/src/index.css b/templates/js/dashboard-tab/src/main.css similarity index 100% rename from templates/js/dashboard-tab/src/index.css rename to templates/js/dashboard-tab/src/main.css diff --git a/templates/js/dashboard-tab/src/index.jsx b/templates/js/dashboard-tab/src/main.jsx similarity index 90% rename from templates/js/dashboard-tab/src/index.jsx rename to templates/js/dashboard-tab/src/main.jsx index 61bd0a0fb4..253d7e5f99 100644 --- a/templates/js/dashboard-tab/src/index.jsx +++ b/templates/js/dashboard-tab/src/main.jsx @@ -1,4 +1,4 @@ -import "./index.css"; +import "./main.css"; import React from "react"; import { createRoot } from "react-dom/client"; diff --git a/templates/js/dashboard-tab/teamsapp.yml.tpl b/templates/js/dashboard-tab/teamsapp.yml.tpl index a192ed6aa5..49577b1a85 100644 --- a/templates/js/dashboard-tab/teamsapp.yml.tpl +++ b/templates/js/dashboard-tab/teamsapp.yml.tpl @@ -91,7 +91,7 @@ deploy: - uses: cli/runNpmCommand name: install dependencies with: - args: install --production + args: install - uses: cli/runNpmCommand name: build app with: @@ -100,7 +100,7 @@ deploy: - uses: cli/runNpxCommand name: deploy to Azure Static Web Apps with: - args: '@azure/static-web-apps-cli deploy ./build -d ${{SECRET_TAB_SWA_DEPLOYMENT_TOKEN}} --env production' + args: '@azure/static-web-apps-cli deploy ./dist -d ${{SECRET_TAB_SWA_DEPLOYMENT_TOKEN}} --env production' # Triggered when 'teamsapp publish' is executed publish: diff --git a/templates/js/dashboard-tab/vite.config.js b/templates/js/dashboard-tab/vite.config.js new file mode 100644 index 0000000000..1f2556b593 --- /dev/null +++ b/templates/js/dashboard-tab/vite.config.js @@ -0,0 +1,15 @@ +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; +import fs from "fs"; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [react()], + server: { + port: 53000, + https: { + cert: process.env.SSL_CRT_FILE ? fs.readFileSync(process.env.SSL_CRT_FILE) : undefined, + key: process.env.SSL_KEY_FILE ? fs.readFileSync(process.env.SSL_KEY_FILE) : undefined, + }, + }, +}); diff --git a/templates/ts/dashboard-tab/README.md b/templates/ts/dashboard-tab/README.md index 67a78bb0e4..d5f23aef09 100644 --- a/templates/ts/dashboard-tab/README.md +++ b/templates/ts/dashboard-tab/README.md @@ -54,11 +54,13 @@ The following files can be customized and demonstrate an example implementation The following are project-related files. You generally will not need to customize these files. -| File | Contents | -| ------------------------- | ------------------------------------ | -| `src/index.css` | The style of application entry point | -| `src/index.tsx` | Application entry point | -| `src/internal/context.ts` | TeamsFx Context | +| File | Contents | +| ------------------------- | ------------------------------------------ | +| `src/main.css` | The style of React application entry point | +| `src/main.tsx` | The entry point for a React application | +| `src/internal/context.ts` | TeamsFx Context | +| `index.html` | The entry point of the application | +| `vite.config.ts` | Vite configuration file | The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works. diff --git a/templates/ts/dashboard-tab/package.json.tpl b/templates/ts/dashboard-tab/package.json.tpl index d4de71afca..b72a8cc4d6 100644 --- a/templates/ts/dashboard-tab/package.json.tpl +++ b/templates/ts/dashboard-tab/package.json.tpl @@ -32,7 +32,6 @@ "dev:teamsfx": "env-cmd --silent -f .localConfigs npm run start", "start": "vite", "build": "tsc && vite build", - "server": "vite preview", "test": "echo \"Error: no test specified\" && exit 1" }, "eslintConfig": {