···11+import "@typelex/emitter";
22+33+// Generated by typelex from ./lexicons (excluding com.test.*)
44+// This file is auto-generated. Do not edit manually.
55+66+@external
77+namespace com.atproto.label.defs {
88+ model SelfLabel { }
99+ model SelfLabels { }
1010+}
···11+import "@typelex/emitter";
22+33+// Generated by typelex from ./lexicons (excluding com.myapp.*)
44+// This file is auto-generated. Do not edit manually.
55+66+@external
77+namespace com.external.media.defs {
88+ model Video { }
99+}
···11+import "@typelex/emitter";
22+33+// Generated by typelex from ../lexicons (excluding com.myapp.*)
44+// This file is auto-generated. Do not edit manually.
55+66+@external
77+namespace com.atproto.label.defs {
88+ model SelfLabel { }
99+ model SelfLabels { }
1010+}
···11+import "@typelex/emitter";
22+33+// Generated by typelex from ../lexicons (excluding com.myapp.*)
44+// This file is auto-generated. Do not edit manually.
55+66+@external
77+namespace com.atproto.label.defs {
88+ model SelfLabel { }
99+ model SelfLabels { }
1010+}
···11+import { expect } from "vitest";
22+33+export async function run(project) {
44+ // Test: Namespace must end with .*
55+ let result = await project.runTypelex(["compile", "com.example"]);
66+ expect(result.exitCode).not.toBe(0);
77+ expect(result.output).toContain("namespace must end with .*");
88+99+ // Test: Output path must end with 'lexicons'
1010+ await project.writeFile("typelex/main.tsp", `import "@typelex/emitter";\nimport "./externals.tsp";\n`);
1111+ await project.writeFile("typelex/externals.tsp", `import "@typelex/emitter";\n`);
1212+1313+ result = await project.runTypelex(["compile", "com.test.*", "--out", "./output"]);
1414+ expect(result.exitCode).not.toBe(0);
1515+ expect(result.output).toContain("Output directory must end with 'lexicons'");
1616+1717+ // Test: main.tsp must exist
1818+ await project.runCommand("rm", ["-rf", "typelex"]);
1919+ result = await project.runTypelex(["compile", "com.test.*"]);
2020+ expect(result.exitCode).not.toBe(0);
2121+ expect(result.output).toContain("main.tsp not found");
2222+2323+ // Test: main.tsp first line must be import "@typelex/emitter"
2424+ await project.writeFile("typelex/main.tsp", `// wrong first line\nimport "./externals.tsp";\n`);
2525+ await project.writeFile("typelex/externals.tsp", `import "@typelex/emitter";\n`);
2626+ result = await project.runTypelex(["compile", "com.test.*"]);
2727+ expect(result.exitCode).not.toBe(0);
2828+ expect(result.output).toContain('main.tsp must start with: import "@typelex/emitter"');
2929+3030+ // Test: main.tsp second line must be import "./externals.tsp"
3131+ await project.writeFile("typelex/main.tsp", `import "@typelex/emitter";\n// wrong second line\n`);
3232+ result = await project.runTypelex(["compile", "com.test.*"]);
3333+ expect(result.exitCode).not.toBe(0);
3434+ expect(result.output).toContain('Line 2 of main.tsp must be: import "./externals.tsp"');
3535+}
···11+import "@typelex/emitter";
22+33+// Generated by typelex from ./lexicons (excluding com.myapp.*)
44+// This file is auto-generated. Do not edit manually.
55+66+@external
77+namespace com.atproto.label.defs {
88+ model SelfLabel { }
99+ model SelfLabels { }
1010+}
···11+import "@typelex/emitter";
22+33+// Generated by typelex from ./lexicons (excluding com.myapp.*)
44+// This file is auto-generated. Do not edit manually.
55+66+@external
77+namespace com.atproto.label.defs {
88+ model SelfLabel { }
99+ model SelfLabels { }
1010+}