remix-run / indie-stack

The Remix Stack for deploying to Fly with SQLite, authentication, testing, linting, formatting, etc.
https://remix.run/stacks
MIT License
1.13k stars 315 forks source link

Add MSW setup instructions #292

Closed petecartwright closed 1 month ago

petecartwright commented 4 months ago

See #291 for some additional details.

With the current setup guide, users will get 404s in their terminal looking for mockServiceWorker.js.

This PR adds msw init to the setup guide, and adds the generated public/mockServiceWorker.js file to .gitignore and .dockerignore to minimize likelihood of it getting packaged for prod.

I went back and forth on whether this makes more sense in the ## Development section, or as a new ### Mocking section under ## Testing. Happy to make that change or any rephrase y'all prefer.

MichaelDeBoey commented 1 month ago

@petecartwright I can't seem to reproduce the problem you're explaining. I can just run npm run dev and look around in the app without any problem.

Tagging @kettanaito (the creator/maintainer of MSW) to know if we would need to add the created public/mockServiceWorker.js file or not

petecartwright commented 1 month ago

Hm - thanks for looking! I can try to reproduce locally tomorrow. If I can’t replicate, I’ll close and we can pretend this never happened. 😀

petecartwright commented 1 month ago

Closing, see #291 for a little more context.