-
Notifications
You must be signed in to change notification settings - Fork 17
/
nest.sh
147 lines (134 loc) · 6.39 KB
/
nest.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/usr/bin/env bash
# Automatic generated, DON'T MODIFY IT.
# @flag -v --version Output the current version.
# @flag -h --help Output usage information.
# {{ nest new
# @cmd Generate Nest application.
# @alias n
# @option --directory <directory> Specify the destination directory
# @flag -d --dry-run Report actions that would be performed without writing out results.
# @flag -g --skip-git Skip git repository initialization.
# @flag -s --skip-install Skip package installation.
# @option -p --package-manager[npm|yarn|pnpm] <packageManager> Specify package manager.
# @option -l --language[TypeScript|Javascript] <language> Programming language to be used (TypeScript or JavaScript) (default: "TypeScript")
# @option -c --collection <collectionName> Schematics collection to use (default: "@nestjs/schematics")
# @flag --strict Enables strict mode in TypeScript.
# @flag -h --help Output usage information.
# @arg name
new() {
:;
}
# }} nest new
# {{ nest build
# @cmd Build Nest application.
# @option -c --config <path> Path to nest-cli configuration file.
# @option -p --path <path> Path to tsconfig file.
# @flag -w --watch Run in watch mode (live-reload).
# @option -b --builder[tsc|webpack|swc] <name> Builder to be used.
# @flag --watchAssets Watch non-ts (e.g., .graphql) files mode.
# @flag --webpack Use webpack for compilation (deprecated option, use --builder instead).
# @flag --type-check Enable type checking (when SWC is used).
# @option --webpackPath <path> Path to webpack configuration.
# @flag --tsc Use typescript compiler for compilation.
# @flag --preserveWatchOutput Use "preserveWatchOutput" option when using tsc watch mode.
# @flag -h --help Output usage information.
# @arg app[`_choice_project`]
build() {
:;
}
# }} nest build
# {{ nest start
# @cmd Run Nest application.
# @option -c --config <path> Path to nest-cli configuration file.
# @option -p --path <path> Path to tsconfig file.
# @flag -w --watch Run in watch mode (live-reload).
# @option -b --builder[tsc|webpack|swc] <name> Builder to be used.
# @flag --watchAssets Watch non-ts (e.g., .graphql) files mode.
# @option -d --debug <hostport> Run in debug mode (with --inspect flag).
# @flag --webpack Use webpack for compilation (deprecated option, use --builder instead).
# @option --webpackPath <path> Path to webpack configuration.
# @flag --type-check Enable type checking (when SWC is used).
# @flag --tsc Use typescript compiler for compilation.
# @option --sourceRoot <sourceRoot> Points at the root of the source code for the single project in standard mode structures, or the default project in monorepo mode structures.
# @option --entryFile <entryFile> Path to the entry file where this command will work with.
# @option -e --exec <binary> Binary to run (default: "node").
# @flag --preserveWatchOutput Use "preserveWatchOutput" option when using tsc watch mode.
# @flag -h --help Output usage information.
# @arg app[`_choice_project`]
start() {
:;
}
# }} nest start
# {{ nest info
# @cmd Display Nest project details.
# @alias i
# @flag -h --help Output usage information.
info() {
:;
}
# }} nest info
# {{ nest add
# @cmd Adds support for an external library to your project.
# @flag -d --dry-run Report actions that would be performed without writing out results.
# @flag -s --skip-install Skip package installation.
# @option -p --project[`_choice_project`] <project> Project in which to generate files.
# @flag -h --help Output usage information.
# @arg library!
add() {
:;
}
# }} nest add
# {{ nest generate
# @cmd Generate a Nest element.
# @alias g
# @flag -d --dry-run Report actions that would be taken without writing out results.
# @option -p --project[`_choice_project`] <project> Project in which to generate files.
# @flag --flat Enforce flat structure of generated element.
# @flag --no-flat Enforce that directories are generated.
# @flag --spec Enforce spec files generation.
# @option --spec-file-suffix <suffix> Use a custom suffix for spec files.
# @flag --skip-import Skip importing (default: false)
# @flag --no-spec Disable spec files generation.
# @option -c --collection <collectionName> Schematics collection to use.
# @flag -h --help Output usage information.
# @arg schematic![`_choice_schematic`]
# @arg name
# @arg path
generate() {
:;
}
# }} nest generate
. "$ARGC_COMPLETIONS_ROOT/utils/_argc_utils.sh"
_choice_project() {
_helper_find_nest_cli_json_path
if [[ -n "$nest_cli_json_path" ]]; then
cat "$nest_cli_json_path" | yq '(.projects // {}) | keys | .[]'
fi
}
_choice_schematic() {
cat <<-'EOF'
application Generate a new application workspace
class Generate a new class
configuration Generate a CLI configuration file
controller Generate a controller declaration
decorator Generate a custom decorator
filter Generate a filter declaration
gateway Generate a gateway declaration
guard Generate a guard declaration
interceptor Generate an interceptor declaration
interface Generate an interface
library Generate a new library within a monorepo
middleware Generate a middleware declaration
module Generate a module declaration
pipe Generate a pipe declaration
provider Generate a provider declaration
resolver Generate a GraphQL resolver declaration
resource Generate a new CRUD resource
service Generate a service declaration
sub-app Generate a new application within a monorepo
EOF
}
_helper_find_nest_cli_json_path() {
nest_cli_json_path="$(_argc_util_path_search_parent nest-cli.json)"
}
command eval "$(argc --argc-eval "$0" "$@")"