mnfst-publish 0.1.10 → 0.1.12
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/manifest.publish.mjs +14 -4
- package/package.json +1 -1
package/manifest.publish.mjs
CHANGED
|
@@ -222,9 +222,9 @@ export function makePublishIgnore(rawPatterns) {
|
|
|
222
222
|
const pathScoped = anchored || p.includes('/');
|
|
223
223
|
const body = p
|
|
224
224
|
.replace(/[.+^${}()|[\]\\]/g, '\\$&')
|
|
225
|
-
.replace(/\*\*/g, '
|
|
225
|
+
.replace(/\*\*/g, '\u0000')
|
|
226
226
|
.replace(/\*/g, '[^/]*')
|
|
227
|
-
.replace(
|
|
227
|
+
.replace(/\u0000/g, '.*')
|
|
228
228
|
.replace(/\?/g, '[^/]');
|
|
229
229
|
rules.push({ dirOnly, pathScoped, exact: new RegExp('^' + body + '$'), prefix: new RegExp('^' + body + '/') });
|
|
230
230
|
}
|
|
@@ -321,8 +321,12 @@ export function collectFiles(root, outputDir) {
|
|
|
321
321
|
// A server that predates this ignores the header and answers synchronously with
|
|
322
322
|
// {ok:true}; both are handled below.
|
|
323
323
|
const POLL_FIRST_MS = 1000;
|
|
324
|
-
const POLL_MAX_MS =
|
|
324
|
+
const POLL_MAX_MS = 2000;
|
|
325
325
|
const POLL_TOTAL_MS = 10 * 60 * 1000;
|
|
326
|
+
/* Ingest advances a bounded slice per status poll, so polls that observe the
|
|
327
|
+
`written` counter climbing must never give up: the overall cap applies only
|
|
328
|
+
while NO progress is being made. */
|
|
329
|
+
const NO_PROGRESS_MS = 10 * 60 * 1000;
|
|
326
330
|
// A status read that stays "pending" this long means the bundle never actually
|
|
327
331
|
// arrived. The grace matters because the server's token record is eventually
|
|
328
332
|
// consistent, so a brief stale "pending" right after an upload is normal.
|
|
@@ -361,6 +365,8 @@ export async function pollPublishStatus(statusUrl, opts = {}) {
|
|
|
361
365
|
const started = now();
|
|
362
366
|
let delay = POLL_FIRST_MS;
|
|
363
367
|
let lastProgress = started;
|
|
368
|
+
let lastWritten = -1;
|
|
369
|
+
let lastAdvance = started;
|
|
364
370
|
|
|
365
371
|
for (;;) {
|
|
366
372
|
let status = 0;
|
|
@@ -399,7 +405,11 @@ export async function pollPublishStatus(statusUrl, opts = {}) {
|
|
|
399
405
|
// keep waiting.
|
|
400
406
|
|
|
401
407
|
const elapsed = now() - started;
|
|
402
|
-
if (
|
|
408
|
+
if (json && typeof json.written === 'number' && json.written > lastWritten) {
|
|
409
|
+
lastWritten = json.written;
|
|
410
|
+
lastAdvance = now();
|
|
411
|
+
}
|
|
412
|
+
if (now() - lastAdvance >= Math.min(totalMs, NO_PROGRESS_MS)) return { state: 'timeout' };
|
|
403
413
|
if (elapsed - (lastProgress - started) >= PROGRESS_EVERY_MS) {
|
|
404
414
|
lastProgress = now();
|
|
405
415
|
logFn(` still publishing… (${Math.round(elapsed / 1000)}s)`);
|