mnfst-publish 0.1.11 → 0.1.13
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 +9 -5
- 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
|
}
|
|
@@ -532,11 +532,15 @@ export function stampManifests(root, rels) {
|
|
|
532
532
|
continue; // invalid JSON — ship as-is
|
|
533
533
|
}
|
|
534
534
|
const dir = mfRel.includes('/') ? mfRel.slice(0, mfRel.lastIndexOf('/') + 1) : '';
|
|
535
|
-
const
|
|
535
|
+
const listed = [...(mf.preloadedComponents || []), ...(mf.components || [])]
|
|
536
536
|
.filter((p) => typeof p === 'string' && !p.startsWith('http'))
|
|
537
537
|
.map((p) => dir + p.replace(/^\/+/, ''))
|
|
538
|
-
.filter((p) => relSet.has(p))
|
|
539
|
-
|
|
538
|
+
.filter((p) => relSet.has(p));
|
|
539
|
+
// Convention components (components/<name>.html, unlisted) load with the
|
|
540
|
+
// same ?v= stamp — hash them too so their edits bust caches.
|
|
541
|
+
const conventionRe = new RegExp('^' + dir.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + 'components/[^/]+\\.html$');
|
|
542
|
+
const convention = [...relSet].filter((p) => conventionRe.test(p));
|
|
543
|
+
const paths = [...new Set([...listed, ...convention])].sort();
|
|
540
544
|
if (!paths.length) continue;
|
|
541
545
|
const hash = createHash('sha256');
|
|
542
546
|
for (const p of paths) {
|