feat(fmt): cache files using package plugins - #232
Conversation
Deploying rstack-cli with
|
| Latest commit: |
50522a6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://af2e3047.rstack-cli.pages.dev |
| Branch Preview URL: | https://chenjiahan-feat-fmt-plugin-c.rstack-cli.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50522a614b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| fingerprints.push(fingerprint); | ||
| } | ||
| value = { ...options, plugins: fingerprints }; |
There was a problem hiding this comment.
Account for plugin configuration inputs in the cache key
For plugins whose output depends on external files, such as prettier-plugin-tailwindcss reading a Tailwind config or stylesheet, changing that file leaves the formatted file content, the option containing its path, and this package fingerprint unchanged. The worker can consequently reuse the prior entry without running the plugin, causing --check to report clean or --write to do nothing even though the expected formatting changed; these plugins need their external inputs included in invalidation or must continue bypassing the cache.
Useful? React with 👍 / 👎.
Files using custom Prettier plugins currently bypass the persistent formatting cache even when the installed plugin identity is stable.
This PR resolves distinct plugin fingerprints once per invocation and injects them into per-file option hashes. Files using local, linked, or unversioned plugins continue to bypass the cache without disabling caching for other files.
Related Links