-
Notifications
You must be signed in to change notification settings - Fork 198
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
Detect list of files used by a Wing project #3730
Comments
Yes! The current watch mechanism is not optimal at all. IMO, the interface CompileResult {
/** The output directory **/
outputDir: string;
/** The compilation dependencies (aka the files) **/
dependencies: string[];
// ... errors and warnings too?
} I don't know if wingc already has a mechanism to report such data but if it can print json to stdout, we should be able to build it. |
closed #3956 as a duplicate, when implementing this, please make sure that the solution also fits the case described there (creating a react website with wing file at the same directory level/ one folder down) |
(Added the console/simulator labels since not having a good watching mechanism impacts the DX of those tools) |
…rectory (#6416) This allows users to watch arbitrary places for file changes. This is mostly an escape hatch for #3730, but even when that is implemented there will probably continue to be a desire to watch arbitrary stuff. *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
Hi, This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. |
I ran into this while working on a winglib. The scenario was I was testing out an example, and I was importing a module from a parent directory, like in the snippet below. bring cloud;
bring "../hello.w" as hello;
new hello.Hello(); Unfortunately, when I made changes to "hello.w", the console didn't auto-update which was a bit confusing (also the "Reset" button doesn't re-compile the app so it didn't help). |
We would like to have a general way to track changes to a Wing project so that the Wing Console and other CLI commands (like
wing compile --watch
orwing test --watch
) can detect when a Wing project has changed and needs to be refreshed. The solution should also solve the case when a user adds a new .w file into their project (i.e. usesbring
on a file that hasn't been compiled before)It's possible this could be some kind of function exposed by
@winglang/compiler
that lists all files in the project given an entrypoint file passed as an argument (i.e.main.w
or*.main.w
), or a custom watcher that takes an entrypoint and explicitly notifies (e.g. using callbacks or an EventEmitter when a file in the project has changed.P1: detect changes whenever Wing source files have changed
P2: detect changes whenever the
package.json
file has changed, or when extern JS files have changedThe text was updated successfully, but these errors were encountered: