Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export function findConfig(startDir?: string): MexConfig {
const projectRoot = gitRoot ?? dir;

const mexDir = resolve(projectRoot, ".mex");
if (existsSync(mexDir) && !existsSync(resolve(mexDir, "setup.sh"))) {
throw new Error("Scaffold directory exists but looks incomplete. Run: bash .mex/setup.sh");
if (existsSync(mexDir) && !existsSync(resolve(mexDir, "ROUTER.md"))) {
throw new Error("Scaffold directory exists but looks incomplete. Run: mex setup");
}
Comment on lines 22 to 25

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested recovery command npx mex init is likely incorrect/misleading. In this repo, scaffold creation is done via the setup command (see src/cli.ts where setup is "First-time setup — create .mex/ scaffold"), while init requires an existing scaffold. Consider updating the message to point to mex setup (or npx promexeus setup for non-global installs) so users can actually recover from an incomplete scaffold.

Copilot uses AI. Check for mistakes.

const scaffoldRoot = findScaffoldRoot(projectRoot);
Expand All @@ -31,7 +31,7 @@ export function findConfig(startDir?: string): MexConfig {
}

throw new Error(
"No .mex/ scaffold found. Run: git clone https://github.com/theDakshJaitly/mex.git .mex && bash .mex/setup.sh"
"No .mex/ scaffold found. Run: mex setup"
);
Comment on lines 33 to 35

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message also points to npx mex init, but init is a pre-scan command that expects a valid scaffold; the command that creates the .mex/ scaffold is setup (see src/cli.ts). Update this guidance to mex setup / npx promexeus setup so a first-time user can fix the missing scaffold.

Copilot uses AI. Check for mistakes.
}

Expand Down
6 changes: 3 additions & 3 deletions test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ describe("findConfig", () => {

it("throws when no .mex/ scaffold found at all", () => {
mkdirSync(join(tmpDir, ".git"));
expect(() => findConfig(tmpDir)).toThrow("No .mex/ scaffold found. Run: git clone");
expect(() => findConfig(tmpDir)).toThrow("No .mex/ scaffold found. Run: mex setup");
});
Comment on lines 34 to 37

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test expectation is aligned to the new string, but the string itself likely points to the wrong command: scaffold creation is setup, not init (and via npx the package name is promexeus). After fixing the error message in src/config.ts, update this assertion to match the corrected guidance.

Copilot uses AI. Check for mistakes.

it("works without .git if a complete scaffold exists", () => {
const mexPath = join(tmpDir, ".mex");
mkdirSync(mexPath);
writeFileSync(join(mexPath, "setup.sh"), "");
writeFileSync(join(mexPath, "ROUTER.md"), "");

const config = findConfig(tmpDir);
expect(config.projectRoot).toBe(tmpDir);
Expand All @@ -58,7 +58,7 @@ describe("findConfig", () => {
mkdirSync(join(tmpDir, ".git"));
const mexPath = join(tmpDir, ".mex");
mkdirSync(mexPath);
writeFileSync(join(mexPath, "setup.sh"), "");
writeFileSync(join(mexPath, "ROUTER.md"), "");
mkdirSync(join(tmpDir, "context"));
const config = findConfig(tmpDir);
expect(config.scaffoldRoot).toBe(mexPath);
Expand Down
Loading