Repository navigation
PackageManagers: option for long flags (--save-dev instead of -D) #444
dimitropoulos
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What I want
A way to make
<PackageManagers>print long flags instead of short ones. Todaydevrenders as:npm i -Dnpm install --save-devyarn add -Dyarn add --devpnpm add -Dpnpm add --save-devbun add -dbun add --devWhy
Docs are read by people who don't yet know the command, let alone its shortcuts.
-Dtells a newcomer nothing, while--save-devsays what it does. The Forge docs (built on Nimbus) have a rule against short flags in any command, and<PackageManagers>is the one place we can't follow it.What we do now
The strings are hard-coded in the
commandstable inpackages/nimbus-docs/src/lib/pkgm.ts. That table feeds the component, the Markdown pages andllms-full.txt, so changing only the starter'sPackageManagers.astroleaves the Markdown output with short flags. We carry apnpm patchofdist/lib/pkgm.jsthat changesnpm itonpm installand the fourdevvalues. It has to be redone on every Nimbus upgrade.Possible shapes
Either would work for us:
defineNimbusConfig({ packageManagers: { longFlags: true } }), that makespkgmusenpm installand the longdevflags everywhere.defineNimbusConfig({ packageManagers: { commands: { npm: { add: "npm install", dev: "--save-dev" } } } }), merged over the built-in table. This is more general and also covers other preferences, likenpm installovernpm i.The setting has to reach every caller of
getTabsandgetCommand(the component, the MDX-to-Markdown renderer and the discoverability output), not just the component. Otherwise the HTML and Markdown versions of a page disagree.Using long flags by default would also be reasonable, since every manager supports them.
All reactions