vanspod 0.3.1 → 0.3.2
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/README.md +4 -4
- package/dist/classroomApp.js +10 -2
- package/dist/page.js +3 -3
- package/dist/start.js +4 -3
- package/dist/version.js +1 -1
- package/dist/versionUpdateView.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ npm run dist
|
|
|
38
38
|
npm pack --pack-destination dist
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
exe 產物為 `dist/VansPod.exe`,本機套件為 `dist/vanspod-0.3.
|
|
41
|
+
exe 產物為 `dist/VansPod.exe`,本機套件為 `dist/vanspod-0.3.2.tgz`;可在 Windows 用 `npm install -g <套件路徑>` 安裝測試。圖片、favicon、系統匣與移除腳本均包含在發佈產物中。更新 logo 後執行 `powershell.exe -NoProfile -File scripts/build-icon.ps1` 重建多尺寸 Windows icon。
|
|
42
42
|
|
|
43
43
|
exe 發佈管道為本專案 GitHub Releases,npm 為公開 registry 的 [`vanspod`](https://www.npmjs.com/package/vanspod) 套件。更新時不要執行完整移除,否則會清除課堂資料。
|
|
44
44
|
|
|
@@ -46,12 +46,12 @@ exe 發佈管道為本專案 GitHub Releases,npm 為公開 registry 的 [`vans
|
|
|
46
46
|
|
|
47
47
|
一般 push 不發佈;推送 `v*` tag 會在 Windows runner 安裝 Node.js 24、檢查型別、執行測試、打包並驗證 exe/npm 生命週期,全部通過後才建立 GitHub Release,最後發佈 npm 套件。學生從 Release 下載 `VansPod.exe`,同頁提供 `SHA256SUMS.txt`。
|
|
48
48
|
|
|
49
|
-
發版前同步 `package.json`、`package-lock.json` 與 `src/version.ts` 的版本;tag 必須等於 `v` 加版本號,否則流程失敗。以 `0.3.
|
|
49
|
+
發版前同步 `package.json`、`package-lock.json` 與 `src/version.ts` 的版本;tag 必須等於 `v` 加版本號,否則流程失敗。以 `0.3.2` 為例:
|
|
50
50
|
|
|
51
51
|
```powershell
|
|
52
52
|
git push origin master
|
|
53
|
-
git tag -a v0.3.
|
|
54
|
-
git push origin v0.3.
|
|
53
|
+
git tag -a v0.3.2 -m "VansPod 0.3.2"
|
|
54
|
+
git push origin v0.3.2
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
新版本使用新的版本號與 tag。相同 tag 的 Actions 重跑會更新該 Release 的產物。
|
package/dist/classroomApp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClassroomApp = exports.ENVIRONMENT_TOOLS = void 0;
|
|
3
|
+
exports.ClassroomApp = exports.COPIED_KEY_NOTICE = exports.ENVIRONMENT_TOOLS = void 0;
|
|
4
4
|
const secureStorage_1 = require("./secureStorage");
|
|
5
5
|
const storageErrors_1 = require("./storageErrors");
|
|
6
6
|
const adapterSettings_1 = require("./adapterSettings");
|
|
@@ -16,6 +16,7 @@ const ENVIRONMENT_LABEL = {
|
|
|
16
16
|
pwsh: "PowerShell 7",
|
|
17
17
|
};
|
|
18
18
|
const LOCAL_LIST_NOTE = "這是本機清單。";
|
|
19
|
+
exports.COPIED_KEY_NOTICE = "已複製 Classroom API Key。請勿分享給不信任的人。";
|
|
19
20
|
const INSTALL_UNAVAILABLE = "尚未指定專案資料夾,安裝不可用。";
|
|
20
21
|
const REOPEN_TERMINAL = "請重開終端機再重新檢查。";
|
|
21
22
|
const ENVIRONMENT_ABORTED = "已中止安裝。系統安裝程式可能仍在執行,請等待結束或稍後重新安裝。";
|
|
@@ -86,6 +87,13 @@ class ClassroomApp {
|
|
|
86
87
|
this.connectionOperations = next.catch(() => { });
|
|
87
88
|
return next;
|
|
88
89
|
}
|
|
90
|
+
// 整頁畫面用這個:複製成功的提示只出現一次,重新整理就不會再讓法鬥說一遍。
|
|
91
|
+
pageView() {
|
|
92
|
+
const view = this.view();
|
|
93
|
+
if (this.notice === exports.COPIED_KEY_NOTICE)
|
|
94
|
+
this.notice = this.connectionNotice = undefined;
|
|
95
|
+
return view;
|
|
96
|
+
}
|
|
89
97
|
view() {
|
|
90
98
|
const view = {
|
|
91
99
|
connected: this.connected,
|
|
@@ -1442,7 +1450,7 @@ class ClassroomApp {
|
|
|
1442
1450
|
this.notice = this.connectionNotice = "無法複製 Classroom API Key。請重新連線後再試。";
|
|
1443
1451
|
return;
|
|
1444
1452
|
}
|
|
1445
|
-
this.notice = this.connectionNotice =
|
|
1453
|
+
this.notice = this.connectionNotice = exports.COPIED_KEY_NOTICE;
|
|
1446
1454
|
}
|
|
1447
1455
|
async copySnippet(snippetId) {
|
|
1448
1456
|
const snippet = this.catalog?.snippets?.find((item) => item.id === snippetId);
|
package/dist/page.js
CHANGED
|
@@ -13,6 +13,7 @@ const classroomUpdate_1 = require("./classroomUpdate");
|
|
|
13
13
|
const connectionMascot_1 = require("./connectionMascot");
|
|
14
14
|
const clientIcons_1 = require("./clientIcons");
|
|
15
15
|
const environmentIcons_1 = require("./environmentIcons");
|
|
16
|
+
const classroomApp_1 = require("./classroomApp");
|
|
16
17
|
const promptCapture_1 = require("./promptCapture");
|
|
17
18
|
const inspectorView_1 = require("./inspectorView");
|
|
18
19
|
const versionUpdateView_1 = require("./versionUpdateView");
|
|
@@ -69,10 +70,9 @@ function notices(view) {
|
|
|
69
70
|
: "";
|
|
70
71
|
return `${klass}${notice}${running}`;
|
|
71
72
|
}
|
|
72
|
-
const COPY_KEY_NOTICE = "已複製 Classroom API Key。請勿分享給不信任的人。";
|
|
73
73
|
function connectionFeedback(view) {
|
|
74
74
|
const original = view.connectionError || view.connectionNotice || (view.detail !== "Classroom API Key 已設定。" ? view.detail : "");
|
|
75
|
-
const message = original ===
|
|
75
|
+
const message = original === classroomApp_1.COPIED_KEY_NOTICE
|
|
76
76
|
? "複製好了!API Key 不是群組伴手禮,別發給不信任的人喔。" : original;
|
|
77
77
|
const feedback = `<div class="connection-feedback">${message ? `<div class="${view.connectionError ? "connection-error" : "connection-message"}" role="${view.connectionError ? "alert" : "status"}"><svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.8"><circle cx="12" cy="12" r="9"/><path d="M12 7v6M12 15v2"/></svg><p>${escapeHtml(message)}</p></div>` : ""}</div>`;
|
|
78
78
|
return feedback;
|
|
@@ -806,7 +806,7 @@ function organizeSettings(html, view) {
|
|
|
806
806
|
};
|
|
807
807
|
if (title === "連線") {
|
|
808
808
|
moveForm("clear");
|
|
809
|
-
if (actions && !view.connectionError && view.connectionNotice ===
|
|
809
|
+
if (actions && !view.connectionError && view.connectionNotice === classroomApp_1.COPIED_KEY_NOTICE) {
|
|
810
810
|
const feedback = connectionFeedback(view);
|
|
811
811
|
body = body.replace(feedback, "");
|
|
812
812
|
const speech = `<div class="mascot-speech">${feedback}<button type="button" class="mascot-speech-close" aria-label="收起法鬥台詞">知道啦</button></div>`;
|
package/dist/start.js
CHANGED
|
@@ -462,7 +462,8 @@ async function main(instance) {
|
|
|
462
462
|
const goHome = (params) => {
|
|
463
463
|
if (req.headers["x-classroom-settings"] === "1") {
|
|
464
464
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-store" });
|
|
465
|
-
|
|
465
|
+
const html = (0, page_1.renderPage)(app.pageView());
|
|
466
|
+
res.end(instance ? (0, lifecyclePage_1.lifecyclePage)(html, instance.token) : html);
|
|
466
467
|
return;
|
|
467
468
|
}
|
|
468
469
|
const variant = params?.get("prototype_variant") ?? "";
|
|
@@ -578,8 +579,8 @@ async function main(instance) {
|
|
|
578
579
|
if (req.method === "GET" && (pathname === "/" || pathname === "/index.html")) {
|
|
579
580
|
const variant = parsed.searchParams.get("variant") ?? "";
|
|
580
581
|
const html = process.env.NODE_ENV !== "production" && (0, pagePrototype_1.isPrototypeVariant)(variant)
|
|
581
|
-
? (0, pagePrototype_1.renderPrototypePage)(app.
|
|
582
|
-
: (0, page_1.renderPage)(app.
|
|
582
|
+
? (0, pagePrototype_1.renderPrototypePage)(app.pageView(), variant)
|
|
583
|
+
: (0, page_1.renderPage)(app.pageView());
|
|
583
584
|
res.writeHead(200, {
|
|
584
585
|
"Content-Type": "text/html; charset=utf-8",
|
|
585
586
|
"Cache-Control": "no-store",
|
package/dist/version.js
CHANGED
|
@@ -7,11 +7,12 @@ const DOWNLOAD_ICON = `<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" s
|
|
|
7
7
|
exports.UPDATE_BUTTON = `<button type="button" class="update-button" data-version-update hidden aria-label="檢查更新" title="檢查更新">${DOWNLOAD_ICON}<span class="update-dot"></span></button>`;
|
|
8
8
|
exports.VERSION_UPDATE_STYLES = `
|
|
9
9
|
.bar .side-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; }
|
|
10
|
-
.
|
|
10
|
+
.bar .side-foot > button { align-self: center; }
|
|
11
|
+
.update-button { position: relative; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; min-height: 2.75rem; flex: 0 0 auto; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
|
|
11
12
|
.update-button[hidden] { display: none; }
|
|
12
13
|
.update-button:hover { color: var(--text); background: light-dark(rgba(13, 13, 13, 0.04), rgba(255, 255, 255, 0.06)); }
|
|
13
14
|
.update-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
14
|
-
.update-button svg { width:
|
|
15
|
+
.update-button svg { width: 1.25rem; height: 1.25rem; }
|
|
15
16
|
.update-button .update-dot { display: none; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 999px; background: #2563eb; box-shadow: 0 0 0 2px var(--bg); }
|
|
16
17
|
.update-button.available { color: #2563eb; border-color: rgba(37, 99, 235, 0.45); background: rgba(37, 99, 235, 0.08); }
|
|
17
18
|
.update-button.available .update-dot { display: block; }
|