pinokiod 3.19.81 → 3.19.83
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/scripts/git/push +1 -11
- package/kernel/util.js +0 -3
- package/package.json +1 -1
- package/server/index.js +5 -1
- package/server/public/opener.js +1 -0
- package/server/views/app.ejs +1 -1
- package/server/views/git.ejs +36 -20
- package/server/views/github.ejs +6 -4
package/kernel/scripts/git/push
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"run": [{
|
|
3
|
-
"method": "input",
|
|
4
|
-
"params": {
|
|
5
|
-
"form": [{
|
|
6
|
-
"key": "commit",
|
|
7
|
-
"title": "Commit message"
|
|
8
|
-
}]
|
|
9
|
-
}
|
|
10
|
-
}, {
|
|
11
3
|
"method": "shell.run",
|
|
12
4
|
"params": {
|
|
13
|
-
"chain":
|
|
5
|
+
"chain": "*",
|
|
14
6
|
"path": "{{args.cwd}}",
|
|
15
7
|
"message": [
|
|
16
|
-
"git add .",
|
|
17
|
-
"git commit -am {{input.commit}}",
|
|
18
8
|
"git push"
|
|
19
9
|
]
|
|
20
10
|
}
|
package/kernel/util.js
CHANGED
|
@@ -185,12 +185,9 @@ const log = async (filepath, str, session) => {
|
|
|
185
185
|
const regex = new RegExp(pattern, 'gi')
|
|
186
186
|
let stripped = str.replaceAll(regex, '');
|
|
187
187
|
let logpath = path.resolve(filepath, session)
|
|
188
|
-
console.log("> write log", logpath)
|
|
189
188
|
await fs.promises.writeFile(logpath, stripped)
|
|
190
189
|
let latest_logpath = path.resolve(filepath, "latest")
|
|
191
|
-
console.log("> write latest log", latest_logpath)
|
|
192
190
|
await fs.promises.writeFile(latest_logpath, stripped)
|
|
193
|
-
console.log("> all logs written")
|
|
194
191
|
}
|
|
195
192
|
}
|
|
196
193
|
const run = (cmd, cwd, kernel) => {
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -4438,6 +4438,7 @@ class Server {
|
|
|
4438
4438
|
console.log("hosts", hosts)
|
|
4439
4439
|
|
|
4440
4440
|
let connected = (hosts.length > 0)
|
|
4441
|
+
console.log({ connected })
|
|
4441
4442
|
|
|
4442
4443
|
|
|
4443
4444
|
let remote = null
|
|
@@ -4465,6 +4466,7 @@ class Server {
|
|
|
4465
4466
|
changes.push({
|
|
4466
4467
|
webpath,
|
|
4467
4468
|
file: filepath,
|
|
4469
|
+
path: fullPath,
|
|
4468
4470
|
//status: `${head}${workdir}${stage}`,
|
|
4469
4471
|
status: Util.classifyChange(head, workdir, stage),
|
|
4470
4472
|
binary: true,
|
|
@@ -4497,7 +4499,7 @@ class Server {
|
|
|
4497
4499
|
const diffs = diff.diffLines(normalize(oldContent), normalize(newContent));
|
|
4498
4500
|
|
|
4499
4501
|
const summarized = Util.diffLinesWithContext(diffs, 5);
|
|
4500
|
-
changes.push({ webpath, file: filepath, status: Util.classifyChange(head, workdir, stage)/*`${head}${workdir}${stage}`*/, diff: summarized, binary: false, });
|
|
4502
|
+
changes.push({ webpath, file: filepath, path: fullPath, status: Util.classifyChange(head, workdir, stage)/*`${head}${workdir}${stage}`*/, diff: summarized, binary: false, });
|
|
4501
4503
|
}
|
|
4502
4504
|
}
|
|
4503
4505
|
}
|
|
@@ -4506,6 +4508,8 @@ class Server {
|
|
|
4506
4508
|
console.log("git status matrix error", err)
|
|
4507
4509
|
}
|
|
4508
4510
|
|
|
4511
|
+
|
|
4512
|
+
|
|
4509
4513
|
res.render("git", {
|
|
4510
4514
|
connected,
|
|
4511
4515
|
changes,
|
package/server/public/opener.js
CHANGED
package/server/views/app.ejs
CHANGED
|
@@ -873,7 +873,7 @@ body.dark .appcanvas {
|
|
|
873
873
|
<% if (type === "browse") { %>
|
|
874
874
|
<div class='nested-menu selected git blue'>
|
|
875
875
|
<div class='btn header-item frame-link reveal'>
|
|
876
|
-
<div class='tab'><i class="fa-
|
|
876
|
+
<div class='tab'><i class="fa-brands fa-github"></i> Publish</div>
|
|
877
877
|
<div class='loader'><i class="fa-solid fa-angle-down"></i><i class="fa-solid fa-angle-up hidden"></i></div>
|
|
878
878
|
</div>
|
|
879
879
|
<div class='submenu' id='git-repos'>
|
package/server/views/git.ejs
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
<link href="/css/solid.min.css" rel="stylesheet">
|
|
5
5
|
<link href="/css/regular.min.css" rel="stylesheet">
|
|
6
6
|
<link href="/css/brands.min.css" rel="stylesheet">
|
|
7
|
+
<script src="/hotkeys.min.js"></script>
|
|
7
8
|
<script src="/opener.js"></script>
|
|
8
9
|
<% if (agent === "electron") { %>
|
|
9
10
|
<link href="/electron.css" rel="stylesheet"/>
|
|
@@ -36,7 +37,7 @@ aside .item {
|
|
|
36
37
|
text-decoration: none;
|
|
37
38
|
color: royalblue;
|
|
38
39
|
padding: 10px;
|
|
39
|
-
background: rgba(0,0,0,0.
|
|
40
|
+
background: rgba(0,0,0,0.04);
|
|
40
41
|
}
|
|
41
42
|
nav {
|
|
42
43
|
padding: 10px;
|
|
@@ -63,6 +64,9 @@ label {
|
|
|
63
64
|
body.dark nav {
|
|
64
65
|
background: rgba(0,0,0,0.4);
|
|
65
66
|
}
|
|
67
|
+
nav {
|
|
68
|
+
background: rgba(0,0,0,0.06);
|
|
69
|
+
}
|
|
66
70
|
nav label {
|
|
67
71
|
display: block;
|
|
68
72
|
padding: 10px;
|
|
@@ -81,7 +85,7 @@ main img {
|
|
|
81
85
|
width: 100%;
|
|
82
86
|
}
|
|
83
87
|
main h2 {
|
|
84
|
-
padding:
|
|
88
|
+
padding: 10px;
|
|
85
89
|
margin: 0;
|
|
86
90
|
font-size: 16px;
|
|
87
91
|
}
|
|
@@ -148,6 +152,8 @@ body.dark main h3 {
|
|
|
148
152
|
color: white;
|
|
149
153
|
}
|
|
150
154
|
main h3 {
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
151
157
|
margin: 0;
|
|
152
158
|
background: rgba(0, 0, 0, 0.04);
|
|
153
159
|
padding: 15px;
|
|
@@ -157,7 +163,7 @@ body.dark .chunk {
|
|
|
157
163
|
border: 10px solid white;
|
|
158
164
|
}
|
|
159
165
|
.chunk {
|
|
160
|
-
border: 10px solid
|
|
166
|
+
border: 10px solid rgba(0,0,0,0.04);
|
|
161
167
|
margin-bottom: 10px;
|
|
162
168
|
}
|
|
163
169
|
.filler {
|
|
@@ -170,12 +176,16 @@ body.dark .chunk {
|
|
|
170
176
|
.add { background: #e6ffed; color: green; }
|
|
171
177
|
.del { background: #ffeef0; color: red; }
|
|
172
178
|
.context { background: #f8f8f8; }
|
|
179
|
+
|
|
180
|
+
.changes .btn {
|
|
181
|
+
padding: 5px 15px;
|
|
182
|
+
margin: 0;
|
|
183
|
+
}
|
|
173
184
|
.btn {
|
|
174
185
|
margin-right: 10px;
|
|
175
186
|
cursor: pointer;
|
|
176
187
|
border: none;
|
|
177
188
|
text-decoration: none;
|
|
178
|
-
padding: 10px;
|
|
179
189
|
border-radius: 3px;
|
|
180
190
|
background: black;
|
|
181
191
|
color: white;
|
|
@@ -187,10 +197,16 @@ body.dark .empty {
|
|
|
187
197
|
}
|
|
188
198
|
.empty {
|
|
189
199
|
text-align: center;
|
|
190
|
-
|
|
200
|
+
height: 100%;
|
|
201
|
+
display: flex;
|
|
202
|
+
flex-direction: column;
|
|
203
|
+
justify-content: center;
|
|
191
204
|
opacity: 0.5;
|
|
192
205
|
background: rgba(0,0,0,0.04);
|
|
193
206
|
}
|
|
207
|
+
.flexible {
|
|
208
|
+
flex-grow: 1;
|
|
209
|
+
}
|
|
194
210
|
</style>
|
|
195
211
|
</head>
|
|
196
212
|
<body class='<%=theme%>' data-platform="<%=platform%>" data-agent="<%=agent%>">
|
|
@@ -199,7 +215,7 @@ body.dark .empty {
|
|
|
199
215
|
<% if (connected) { %>
|
|
200
216
|
<a href="/run/scripts/git/push.json?cwd=<%=encodeURIComponent(dir)%>" class='btn'><i class="fa-brands fa-github"></i> Publish to GitHub</a>
|
|
201
217
|
<% } else { %>
|
|
202
|
-
<a class='btn'
|
|
218
|
+
<a class='btn' data-redirect="/github" target="_blank">Publish to GitHub</a>
|
|
203
219
|
<% } %>
|
|
204
220
|
<a href="/run/scripts/git/commit.json?cwd=<%=encodeURIComponent(dir)%>" class='btn'><i class="fa-solid fa-floppy-disk"></i> Commit (Save the current version)</a>
|
|
205
221
|
<a href="<%=remote%>" target="_blank"><%=remote%></a>
|
|
@@ -207,25 +223,23 @@ body.dark .empty {
|
|
|
207
223
|
<% if (connected) { %>
|
|
208
224
|
<a href="/run/scripts/git/create.json?cwd=<%=encodeURIComponent(dir)%>" class='btn'><i class="fa-brands fa-github"></i> Create on GitHub</a>
|
|
209
225
|
<% } else { %>
|
|
210
|
-
<a class='btn'
|
|
226
|
+
<a class='btn' data-redirect="/github" target="_blank">Create on GitHub</a>
|
|
211
227
|
<% } %>
|
|
212
228
|
<a href="/run/scripts/git/commit.json?cwd=<%=encodeURIComponent(dir)%>" class='btn'><i class="fa-solid fa-floppy-disk"></i> Commit (Save the current version)</a>
|
|
213
229
|
<% } %>
|
|
214
230
|
</nav>
|
|
215
231
|
<main>
|
|
216
|
-
|
|
217
|
-
<
|
|
218
|
-
|
|
232
|
+
<% if (changes && changes.length > 0) { %>
|
|
233
|
+
<aside>
|
|
234
|
+
<h2><i class="fa-solid fa-code-compare"></i> Changes</h2>
|
|
219
235
|
<% changes.forEach(({ file, status, binary, diff, webpath }) => { %>
|
|
220
236
|
<a class='item' data-selector="<%=file%>" href="#<%=file%>"><%=file%></a>
|
|
221
237
|
<% }) %>
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
<% if (changes && changes.length > 0) { %>
|
|
226
|
-
<% changes.forEach(({ file, status, binary, diff, webpath }) => { %>
|
|
238
|
+
</aside>
|
|
239
|
+
<div class='changes'>
|
|
240
|
+
<% changes.forEach(({ file, status, binary, diff, webpath, path }) => { %>
|
|
227
241
|
<div id="<%=file%>" class='chunk' data-selection="<%=file%>">
|
|
228
|
-
<h3>[<%= status %>] <%= file %></h3>
|
|
242
|
+
<h3><div class='flexible'>[<%= status %>] <%= file %></div><a class='btn' data-filepath="<%=path%>"><i class="fa-solid fa-arrow-up-right-from-square"></i> Open</a></h3>
|
|
229
243
|
<% if (binary) { %>
|
|
230
244
|
<div class="binary-notice">[Binary file <%= status %>]</div>
|
|
231
245
|
<iframe src="<%=webpath%>"></iframe>
|
|
@@ -243,14 +257,16 @@ body.dark .empty {
|
|
|
243
257
|
</div>
|
|
244
258
|
<% }); %>
|
|
245
259
|
<div class='filler'></div>
|
|
246
|
-
|
|
260
|
+
</div>
|
|
261
|
+
<% } else { %>
|
|
262
|
+
<div class='changes'>
|
|
247
263
|
<div class='empty'>No changes</div>
|
|
248
|
-
|
|
249
|
-
|
|
264
|
+
</div>
|
|
265
|
+
<% } %>
|
|
250
266
|
</main>
|
|
251
267
|
<script>
|
|
252
268
|
document.querySelector("nav").addEventListener("click", (e) => {
|
|
253
|
-
let redirect = e.target.getAttribute("
|
|
269
|
+
let redirect = e.target.getAttribute("[data-redirect]")
|
|
254
270
|
if (redirect) {
|
|
255
271
|
const c = confirm("Please connect with GitHub first")
|
|
256
272
|
if (c) {
|
package/server/views/github.ejs
CHANGED
|
@@ -142,7 +142,7 @@ body.dark .setup-items pre, body.dark .setup-items .pre {
|
|
|
142
142
|
}
|
|
143
143
|
.setup-items pre, .setup-items .pre {
|
|
144
144
|
box-sizing: border-box;
|
|
145
|
-
margin: 10px 0
|
|
145
|
+
margin: 10px 0;
|
|
146
146
|
width: 100%;
|
|
147
147
|
padding: 20px;
|
|
148
148
|
background: rgba(0,0,0,0.04) !important;
|
|
@@ -251,11 +251,12 @@ ol {
|
|
|
251
251
|
</header>
|
|
252
252
|
<main>
|
|
253
253
|
<div class='head'>
|
|
254
|
-
<h3><i class="fa-brands fa-
|
|
254
|
+
<h3><i class="fa-brands fa-git-alt"></i><br><br>Configure Git</h3>
|
|
255
255
|
</div>
|
|
256
256
|
<div class='cols'>
|
|
257
257
|
<div class='column'>
|
|
258
|
-
<h1>GitHub</h1>
|
|
258
|
+
<h1><i class="fa-brands fa-github"></i> GitHub</h1>
|
|
259
|
+
<div>Connect with GitHub to publish projects to GitHub.</div>
|
|
259
260
|
<div class='setup-items'>
|
|
260
261
|
<% if (hosts.length > 0) { %>
|
|
261
262
|
<pre><%=hosts%></pre>
|
|
@@ -275,7 +276,8 @@ ol {
|
|
|
275
276
|
</div>
|
|
276
277
|
</div>
|
|
277
278
|
<div class='column'>
|
|
278
|
-
<h1>Git Config</h1>
|
|
279
|
+
<h1><i class="fa-brands fa-square-git"></i> Git Config</h1>
|
|
280
|
+
<div>These credentials will show up on every commit.</div>
|
|
279
281
|
<div class='setup-items'>
|
|
280
282
|
<form class='gitconfig'>
|
|
281
283
|
<div class='pre'>
|