Dashboard › craft › Distillation
192b79c5-5525-4fc4-bb26-d7ebcb67e131["lore_tm_v1_X6o7vRBnENGw8VJrYJgV9VXdZznXFB-oPer8loFCwOo","lore_tm_v1_BU04v-0p635_PBAjbE2-nmQaUj66kKqY-8h_qnHft4Q"]
Date: Aug 24, 2026
src/index.ts establishes the active workspace before yargs parsing/builders by calling setActiveWorkspace(extractWorkspaceSelection(argv)) after fixGlobalBooleanFlags(process.argv.slice(2)); this is required because command builders such as publish may read configuration and derive --target choices before middleware, so workspace selection in middleware would occur too late.extractWorkspaceSelection(argv) is documented as the single source of truth for --workspace versus CRAFT_WORKSPACE precedence.GLOBAL_BOOLEAN_FLAGS defines global no-input and dry-run flags; fixGlobalBooleanFlags(argv) manually scans arguments and injects '1' after a standalone matching global flag so yargs can treat environment-backed string flags as booleans while permitting --flag=no.fixGlobalBooleanFlags’ manual argument scan with Node’s parseArgs({ tokens: true }), while preserving early workspace selection before yargs command builders run.