open-wc / api-viewer-element

API documentation and live playground for Web Components. Based on Custom Elements Manifest format
https://api-viewer.open-wc.org
MIT License
269 stars 26 forks source link

The npm watch task is not notified about file changes #157

Closed bendera closed 1 year ago

bendera commented 2 years ago

I'd like to contribute to the project, but I couldn't figure out how to use the local development environment. When I run the yarn dev or yarn watch command, the modified files are not compiled automatically. Did I miss something? I tried to remove the "files": [], entry from tsconfig but in this case, the compiler complains about the definition files. I'm not skilled enough to fix this issue.

bennypowers commented 2 years ago

might be worth moving to wireit after https://github.com/google/wireit/issues/33 lands

bendera commented 1 year ago

Okay, I got it.

I forgot to mention the most important thing, I work on Windows.

I changed the tsc-watch command to tsc --build --watch in the watch task and it works perfectly. https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript

Other issues I have faced:

The web dev server refuses the connection when I start it with the dev task. I changed the script to: "dev": "concurrently \"npm run watch\" \"npm run serve\" --names=\"tsc,server\""

I had to replace single quotes to escaped double quotes in the analyze task of the fixtures/lit package: "analyze": "cem analyze --litelement --globs \"src/*.ts\""

I'm happy to open a PR for this if you need it.

web-padawan commented 1 year ago

Thanks for the issue. Sorry for not answering, I was busy with other things lately. Will update the npm scripts soon.