@shopify/cli-kit 3.45.1 → 3.46.0-pre.1

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 (159) hide show
  1. package/assets/cli-ruby/Gemfile +0 -1
  2. package/assets/cli-ruby/Rakefile +0 -76
  3. package/assets/cli-ruby/lib/project_types/extension/cli.rb +5 -86
  4. package/assets/cli-ruby/lib/shopify_cli/admin_api.rb +0 -3
  5. package/assets/cli-ruby/lib/shopify_cli/command/sub_command.rb +1 -2
  6. package/assets/cli-ruby/lib/shopify_cli/command.rb +0 -7
  7. package/assets/cli-ruby/lib/shopify_cli/commands.rb +0 -15
  8. package/assets/cli-ruby/lib/shopify_cli/core.rb +0 -1
  9. package/assets/cli-ruby/lib/shopify_cli/identity_auth.rb +0 -1
  10. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/proxy.rb +9 -1
  11. package/assets/cli-ruby/lib/shopify_cli.rb +1 -10
  12. package/assets/cli-ruby/test/test_helpers.rb +0 -2
  13. package/dist/private/node/ui/components/ConcurrentOutput.js.map +1 -1
  14. package/dist/private/node/ui/components/ConcurrentOutput.test.js +2 -2
  15. package/dist/private/node/ui/components/ConcurrentOutput.test.js.map +1 -1
  16. package/dist/private/node/ui/components/List.d.ts +2 -0
  17. package/dist/private/node/ui/components/List.js +5 -4
  18. package/dist/private/node/ui/components/List.js.map +1 -1
  19. package/dist/private/node/ui/components/Prompts/InfoTable.d.ts +10 -2
  20. package/dist/private/node/ui/components/Prompts/InfoTable.js +12 -8
  21. package/dist/private/node/ui/components/Prompts/InfoTable.js.map +1 -1
  22. package/dist/public/common/string.js +62 -0
  23. package/dist/public/common/string.js.map +1 -1
  24. package/dist/public/common/version.d.ts +1 -1
  25. package/dist/public/common/version.js +1 -1
  26. package/dist/public/common/version.js.map +1 -1
  27. package/dist/public/node/cli.d.ts +1 -0
  28. package/dist/public/node/cli.js +15 -1
  29. package/dist/public/node/cli.js.map +1 -1
  30. package/dist/public/node/fs.d.ts +7 -2
  31. package/dist/public/node/fs.js +4 -3
  32. package/dist/public/node/fs.js.map +1 -1
  33. package/dist/public/node/output.d.ts +3 -1
  34. package/dist/public/node/output.js +10 -2
  35. package/dist/public/node/output.js.map +1 -1
  36. package/dist/public/node/ui.d.ts +3 -2
  37. package/dist/public/node/ui.js +1 -1
  38. package/dist/public/node/ui.js.map +1 -1
  39. package/dist/tsconfig.tsbuildinfo +1 -1
  40. package/package.json +8 -8
  41. package/assets/cli-ruby/lib/project_types/extension/commands/build.rb +0 -51
  42. package/assets/cli-ruby/lib/project_types/extension/commands/check.rb +0 -51
  43. package/assets/cli-ruby/lib/project_types/extension/commands/connect.rb +0 -35
  44. package/assets/cli-ruby/lib/project_types/extension/commands/create.rb +0 -100
  45. package/assets/cli-ruby/lib/project_types/extension/commands/info.rb +0 -86
  46. package/assets/cli-ruby/lib/project_types/extension/commands/push.rb +0 -112
  47. package/assets/cli-ruby/lib/project_types/extension/commands/register.rb +0 -67
  48. package/assets/cli-ruby/lib/project_types/extension/commands/tunnel.rb +0 -73
  49. package/assets/cli-ruby/lib/project_types/extension/forms/connect.rb +0 -42
  50. package/assets/cli-ruby/lib/project_types/extension/forms/create.rb +0 -49
  51. package/assets/cli-ruby/lib/project_types/extension/forms/questions/ask_app.rb +0 -53
  52. package/assets/cli-ruby/lib/project_types/extension/forms/questions/ask_name.rb +0 -48
  53. package/assets/cli-ruby/lib/project_types/extension/forms/questions/ask_registration.rb +0 -55
  54. package/assets/cli-ruby/lib/project_types/extension/forms/questions/ask_template.rb +0 -37
  55. package/assets/cli-ruby/lib/project_types/extension/forms/questions/ask_type.rb +0 -47
  56. package/assets/cli-ruby/lib/project_types/extension/models/development_server.rb +0 -77
  57. package/assets/cli-ruby/lib/project_types/extension/models/development_server_requirements.rb +0 -56
  58. package/assets/cli-ruby/lib/project_types/extension/models/npm_package.rb +0 -44
  59. package/assets/cli-ruby/lib/project_types/extension/models/product.rb +0 -12
  60. package/assets/cli-ruby/lib/project_types/extension/models/registration.rb +0 -20
  61. package/assets/cli-ruby/lib/project_types/extension/models/server_config/app.rb +0 -13
  62. package/assets/cli-ruby/lib/project_types/extension/models/server_config/base.rb +0 -31
  63. package/assets/cli-ruby/lib/project_types/extension/models/server_config/capabilities.rb +0 -11
  64. package/assets/cli-ruby/lib/project_types/extension/models/server_config/development.rb +0 -33
  65. package/assets/cli-ruby/lib/project_types/extension/models/server_config/development_entries.rb +0 -38
  66. package/assets/cli-ruby/lib/project_types/extension/models/server_config/development_renderer.rb +0 -38
  67. package/assets/cli-ruby/lib/project_types/extension/models/server_config/development_resource.rb +0 -13
  68. package/assets/cli-ruby/lib/project_types/extension/models/server_config/extension.rb +0 -46
  69. package/assets/cli-ruby/lib/project_types/extension/models/server_config/root.rb +0 -21
  70. package/assets/cli-ruby/lib/project_types/extension/models/server_config/user.rb +0 -10
  71. package/assets/cli-ruby/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb +0 -29
  72. package/assets/cli-ruby/lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb +0 -170
  73. package/assets/cli-ruby/lib/project_types/extension/models/specification_handlers/web_pixel_extension.rb +0 -58
  74. package/assets/cli-ruby/lib/project_types/extension/models/specification_handlers/web_pixel_extension_utils/script_config.rb +0 -33
  75. package/assets/cli-ruby/lib/project_types/extension/models/specification_handlers/web_pixel_extension_utils/script_config_repository.rb +0 -75
  76. package/assets/cli-ruby/lib/project_types/extension/tasks/choose_next_available_port.rb +0 -36
  77. package/assets/cli-ruby/lib/project_types/extension/tasks/convert_server_config.rb +0 -85
  78. package/assets/cli-ruby/lib/project_types/extension/tasks/converters/app_converter.rb +0 -27
  79. package/assets/cli-ruby/lib/project_types/extension/tasks/converters/product_converter.rb +0 -21
  80. package/assets/cli-ruby/lib/project_types/extension/tasks/converters/registration_converter.rb +0 -28
  81. package/assets/cli-ruby/lib/project_types/extension/tasks/create_extension.rb +0 -31
  82. package/assets/cli-ruby/lib/project_types/extension/tasks/ensure_resource_url.rb +0 -39
  83. package/assets/cli-ruby/lib/project_types/extension/tasks/execute_commands/base.rb +0 -15
  84. package/assets/cli-ruby/lib/project_types/extension/tasks/execute_commands/build.rb +0 -30
  85. package/assets/cli-ruby/lib/project_types/extension/tasks/execute_commands/create.rb +0 -30
  86. package/assets/cli-ruby/lib/project_types/extension/tasks/execute_commands/outdated_extension_detection.rb +0 -57
  87. package/assets/cli-ruby/lib/project_types/extension/tasks/execute_commands/serve.rb +0 -36
  88. package/assets/cli-ruby/lib/project_types/extension/tasks/find_npm_packages.rb +0 -106
  89. package/assets/cli-ruby/lib/project_types/extension/tasks/find_package_from_json.rb +0 -37
  90. package/assets/cli-ruby/lib/project_types/extension/tasks/get_app.rb +0 -22
  91. package/assets/cli-ruby/lib/project_types/extension/tasks/get_apps.rb +0 -26
  92. package/assets/cli-ruby/lib/project_types/extension/tasks/get_extensions.rb +0 -33
  93. package/assets/cli-ruby/lib/project_types/extension/tasks/get_product.rb +0 -22
  94. package/assets/cli-ruby/lib/project_types/extension/tasks/merge_server_config.rb +0 -47
  95. package/assets/cli-ruby/lib/project_types/extension/tasks/update_draft.rb +0 -29
  96. package/assets/cli-ruby/lib/project_types/extension/tasks/user_errors.rb +0 -45
  97. package/assets/cli-ruby/lib/shopify_cli/admin_api/populate_resource_command.rb +0 -166
  98. package/assets/cli-ruby/lib/shopify_cli/admin_api/schema.rb +0 -35
  99. package/assets/cli-ruby/lib/shopify_cli/app_type_detector.rb +0 -36
  100. package/assets/cli-ruby/lib/shopify_cli/assets/post_auth_page/index.html.erb +0 -34
  101. package/assets/cli-ruby/lib/shopify_cli/assets/post_auth_page/style.css +0 -58
  102. package/assets/cli-ruby/lib/shopify_cli/changelog.rb +0 -148
  103. package/assets/cli-ruby/lib/shopify_cli/command/app_sub_command.rb +0 -26
  104. package/assets/cli-ruby/lib/shopify_cli/command_options/command_serve_options.rb +0 -53
  105. package/assets/cli-ruby/lib/shopify_cli/command_options.rb +0 -7
  106. package/assets/cli-ruby/lib/shopify_cli/commands/app/connect.rb +0 -22
  107. package/assets/cli-ruby/lib/shopify_cli/commands/app/create/node.rb +0 -40
  108. package/assets/cli-ruby/lib/shopify_cli/commands/app/create/php.rb +0 -37
  109. package/assets/cli-ruby/lib/shopify_cli/commands/app/create/rails.rb +0 -42
  110. package/assets/cli-ruby/lib/shopify_cli/commands/app/create.rb +0 -28
  111. package/assets/cli-ruby/lib/shopify_cli/commands/app/deploy.rb +0 -51
  112. package/assets/cli-ruby/lib/shopify_cli/commands/app/open.rb +0 -19
  113. package/assets/cli-ruby/lib/shopify_cli/commands/app/serve.rb +0 -51
  114. package/assets/cli-ruby/lib/shopify_cli/commands/app/tunnel.rb +0 -43
  115. package/assets/cli-ruby/lib/shopify_cli/commands/app.rb +0 -29
  116. package/assets/cli-ruby/lib/shopify_cli/commands/config.rb +0 -76
  117. package/assets/cli-ruby/lib/shopify_cli/commands/help.rb +0 -52
  118. package/assets/cli-ruby/lib/shopify_cli/commands/login.rb +0 -98
  119. package/assets/cli-ruby/lib/shopify_cli/commands/logout.rb +0 -50
  120. package/assets/cli-ruby/lib/shopify_cli/commands/populate/customer.rb +0 -25
  121. package/assets/cli-ruby/lib/shopify_cli/commands/populate/draft_order.rb +0 -28
  122. package/assets/cli-ruby/lib/shopify_cli/commands/populate/product.rb +0 -24
  123. package/assets/cli-ruby/lib/shopify_cli/commands/populate.rb +0 -23
  124. package/assets/cli-ruby/lib/shopify_cli/commands/reporting.rb +0 -38
  125. package/assets/cli-ruby/lib/shopify_cli/commands/store.rb +0 -15
  126. package/assets/cli-ruby/lib/shopify_cli/commands/switch.rb +0 -39
  127. package/assets/cli-ruby/lib/shopify_cli/commands/system.rb +0 -165
  128. package/assets/cli-ruby/lib/shopify_cli/commands/version.rb +0 -15
  129. package/assets/cli-ruby/lib/shopify_cli/commands/whoami.rb +0 -28
  130. package/assets/cli-ruby/lib/shopify_cli/connect.rb +0 -32
  131. package/assets/cli-ruby/lib/shopify_cli/core/help_resolver.rb +0 -20
  132. package/assets/cli-ruby/lib/shopify_cli/heroku.rb +0 -140
  133. package/assets/cli-ruby/lib/shopify_cli/identity_auth/servlet.rb +0 -44
  134. package/assets/cli-ruby/lib/shopify_cli/js_deps.rb +0 -110
  135. package/assets/cli-ruby/lib/shopify_cli/packager.rb +0 -108
  136. package/assets/cli-ruby/lib/shopify_cli/php_deps.rb +0 -102
  137. package/assets/cli-ruby/lib/shopify_cli/process_supervision.rb +0 -228
  138. package/assets/cli-ruby/lib/shopify_cli/project_commands.rb +0 -16
  139. package/assets/cli-ruby/lib/shopify_cli/release.rb +0 -197
  140. package/assets/cli-ruby/lib/shopify_cli/sed.rb +0 -19
  141. package/assets/cli-ruby/lib/shopify_cli/services/app/connect_service.rb +0 -25
  142. package/assets/cli-ruby/lib/shopify_cli/services/app/create/node_service.rb +0 -143
  143. package/assets/cli-ruby/lib/shopify_cli/services/app/create/php_service.rb +0 -147
  144. package/assets/cli-ruby/lib/shopify_cli/services/app/create/rails_service.rb +0 -239
  145. package/assets/cli-ruby/lib/shopify_cli/services/app/deploy/heroku/node_service.rb +0 -101
  146. package/assets/cli-ruby/lib/shopify_cli/services/app/deploy/heroku/php_service.rb +0 -135
  147. package/assets/cli-ruby/lib/shopify_cli/services/app/deploy/heroku/rails_service.rb +0 -120
  148. package/assets/cli-ruby/lib/shopify_cli/services/app/open_service.rb +0 -19
  149. package/assets/cli-ruby/lib/shopify_cli/services/app/serve/node_service.rb +0 -19
  150. package/assets/cli-ruby/lib/shopify_cli/services/app/serve/php_service.rb +0 -23
  151. package/assets/cli-ruby/lib/shopify_cli/services/app/serve/rails_service.rb +0 -28
  152. package/assets/cli-ruby/lib/shopify_cli/services/app/serve/serve_service.rb +0 -57
  153. package/assets/cli-ruby/lib/shopify_cli/services/app/tunnel/auth_service.rb +0 -21
  154. package/assets/cli-ruby/lib/shopify_cli/services/app/tunnel/start_service.rb +0 -20
  155. package/assets/cli-ruby/lib/shopify_cli/services/app/tunnel/stop_service.rb +0 -20
  156. package/assets/cli-ruby/lib/shopify_cli/services/base_service.rb +0 -13
  157. package/assets/cli-ruby/lib/shopify_cli/services/reporting_service.rb +0 -16
  158. package/assets/cli-ruby/lib/shopify_cli/services.rb +0 -38
  159. package/assets/cli-ruby/lib/shopify_cli/tunnel.rb +0 -255
@@ -10,6 +10,7 @@ import { Task } from '../../private/node/ui/components/Tasks.js';
10
10
  import { TextPromptProps } from '../../private/node/ui/components/TextPrompt.js';
11
11
  import { AutocompletePromptProps } from '../../private/node/ui/components/AutocompletePrompt.js';
12
12
  import { InlineToken, LinkToken, TokenItem } from '../../private/node/ui/components/TokenizedText.js';
13
+ import { InfoTableSection } from '../../private/node/ui/components/Prompts/InfoTable.js';
13
14
  import { Key as InkKey, RenderOptions } from 'ink';
14
15
  type PartialBy<T, TKey extends keyof T> = Omit<T, TKey> & Partial<Pick<T, TKey>>;
15
16
  export interface RenderConcurrentOptions extends PartialBy<ConcurrentOutputProps, 'abortController'> {
@@ -25,7 +26,7 @@ export interface RenderConcurrentOptions extends PartialBy<ConcurrentOutputProps
25
26
  * 0000-00-00 00:00:00 │ frontend │ second frontend message
26
27
  * 0000-00-00 00:00:00 │ frontend │ third frontend message
27
28
  *
28
- * › Press p │ open your browser
29
+ * › Press p │ preview in your browser
29
30
  * › Press q │ quit.
30
31
  *
31
32
  * Preview URL: https://shopify.com
@@ -309,4 +310,4 @@ export declare function renderText({ text, logLevel, logger }: RenderTextOptions
309
310
  /** Waits for any key to be pressed except Ctrl+C which will terminate the process. */
310
311
  export declare const keypress: () => Promise<unknown>;
311
312
  export type Key = InkKey;
312
- export { Task, TokenItem, InlineToken, LinkToken, TableColumn };
313
+ export { Task, TokenItem, InlineToken, LinkToken, TableColumn, InfoTableSection };
@@ -23,7 +23,7 @@ import React from 'react';
23
23
  * 0000-00-00 00:00:00 │ frontend │ second frontend message
24
24
  * 0000-00-00 00:00:00 │ frontend │ third frontend message
25
25
  *
26
- * › Press p │ open your browser
26
+ * › Press p │ preview in your browser
27
27
  * › Press q │ quit.
28
28
  *
29
29
  * Preview URL: https://shopify.com
@@ -1 +1 @@
1
- {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../src/public/node/ui.tsx"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,OAAO,EAAC,gBAAgB,EAAsB,MAAM,YAAY,CAAA;AAChE,OAAO,EAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAoB,WAAW,EAAE,sBAAsB,EAAC,MAAM,aAAa,CAAA;AACvH,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAC,eAAe,EAAC,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAC,gBAAgB,EAAwB,MAAM,sDAAsD,CAAA;AAC5G,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAC,KAAK,EAAe,MAAM,gCAAgC,CAAA;AAElE,OAAO,EAAC,UAAU,EAAC,MAAM,gDAAgD,CAAA;AAEzE,OAAO,EAAC,KAAK,EAA0B,MAAM,iDAAiD,CAAA;AAC9F,OAAO,EAAC,YAAY,EAAoB,MAAM,kDAAkD,CAAA;AAChG,OAAO,EAAC,KAAK,EAAO,MAAM,2CAA2C,CAAA;AACrE,OAAO,EAAC,UAAU,EAAkB,MAAM,gDAAgD,CAAA;AAC1F,OAAO,EAA0B,kBAAkB,EAAC,MAAM,wDAAwD,CAAA;AAElH,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EAAC,aAAa,EAAE,GAAG,KAAK,EAA0B;IACvF,MAAM,QAAQ,GAAG;QACf,eAAe,EAAE,IAAI,eAAe,EAAE;QACtC,GAAG,KAAK;KACT,CAAA;IAED,OAAO,MAAM,CAAC,oBAAC,gBAAgB,OAAK,QAAQ,GAAI,EAAE;QAChD,GAAG,aAAa;QAChB,WAAW,EAAE,OAAO,KAAK,CAAC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AAA","sourcesContent":["/* eslint-disable tsdoc/syntax */\nimport {AbortSilentError, FatalError as Fatal} from './error.js'\nimport {collectLog, consoleError, consoleLog, Logger, LogLevel, outputDebug, outputWhereAppropriate} from './output.js'\nimport {isUnitTest} from './context/local.js'\nimport {AbortController} from './abort.js'\nimport {ConcurrentOutput, ConcurrentOutputProps} from '../../private/node/ui/components/ConcurrentOutput.js'\nimport {render, renderOnce} from '../../private/node/ui.js'\nimport {alert, AlertOptions} from '../../private/node/ui/alert.js'\nimport {CustomSection} from '../../private/node/ui/components/Alert.js'\nimport {FatalError} from '../../private/node/ui/components/FatalError.js'\nimport ScalarDict from '../../private/node/ui/components/Table/ScalarDict.js'\nimport {Table, TableColumn, TableProps} from '../../private/node/ui/components/Table/Table.js'\nimport {SelectPrompt, SelectPromptProps} from '../../private/node/ui/components/SelectPrompt.js'\nimport {Tasks, Task} from '../../private/node/ui/components/Tasks.js'\nimport {TextPrompt, TextPromptProps} from '../../private/node/ui/components/TextPrompt.js'\nimport {AutocompletePromptProps, AutocompletePrompt} from '../../private/node/ui/components/AutocompletePrompt.js'\nimport {InlineToken, LinkToken, TokenItem} from '../../private/node/ui/components/TokenizedText.js'\nimport React from 'react'\nimport {Key as InkKey, RenderOptions} from 'ink'\n\ntype PartialBy<T, TKey extends keyof T> = Omit<T, TKey> & Partial<Pick<T, TKey>>\n\nexport interface RenderConcurrentOptions extends PartialBy<ConcurrentOutputProps, 'abortController'> {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders output from concurrent processes to the terminal with {@link ConcurrentOutput}.\n * @example\n * 0000-00-00 00:00:00 │ backend │ first backend message\n * 0000-00-00 00:00:00 │ backend │ second backend message\n * 0000-00-00 00:00:00 │ backend │ third backend message\n * 0000-00-00 00:00:00 │ frontend │ first frontend message\n * 0000-00-00 00:00:00 │ frontend │ second frontend message\n * 0000-00-00 00:00:00 │ frontend │ third frontend message\n *\n * › Press p │ open your browser\n * › Press q │ quit.\n *\n * Preview URL: https://shopify.com\n *\n */\nexport async function renderConcurrent({renderOptions, ...props}: RenderConcurrentOptions) {\n const newProps = {\n abortController: new AbortController(),\n ...props,\n }\n\n return render(<ConcurrentOutput {...newProps} />, {\n ...renderOptions,\n exitOnCtrlC: typeof props.onInput === 'undefined',\n })\n}\n\nexport type AlertCustomSection = CustomSection\nexport type RenderAlertOptions = Omit<AlertOptions, 'type'>\n\n/**\n * Renders an information banner to the console.\n * @example Basic\n * ╭─ info ───────────────────────────────────────────────────╮\n * │ │\n * │ CLI update available │\n * │ │\n * │ Run `npm run shopify upgrade`. │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n *\n * @example Complete\n * ╭─ info ───────────────────────────────────────────────────╮\n * │ │\n * │ my-app initialized and ready to build. │\n * │ │\n * │ Next steps │\n * │ • Run `cd verification-app` │\n * │ • To preview your project, run `npm app dev` │\n * │ • To add extensions, run `npm generate extension` │\n * │ │\n * │ Reference │\n * │ • Run `npm shopify help` │\n * │ • Dev docs [1] │\n * │ │\n * │ Custom section │\n * │ • Item 1 [2] │\n * │ • Item 2 │\n * │ • Item 3 [3] │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n * [1] https://shopify.dev\n * [2] https://www.google.com/search?q=jh56t9l34kpo35tw8s28hn7s\n * 9s2xvzla01d8cn6j7yq&rlz=1C1GCEU_enUS832US832&oq=jh56t9l34kpo\n * 35tw8s28hn7s9s2xvzla01d8cn6j7yq&aqs=chrome.0.35i39l2j0l4j46j\n * 69i60.2711j0j7&sourceid=chrome&ie=UTF-8\n * [3] https://shopify.com\n *\n */\nexport function renderInfo(options: RenderAlertOptions) {\n return alert({...options, type: 'info'})\n}\n\n/**\n * Renders a success banner to the console.\n * @example Basic\n * ╭─ success ────────────────────────────────────────────────╮\n * │ │\n * │ CLI updated. │\n * │ │\n * │ You are now running version 3.47. │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n *\n * @example Complete\n * ╭─ success ────────────────────────────────────────────────╮\n * │ │\n * │ Deployment successful. │\n * │ │\n * │ Your extensions have been uploaded to your Shopify │\n * │ Partners Dashboard. │\n * │ │\n * │ Next steps │\n * │ • See your deployment and set it live [1] │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n * [1] https://partners.shopify.com/1797046/apps/4523695/deploy\n * ments\n *\n */\nexport function renderSuccess(options: RenderAlertOptions) {\n return alert({...options, type: 'success'})\n}\n\n/**\n * Renders a warning banner to the console.\n * @example Basic\n * ╭─ warning ────────────────────────────────────────────────╮\n * │ │\n * │ You have reached your limit of checkout extensions for │\n * │ this app. │\n * │ │\n * │ You can free up space for a new one by deleting an │\n * │ existing one. │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n *\n * @example Complete\n * ╭─ warning ────────────────────────────────────────────────╮\n * │ │\n * │ Required access scope update. │\n * │ │\n * │ The deadline for re-selecting your app scopes is May │\n * │ 1, 2022. │\n * │ │\n * │ Reference │\n * │ • Dev docs [1] │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n * [1] https://shopify.dev/app/scopes\n *\n */\nexport function renderWarning(options: RenderAlertOptions) {\n return alert({...options, type: 'warning'})\n}\n\ninterface RenderFatalErrorOptions {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders a Fatal error to the console inside a banner.\n * @example Basic\n * ╭─ error ──────────────────────────────────────────────────╮\n * │ │\n * │ Something went wrong. │\n * │ │\n * │ To investigate the issue, examine this stack trace: │\n * │ at _compile (internal/modules/cjs/loader.js:1137) │\n * │ at js (internal/modules/cjs/loader.js:1157) │\n * │ at load (internal/modules/cjs/loader.js:985) │\n * │ at _load (internal/modules/cjs/loader.js:878) │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n *\n * @example Complete\n * ╭─ error ──────────────────────────────────────────────────╮\n * │ │\n * │ No Organization found │\n * │ │\n * │ Next steps │\n * │ • Have you created a Shopify Partners organization │\n * │ [1]? │\n * │ • Have you confirmed your accounts from the emails │\n * │ you received? │\n * │ • Need to connect to a different App or │\n * │ organization? Run the command again with `--reset` │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n * [1] https://partners.shopify.com/signup\n *\n */\n// eslint-disable-next-line max-params\nexport function renderFatalError(error: Fatal, {renderOptions}: RenderFatalErrorOptions = {}) {\n return renderOnce(<FatalError error={error} />, {logLevel: 'error', logger: consoleError, renderOptions})\n}\n\nexport interface RenderSeletPromptOptions<T> extends Omit<SelectPromptProps<T>, 'onSubmit'> {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders a select prompt to the console.\n * @example\n * ? Associate your project with the org Castile Ventures?\n *\n * Add: • new-ext\n *\n * Remove: • integrated-demand-ext\n * • order-discount\n *\n * Automations\n * > (a) fifth\n * (2) sixth\n *\n * Merchant Admin\n * (3) eighth\n * (4) ninth\n *\n * Other\n * (f) first\n * (s) second\n * (7) third\n * (8) fourth\n * (9) seventh\n * (10) tenth\n *\n * Press ↑↓ arrows to select, enter to confirm\n *\n */\nexport function renderSelectPrompt<T>({renderOptions, ...props}: RenderSeletPromptOptions<T>): Promise<T> {\n // eslint-disable-next-line max-params\n return new Promise((resolve, reject) => {\n render(<SelectPrompt {...props} onSubmit={(value: T) => resolve(value)} />, {\n ...renderOptions,\n exitOnCtrlC: false,\n }).catch(reject)\n })\n}\n\nexport interface RenderConfirmationPromptOptions extends Pick<SelectPromptProps<boolean>, 'message' | 'infoTable'> {\n confirmationMessage?: string\n cancellationMessage?: string\n renderOptions?: RenderOptions\n defaultValue?: boolean\n}\n\n/**\n * Renders a confirmation prompt to the console.\n * @example\n * ? Delete the following themes from the store?\n *\n * • first theme (#1)\n * • second theme (#2)\n *\n * > (y) Yes, confirm changes\n * (n) Cancel\n *\n * Press ↑↓ arrows to select, enter or a shortcut to confirm\n *\n */\nexport function renderConfirmationPrompt({\n message,\n infoTable,\n confirmationMessage = 'Yes, confirm',\n cancellationMessage = 'No, cancel',\n renderOptions,\n defaultValue = true,\n}: RenderConfirmationPromptOptions): Promise<boolean> {\n const choices = [\n {\n label: confirmationMessage,\n value: true,\n key: 'y',\n },\n {\n label: cancellationMessage,\n value: false,\n key: 'n',\n },\n ]\n\n return renderSelectPrompt({\n choices,\n message,\n infoTable,\n submitWithShortcuts: true,\n renderOptions,\n defaultValue,\n })\n}\n\nexport interface RenderAutocompleteOptions<T>\n extends PartialBy<Omit<AutocompletePromptProps<T>, 'onSubmit'>, 'search'> {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders an autocomplete prompt to the console.\n * @example\n * ? Select a template: Type to search...\n *\n * > first\n * second\n * third\n * fourth\n * fifth\n * sixth\n * seventh\n * eighth\n * ninth\n * tenth\n * eleventh\n * twelfth\n * thirteenth\n * fourteenth\n * fifteenth\n * sixteenth\n * seventeenth\n * eighteenth\n * nineteenth\n * twentieth\n * twenty-first\n * twenty-second\n * twenty-third\n * twenty-fourth\n * twenty-fifth\n *\n * Press ↑↓ arrows to select, enter to confirm\n *\n */\nexport function renderAutocompletePrompt<T>({renderOptions, ...props}: RenderAutocompleteOptions<T>): Promise<T> {\n const newProps = {\n search(term: string) {\n return Promise.resolve({\n data: props.choices.filter((item) => item.label.toLowerCase().includes(term.toLowerCase())),\n })\n },\n ...props,\n }\n\n // eslint-disable-next-line max-params\n return new Promise((resolve, reject) => {\n render(<AutocompletePrompt {...newProps} onSubmit={(value: T) => resolve(value)} />, {\n ...renderOptions,\n exitOnCtrlC: false,\n }).catch(reject)\n })\n}\n\ninterface RenderTableOptions<T extends ScalarDict> extends TableProps<T> {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders a table to the console.\n * @example\n * ID Name email\n * ── ────────── ─────────────\n * 1 John Doe jon@doe.com\n * 2 Jane Doe jane@doe.com\n * 3 John Smith jon@smith.com\n */\nexport function renderTable<T extends ScalarDict>({renderOptions, ...props}: RenderTableOptions<T>) {\n return renderOnce(<Table {...props} />, {renderOptions})\n}\n\ninterface RenderTasksOptions {\n renderOptions?: RenderOptions\n}\n\n/**\n * Runs async tasks and displays their progress to the console.\n * @example\n * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n * Installing dependencies ...\n */\n// eslint-disable-next-line max-params\nexport async function renderTasks<TContext>(tasks: Task<TContext>[], {renderOptions}: RenderTasksOptions = {}) {\n // eslint-disable-next-line max-params\n return new Promise<TContext>((resolve, reject) => {\n render(<Tasks tasks={tasks} onComplete={resolve} />, {\n ...renderOptions,\n exitOnCtrlC: false,\n }).catch(reject)\n })\n}\n\nexport interface RenderTextPromptOptions extends Omit<TextPromptProps, 'onSubmit'> {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders a text prompt to the console.\n * @example\n * ? App project name (can be changed later):\n * > expansive commerce app\n * ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔\n *\n */\nexport function renderTextPrompt({renderOptions, ...props}: RenderTextPromptOptions): Promise<string> {\n // eslint-disable-next-line max-params\n return new Promise((resolve, reject) => {\n render(<TextPrompt {...props} onSubmit={(value: string) => resolve(value)} />, {\n ...renderOptions,\n exitOnCtrlC: false,\n }).catch(reject)\n })\n}\n\ninterface RenderTextOptions {\n text: string\n logLevel?: LogLevel\n logger?: Logger\n}\n\n/** Renders a text string to the console.\n * Using this function makes sure that correct spacing is applied among the various components.\n * @example\n * Hello world!\n *\n */\nexport function renderText({text, logLevel = 'info', logger = consoleLog}: RenderTextOptions) {\n let textWithLineReturn = text\n if (!text.endsWith('\\n')) textWithLineReturn += '\\n'\n\n if (isUnitTest()) collectLog(logLevel, textWithLineReturn)\n outputWhereAppropriate(logLevel, logger, textWithLineReturn)\n return textWithLineReturn\n}\n\n/** Waits for any key to be pressed except Ctrl+C which will terminate the process. */\nexport const keypress = async () => {\n // eslint-disable-next-line max-params\n return new Promise((resolve, reject) => {\n const handler = (buffer: Buffer) => {\n process.stdin.setRawMode(false)\n process.stdin.pause()\n\n const bytes = Array.from(buffer)\n\n if (bytes.length && bytes[0] === 3) {\n outputDebug('Canceled keypress, User pressed CTRL+C')\n reject(new AbortSilentError())\n }\n process.nextTick(resolve)\n }\n\n process.stdin.resume()\n process.stdin.setRawMode(true)\n process.stdin.once('data', handler)\n })\n}\n\nexport type Key = InkKey\nexport {Task, TokenItem, InlineToken, LinkToken, TableColumn}\n"]}
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../src/public/node/ui.tsx"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,OAAO,EAAC,gBAAgB,EAAsB,MAAM,YAAY,CAAA;AAChE,OAAO,EAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAoB,WAAW,EAAE,sBAAsB,EAAC,MAAM,aAAa,CAAA;AACvH,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAC,eAAe,EAAC,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAC,gBAAgB,EAAwB,MAAM,sDAAsD,CAAA;AAC5G,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAC,KAAK,EAAe,MAAM,gCAAgC,CAAA;AAElE,OAAO,EAAC,UAAU,EAAC,MAAM,gDAAgD,CAAA;AAEzE,OAAO,EAAC,KAAK,EAA0B,MAAM,iDAAiD,CAAA;AAC9F,OAAO,EAAC,YAAY,EAAoB,MAAM,kDAAkD,CAAA;AAChG,OAAO,EAAC,KAAK,EAAO,MAAM,2CAA2C,CAAA;AACrE,OAAO,EAAC,UAAU,EAAkB,MAAM,gDAAgD,CAAA;AAC1F,OAAO,EAA0B,kBAAkB,EAAC,MAAM,wDAAwD,CAAA;AAGlH,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EAAC,aA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C3B,CAAC,CAAA;QAED,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,CAAA;QACtB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QAC9B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["/* eslint-disable tsdoc/syntax */\nimport {AbortSilentError, FatalError as Fatal} from './error.js'\nimport {collectLog, consoleError, consoleLog, Logger, LogLevel, outputDebug, outputWhereAppropriate} from './output.js'\nimport {isUnitTest} from './context/local.js'\nimport {AbortController} from './abort.js'\nimport {ConcurrentOutput, ConcurrentOutputProps} from '../../private/node/ui/components/ConcurrentOutput.js'\nimport {render, renderOnce} from '../../private/node/ui.js'\nimport {alert, AlertOptions} from '../../private/node/ui/alert.js'\nimport {CustomSection} from '../../private/node/ui/components/Alert.js'\nimport {FatalError} from '../../private/node/ui/components/FatalError.js'\nimport ScalarDict from '../../private/node/ui/components/Table/ScalarDict.js'\nimport {Table, TableColumn, TableProps} from '../../private/node/ui/components/Table/Table.js'\nimport {SelectPrompt, SelectPromptProps} from '../../private/node/ui/components/SelectPrompt.js'\nimport {Tasks, Task} from '../../private/node/ui/components/Tasks.js'\nimport {TextPrompt, TextPromptProps} from '../../private/node/ui/components/TextPrompt.js'\nimport {AutocompletePromptProps, AutocompletePrompt} from '../../private/node/ui/components/AutocompletePrompt.js'\nimport {InlineToken, LinkToken, TokenItem} from '../../private/node/ui/components/TokenizedText.js'\nimport {InfoTableSection} from '../../private/node/ui/components/Prompts/InfoTable.js'\nimport React from 'react'\nimport {Key as InkKey, RenderOptions} from 'ink'\n\ntype PartialBy<T, TKey extends keyof T> = Omit<T, TKey> & Partial<Pick<T, TKey>>\n\nexport interface RenderConcurrentOptions extends PartialBy<ConcurrentOutputProps, 'abortController'> {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders output from concurrent processes to the terminal with {@link ConcurrentOutput}.\n * @example\n * 0000-00-00 00:00:00 │ backend │ first backend message\n * 0000-00-00 00:00:00 │ backend │ second backend message\n * 0000-00-00 00:00:00 │ backend │ third backend message\n * 0000-00-00 00:00:00 │ frontend │ first frontend message\n * 0000-00-00 00:00:00 │ frontend │ second frontend message\n * 0000-00-00 00:00:00 │ frontend │ third frontend message\n *\n * › Press p │ preview in your browser\n * › Press q │ quit.\n *\n * Preview URL: https://shopify.com\n *\n */\nexport async function renderConcurrent({renderOptions, ...props}: RenderConcurrentOptions) {\n const newProps = {\n abortController: new AbortController(),\n ...props,\n }\n\n return render(<ConcurrentOutput {...newProps} />, {\n ...renderOptions,\n exitOnCtrlC: typeof props.onInput === 'undefined',\n })\n}\n\nexport type AlertCustomSection = CustomSection\nexport type RenderAlertOptions = Omit<AlertOptions, 'type'>\n\n/**\n * Renders an information banner to the console.\n * @example Basic\n * ╭─ info ───────────────────────────────────────────────────╮\n * │ │\n * │ CLI update available │\n * │ │\n * │ Run `npm run shopify upgrade`. │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n *\n * @example Complete\n * ╭─ info ───────────────────────────────────────────────────╮\n * │ │\n * │ my-app initialized and ready to build. │\n * │ │\n * │ Next steps │\n * │ • Run `cd verification-app` │\n * │ • To preview your project, run `npm app dev` │\n * │ • To add extensions, run `npm generate extension` │\n * │ │\n * │ Reference │\n * │ • Run `npm shopify help` │\n * │ • Dev docs [1] │\n * │ │\n * │ Custom section │\n * │ • Item 1 [2] │\n * │ • Item 2 │\n * │ • Item 3 [3] │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n * [1] https://shopify.dev\n * [2] https://www.google.com/search?q=jh56t9l34kpo35tw8s28hn7s\n * 9s2xvzla01d8cn6j7yq&rlz=1C1GCEU_enUS832US832&oq=jh56t9l34kpo\n * 35tw8s28hn7s9s2xvzla01d8cn6j7yq&aqs=chrome.0.35i39l2j0l4j46j\n * 69i60.2711j0j7&sourceid=chrome&ie=UTF-8\n * [3] https://shopify.com\n *\n */\nexport function renderInfo(options: RenderAlertOptions) {\n return alert({...options, type: 'info'})\n}\n\n/**\n * Renders a success banner to the console.\n * @example Basic\n * ╭─ success ────────────────────────────────────────────────╮\n * │ │\n * │ CLI updated. │\n * │ │\n * │ You are now running version 3.47. │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n *\n * @example Complete\n * ╭─ success ────────────────────────────────────────────────╮\n * │ │\n * │ Deployment successful. │\n * │ │\n * │ Your extensions have been uploaded to your Shopify │\n * │ Partners Dashboard. │\n * │ │\n * │ Next steps │\n * │ • See your deployment and set it live [1] │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n * [1] https://partners.shopify.com/1797046/apps/4523695/deploy\n * ments\n *\n */\nexport function renderSuccess(options: RenderAlertOptions) {\n return alert({...options, type: 'success'})\n}\n\n/**\n * Renders a warning banner to the console.\n * @example Basic\n * ╭─ warning ────────────────────────────────────────────────╮\n * │ │\n * │ You have reached your limit of checkout extensions for │\n * │ this app. │\n * │ │\n * │ You can free up space for a new one by deleting an │\n * │ existing one. │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n *\n * @example Complete\n * ╭─ warning ────────────────────────────────────────────────╮\n * │ │\n * │ Required access scope update. │\n * │ │\n * │ The deadline for re-selecting your app scopes is May │\n * │ 1, 2022. │\n * │ │\n * │ Reference │\n * │ • Dev docs [1] │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n * [1] https://shopify.dev/app/scopes\n *\n */\nexport function renderWarning(options: RenderAlertOptions) {\n return alert({...options, type: 'warning'})\n}\n\ninterface RenderFatalErrorOptions {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders a Fatal error to the console inside a banner.\n * @example Basic\n * ╭─ error ──────────────────────────────────────────────────╮\n * │ │\n * │ Something went wrong. │\n * │ │\n * │ To investigate the issue, examine this stack trace: │\n * │ at _compile (internal/modules/cjs/loader.js:1137) │\n * │ at js (internal/modules/cjs/loader.js:1157) │\n * │ at load (internal/modules/cjs/loader.js:985) │\n * │ at _load (internal/modules/cjs/loader.js:878) │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n *\n * @example Complete\n * ╭─ error ──────────────────────────────────────────────────╮\n * │ │\n * │ No Organization found │\n * │ │\n * │ Next steps │\n * │ • Have you created a Shopify Partners organization │\n * │ [1]? │\n * │ • Have you confirmed your accounts from the emails │\n * │ you received? │\n * │ • Need to connect to a different App or │\n * │ organization? Run the command again with `--reset` │\n * │ │\n * ╰──────────────────────────────────────────────────────────╯\n * [1] https://partners.shopify.com/signup\n *\n */\n// eslint-disable-next-line max-params\nexport function renderFatalError(error: Fatal, {renderOptions}: RenderFatalErrorOptions = {}) {\n return renderOnce(<FatalError error={error} />, {logLevel: 'error', logger: consoleError, renderOptions})\n}\n\nexport interface RenderSeletPromptOptions<T> extends Omit<SelectPromptProps<T>, 'onSubmit'> {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders a select prompt to the console.\n * @example\n * ? Associate your project with the org Castile Ventures?\n *\n * Add: • new-ext\n *\n * Remove: • integrated-demand-ext\n * • order-discount\n *\n * Automations\n * > (a) fifth\n * (2) sixth\n *\n * Merchant Admin\n * (3) eighth\n * (4) ninth\n *\n * Other\n * (f) first\n * (s) second\n * (7) third\n * (8) fourth\n * (9) seventh\n * (10) tenth\n *\n * Press ↑↓ arrows to select, enter to confirm\n *\n */\nexport function renderSelectPrompt<T>({renderOptions, ...props}: RenderSeletPromptOptions<T>): Promise<T> {\n // eslint-disable-next-line max-params\n return new Promise((resolve, reject) => {\n render(<SelectPrompt {...props} onSubmit={(value: T) => resolve(value)} />, {\n ...renderOptions,\n exitOnCtrlC: false,\n }).catch(reject)\n })\n}\n\nexport interface RenderConfirmationPromptOptions extends Pick<SelectPromptProps<boolean>, 'message' | 'infoTable'> {\n confirmationMessage?: string\n cancellationMessage?: string\n renderOptions?: RenderOptions\n defaultValue?: boolean\n}\n\n/**\n * Renders a confirmation prompt to the console.\n * @example\n * ? Delete the following themes from the store?\n *\n * • first theme (#1)\n * • second theme (#2)\n *\n * > (y) Yes, confirm changes\n * (n) Cancel\n *\n * Press ↑↓ arrows to select, enter or a shortcut to confirm\n *\n */\nexport function renderConfirmationPrompt({\n message,\n infoTable,\n confirmationMessage = 'Yes, confirm',\n cancellationMessage = 'No, cancel',\n renderOptions,\n defaultValue = true,\n}: RenderConfirmationPromptOptions): Promise<boolean> {\n const choices = [\n {\n label: confirmationMessage,\n value: true,\n key: 'y',\n },\n {\n label: cancellationMessage,\n value: false,\n key: 'n',\n },\n ]\n\n return renderSelectPrompt({\n choices,\n message,\n infoTable,\n submitWithShortcuts: true,\n renderOptions,\n defaultValue,\n })\n}\n\nexport interface RenderAutocompleteOptions<T>\n extends PartialBy<Omit<AutocompletePromptProps<T>, 'onSubmit'>, 'search'> {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders an autocomplete prompt to the console.\n * @example\n * ? Select a template: Type to search...\n *\n * > first\n * second\n * third\n * fourth\n * fifth\n * sixth\n * seventh\n * eighth\n * ninth\n * tenth\n * eleventh\n * twelfth\n * thirteenth\n * fourteenth\n * fifteenth\n * sixteenth\n * seventeenth\n * eighteenth\n * nineteenth\n * twentieth\n * twenty-first\n * twenty-second\n * twenty-third\n * twenty-fourth\n * twenty-fifth\n *\n * Press ↑↓ arrows to select, enter to confirm\n *\n */\nexport function renderAutocompletePrompt<T>({renderOptions, ...props}: RenderAutocompleteOptions<T>): Promise<T> {\n const newProps = {\n search(term: string) {\n return Promise.resolve({\n data: props.choices.filter((item) => item.label.toLowerCase().includes(term.toLowerCase())),\n })\n },\n ...props,\n }\n\n // eslint-disable-next-line max-params\n return new Promise((resolve, reject) => {\n render(<AutocompletePrompt {...newProps} onSubmit={(value: T) => resolve(value)} />, {\n ...renderOptions,\n exitOnCtrlC: false,\n }).catch(reject)\n })\n}\n\ninterface RenderTableOptions<T extends ScalarDict> extends TableProps<T> {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders a table to the console.\n * @example\n * ID Name email\n * ── ────────── ─────────────\n * 1 John Doe jon@doe.com\n * 2 Jane Doe jane@doe.com\n * 3 John Smith jon@smith.com\n */\nexport function renderTable<T extends ScalarDict>({renderOptions, ...props}: RenderTableOptions<T>) {\n return renderOnce(<Table {...props} />, {renderOptions})\n}\n\ninterface RenderTasksOptions {\n renderOptions?: RenderOptions\n}\n\n/**\n * Runs async tasks and displays their progress to the console.\n * @example\n * ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n * Installing dependencies ...\n */\n// eslint-disable-next-line max-params\nexport async function renderTasks<TContext>(tasks: Task<TContext>[], {renderOptions}: RenderTasksOptions = {}) {\n // eslint-disable-next-line max-params\n return new Promise<TContext>((resolve, reject) => {\n render(<Tasks tasks={tasks} onComplete={resolve} />, {\n ...renderOptions,\n exitOnCtrlC: false,\n }).catch(reject)\n })\n}\n\nexport interface RenderTextPromptOptions extends Omit<TextPromptProps, 'onSubmit'> {\n renderOptions?: RenderOptions\n}\n\n/**\n * Renders a text prompt to the console.\n * @example\n * ? App project name (can be changed later):\n * > expansive commerce app\n * ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔\n *\n */\nexport function renderTextPrompt({renderOptions, ...props}: RenderTextPromptOptions): Promise<string> {\n // eslint-disable-next-line max-params\n return new Promise((resolve, reject) => {\n render(<TextPrompt {...props} onSubmit={(value: string) => resolve(value)} />, {\n ...renderOptions,\n exitOnCtrlC: false,\n }).catch(reject)\n })\n}\n\ninterface RenderTextOptions {\n text: string\n logLevel?: LogLevel\n logger?: Logger\n}\n\n/** Renders a text string to the console.\n * Using this function makes sure that correct spacing is applied among the various components.\n * @example\n * Hello world!\n *\n */\nexport function renderText({text, logLevel = 'info', logger = consoleLog}: RenderTextOptions) {\n let textWithLineReturn = text\n if (!text.endsWith('\\n')) textWithLineReturn += '\\n'\n\n if (isUnitTest()) collectLog(logLevel, textWithLineReturn)\n outputWhereAppropriate(logLevel, logger, textWithLineReturn)\n return textWithLineReturn\n}\n\n/** Waits for any key to be pressed except Ctrl+C which will terminate the process. */\nexport const keypress = async () => {\n // eslint-disable-next-line max-params\n return new Promise((resolve, reject) => {\n const handler = (buffer: Buffer) => {\n process.stdin.setRawMode(false)\n process.stdin.pause()\n\n const bytes = Array.from(buffer)\n\n if (bytes.length && bytes[0] === 3) {\n outputDebug('Canceled keypress, User pressed CTRL+C')\n reject(new AbortSilentError())\n }\n process.nextTick(resolve)\n }\n\n process.stdin.resume()\n process.stdin.setRawMode(true)\n process.stdin.once('data', handler)\n })\n}\n\nexport type Key = InkKey\nexport {Task, TokenItem, InlineToken, LinkToken, TableColumn, InfoTableSection}\n"]}