Skip to content
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

[Watch & Run] Add missing hooks #171

Merged

Conversation

Giovannini
Copy link
Contributor

Current implementation only watches 3 hooks: add, change and delete.

I needed to use the "ready" hook too in my app to run the command apppearing as soon as the vite server started. I just added the other hooks in the process: "addDir", "all", "error", "raw", "ready", "unlink", "unlinkDir".

@vercel
Copy link

vercel bot commented Jul 7, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
kitql ✅ Ready (Inspect) Visit Preview Jul 11, 2022 at 5:51PM (UTC)

@@ -128,6 +140,12 @@ async function watcher(absolutePath: string, watchKind: WatchKind, watchAndRunCo
}

const log = new Log('KitQL vite-plugin-watch-and-run')
const toCamel = (s: string): string => s
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the end, it may be better to directly use vite camelCase naming instead of snake uppercase naming here. Keeping it for compatibility.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind doing a breaking change to be inlined with vite
It's also less code here and simpler.

Do you want to refactor?

@Giovannini
Copy link
Contributor Author

I misunderstood something and this PR is not usable as it is (sorry for that).
There is not an absolute path to match at most of these steps so current implementation does not work.

@jycouet
Copy link
Owner

jycouet commented Jul 7, 2022

1/ Thx a lot for your contribution
2/ @all-contributors please add @Giovannini for code
3/ maybe we can skip the match on kind where it doesn't make sense?

@allcontributors
Copy link
Contributor

@jycouet

I've put up a pull request to add @Giovannini! 🎉

@Giovannini
Copy link
Contributor Author

Is there a README I did not see explaining the way to configure the dev environment ?
I can see there's a .vscode folder but the package does not seems to display any Typescript annotation to help development (I am not that familiar with yarn workspace). That did not help me avoiding to push bad code 😅

@jycouet
Copy link
Owner

jycouet commented Jul 11, 2022

Is there a README I did not see explaining the way to configure the dev environment ? I can see there's a .vscode folder but the package does not seems to display any Typescript annotation to help development (I am not that familiar with yarn workspace). That did not help me avoiding to push bad code 😅

I'm willing to improve 😅
What Typescript annotation are you looking for?

@Giovannini
Copy link
Contributor Author

I'm willing to improve 😅 What Typescript annotation are you looking for?

Just the type errors actually. Locally, I just added a tsconfig file to the package I'm developping in so I can have some.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants