spyne-cli 0.6.8 → 0.7.0

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 (93) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +80 -30
  3. package/index.js +123 -21
  4. package/package.json +24 -6
  5. package/src/cli/args.js +197 -0
  6. package/src/cli/render.js +184 -0
  7. package/src/core/create-app.js +232 -0
  8. package/src/core/generate-module.js +146 -0
  9. package/src/registry.js +174 -0
  10. package/src/spyne-file-prompt.js +77 -30
  11. package/src/templates/generate-prompt-input-fields.js +1 -1
  12. package/src/ui.js +5 -1
  13. package/lib/ansi.js +0 -116
  14. package/lib/combos.js +0 -75
  15. package/lib/completer.js +0 -52
  16. package/lib/interpolate.js +0 -266
  17. package/lib/keypress.js +0 -243
  18. package/lib/placeholder.js +0 -63
  19. package/lib/prompt.js +0 -485
  20. package/lib/prompts/autocomplete.js +0 -113
  21. package/lib/prompts/basicauth.js +0 -41
  22. package/lib/prompts/confirm.js +0 -13
  23. package/lib/prompts/editable.js +0 -136
  24. package/lib/prompts/form.js +0 -196
  25. package/lib/prompts/index.js +0 -28
  26. package/lib/prompts/input.js +0 -55
  27. package/lib/prompts/invisible.js +0 -11
  28. package/lib/prompts/list.js +0 -36
  29. package/lib/prompts/multiselect.js +0 -11
  30. package/lib/prompts/numeral.js +0 -1
  31. package/lib/prompts/password.js +0 -18
  32. package/lib/prompts/quiz.js +0 -37
  33. package/lib/prompts/scale.js +0 -237
  34. package/lib/prompts/select.js +0 -139
  35. package/lib/prompts/snippet.js +0 -185
  36. package/lib/prompts/sort.js +0 -37
  37. package/lib/prompts/survey.js +0 -163
  38. package/lib/prompts/text.js +0 -1
  39. package/lib/prompts/toggle.js +0 -109
  40. package/lib/render.js +0 -33
  41. package/lib/roles.js +0 -46
  42. package/lib/state.js +0 -69
  43. package/lib/styles.js +0 -144
  44. package/lib/symbols.js +0 -66
  45. package/lib/theme.js +0 -11
  46. package/lib/timer.js +0 -38
  47. package/lib/types/array.js +0 -658
  48. package/lib/types/auth.js +0 -29
  49. package/lib/types/boolean.js +0 -88
  50. package/lib/types/index.js +0 -7
  51. package/lib/types/number.js +0 -86
  52. package/lib/types/string.js +0 -185
  53. package/lib/utils.js +0 -268
  54. package/mocha.conf.cjs +0 -16
  55. package/src/app/channels/.gitkeep +0 -0
  56. package/src/app/channels/channel-custom.js +0 -1
  57. package/src/app/components/.gitkeep +0 -0
  58. package/src/app/traits/.gitkeep +0 -0
  59. package/src/hello-world-app-source/README.md +0 -15
  60. package/src/hello-world-app-source/apache-htaccess +0 -20
  61. package/src/hello-world-app-source/karma.conf.js +0 -75
  62. package/src/hello-world-app-source/package.json +0 -50
  63. package/src/hello-world-app-source/src/app/app-view.js +0 -38
  64. package/src/hello-world-app-source/src/app/channels/.gitkeep +0 -0
  65. package/src/hello-world-app-source/src/app/components/.gitkeep +0 -0
  66. package/src/hello-world-app-source/src/app/traits/.gitkeep +0 -0
  67. package/src/hello-world-app-source/src/index.js +0 -16
  68. package/src/hello-world-app-source/src/index.tmpl.html +0 -12
  69. package/src/hello-world-app-source/src/scss/01-vendors/normalize.css +0 -349
  70. package/src/hello-world-app-source/src/scss/02-variables/mixins.scss +0 -0
  71. package/src/hello-world-app-source/src/scss/03-components/.gitkeep +0 -0
  72. package/src/hello-world-app-source/src/scss/main.scss +0 -15
  73. package/src/hello-world-app-source/src/static/data/.gitkeep +0 -0
  74. package/src/hello-world-app-source/src/static/fonts/.gitkeep +0 -0
  75. package/src/hello-world-app-source/src/static/imgs/.gitkeep +0 -0
  76. package/src/hello-world-app-source/src/tests/unit-tests/index.test.js +0 -10
  77. package/src/hello-world-app-source/webpack.config.js +0 -178
  78. package/src/spyne-app-create.js +0 -209
  79. package/src/spyne-app-creator.js +0 -119
  80. package/src/spyne-starter-app-create.js +0 -147
  81. package/tests/create-spyne-app.test.js +0 -63
  82. package/tests/generate-file-prompt.test.js +0 -45
  83. package/tests/generate-file-string.test.js +0 -66
  84. package/tests/generate-prompt-input-fields-methods.test.js +0 -177
  85. package/tests/generate-prompt-input-fields.test.js +0 -179
  86. package/tests/generate-prompt-input-object.test.js +0 -39
  87. package/tests/generate-prompt-output.test.js +0 -58
  88. package/tests/index.test.js +0 -11
  89. package/tests/mocks/answers.js +0 -33
  90. package/tests/mocks/answers.json +0 -33
  91. package/tests/mocks/enquirer-data.js +0 -411
  92. package/tests/mocks/enquirer-data.json +0 -409
  93. package/tests/utils/file-utils.test.js +0 -84
@@ -1,33 +0,0 @@
1
- const AnswersData = {
2
- "answersArr": [
3
- {
4
- "fileName": "my-ui-el-view.js",
5
- "className": "MyUiElView",
6
- "fileDirectory": "./src/app/components/",
7
- "fileType": "ViewStream"
8
- },
9
- {
10
- "fileName": "my-dom-element.js",
11
- "className": "MyDomElement",
12
- "fileDirectory": "./src/app/components/",
13
- "fileType": "DomElement"
14
- },
15
- {
16
- "fileName": "channel-custom.js",
17
- "className": "ChannelCustom",
18
- "channelName": "CHANNEL_CUSTOM",
19
- "replayLastPayload": false,
20
- "fileDirectory": "./src/app/channels/",
21
- "fileType": "Channel"
22
- },
23
- {
24
- "fileName": "my-custom-trait.js",
25
- "className": "MyCustomTrait",
26
- "methodPrefix": "myCustom$",
27
- "fileDirectory": "./src/app/traits/",
28
- "fileType": "SpyneTrait"
29
- }
30
- ]
31
- }
32
-
33
- export {AnswersData}
@@ -1,411 +0,0 @@
1
- const MockData = {
2
- "_events": {
3
- "submit": [
4
- null,
5
- null
6
- ]
7
- },
8
- "_eventsCount": 2,
9
- "_maxListeners": 0,
10
- "name": "vsClassName",
11
- "enquirer": {
12
- "_events": {},
13
- "_eventsCount": 0,
14
- "options": {},
15
- "answers": {
16
- "fileName": "my-viewstream-view.js",
17
- "className": "MyViewStream",
18
-
19
- "fileDirectory": "./src/templates/components/"
20
- }
21
- },
22
- "type": "input",
23
- "options": {
24
- "type": "input",
25
- "name": "vsClassName",
26
- "message": "\u001B[94mwhat is the viewstream class name?\u001B[39m"
27
- },
28
- "symbols": {
29
- "ballotDisabled": "",
30
- "ballotOff": "",
31
- "ballotOn": "",
32
- "bullet": "",
33
- "bulletWhite": "",
34
- "fullBlock": "",
35
- "heart": "",
36
- "identicalTo": "",
37
- "line": "",
38
- "mark": "",
39
- "middot": "",
40
- "minus": "",
41
- "multiplication": "",
42
- "obelus": "",
43
- "pencilDownRight": "",
44
- "pencilRight": "",
45
- "pencilUpRight": "",
46
- "percent": "%",
47
- "pilcrow2": "",
48
- "pilcrow": "",
49
- "plusMinus": "",
50
- "section": "",
51
- "starsOff": "",
52
- "starsOn": "",
53
- "upDownArrow": "",
54
- "ballotCross": "",
55
- "check": "",
56
- "cross": "",
57
- "ellipsisLarge": "",
58
- "ellipsis": "",
59
- "info": "",
60
- "question": "?",
61
- "questionFull": "",
62
- "questionSmall": "",
63
- "pointer": "",
64
- "pointerSmall": "",
65
- "radioOff": "",
66
- "radioOn": "",
67
- "warning": "",
68
- "upDownDoubleArrow": "",
69
- "upDownDoubleArrow2": "",
70
- "asterisk": "*",
71
- "asterism": "",
72
- "electricArrow": "",
73
- "ellipsisSmall": "",
74
- "indicator": "",
75
- "leftAngle": "",
76
- "plus": "+",
77
- "pointRight": "",
78
- "rightAngle": "",
79
- "hexagon": {
80
- "off": "",
81
- "on": "",
82
- "disabled": ""
83
- },
84
- "ballot": {
85
- "on": "",
86
- "off": "",
87
- "disabled": ""
88
- },
89
- "stars": {
90
- "on": "",
91
- "off": "",
92
- "disabled": ""
93
- },
94
- "folder": {
95
- "on": "",
96
- "off": "",
97
- "disabled": ""
98
- },
99
- "prefix": {
100
- "pending": "?",
101
- "submitted": "",
102
- "cancelled": ""
103
- },
104
- "separator": {
105
- "pending": "",
106
- "submitted": "",
107
- "cancelled": ""
108
- },
109
- "radio": {
110
- "off": "",
111
- "on": "",
112
- "disabled": ""
113
- },
114
- "timers": {},
115
- "state": {
116
- "type": "input",
117
- "name": "vsClassName",
118
- "message": "\u001B[94mwhat is the viewstream class name?\u001B[39m",
119
- "header": "",
120
- "footer": "",
121
- "error": "",
122
- "hint": "",
123
- "input": "",
124
- "cursor": 0,
125
- "index": 0,
126
- "lines": 0,
127
- "tick": 0,
128
- "prompt": "",
129
- "buffer": "",
130
- "width": 328,
131
- "symbols": {
132
- "ballotDisabled": "",
133
- "ballotOff": "",
134
- "ballotOn": "",
135
- "bullet": "",
136
- "bulletWhite": "",
137
- "fullBlock": "",
138
- "heart": "",
139
- "identicalTo": "",
140
- "line": "",
141
- "mark": "",
142
- "middot": "",
143
- "minus": "",
144
- "multiplication": "",
145
- "obelus": "",
146
- "pencilDownRight": "",
147
- "pencilRight": "",
148
- "pencilUpRight": "",
149
- "percent": "%",
150
- "pilcrow2": "",
151
- "pilcrow": "",
152
- "plusMinus": "",
153
- "section": "",
154
- "starsOff": "",
155
- "starsOn": "",
156
- "upDownArrow": "",
157
- "ballotCross": "",
158
- "check": "",
159
- "cross": "",
160
- "ellipsisLarge": "",
161
- "ellipsis": "",
162
- "info": "",
163
- "question": "?",
164
- "questionFull": "",
165
- "questionSmall": "",
166
- "pointer": "",
167
- "pointerSmall": "",
168
- "radioOff": "",
169
- "radioOn": "",
170
- "warning": "",
171
- "upDownDoubleArrow": "",
172
- "upDownDoubleArrow2": "",
173
- "asterisk": "*",
174
- "asterism": "",
175
- "electricArrow": "",
176
- "eipsisSmall": "",
177
- "indicator": "",
178
- "leftAngle": "",
179
- "plus": "+",
180
- "pointRight": "",
181
- "rightAngle": "",
182
- "hexagon": {
183
- "off": "",
184
- "on": "",
185
- "disabled": ""
186
- },
187
- "ballot": {
188
- "on": "",
189
- "off": "",
190
- "disabled": ""
191
- },
192
- "stars": {
193
- "on": "",
194
- "off": "",
195
- "disabled": ""
196
- },
197
- "folder": {
198
- "on": "",
199
- "off": "",
200
- "disabled": ""
201
- },
202
- "prefix": {
203
- "pending": "?",
204
- "submitted": "",
205
- "cancelled": ""
206
- },
207
- "separator": {
208
- "pending": "",
209
- "submitted": "",
210
- "cancelled": ""
211
- },
212
- "radio": {
213
- "off": "",
214
- "on": "",
215
- "disabled": ""
216
- },
217
- "required": {},
218
- "cancelled": false,
219
- "submitted": false,
220
- "prevCursor": 0,
221
- "clipboard": [],
222
- "answers": {
223
- "vsName": "adfdsfasdfads"
224
- }
225
- },
226
- "initial": "",
227
- "stdout": {
228
- "connecting": false,
229
- "_hadError": false,
230
- "_parent": null,
231
- "_host": null,
232
- "_readableState": {
233
- "objectMode": false,
234
- "highWaterMark": 16384,
235
- "buffer": {
236
- "head": null,
237
- "tail": null,
238
- "length": 0
239
- },
240
- "length": 0,
241
- "pipes": [],
242
- "flowing": null,
243
- "ended": false,
244
- "endEmitted": false,
245
- "reading": false,
246
- "sync": true,
247
- "needReadable": false,
248
- "emittedReadable": false,
249
- "readableListening": false,
250
- "resumeScheduled": false,
251
- "errorEmitted": false,
252
- "emitClose": false,
253
- "autoDestroy": false,
254
- "destroyed": false,
255
- "errored": null,
256
- "closed": false,
257
- "closeEmitted": false,
258
- "defaultEncoding": "utf8",
259
- "awaitDrainWriters": null,
260
- "multiAwaitDrain": false,
261
- "readingMore": false,
262
- "decoder": null,
263
- "encoding": null,
264
- "readable": false
265
- },
266
- "_events": {},
267
- "_eventsCount": 2,
268
- "_writableState": {
269
- "objectMode": false,
270
- "highWaterMark": 16384,
271
- "finalCalled": false,
272
- "needDrain": false,
273
- "ending": false,
274
- "ended": false,
275
- "finished": false,
276
- "destroyed": false,
277
- "decodeStrings": false,
278
- "defaultEncoding": "utf8",
279
- "length": 0,
280
- "writing": false,
281
- "corked": 0,
282
- "sync": false,
283
- "bufferProcessing": false,
284
- "writecb": null,
285
- "writelen": 0,
286
- "afterWriteTickInfo": {
287
- "count": 3,
288
- "stream": "[Circular ~.stdout]",
289
- "state": "[Circular ~.stdout._writableState]"
290
- },
291
- "buffered": [],
292
- "bufferedIndex": 0,
293
- "allBuffers": true,
294
- "allNoop": true,
295
- "pendingcb": 3,
296
- "prefinished": false,
297
- "errorEmitted": false,
298
- "emitClose": false,
299
- "autoDestroy": false,
300
- "errored": null,
301
- "closed": false,
302
- "closeEmitted": false
303
- },
304
- "allowHalfOpen": false,
305
- "_sockname": null,
306
- "_pendingData": null,
307
- "_pendingEncoding": "",
308
- "server": null,
309
- "_server": null,
310
- "columns": 328,
311
- "rows": 23,
312
- "_type": "tty",
313
- "fd": 1,
314
- "_isStdio": true
315
- },
316
- "stdin": {
317
- "connecting": false,
318
- "_hadError": false,
319
- "_parent": null,
320
- "_host": null,
321
- "_readableState": {
322
- "objectMode": false,
323
- "highWaterMark": 0,
324
- "buffer": {
325
- "head": null,
326
- "tail": null,
327
- "length": 0
328
- },
329
- "length": 0,
330
- "pipes": [],
331
- "flowing": false,
332
- "ended": false,
333
- "endEmitted": false,
334
- "reading": true,
335
- "sync": false,
336
- "needReadable": true,
337
- "emittedReadable": false,
338
- "readableListening": false,
339
- "resumeScheduled": false,
340
- "errorEmitted": false,
341
- "emitClose": false,
342
- "autoDestroy": false,
343
- "destroyed": false,
344
- "errored": null,
345
- "closed": false,
346
- "closeEmitted": false,
347
- "defaultEncoding": "utf8",
348
- "awaitDrainWriters": null,
349
- "multiAwaitDrain": false,
350
- "readingMore": false,
351
- "decoder": null,
352
- "encoding": null
353
- },
354
- "_events": {},
355
- "_eventsCount": 3,
356
- "_writableState": {
357
- "objectMode": false,
358
- "highWaterMark": 0,
359
- "finalCalled": false,
360
- "needDrain": false,
361
- "ending": false,
362
- "ended": false,
363
- "finished": false,
364
- "destroyed": false,
365
- "decodeStrings": false,
366
- "defaultEncoding": "utf8",
367
- "length": 0,
368
- "writing": false,
369
- "corked": 0,
370
- "sync": true,
371
- "bufferProcessing": false,
372
- "writecb": null,
373
- "writelen": 0,
374
- "afterWriteTickInfo": null,
375
- "buffered": [],
376
- "bufferedIndex": 0,
377
- "allBuffers": true,
378
- "allNoop": true,
379
- "pendingcb": 0,
380
- "prefinished": false,
381
- "errorEmitted": false,
382
- "emitClose": false,
383
- "autoDestroy": false,
384
- "errored": null,
385
- "closed": false,
386
- "writable": false,
387
- "closeEmitted": false
388
- },
389
- "allowHalfOpen": false,
390
- "_sockname": null,
391
- "_pendingData": null,
392
- "_pendingEncoding": "",
393
- "server": null,
394
- "_server": null,
395
- "isRaw": false,
396
- "isTTY": true,
397
- "fd": 0
398
- },
399
- "scale": 1,
400
- "margin": [
401
- "",
402
- "",
403
- "",
404
- ""
405
- ],
406
- "skipped": false
407
- }
408
- }
409
- }
410
-
411
- export {MockData}