Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching to Bun and Vite, adapting to the new syntax of [email protected] | 更換為 Bun 和 Vite ,適應 [email protected] 新語法 #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JwietPuj-Drin
Copy link

  1. 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.

  2. 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.

  3. Consider introducing the dprint code formatting tool, and add check and fmt scripts to package.json.

  4. Try switching kyonh to tupa.

  5. Try writing the script ./tools/qieyun-examples-node.js to fetch the new qieyun-examples.

  6. Try rewriting all references to qieyun-js to adapt to the new syntax in version 0.13.

  7. Consider introducing Google Fonts to improve display effects.

  8. Complete the favicon and a robots.txt example.

  9. 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


  1. Node.js@14 已於 2023 年 4 月 30 日結束其生命週期,試替換運行時環境至前沿的 Bun ,包管理器亦更換為 bun

  2. 現版本只配置了模塊打包工具 Rollup ,部署時須配合其他操作移動 index.html index.js index.css pyanxchet.min.js 於同一路徑才得以組裝出完整的前端環境。這適合過去 GitHub Pages 從分支部署的需要,但現在已有了全新的、直接從 GitHub Actions 中部署的能力,也不方便及時協調修改靜態資源路徑關係,這一方式就顯得不合時宜了。試引入 Vite 以更方便地打包前端,其也兼容 Rollup 的插件生態。

  3. 試引入 dprint 程式碼格式化工具,并於 package.json 增加腳本 check fmt

  4. 試換推導古韻羅馬字為推導切韻拼音。

  5. 試編寫腳本 ./tools/qieyun-examples-node.js 以獲取新的 qieyun-examples 。

  6. 試改寫所有對 qieyun-js 的引用寫法以適應 0.13 版本的新語法。

  7. 試引入 Google Fonts 增進顯示效果。

  8. 補全 favicon 和一個 robots.txt 示例。

  9. 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

…13 | 更換為 Bun 和 Vite ,適應 [email protected] 新語法

1. Node.js@14 reached the end of its lifecycle on April 30, 2023. Consider switching the runtime environment to the cutting-edge [Bun](https://bun.sh/ "Bun — A fast all-in-one JavaScript runtime"), and change the package manager to `bun`.

2. 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](https://vitejs.dev/ "Vite | Next Generation Frontend Tooling") for more convenient frontend packaging, which is also compatible with the Rollup plugin ecosystem.

3. Consider introducing the [dprint](https://dprint.dev/ "dprint - Code Formatter") code formatting tool, and add `check` and `fmt` scripts to `package.json`.

4. Try writing the script `./tools/qieyun-examples-node.js` to fetch the new qieyun-examples.

5. Try rewriting all references to qieyun-js to adapt to the new syntax in version 0.13.

6. Consider introducing Google Fonts to improve display effects.

7. Complete the favicon and a `robots.txt` example.

8. 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](https://a48171ea.pyanxchet-forked-by-jwietpuj-drin.pages.dev/ "自動反切器")

GitHub Actions workflow log of the committed version: [https://github.com/JwietPuj-Drin/pyanxchet/actions/workflows/publish.yml](https://github.com/JwietPuj-Drin/pyanxchet/actions/workflows/publish.yml "Publish · Workflow runs · JwietPuj-Drin/pyanxchet")

---

1. Node.js@14 已於 2023 年 4 月 30 日結束其生命週期,試替換運行時環境至前沿的 [Bun](https://bun.sh/ "Bun — A fast all-in-one JavaScript runtime") ,包管理器亦更換為 `bun` 。

2. 現版本只配置了模塊打包工具 Rollup ,部署時須配合其他操作移動 `index.html` `index.js` `index.css` `pyanxchet.min.js` 於同一路徑才得以組裝出完整的前端環境。這適合過去 GitHub Pages 從分支部署的需要,但現在已有了全新的、直接從 GitHub Actions 中部署的能力,也不方便及時協調修改靜態資源路徑關係,這一方式就顯得不合時宜了。試引入 [Vite](https://cn.vitejs.dev/ "Vite | 下一代的前端工具链") 以更方便地打包前端,其也兼容 Rollup 的插件生態。

3. 試引入 [dprint](https://dprint.dev/ "dprint - Code Formatter") 程式碼格式化工具,并於 `package.json` 增加腳本 `check` `fmt`。

4. 試編寫腳本 `./tools/qieyun-examples-node.js` 以獲取新的 qieyun-examples 。

5. 試改寫所有對 qieyun-js 的引用寫法以適應 0.13 版本的新語法。

6. 試引入 Google Fonts 增進顯示效果。

7. 補全 favicon 和一個 `robots.txt` 示例。

8. GitHub Actions 工作流脚本增加手動触發事件 `workflow_dispatch` 。

提交版本的演示前端: [a48171ea.pyanxchet-forked-by-jwietpuj-drin.pages.dev](https://a48171ea.pyanxchet-forked-by-jwietpuj-drin.pages.dev/ "自動反切器")

提交版本的 GitHub Actions 工作日誌: [https://github.com/JwietPuj-Drin/pyanxchet/actions/workflows/publish.yml](https://github.com/JwietPuj-Drin/pyanxchet/actions/workflows/publish.yml "Publish · Workflow runs · JwietPuj-Drin/pyanxchet")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant