Skip to content

Commit 0bed7e1

Browse files
committed
update registry
1 parent 7a85a86 commit 0bed7e1

File tree

9 files changed

+148
-88
lines changed

9 files changed

+148
-88
lines changed
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 38 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
gtag("js", new Date());
101101
gtag("config", "G-1B67VYZMXF");
102102
</script>
103-
<script type="module" crossorigin src="/assets/index-MDb74Gyn.js"></script>
104-
<link rel="stylesheet" crossorigin href="/assets/index-DAvfO--b.css">
103+
<script type="module" crossorigin src="/assets/index-nDhrthX7.js"></script>
104+
<link rel="stylesheet" crossorigin href="/assets/index-Ddd-eCPz.css">
105105
<link rel="manifest" href="/manifest.webmanifest"></head>
106106

107107
<body>

registry/index/all.min.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"meta":{"registryId":"vixcpp-registry","specVersion":"1.0.0","generatedAt":"2026-02-11T04:45:14.383Z","sourceRepo":"https://github.com/vixcpp/registry","indexFormat":"json-per-package","entryCount":2},"entries":[{"description":"","displayName":"binary_search","homepage":"https://github.com/Gaspardkirira/binary_search","keywords":[],"latest":"0.1.2","license":"MIT","maintainers":[{"github":"","name":""}],"manifestPath":"vix.json","name":"binary_search","namespace":"gaspardkirira","repo":{"defaultBranch":"main","url":"https://github.com/Gaspardkirira/binary_search"},"type":"header-only","versions":{"0.1.1":{"commit":"b2cc3302637f336f2a798f8bf4e855c4b20f7522","notes":"Fix registry id + publishable commit","tag":"v0.1.1"},"0.1.2":{"commit":"adf2cd3c9b9784014223e4b33055521717b5fb84","notes":"Update README","tag":"v0.1.2"}}},{"description":"Tiny header-only example library for demonstrating the Vix Registry workflow.","displayName":"tree","homepage":"https://github.com/GaspardKirira/tree","keywords":["c++","header-only","demo","registry","vix"],"latest":"0.7.1","license":"MIT","maintainers":[{"github":"GaspardKirira","name":"Gaspard Kirira"}],"manifestPath":"vix.json","name":"tree","namespace":"gaspardkirira","readme":"# tree\n\nA tiny header-only example library for the Vix Registry demo.\n\n## Usage\n- Include headers from `include/`\n- Example in `examples/basic.cpp`\n\n---\n\n## License\n\nMIT © [Gaspard Kirira Authors](https://github.com/Gaspardkirira/tree)\n","repo":{"defaultBranch":"main","url":"https://github.com/GaspardKirira/tree"},"type":"header-only","versions":{"0.1.0":{"commit":"ffcf9d703e6113f5ac5887c99b45baaccf7e4937","notes":"Initial demo release","tag":"v0.1.0"},"0.2.0":{"commit":"b79ba53ca60a78a3c4b7baaa1da728907ee0a5fa","notes":"Add count_leaves helper","tag":"v0.2.0"},"0.5.0":{"commit":"b184d0cf2220f825ca41139bede5543c5e717df4","notes":"Add index_by_id helper","tag":"v0.5.0"},"0.6.0":{"commit":"6d6a9abdf1b80a85b2f97832153b754f9f746629","notes":"Add count_internal_nodes helper","tag":"v0.6.0"},"0.7.0":{"commit":"18363babf297b4050d2585596238012faee65d52","notes":"Add tree helper","tag":"v0.7.0"},"0.7.1":{"commit":"5f650ab896593c169f91dd722aaa72185db90f8c","notes":"Update README with code examples","tag":"v0.7.1"}}}]}
1+
{"meta":{"registryId":"vixcpp-registry","specVersion":"1.0.0","generatedAt":"2026-02-11T05:20:51.577Z","sourceRepo":"https://github.com/vixcpp/registry","indexFormat":"json-per-package","entryCount":3},"entries":[{"description":"","displayName":"binary_search","homepage":"https://github.com/Gaspardkirira/binary_search","keywords":[],"latest":"0.1.2","license":"MIT","maintainers":[{"github":"","name":""}],"manifestPath":"vix.json","name":"binary_search","namespace":"gaspardkirira","repo":{"defaultBranch":"main","url":"https://github.com/Gaspardkirira/binary_search"},"type":"header-only","versions":{"0.1.1":{"commit":"b2cc3302637f336f2a798f8bf4e855c4b20f7522","notes":"Fix registry id + publishable commit","tag":"v0.1.1"},"0.1.2":{"commit":"adf2cd3c9b9784014223e4b33055521717b5fb84","notes":"Update README","tag":"v0.1.2"}}},{"name":"test_lib","namespace":"gaspardkirira","displayName":"test_lib","description":"Header-only C++ utility library for testing Vix workflows and registry publishing.","keywords":["header-only"],"license":"MIT","repo":{"url":"https://github.com/GaspardKirira/test_lib","defaultBranch":"main"},"type":"header-only","manifestPath":"vix.json","homepage":"https://softadastra.com","maintainers":[{"name":"Gaspard kirira","github":"Gaspard Kirira"}],"versions":{"0.1.0":{"tag":"v0.1.0","commit":"f05619022bca6da576d7bf7dca65e028f7db654d","notes":"Add test_lib","publishedAt":"2026-02-11T05:06:50.025Z"}},"latest":"0.1.0"},{"description":"Tiny header-only example library for demonstrating the Vix Registry workflow.","displayName":"tree","homepage":"https://github.com/GaspardKirira/tree","keywords":["c++","header-only","demo","registry","vix"],"latest":"0.7.1","license":"MIT","maintainers":[{"github":"GaspardKirira","name":"Gaspard Kirira"}],"manifestPath":"vix.json","name":"tree","namespace":"gaspardkirira","readme":"# tree\n\nA tiny header-only example library for the Vix Registry demo.\n\n## Usage\n- Include headers from `include/`\n- Example in `examples/basic.cpp`\n\n---\n\n## License\n\nMIT © [Gaspard Kirira Authors](https://github.com/Gaspardkirira/tree)\n","repo":{"defaultBranch":"main","url":"https://github.com/GaspardKirira/tree"},"type":"header-only","versions":{"0.1.0":{"commit":"ffcf9d703e6113f5ac5887c99b45baaccf7e4937","notes":"Initial demo release","tag":"v0.1.0"},"0.2.0":{"commit":"b79ba53ca60a78a3c4b7baaa1da728907ee0a5fa","notes":"Add count_leaves helper","tag":"v0.2.0"},"0.5.0":{"commit":"b184d0cf2220f825ca41139bede5543c5e717df4","notes":"Add index_by_id helper","tag":"v0.5.0"},"0.6.0":{"commit":"6d6a9abdf1b80a85b2f97832153b754f9f746629","notes":"Add count_internal_nodes helper","tag":"v0.6.0"},"0.7.0":{"commit":"18363babf297b4050d2585596238012faee65d52","notes":"Add tree helper","tag":"v0.7.0"},"0.7.1":{"commit":"5f650ab896593c169f91dd722aaa72185db90f8c","notes":"Update README with code examples","tag":"v0.7.1"}}}]}

sw.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"meta":{"registryId":"vixcpp-registry","specVersion":"1.0.0","generatedAt":"2026-02-11T04:45:14.383Z","sourceRepo":"https://github.com/vixcpp/registry","indexFormat":"json-per-package","entryCount":2},"entries":[{"description":"","displayName":"binary_search","homepage":"https://github.com/Gaspardkirira/binary_search","keywords":[],"latest":"0.1.2","license":"MIT","maintainers":[{"github":"","name":""}],"manifestPath":"vix.json","name":"binary_search","namespace":"gaspardkirira","repo":{"defaultBranch":"main","url":"https://github.com/Gaspardkirira/binary_search"},"type":"header-only","versions":{"0.1.1":{"commit":"b2cc3302637f336f2a798f8bf4e855c4b20f7522","notes":"Fix registry id + publishable commit","tag":"v0.1.1"},"0.1.2":{"commit":"adf2cd3c9b9784014223e4b33055521717b5fb84","notes":"Update README","tag":"v0.1.2"}}},{"description":"Tiny header-only example library for demonstrating the Vix Registry workflow.","displayName":"tree","homepage":"https://github.com/GaspardKirira/tree","keywords":["c++","header-only","demo","registry","vix"],"latest":"0.7.1","license":"MIT","maintainers":[{"github":"GaspardKirira","name":"Gaspard Kirira"}],"manifestPath":"vix.json","name":"tree","namespace":"gaspardkirira","readme":"# tree\n\nA tiny header-only example library for the Vix Registry demo.\n\n## Usage\n- Include headers from `include/`\n- Example in `examples/basic.cpp`\n\n---\n\n## License\n\nMIT © [Gaspard Kirira Authors](https://github.com/Gaspardkirira/tree)\n","repo":{"defaultBranch":"main","url":"https://github.com/GaspardKirira/tree"},"type":"header-only","versions":{"0.1.0":{"commit":"ffcf9d703e6113f5ac5887c99b45baaccf7e4937","notes":"Initial demo release","tag":"v0.1.0"},"0.2.0":{"commit":"b79ba53ca60a78a3c4b7baaa1da728907ee0a5fa","notes":"Add count_leaves helper","tag":"v0.2.0"},"0.5.0":{"commit":"b184d0cf2220f825ca41139bede5543c5e717df4","notes":"Add index_by_id helper","tag":"v0.5.0"},"0.6.0":{"commit":"6d6a9abdf1b80a85b2f97832153b754f9f746629","notes":"Add count_internal_nodes helper","tag":"v0.6.0"},"0.7.0":{"commit":"18363babf297b4050d2585596238012faee65d52","notes":"Add tree helper","tag":"v0.7.0"},"0.7.1":{"commit":"5f650ab896593c169f91dd722aaa72185db90f8c","notes":"Update README with code examples","tag":"v0.7.1"}}}]}
1+
{"meta":{"registryId":"vixcpp-registry","specVersion":"1.0.0","generatedAt":"2026-02-11T05:20:51.577Z","sourceRepo":"https://github.com/vixcpp/registry","indexFormat":"json-per-package","entryCount":3},"entries":[{"description":"","displayName":"binary_search","homepage":"https://github.com/Gaspardkirira/binary_search","keywords":[],"latest":"0.1.2","license":"MIT","maintainers":[{"github":"","name":""}],"manifestPath":"vix.json","name":"binary_search","namespace":"gaspardkirira","repo":{"defaultBranch":"main","url":"https://github.com/Gaspardkirira/binary_search"},"type":"header-only","versions":{"0.1.1":{"commit":"b2cc3302637f336f2a798f8bf4e855c4b20f7522","notes":"Fix registry id + publishable commit","tag":"v0.1.1"},"0.1.2":{"commit":"adf2cd3c9b9784014223e4b33055521717b5fb84","notes":"Update README","tag":"v0.1.2"}}},{"name":"test_lib","namespace":"gaspardkirira","displayName":"test_lib","description":"Header-only C++ utility library for testing Vix workflows and registry publishing.","keywords":["header-only"],"license":"MIT","repo":{"url":"https://github.com/GaspardKirira/test_lib","defaultBranch":"main"},"type":"header-only","manifestPath":"vix.json","homepage":"https://softadastra.com","maintainers":[{"name":"Gaspard kirira","github":"Gaspard Kirira"}],"versions":{"0.1.0":{"tag":"v0.1.0","commit":"f05619022bca6da576d7bf7dca65e028f7db654d","notes":"Add test_lib","publishedAt":"2026-02-11T05:06:50.025Z"}},"latest":"0.1.0"},{"description":"Tiny header-only example library for demonstrating the Vix Registry workflow.","displayName":"tree","homepage":"https://github.com/GaspardKirira/tree","keywords":["c++","header-only","demo","registry","vix"],"latest":"0.7.1","license":"MIT","maintainers":[{"github":"GaspardKirira","name":"Gaspard Kirira"}],"manifestPath":"vix.json","name":"tree","namespace":"gaspardkirira","readme":"# tree\n\nA tiny header-only example library for the Vix Registry demo.\n\n## Usage\n- Include headers from `include/`\n- Example in `examples/basic.cpp`\n\n---\n\n## License\n\nMIT © [Gaspard Kirira Authors](https://github.com/Gaspardkirira/tree)\n","repo":{"defaultBranch":"main","url":"https://github.com/GaspardKirira/tree"},"type":"header-only","versions":{"0.1.0":{"commit":"ffcf9d703e6113f5ac5887c99b45baaccf7e4937","notes":"Initial demo release","tag":"v0.1.0"},"0.2.0":{"commit":"b79ba53ca60a78a3c4b7baaa1da728907ee0a5fa","notes":"Add count_leaves helper","tag":"v0.2.0"},"0.5.0":{"commit":"b184d0cf2220f825ca41139bede5543c5e717df4","notes":"Add index_by_id helper","tag":"v0.5.0"},"0.6.0":{"commit":"6d6a9abdf1b80a85b2f97832153b754f9f746629","notes":"Add count_internal_nodes helper","tag":"v0.6.0"},"0.7.0":{"commit":"18363babf297b4050d2585596238012faee65d52","notes":"Add tree helper","tag":"v0.7.0"},"0.7.1":{"commit":"5f650ab896593c169f91dd722aaa72185db90f8c","notes":"Update README with code examples","tag":"v0.7.1"}}}]}

vix-site/src/data/github_stats.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"repo": "vixcpp/vix",
3-
"fetched_at": "2026-02-11T04:46:09.458Z",
3+
"fetched_at": "2026-02-11T05:21:25.401Z",
44
"stars": 268,
55
"forks": 22,
66
"open_issues": 182,

vix-site/src/pages/registry/RegistryPublish.vue

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,26 @@ function toLower(s) {
3737
return (s || "").toLowerCase().trim();
3838
}
3939
40-
const nsLower = computed(() => toLower(namespace.value));
41-
const nameLower = computed(() => toLower(name.value));
40+
function sanitizeId(s) {
41+
return (s || "")
42+
.toLowerCase()
43+
.trim()
44+
.replace(/\//g, "-")
45+
.replace(/[^a-z0-9._-]/g, "");
46+
}
47+
48+
const nsLower = computed(() => sanitizeId(namespace.value));
49+
const nameLower = computed(() => sanitizeId(name.value));
4250
4351
const tag = computed(() => {
4452
const v = (version.value || "").trim();
4553
return v ? `v${v}` : "";
4654
});
4755
56+
const invalidId = computed(() => {
57+
return /[\\/]/.test(namespace.value) || /[\\/]/.test(name.value);
58+
});
59+
4860
const pkgId = computed(() => {
4961
if (!nsLower.value || !nameLower.value) return "";
5062
return `${nsLower.value}/${nameLower.value}`;
@@ -249,6 +261,7 @@ const canPublish = computed(() => {
249261
if (!previewJson.value) return false;
250262
if (requiredMissing.value.length) return false;
251263
if (versionAlreadyExists.value) return false;
264+
if (invalidId.value) return false;
252265
return true;
253266
});
254267
@@ -311,7 +324,7 @@ onMounted(async () => {
311324
312325
<pre class="cmd">
313326
vix new tree --lib
314-
vix publish 0.2.0 --notes "Add count_leaves helper"
327+
vix publish 0.2.0 --notes ""
315328
</pre>
316329
317330
<a
@@ -469,6 +482,10 @@ onMounted(async () => {
469482
This version already exists in the registry entry.
470483
</div>
471484
485+
<div v-if="invalidId" class="err">
486+
Namespace and name must not contain "/"
487+
</div>
488+
472489
<div v-if="existingEntry" class="hint">
473490
<div class="hint-row">
474491
<a class="link" :href="githubOpenExistingUrl" target="_blank" rel="noreferrer">

vix-site/tools/build_registry_index.js

Lines changed: 83 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,47 @@ function sh(cmd, cwd) {
1818
}
1919

2020
function ensureRegistryRepo({ root }) {
21-
const candidates = [
22-
path.join(root, "..", "..", "registry"),
23-
path.join(root, "..", "registry"),
24-
path.join(root, "registry"),
25-
];
21+
const FORCE_REMOTE = process.env.VIX_REGISTRY_SOURCE === "remote";
22+
23+
if (!FORCE_REMOTE) {
24+
const candidates = [
25+
path.join(root, "..", "..", "registry"),
26+
path.join(root, "..", "registry"),
27+
path.join(root, "registry"),
28+
];
29+
30+
for (const c of candidates) {
31+
if (
32+
fs.existsSync(path.join(c, "registry.json")) &&
33+
fs.existsSync(path.join(c, "index")) &&
34+
fs.existsSync(path.join(c, ".git"))
35+
) {
36+
try {
37+
sh("git fetch origin --prune", c);
38+
sh("git checkout main", c);
39+
sh("git pull --rebase origin main", c);
40+
} catch {
41+
// ignore update errors, still usable locally
42+
}
43+
return c;
44+
}
45+
}
2646

27-
for (const c of candidates) {
47+
const vixClone = path.join(
48+
process.env.HOME || "",
49+
".vix",
50+
"registry",
51+
"index",
52+
);
2853
if (
29-
fs.existsSync(path.join(c, "registry.json")) &&
30-
fs.existsSync(path.join(c, "index")) &&
31-
fs.existsSync(path.join(c, ".git"))
54+
vixClone &&
55+
fs.existsSync(path.join(vixClone, "registry.json")) &&
56+
fs.existsSync(path.join(vixClone, "index"))
3257
) {
33-
try {
34-
sh("git fetch origin --prune", c);
35-
sh("git checkout main", c);
36-
sh("git pull --rebase origin main", c);
37-
} catch {}
38-
return c;
58+
return vixClone;
3959
}
4060
}
4161

42-
const vixClone = path.join(
43-
process.env.HOME || "",
44-
".vix",
45-
"registry",
46-
"index",
47-
);
48-
49-
if (
50-
vixClone &&
51-
fs.existsSync(path.join(vixClone, "registry.json")) &&
52-
fs.existsSync(path.join(vixClone, "index"))
53-
) {
54-
return vixClone;
55-
}
56-
5762
const cacheDir = path.join(root, "tools", ".cache");
5863
const cloneDir = path.join(cacheDir, "registry");
5964

@@ -84,33 +89,64 @@ function ensureRegistryRepo({ root }) {
8489
return "";
8590
}
8691

92+
function safeReadEntry(file) {
93+
try {
94+
const e = readJson(file);
95+
if (!e || typeof e !== "object") return null;
96+
97+
const ns = typeof e.namespace === "string" ? e.namespace : "";
98+
const nm = typeof e.name === "string" ? e.name : "";
99+
if (!ns || !nm) return null;
100+
101+
return e;
102+
} catch {
103+
return null;
104+
}
105+
}
106+
87107
function main() {
88108
const root = process.cwd();
89109

90110
const registryRoot = ensureRegistryRepo({ root });
91-
92111
if (!registryRoot) {
93112
console.error("build_registry_index: registry repo not found.");
94113
console.error(
95-
"Looked for ../registry, ../../registry, ./registry, ~/.vix/registry/index, or a cached clone.",
114+
"Looked for ../../registry, ../registry, ./registry, ~/.vix/registry/index, or tools/.cache/registry.",
96115
);
97116
process.exit(1);
98117
}
99118

100119
const registryMetaPath = path.join(registryRoot, "registry.json");
101120
const indexDir = path.join(registryRoot, "index");
102121

122+
if (!fs.existsSync(registryMetaPath)) {
123+
console.error(
124+
"build_registry_index: missing registry.json at:",
125+
registryMetaPath,
126+
);
127+
process.exit(1);
128+
}
129+
if (!fs.existsSync(indexDir)) {
130+
console.error("build_registry_index: missing index dir at:", indexDir);
131+
process.exit(1);
132+
}
133+
103134
const registryMeta = readJson(registryMetaPath);
104135
const files = listJsonFiles(indexDir);
105136

106137
const entries = [];
107138
for (const file of files) {
108-
try {
109-
const e = readJson(file);
110-
entries.push(e);
111-
} catch {}
139+
const e = safeReadEntry(file);
140+
if (e) entries.push(e);
112141
}
113142

143+
// deterministic output for diffs
144+
entries.sort((a, b) => {
145+
const ida = `${a.namespace}/${a.name}`.toLowerCase();
146+
const idb = `${b.namespace}/${b.name}`.toLowerCase();
147+
return ida.localeCompare(idb);
148+
});
149+
114150
const out = {
115151
meta: {
116152
registryId: registryMeta.id || "vixcpp-registry",
@@ -129,16 +165,23 @@ function main() {
129165
const outPath = path.join(outDir, "all.min.json");
130166
fs.writeFileSync(outPath, JSON.stringify(out), "utf8");
131167

132-
const has071 = JSON.stringify(out).includes('"0.7.1"');
168+
// Helpful debug, not hardcoded to a single version
169+
const sample = entries
170+
.slice(0, 5)
171+
.map(
172+
(e) =>
173+
`${e.namespace}/${e.name}@${typeof e.latest === "string" ? e.latest : "?"}`,
174+
);
175+
133176
console.log(
134177
"registry index built:",
135178
outPath,
136179
"entries:",
137180
entries.length,
138-
"has_0.7.1:",
139-
has071,
181+
"source:",
182+
registryRoot,
140183
);
141-
console.log("registry source:", registryRoot);
184+
if (sample.length) console.log("registry sample:", sample.join(", "));
142185
}
143186

144187
main();

0 commit comments

Comments
 (0)