andywer / andywer/postcss-debug

How to actually use this

未關閉
#19 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
94
分支
7
PR 合併指標
30 天內沒有已合併 PR

描述

The documentation is quite lacking. It basically doesn't explain how to actually use the thing. You have to follow the link to the Webdebugger README (under **Contributing**) to learn that it rewrites `index.html` with the debugging data embedded.

`debug.inspect()` doesn't appear to do much (it doesn't start a web server or anything), but behind the scenes it "automagically" updates the Webdebugger's static page. The Webdebugger is supposed to be "loosely coupled" and "stand-alone" but I'm not sure how you'd use one without the other.

To debug multiple files you have to call `debug` multiple times and `debug.inspect` only once, which is _reasonable_, but not documented.

Here's what I would suggest:
1. Consider the "Webdebugger" a vital part of this tool and explain how to access it on the README. It's best to do this with [live-server](https://www.npmjs.com/package/live-server) i.e. `live-server --open node_modules/postcss-debug/webdebugger/build/`
2. Instead of rewriting `index.html`, have `index.html` include the debugging data via a script tag. Let the static page truly be a static page and avoid having to patch it with string replacement.
3. Rename `debug.inspect` to something like `debug.dump` or `debug.write`, and provide a callback with the path to the static page, so the user can log something when it's done, maybe launch a server, and to improve the code's ability to self-document.
4. Document the methods of the API explicitly, not just through code examples

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。