Comments (5)
Edit: converted to its own issue based on discussion below; see #1709.
Thanks for opening this, and you did not miss anything. We do not currently supply man pages! However, it would be relatively straightforward to implement using the clap_mangen
crate, since we already use clap for our CLI parser. If someone wants to implement it, it should be a relatively easy first issue.
For a rough idea of how to implement it, you would want to do roughly what we do in src/command/completions.rs
:
- Add
clap_mangen
as a dependency for that crate. - Add a new
man_pages
module as a sibling tocompletions
and the others. - Define a new clap argument with a
pub(crate) struct ManPages
. - Implement Volta’s
Command
trait forManPages
, including logging events the same basic wayCompletionts
does (so you will also need to add a newActivityKind
etc.) for it. - Use the
Man
struct fromclap_mangen
to generate the man pages from the command (crate::cli::Volta::command()
). - Emit the generated roff to the appropriate location. (You will have to see where that is on a per-OS basis!) One note that adds a small bit of complexity here: there is no “default” place to install it on Windows, as far as I know, but we should presumably still support it for someone who wants to read them there.
from volta.
Ahhhhh, I see. That is a separate very good feature request, and I should have clicked the links—I thought you were talking about npm’s implementation for itself rather than for packages. Whoops! We don’t have the feature explicitly… but you should test it? Because under the hood, volta install
is using npm install
, yarn install
, etc., so if it works in the underlying package manager, it may (I will not say “should” here, but “may”!) work already. Perhaps you’re asking, though, because you see that it does not?
from volta.
Well I would like to work on that myself, it should be fun. But I believe you misunderstood what I was trying to say :).
The situation is I wanna install a package that has a man page using volta, let's say my own package convconv. I expect volta to install its man page to correct directory in a way that when I run man convconv
the man page opens, similar to what npm does. The thing that npm does is it installs global packages in /usr/lib/node_modules
directory and creates a symbolic link from /usr/share/man/man1/convconv.1
to /usr/lib/node_modules/convconv/man/convconv.1
. So when man command looks for it in /usr/share/man/man1
folder it finds it. I wanted to know if volta has that feature or any plan for adding it.
That aside, having a man page for volta would be a nice thing to have as well. 👍
from volta.
Yeah, that didn't work for me. I should really check volta's source code to be sure I haven't missed anything though. But the way npm handles it is that it only symlinks man pages when the package is installed globally.
const binLinks = opts => {
const { path, pkg, force, global, top } = opts
// global top pkgs on windows get bins installed in {prefix}, and no mans
//
// unix global top pkgs get their bins installed in {prefix}/bin,
// and mans in {prefix}/share/man
//
// non-top pkgs get their bins installed in {prefix}/node_modules/.bin,
// and do not install mans
//
// non-global top pkgs don't have any bins or mans linked. From here on
// out, if it's top, we know that it's global, so no need to pass that
// option further down the stack.
if (top && !global) {
return Promise.resolve()
}
return Promise.all([
// allow clobbering within the local node_modules/.bin folder.
// only global bins are protected in this way, or else it is
// yet another vector for excessive dependency conflicts.
linkBins({ path, pkg, top, force: force || !top }),
linkMans({ path, pkg, top, force }),
])
}
from volta.
Intuitively, it is likely something about the way it does the final link actions—IIRC we do run npm install --global
but provide it a specific installation path to treat as its global installation location—but you’d have to set up some kind of debugging in the Node-side code to confirm that. That might be a touch annoying, since you will need to make sure you have the relevant copy of Node on your system which the volta install
will go through, and be sure it’s going through that one, and then patch the version in Volta’s cache to add logging or whatever. 😬
from volta.
Related Issues (20)
- Generate Volta man pages
- Running Node with Volta with TMP options HOT 5
- 关于文件路径问题 (Specify installation path)
- Volta/Nuxt problems between multiple user accounts? HOT 2
- SUGGESTION: Move volta config to .voltarc or somewhere else. HOT 1
- I am install [email protected] ,but platform runtime at [email protected],why HOT 1
- volta install cocoapods HOT 2
- Unable to install TypeScript: Could not create shared environment for package 'typescript' HOT 1
- Potential fork bomb
- how to solve pnpm's problem HOT 3
- When trying to install new versions volta hangs indefinitely and uses all available network bandwidth HOT 7
- Unable to install nativescript (CLI)
- When using child_process.fork() with the execPath pointing to volta on windows ipc breaks. HOT 1
- Volta changed the toolchain action HOT 1
- mkgainet.
- uninstall failed
- Can I use it on a prodcution server with pm2? HOT 1
- [PSA] yarn version discrepancy
- 1.1.2 HOT 1
- how to use it in Jenkins or gitlab ci?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from volta.