fix(appkit): make typegen --no-cache actually bypass the cache [F5]#425
Draft
atilafassina wants to merge 1 commit into
Draft
fix(appkit): make typegen --no-cache actually bypass the cache [F5]#425atilafassina wants to merge 1 commit into
atilafassina wants to merge 1 commit into
Conversation
The documented `generate-types --no-cache` flag was a silent no-op: the value was read from `options.noCache`, but commander stores the `--no-cache` boolean negation under `options.cache` (true by default, false when passed). - Read the flag as `options.cache === false` and thread the resulting noCache into both generateFromEntryPoint and generateServingTypes. - Forward `--no-cache` to the detached background worker when set, so the refresh bypasses the cache too — while still carrying `...process.execArgv` and `--wait` (dropping either silently breaks the tsx-run worker). Tests: foreground bypass (noCache:true into both generators), default keeps caching (noCache:false), worker argv includes/omits --no-cache and retains execArgv + --wait. Resets commander's singleton option state per test to avoid cross-test flag leakage. Co-authored-by: Isaac Signed-off-by: Atila Fassina <atila@fassina.eu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR3 of the typegen review-fix stack. Independent of PR1/PR2 (branches off
main).Scope: make the documented
generate-types --no-cacheflag actually work (F5).The bug
--no-cachewas a silent no-op. The value was read fromoptions.noCache, butcommander stores the
--no-cacheboolean negation underoptions.cache(trueby default,
falsewhen the flag is passed). SonoCachewas alwaysfalse.Changes (
generate-types.ts)options.cache === falseand threadnoCacheinto bothgenerateFromEntryPointandgenerateServingTypes.--no-cacheto the detached background worker when set, so the refreshbypasses the cache too — while still carrying
...process.execArgvand--wait(dropping either silently breaks a tsx-run worker).noCache?→cache?to match what commander populates.Acceptance criteria (asserted)
--no-cachepropagatesnoCache: trueintogenerateFromEntryPointandgenerateServingTypes.--no-cachewhen set, omits it otherwise,and always retains
...process.execArgv+--wait.Checks
pnpm test(shared CLI),pnpm -r typecheck,pnpm check,pnpm --filter shared build:packageall green. Tests reset commander'ssingleton option state per test to avoid cross-test flag leakage.
Note
Touches
generate-types.ts, which PR4 (lock-token) also edits. Branchedindependently off
main, so the two will textually conflict at merge — expectedand resolved at merge time.
This pull request and its description were written by Isaac.