@holdyourvoice/hyv 2.9.6 → 2.9.7
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/dist/index.js +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4680,6 +4680,10 @@ function assertSafeProfileName(name) {
|
|
|
4680
4680
|
}
|
|
4681
4681
|
return normalized;
|
|
4682
4682
|
}
|
|
4683
|
+
function toSafeProfileCacheKey(name) {
|
|
4684
|
+
const normalized = String(name || "").trim().toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
4685
|
+
return assertSafeProfileName(normalized || "profile");
|
|
4686
|
+
}
|
|
4683
4687
|
function profilePathForName(name) {
|
|
4684
4688
|
const safe = assertSafeProfileName(name);
|
|
4685
4689
|
ensureHyvDir();
|
|
@@ -15730,7 +15734,8 @@ function registerSyncCommand(program3) {
|
|
|
15730
15734
|
ensureHyvDir();
|
|
15731
15735
|
let profileCount = 0;
|
|
15732
15736
|
for (const profile of data.profiles) {
|
|
15733
|
-
|
|
15737
|
+
const cacheKey = toSafeProfileCacheKey(profile.slug || profile.name);
|
|
15738
|
+
writeCachedProfile(cacheKey, profile.content);
|
|
15734
15739
|
profileCount++;
|
|
15735
15740
|
}
|
|
15736
15741
|
const rulesPath = path7.join(CACHE_DIR, "rules.md");
|
|
@@ -15743,7 +15748,8 @@ function registerSyncCommand(program3) {
|
|
|
15743
15748
|
}
|
|
15744
15749
|
for (const profile of data.profiles) {
|
|
15745
15750
|
try {
|
|
15746
|
-
|
|
15751
|
+
const cacheKey = toSafeProfileCacheKey(profile.slug || profile.name);
|
|
15752
|
+
await loadFullProfile(cacheKey, { forceRefresh: true });
|
|
15747
15753
|
} catch {
|
|
15748
15754
|
}
|
|
15749
15755
|
}
|
package/package.json
CHANGED