Switching to Bun and Vite, adapting to the new syntax of [email protected] | 更換為 Bun 和 Vite ,適應 [email protected] 新語法 #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Node.js@14 reached the end of its lifecycle on April 30, 2023. Consider switching the runtime environment to the cutting-edge Bun, and change the package manager to
bun
.The current version is only configured with the module bundler Rollup. For deployment, other operations are required to move
index.html
,index.js
,index.css
,pyanxchet.min.js
to the same path to assemble a complete frontend environment. This was suitable for past deployments from GitHub Pages branches, but now with the new ability to deploy directly from GitHub Actions, it's inconvenient and outdated for timely coordination of modifying static resource paths. Consider introducing Vite for more convenient frontend packaging, which is also compatible with the Rollup plugin ecosystem.Consider introducing the dprint code formatting tool, and add
check
andfmt
scripts topackage.json
.Try switching kyonh to tupa.
Try writing the script
./tools/qieyun-examples-node.js
to fetch the new qieyun-examples.Try rewriting all references to qieyun-js to adapt to the new syntax in version 0.13.
Consider introducing Google Fonts to improve display effects.
Complete the favicon and a
robots.txt
example.Add manual trigger event
workflow_dispatch
to GitHub Actions workflow script.Demo frontend of the committed version: a48171ea.pyanxchet-forked-by-jwietpuj-drin.pages.dev
GitHub Actions workflow log of the committed version: https://github.com/JwietPuj-Drin/pyanxchet/actions/runs/7602123887/job/20702295646
Node.js@14 已於 2023 年 4 月 30 日結束其生命週期,試替換運行時環境至前沿的 Bun ,包管理器亦更換為
bun
。現版本只配置了模塊打包工具 Rollup ,部署時須配合其他操作移動
index.html
index.js
index.css
pyanxchet.min.js
於同一路徑才得以組裝出完整的前端環境。這適合過去 GitHub Pages 從分支部署的需要,但現在已有了全新的、直接從 GitHub Actions 中部署的能力,也不方便及時協調修改靜態資源路徑關係,這一方式就顯得不合時宜了。試引入 Vite 以更方便地打包前端,其也兼容 Rollup 的插件生態。試引入 dprint 程式碼格式化工具,并於
package.json
增加腳本check
fmt
。試換推導古韻羅馬字為推導切韻拼音。
試編寫腳本
./tools/qieyun-examples-node.js
以獲取新的 qieyun-examples 。試改寫所有對 qieyun-js 的引用寫法以適應 0.13 版本的新語法。
試引入 Google Fonts 增進顯示效果。
補全 favicon 和一個
robots.txt
示例。GitHub Actions 工作流脚本增加手動触發事件
workflow_dispatch
。提交版本的演示前端: a48171ea.pyanxchet-forked-by-jwietpuj-drin.pages.dev
提交版本的 GitHub Actions 工作日誌: https://github.com/JwietPuj-Drin/pyanxchet/actions/runs/7602123887/job/20702295646