CLI docs using only markdown - #2361
Conversation
|
f95eebe to
762b65c
Compare
762b65c to
b583f40
Compare
3446d19 to
93972c6
Compare
93972c6 to
510604c
Compare
faa6518 to
6456e9a
Compare
aron
left a comment
There was a problem hiding this comment.
Added some suggestions inline to fix broken links and some minor formatting inconsistencies and broken likes but otherwise looks good to me 👍
ghost
left a comment
There was a problem hiding this comment.
Looks good. This will reduce a lot of PR friction around updating docs. 🎉
I've left a bunch of improvements we can make, but I don't think we should block this PR as it's greatly improving what we currently have. I'm mostly leaving comments to go back to later as this PR is huge.
Let's discuss later.
There was a problem hiding this comment.
The cause of this issue mentioned yesterday is likely because webpack.common's default export does not have an assigned type. So every usage needs the as Configuration to bypass TypeScript.
This can be avoided by assigning the type in webpack.common.
There was a problem hiding this comment.
Thank you so much for explaining!
There was a problem hiding this comment.
It would be nice to have tests for this as it's pretty complex and hard to know what each step is for.
There was a problem hiding this comment.
(Repeating myself) It would be nice to have tests for this as it's pretty complex and hard to know what each step is for.
There was a problem hiding this comment.
externals is a bit of a mess, so forcing TypeScript to assume it's string[] might cause weird bugs in the future. We could move the object to its own module and type and import it here and in webpack.common. That'd make it typesafe.
Here's the type for reference:
type Externals =
| string
| RegExp
| ExternalItem[]
| (ExternalItemObjectKnown & ExternalItemObjectUnknown)
| ((
data: ExternalItemFunctionData,
callback: (
err?: Error,
result?: string | boolean | string[] | { [index: string]: any }
) => void
) => void)
| ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);There was a problem hiding this comment.
Other notes: we should write tests for this script. Maybe consider removing externals logic entirely as it's empty. We can bring it back if/when we need it.
There was a problem hiding this comment.
We should move this execution to its own module like generate-help.ts. Having modules with both side-effects and exports will cause issues for dependant modules importing from it.
There was a problem hiding this comment.
I think we can integrate our help docs more closely with Webpack and let it do the hard work around watching, generating and bundling docs. Can't summarise the process in a comment box so let's discuss later.
There was a problem hiding this comment.
Why don't we want Prettier to format -docs? 🤔
There was a problem hiding this comment.
I don't think we need this "directories" key at all. It's just CommonJS metadata that nothing seems to be using.
https://docs.npmjs.com/cli/v8/configuring-npm/package-json#directories
http://wiki.commonjs.org/wiki/Packages/1.0
Less maintenance for us if we remove it.
2705b3e to
c5ccc61
Compare
c5ccc61 to
9aa0478
Compare
Transforming CLI help to a plain markdown to improve the editing experience and portability.