You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While fixing the same machinery in @cldmv/holdmytask (PR #12, fix/devcheck-normal-module) and @cldmv/uuid (CLDMV/uuid#9), two bugs in slothlet's devcheck.mjs came up that apply here too. Slothlet's devcheck is deliberately more elaborate than the plain "normal module" version (it ships src/, deletes it in a later CI phase, distinguishes generic-development vs slothlet-dev, uses the !existsSync(distPath) guard), so this issue is scoped to only the parts that are genuinely wrong for slothlet — not a wholesale port of the holdmytask version.
Bugs
1. Dev-condition detection only checks NODE_OPTIONS, misses execArgv
node --conditions=slothlet-dev file.mjs puts the flag in process.execArgv, not NODE_OPTIONS — and that's how vitest passes conditions to its workers too (a worker's NODE_OPTIONS is undefined while execArgv carries --conditions slothlet-dev). The CLI form and the vitest-worker form therefore aren't detected, so devcheck can spuriously fire (or a --conditions-on-CLI dev gets a false warning). Fold execArgv into the haystack:
slothlet installs as node_modules/@cldmv/slothlet, so path.dirname(__dirname) is the @cldmv scope dir and basename is @cldmv, not node_modules — the guard never trips for slothlet's own scoped package. It's partly masked by the !existsSync(distPath) guard for registry installs, but a git/tarball install (which ships src/ and no dist/) would slip through and process.exit(1) inside a consumer. Detect a node_modules segment anywhere above the file:
slothlet's devcheck has richer branching (the wrong-settings vs no-settings messages, the dist guard) and no tests. holdmytask PR #12 added a spawn-based tests/DevCheck.test.vitest.mjs that could be adapted to slothlet's branches if worth it.
Explicitly NOT in scope for slothlet
The NODE_ENV-coupling fix and the "condition-only trigger" from the holdmytask/uuid issues — slothlet's model differs (it intentionally accepts generic-dev to warn and redirect, and its resolution/CI-cleanup story isn't the plain normal-module one), so its trigger shape may be correct as-is. Only the execArgv detection (Release v2.0.0 - Major architectural rewrite with universal… #1) and scoped-install guard (chore(master): release 2.0.0 #2) are clear bugs here.
The !existsSync(distPath) guard — correct for slothlet (unlike a plain normal module, where nagging-after-build is intended).
While fixing the same machinery in
@cldmv/holdmytask(PR #12,fix/devcheck-normal-module) and@cldmv/uuid(CLDMV/uuid#9), two bugs in slothlet'sdevcheck.mjscame up that apply here too. Slothlet's devcheck is deliberately more elaborate than the plain "normal module" version (it shipssrc/, deletes it in a later CI phase, distinguishes generic-developmentvsslothlet-dev, uses the!existsSync(distPath)guard), so this issue is scoped to only the parts that are genuinely wrong for slothlet — not a wholesale port of the holdmytask version.Bugs
1. Dev-condition detection only checks
NODE_OPTIONS, missesexecArgvnode --conditions=slothlet-dev file.mjsputs the flag inprocess.execArgv, notNODE_OPTIONS— and that's how vitest passes conditions to its workers too (a worker'sNODE_OPTIONSisundefinedwhileexecArgvcarries--conditions slothlet-dev). The CLI form and the vitest-worker form therefore aren't detected, so devcheck can spuriously fire (or a--conditions-on-CLI dev gets a false warning). FoldexecArgvinto the haystack:2. Installed-package guard misses scoped installs
slothlet installs as
node_modules/@cldmv/slothlet, sopath.dirname(__dirname)is the@cldmvscope dir andbasenameis@cldmv, notnode_modules— the guard never trips for slothlet's own scoped package. It's partly masked by the!existsSync(distPath)guard for registry installs, but a git/tarball install (which shipssrc/and nodist/) would slip through andprocess.exit(1)inside a consumer. Detect anode_modulessegment anywhere above the file:3. (Optional) no devcheck tests
slothlet's devcheck has richer branching (the wrong-settings vs no-settings messages, the dist guard) and no tests. holdmytask PR #12 added a spawn-based
tests/DevCheck.test.vitest.mjsthat could be adapted to slothlet's branches if worth it.Explicitly NOT in scope for slothlet
NODE_ENV-coupling fix and the "condition-only trigger" from the holdmytask/uuid issues — slothlet's model differs (it intentionally accepts generic-dev to warn and redirect, and its resolution/CI-cleanup story isn't the plain normal-module one), so its trigger shape may be correct as-is. Only theexecArgvdetection (Release v2.0.0 - Major architectural rewrite with universal… #1) and scoped-install guard (chore(master): release 2.0.0 #2) are clear bugs here.!existsSync(distPath)guard — correct for slothlet (unlike a plain normal module, where nagging-after-build is intended).Reference: holdmytask PR #12; CLDMV/uuid#9.