@quilted/create 0.2.22 → 0.2.24

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 (99) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/esnext/app.esnext +2 -4
  3. package/build/esnext/module.esnext +1 -2
  4. package/build/esnext/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.esnext +2 -4
  5. package/build/esnext/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.esnext +1 -2
  6. package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/expand.esnext +3 -6
  7. package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.esnext +4 -8
  8. package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.esnext +8 -16
  9. package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/TemplateTag/TemplateTag.esnext +3 -6
  10. package/build/esnext/node_modules/.pnpm/fastq@1.13.0/node_modules/fastq/queue.esnext +1 -2
  11. package/build/esnext/node_modules/.pnpm/fill-range@7.0.1/node_modules/fill-range/index.esnext +12 -24
  12. package/build/esnext/node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.esnext +1 -2
  13. package/build/esnext/node_modules/.pnpm/kleur@3.0.3/node_modules/kleur/index.esnext +1 -2
  14. package/build/esnext/node_modules/.pnpm/micromatch@4.0.5/node_modules/micromatch/index.esnext +6 -12
  15. package/build/esnext/node_modules/.pnpm/minimatch@5.1.0/node_modules/minimatch/minimatch.esnext +19 -38
  16. package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.esnext +8 -16
  17. package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.esnext +3 -6
  18. package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.esnext +3 -6
  19. package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.esnext +2 -4
  20. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.esnext +1 -2
  21. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.esnext +1 -2
  22. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.esnext +2 -4
  23. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.esnext +1 -2
  24. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.esnext +1 -2
  25. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.esnext +1 -2
  26. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.esnext +1 -2
  27. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.esnext +1 -2
  28. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.esnext +1 -2
  29. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.esnext +1 -2
  30. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.esnext +16 -30
  31. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.esnext +6 -12
  32. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.esnext +4 -8
  33. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.esnext +9 -18
  34. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.esnext +1 -2
  35. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.esnext +8 -13
  36. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.esnext +11 -22
  37. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.esnext +4 -8
  38. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.esnext +10 -17
  39. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.esnext +9 -18
  40. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.esnext +7 -14
  41. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.esnext +15 -30
  42. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.esnext +1 -2
  43. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.esnext +24 -48
  44. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.esnext +13 -26
  45. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.esnext +2 -4
  46. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.esnext +1 -2
  47. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.esnext +1 -2
  48. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.esnext +2 -4
  49. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.esnext +1 -2
  50. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.esnext +1 -2
  51. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.esnext +3 -6
  52. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.esnext +2 -4
  53. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.esnext +1 -2
  54. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.esnext +1 -2
  55. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.esnext +1 -2
  56. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.esnext +1 -2
  57. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.esnext +1 -2
  58. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.esnext +1 -2
  59. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.esnext +1 -2
  60. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.esnext +1 -2
  61. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.esnext +1 -2
  62. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.esnext +1 -2
  63. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.esnext +11 -22
  64. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.esnext +6 -12
  65. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.esnext +4 -8
  66. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.esnext +8 -16
  67. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.esnext +1 -2
  68. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.esnext +4 -8
  69. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.esnext +10 -20
  70. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.esnext +4 -8
  71. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.esnext +5 -10
  72. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.esnext +8 -16
  73. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.esnext +7 -14
  74. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/index.esnext +4 -8
  75. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.esnext +1 -2
  76. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.esnext +24 -48
  77. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.esnext +2 -4
  78. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.esnext +2 -4
  79. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.esnext +1 -2
  80. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.esnext +1 -2
  81. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.esnext +2 -4
  82. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.esnext +1 -2
  83. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.esnext +1 -2
  84. package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.esnext +2 -4
  85. package/build/esnext/node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.esnext +3 -6
  86. package/build/esnext/node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.esnext +6 -12
  87. package/build/esnext/node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.esnext +1 -2
  88. package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/compose/resolve-flow-collection.esnext +11 -12
  89. package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/parse/lexer.esnext +17 -18
  90. package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/parse/parser.esnext +9 -10
  91. package/build/esnext/package.esnext +7 -14
  92. package/build/esnext/server.esnext +1 -2
  93. package/build/esnext/shared/prompts.esnext +3 -6
  94. package/build/esnext/shared.esnext +3 -6
  95. package/package.json +1 -1
  96. package/templates/app-empty/tsconfig.json +2 -1
  97. package/templates/app-graphql/tsconfig.json +2 -1
  98. package/templates/app-trpc/tsconfig.json +2 -1
  99. package/templates/workspace/package.json +2 -2
@@ -6,8 +6,7 @@ import { __require as requireUtil } from '../util/index.esnext';
6
6
  var autocomplete;
7
7
  var hasRequiredAutocomplete;
8
8
  function requireAutocomplete() {
9
- if (hasRequiredAutocomplete)
10
- return autocomplete;
9
+ if (hasRequiredAutocomplete) return autocomplete;
11
10
  hasRequiredAutocomplete = 1;
12
11
  const color = requireKleur();
13
12
  const Prompt = requirePrompt();
@@ -57,15 +56,13 @@ function requireAutocomplete() {
57
56
  this.select = i;
58
57
  if (this.suggestions.length > 0)
59
58
  this.value = getVal(this.suggestions, i);
60
- else
61
- this.value = this.fallback.value;
59
+ else this.value = this.fallback.value;
62
60
  this.fire();
63
61
  }
64
62
  async complete(cb) {
65
63
  const p = this.completing = this.suggest(this.input, this.choices);
66
64
  const suggestions = await p;
67
- if (this.completing !== p)
68
- return;
65
+ if (this.completing !== p) return;
69
66
  this.suggestions = suggestions.map((s, i, arr) => ({ title: getTitle(arr, i), value: getVal(arr, i), description: s.description }));
70
67
  this.completing = false;
71
68
  const l = Math.max(suggestions.length - 1, 0);
@@ -117,8 +114,7 @@ function requireAutocomplete() {
117
114
  this.render();
118
115
  }
119
116
  delete() {
120
- if (this.cursor === 0)
121
- return this.bell();
117
+ if (this.cursor === 0) return this.bell();
122
118
  let s1 = this.input.slice(0, this.cursor - 1);
123
119
  let s2 = this.input.slice(this.cursor);
124
120
  this.input = `${s1}${s2}`;
@@ -127,8 +123,7 @@ function requireAutocomplete() {
127
123
  this.render();
128
124
  }
129
125
  deleteForward() {
130
- if (this.cursor * this.scale >= this.rendered.length)
131
- return this.bell();
126
+ if (this.cursor * this.scale >= this.rendered.length) return this.bell();
132
127
  let s1 = this.input.slice(0, this.cursor);
133
128
  let s2 = this.input.slice(this.cursor + 1);
134
129
  this.input = `${s1}${s2}`;
@@ -162,8 +157,7 @@ function requireAutocomplete() {
162
157
  next() {
163
158
  if (this.select === this.suggestions.length - 1) {
164
159
  this.moveSelect(0);
165
- } else
166
- this.moveSelect(this.select + 1);
160
+ } else this.moveSelect(this.select + 1);
167
161
  this.render();
168
162
  }
169
163
  nextPage() {
@@ -175,14 +169,12 @@ function requireAutocomplete() {
175
169
  this.render();
176
170
  }
177
171
  left() {
178
- if (this.cursor <= 0)
179
- return this.bell();
172
+ if (this.cursor <= 0) return this.bell();
180
173
  this.cursor = this.cursor - 1;
181
174
  this.render();
182
175
  }
183
176
  right() {
184
- if (this.cursor * this.scale >= this.rendered.length)
185
- return this.bell();
177
+ if (this.cursor * this.scale >= this.rendered.length) return this.bell();
186
178
  this.cursor = this.cursor + 1;
187
179
  this.render();
188
180
  }
@@ -200,12 +192,9 @@ function requireAutocomplete() {
200
192
  return prefix + " " + title + color.gray(desc || "");
201
193
  }
202
194
  render() {
203
- if (this.closed)
204
- return;
205
- if (this.firstRender)
206
- this.out.write(cursor.hide);
207
- else
208
- this.out.write(clear(this.outputText, this.out.columns));
195
+ if (this.closed) return;
196
+ if (this.firstRender) this.out.write(cursor.hide);
197
+ else this.out.write(clear(this.outputText, this.out.columns));
209
198
  super.render();
210
199
  let { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit);
211
200
  this.outputText = [
@@ -6,8 +6,7 @@ import { __require as requireUtil } from '../util/index.esnext';
6
6
  var autocompleteMultiselect;
7
7
  var hasRequiredAutocompleteMultiselect;
8
8
  function requireAutocompleteMultiselect() {
9
- if (hasRequiredAutocompleteMultiselect)
10
- return autocompleteMultiselect;
9
+ if (hasRequiredAutocompleteMultiselect) return autocompleteMultiselect;
11
10
  hasRequiredAutocompleteMultiselect = 1;
12
11
  const color = requireKleur();
13
12
  const { cursor } = requireSrc();
@@ -51,8 +50,7 @@ function requireAutocompleteMultiselect() {
51
50
  this.render();
52
51
  }
53
52
  right() {
54
- if (this.value.filter((e) => e.selected).length >= this.maxChoices)
55
- return this.bell();
53
+ if (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell();
56
54
  this.filteredOptions[this.cursor].selected = true;
57
55
  this.render();
58
56
  }
@@ -129,10 +127,8 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
129
127
  }
130
128
  renderOption(cursor2, v, i) {
131
129
  let title;
132
- if (v.disabled)
133
- title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
134
- else
135
- title = cursor2 === i ? color.cyan().underline(v.title) : v.title;
130
+ if (v.disabled) title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
131
+ else title = cursor2 === i ? color.cyan().underline(v.title) : v.title;
136
132
  return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + title;
137
133
  }
138
134
  renderDoneOrInstructions() {
@@ -146,10 +142,8 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
146
142
  return output.join(" ");
147
143
  }
148
144
  render() {
149
- if (this.closed)
150
- return;
151
- if (this.firstRender)
152
- this.out.write(cursor.hide);
145
+ if (this.closed) return;
146
+ if (this.firstRender) this.out.write(cursor.hide);
153
147
  super.render();
154
148
  let prompt = [
155
149
  style.symbol(this.done, this.aborted),
@@ -6,8 +6,7 @@ import { __require as requireSrc } from '../../../../../sisteransi@1.0.5/node_mo
6
6
  var confirm;
7
7
  var hasRequiredConfirm;
8
8
  function requireConfirm() {
9
- if (hasRequiredConfirm)
10
- return confirm;
9
+ if (hasRequiredConfirm) return confirm;
11
10
  hasRequiredConfirm = 1;
12
11
  const color = requireKleur();
13
12
  const Prompt = requirePrompt();
@@ -61,12 +60,9 @@ function requireConfirm() {
61
60
  return this.bell();
62
61
  }
63
62
  render() {
64
- if (this.closed)
65
- return;
66
- if (this.firstRender)
67
- this.out.write(cursor.hide);
68
- else
69
- this.out.write(clear(this.outputText, this.out.columns));
63
+ if (this.closed) return;
64
+ if (this.firstRender) this.out.write(cursor.hide);
65
+ else this.out.write(clear(this.outputText, this.out.columns));
70
66
  super.render();
71
67
  this.outputText = [
72
68
  style.symbol(this.done, this.aborted),
@@ -7,8 +7,7 @@ import { __require as requireDateparts } from '../dateparts/index.esnext';
7
7
  var date;
8
8
  var hasRequiredDate;
9
9
  function requireDate() {
10
- if (hasRequiredDate)
11
- return date;
10
+ if (hasRequiredDate) return date;
12
11
  hasRequiredDate = 1;
13
12
  const color = requireKleur();
14
13
  const Prompt = requirePrompt();
@@ -62,8 +61,7 @@ function requireDate() {
62
61
  return this._date;
63
62
  }
64
63
  set date(date2) {
65
- if (date2)
66
- this._date.setTime(date2.getTime());
64
+ if (date2) this._date.setTime(date2.getTime());
67
65
  }
68
66
  set mask(mask) {
69
67
  let result;
@@ -76,8 +74,7 @@ function requireDate() {
76
74
  let parts = this.parts.reduce((arr, i) => {
77
75
  if (typeof i === "string" && typeof arr[arr.length - 1] === "string")
78
76
  arr[arr.length - 1] += i;
79
- else
80
- arr.push(i);
77
+ else arr.push(i);
81
78
  return arr;
82
79
  }, []);
83
80
  this.parts.splice(0);
@@ -140,15 +137,13 @@ function requireDate() {
140
137
  }
141
138
  left() {
142
139
  let prev = this.parts[this.cursor].prev();
143
- if (prev == null)
144
- return this.bell();
140
+ if (prev == null) return this.bell();
145
141
  this.moveCursor(this.parts.indexOf(prev));
146
142
  this.render();
147
143
  }
148
144
  right() {
149
145
  let next = this.parts[this.cursor].next();
150
- if (next == null)
151
- return this.bell();
146
+ if (next == null) return this.bell();
152
147
  this.moveCursor(this.parts.indexOf(next));
153
148
  this.render();
154
149
  }
@@ -165,12 +160,9 @@ function requireDate() {
165
160
  }
166
161
  }
167
162
  render() {
168
- if (this.closed)
169
- return;
170
- if (this.firstRender)
171
- this.out.write(cursor.hide);
172
- else
173
- this.out.write(clear(this.outputText, this.out.columns));
163
+ if (this.closed) return;
164
+ if (this.firstRender) this.out.write(cursor.hide);
165
+ else this.out.write(clear(this.outputText, this.out.columns));
174
166
  super.render();
175
167
  this.outputText = [
176
168
  style.symbol(this.done, this.aborted),
@@ -11,8 +11,7 @@ import { __require as requireConfirm } from './confirm.esnext';
11
11
  var elements;
12
12
  var hasRequiredElements;
13
13
  function requireElements() {
14
- if (hasRequiredElements)
15
- return elements;
14
+ if (hasRequiredElements) return elements;
16
15
  hasRequiredElements = 1;
17
16
  elements = {
18
17
  TextPrompt: requireText(),
@@ -6,8 +6,7 @@ import { __require as requireUtil } from '../util/index.esnext';
6
6
  var multiselect;
7
7
  var hasRequiredMultiselect;
8
8
  function requireMultiselect() {
9
- if (hasRequiredMultiselect)
10
- return multiselect;
9
+ if (hasRequiredMultiselect) return multiselect;
11
10
  hasRequiredMultiselect = 1;
12
11
  const color = requireKleur();
13
12
  const { cursor } = requireSrc();
@@ -108,8 +107,7 @@ function requireMultiselect() {
108
107
  this.render();
109
108
  }
110
109
  right() {
111
- if (this.value.filter((e) => e.selected).length >= this.maxChoices)
112
- return this.bell();
110
+ if (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell();
113
111
  this.value[this.cursor].selected = true;
114
112
  this.render();
115
113
  }
@@ -209,10 +207,8 @@ Instructions:
209
207
  return output.join(" ");
210
208
  }
211
209
  render() {
212
- if (this.closed)
213
- return;
214
- if (this.firstRender)
215
- this.out.write(cursor.hide);
210
+ if (this.closed) return;
211
+ if (this.firstRender) this.out.write(cursor.hide);
216
212
  super.render();
217
213
  let prompt = [
218
214
  style.symbol(this.done, this.aborted),
@@ -6,8 +6,7 @@ import { __require as requireUtil } from '../util/index.esnext';
6
6
  var number;
7
7
  var hasRequiredNumber;
8
8
  function requireNumber() {
9
- if (hasRequiredNumber)
10
- return number;
9
+ if (hasRequiredNumber) return number;
11
10
  hasRequiredNumber = 1;
12
11
  const color = requireKleur();
13
12
  const Prompt = requirePrompt();
@@ -111,8 +110,7 @@ function requireNumber() {
111
110
  if (this.value === "") {
112
111
  this.value = this.min - this.inc;
113
112
  }
114
- if (this.value >= this.max)
115
- return this.bell();
113
+ if (this.value >= this.max) return this.bell();
116
114
  this.value += this.inc;
117
115
  this.color = `cyan`;
118
116
  this.fire();
@@ -123,8 +121,7 @@ function requireNumber() {
123
121
  if (this.value === "") {
124
122
  this.value = this.min + this.inc;
125
123
  }
126
- if (this.value <= this.min)
127
- return this.bell();
124
+ if (this.value <= this.min) return this.bell();
128
125
  this.value -= this.inc;
129
126
  this.color = `cyan`;
130
127
  this.fire();
@@ -132,8 +129,7 @@ function requireNumber() {
132
129
  }
133
130
  delete() {
134
131
  let val = this.value.toString();
135
- if (val.length === 0)
136
- return this.bell();
132
+ if (val.length === 0) return this.bell();
137
133
  this.value = this.parse(val = val.slice(0, -1)) || ``;
138
134
  if (this.value !== "" && this.value < this.min) {
139
135
  this.value = this.min;
@@ -148,27 +144,21 @@ function requireNumber() {
148
144
  this.render();
149
145
  }
150
146
  _(c, key) {
151
- if (!this.valid(c))
152
- return this.bell();
147
+ if (!this.valid(c)) return this.bell();
153
148
  const now = Date.now();
154
- if (now - this.lastHit > 1e3)
155
- this.typed = ``;
149
+ if (now - this.lastHit > 1e3) this.typed = ``;
156
150
  this.typed += c;
157
151
  this.lastHit = now;
158
152
  this.color = `cyan`;
159
- if (c === `.`)
160
- return this.fire();
153
+ if (c === `.`) return this.fire();
161
154
  this.value = Math.min(this.parse(this.typed), this.max);
162
- if (this.value > this.max)
163
- this.value = this.max;
164
- if (this.value < this.min)
165
- this.value = this.min;
155
+ if (this.value > this.max) this.value = this.max;
156
+ if (this.value < this.min) this.value = this.min;
166
157
  this.fire();
167
158
  this.render();
168
159
  }
169
160
  render() {
170
- if (this.closed)
171
- return;
161
+ if (this.closed) return;
172
162
  if (!this.firstRender) {
173
163
  if (this.outputError)
174
164
  this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
@@ -7,8 +7,7 @@ import { __require as requireKleur } from '../../../../../kleur@3.0.3/node_modul
7
7
  var prompt;
8
8
  var hasRequiredPrompt;
9
9
  function requirePrompt() {
10
- if (hasRequiredPrompt)
11
- return prompt;
10
+ if (hasRequiredPrompt) return prompt;
12
11
  hasRequiredPrompt = 1;
13
12
  const readline = require$$0;
14
13
  const { action } = requireUtil();
@@ -24,8 +23,7 @@ function requirePrompt() {
24
23
  this.onRender = (opts.onRender || (() => void 0)).bind(this);
25
24
  const rl = readline.createInterface({ input: this.in, escapeCodeTimeout: 50 });
26
25
  readline.emitKeypressEvents(this.in, rl);
27
- if (this.in.isTTY)
28
- this.in.setRawMode(true);
26
+ if (this.in.isTTY) this.in.setRawMode(true);
29
27
  const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
30
28
  const keypress = (str, key) => {
31
29
  let a = action(key, isSelect);
@@ -40,8 +38,7 @@ function requirePrompt() {
40
38
  this.close = () => {
41
39
  this.out.write(cursor.show);
42
40
  this.in.removeListener("keypress", keypress);
43
- if (this.in.isTTY)
44
- this.in.setRawMode(false);
41
+ if (this.in.isTTY) this.in.setRawMode(false);
45
42
  rl.close();
46
43
  this.emit(this.aborted ? "abort" : this.exited ? "exit" : "submit", this.value);
47
44
  this.closed = true;
@@ -60,8 +57,7 @@ function requirePrompt() {
60
57
  }
61
58
  render() {
62
59
  this.onRender(color);
63
- if (this.firstRender)
64
- this.firstRender = false;
60
+ if (this.firstRender) this.firstRender = false;
65
61
  }
66
62
  }
67
63
  prompt = Prompt;
@@ -6,8 +6,7 @@ import { __require as requireSrc } from '../../../../../sisteransi@1.0.5/node_mo
6
6
  var select;
7
7
  var hasRequiredSelect;
8
8
  function requireSelect() {
9
- if (hasRequiredSelect)
10
- return select;
9
+ if (hasRequiredSelect) return select;
11
10
  hasRequiredSelect = 1;
12
11
  const color = requireKleur();
13
12
  const Prompt = requirePrompt();
@@ -96,19 +95,15 @@ function requireSelect() {
96
95
  this.render();
97
96
  }
98
97
  _(c, key) {
99
- if (c === " ")
100
- return this.submit();
98
+ if (c === " ") return this.submit();
101
99
  }
102
100
  get selection() {
103
101
  return this.choices[this.cursor];
104
102
  }
105
103
  render() {
106
- if (this.closed)
107
- return;
108
- if (this.firstRender)
109
- this.out.write(cursor.hide);
110
- else
111
- this.out.write(clear(this.outputText, this.out.columns));
104
+ if (this.closed) return;
105
+ if (this.firstRender) this.out.write(cursor.hide);
106
+ else this.out.write(clear(this.outputText, this.out.columns));
112
107
  super.render();
113
108
  let { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage);
114
109
  this.outputText = [
@@ -6,8 +6,7 @@ import { __require as requireUtil } from '../util/index.esnext';
6
6
  var text;
7
7
  var hasRequiredText;
8
8
  function requireText() {
9
- if (hasRequiredText)
10
- return text;
9
+ if (hasRequiredText) return text;
11
10
  hasRequiredText = 1;
12
11
  const color = requireKleur();
13
12
  const Prompt = requirePrompt();
@@ -89,16 +88,14 @@ function requireText() {
89
88
  this.close();
90
89
  }
91
90
  next() {
92
- if (!this.placeholder)
93
- return this.bell();
91
+ if (!this.placeholder) return this.bell();
94
92
  this.value = this.initial;
95
93
  this.cursor = this.rendered.length;
96
94
  this.fire();
97
95
  this.render();
98
96
  }
99
97
  moveCursor(n) {
100
- if (this.placeholder)
101
- return;
98
+ if (this.placeholder) return;
102
99
  this.cursor = this.cursor + n;
103
100
  this.cursorOffset += n;
104
101
  }
@@ -111,8 +108,7 @@ function requireText() {
111
108
  this.render();
112
109
  }
113
110
  delete() {
114
- if (this.isCursorAtStart())
115
- return this.bell();
111
+ if (this.isCursorAtStart()) return this.bell();
116
112
  let s1 = this.value.slice(0, this.cursor - 1);
117
113
  let s2 = this.value.slice(this.cursor);
118
114
  this.value = `${s1}${s2}`;
@@ -126,8 +122,7 @@ function requireText() {
126
122
  this.render();
127
123
  }
128
124
  deleteForward() {
129
- if (this.cursor * this.scale >= this.rendered.length || this.placeholder)
130
- return this.bell();
125
+ if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();
131
126
  let s1 = this.value.slice(0, this.cursor);
132
127
  let s2 = this.value.slice(this.cursor + 1);
133
128
  this.value = `${s1}${s2}`;
@@ -148,14 +143,12 @@ function requireText() {
148
143
  this.render();
149
144
  }
150
145
  left() {
151
- if (this.cursor <= 0 || this.placeholder)
152
- return this.bell();
146
+ if (this.cursor <= 0 || this.placeholder) return this.bell();
153
147
  this.moveCursor(-1);
154
148
  this.render();
155
149
  }
156
150
  right() {
157
- if (this.cursor * this.scale >= this.rendered.length || this.placeholder)
158
- return this.bell();
151
+ if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();
159
152
  this.moveCursor(1);
160
153
  this.render();
161
154
  }
@@ -166,8 +159,7 @@ function requireText() {
166
159
  return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1;
167
160
  }
168
161
  render() {
169
- if (this.closed)
170
- return;
162
+ if (this.closed) return;
171
163
  if (!this.firstRender) {
172
164
  if (this.outputError)
173
165
  this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
@@ -6,8 +6,7 @@ import { __require as requireSrc } from '../../../../../sisteransi@1.0.5/node_mo
6
6
  var toggle;
7
7
  var hasRequiredToggle;
8
8
  function requireToggle() {
9
- if (hasRequiredToggle)
10
- return toggle;
9
+ if (hasRequiredToggle) return toggle;
11
10
  hasRequiredToggle = 1;
12
11
  const color = requireKleur();
13
12
  const Prompt = requirePrompt();
@@ -47,14 +46,12 @@ function requireToggle() {
47
46
  this.close();
48
47
  }
49
48
  deactivate() {
50
- if (this.value === false)
51
- return this.bell();
49
+ if (this.value === false) return this.bell();
52
50
  this.value = false;
53
51
  this.render();
54
52
  }
55
53
  activate() {
56
- if (this.value === true)
57
- return this.bell();
54
+ if (this.value === true) return this.bell();
58
55
  this.value = true;
59
56
  this.render();
60
57
  }
@@ -85,17 +82,13 @@ function requireToggle() {
85
82
  this.value = true;
86
83
  } else if (c === "0") {
87
84
  this.value = false;
88
- } else
89
- return this.bell();
85
+ } else return this.bell();
90
86
  this.render();
91
87
  }
92
88
  render() {
93
- if (this.closed)
94
- return;
95
- if (this.firstRender)
96
- this.out.write(cursor.hide);
97
- else
98
- this.out.write(clear(this.outputText, this.out.columns));
89
+ if (this.closed) return;
90
+ if (this.firstRender) this.out.write(cursor.hide);
91
+ else this.out.write(clear(this.outputText, this.out.columns));
99
92
  super.render();
100
93
  this.outputText = [
101
94
  style.symbol(this.done, this.aborted),
@@ -3,8 +3,7 @@ import { __require as requirePrompts } from './prompts.esnext';
3
3
  var lib;
4
4
  var hasRequiredLib;
5
5
  function requireLib() {
6
- if (hasRequiredLib)
7
- return lib;
6
+ if (hasRequiredLib) return lib;
8
7
  hasRequiredLib = 1;
9
8
  const prompts = requirePrompts();
10
9
  const passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
@@ -27,11 +26,9 @@ function requireLib() {
27
26
  type = await type(answer, { ...answers }, question);
28
27
  question["type"] = type;
29
28
  }
30
- if (!type)
31
- continue;
29
+ if (!type) continue;
32
30
  for (let key in question) {
33
- if (passOn.includes(key))
34
- continue;
31
+ if (passOn.includes(key)) continue;
35
32
  let value = question[key];
36
33
  question[key] = typeof value === "function" ? await value(answer, { ...answers }, lastPrompt) : value;
37
34
  }
@@ -57,8 +54,7 @@ function requireLib() {
57
54
  } catch (err) {
58
55
  quit = !await onCancel(question, answers);
59
56
  }
60
- if (quit)
61
- return answers;
57
+ if (quit) return answers;
62
58
  }
63
59
  return answers;
64
60
  }
@@ -3,8 +3,7 @@ import { __require as requireElements } from './elements/index.esnext';
3
3
 
4
4
  var hasRequiredPrompts;
5
5
  function requirePrompts() {
6
- if (hasRequiredPrompts)
7
- return prompts;
6
+ if (hasRequiredPrompts) return prompts;
8
7
  hasRequiredPrompts = 1;
9
8
  (function(exports) {
10
9
  const $ = exports;
@@ -1,60 +1,36 @@
1
1
  var action;
2
2
  var hasRequiredAction;
3
3
  function requireAction() {
4
- if (hasRequiredAction)
5
- return action;
4
+ if (hasRequiredAction) return action;
6
5
  hasRequiredAction = 1;
7
6
  action = (key, isSelect) => {
8
- if (key.meta && key.name !== "escape")
9
- return;
7
+ if (key.meta && key.name !== "escape") return;
10
8
  if (key.ctrl) {
11
- if (key.name === "a")
12
- return "first";
13
- if (key.name === "c")
14
- return "abort";
15
- if (key.name === "d")
16
- return "abort";
17
- if (key.name === "e")
18
- return "last";
19
- if (key.name === "g")
20
- return "reset";
9
+ if (key.name === "a") return "first";
10
+ if (key.name === "c") return "abort";
11
+ if (key.name === "d") return "abort";
12
+ if (key.name === "e") return "last";
13
+ if (key.name === "g") return "reset";
21
14
  }
22
15
  if (isSelect) {
23
- if (key.name === "j")
24
- return "down";
25
- if (key.name === "k")
26
- return "up";
16
+ if (key.name === "j") return "down";
17
+ if (key.name === "k") return "up";
27
18
  }
28
- if (key.name === "return")
29
- return "submit";
30
- if (key.name === "enter")
31
- return "submit";
32
- if (key.name === "backspace")
33
- return "delete";
34
- if (key.name === "delete")
35
- return "deleteForward";
36
- if (key.name === "abort")
37
- return "abort";
38
- if (key.name === "escape")
39
- return "exit";
40
- if (key.name === "tab")
41
- return "next";
42
- if (key.name === "pagedown")
43
- return "nextPage";
44
- if (key.name === "pageup")
45
- return "prevPage";
46
- if (key.name === "home")
47
- return "home";
48
- if (key.name === "end")
49
- return "end";
50
- if (key.name === "up")
51
- return "up";
52
- if (key.name === "down")
53
- return "down";
54
- if (key.name === "right")
55
- return "right";
56
- if (key.name === "left")
57
- return "left";
19
+ if (key.name === "return") return "submit";
20
+ if (key.name === "enter") return "submit";
21
+ if (key.name === "backspace") return "delete";
22
+ if (key.name === "delete") return "deleteForward";
23
+ if (key.name === "abort") return "abort";
24
+ if (key.name === "escape") return "exit";
25
+ if (key.name === "tab") return "next";
26
+ if (key.name === "pagedown") return "nextPage";
27
+ if (key.name === "pageup") return "prevPage";
28
+ if (key.name === "home") return "home";
29
+ if (key.name === "end") return "end";
30
+ if (key.name === "up") return "up";
31
+ if (key.name === "down") return "down";
32
+ if (key.name === "right") return "right";
33
+ if (key.name === "left") return "left";
58
34
  return false;
59
35
  };
60
36
  return action;