@cyclone-ui/cli 0.0.0-stage → 0.6.2

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.
Files changed (80) hide show
  1. package/LICENSE +187 -0
  2. package/README.md +113 -2
  3. package/dist/add-DXaT7So9.mjs +1 -0
  4. package/dist/add.mjs +4 -0
  5. package/dist/analyze-a11y-DSQGGQW0.mjs +1 -0
  6. package/dist/analyze-a11y.mjs +2 -0
  7. package/dist/bin.mjs +9 -0
  8. package/dist/build-C5SQ7omP.mjs +1 -0
  9. package/dist/build.mjs +2 -0
  10. package/dist/completions-bash-config.mjs +6 -0
  11. package/dist/completions-bash-script.mjs +6 -0
  12. package/dist/completions-fish-config.mjs +6 -0
  13. package/dist/completions-fish-script.mjs +6 -0
  14. package/dist/completions-powershell-config.mjs +6 -0
  15. package/dist/completions-powershell-script.mjs +6 -0
  16. package/dist/completions-zsh-config.mjs +6 -0
  17. package/dist/completions-zsh-script.mjs +6 -0
  18. package/dist/components-CL5K9O-8.mjs +10 -0
  19. package/dist/config-4Rgq0kBY.mjs +1 -0
  20. package/dist/config-CcLxKgqv.mjs +1 -0
  21. package/dist/config-D4XQ3gm9.mjs +1 -0
  22. package/dist/config-DYtzUnW1.mjs +1 -0
  23. package/dist/config-DiyybDxS.mjs +1 -0
  24. package/dist/console-wWDh21MV.mjs +20 -0
  25. package/dist/create-tokens-BkSmDzsb.mjs +1 -0
  26. package/dist/create-tokens.mjs +2 -0
  27. package/dist/design-system-C6qKXe7_.mjs +1 -0
  28. package/dist/diff-BENt04nS.mjs +1 -0
  29. package/dist/diff.mjs +2 -0
  30. package/dist/docs-CV-tOshm.mjs +1 -0
  31. package/dist/docs.mjs +4 -0
  32. package/dist/guidelines-CaUBc0wB.mjs +1 -0
  33. package/dist/guidelines.mjs +2 -0
  34. package/dist/help.mjs +2 -0
  35. package/dist/info-Vg-ZDW4H.mjs +1 -0
  36. package/dist/info.mjs +2 -0
  37. package/dist/init-CTw6TmcL.mjs +1 -0
  38. package/dist/init.mjs +2 -0
  39. package/dist/list-components-CI9b0sg9.mjs +1 -0
  40. package/dist/list-components.mjs +2 -0
  41. package/dist/list-fonts-CtGQHoE_.mjs +1 -0
  42. package/dist/list-fonts.mjs +2 -0
  43. package/dist/list-icons-BNwuGwSr.mjs +1 -0
  44. package/dist/list-icons.mjs +2 -0
  45. package/dist/list-tokens-BSwZsUam.mjs +1 -0
  46. package/dist/list-tokens.mjs +2 -0
  47. package/dist/local-registry-pqsOERYj.mjs +1 -0
  48. package/dist/mcp-DleN2BRI.mjs +1 -0
  49. package/dist/mcp.mjs +48 -0
  50. package/dist/plan-BiklQTti.mjs +1 -0
  51. package/dist/plan.mjs +2 -0
  52. package/dist/prompts-zyeiNLLd.mjs +8 -0
  53. package/dist/registry-Bsa1pzvl.mjs +1 -0
  54. package/dist/registry-C95vaVW8.mjs +1 -0
  55. package/dist/registry-validate.mjs +2 -0
  56. package/dist/script-C089wQdt.mjs +1 -0
  57. package/dist/script-CIEAixHe.mjs +1 -0
  58. package/dist/script-CPF-jk49.mjs +1 -0
  59. package/dist/script-DUM1UD8_.mjs +1 -0
  60. package/dist/search-C78IX7wC.mjs +1 -0
  61. package/dist/search-components-Cv1FVd2d.mjs +1 -0
  62. package/dist/search-components.mjs +3 -0
  63. package/dist/search-fonts-S-_oxo-_.mjs +1 -0
  64. package/dist/search-fonts.mjs +3 -0
  65. package/dist/search-icons-9B6-pV_m.mjs +1 -0
  66. package/dist/search-icons.mjs +3 -0
  67. package/dist/search-tokens-ChSh44BL.mjs +1 -0
  68. package/dist/search-tokens.mjs +3 -0
  69. package/dist/search.mjs +3 -0
  70. package/dist/shared-BHWQIq8h.mjs +216 -0
  71. package/dist/shared-BgKqmf2q.mjs +103 -0
  72. package/dist/shared-Bs-4ebiC.mjs +249 -0
  73. package/dist/shared-DgLETJ0V.mjs +235 -0
  74. package/dist/update-BP6PyX8m.mjs +1 -0
  75. package/dist/update-DcG9HWj8.mjs +1 -0
  76. package/dist/update.mjs +2 -0
  77. package/dist/validate-BhYpRUOH.mjs +1 -0
  78. package/dist/view-DLb3I50K.mjs +1 -0
  79. package/dist/view.mjs +3 -0
  80. package/package.json +99 -4
@@ -0,0 +1,103 @@
1
+ import{bold as e,cyan as t,cyanBright as n,dim as r,gray as i,green as a,greenBright as o,magenta as s,magentaBright as c,red as l,redBright as u,white as d}from"node:console";const f=`# Define shell completion directives
2
+ readonly ShellCompDirectiveError=1
3
+ readonly ShellCompDirectiveNoSpace=2
4
+ readonly ShellCompDirectiveNoFileComp=4
5
+ readonly ShellCompDirectiveFilterFileExt=8
6
+ readonly ShellCompDirectiveFilterDirs=16
7
+ readonly ShellCompDirectiveKeepOrder=32
8
+
9
+ # Function to debug completion
10
+ __cyclone_ui_debug() {
11
+ if [[ -n \${BASH_COMP_DEBUG_FILE:-} ]]; then
12
+ echo "$*" >> "\${BASH_COMP_DEBUG_FILE}"
13
+ fi
14
+ }
15
+
16
+ # Function to handle completions
17
+ __cyclone_ui_complete() {
18
+ local cur prev words cword
19
+ _get_comp_words_by_ref -n "=:" cur prev words cword
20
+
21
+ local requestComp out directive
22
+
23
+ # Build the command to get completions
24
+ requestComp="/nix/store/vhmrk3hh4nkaw62xmcl22961g64sn443-nodejs-slim-26.8.2/bin/node /home/runner/work/cyclone-ui/cyclone-ui/node_modules/.pnpm/nx@23.1.1_@swc-node+register@1.11.1_@swc+core@1.15.41_@swc+helpers@0.5.23__@swc+types@0_583c0237aac68dfd0de00ada7cc6c6ec/node_modules/nx/dist/bin/run-executor.js complete -- \${words[@]:1}"
25
+
26
+ # Add an empty parameter if the last parameter is complete
27
+ if [[ -z "$cur" ]]; then
28
+ requestComp="$requestComp ''"
29
+ fi
30
+
31
+ # Get completions from the program
32
+ out=$(eval "$requestComp" 2>/dev/null)
33
+
34
+ # Extract directive if present
35
+ directive=0
36
+ if [[ "$out" == *:* ]]; then
37
+ directive=\${out##*:}
38
+ out=\${out%:*}
39
+ fi
40
+
41
+ # Process completions based on directive
42
+ if [[ $((directive & $ShellCompDirectiveError)) -ne 0 ]]; then
43
+ # Error, no completion
44
+ return
45
+ fi
46
+
47
+ # Apply directives
48
+ if [[ $((directive & $ShellCompDirectiveNoSpace)) -ne 0 ]]; then
49
+ compopt -o nospace
50
+ fi
51
+ if [[ $((directive & $ShellCompDirectiveKeepOrder)) -ne 0 ]]; then
52
+ compopt -o nosort
53
+ fi
54
+ if [[ $((directive & $ShellCompDirectiveNoFileComp)) -ne 0 ]]; then
55
+ compopt +o default
56
+ fi
57
+
58
+ # Handle file extension filtering
59
+ if [[ $((directive & $ShellCompDirectiveFilterFileExt)) -ne 0 ]]; then
60
+ local filter=""
61
+ for ext in $out; do
62
+ filter="$filter|$ext"
63
+ done
64
+ filter=".($filter)"
65
+ compopt -o filenames
66
+ COMPREPLY=( $(compgen -f -X "!$filter" -- "$cur") )
67
+ return
68
+ fi
69
+
70
+ # Handle directory filtering
71
+ if [[ $((directive & $ShellCompDirectiveFilterDirs)) -ne 0 ]]; then
72
+ compopt -o dirnames
73
+ COMPREPLY=( $(compgen -d -- "$cur") )
74
+ return
75
+ fi
76
+
77
+ # Process completions
78
+ local IFS=$'
79
+ '
80
+ local tab=$(printf ' ')
81
+
82
+ # Parse completions with descriptions
83
+ local completions=()
84
+ while read -r comp; do
85
+ if [[ "$comp" == *$tab* ]]; then
86
+ # Split completion and description
87
+ local value=\${comp%%$tab*}
88
+ local desc=\${comp#*$tab}
89
+ completions+=("$value")
90
+ else
91
+ completions+=("$comp")
92
+ fi
93
+ done <<< "$out"
94
+
95
+ # Return completions
96
+ COMPREPLY=( $(compgen -W "\${completions[*]}" -- "$cur") )
97
+ }
98
+
99
+ # Register completion function
100
+ complete -F __cyclone_ui_complete cyclone-ui
101
+ `,p=f.split(`
102
+ `).map(f=>f.trim()?f.trim().startsWith(`#`)?`${r(f)}`:d(f).replaceAll(/(?<=\$(\{|\()).*(?=(\}\)))/g,a(`$&`)).replaceAll(/\".*\"/g,t(`$&`)).replaceAll(/(\[|\]|\(|\)|\||<|>|\$\(|\$?\{|\}|\+|=|;|:)/g,e(i(`$&`))).replaceAll(/(readonly|complete)\s+/g,a(`$&`)).replaceAll(/(?<=(readonly|complete)\s+)\w/g,e(o(`$&`))).replaceAll(/local\s+/g,l(`$&`)).replaceAll(/(?<=local\s+)\w/g,e(u(`$&`))).replaceAll(/while\s+/g,t(`$&`)).replaceAll(/(?<=while\s+)\w/g,e(n(`$&`))).replaceAll(/(if|fi|else|elif|then|done)\s+/g,a(`$&`)).replaceAll(/__\w/g,e(c(`$&`))).replaceAll(/(?<=\s)(-\w|--\w[\w-]*)(?=\s|$)/g,e(s(`$&`))):``).join(`
103
+ `);export{p as n,f as t};
@@ -0,0 +1,249 @@
1
+ import{bold as e,cyan as t,cyanBright as n,dim as r,gray as i,green as a,greenBright as o,magenta as s,magentaBright as c,red as l,redBright as u,white as d}from"node:console";const f=`# powershell completion for Cyclone User Interface
2
+
3
+ [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
4
+ function __cycloneUI_debug {
5
+ if ($env:BASH_COMP_DEBUG_FILE) {
6
+ "$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE"
7
+ }
8
+ }
9
+
10
+ filter __cycloneUI_escapeStringWithSpecialChars {
11
+ $_ -replace 's|#|@|$|;|,|''|{|}|(|)|"|||<|>|&','\`$&'
12
+ }
13
+
14
+ [scriptblock]$__cycloneUICompleterBlock = {
15
+ param(
16
+ $WordToComplete,
17
+ $CommandAst,
18
+ $CursorPosition
19
+ )
20
+
21
+ # Get the current command-line and convert into a string
22
+ $Command = $CommandAst.CommandElements
23
+ $Command = "$Command"
24
+
25
+ __cycloneUI_debug ""
26
+ __cycloneUI_debug "========= starting completion logic =========="
27
+ __cycloneUI_debug "WordToComplete: $WordToComplete Command: $Command CursorPosition: $CursorPosition"
28
+
29
+ # The user could have moved the cursor backwards on the command-line.
30
+ # We need to trigger completion from the $CursorPosition location, so we need
31
+ # to truncate the command-line ($Command) up to the $CursorPosition location.
32
+ # Make sure the $Command is longer then the $CursorPosition before we truncate.
33
+ # This happens because the $Command does not include the last space.
34
+ if ($Command.Length -gt $CursorPosition) {
35
+ $Command = $Command.Substring(0, $CursorPosition)
36
+ }
37
+ __cycloneUI_debug "Truncated command: $Command"
38
+
39
+ $ShellCompDirectiveError=1
40
+ $ShellCompDirectiveNoSpace=2
41
+ $ShellCompDirectiveNoFileComp=4
42
+ $ShellCompDirectiveFilterFileExt=8
43
+ $ShellCompDirectiveFilterDirs=16
44
+ $ShellCompDirectiveKeepOrder=32
45
+
46
+ # Prepare the command to request completions for the program.
47
+ # Split the command at the first space to separate the program and arguments.
48
+ $Program, $Arguments = $Command.Split(" ", 2)
49
+
50
+ $QuotedArgs = ($Arguments -split ' ' | ForEach-Object { "'" + ($_ -replace "'", "''") + "'" }) -join ' '
51
+ __cycloneUI_debug "QuotedArgs: $QuotedArgs"
52
+
53
+ $RequestComp = "& /nix/store/vhmrk3hh4nkaw62xmcl22961g64sn443-nodejs-slim-26.8.2/bin/node /home/runner/work/cyclone-ui/cyclone-ui/node_modules/.pnpm/nx@23.1.1_@swc-node+register@1.11.1_@swc+core@1.15.41_@swc+helpers@0.5.23__@swc+types@0_583c0237aac68dfd0de00ada7cc6c6ec/node_modules/nx/dist/bin/run-executor.js complete '--' $QuotedArgs"
54
+ __cycloneUI_debug "RequestComp: $RequestComp"
55
+
56
+ # we cannot use $WordToComplete because it
57
+ # has the wrong values if the cursor was moved
58
+ # so use the last argument
59
+ if ($WordToComplete -ne "" ) {
60
+ $WordToComplete = $Arguments.Split(" ")[-1]
61
+ }
62
+ __cycloneUI_debug "New WordToComplete: $WordToComplete"
63
+
64
+
65
+ # Check for flag with equal sign
66
+ $IsEqualFlag = ($WordToComplete -Like "--*=*" )
67
+ if ( $IsEqualFlag ) {
68
+ __cycloneUI_debug "Completing equal sign flag"
69
+ # Remove the flag part
70
+ $Flag, $WordToComplete = $WordToComplete.Split("=", 2)
71
+ }
72
+
73
+ if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag )) {
74
+ # If the last parameter is complete (there is a space following it)
75
+ # We add an extra empty parameter so we can indicate this to the go method.
76
+ __cycloneUI_debug "Adding extra empty parameter"
77
+ # PowerShell 7.2+ changed the way how the arguments are passed to executables,
78
+ # so for pre-7.2 or when Legacy argument passing is enabled we need to use
79
+ if ($PSVersionTable.PsVersion -lt [version]'7.2.0' -or
80
+ ($PSVersionTable.PsVersion -lt [version]'7.3.0' -and -not [ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -or
81
+ (($PSVersionTable.PsVersion -ge [version]'7.3.0' -or [ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -and
82
+ $PSNativeCommandArgumentPassing -eq 'Legacy')) {
83
+ $RequestComp="$RequestComp" + ' \`"\`"'
84
+ } else {
85
+ $RequestComp = "$RequestComp" + ' ""'
86
+ }
87
+ }
88
+
89
+ __cycloneUI_debug "Calling $RequestComp"
90
+ # First disable ActiveHelp which is not supported for Powershell
91
+ $env:ActiveHelp = 0
92
+
93
+ # call the command store the output in $out and redirect stderr and stdout to null
94
+ # $Out is an array contains each line per element
95
+ Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null
96
+
97
+ # get directive from last line
98
+ [int]$Directive = $Out[-1].TrimStart(':')
99
+ if ($Directive -eq "") {
100
+ # There is no directive specified
101
+ $Directive = 0
102
+ }
103
+ __cycloneUI_debug "The completion directive is: $Directive"
104
+
105
+ # remove directive (last element) from out
106
+ $Out = $Out | Where-Object { $_ -ne $Out[-1] }
107
+ __cycloneUI_debug "The completions are: $Out"
108
+ if (($Directive -band $ShellCompDirectiveError) -ne 0 ) {
109
+ # Error code. No completion.
110
+ __cycloneUI_debug "Received error from custom completion go code"
111
+ return
112
+ }
113
+
114
+ $Longest = 0
115
+ [Array]$Values = $Out | ForEach-Object {
116
+ # Split the output in name and description
117
+ $Name, $Description = $_.Split("\`t", 2)
118
+ __cycloneUI_debug "Name: $Name Description: $Description"
119
+
120
+ # Look for the longest completion so that we can format things nicely
121
+ if ($Longest -lt $Name.Length) {
122
+ $Longest = $Name.Length
123
+ }
124
+
125
+ # Set the description to a one space string if there is none set.
126
+ # This is needed because the CompletionResult does not accept an empty string as argument
127
+ if (-Not $Description) {
128
+ $Description = " "
129
+ }
130
+ @{ Name = "$Name"; Description = "$Description" }
131
+ }
132
+
133
+
134
+ $Space = " "
135
+ if (($Directive -band $ShellCompDirectiveNoSpace) -ne 0 ) {
136
+ # remove the space here
137
+ __cycloneUI_debug "ShellCompDirectiveNoSpace is called"
138
+ $Space = ""
139
+ }
140
+
141
+ if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or
142
+ (($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 )) {
143
+ __cycloneUI_debug "ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported"
144
+
145
+ # return here to prevent the completion of the extensions
146
+ return
147
+ }
148
+
149
+ $Values = $Values | Where-Object {
150
+ # filter the result
151
+ $_.Name -like "$WordToComplete*"
152
+
153
+ # Join the flag back if we have an equal sign flag
154
+ if ( $IsEqualFlag ) {
155
+ __cycloneUI_debug "Join the equal sign flag back to the completion value"
156
+ $_.Name = $Flag + "=" + $_.Name
157
+ }
158
+ }
159
+
160
+ # we sort the values in ascending order by name if keep order isn't passed
161
+ if (($Directive -band $ShellCompDirectiveKeepOrder) -eq 0 ) {
162
+ $Values = $Values | Sort-Object -Property Name
163
+ }
164
+
165
+ if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) {
166
+ __cycloneUI_debug "ShellCompDirectiveNoFileComp is called"
167
+
168
+ if ($Values.Length -eq 0) {
169
+ # Just print an empty string here so the
170
+ # shell does not start to complete paths.
171
+ # We cannot use CompletionResult here because
172
+ # it does not accept an empty string as argument.
173
+ ""
174
+ return
175
+ }
176
+ }
177
+
178
+ # Get the current mode
179
+ $Mode = (Get-PSReadLineKeyHandler | Where-Object { $_.Key -eq "Tab" }).Function
180
+ __cycloneUI_debug "Mode: $Mode"
181
+
182
+ $Values | ForEach-Object {
183
+
184
+ # store temporary because switch will overwrite $_
185
+ $comp = $_
186
+
187
+ # PowerShell supports three different completion modes
188
+ # - TabCompleteNext (default windows style - on each key press the next option is displayed)
189
+ # - Complete (works like bash)
190
+ # - MenuComplete (works like zsh)
191
+ # You set the mode with Set-PSReadLineKeyHandler -Key Tab -Function <mode>
192
+
193
+ # CompletionResult Arguments:
194
+ # 1) CompletionText text to be used as the auto completion result
195
+ # 2) ListItemText text to be displayed in the suggestion list
196
+ # 3) ResultType type of completion result
197
+ # 4) ToolTip text for the tooltip with details about the object
198
+
199
+ switch ($Mode) {
200
+
201
+ # bash like
202
+ "Complete" {
203
+
204
+ if ($Values.Length -eq 1) {
205
+ __cycloneUI_debug "Only one completion left"
206
+
207
+ # insert space after value
208
+ [System.Management.Automation.CompletionResult]::new($($comp.Name | __cycloneUI_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)")
209
+
210
+ } else {
211
+ # Add the proper number of spaces to align the descriptions
212
+ while($comp.Name.Length -lt $Longest) {
213
+ $comp.Name = $comp.Name + " "
214
+ }
215
+
216
+ # Check for empty description and only add parentheses if needed
217
+ if ($($comp.Description) -eq " " ) {
218
+ $Description = ""
219
+ } else {
220
+ $Description = " ($($comp.Description))"
221
+ }
222
+
223
+ [System.Management.Automation.CompletionResult]::new("$($comp.Name)$Description", "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)")
224
+ }
225
+ }
226
+
227
+ # zsh like
228
+ "MenuComplete" {
229
+ # insert space after value
230
+ # MenuComplete will automatically show the ToolTip of
231
+ # the highlighted value at the bottom of the suggestions.
232
+ [System.Management.Automation.CompletionResult]::new($($comp.Name | __cycloneUI_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)")
233
+ }
234
+
235
+ # TabCompleteNext and in case we get something unknown
236
+ Default {
237
+ # Like MenuComplete but we don't want to add a space here because
238
+ # the user need to press space anyway to get the completion.
239
+ # Description will not be shown because that's not possible with TabCompleteNext
240
+ [System.Management.Automation.CompletionResult]::new($($comp.Name | __cycloneUI_escapeStringWithSpecialChars), "$($comp.Name)", 'ParameterValue', "$($comp.Description)")
241
+ }
242
+ }
243
+ }
244
+ }
245
+
246
+ Register-ArgumentCompleter -CommandName 'cyclone-ui' -ScriptBlock $__cycloneUICompleterBlock
247
+ `,p=f.split(`
248
+ `).map(f=>f.trim()?f.trim().startsWith(`#`)?`${r(f)}`:d(f).replaceAll(/(?<=\$(\{|\()).*(?=(\}\)))/g,a(`$&`)).replaceAll(/\".*\"/g,t(`$&`)).replaceAll(/(\[|\]|\(|\)|\||<|>|\$\(|\$?\{|\}|\+|=|;|::new|::OutputEncoding|::UTF8)/g,e(i(`$&`))).replaceAll(/(switch|complete)\s+/g,a(`$&`)).replaceAll(/(?<=(switch|complete)\s+)\w/g,e(o(`$&`))).replaceAll(/(Get-PSReadLineKeyHandler|Where-Object|ExperimentalFeature|Console|ScriptBlock|Array|ForEach-Object|Register-ArgumentCompleter|System.Management.Automation.CompletionResult|$\w+)\s+/g,l(`$&`)).replaceAll(/(?<=(Get-PSReadLineKeyHandler|Where-Object|ExperimentalFeature|Console|ScriptBlock|Array|ForEach-Object|Register-ArgumentCompleter|System.Management.Automation.CompletionResult|$\w+)\s+)\w/g,e(u(`$&`))).replaceAll(/while\s+/g,t(`$&`)).replaceAll(/(?<=while\s+)\w/g,e(n(`$&`))).replaceAll(/(if|fi|else|elif|then|done)\s+/g,a(`$&`)).replaceAll(/\$?__\w/g,e(c(`$&`))).replaceAll(/(?<=\s)(-\w|--\w[\w-]*)(?=\s|$)/g,e(s(`$&`))):``).join(`
249
+ `);export{p as n,f as t};
@@ -0,0 +1,235 @@
1
+ import{bold as e,cyan as t,cyanBright as n,dim as r,gray as i,green as a,greenBright as o,magenta as s,magentaBright as c,red as l,redBright as u,white as d}from"node:console";const f=`function __cyclone_ui_debug
2
+ set -l file "$BASH_COMP_DEBUG_FILE"
3
+ if test -n "$file"
4
+ echo "$argv" >> $file
5
+ end
6
+ end
7
+
8
+ function __cyclone_ui_perform_completion
9
+ __cyclone_ui_debug "Starting __cyclone_ui_perform_completion"
10
+
11
+ # Extract all args except the last one
12
+ set -l args (commandline -opc)
13
+ # Extract the last arg and escape it in case it is a space or wildcard
14
+ set -l lastArg (string escape -- (commandline -ct))
15
+
16
+ __cyclone_ui_debug "args: $args"
17
+ __cyclone_ui_debug "last arg: $lastArg"
18
+
19
+ # Build the completion request command
20
+ set -l requestComp "/nix/store/vhmrk3hh4nkaw62xmcl22961g64sn443-nodejs-slim-26.8.2/bin/node /home/runner/work/cyclone-ui/cyclone-ui/node_modules/.pnpm/nx@23.1.1_@swc-node+register@1.11.1_@swc+core@1.15.41_@swc+helpers@0.5.23__@swc+types@0_583c0237aac68dfd0de00ada7cc6c6ec/node_modules/nx/dist/bin/run-executor.js complete -- (string join ' ' -- (string escape -- $args[2..-1])) $lastArg"
21
+
22
+ __cyclone_ui_debug "Calling $requestComp"
23
+ set -l results (eval $requestComp 2> /dev/null)
24
+
25
+ # Some programs may output extra empty lines after the directive.
26
+ # Let's ignore them or else it will break completion.
27
+ # Ref: https://github.com/spf13/cobra/issues/1279
28
+ for line in $results[-1..1]
29
+ if test (string trim -- $line) = ""
30
+ # Found an empty line, remove it
31
+ set results $results[1..-2]
32
+ else
33
+ # Found non-empty line, we have our proper output
34
+ break
35
+ end
36
+ end
37
+
38
+ set -l comps $results[1..-2]
39
+ set -l directiveLine $results[-1]
40
+
41
+ # For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
42
+ # completions must be prefixed with the flag
43
+ set -l flagPrefix (string match -r -- '-.*=' "$lastArg")
44
+
45
+ __cyclone_ui_debug "Comps: $comps"
46
+ __cyclone_ui_debug "DirectiveLine: $directiveLine"
47
+ __cyclone_ui_debug "flagPrefix: $flagPrefix"
48
+
49
+ for comp in $comps
50
+ printf "%s%s
51
+ " "$flagPrefix" "$comp"
52
+ end
53
+
54
+ printf "%s
55
+ " "$directiveLine"
56
+ end
57
+
58
+ # This function limits calls to __cyclone_ui_perform_completion, by caching the result
59
+ function __cyclone_ui_perform_completion_once
60
+ __cyclone_ui_debug "Starting __cyclone_ui_perform_completion_once"
61
+
62
+ if test -n "$__cyclone_ui_perform_completion_once_result"
63
+ __cyclone_ui_debug "Seems like a valid result already exists, skipping __cyclone_ui_perform_completion"
64
+ return 0
65
+ end
66
+
67
+ set --global __cyclone_ui_perform_completion_once_result (__cyclone_ui_perform_completion)
68
+ if test -z "$__cyclone_ui_perform_completion_once_result"
69
+ __cyclone_ui_debug "No completions, probably due to a failure"
70
+ return 1
71
+ end
72
+
73
+ __cyclone_ui_debug "Performed completions and set __cyclone_ui_perform_completion_once_result"
74
+ return 0
75
+ end
76
+
77
+ # This function is used to clear the cached result after completions are run
78
+ function __cyclone_ui_clear_perform_completion_once_result
79
+ __cyclone_ui_debug ""
80
+ __cyclone_ui_debug "========= clearing previously set __cyclone_ui_perform_completion_once_result variable =========="
81
+ set --erase __cyclone_ui_perform_completion_once_result
82
+ __cyclone_ui_debug "Successfully erased the variable __cyclone_ui_perform_completion_once_result"
83
+ end
84
+
85
+ function __cyclone_ui_requires_order_preservation
86
+ __cyclone_ui_debug ""
87
+ __cyclone_ui_debug "========= checking if order preservation is required =========="
88
+
89
+ __cyclone_ui_perform_completion_once
90
+ if test -z "$__cyclone_ui_perform_completion_once_result"
91
+ __cyclone_ui_debug "Error determining if order preservation is required"
92
+ return 1
93
+ end
94
+
95
+ set -l directive (string sub --start 2 $__cyclone_ui_perform_completion_once_result[-1])
96
+ __cyclone_ui_debug "Directive is: $directive"
97
+
98
+ set -l shellCompDirectiveKeepOrder 32
99
+ set -l keeporder (math (math --scale 0 $directive / $shellCompDirectiveKeepOrder) % 2)
100
+ __cyclone_ui_debug "Keeporder is: $keeporder"
101
+
102
+ if test $keeporder -ne 0
103
+ __cyclone_ui_debug "This does require order preservation"
104
+ return 0
105
+ end
106
+
107
+ __cyclone_ui_debug "This doesn't require order preservation"
108
+ return 1
109
+ end
110
+
111
+ # This function does two things:
112
+ # - Obtain the completions and store them in the global __cyclone_ui_comp_results
113
+ # - Return false if file completion should be performed
114
+ function __cyclone_ui_prepare_completions
115
+ __cyclone_ui_debug ""
116
+ __cyclone_ui_debug "========= starting completion logic =========="
117
+
118
+ # Start fresh
119
+ set --erase __cyclone_ui_comp_results
120
+
121
+ __cyclone_ui_perform_completion_once
122
+ __cyclone_ui_debug "Completion results: $__cyclone_ui_perform_completion_once_result"
123
+
124
+ if test -z "$__cyclone_ui_perform_completion_once_result"
125
+ __cyclone_ui_debug "No completion, probably due to a failure"
126
+ # Might as well do file completion, in case it helps
127
+ return 1
128
+ end
129
+
130
+ set -l directive (string sub --start 2 $__cyclone_ui_perform_completion_once_result[-1])
131
+ set --global __cyclone_ui_comp_results $__cyclone_ui_perform_completion_once_result[1..-2]
132
+
133
+ __cyclone_ui_debug "Completions are: $__cyclone_ui_comp_results"
134
+ __cyclone_ui_debug "Directive is: $directive"
135
+
136
+ set -l shellCompDirectiveError 1
137
+ set -l shellCompDirectiveNoSpace 2
138
+ set -l shellCompDirectiveNoFileComp 4
139
+ set -l shellCompDirectiveFilterFileExt 8
140
+ set -l shellCompDirectiveFilterDirs 16
141
+ if test -z "$directive"
142
+ set directive 0
143
+ end
144
+
145
+ set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
146
+ if test $compErr -eq 1
147
+ __cyclone_ui_debug "Received error directive: aborting."
148
+ # Might as well do file completion, in case it helps
149
+ return 1
150
+ end
151
+
152
+ set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
153
+ set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
154
+ if test $filefilter -eq 1; or test $dirfilter -eq 1
155
+ __cyclone_ui_debug "File extension filtering or directory filtering not supported"
156
+ # Do full file completion instead
157
+ return 1
158
+ end
159
+
160
+ set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
161
+ set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)
162
+
163
+ __cyclone_ui_debug "nospace: $nospace, nofiles: $nofiles"
164
+
165
+ # If we want to prevent a space, or if file completion is NOT disabled,
166
+ # we need to count the number of valid completions.
167
+ # To do so, we will filter on prefix as the completions we have received
168
+ # may not already be filtered so as to allow fish to match on different
169
+ # criteria than the prefix.
170
+ if test $nospace -ne 0; or test $nofiles -eq 0
171
+ set -l prefix (commandline -t | string escape --style=regex)
172
+ __cyclone_ui_debug "prefix: $prefix"
173
+
174
+ set -l completions (string match -r -- "^$prefix.*" $__cyclone_ui_comp_results)
175
+ set --global __cyclone_ui_comp_results $completions
176
+ __cyclone_ui_debug "Filtered completions are: $__cyclone_ui_comp_results"
177
+
178
+ # Important not to quote the variable for count to work
179
+ set -l numComps (count $__cyclone_ui_comp_results)
180
+ __cyclone_ui_debug "numComps: $numComps"
181
+
182
+ if test $numComps -eq 1; and test $nospace -ne 0
183
+ # We must first split on to get rid of the descriptions to be
184
+ # able to check what the actual completion will be.
185
+ # We don't need descriptions anyway since there is only a single
186
+ # real completion which the shell will expand immediately.
187
+ set -l split (string split --max 1 " " $__cyclone_ui_comp_results[1])
188
+
189
+ # Fish won't add a space if the completion ends with any
190
+ # of the following characters: @=/:.,
191
+ set -l lastChar (string sub -s -1 -- $split)
192
+ if not string match -r -q "[@=/:.,]" -- "$lastChar"
193
+ # In other cases, to support the "nospace" directive we trick the shell
194
+ # by outputting an extra, longer completion.
195
+ __cyclone_ui_debug "Adding second completion to perform nospace directive"
196
+ set --global __cyclone_ui_comp_results $split[1] $split[1].
197
+ __cyclone_ui_debug "Completions are now: $__cyclone_ui_comp_results"
198
+ end
199
+ end
200
+
201
+ if test $numComps -eq 0; and test $nofiles -eq 0
202
+ # To be consistent with bash and zsh, we only trigger file
203
+ # completion when there are no other completions
204
+ __cyclone_ui_debug "Requesting file completion"
205
+ return 1
206
+ end
207
+ end
208
+
209
+ return 0
210
+ end
211
+
212
+ # Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
213
+ # so we can properly delete any completions provided by another script.
214
+ # Only do this if the program can be found, or else fish may print some errors; besides,
215
+ # the existing completions will only be loaded if the program can be found.
216
+ if type -q "cyclone-ui"
217
+ # The space after the program name is essential to trigger completion for the program
218
+ # and not completion of the program name itself.
219
+ # Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
220
+ complete --do-complete "cyclone-ui " > /dev/null 2>&1
221
+ end
222
+
223
+ # Remove any pre-existing completions for the program since we will be handling all of them.
224
+ complete -c cyclone-ui -e
225
+ # This will get called after the two calls below and clear the cached result
226
+ complete -c cyclone-ui -n '__cyclone_ui_clear_perform_completion_once_result'
227
+ # The call to __cyclone_ui_prepare_completions will setup __cyclone_ui_comp_results
228
+ # which provides the program's completion choices.
229
+ # If this doesn't require order preservation, we don't use the -k flag
230
+ complete -c cyclone-ui -n 'not __cyclone_ui_requires_order_preservation && __cyclone_ui_prepare_completions' -f -a '$__cyclone_ui_comp_results'
231
+ # Otherwise we use the -k flag
232
+ complete -k -c cyclone-ui -n '__cyclone_ui_requires_order_preservation && __cyclone_ui_prepare_completions' -f -a '$__cyclone_ui_comp_results'
233
+ `,p=f.split(`
234
+ `).map(f=>f.trim()?f.trim().startsWith(`#`)?`${r(f)}`:d(f).replaceAll(/(?<=\$(\{|\()).*(?=(\}\)))/g,a(`$&`)).replaceAll(/(\"|\').*(\"|\')/g,t(`$&`)).replaceAll(/(\[|\]|\(|\)|\||<|>|\$\(|\$?\{|\}|\+|=|;|:)/g,e(i(`$&`))).replaceAll(/(function|complete)\s+/g,a(`$&`)).replaceAll(/(?<=(function|complete)\s+)\w/g,e(o(`$&`))).replaceAll(/set\s+/g,l(`$&`)).replaceAll(/(?<=set\s+)\w/g,e(u(`$&`))).replaceAll(/while\s+/g,t(`$&`)).replaceAll(/(?<=while\s+)\w/g,e(n(`$&`))).replaceAll(/(if|fi|else|elif|then|done)\s+/g,a(`$&`)).replaceAll(/\s__\w/g,e(c(`$&`))).replaceAll(/(?<=\s)(-\w|--\w[\w-]*)(?=\s|$)/g,e(s(`$&`))):``).join(`
235
+ `);export{p as n,f as t};
@@ -0,0 +1 @@
1
+ import{A as e,D as t,J as n,P as r,S as i,U as a,W as o,d as s,f as c,g as l,i as u,l as d,o as f,q as p,u as m}from"./console-wWDh21MV.mjs";import{i as h}from"./prompts-zyeiNLLd.mjs";import g from"node:os";import{join as _,resolve as v}from"node:path";import{existsSync as y}from"node:fs";import b from"node:process";import{mkdir as x,readFile as S,writeFile as C}from"node:fs/promises";const w=g.homedir(),T=g.tmpdir();async function E(e={}){let t=e.cwd??b.cwd(),n=v(t,`..`);for(;n!==t&&t!==w&&t!==T;){let r=_(t,`package.json`);if(y(r)){if(e.isDependencyRequired){let e=JSON.parse(await S(r,`utf8`));if(Object.keys(e.dependencies||{}).concat(Object.keys(e.devDependencies||{})).concat(Object.keys(e.peerDependencies||{})).concat(Object.keys(e.optionalDependencies||{})).some(e=>e===`@cyclone-ui/cli`||e.startsWith(`@cyclone-ui/cli@`)))return r}else return r}else t=n,n=v(t,`..`)}}function D(e={}){let t=e.cwd??b.cwd(),n=v(t,`..`);for(;n!==t&&t!==w&&t!==T;){let e=[`package-lock.json`,`npm-shrinkwrap.json`,`yarn.lock`,`pnpm-lock.yaml`,`pnpm-workspace.yaml`,`deno.lock`,`deno.json`,`deno.jsonc`,`bun.lock`,`bun.lockb`].find(e=>y(_(t,e)));if(e)return e;t=n,n=v(t,`..`)}}async function O(e={}){let t=b.env.npm_config_user_agent??``,n=b.env.npm_execpath??``;if(t.startsWith(`yarn`)||n.includes(`yarn`))return`yarn`;if(t.startsWith(`pnpm`)||n.includes(`pnpm`))return`pnpm`;if(t.startsWith(`bun`)||n.includes(`bun`)||b.versions.bun)return`bun`;{let t=D(e);if(t===`yarn.lock`)return`yarn`;if(t===`deno.lock`||t===`deno.json`||t===`deno.jsonc`)return`deno`;if(t===`pnpm-lock.yaml`||t===`pnpm-workspace.yaml`)return`pnpm`;if(t===`bun.lock`||t===`bun.lockb`)return`bun`;{let t=await E(e);if(t&&y(t)){let e=JSON.parse(await S(t,`utf8`));if(e.devEngines?.packageManager?.name&&typeof e.devEngines.packageManager.name==`string`&&[`npm`,`yarn`,`pnpm`,`deno`,`bun`].includes(e.devEngines.packageManager.name))return e.devEngines.packageManager.name;let n={...e.dependencies,...e.devDependencies,...e.peerDependencies,...e.optionalDependencies};if(Object.keys(n).some(e=>e===`yarn`||e.startsWith(`yarn@`)||e===`yarnpkg`||e.startsWith(`yarnpkg@`)))return`yarn`;if(Object.keys(n).some(e=>e===`bun`||e.startsWith(`bun@`)))return`bun`;if(Object.keys(n).some(e=>e===`pnpm`||e.startsWith(`pnpm@`)))return`pnpm`;if(Object.keys(n).some(e=>e===`deno`||e.startsWith(`deno@`)))return`deno`}return`npm`}}}async function k(e){let t=await fetch(`https://registry.npmjs.com/-/v1/search?text=${e}&size=1`).then(e=>e.json());if(t.objects&&t.objects.length>0&&t.objects[0].package&&t.objects[0].package.name===e)return t.objects[0].package}async function A(e=`@cyclone-ui/cli`){return(await k(e))?.version}async function j(e,t=b.cwd()){let n=await A(`@cyclone-ui/cli`)||`latest`;return e===`yarn`?[`upgrade`,`@cyclone-ui/cli@${n}`]:e===`pnpm`?[`update`,`@cyclone-ui/cli@${n}`]:e===`deno`?[`outdated`,`--update`,`@cyclone-ui/cli@${n}`]:e===`bun`?[`update`,`--save`,`@cyclone-ui/cli@${n}`]:[`update`,`--save`,`--bin-links`,`@cyclone-ui/cli@${n}`]}async function M(e={}){let t=await O(e),n=await j(t,e.cwd),i=``;await r(`${t}${p&&t!==`bun`?`.cmd`:``}`,[n.join(` `)],{...e,env:{...e.env,...t===`pnpm`?{npm_config_strict_peer_dependencies:!1}:null},stdout:t=>{e.stdout?.(t),i+=t},stderr:t=>{e.stderr?.(t)}})}async function N(e={}){if(!e.force&&!await P())return{latestVersion:`0.6.1`,currentVersion:`0.6.1`,isUpToDate:!0,isError:!1};try{let e=await k(`@cyclone-ui/cli`);return{latestVersion:e?.version||`0.6.1`,currentVersion:`0.6.1`,isUpToDate:!e||e.version===`0.6.1`,package:e,isError:!1}}catch(e){return{isError:!0,error:e instanceof Error?e:Error(String(e))}}}async function P(){if(!e||o||a.SKIP_UPDATE_CHECK)return!1;let t=_(n.data,`update-check.json`);if(y(t)){let e=JSON.parse(await S(t,`utf8`));if(!e.timestamp)return await F(),!0;if((/* @__PURE__ */ new Date()).getTime()-e.timestamp<1296e5)return!1}else return await F(),!0}async function F(){y(n.data)||await x(n.data,{recursive:!0}),await C(_(n.data,`update-check.json`),JSON.stringify({timestamp:(/* @__PURE__ */ new Date()).getTime()}),`utf8`)}async function I(){if(await P()){let e=u({message:`Checking for updates...`}).start(),n=await N({force:!0});if(n?.isError)e.error(`An error occurred while checking for Cyclone User Interface application updates. Please try again later - if the problem persists, please contact support.`),f(n.error);else if(n?.isUpToDate)e.success(`Currently running the latest version of Cyclone User Interface.`),t(``);else{e.stop(),s(`A new version of Cyclone User Interface is available: ${l(`v${n.currentVersion}`)} ${i.body.tertiary(`➜`)} ${d(`v${n.latestVersion}`)}${n.package?.date?i.body.tertiary(` (updated on ${n.package?.date})`):``}`);try{await M(),e.success(`Update successful! Please restart the application to apply the update.`),t(``),m(`The changelog for this release can be viewed by running the ${c(`cyclone-ui changelog`)} command.`),t(``),t(`Press any key to exit the application...`),await h();return}catch(t){e.error(`An error occurred while updating Cyclone User Interface to v${n.latestVersion}. Please try again later - if the problem persists, please contact support.`),f(t)}}}}export{I as t};
@@ -0,0 +1 @@
1
+ import{D as e,S as t,h as n,p as r,t as i,x as a}from"./console-wWDh21MV.mjs";function o(){e(`${i(t.heading.secondary(`Tags: `))} ${t.tags.utility?t.tags.utility(r(` Utility `)):t.tags.default(r(` Utility `))}`,{padding:0}),e(``),e(i(t.heading.secondary(`Usage:`))),e(t.body.secondary(`${t.usage.bin(`>_ cyclone-ui`)} ${t.usage.command(`update`)} ${t.usage.options(`[options]`)}`),{padding:0}),e(t.body.secondary(`${t.usage.bin(`>_ cyclone-ui`)} ${t.usage.command(`upgrade`)} ${t.usage.options(`[options]`)}`),{padding:0}),e(``),e(i(t.heading.secondary(`Options:`))),a([[{value:t.body.primary(`--color, --colors`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Force colored terminal output (env: CYCLONE_UI_COLOR, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-color, --no-colors`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Force disable colored terminal output (env: CYCLONE_UI_NO_COLOR, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`-?, -h, --help`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Show help information (default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`-i, --interact, --interactive`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Enable interactive mode - will be set to false if running in a CI pipeline (env: CYCLONE_UI_INTERACTIVE, default: true).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-interactive, --non-interactive`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Disable interactive mode - will be set to true if running in a CI pipeline (env: CYCLONE_UI_NON_INTERACTIVE, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--latest`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Whether to update to the latest version (default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--hide-banner, --no-banner`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline (env: CYCLONE_UI_NO_BANNER, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-color, --no-colors`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Force disable colored terminal output (env: CYCLONE_UI_NO_COLOR, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-interactive, --non-interactive`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Disable interactive mode - will be set to true if running in a CI pipeline (env: CYCLONE_UI_NON_INTERACTIVE, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--quiet`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Suppress command decorations and diagnostic messages (default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`-V, --verbose`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Enable verbose output (env: CYCLONE_UI_VERBOSE, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--version <version>`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`A specific application version to update to (default: "latest").`),align:`left`,border:`none`}],[{value:t.body.primary(`-y, --yes`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Skip all prompts by answering yes to all of them - will be set to true if running in a CI pipeline (env: CYCLONE_UI_YES, default: false).`),align:`left`,border:`none`}]]),e(``),e(t.body.tertiary(`More information can be found in the Update command documentation at ${n(`https://docs.cyclone-ui.com/reference/cli/update`)}${t.body.tertiary(`.`)}`),{padding:0}),e(``)}export{o as t};
@@ -0,0 +1,2 @@
1
+ import{A as e,B as t,D as n,F as r,G as i,I as a,K as o,L as s,N as c,S as l,U as u,V as d,_ as f,j as p,k as m,n as h,t as g,y as _,z as v}from"./console-wWDh21MV.mjs";import{a as y}from"./prompts-zyeiNLLd.mjs";import{t as b}from"./update-BP6PyX8m.mjs";import{t as x}from"./update-DcG9HWj8.mjs";async function S(i=500){if(t().get(`is-banner-displayed`)||r(`no-banner`)||r(`hide-banner`)||p)return;t().set(`is-banner-displayed`,!0),n(``),n(h.banner.outline.primary(`┏`)+h.banner.outline.primary(`━`.repeat(6))+` `+l.banner.header.primary(`⬤`)+` `+h.banner.outline.primary(`━`)+` `+g(l.banner.header.primary(`Cyclone CLI v0.6.1`))+` `+h.banner.outline.primary(`━`.repeat(Math.max(m().columns-32,0)))+h.banner.outline.primary(`┓`),{consoleFn:console.log});let o=Math.max(...y.map(e=>_(e).length))>Math.max(m().columns+30,20)?`Cyclone User Interface`:`\n${y.join(`
2
+ `)}\n`;f(o,Math.max(m().columns-30,20)).forEach(e=>{n(h.banner.outline.primary(`┃`)+` `.repeat(Math.max(Math.floor((m().columns-(_(e).length+2))/2),0))+g(l.banner.title.primary(e))+` `.repeat(Math.max(Math.ceil((m().columns-(_(e).length+2))/2),0))+h.banner.outline.primary(`┃`),{consoleFn:console.log})}),n(h.banner.outline.primary(`┃`)+` `.repeat(Math.max(Math.floor((m().columns-(_(`Update`).length+2))/2),0))+g(l.banner.command.primary(`Update`))+` `.repeat(Math.max(Math.ceil((m().columns-(_(`Update`).length+2))/2),0))+h.banner.outline.primary(`┃`),{consoleFn:console.log}),f(g(l.banner.description.primary(`A command for checking and updating the version of the Cyclone User Interface command-line interface application.`)),Math.max(60>m().columns/2?m().columns-6:m().columns-30,20)).forEach(e=>{n(h.banner.outline.primary(`┃`)+` `.repeat(Math.max(Math.floor((m().columns-(_(e).length+2))/2),0))+l.banner.description.primary(e)+` `.repeat(Math.max(Math.ceil((m().columns-(_(e).length+2))/2),0))+h.banner.outline.primary(`┃`),{consoleFn:console.log})}),n(h.banner.outline.primary(`┃`)+` `.repeat(Math.max(m().columns-2,0))+h.banner.outline.primary(`┃`),{consoleFn:console.log}),n(h.banner.outline.primary(`┗`)+h.banner.outline.primary(`━`.repeat(Math.max(m().columns-32,0)))+` `+g(l.banner.footer.primary(`https://cyclone-ui.com`))+` `+h.banner.outline.primary(`━`.repeat(6))+h.banner.outline.primary(`┛`),{consoleFn:console.log}),n(``),e&&!a()&&await c(i)}async function C(e){}async function w(e=s()){let t={...v(),latest:!1,version:`latest`};for(let n=0;n<e.slice(0).length;n++){let r=e[n].length>3&&e[n].startsWith(`--`)?`--${e[n].slice(2).replaceAll(`-`,``).toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``)}`:e[n].length>2&&e[n].startsWith(`-`)?`-${e[n].slice(1).replaceAll(`-`,``)}`:e[n];if(r.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``).startsWith(`latest=`)||r.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``)===`latest`||r.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``).startsWith(`latest=`)||r.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``)===`latest`){if(/^--?(latest)=/.test(`-`+r.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``))){let e=r.replace(/^--?(latest)=/,``).trim().replace(/^("|')/,``).replace(/("|')$/,``).toLowerCase();t.latest=!!e&&e.toLowerCase()!==`false`&&e.toLowerCase()!==`f`&&e.toLowerCase()!==`no`&&e!==`n`&&e.toLowerCase()!==`0`&&e.toLowerCase()!==`off`&&e!==`disable`&&e.toLowerCase()!==`disabled`&&e.toLowerCase()!==`never`&&(Number.isNaN(Number.parseFloat(e))||Number.parseFloat(e)>0)}else t.latest=!0}else(r.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``).startsWith(`version=`)||r.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``)===`version`||r.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``).startsWith(`version=`)||r.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``)===`version`)&&(/^--?(version)=/.test(`-`+r.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``))?t.version=r.replace(/^--?(version)=/,``).trim().replace(/^("|')/,``).replace(/("|')$/,``):e.length>n+1&&(t.version=e[++n].trim().replace(/^("|')/,``).replace(/("|')$/,``)))}return r(`quiet`)||(await S(),await b()),!a()&&!r(`quiet`)&&(n(``),(o||i||u.LOG_LEVEL===`debug`)&&n(l.body.tertiary(`Debug mode is enabled. Additional debug information may be logged to the console.`))),t.help?x():d(`update`,[`update`],[t],C)}export{w as handler};
@@ -0,0 +1 @@
1
+ import{D as e,S as t,h as n,t as r,x as i}from"./console-wWDh21MV.mjs";function a(){e(``),e(r(t.heading.secondary(`Usage:`))),e(t.body.secondary(`${t.usage.bin(`>_ cyclone-ui`)} ${t.usage.command(`registry`)} ${t.usage.command(`validate`)} ${t.usage.args(`<registry>`)} ${t.usage.options(`[options]`)}`),{padding:0}),e(t.body.secondary(`${t.usage.bin(`>_ cyclone-ui`)} ${t.usage.command(`registry`)} ${t.usage.command(`validate`)} ${t.usage.options(`[options]`)} ${t.usage.args(`<registry>`)}`),{padding:0}),e(``),e(r(t.heading.secondary(`Options:`))),i([[{value:t.body.primary(`--color, --colors`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Force colored terminal output (env: CYCLONE_UI_COLOR, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-color, --no-colors`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Force disable colored terminal output (env: CYCLONE_UI_NO_COLOR, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--cwd <cwd>`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`The working directory.`),align:`left`,border:`none`}],[{value:t.body.primary(`-?, -h, --help`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Show help information (default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`-i, --interact, --interactive`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Enable interactive mode - will be set to false if running in a CI pipeline (env: CYCLONE_UI_INTERACTIVE, default: true).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-interactive, --non-interactive`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Disable interactive mode - will be set to true if running in a CI pipeline (env: CYCLONE_UI_NON_INTERACTIVE, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--hide-banner, --no-banner`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline (env: CYCLONE_UI_NO_BANNER, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-color, --no-colors`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Force disable colored terminal output (env: CYCLONE_UI_NO_COLOR, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-interactive, --non-interactive`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Disable interactive mode - will be set to true if running in a CI pipeline (env: CYCLONE_UI_NON_INTERACTIVE, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--quiet`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Suppress command decorations and diagnostic messages (default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`-V, --verbose`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Enable verbose output (env: CYCLONE_UI_VERBOSE, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`-v, --version`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Show the version of the application (default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`-y, --yes`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Skip all prompts by answering yes to all of them - will be set to true if running in a CI pipeline (env: CYCLONE_UI_YES, default: false).`),align:`left`,border:`none`}]]),e(``),e(t.body.tertiary(`More information can be found in the Validate Registry command documentation at ${n(`https://docs.cyclone-ui.com/reference/cli/registry/validate`)}${t.body.tertiary(`.`)}`),{padding:0}),e(``)}export{a as t};
@@ -0,0 +1 @@
1
+ import{D as e,S as t,h as n,t as r,x as i}from"./console-wWDh21MV.mjs";function a(){e(``),e(r(t.heading.secondary(`Usage:`))),e(t.body.secondary(`${t.usage.bin(`>_ cyclone-ui`)} ${t.usage.command(`view`)} ${t.usage.args(`<components...>`)} ${t.usage.options(`[options]`)}`),{padding:0}),e(t.body.secondary(`${t.usage.bin(`>_ cyclone-ui`)} ${t.usage.command(`view`)} ${t.usage.options(`[options]`)} ${t.usage.args(`<components...>`)}`),{padding:0}),e(``),e(r(t.heading.secondary(`Options:`))),i([[{value:t.body.primary(`--color, --colors`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Force colored terminal output (env: CYCLONE_UI_COLOR, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-color, --no-colors`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Force disable colored terminal output (env: CYCLONE_UI_NO_COLOR, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--cwd <cwd>`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`The working directory.`),align:`left`,border:`none`}],[{value:t.body.primary(`-?, -h, --help`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Show help information (default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`-i, --interact, --interactive`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Enable interactive mode - will be set to false if running in a CI pipeline (env: CYCLONE_UI_INTERACTIVE, default: true).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-interactive, --non-interactive`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Disable interactive mode - will be set to true if running in a CI pipeline (env: CYCLONE_UI_NON_INTERACTIVE, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--hide-banner, --no-banner`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline (env: CYCLONE_UI_NO_BANNER, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-color, --no-colors`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Force disable colored terminal output (env: CYCLONE_UI_NO_COLOR, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--no-interactive, --non-interactive`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Disable interactive mode - will be set to true if running in a CI pipeline (env: CYCLONE_UI_NON_INTERACTIVE, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--quiet`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Suppress command decorations and diagnostic messages (default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`--registry <registry>`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Registry API URL.`),align:`left`,border:`none`}],[{value:t.body.primary(`-V, --verbose`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Enable verbose output (env: CYCLONE_UI_VERBOSE, default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`-v, --version`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Show the version of the application (default: false).`),align:`left`,border:`none`}],[{value:t.body.primary(`-y, --yes`),align:`right`,border:`none`,maxWidth:`1/3`},{value:t.body.tertiary(`Skip all prompts by answering yes to all of them - will be set to true if running in a CI pipeline (env: CYCLONE_UI_YES, default: false).`),align:`left`,border:`none`}]]),e(``),e(t.body.tertiary(`More information can be found in the View Registry Components command documentation at ${n(`https://docs.cyclone-ui.com/reference/cli/view`)}${t.body.tertiary(`.`)}`),{padding:0}),e(``)}export{a as t};
package/dist/view.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import{A as e,B as t,D as n,E as r,F as i,G as a,I as o,K as s,L as c,N as l,S as u,U as d,V as f,_ as p,c as m,j as h,k as g,m as _,n as v,t as y,y as b,z as x}from"./console-wWDh21MV.mjs";import{a as S,r as C,t as w}from"./prompts-zyeiNLLd.mjs";import{t as T}from"./view-DLb3I50K.mjs";import{t as E}from"./update-BP6PyX8m.mjs";import{i as D}from"./config-D4XQ3gm9.mjs";import{n as O}from"./registry-C95vaVW8.mjs";import{resolve as k}from"node:path";import{DEFAULT_REGISTRY_URL as A}from"@cyclone-ui/registry-api/client";async function j(r=500){if(t().get(`is-banner-displayed`)||i(`no-banner`)||i(`hide-banner`)||h)return;t().set(`is-banner-displayed`,!0),n(``),n(v.banner.outline.primary(`┏`)+v.banner.outline.primary(`━`.repeat(6))+` `+u.banner.header.primary(`⬤`)+` `+v.banner.outline.primary(`━`)+` `+y(u.banner.header.primary(`Cyclone CLI v0.6.1`))+` `+v.banner.outline.primary(`━`.repeat(Math.max(g().columns-32,0)))+v.banner.outline.primary(`┓`),{consoleFn:console.log});let a=Math.max(...S.map(e=>b(e).length))>Math.max(g().columns+30,20)?`Cyclone User Interface`:`\n${S.join(`
2
+ `)}\n`;p(a,Math.max(g().columns-30,20)).forEach(e=>{n(v.banner.outline.primary(`┃`)+` `.repeat(Math.max(Math.floor((g().columns-(b(e).length+2))/2),0))+y(u.banner.title.primary(e))+` `.repeat(Math.max(Math.ceil((g().columns-(b(e).length+2))/2),0))+v.banner.outline.primary(`┃`),{consoleFn:console.log})}),n(v.banner.outline.primary(`┃`)+` `.repeat(Math.max(Math.floor((g().columns-(b(`View Registry Components`).length+2))/2),0))+y(u.banner.command.primary(`View Registry Components`))+` `.repeat(Math.max(Math.ceil((g().columns-(b(`View Registry Components`).length+2))/2),0))+v.banner.outline.primary(`┃`),{consoleFn:console.log}),p(y(u.banner.description.primary(`View component metadata and files from the registry.`)),Math.max(60>g().columns/2?g().columns-6:g().columns-30,20)).forEach(e=>{n(v.banner.outline.primary(`┃`)+` `.repeat(Math.max(Math.floor((g().columns-(b(e).length+2))/2),0))+u.banner.description.primary(e)+` `.repeat(Math.max(Math.ceil((g().columns-(b(e).length+2))/2),0))+v.banner.outline.primary(`┃`),{consoleFn:console.log})}),n(v.banner.outline.primary(`┃`)+` `.repeat(Math.max(g().columns-2,0))+v.banner.outline.primary(`┃`),{consoleFn:console.log}),n(v.banner.outline.primary(`┗`)+v.banner.outline.primary(`━`.repeat(Math.max(g().columns-32,0)))+` `+y(u.banner.footer.primary(`https://cyclone-ui.com`))+` `+v.banner.outline.primary(`━`.repeat(6))+v.banner.outline.primary(`┛`),{consoleFn:console.log}),n(``),e&&!o()&&await l(r)}async function M(e,t){let n=k(e.cwd??process.cwd()),i=await D(n),a=O(e.registry??i?.registry??A);r(JSON.stringify(await Promise.all(t.map(e=>a.components.get.query(e))),null,2))}async function N(t=c()){let r={...x()};for(let e=0;e<t.slice(0).length;e++){let n=t[e].length>3&&t[e].startsWith(`--`)?`--${t[e].slice(2).replaceAll(`-`,``).toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``)}`:t[e].length>2&&t[e].startsWith(`-`)?`-${t[e].slice(1).replaceAll(`-`,``)}`:t[e];n.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``).startsWith(`cwd=`)||n.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``)===`cwd`||n.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``).startsWith(`cwd=`)||n.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``)===`cwd`?/^--?(cwd)=/.test(`-`+n.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``))?r.cwd=n.replace(/^--?(cwd)=/,``).trim().replace(/^("|')/,``).replace(/("|')$/,``):t.length>e+1&&(r.cwd=t[++e].trim().replace(/^("|')/,``).replace(/("|')$/,``)):(n.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``).startsWith(`registry=`)||n.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``)===`registry`||n.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``).startsWith(`registry=`)||n.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``)===`registry`)&&(/^--?(registry)=/.test(`-`+n.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``))?r.registry=n.replace(/^--?(registry)=/,``).trim().replace(/^("|')/,``).replace(/("|')$/,``):t.length>e+1&&(r.registry=t[++e].trim().replace(/^("|')/,``).replace(/("|')$/,``)))}let l=Math.max(0,t.slice(2).findIndex(e=>e.startsWith(`-`)&&/^(cwd|registry)=?.*$/.test(e.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``))))+2,p=l>2?2:Math.max(0,t.slice(l).findLastIndex(e=>e.startsWith(`-`)&&/^(cwd|registry)=?.*$/.test(e.toLowerCase().replaceAll(`-`,``).replaceAll(`_`,``))))+2,h=[];if(p+0<t.length&&p+0!==l&&(h=t.slice(p+0,(l>p?l:t.length)-1).join(` `).split(`,`).map(e=>e.trim().replace(/^("|')/,``).replace(/("|')$/,``)).filter(Boolean)),i(`quiet`)||(await j(),await E()),!o()&&!i(`quiet`)&&(n(``),(s||a||d.LOG_LEVEL===`debug`)&&n(u.body.tertiary(`Debug mode is enabled. Additional debug information may be logged to the console.`))),!e){let e=[];h?h.length===0&&e.push(`No values were provided to the required "components" array positional argument`):e.push(`Missing required "components" positional argument`)}else if(!o()&&(!h||h.length===0)){if(n(``),!h){let e=await C({message:`Please provide a value for the ${_(`components`)} argument`,description:`Component names to view.`,validate(e){return!e||e.trim()===``?`A value must be provided for this argument`:null}});if(w(e))return;h=e}else if(h.length===0){let e=await C({message:`Please provide one or more values for the ${_(`components`)} argument (values are separated by a \",\" character)`,description:`Component names to view.`,validate(e){if(!e||e.trim()===``)return`A value must be provided for this argument`;if(e.split(`,`).map(e=>e.trim()).filter(Boolean).length===0)return`At least one value must be provided for this argument`}});if(w(e))return;h=e.split(`,`).map(e=>e.trim()).filter(Boolean)}n(``);let e=[];h?h.length===0&&e.push(`No values were provided to the required "components" array positional argument`):e.push(`Missing required "components" positional argument`),e.length>0&&(m(`The following validation failures were found while processing the user provided input, and must be corrected before the ${_(`View Registry Components`)} command can be executed: \n\n${e.map(e=>` - `+e).join(`
3
+ `)}`),r.help=!0)}return r.help?T():f(`view`,[`view`],[r,h],M)}export{N as handler};