Compare commits

...

1 Commits

Author SHA1 Message Date
hongjr03 53d372e29b fix: report untracked legacy symlinks 2026-07-11 23:37:25 +08:00
4 changed files with 12 additions and 7 deletions
+4 -1
View File
@@ -49,7 +49,10 @@ async function findProjectFiles(directory) {
for (const entry of entries) { for (const entry of entries) {
if (entry.name === ".trash") continue; if (entry.name === ".trash") continue;
const path = resolve(directory, entry.name); const path = resolve(directory, entry.name);
if (entry.isSymbolicLink()) throw new Error(`legacy manifest rejects symbolic link: ${path}`); if (entry.isSymbolicLink()) {
process.stderr.write(`[legacy-manifest] skip untracked symbolic link: ${path}\n`);
continue;
}
if (entry.isDirectory()) found.push(...await findProjectFiles(path)); if (entry.isDirectory()) found.push(...await findProjectFiles(path));
} }
return found; return found;
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "@paradigm/hub", "name": "@paradigm/hub",
"version": "0.0.21", "version": "0.0.22",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@paradigm/hub", "name": "@paradigm/hub",
"version": "0.0.21", "version": "0.0.22",
"dependencies": { "dependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.3.202", "@anthropic-ai/claude-agent-sdk": "^0.3.202",
"@fastify/cookie": "^11.0.2", "@fastify/cookie": "^11.0.2",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@paradigm/hub", "name": "@paradigm/hub",
"version": "0.0.21", "version": "0.0.22",
"private": true, "private": true,
"type": "module", "type": "module",
"engines": { "engines": {
@@ -48,14 +48,16 @@ describe("legacy project manifest builder", () => {
}]); }]);
}); });
it("rejects symlinked entries instead of silently omitting them", async () => { it("reports untracked symlinked entries instead of silently omitting them", async () => {
const root = await mkdtemp(join(tmpdir(), "cph-legacy-manifest-link-")); const root = await mkdtemp(join(tmpdir(), "cph-legacy-manifest-link-"));
temporaryRoots.push(root); temporaryRoots.push(root);
await symlink("/tmp", join(root, "linked-project")); await symlink("/tmp", join(root, "linked-project"));
await expect(execute(process.execPath, [ const result = await execute(process.execPath, [
resolve("deploy/build_legacy_project_manifest.mjs"), resolve("deploy/build_legacy_project_manifest.mjs"),
root, root,
])).rejects.toMatchObject({ stderr: expect.stringContaining("rejects symbolic link") }); ]);
expect(result.stderr).toContain("skip untracked symbolic link");
expect(JSON.parse(result.stdout)).toEqual([]);
}); });
}); });