Allow running custom tasks directly with npx
See original GitHub issueI’d like to be able to run an mrm task without a) globally installing mrm and b) without globally installing the task. I.e. just:
npx @my-org/my-task
And have that be it.
AFAIU right now I have to both npm i -g mrm
as well as npm i -g @my-org/my-task
, to finally be able to do mrm @my-org/my-task
.
Granted, if I’m going to run mrm
and @my-org/my-task
repetitively, this is fine, but I’d like to use mrm
for things similar to npx create-react-app
, where users who want to use/install a library want to run just a one-time command or two, and won’t necessarily have/want mrm
to be installed globally and stick around.
(Note that I know npx mrm
works, but AFAIU I can’t avoid an npm i -g
for custom tasks, i.e. how can I invoke @my-org/my-task
with a single npx
invocation?)
(Fwiw, my guess that this is admittedly tricky because npx
would need to fetch both the core mrm
as well as @my-org/my-task
with a single npx
invocation, so it’s probably “simplest” for the npx
command to look like npx @my-org/my-task
and then somehow the task knows it’s being run directly and actually invokes mrm
with itself as the task to run.)
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
@kevinkhill ah yeah, I get that. When I used to do Java projects back in the day, publishing to Maven central (their npm) was a huge PITA (mostly b/c Maven central was actually secure (for some definition of secure) and required registering your package via an email address from your org’s DNS)
</soapbox>
😃 ).So yeah being able to “just pull from a git url” seems neat too. Especially if it’s public/no auth.
@kevinkhill personally publishing tasks to npm wasn’t a big deal for us. Really great to hear you’re poking around at mrm internals though! Its a great project.