From abe6cc49b93804b0706d97865c9bd5ff60f08906 Mon Sep 17 00:00:00 2001 From: centdix <40307056+centdix@users.noreply.github.com> Date: Tue, 27 Jan 2026 18:58:03 +0100 Subject: [PATCH] fix(cli): make `wmill app lint` and `wmill app generate-agents` respect nonDottedPaths setting (#7706) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These commands were using folder suffix checks without first loading the nonDottedPaths setting from wmill.yaml, causing them to fail when run inside folders with non-dotted names (e.g., myapp__raw_app instead of myapp.raw_app). šŸ¤– Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude --- cli/src/commands/app/generate_agents.ts | 18 +++++++++++++----- cli/src/commands/app/lint.ts | 4 ++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/cli/src/commands/app/generate_agents.ts b/cli/src/commands/app/generate_agents.ts index e186ee06a8..b9feebc56d 100644 --- a/cli/src/commands/app/generate_agents.ts +++ b/cli/src/commands/app/generate_agents.ts @@ -7,6 +7,11 @@ import { DataTableSchema } from "../../../gen/types.gen.ts"; import { generateAgentsDocumentation } from "../sync/sync.ts"; import path from "node:path"; import * as fs from "node:fs"; +import { + getFolderSuffix, + hasFolderSuffix, + loadNonDottedPathsSetting, +} from "../../utils/resource_folders.ts"; interface GenerateAgentsOptions extends GlobalOptions { output?: string; @@ -230,14 +235,17 @@ async function generateAgents( : path.join(cwd, appFolder); } - // Ensure we're in a .raw_app folder or targeting one + // Load nonDottedPaths setting before using folder suffix functions + await loadNonDottedPathsSetting(); + + // Ensure we're in a raw_app folder or targeting one const dirName = path.basename(targetDir); - if (!dirName.endsWith(".raw_app")) { - // Check if current directory is a .raw_app folder - if (!path.basename(cwd).endsWith(".raw_app") && !appFolder) { + if (!hasFolderSuffix(dirName, "raw_app")) { + // Check if current directory is a raw_app folder + if (!hasFolderSuffix(path.basename(cwd), "raw_app") && !appFolder) { log.error( colors.red( - "Error: Must be run inside a .raw_app folder or specify one as argument." + `Error: Must be run inside a ${getFolderSuffix("raw_app")} folder or specify one as argument.` ) ); log.info(colors.gray("Usage: wmill app generate-agents [app_folder]")); diff --git a/cli/src/commands/app/lint.ts b/cli/src/commands/app/lint.ts index 02422553ab..af8d7e5ab3 100644 --- a/cli/src/commands/app/lint.ts +++ b/cli/src/commands/app/lint.ts @@ -10,6 +10,7 @@ import { loadRunnablesFromBackend } from "./raw_apps.ts"; import { getFolderSuffix, hasFolderSuffix, + loadNonDottedPathsSetting, } from "../../utils/resource_folders.ts"; interface LintOptions extends GlobalOptions { @@ -200,6 +201,9 @@ async function lintRawApp( * Main lint command */ async function lint(opts: LintOptions, appFolder?: string) { + // Load nonDottedPaths setting before using folder suffix functions + await loadNonDottedPathsSetting(); + const targetDir = appFolder ?? process.cwd(); log.info(colors.bold.blue(`\nšŸ” Linting raw app: ${targetDir}\n`));