server-studio 1.2.1 → 1.2.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/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/src/index.html +36 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to Server Studio. Dates are release dates.
|
|
4
4
|
|
|
5
|
+
## 1.2.3 — 2026-08-30
|
|
6
|
+
|
|
7
|
+
- The badge shown after an update now says **quit & reopen** rather than "restart to finish".
|
|
8
|
+
Reloading the page kept the old process serving it, so the old wording sent people to do the
|
|
9
|
+
one thing that could not work.
|
|
10
|
+
|
|
11
|
+
## 1.2.2 — 2026-08-30
|
|
12
|
+
|
|
13
|
+
- The version badge no longer keeps offering an update you have already installed. Once you start
|
|
14
|
+
one it reads **restart to finish**, because the running process keeps the old code until it is
|
|
15
|
+
reopened. It returns to a plain version once you restart.
|
|
16
|
+
|
|
5
17
|
## 1.2.1 — 2026-08-30
|
|
6
18
|
|
|
7
19
|
- **Fixed:** an installed app reported its version as `0.0.0`, because the code looks for
|
package/package.json
CHANGED
package/src/index.html
CHANGED
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
.ver.has-update:hover { background: rgba(62,207,142,.24); }
|
|
114
114
|
.ver .dot-new { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
|
|
115
115
|
.ver.checking { opacity: .55; }
|
|
116
|
+
.ver.pending { color: var(--amber); border-color: rgba(245,179,67,.4); background: rgba(245,179,67,.12); padding: 3px 9px; margin-left: -10px; }
|
|
116
117
|
@keyframes verPulse {
|
|
117
118
|
0%, 100% { box-shadow: 0 0 0 0 rgba(62,207,142,0); }
|
|
118
119
|
50% { box-shadow: 0 0 0 4px rgba(62,207,142,.18); }
|
|
@@ -831,6 +832,15 @@ function ssPrompt(title, opts) {
|
|
|
831
832
|
/* ---------- version + update ---------- */
|
|
832
833
|
let updateInfo = null;
|
|
833
834
|
|
|
835
|
+
function isNewerVersion(a, b) {
|
|
836
|
+
const pa = String(a).split('.').map(Number), pb = String(b).split('.').map(Number);
|
|
837
|
+
for (let i = 0; i < 3; i++) {
|
|
838
|
+
const x = pa[i] || 0, y = pb[i] || 0;
|
|
839
|
+
if (x !== y) return x > y;
|
|
840
|
+
}
|
|
841
|
+
return false;
|
|
842
|
+
}
|
|
843
|
+
|
|
834
844
|
async function checkUpdate() {
|
|
835
845
|
const pill = document.getElementById('verPill');
|
|
836
846
|
if (!pill) return;
|
|
@@ -840,6 +850,25 @@ async function checkUpdate() {
|
|
|
840
850
|
updateInfo = r;
|
|
841
851
|
pill.classList.remove('checking');
|
|
842
852
|
|
|
853
|
+
// An update was kicked off from here and this process is still the old one.
|
|
854
|
+
let pending = null;
|
|
855
|
+
try { pending = localStorage.getItem('ss_updating_to'); } catch (e) {}
|
|
856
|
+
if (pending && !isNewerVersion(pending, r.current)) {
|
|
857
|
+
// Already running it, so the restart happened. Clear the flag.
|
|
858
|
+
try { localStorage.removeItem('ss_updating_to'); } catch (e) {}
|
|
859
|
+
pending = null;
|
|
860
|
+
}
|
|
861
|
+
if (pending) {
|
|
862
|
+
// "restart" alone reads as reloading the page, which changes nothing: the old
|
|
863
|
+
// process is still serving it. Say which thing has to be restarted.
|
|
864
|
+
pill.className = 'ver pending';
|
|
865
|
+
pill.textContent = 'quit & reopen for ' + pending;
|
|
866
|
+
pill.title = pending + ' is installed. Quit Server Studio itself and open it again, ' +
|
|
867
|
+
'reloading this page keeps the old version running.';
|
|
868
|
+
pill.onclick = null;
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
|
|
843
872
|
if (r.newer) {
|
|
844
873
|
pill.className = 'ver has-update';
|
|
845
874
|
pill.innerHTML = '<span class="dot-new"></span>v' + esc(r.current) + ' → ' + esc(r.latest);
|
|
@@ -864,7 +893,13 @@ async function runUpdate() {
|
|
|
864
893
|
r = await api('/api/run', { method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
865
894
|
body: JSON.stringify({ cwd: '', command: 'npm install -g server-studio' }) });
|
|
866
895
|
} catch (e) { /* server gone: fall through to the error toast rather than doing nothing */ }
|
|
867
|
-
if (r && r.ok)
|
|
896
|
+
if (r && r.ok) {
|
|
897
|
+
// The running process keeps the old code until it restarts, so stop offering the
|
|
898
|
+
// update. Continuing to show it after a successful update reads as a failure.
|
|
899
|
+
try { localStorage.setItem('ss_updating_to', updateInfo.latest); } catch (e) {}
|
|
900
|
+
checkUpdate();
|
|
901
|
+
toast('Updating in ' + TERM_NAME + '. Quit Server Studio and open it again when it finishes.');
|
|
902
|
+
}
|
|
868
903
|
else toast('Could not start the update. Run this yourself: npm install -g server-studio', true);
|
|
869
904
|
}
|
|
870
905
|
|