-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore: watch for messages changes in dev generate script #15950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
@Rich-Harris it needs to be async because it's changing the files it's watching...without that guard it goes into an infinite loop |
ah lol whoops! i was being careless and thought it was about preventing multiple runs immediately after each other. I still think we can keep it sync though, and bail out inside the |
I tried but the watch callback is not sync so it's invoked a tad later. |
It's not sync, but you can reset the guard when it re-runs instead of after calling |
Yeah i guess it works too...good change! |
This always bothers me when adding a new warning/error because you have to rerun the dev script to regenerate the messages and if you forget it will also fail lint (since the script it also re-organise them).
This adds a watch mode to the script so that you can just run the dev script and be done with it (i had to do a bit of promise gymnastics because
messages
it's changing when the script run).Dunno if we want to merge this but it seems useful.
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.packages/svelte/src
, add a changeset (npx changeset
).Tests and linting
pnpm test
and lint the project withpnpm lint