question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow running custom tasks directly with npx

See original GitHub issue

I’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:open
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
stephenhcommented, Aug 22, 2022

@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.

1reaction
stephenhcommented, Aug 20, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to automate development tasks using NPX
In this mindset, I learned about NPX, the NPM package runner. This is the perfect tool for one-liners as you get the full...
Read more >
Gradle tasks to run node, npm, npx, yarn commands - Siouan
The plugin provides the task type org.siouan.frontendgradleplugin.infrastructure.gradle.RunNpx that allows creating a custom task to run a npx command.
Read more >
npx - npm Docs
This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar...
Read more >
Introducing npx: an npm package runner | by Kat Marchán
The -p option for npx allows you to specify packages to install and add to the running $PATH , so it means you...
Read more >
Creating a task | Ethereum development environment for ...
To see the currently available tasks in your project, run npx hardhat : ... Let's go through the process of creating one to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found