136298e11073c7b34e5a977595c7ba5345ca910e
- Author
- Mohaiminus Sakib <3596793+rode093@users.noreply.github.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
feat(nestjs) Adding NestJS plugin (#13104)
* Adding NestJS command aliases
* Removed installation instructions from the README file of NestJS plugin
Diff
1diff --git a/plugins/nestjs/README.md b/plugins/nestjs/README.md
2new file mode 100644
3index 0000000000000000000000000000000000000000..295618214b4003760e4a221bd3d1084060643b00
4--- /dev/null
5+++ b/plugins/nestjs/README.md
6@@ -0,0 +1,52 @@
7+# NestJS Plugin for Oh My Zsh
8+
9+This plugin provides aliases for common [NestJS CLI](https://docs.nestjs.com/cli/overview) commands.
10+
11+## Requirements
12+
13+- [NestJS CLI](https://docs.nestjs.com/cli/overview#installation) installed globally:
14+ `npm install -g @nestjs/cli`
15+
16+## Aliases
17+
18+| Alias | Command | Description |
19+| :------ | :--------------------------- | :------------------------------------------ |
20+| `nnew` | `nest new` | Create a new NestJS project |
21+| `nb` | `nest build` | Build the NestJS application |
22+| `ns` | `nest start` | Start the application |
23+| `nsw` | `nest start --watch` | Start the application in watch mode |
24+| `nsd` | `nest start --dev` | Start the application in dev mode |
25+| `nsdbg` | `nest start --debug --watch` | Start the application in debug & watch mode |
26+| `ng` | `nest generate` | Generate a NestJS element |
27+| `ngm` | `nest generate module` | Generate a module |
28+| `ngc` | `nest generate controller` | Generate a controller |
29+| `ngs` | `nest generate service` | Generate a service |
30+| `ngg` | `nest generate guard` | Generate a guard |
31+| `ngp` | `nest generate pipe` | Generate a pipe |
32+| `ngf` | `nest generate filter` | Generate a filter |
33+| `ngr` | `nest generate resolver` | Generate a GraphQL resolver |
34+| `ngcl` | `nest generate class` | Generate a class |
35+| `ngi` | `nest generate interface` | Generate an interface |
36+| `ngit` | `nest generate interceptor` | Generate an interceptor |
37+| `ngmi` | `nest generate middleware` | Generate a middleware |
38+| `ngd` | `nest generate decorator` | Generate a custom decorator |
39+| `ngres` | `nest generate resource` | Generate a CRUD resource |
40+| `nglib` | `nest generate library` | Generate a new library |
41+| `ngsub` | `nest generate sub-app` | Generate a new sub-application (monorepo) |
42+| `na` | `nest add` | Add a library to the project |
43+| `ni` | `nest info` | Display NestJS project information |
44+| `nu` | `nest update` | Update NestJS dependencies |
45+
46+## Usage
47+
48+1. Add `nestjs` to the `plugins` array in your `~/.zshrc` file:
49+
50+```zsh
51+plugins=(... nestjs)
52+```
53+
54+2. Restart your terminal or source your `~/.zshrc` file:
55+
56+```zsh
57+source ~/.zshrc
58+```
59diff --git a/plugins/nestjs/nestjs.plugin.zsh b/plugins/nestjs/nestjs.plugin.zsh
60new file mode 100644
61index 0000000000000000000000000000000000000000..9496abdeb9933b5b9bd1c7050d8b73c1cba63d59
62--- /dev/null
63+++ b/plugins/nestjs/nestjs.plugin.zsh
64@@ -0,0 +1,41 @@
65+# Oh My Zsh plugin for NestJS CLI
66+
67+# Check if nest command exists
68+if ! command -v nest &>/dev/null; then
69+ return
70+fi
71+
72+# Project creation
73+alias nnew='nest new'
74+
75+# Basic development
76+alias nb='nest build'
77+alias ns='nest start'
78+alias nsw='nest start --watch'
79+alias nsd='nest start --dev' # Alias for start --watch
80+alias nsdbg='nest start --debug --watch'
81+
82+# Code generation (short aliases)
83+alias ng='nest generate'
84+alias ngm='nest generate module'
85+alias ngc='nest generate controller'
86+alias ngs='nest generate service'
87+alias ngg='nest generate guard'
88+alias ngp='nest generate pipe'
89+alias ngf='nest generate filter'
90+alias ngr='nest generate resolver'
91+alias ngcl='nest generate class'
92+alias ngi='nest generate interface'
93+alias ngit='nest generate interceptor'
94+alias ngmi='nest generate middleware'
95+alias ngd='nest generate decorator'
96+alias ngres='nest generate resource'
97+alias nglib='nest generate library'
98+alias ngsub='nest generate sub-app'
99+
100+# Other commands
101+alias na='nest add'
102+alias ni='nest info'
103+alias nu='nest update'
104+
105+# You can add more aliases or functions here as needed.