pinokiod 5.2.0 → 5.3.1
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/kernel/bin/registry.js +5 -13
- package/package.json +1 -1
- package/server/public/checkpoint.png +0 -0
- package/server/views/app.ejs +106 -3
package/kernel/bin/registry.js
CHANGED
|
@@ -14,20 +14,12 @@ class Registry {
|
|
|
14
14
|
}, (stream) => {
|
|
15
15
|
})
|
|
16
16
|
console.log("registry check", { res })
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const output = (res && (res.response || res.stdout)) || ""
|
|
18
|
+
const matches = /LongPathsEnabled\s+REG_DWORD\s+([^\s]+)/i.exec(output)
|
|
19
19
|
console.log("matches", matches)
|
|
20
|
-
if (matches && matches
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (Number(chunks[2]) === 1) {
|
|
24
|
-
this._installed = true
|
|
25
|
-
} else {
|
|
26
|
-
this._installed = false
|
|
27
|
-
}
|
|
28
|
-
} else {
|
|
29
|
-
this._installed = false
|
|
30
|
-
}
|
|
20
|
+
if (matches && matches[1]) {
|
|
21
|
+
const parsed = parseInt(matches[1], 0)
|
|
22
|
+
this._installed = Number.isFinite(parsed) && parsed === 1
|
|
31
23
|
} else {
|
|
32
24
|
this._installed = false
|
|
33
25
|
}
|
package/package.json
CHANGED
|
Binary file
|
package/server/views/app.ejs
CHANGED
|
@@ -3350,6 +3350,48 @@ html.snapshot-footer-dismissed .snapshot-footer {
|
|
|
3350
3350
|
}
|
|
3351
3351
|
.snapshot-footer .caption {
|
|
3352
3352
|
opacity: 0.8;
|
|
3353
|
+
display: flex;
|
|
3354
|
+
align-items: center;
|
|
3355
|
+
gap: 6px;
|
|
3356
|
+
flex-wrap: wrap;
|
|
3357
|
+
}
|
|
3358
|
+
.snapshot-info-text {
|
|
3359
|
+
font-size: 13px;
|
|
3360
|
+
line-height: 1.5;
|
|
3361
|
+
margin-bottom: 12px;
|
|
3362
|
+
}
|
|
3363
|
+
.snapshot-info-label {
|
|
3364
|
+
font-size: 11px;
|
|
3365
|
+
text-transform: uppercase;
|
|
3366
|
+
letter-spacing: 0.08em;
|
|
3367
|
+
color: var(--pinokio-modal-subtitle-color);
|
|
3368
|
+
margin-bottom: 6px;
|
|
3369
|
+
}
|
|
3370
|
+
.snapshot-info-label.spaced {
|
|
3371
|
+
margin-top: 12px;
|
|
3372
|
+
}
|
|
3373
|
+
.snapshot-info-code {
|
|
3374
|
+
margin: 0;
|
|
3375
|
+
padding: 10px 12px;
|
|
3376
|
+
border-radius: 8px;
|
|
3377
|
+
border: 1px solid var(--pinokio-modal-body-border);
|
|
3378
|
+
background: rgba(15, 23, 42, 0.06);
|
|
3379
|
+
font-size: 12px;
|
|
3380
|
+
line-height: 1.5;
|
|
3381
|
+
overflow-x: auto;
|
|
3382
|
+
white-space: pre;
|
|
3383
|
+
}
|
|
3384
|
+
body.dark .snapshot-info-code {
|
|
3385
|
+
background: rgba(15, 23, 42, 0.6);
|
|
3386
|
+
}
|
|
3387
|
+
.snapshot-info-image {
|
|
3388
|
+
width: 100%;
|
|
3389
|
+
max-width: 100%;
|
|
3390
|
+
border-radius: 10px;
|
|
3391
|
+
border: 1px solid var(--pinokio-modal-body-border);
|
|
3392
|
+
background: var(--pinokio-modal-body-bg);
|
|
3393
|
+
display: block;
|
|
3394
|
+
margin-bottom: 12px;
|
|
3353
3395
|
}
|
|
3354
3396
|
.snapshot-footer-save {
|
|
3355
3397
|
display: flex;
|
|
@@ -3665,14 +3707,15 @@ body.dark .snapshot-footer-input input {
|
|
|
3665
3707
|
<% if (showSnapshotFooter) { %>
|
|
3666
3708
|
<div class='snapshot-footer' data-workspace="<%=name%>" data-pending-snapshot-id="<%= pendingSnapshotId ? pendingSnapshotId : '' %>" data-registry-beta-enabled="<%= registryEnabled ? '1' : '0' %>">
|
|
3667
3709
|
<div class="snapshot-footer-save <%= registryEnabled && pendingSnapshotId ? 'hidden' : '' %>">
|
|
3668
|
-
<div class='caption' title="<%= registryEnabled ? 'Saves a checkpoint
|
|
3669
|
-
|
|
3710
|
+
<div class='caption' title="<%= registryEnabled ? 'Saves a tiny JSON checkpoint of exact commit hashes (no files). You can publish it after saving.' : 'Saves a tiny JSON checkpoint of exact commit hashes (no files).' %>">
|
|
3711
|
+
Snapshot installed modules information and restore later
|
|
3670
3712
|
</div>
|
|
3671
3713
|
<div class="snapshot-footer-actions" style="display:flex; gap:10px; flex-wrap:wrap; align-items:center;">
|
|
3672
3714
|
<button type="button" class="btn btn-primary snapshot-btn-save">
|
|
3673
3715
|
<i class="fa-solid fa-circle-check"></i> Save checkpoint
|
|
3674
3716
|
</button>
|
|
3675
|
-
<button type="button" class="btn snapshot-btn-
|
|
3717
|
+
<button type="button" class="btn snapshot-btn-how"><i class="fa-solid fa-circle-info"></i> How it works</button>
|
|
3718
|
+
<button type="button" class="btn snapshot-btn-dismiss"><i class="fa-solid fa-circle-xmark"></i> Dismiss</button>
|
|
3676
3719
|
</div>
|
|
3677
3720
|
</div>
|
|
3678
3721
|
<% if (registryEnabled) { %>
|
|
@@ -9684,6 +9727,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
9684
9727
|
const publishBtn = footer.querySelector(".snapshot-btn-publish")
|
|
9685
9728
|
const laterBtn = footer.querySelector(".snapshot-btn-later")
|
|
9686
9729
|
const dismissBtn = footer.querySelector(".snapshot-btn-dismiss")
|
|
9730
|
+
const howBtn = footer.querySelector(".snapshot-btn-how")
|
|
9687
9731
|
const publishText = publishPanel ? publishPanel.querySelector(".snapshot-footer-publish-text") : null
|
|
9688
9732
|
const publishActions = publishPanel ? publishPanel.querySelector(".snapshot-footer-actions") : null
|
|
9689
9733
|
if (!saveBtn) return
|
|
@@ -9744,6 +9788,65 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
9744
9788
|
showPublishPanel()
|
|
9745
9789
|
}
|
|
9746
9790
|
|
|
9791
|
+
const snapshotInfoJson = `{
|
|
9792
|
+
"version": 1,
|
|
9793
|
+
"root": "https://github.com/org/app",
|
|
9794
|
+
"repos": [
|
|
9795
|
+
{ "path": ".", "repo": "https://github.com/org/app", "commit": "9f2a3c1" },
|
|
9796
|
+
{ "path": "modules/foo", "repo": "https://github.com/org/foo", "commit": "1ab4d90" }
|
|
9797
|
+
]
|
|
9798
|
+
}`
|
|
9799
|
+
const snapshotInfoHtml = `
|
|
9800
|
+
<div class="pinokio-modal-surface">
|
|
9801
|
+
<div class="pinokio-modal-header">
|
|
9802
|
+
<div class="pinokio-modal-icon"><i class="fa-solid fa-circle-info"></i></div>
|
|
9803
|
+
<div class="pinokio-modal-heading">
|
|
9804
|
+
<div class="pinokio-modal-title">Checkpoint snapshot</div>
|
|
9805
|
+
<div class="pinokio-modal-subtitle">Metadata only, restore exact module versions</div>
|
|
9806
|
+
</div>
|
|
9807
|
+
</div>
|
|
9808
|
+
<div class="pinokio-modal-body">
|
|
9809
|
+
<div class="snapshot-info-text">Creates a tiny JSON of exact commit hashes and install paths for installed modules (no files), so you can later restore exact versions from the <a href="/checkpoints">Checkpoints tab</a>. Use after all modules have finished installing.</div>
|
|
9810
|
+
<div class="snapshot-info-label">Example snapshot JSON</div>
|
|
9811
|
+
<pre class="snapshot-info-code" data-snapshot-json="1"></pre>
|
|
9812
|
+
<div class="snapshot-info-label spaced">Example restore UI</div>
|
|
9813
|
+
<img class="snapshot-info-image" src="/checkpoint.png" alt="Checkpoint restore UI example" loading="lazy" />
|
|
9814
|
+
</div>
|
|
9815
|
+
</div>
|
|
9816
|
+
`
|
|
9817
|
+
const showSnapshotInfo = () => {
|
|
9818
|
+
if (typeof Swal === "undefined") return
|
|
9819
|
+
Swal.fire({
|
|
9820
|
+
html: snapshotInfoHtml,
|
|
9821
|
+
backdrop: 'rgba(9,11,15,0.65)',
|
|
9822
|
+
width: 'min(560px, 92vw)',
|
|
9823
|
+
showConfirmButton: true,
|
|
9824
|
+
confirmButtonText: 'Got it',
|
|
9825
|
+
showCloseButton: true,
|
|
9826
|
+
buttonsStyling: false,
|
|
9827
|
+
focusConfirm: false,
|
|
9828
|
+
customClass: {
|
|
9829
|
+
popup: 'pinokio-modern-modal',
|
|
9830
|
+
htmlContainer: 'pinokio-modern-html',
|
|
9831
|
+
closeButton: 'pinokio-modern-close',
|
|
9832
|
+
confirmButton: 'pinokio-modern-confirm'
|
|
9833
|
+
},
|
|
9834
|
+
didOpen: () => {
|
|
9835
|
+
const container = Swal.getHtmlContainer()
|
|
9836
|
+
const codeEl = container ? container.querySelector('[data-snapshot-json="1"]') : null
|
|
9837
|
+
if (codeEl) {
|
|
9838
|
+
codeEl.textContent = snapshotInfoJson
|
|
9839
|
+
}
|
|
9840
|
+
}
|
|
9841
|
+
})
|
|
9842
|
+
}
|
|
9843
|
+
if (howBtn) {
|
|
9844
|
+
howBtn.addEventListener("click", (event) => {
|
|
9845
|
+
event.preventDefault()
|
|
9846
|
+
showSnapshotInfo()
|
|
9847
|
+
})
|
|
9848
|
+
}
|
|
9849
|
+
|
|
9747
9850
|
const waitForRegistryLink = async () => {
|
|
9748
9851
|
const startedAt = Date.now()
|
|
9749
9852
|
while (Date.now() - startedAt < 120000) {
|