Giter Site home page Giter Site logo

Comments (5)

Peeeep avatar Peeeep commented on June 12, 2024 5

I'm not sure if this helps in your case, but I have added this tiny script to my .zshrc to get autocomplete working whithout nx being globally installed (yarn in my case):

function nx() {
    yarn nx "$@"
}

from nx-completion.

edbzn avatar edbzn commented on June 12, 2024

I recently started to use pnpm and also noticed the warning but I just ignored it, I wonder what issues it can cause and why. I agree it would be great to handle this directly in the plugin, if you want to contribute you are welcome.

from nx-completion.

kopach avatar kopach commented on June 12, 2024

Sometimes, some command will fail if used without pnpm prefix. Usually more complex commands like nx generate or nx migrate, so this is not only warning.

I might take a look on this, but not sure I'll have time. But feel free to reuse that piece of code I've shared.

btw, not sure if this is possible, but I would improve the behavior of that script a bit.
The downside of script from above is that pnpm nx.. command gets written to history instead of nx .... So, I can't navigate back in history with arrows and re-use nx ... command with substitution. nx-completion plugin won't work.
Probably the solution would be to alter terminal history somehow after execution and write there nx ... instead of pnpm nx ...

from nx-completion.

kopach avatar kopach commented on June 12, 2024

Just as an idea for potential solution. There is a package I use https://github.com/antfu/ni which can automatically detect package manager used in the project and install dependencies with proper manager.
So, this plugin, potentially could do the same – detect package manager used and append yarn , pnpm or nothing in case of npm

from nx-completion.

kopach avatar kopach commented on June 12, 2024

and @Peeeep , your solution works like a charm, thanks.
In my case, I did the following for pnpm

# ~/.zshrc file
function nx() {
    pnpm nx "$@"
}

from nx-completion.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.