@wiztivi/dana-cli 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/README.md → README.md} +1 -0
- package/package.json +8 -5
- package/dist/dana_completion.sh +0 -153
|
@@ -38,6 +38,7 @@ Use the CLI to:
|
|
|
38
38
|
- create a new app project
|
|
39
39
|
- add device(s) easily to deploy your project on more platforms: `npx @wiztivi/dana-cli add-device`,
|
|
40
40
|
- add built-in components to your project: eg `npx @wiztivi/dana-cli add-menu`
|
|
41
|
+
- get autocompletion script for dana commands: `npx @wiztivi/dana-cli completion <shell>`
|
|
41
42
|
|
|
42
43
|
To get all available options and more information:`npx @wiztivi/dana-cli help`
|
|
43
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wiztivi/dana-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Dana create app CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -14,18 +14,21 @@
|
|
|
14
14
|
"lint": "eslint src tests",
|
|
15
15
|
"test": "vitest",
|
|
16
16
|
"test:coverage": "vitest run --coverage",
|
|
17
|
-
"build": "
|
|
17
|
+
"build": "npm run _clean:dist && tsc --build && npm run _add_files:dist",
|
|
18
|
+
"build:watch": "npm run _clean:dist && tsc --build --watch",
|
|
18
19
|
"ci": "npm run build && npm run lint && npm run test:coverage",
|
|
19
|
-
"
|
|
20
|
+
"_add_files:dist": "cp ../../README.md .",
|
|
21
|
+
"_clean:dist": "rimraf ./dist tsconfig.tsbuildinfo"
|
|
20
22
|
},
|
|
21
23
|
"files": [
|
|
22
24
|
"dist",
|
|
23
|
-
"dana_completion.sh"
|
|
25
|
+
"dana_completion.sh",
|
|
26
|
+
"README.md"
|
|
24
27
|
],
|
|
25
28
|
"dependencies": {
|
|
26
29
|
"@aws-sdk/client-codeartifact": "^3.859.0",
|
|
27
30
|
"@clack/prompts": "0.10.0",
|
|
28
|
-
"@wiztivi/dana-templates": "^0.0.
|
|
31
|
+
"@wiztivi/dana-templates": "^0.0.8",
|
|
29
32
|
"child_process": "1.0.x",
|
|
30
33
|
"command-exists": "1.2.9",
|
|
31
34
|
"commander": "11.1.x",
|
package/dist/dana_completion.sh
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
|
|
3
|
-
# Unified completion script for dana CLI
|
|
4
|
-
# Detects shell and loads appropriate completion
|
|
5
|
-
|
|
6
|
-
# Shared command list
|
|
7
|
-
dana_commands=(
|
|
8
|
-
'add-device'
|
|
9
|
-
'add-menu'
|
|
10
|
-
'add-rail'
|
|
11
|
-
'add-scrollView'
|
|
12
|
-
'add-screen'
|
|
13
|
-
'auth'
|
|
14
|
-
'create-app'
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
# Shared subcommand declarations
|
|
18
|
-
login_sub="login"
|
|
19
|
-
logout_sub="logout"
|
|
20
|
-
status_sub="status"
|
|
21
|
-
# Shared option declarations
|
|
22
|
-
direction_opts="-d --direction"
|
|
23
|
-
navigation_opts="-n --navigation"
|
|
24
|
-
cyclic_opts="-c --cyclic"
|
|
25
|
-
margin_opts="-m --itemMargin"
|
|
26
|
-
custom_opts="-cm --custom"
|
|
27
|
-
item_view_opts="-i --itemView"
|
|
28
|
-
org_opts="-o --org"
|
|
29
|
-
device_opts="-d --device"
|
|
30
|
-
tutorial_opts="-t, --tutorial"
|
|
31
|
-
|
|
32
|
-
# Shared option values
|
|
33
|
-
direction_values="h v"
|
|
34
|
-
navigation_values="fixed lmr lr paginated"
|
|
35
|
-
org_values="preprod"
|
|
36
|
-
# Detect shell and load appropriate completion
|
|
37
|
-
if [ -n "$BASH_VERSION" ]; then
|
|
38
|
-
# Bash completion
|
|
39
|
-
_dana()
|
|
40
|
-
{
|
|
41
|
-
local cur prev opts
|
|
42
|
-
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
43
|
-
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
44
|
-
# Complete option values
|
|
45
|
-
case "$prev" in
|
|
46
|
-
-d|--direction)
|
|
47
|
-
COMPREPLY=($(compgen -W "$direction_values" -- "$cur"))
|
|
48
|
-
return 0
|
|
49
|
-
;;
|
|
50
|
-
-n|--navigation)
|
|
51
|
-
COMPREPLY=($(compgen -W "$navigation_values" -- "$cur"))
|
|
52
|
-
return 0
|
|
53
|
-
;;
|
|
54
|
-
-o|--org)
|
|
55
|
-
COMPREPLY=($(compgen -W "$org_values" -- "$cur"))
|
|
56
|
-
return 0
|
|
57
|
-
;;
|
|
58
|
-
esac
|
|
59
|
-
# If we're completing the first argument (command)
|
|
60
|
-
if [[ $COMP_CWORD -eq 1 ]]; then
|
|
61
|
-
COMPREPLY=($(compgen -W "${dana_commands[*]}" -- "$cur"))
|
|
62
|
-
return 0
|
|
63
|
-
fi
|
|
64
|
-
# If we're completing options for specific commands
|
|
65
|
-
local cmd="${COMP_WORDS[1]}"
|
|
66
|
-
case "$cmd" in
|
|
67
|
-
add-rail)
|
|
68
|
-
opts="$navigation_opts $cyclic_opts $direction_opts $custom_opts $item_view_opts"
|
|
69
|
-
COMPREPLY=($(compgen -W "$opts" -- "$cur"))
|
|
70
|
-
;;
|
|
71
|
-
add-menu)
|
|
72
|
-
opts="$direction_opts $margin_opts $custom_opts $item_view_opts"
|
|
73
|
-
COMPREPLY=($(compgen -W "$opts" -- "$cur"))
|
|
74
|
-
;;
|
|
75
|
-
add-scrollView)
|
|
76
|
-
opts="$custom_opts $item_view_opts $margin_opts"
|
|
77
|
-
COMPREPLY=($(compgen -W "$opts" -- "$cur"))
|
|
78
|
-
;;
|
|
79
|
-
auth)
|
|
80
|
-
if [[ $COMP_CWORD -eq 2 ]]; then
|
|
81
|
-
opts="$login_sub $logout_sub $status_sub"
|
|
82
|
-
else
|
|
83
|
-
opts="$org_opts"
|
|
84
|
-
fi
|
|
85
|
-
COMPREPLY=($(compgen -W "$opts" -- "$cur"))
|
|
86
|
-
;;
|
|
87
|
-
create-app)
|
|
88
|
-
opts="$device_opts $tutorial_opts"
|
|
89
|
-
COMPREPLY=($(compgen -W "$opts" -- "$cur"))
|
|
90
|
-
;;
|
|
91
|
-
*)
|
|
92
|
-
COMPREPLY=()
|
|
93
|
-
;;
|
|
94
|
-
esac
|
|
95
|
-
}
|
|
96
|
-
complete -F _dana dana
|
|
97
|
-
elif [ -n "$ZSH_VERSION" ]; then
|
|
98
|
-
# Zsh completion
|
|
99
|
-
_dana() {
|
|
100
|
-
# Main commands
|
|
101
|
-
if (( CURRENT == 2 )); then
|
|
102
|
-
local -a commands
|
|
103
|
-
commands=(${dana_commands[@]})
|
|
104
|
-
compadd -a commands
|
|
105
|
-
return
|
|
106
|
-
fi
|
|
107
|
-
# Complete option values
|
|
108
|
-
local prev=${words[CURRENT-1]}
|
|
109
|
-
case "$prev" in
|
|
110
|
-
-d|--direction)
|
|
111
|
-
compadd -- ${=direction_values}
|
|
112
|
-
return
|
|
113
|
-
;;
|
|
114
|
-
-n|--navigation)
|
|
115
|
-
compadd -- ${=navigation_values}
|
|
116
|
-
return
|
|
117
|
-
;;
|
|
118
|
-
-o|--org)
|
|
119
|
-
compadd -- ${=org_values}
|
|
120
|
-
return
|
|
121
|
-
;;
|
|
122
|
-
login|logout|status)
|
|
123
|
-
compadd -- ${=org_opts}
|
|
124
|
-
return
|
|
125
|
-
;;
|
|
126
|
-
esac
|
|
127
|
-
# Complete options for commands
|
|
128
|
-
local cmd=${words[2]}
|
|
129
|
-
case "$cmd" in
|
|
130
|
-
add-rail)
|
|
131
|
-
compadd -- ${=navigation_opts} ${=cyclic_opts} ${=direction_opts} ${=custom_opts} ${=item_view_opts}
|
|
132
|
-
;;
|
|
133
|
-
add-menu)
|
|
134
|
-
compadd -- ${=direction_opts} ${=margin_opts} ${=custom_opts} ${=item_view_opts}
|
|
135
|
-
;;
|
|
136
|
-
add-scrollView)
|
|
137
|
-
compadd -- ${=custom_opts} ${=item_view_opts} ${=margin_opts}
|
|
138
|
-
;;
|
|
139
|
-
auth)
|
|
140
|
-
if (( CURRENT == 3 )); then
|
|
141
|
-
compadd -- ${=login_sub} ${=logout_sub} ${=status_sub}
|
|
142
|
-
else
|
|
143
|
-
compadd -- ${=org_opts}
|
|
144
|
-
fi
|
|
145
|
-
;;
|
|
146
|
-
create-app)
|
|
147
|
-
compadd -- ${device_opts} $={tutorial_opts}
|
|
148
|
-
esac
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
# Register the completion
|
|
152
|
-
compdef _dana dana
|
|
153
|
-
fi
|