Giter Site home page Giter Site logo

nx-completion's People

Contributors

alireza-sampour avatar edbzn avatar esmilis avatar forivall avatar jensweigele avatar miwaniak avatar sesa488565 avatar yanis-git avatar yjaaidi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nx-completion's Issues

Does not work without a workspace file

If the workspace.json file does not exist (as is the way with a modern nx monorepo), the plugin generates this error when trying to autocomplete a package name:

image

> NX Running global Nx CLI with PNPM may have issues.

When running nx in pnpm managed repo, I get the following warning (which sometimes even results in not working command)

 >  NX   Running global Nx CLI with PNPM may have issues.

   Prefer to use "pnpm" (https://pnpm.io/cli/exec) to execute commands in this workspace.
    TIP  create a shortcut such as: alias pnx="pnpm nx --"

Using the alias from the TIP would break this autocompletion, so would be really great if the plugin could work with PNPM natively and run pnpm nx whenever nx is used.

Here is what I came up with as a solution for me:

In .zrhrc

function pnpm-nx() {
	local cmd=$BUFFER
	if [[ "$cmd" =~ ^nx ]]; then
		local new_cmd=$(echo $cmd | sed -E 's/^nx /pnpm nx /g')
		BUFFER="$new_cmd"
	fi
	zle accept-line
}

zle -N pnpm-nx
bindkey "^M" pnpm-nx

So, now whenever I type nx {command} it gets replaced by pnpm nx {command} automatically on Enter. This also doesn't break this autocompletion plugin

zsh-snap load

Thanks for writing this :)

Probably not worth including in the readme, but felt like sharing.

I was able to get this added to my zsh-snap based config with a one-liner:

znap eval nx "curl -fsSL https://raw.githubusercontent.com/zdog234/nx-completion/main/nx-completion.plugin.zsh"

(pointed at a fork because paranoia)

random aside:

I'm surprised nx doesn't include completion out of the box -- it seems like the JS ecosystem is a bit lacking w.r.t. CLI libaries compared to other languages I've worked in

Feature Request: Work with local Nx CLI installation

Hi,

This is such a nice plugin that I don't realize I want. However, like many people, I don't usually have Nx CLI installed globally and use yarn nx (or npx nx) to invoke the locally installed nx instead.

That said, would it be possible to support yarn nx as well?

Thanks

Update arguments to stick to nx 12.x.x

  • A couple of arguments are outdated and/or missing, eg: --deleteOutputPath for nx build.
  • Regular Angular CLI arguments are not necessary, we can delete them.

'nx g' does not complete

Hi!

Completions work quite nicely, but I can't get "nx generate" to complete anything. I've seen that in the code you call nx g which in my case returns Specify the generator name (e.g., nx generate @nrwl/workspace:library) on stderr. My nx --version is 13.9.2.

Regards
Adam

Breaks on plugins that cannot be found

Hi all,

In a NX-angular project I cannot use the nx-completion plugin. It gives two errors when using it:

nx g Plugin listed in nx.json not found: devextreme-schematics
Plugin listed in nx.json not found: ng-extract-i18n-merge

These are npm installed packages, I'm not aware that they are listed in nx.json or elsewhere.

Thanks in advance

Is md5sha1sum also a dependency?

When running the latest version I got this error command not found: md5sum. That's probably because I needed to install it on MacOS with brew install md5sha1sum. After that it works fine. So maybe this should be mentioned in the readme.

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.