Skip to content

blocks-cli: generate cache ignores public/*.csv — CSV redirect changes leave a stale blocks.gen.json #667

Open

Description

@aline-pereira

Problem

generate's blocks step is cached by .deco/generate.digests.json, and its inputs are only the top-level JSON files of .deco/blocks (scripts/generate.ts ~l.572, listTopLevelJson). The CSV redirects it materializes (__csv_redirects__<file> via lib/csv-redirects.ts) are read from public/<file>.csv, which is not part of the digest.

So updating only public/redirects.csv (the usual way a storefront ships new SEO redirects) leaves a stale .deco/blocks.gen.json wherever the file already exists: bun run generate / bun run build report the blocks step as cached and the old rules keep answering. Measured on deco-sites/oficina-tanstack after syncing 475 changed rows: /calca-linho-cinza-0076697020/p kept the old target (301 to another product) until generate --only blocks --force. Fresh CI checkouts are unaffected only because blocks.gen.json is gitignored and absent.

Proposal

Add every CSV referenced by a website/loaders/redirectsFromCsv.ts block (resolved the same way buildCsvRedirectBlocks does) to the blocks step's digest inputs.

Found while validating deco-sites/oficina-tanstack#479.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions