···1+import "@typelex/emitter";
2+3+// Generated by typelex from ./lexicons (excluding com.test.*)
4+// This file is auto-generated. Do not edit manually.
5+6+@external
7+namespace com.atproto.label.defs {
8+ model SelfLabel { }
9+ model SelfLabels { }
10+}
···1+import "@typelex/emitter";
2+3+// Generated by typelex from ./lexicons (excluding com.myapp.*)
4+// This file is auto-generated. Do not edit manually.
5+6+@external
7+namespace com.external.media.defs {
8+ model Video { }
9+}
···1+import "@typelex/emitter";
2+3+// Generated by typelex from ../lexicons (excluding com.myapp.*)
4+// This file is auto-generated. Do not edit manually.
5+6+@external
7+namespace com.atproto.label.defs {
8+ model SelfLabel { }
9+ model SelfLabels { }
10+}
···1+import "@typelex/emitter";
2+3+// Generated by typelex from ../lexicons (excluding com.myapp.*)
4+// This file is auto-generated. Do not edit manually.
5+6+@external
7+namespace com.atproto.label.defs {
8+ model SelfLabel { }
9+ model SelfLabels { }
10+}
···1+import { expect } from "vitest";
2+3+export async function run(project) {
4+ // Test: Namespace must end with .*
5+ let result = await project.runTypelex(["compile", "com.example"]);
6+ expect(result.exitCode).not.toBe(0);
7+ expect(result.output).toContain("namespace must end with .*");
8+9+ // Test: Output path must end with 'lexicons'
10+ await project.writeFile("typelex/main.tsp", `import "@typelex/emitter";\nimport "./externals.tsp";\n`);
11+ await project.writeFile("typelex/externals.tsp", `import "@typelex/emitter";\n`);
12+13+ result = await project.runTypelex(["compile", "com.test.*", "--out", "./output"]);
14+ expect(result.exitCode).not.toBe(0);
15+ expect(result.output).toContain("Output directory must end with 'lexicons'");
16+17+ // Test: main.tsp must exist
18+ await project.runCommand("rm", ["-rf", "typelex"]);
19+ result = await project.runTypelex(["compile", "com.test.*"]);
20+ expect(result.exitCode).not.toBe(0);
21+ expect(result.output).toContain("main.tsp not found");
22+23+ // Test: main.tsp first line must be import "@typelex/emitter"
24+ await project.writeFile("typelex/main.tsp", `// wrong first line\nimport "./externals.tsp";\n`);
25+ await project.writeFile("typelex/externals.tsp", `import "@typelex/emitter";\n`);
26+ result = await project.runTypelex(["compile", "com.test.*"]);
27+ expect(result.exitCode).not.toBe(0);
28+ expect(result.output).toContain('main.tsp must start with: import "@typelex/emitter"');
29+30+ // Test: main.tsp second line must be import "./externals.tsp"
31+ await project.writeFile("typelex/main.tsp", `import "@typelex/emitter";\n// wrong second line\n`);
32+ result = await project.runTypelex(["compile", "com.test.*"]);
33+ expect(result.exitCode).not.toBe(0);
34+ expect(result.output).toContain('Line 2 of main.tsp must be: import "./externals.tsp"');
35+}
···1+import "@typelex/emitter";
2+3+// Generated by typelex from ./lexicons (excluding com.myapp.*)
4+// This file is auto-generated. Do not edit manually.
5+6+@external
7+namespace com.atproto.label.defs {
8+ model SelfLabel { }
9+ model SelfLabels { }
10+}
···1+import "@typelex/emitter";
2+3+// Generated by typelex from ./lexicons (excluding com.myapp.*)
4+// This file is auto-generated. Do not edit manually.
5+6+@external
7+namespace com.atproto.label.defs {
8+ model SelfLabel { }
9+ model SelfLabels { }
10+}