@shopify/cli-kit 0.0.0-nightly-20230110194301
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +8 -0
- package/README.md +63 -0
- package/assets/auth-error.html +23 -0
- package/assets/empty-url.html +23 -0
- package/assets/favicon.svg +26 -0
- package/assets/missing-code.html +23 -0
- package/assets/missing-state.html +23 -0
- package/assets/style.css +58 -0
- package/assets/success.html +20 -0
- package/dist/api/admin.d.ts +3 -0
- package/dist/api/admin.js +56 -0
- package/dist/api/admin.js.map +1 -0
- package/dist/api/common.d.ts +21 -0
- package/dist/api/common.js +87 -0
- package/dist/api/common.js.map +1 -0
- package/dist/api/graphql/all_app_extension_registrations.d.ts +20 -0
- package/dist/api/graphql/all_app_extension_registrations.js +20 -0
- package/dist/api/graphql/all_app_extension_registrations.js.map +1 -0
- package/dist/api/graphql/all_dev_stores_by_org.d.ts +18 -0
- package/dist/api/graphql/all_dev_stores_by_org.js +21 -0
- package/dist/api/graphql/all_dev_stores_by_org.js.map +1 -0
- package/dist/api/graphql/all_orgs.d.ts +12 -0
- package/dist/api/graphql/all_orgs.js +14 -0
- package/dist/api/graphql/all_orgs.js.map +1 -0
- package/dist/api/graphql/convert_dev_to_test_store.d.ts +16 -0
- package/dist/api/graphql/convert_dev_to_test_store.js +13 -0
- package/dist/api/graphql/convert_dev_to_test_store.js.map +1 -0
- package/dist/api/graphql/create_app.d.ts +29 -0
- package/dist/api/graphql/create_app.js +33 -0
- package/dist/api/graphql/create_app.js.map +1 -0
- package/dist/api/graphql/create_deployment.d.ts +33 -0
- package/dist/api/graphql/create_deployment.js +25 -0
- package/dist/api/graphql/create_deployment.js.map +1 -0
- package/dist/api/graphql/extension_create.d.ts +30 -0
- package/dist/api/graphql/extension_create.js +26 -0
- package/dist/api/graphql/extension_create.js.map +1 -0
- package/dist/api/graphql/extension_specifications.d.ts +27 -0
- package/dist/api/graphql/extension_specifications.js +22 -0
- package/dist/api/graphql/extension_specifications.js.map +1 -0
- package/dist/api/graphql/find_app.d.ts +14 -0
- package/dist/api/graphql/find_app.js +17 -0
- package/dist/api/graphql/find_app.js.map +1 -0
- package/dist/api/graphql/find_org.d.ts +18 -0
- package/dist/api/graphql/find_org.js +21 -0
- package/dist/api/graphql/find_org.js.map +1 -0
- package/dist/api/graphql/find_org_basic.d.ts +11 -0
- package/dist/api/graphql/find_org_basic.js +14 -0
- package/dist/api/graphql/find_org_basic.js.map +1 -0
- package/dist/api/graphql/find_store_by_domain.d.ts +21 -0
- package/dist/api/graphql/find_store_by_domain.js +24 -0
- package/dist/api/graphql/find_store_by_domain.js.map +1 -0
- package/dist/api/graphql/functions/api_schema_definition.d.ts +9 -0
- package/dist/api/graphql/functions/api_schema_definition.js +7 -0
- package/dist/api/graphql/functions/api_schema_definition.js.map +1 -0
- package/dist/api/graphql/functions/app_function_set.d.ts +30 -0
- package/dist/api/graphql/functions/app_function_set.js +38 -0
- package/dist/api/graphql/functions/app_function_set.js.map +1 -0
- package/dist/api/graphql/functions/function_service_proxy.d.ts +4 -0
- package/dist/api/graphql/functions/function_service_proxy.js +7 -0
- package/dist/api/graphql/functions/function_service_proxy.js.map +1 -0
- package/dist/api/graphql/functions/upload_url_generate.d.ts +12 -0
- package/dist/api/graphql/functions/upload_url_generate.js +11 -0
- package/dist/api/graphql/functions/upload_url_generate.js.map +1 -0
- package/dist/api/graphql/generate_signed_upload_url.d.ts +15 -0
- package/dist/api/graphql/generate_signed_upload_url.js +15 -0
- package/dist/api/graphql/generate_signed_upload_url.js.map +1 -0
- package/dist/api/graphql/get_urls.d.ts +10 -0
- package/dist/api/graphql/get_urls.js +10 -0
- package/dist/api/graphql/get_urls.js.map +1 -0
- package/dist/api/graphql/get_variant_id.d.ts +17 -0
- package/dist/api/graphql/get_variant_id.js +20 -0
- package/dist/api/graphql/get_variant_id.js.map +1 -0
- package/dist/api/graphql/index.d.ts +21 -0
- package/dist/api/graphql/index.js +22 -0
- package/dist/api/graphql/index.js.map +1 -0
- package/dist/api/graphql/update_draft.d.ts +33 -0
- package/dist/api/graphql/update_draft.js +24 -0
- package/dist/api/graphql/update_draft.js.map +1 -0
- package/dist/api/graphql/update_urls.d.ts +14 -0
- package/dist/api/graphql/update_urls.js +12 -0
- package/dist/api/graphql/update_urls.js.map +1 -0
- package/dist/api/identity.d.ts +1 -0
- package/dist/api/identity.js +41 -0
- package/dist/api/identity.js.map +1 -0
- package/dist/api/oxygen.d.ts +5 -0
- package/dist/api/oxygen.js +30 -0
- package/dist/api/oxygen.js.map +1 -0
- package/dist/api/partners.d.ts +14 -0
- package/dist/api/partners.js +44 -0
- package/dist/api/partners.js.map +1 -0
- package/dist/api.d.ts +6 -0
- package/dist/api.js +7 -0
- package/dist/api.js.map +1 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +18 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants.d.ts +52 -0
- package/dist/constants.js +71 -0
- package/dist/constants.js.map +1 -0
- package/dist/content-tokens.d.ts +44 -0
- package/dist/content-tokens.js +105 -0
- package/dist/content-tokens.js.map +1 -0
- package/dist/environment/fqdn.d.ts +29 -0
- package/dist/environment/fqdn.js +72 -0
- package/dist/environment/fqdn.js.map +1 -0
- package/dist/environment/local.d.ts +92 -0
- package/dist/environment/local.js +169 -0
- package/dist/environment/local.js.map +1 -0
- package/dist/environment/service.d.ts +4 -0
- package/dist/environment/service.js +19 -0
- package/dist/environment/service.js.map +1 -0
- package/dist/environment/spin-cache.d.ts +2 -0
- package/dist/environment/spin-cache.js +8 -0
- package/dist/environment/spin-cache.js.map +1 -0
- package/dist/environment/spin.d.ts +50 -0
- package/dist/environment/spin.js +99 -0
- package/dist/environment/spin.js.map +1 -0
- package/dist/environment/utilities.d.ts +8 -0
- package/dist/environment/utilities.js +19 -0
- package/dist/environment/utilities.js.map +1 -0
- package/dist/environment.d.ts +7 -0
- package/dist/environment.js +8 -0
- package/dist/environment.js.map +1 -0
- package/dist/error.d.ts +68 -0
- package/dist/error.js +143 -0
- package/dist/error.js.map +1 -0
- package/dist/file.d.ts +98 -0
- package/dist/file.js +216 -0
- package/dist/file.js.map +1 -0
- package/dist/git.d.ts +36 -0
- package/dist/git.js +133 -0
- package/dist/git.js.map +1 -0
- package/dist/http/fetch.d.ts +22 -0
- package/dist/http/fetch.js +44 -0
- package/dist/http/fetch.js.map +1 -0
- package/dist/http/formdata.d.ts +3 -0
- package/dist/http/formdata.js +6 -0
- package/dist/http/formdata.js.map +1 -0
- package/dist/http/graphql.d.ts +13 -0
- package/dist/http/graphql.js +12 -0
- package/dist/http/graphql.js.map +1 -0
- package/dist/http.d.ts +27 -0
- package/dist/http.js +32 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/metadata.d.ts +53 -0
- package/dist/metadata.js +62 -0
- package/dist/metadata.js.map +1 -0
- package/dist/monorail.d.ts +100 -0
- package/dist/monorail.js +39 -0
- package/dist/monorail.js.map +1 -0
- package/dist/network/api.d.ts +2 -0
- package/dist/network/api.js +2 -0
- package/dist/network/api.js.map +1 -0
- package/dist/network/service.d.ts +14 -0
- package/dist/network/service.js +11 -0
- package/dist/network/service.js.map +1 -0
- package/dist/npm.d.ts +27 -0
- package/dist/npm.js +20 -0
- package/dist/npm.js.map +1 -0
- package/dist/output.d.ts +129 -0
- package/dist/output.js +310 -0
- package/dist/output.js.map +1 -0
- package/dist/path.d.ts +25 -0
- package/dist/path.js +48 -0
- package/dist/path.js.map +1 -0
- package/dist/plugins.d.ts +73 -0
- package/dist/plugins.js +49 -0
- package/dist/plugins.js.map +1 -0
- package/dist/private/common/json.d.ts +6 -0
- package/dist/private/common/json.js +2 -0
- package/dist/private/common/json.js.map +1 -0
- package/dist/private/common/lodash.d.ts +47 -0
- package/dist/private/common/lodash.js +2 -0
- package/dist/private/common/lodash.js.map +1 -0
- package/dist/private/node/analytics.d.ts +27 -0
- package/dist/private/node/analytics.js +57 -0
- package/dist/private/node/analytics.js.map +1 -0
- package/dist/private/node/ui/alert.d.ts +2 -0
- package/dist/private/node/ui/alert.js +18 -0
- package/dist/private/node/ui/alert.js.map +1 -0
- package/dist/private/node/ui/components/Alert.d.ts +17 -0
- package/dist/private/node/ui/components/Alert.js +21 -0
- package/dist/private/node/ui/components/Alert.js.map +1 -0
- package/dist/private/node/ui/components/Alert.test.d.ts +1 -0
- package/dist/private/node/ui/components/Alert.test.js +95 -0
- package/dist/private/node/ui/components/Alert.test.js.map +1 -0
- package/dist/private/node/ui/components/Banner.d.ts +8 -0
- package/dist/private/node/ui/components/Banner.js +41 -0
- package/dist/private/node/ui/components/Banner.js.map +1 -0
- package/dist/private/node/ui/components/Banner.test.d.ts +1 -0
- package/dist/private/node/ui/components/Banner.test.js +52 -0
- package/dist/private/node/ui/components/Banner.test.js.map +1 -0
- package/dist/private/node/ui/components/Command.d.ts +9 -0
- package/dist/private/node/ui/components/Command.js +13 -0
- package/dist/private/node/ui/components/Command.js.map +1 -0
- package/dist/private/node/ui/components/Command.test.d.ts +1 -0
- package/dist/private/node/ui/components/Command.test.js +11 -0
- package/dist/private/node/ui/components/Command.test.js.map +1 -0
- package/dist/private/node/ui/components/ConcurrentOutput.d.ts +47 -0
- package/dist/private/node/ui/components/ConcurrentOutput.js +86 -0
- package/dist/private/node/ui/components/ConcurrentOutput.js.map +1 -0
- package/dist/private/node/ui/components/ConcurrentOutput.test.d.ts +1 -0
- package/dist/private/node/ui/components/ConcurrentOutput.test.js +54 -0
- package/dist/private/node/ui/components/ConcurrentOutput.test.js.map +1 -0
- package/dist/private/node/ui/components/FatalError.d.ts +7 -0
- package/dist/private/node/ui/components/FatalError.js +54 -0
- package/dist/private/node/ui/components/FatalError.js.map +1 -0
- package/dist/private/node/ui/components/FatalError.test.d.ts +1 -0
- package/dist/private/node/ui/components/FatalError.test.js +119 -0
- package/dist/private/node/ui/components/FatalError.test.js.map +1 -0
- package/dist/private/node/ui/components/FilePath.d.ts +9 -0
- package/dist/private/node/ui/components/FilePath.js +13 -0
- package/dist/private/node/ui/components/FilePath.js.map +1 -0
- package/dist/private/node/ui/components/FilePath.test.d.ts +1 -0
- package/dist/private/node/ui/components/FilePath.test.js +11 -0
- package/dist/private/node/ui/components/FilePath.test.js.map +1 -0
- package/dist/private/node/ui/components/FullScreen.d.ts +8 -0
- package/dist/private/node/ui/components/FullScreen.js +32 -0
- package/dist/private/node/ui/components/FullScreen.js.map +1 -0
- package/dist/private/node/ui/components/Link.d.ts +10 -0
- package/dist/private/node/ui/components/Link.js +15 -0
- package/dist/private/node/ui/components/Link.js.map +1 -0
- package/dist/private/node/ui/components/Link.test.d.ts +1 -0
- package/dist/private/node/ui/components/Link.test.js +22 -0
- package/dist/private/node/ui/components/Link.test.js.map +1 -0
- package/dist/private/node/ui/components/List.d.ts +13 -0
- package/dist/private/node/ui/components/List.js +19 -0
- package/dist/private/node/ui/components/List.js.map +1 -0
- package/dist/private/node/ui/components/List.test.d.ts +1 -0
- package/dist/private/node/ui/components/List.test.js +34 -0
- package/dist/private/node/ui/components/List.test.js.map +1 -0
- package/dist/private/node/ui/components/SelectInput.d.ts +12 -0
- package/dist/private/node/ui/components/SelectInput.js +87 -0
- package/dist/private/node/ui/components/SelectInput.js.map +1 -0
- package/dist/private/node/ui/components/SelectInput.test.d.ts +1 -0
- package/dist/private/node/ui/components/SelectInput.test.js +230 -0
- package/dist/private/node/ui/components/SelectInput.test.js.map +1 -0
- package/dist/private/node/ui/components/SelectPrompt.d.ts +11 -0
- package/dist/private/node/ui/components/SelectPrompt.js +34 -0
- package/dist/private/node/ui/components/SelectPrompt.js.map +1 -0
- package/dist/private/node/ui/components/SelectPrompt.test.d.ts +1 -0
- package/dist/private/node/ui/components/SelectPrompt.test.js +74 -0
- package/dist/private/node/ui/components/SelectPrompt.test.js.map +1 -0
- package/dist/private/node/ui/components/Table.d.ts +8 -0
- package/dist/private/node/ui/components/Table.js +17 -0
- package/dist/private/node/ui/components/Table.js.map +1 -0
- package/dist/private/node/ui/components/Tasks.d.ts +10 -0
- package/dist/private/node/ui/components/Tasks.js +27 -0
- package/dist/private/node/ui/components/Tasks.js.map +1 -0
- package/dist/private/node/ui/components/Tasks.test.d.ts +1 -0
- package/dist/private/node/ui/components/Tasks.test.js +50 -0
- package/dist/private/node/ui/components/Tasks.test.js.map +1 -0
- package/dist/private/node/ui/components/TextAnimation.d.ts +9 -0
- package/dist/private/node/ui/components/TextAnimation.js +35 -0
- package/dist/private/node/ui/components/TextAnimation.js.map +1 -0
- package/dist/private/node/ui/components/TextInput.d.ts +9 -0
- package/dist/private/node/ui/components/TextInput.js +74 -0
- package/dist/private/node/ui/components/TextInput.js.map +1 -0
- package/dist/private/node/ui/components/TextInput.test.d.ts +1 -0
- package/dist/private/node/ui/components/TextInput.test.js +139 -0
- package/dist/private/node/ui/components/TextInput.test.js.map +1 -0
- package/dist/private/node/ui/components/TextPrompt.d.ts +8 -0
- package/dist/private/node/ui/components/TextPrompt.js +52 -0
- package/dist/private/node/ui/components/TextPrompt.js.map +1 -0
- package/dist/private/node/ui/components/TextPrompt.test.d.ts +1 -0
- package/dist/private/node/ui/components/TextPrompt.test.js +68 -0
- package/dist/private/node/ui/components/TextPrompt.test.js.map +1 -0
- package/dist/private/node/ui/components/TokenizedText.d.ts +36 -0
- package/dist/private/node/ui/components/TokenizedText.js +70 -0
- package/dist/private/node/ui/components/TokenizedText.js.map +1 -0
- package/dist/private/node/ui/components/TokenizedText.test.d.ts +1 -0
- package/dist/private/node/ui/components/TokenizedText.test.js +44 -0
- package/dist/private/node/ui/components/TokenizedText.test.js.map +1 -0
- package/dist/private/node/ui/components/UserInput.d.ts +10 -0
- package/dist/private/node/ui/components/UserInput.js +11 -0
- package/dist/private/node/ui/components/UserInput.js.map +1 -0
- package/dist/private/node/ui/components/UserInput.test.d.ts +1 -0
- package/dist/private/node/ui/components/UserInput.test.js +11 -0
- package/dist/private/node/ui/components/UserInput.test.js.map +1 -0
- package/dist/private/node/ui/hooks/use-async-and-unmount.d.ts +6 -0
- package/dist/private/node/ui/hooks/use-async-and-unmount.js +17 -0
- package/dist/private/node/ui/hooks/use-async-and-unmount.js.map +1 -0
- package/dist/private/node/ui/hooks/use-layout.d.ts +6 -0
- package/dist/private/node/ui/hooks/use-layout.js +30 -0
- package/dist/private/node/ui/hooks/use-layout.js.map +1 -0
- package/dist/private/node/ui.d.ts +23 -0
- package/dist/private/node/ui.js +53 -0
- package/dist/private/node/ui.js.map +1 -0
- package/dist/public/common/array.d.ts +37 -0
- package/dist/public/common/array.js +51 -0
- package/dist/public/common/array.js.map +1 -0
- package/dist/public/common/collection.d.ts +23 -0
- package/dist/public/common/collection.js +29 -0
- package/dist/public/common/collection.js.map +1 -0
- package/dist/public/common/function.d.ts +30 -0
- package/dist/public/common/function.js +40 -0
- package/dist/public/common/function.js.map +1 -0
- package/dist/public/common/lang.d.ts +16 -0
- package/dist/public/common/lang.js +22 -0
- package/dist/public/common/lang.js.map +1 -0
- package/dist/public/common/object.d.ts +32 -0
- package/dist/public/common/object.js +45 -0
- package/dist/public/common/object.js.map +1 -0
- package/dist/public/common/string.d.ts +6 -0
- package/dist/public/common/string.js +109 -0
- package/dist/public/common/string.js.map +1 -0
- package/dist/public/common/url.d.ts +7 -0
- package/dist/public/common/url.js +17 -0
- package/dist/public/common/url.js.map +1 -0
- package/dist/public/node/abort.d.ts +16 -0
- package/dist/public/node/abort.js +17 -0
- package/dist/public/node/abort.js.map +1 -0
- package/dist/public/node/analytics.d.ts +13 -0
- package/dist/public/node/analytics.js +82 -0
- package/dist/public/node/analytics.js.map +1 -0
- package/dist/public/node/archiver.d.ts +9 -0
- package/dist/public/node/archiver.js +34 -0
- package/dist/public/node/archiver.js.map +1 -0
- package/dist/public/node/base-command.d.ts +26 -0
- package/dist/public/node/base-command.js +172 -0
- package/dist/public/node/base-command.js.map +1 -0
- package/dist/public/node/checksum.d.ts +20 -0
- package/dist/public/node/checksum.js +32 -0
- package/dist/public/node/checksum.js.map +1 -0
- package/dist/public/node/cli.d.ts +29 -0
- package/dist/public/node/cli.js +106 -0
- package/dist/public/node/cli.js.map +1 -0
- package/dist/public/node/colors.d.ts +2 -0
- package/dist/public/node/colors.js +3 -0
- package/dist/public/node/colors.js.map +1 -0
- package/dist/public/node/dot-env.d.ts +42 -0
- package/dist/public/node/dot-env.js +67 -0
- package/dist/public/node/dot-env.js.map +1 -0
- package/dist/public/node/error-handler.d.ts +41 -0
- package/dist/public/node/error-handler.js +198 -0
- package/dist/public/node/error-handler.js.map +1 -0
- package/dist/public/node/error.d.ts +4 -0
- package/dist/public/node/error.js +5 -0
- package/dist/public/node/error.js.map +1 -0
- package/dist/public/node/framework.d.ts +8 -0
- package/dist/public/node/framework.js +135 -0
- package/dist/public/node/framework.js.map +1 -0
- package/dist/public/node/fs.d.ts +17 -0
- package/dist/public/node/fs.js +21 -0
- package/dist/public/node/fs.js.map +1 -0
- package/dist/public/node/github.d.ts +50 -0
- package/dist/public/node/github.js +71 -0
- package/dist/public/node/github.js.map +1 -0
- package/dist/public/node/hooks/postrun.d.ts +2 -0
- package/dist/public/node/hooks/postrun.js +9 -0
- package/dist/public/node/hooks/postrun.js.map +1 -0
- package/dist/public/node/hooks/prerun.d.ts +12 -0
- package/dist/public/node/hooks/prerun.js +66 -0
- package/dist/public/node/hooks/prerun.js.map +1 -0
- package/dist/public/node/node-package-manager.d.ts +243 -0
- package/dist/public/node/node-package-manager.js +369 -0
- package/dist/public/node/node-package-manager.js.map +1 -0
- package/dist/public/node/os.d.ts +16 -0
- package/dist/public/node/os.js +77 -0
- package/dist/public/node/os.js.map +1 -0
- package/dist/public/node/plugins/tunnel.d.ts +47 -0
- package/dist/public/node/plugins/tunnel.js +19 -0
- package/dist/public/node/plugins/tunnel.js.map +1 -0
- package/dist/public/node/presets.d.ts +8 -0
- package/dist/public/node/presets.js +26 -0
- package/dist/public/node/presets.js.map +1 -0
- package/dist/public/node/result.d.ts +94 -0
- package/dist/public/node/result.js +134 -0
- package/dist/public/node/result.js.map +1 -0
- package/dist/public/node/ruby.d.ts +38 -0
- package/dist/public/node/ruby.js +234 -0
- package/dist/public/node/ruby.js.map +1 -0
- package/dist/public/node/semver.d.ts +3 -0
- package/dist/public/node/semver.js +6 -0
- package/dist/public/node/semver.js.map +1 -0
- package/dist/public/node/tcp.d.ts +5 -0
- package/dist/public/node/tcp.js +35 -0
- package/dist/public/node/tcp.js.map +1 -0
- package/dist/public/node/ui.d.ts +184 -0
- package/dist/public/node/ui.js +203 -0
- package/dist/public/node/ui.js.map +1 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.js +2 -0
- package/dist/schema.js.map +1 -0
- package/dist/secure-store.d.ts +19 -0
- package/dist/secure-store.js +63 -0
- package/dist/secure-store.js.map +1 -0
- package/dist/session/authorize.d.ts +7 -0
- package/dist/session/authorize.js +52 -0
- package/dist/session/authorize.js.map +1 -0
- package/dist/session/device-authorization.d.ts +32 -0
- package/dist/session/device-authorization.js +92 -0
- package/dist/session/device-authorization.js.map +1 -0
- package/dist/session/exchange.d.ts +48 -0
- package/dist/session/exchange.js +159 -0
- package/dist/session/exchange.js.map +1 -0
- package/dist/session/identity.d.ts +3 -0
- package/dist/session/identity.js +58 -0
- package/dist/session/identity.js.map +1 -0
- package/dist/session/post-auth.d.ts +13 -0
- package/dist/session/post-auth.js +62 -0
- package/dist/session/post-auth.js.map +1 -0
- package/dist/session/redirect-listener.d.ts +34 -0
- package/dist/session/redirect-listener.js +106 -0
- package/dist/session/redirect-listener.js.map +1 -0
- package/dist/session/schema.d.ts +175 -0
- package/dist/session/schema.js +60 -0
- package/dist/session/schema.js.map +1 -0
- package/dist/session/scopes.d.ts +16 -0
- package/dist/session/scopes.js +53 -0
- package/dist/session/scopes.js.map +1 -0
- package/dist/session/store.d.ts +24 -0
- package/dist/session/store.js +89 -0
- package/dist/session/store.js.map +1 -0
- package/dist/session/token.d.ts +40 -0
- package/dist/session/token.js +22 -0
- package/dist/session/token.js.map +1 -0
- package/dist/session/validate.d.ts +17 -0
- package/dist/session/validate.js +65 -0
- package/dist/session/validate.js.map +1 -0
- package/dist/session.d.ts +96 -0
- package/dist/session.js +293 -0
- package/dist/session.js.map +1 -0
- package/dist/store/schema.d.ts +3 -0
- package/dist/store/schema.js +27 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store.d.ts +53 -0
- package/dist/store.js +134 -0
- package/dist/store.js.map +1 -0
- package/dist/string.d.ts +28 -0
- package/dist/string.js +77 -0
- package/dist/string.js.map +1 -0
- package/dist/system.d.ts +51 -0
- package/dist/system.js +128 -0
- package/dist/system.js.map +1 -0
- package/dist/template.d.ts +11 -0
- package/dist/template.js +50 -0
- package/dist/template.js.map +1 -0
- package/dist/testing/output.d.ts +10 -0
- package/dist/testing/output.js +16 -0
- package/dist/testing/output.js.map +1 -0
- package/dist/testing/store.d.ts +7 -0
- package/dist/testing/store.js +26 -0
- package/dist/testing/store.js.map +1 -0
- package/dist/testing/ui.d.ts +5 -0
- package/dist/testing/ui.js +23 -0
- package/dist/testing/ui.js.map +1 -0
- package/dist/toml.d.ts +3 -0
- package/dist/toml.js +8 -0
- package/dist/toml.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/typing/deep-required.d.ts +12 -0
- package/dist/typing/deep-required.js +2 -0
- package/dist/typing/deep-required.js.map +1 -0
- package/dist/typing/overloaded-parameters.d.ts +6 -0
- package/dist/typing/overloaded-parameters.js +2 -0
- package/dist/typing/overloaded-parameters.js.map +1 -0
- package/dist/typing/pick-by-prefix.d.ts +12 -0
- package/dist/typing/pick-by-prefix.js +2 -0
- package/dist/typing/pick-by-prefix.js.map +1 -0
- package/dist/typing/simple-definitions.d.ts +4 -0
- package/dist/typing/simple-definitions.js +2 -0
- package/dist/typing/simple-definitions.js.map +1 -0
- package/dist/ui/executor.d.ts +14 -0
- package/dist/ui/executor.js +90 -0
- package/dist/ui/executor.js.map +1 -0
- package/dist/ui/inquirer/autocomplete.d.ts +11 -0
- package/dist/ui/inquirer/autocomplete.js +110 -0
- package/dist/ui/inquirer/autocomplete.js.map +1 -0
- package/dist/ui/inquirer/input.d.ts +16 -0
- package/dist/ui/inquirer/input.js +45 -0
- package/dist/ui/inquirer/input.js.map +1 -0
- package/dist/ui/inquirer/password.d.ts +7 -0
- package/dist/ui/inquirer/password.js +8 -0
- package/dist/ui/inquirer/password.js.map +1 -0
- package/dist/ui/inquirer/select.d.ts +14 -0
- package/dist/ui/inquirer/select.js +26 -0
- package/dist/ui/inquirer/select.js.map +1 -0
- package/dist/ui.d.ts +54 -0
- package/dist/ui.js +128 -0
- package/dist/ui.js.map +1 -0
- package/dist/vscode.d.ts +8 -0
- package/dist/vscode.js +36 -0
- package/dist/vscode.js.map +1 -0
- package/package.json +177 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import BaseCommand from '../../public/node/base-command.js';
|
|
2
|
+
import { CommandContent } from '../../public/node/hooks/prerun.js';
|
|
3
|
+
import { Interfaces } from '@oclif/core';
|
|
4
|
+
interface StartOptions {
|
|
5
|
+
commandContent: CommandContent;
|
|
6
|
+
args: string[];
|
|
7
|
+
currentTime?: number;
|
|
8
|
+
commandClass?: Interfaces.Command.Class | typeof BaseCommand;
|
|
9
|
+
}
|
|
10
|
+
export declare function startAnalytics({ commandContent, args, currentTime, commandClass, }: StartOptions): Promise<void>;
|
|
11
|
+
interface EnvironmentData {
|
|
12
|
+
uname: string;
|
|
13
|
+
env_ci: boolean;
|
|
14
|
+
env_ci_platform?: string;
|
|
15
|
+
env_plugin_installed_any_custom: boolean;
|
|
16
|
+
env_plugin_installed_shopify: string;
|
|
17
|
+
env_shell: string;
|
|
18
|
+
env_web_ide: string | undefined;
|
|
19
|
+
env_device_id: string;
|
|
20
|
+
env_cloud: string;
|
|
21
|
+
env_package_manager: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function getEnvironmentData(config: Interfaces.Config): Promise<EnvironmentData>;
|
|
24
|
+
export declare function getSensitiveEnvironmentData(config: Interfaces.Config): Promise<{
|
|
25
|
+
env_plugin_installed_all: string;
|
|
26
|
+
}>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { getPackageManager, packageManagerUsedForCreating } from '../../public/node/node-package-manager.js';
|
|
2
|
+
import * as metadata from '../../metadata.js';
|
|
3
|
+
import { macAddress } from '../../environment/local.js';
|
|
4
|
+
import { platformAndArch } from '../../public/node/os.js';
|
|
5
|
+
import { hashString } from '../../string.js';
|
|
6
|
+
import * as environment from '../../environment.js';
|
|
7
|
+
export async function startAnalytics({ commandContent, args, currentTime = new Date().getTime(), commandClass, }) {
|
|
8
|
+
let startCommand = commandContent.command;
|
|
9
|
+
if (commandClass && Object.prototype.hasOwnProperty.call(commandClass, 'analyticsNameOverride')) {
|
|
10
|
+
startCommand = commandClass.analyticsNameOverride() ?? commandContent.command;
|
|
11
|
+
}
|
|
12
|
+
await metadata.addSensitive(() => ({
|
|
13
|
+
commandStartOptions: {
|
|
14
|
+
startTime: currentTime,
|
|
15
|
+
startCommand,
|
|
16
|
+
startArgs: args,
|
|
17
|
+
},
|
|
18
|
+
}));
|
|
19
|
+
await metadata.addPublic(() => ({
|
|
20
|
+
cmd_all_launcher: packageManagerUsedForCreating(),
|
|
21
|
+
cmd_all_alias_used: commandContent.alias,
|
|
22
|
+
cmd_all_topic: commandContent.topic,
|
|
23
|
+
cmd_all_plugin: commandClass?.plugin?.name,
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
export async function getEnvironmentData(config) {
|
|
27
|
+
const ciPlatform = environment.local.ciPlatform();
|
|
28
|
+
const pluginNames = getPluginNames(config);
|
|
29
|
+
const shopifyPlugins = pluginNames.filter((plugin) => plugin.startsWith('@shopify/'));
|
|
30
|
+
const { platform, arch } = platformAndArch();
|
|
31
|
+
return {
|
|
32
|
+
uname: `${platform} ${arch}`,
|
|
33
|
+
env_ci: ciPlatform.isCI,
|
|
34
|
+
env_ci_platform: ciPlatform.name,
|
|
35
|
+
env_plugin_installed_any_custom: pluginNames.length !== shopifyPlugins.length,
|
|
36
|
+
env_plugin_installed_shopify: JSON.stringify(shopifyPlugins),
|
|
37
|
+
env_shell: config.shell,
|
|
38
|
+
env_web_ide: environment.local.cloudEnvironment().editor
|
|
39
|
+
? environment.local.cloudEnvironment().platform
|
|
40
|
+
: undefined,
|
|
41
|
+
env_device_id: hashString(await macAddress()),
|
|
42
|
+
env_cloud: environment.local.cloudEnvironment().platform,
|
|
43
|
+
env_package_manager: await getPackageManager(process.cwd()),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export async function getSensitiveEnvironmentData(config) {
|
|
47
|
+
return {
|
|
48
|
+
env_plugin_installed_all: JSON.stringify(getPluginNames(config)),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function getPluginNames(config) {
|
|
52
|
+
return config.plugins
|
|
53
|
+
.map((plugin) => plugin.name)
|
|
54
|
+
.sort()
|
|
55
|
+
.filter((plugin) => !plugin.startsWith('@oclif/'));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../../src/private/node/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,6BAA6B,EAAC,MAAM,2CAA2C,CAAA;AAG1G,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAA;AAC1C,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAA;AAUnD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EACnC,cAAc,EACd,IAAI,EACJ,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,EAClC,YAAY,GACC;IACb,IAAI,YAAY,GAAW,cAAc,CAAC,OAAO,CAAA;IACjD,IAAI,YAAY,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,EAAE,uBAAuB,CAAC,EAAE;QAC/F,YAAY,GAAI,YAAmC,CAAC,qBAAqB,EAAE,IAAI,cAAc,CAAC,OAAO,CAAA;KACtG;IAED,MAAM,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC;QACjC,mBAAmB,EAAE;YACnB,SAAS,EAAE,WAAW;YACtB,YAAY;YACZ,SAAS,EAAE,IAAI;SAChB;KACF,CAAC,CAAC,CAAA;IAEH,MAAM,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC;QAC9B,gBAAgB,EAAE,6BAA6B,EAAE;QACjD,kBAAkB,EAAE,cAAc,CAAC,KAAK;QACxC,aAAa,EAAE,cAAc,CAAC,KAAK;QACnC,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI;KAC3C,CAAC,CAAC,CAAA;AACL,CAAC;AAeD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAyB;IAChE,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,CAAA;IAEjD,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;IAC1C,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAA;IAErF,MAAM,EAAC,QAAQ,EAAE,IAAI,EAAC,GAAG,eAAe,EAAE,CAAA;IAE1C,OAAO;QACL,KAAK,EAAE,GAAG,QAAQ,IAAI,IAAI,EAAE;QAC5B,MAAM,EAAE,UAAU,CAAC,IAAI;QACvB,eAAe,EAAE,UAAU,CAAC,IAAI;QAChC,+BAA+B,EAAE,WAAW,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM;QAC7E,4BAA4B,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;QAC5D,SAAS,EAAE,MAAM,CAAC,KAAK;QACvB,WAAW,EAAE,WAAW,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,MAAM;YACtD,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,QAAQ;YAC/C,CAAC,CAAC,SAAS;QACb,aAAa,EAAE,UAAU,CAAC,MAAM,UAAU,EAAE,CAAC;QAC7C,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,QAAQ;QACxD,mBAAmB,EAAE,MAAM,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;KAC5D,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,MAAyB;IACzE,OAAO;QACL,wBAAwB,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;KACjE,CAAA;AACH,CAAC;AAED,SAAS,cAAc,CAAC,MAAyB;IAC/C,OAAO,MAAM,CAAC,OAAO;SAClB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;SAC5B,IAAI,EAAE;SACN,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAA;AACtD,CAAC","sourcesContent":["import {getPackageManager, packageManagerUsedForCreating} from '../../public/node/node-package-manager.js'\nimport BaseCommand from '../../public/node/base-command.js'\nimport {CommandContent} from '../../public/node/hooks/prerun.js'\nimport * as metadata from '../../metadata.js'\nimport {macAddress} from '../../environment/local.js'\nimport {platformAndArch} from '../../public/node/os.js'\nimport {hashString} from '../../string.js'\nimport * as environment from '../../environment.js'\nimport {Interfaces} from '@oclif/core'\n\ninterface StartOptions {\n commandContent: CommandContent\n args: string[]\n currentTime?: number\n commandClass?: Interfaces.Command.Class | typeof BaseCommand\n}\n\nexport async function startAnalytics({\n commandContent,\n args,\n currentTime = new Date().getTime(),\n commandClass,\n}: StartOptions): Promise<void> {\n let startCommand: string = commandContent.command\n if (commandClass && Object.prototype.hasOwnProperty.call(commandClass, 'analyticsNameOverride')) {\n startCommand = (commandClass as typeof BaseCommand).analyticsNameOverride() ?? commandContent.command\n }\n\n await metadata.addSensitive(() => ({\n commandStartOptions: {\n startTime: currentTime,\n startCommand,\n startArgs: args,\n },\n }))\n\n await metadata.addPublic(() => ({\n cmd_all_launcher: packageManagerUsedForCreating(),\n cmd_all_alias_used: commandContent.alias,\n cmd_all_topic: commandContent.topic,\n cmd_all_plugin: commandClass?.plugin?.name,\n }))\n}\n\ninterface EnvironmentData {\n uname: string\n env_ci: boolean\n env_ci_platform?: string\n env_plugin_installed_any_custom: boolean\n env_plugin_installed_shopify: string\n env_shell: string\n env_web_ide: string | undefined\n env_device_id: string\n env_cloud: string\n env_package_manager: string\n}\n\nexport async function getEnvironmentData(config: Interfaces.Config): Promise<EnvironmentData> {\n const ciPlatform = environment.local.ciPlatform()\n\n const pluginNames = getPluginNames(config)\n const shopifyPlugins = pluginNames.filter((plugin) => plugin.startsWith('@shopify/'))\n\n const {platform, arch} = platformAndArch()\n\n return {\n uname: `${platform} ${arch}`,\n env_ci: ciPlatform.isCI,\n env_ci_platform: ciPlatform.name,\n env_plugin_installed_any_custom: pluginNames.length !== shopifyPlugins.length,\n env_plugin_installed_shopify: JSON.stringify(shopifyPlugins),\n env_shell: config.shell,\n env_web_ide: environment.local.cloudEnvironment().editor\n ? environment.local.cloudEnvironment().platform\n : undefined,\n env_device_id: hashString(await macAddress()),\n env_cloud: environment.local.cloudEnvironment().platform,\n env_package_manager: await getPackageManager(process.cwd()),\n }\n}\n\nexport async function getSensitiveEnvironmentData(config: Interfaces.Config) {\n return {\n env_plugin_installed_all: JSON.stringify(getPluginNames(config)),\n }\n}\n\nfunction getPluginNames(config: Interfaces.Config) {\n return config.plugins\n .map((plugin) => plugin.name)\n .sort()\n .filter((plugin) => !plugin.startsWith('@oclif/'))\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Alert } from './components/Alert.js';
|
|
2
|
+
import { renderOnce } from '../ui.js';
|
|
3
|
+
import { consoleLog, consoleWarn } from '../../../output.js';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
const typeToLogLevel = {
|
|
6
|
+
info: 'info',
|
|
7
|
+
warning: 'warn',
|
|
8
|
+
success: 'info',
|
|
9
|
+
};
|
|
10
|
+
const typeToLogger = {
|
|
11
|
+
info: consoleLog,
|
|
12
|
+
warning: consoleWarn,
|
|
13
|
+
success: consoleLog,
|
|
14
|
+
};
|
|
15
|
+
export function alert({ type, headline, body, nextSteps, reference, link, orderedNextSteps = false }) {
|
|
16
|
+
renderOnce(React.createElement(Alert, { type: type, headline: headline, body: body, nextSteps: nextSteps, reference: reference, link: link, orderedNextSteps: orderedNextSteps }), typeToLogLevel[type], typeToLogger[type]);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../../src/private/node/ui/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAa,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAA;AACnC,OAAO,EAAC,UAAU,EAAE,WAAW,EAAmB,MAAM,oBAAoB,CAAA;AAC5E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,cAAc,GAA4C;IAC9D,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,MAAM;CAChB,CAAA;AAED,MAAM,YAAY,GAA0C;IAC1D,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,UAAU;CACpB,CAAA;AAED,MAAM,UAAU,KAAK,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,GAAG,KAAK,EAAa;IAC5G,UAAU,CACR,oBAAC,KAAK,IACJ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,gBAAgB,GAClC,EACF,cAAc,CAAC,IAAI,CAAC,EACpB,YAAY,CAAC,IAAI,CAAC,CACnB,CAAA;AACH,CAAC","sourcesContent":["import {Alert, AlertProps} from './components/Alert.js'\nimport {renderOnce} from '../ui.js'\nimport {consoleLog, consoleWarn, Logger, LogLevel} from '../../../output.js'\nimport React from 'react'\n\nconst typeToLogLevel: {[key in AlertProps['type']]: LogLevel} = {\n info: 'info',\n warning: 'warn',\n success: 'info',\n}\n\nconst typeToLogger: {[key in AlertProps['type']]: Logger} = {\n info: consoleLog,\n warning: consoleWarn,\n success: consoleLog,\n}\n\nexport function alert({type, headline, body, nextSteps, reference, link, orderedNextSteps = false}: AlertProps) {\n renderOnce(\n <Alert\n type={type}\n headline={headline}\n body={body}\n nextSteps={nextSteps}\n reference={reference}\n link={link}\n orderedNextSteps={orderedNextSteps}\n />,\n typeToLogLevel[type],\n typeToLogger[type],\n )\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BannerType } from './Banner.js';
|
|
2
|
+
import { TokenItem } from './TokenizedText.js';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export interface AlertProps {
|
|
5
|
+
type: Exclude<BannerType, 'error' | 'external_error'>;
|
|
6
|
+
headline: TokenItem;
|
|
7
|
+
body?: TokenItem;
|
|
8
|
+
nextSteps?: TokenItem[];
|
|
9
|
+
reference?: TokenItem[];
|
|
10
|
+
link?: {
|
|
11
|
+
label: string;
|
|
12
|
+
url: string;
|
|
13
|
+
};
|
|
14
|
+
orderedNextSteps?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const Alert: React.FC<AlertProps>;
|
|
17
|
+
export { Alert };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Banner } from './Banner.js';
|
|
2
|
+
import { Link } from './Link.js';
|
|
3
|
+
import { List } from './List.js';
|
|
4
|
+
import { TokenizedText } from './TokenizedText.js';
|
|
5
|
+
import { Box } from 'ink';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
const Alert = ({ type, headline, body, nextSteps, reference, link, orderedNextSteps = false }) => {
|
|
8
|
+
return (React.createElement(Banner, { type: type, marginY: 1 },
|
|
9
|
+
React.createElement(Box, null,
|
|
10
|
+
React.createElement(TokenizedText, { item: headline })),
|
|
11
|
+
body && (React.createElement(Box, { marginTop: 1 },
|
|
12
|
+
React.createElement(TokenizedText, { item: body }))),
|
|
13
|
+
nextSteps && (React.createElement(Box, { marginTop: 1 },
|
|
14
|
+
React.createElement(List, { title: "Next steps", items: nextSteps, ordered: orderedNextSteps }))),
|
|
15
|
+
reference && (React.createElement(Box, { marginTop: 1 },
|
|
16
|
+
React.createElement(List, { title: "Reference", items: reference }))),
|
|
17
|
+
link && (React.createElement(Box, { marginTop: 1 },
|
|
18
|
+
React.createElement(Link, { url: link.url, label: link.label })))));
|
|
19
|
+
};
|
|
20
|
+
export { Alert };
|
|
21
|
+
//# sourceMappingURL=Alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/components/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAa,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,EAAY,aAAa,EAAC,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,MAAM,OAAO,CAAA;AAezB,MAAM,KAAK,GAAyB,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,GAAG,KAAK,EAAC,EAAE,EAAE;IACnH,OAAO,CACL,oBAAC,MAAM,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC5B,oBAAC,GAAG;YACF,oBAAC,aAAa,IAAC,IAAI,EAAE,QAAQ,GAAI,CAC7B;QAEL,IAAI,IAAI,CACP,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,aAAa,IAAC,IAAI,EAAE,IAAI,GAAI,CACzB,CACP;QAEA,SAAS,IAAI,CACZ,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,KAAK,EAAC,YAAY,EAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAI,CACpE,CACP;QAEA,SAAS,IAAI,CACZ,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,KAAK,EAAC,WAAW,EAAC,KAAK,EAAE,SAAS,GAAI,CACxC,CACP;QAEA,IAAI,IAAI,CACP,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI,CACtC,CACP,CACM,CACV,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAC,KAAK,EAAC,CAAA","sourcesContent":["import {Banner, BannerType} from './Banner.js'\nimport {Link} from './Link.js'\nimport {List} from './List.js'\nimport {TokenItem, TokenizedText} from './TokenizedText.js'\nimport {Box} from 'ink'\nimport React from 'react'\n\nexport interface AlertProps {\n type: Exclude<BannerType, 'error' | 'external_error'>\n headline: TokenItem\n body?: TokenItem\n nextSteps?: TokenItem[]\n reference?: TokenItem[]\n link?: {\n label: string\n url: string\n }\n orderedNextSteps?: boolean\n}\n\nconst Alert: React.FC<AlertProps> = ({type, headline, body, nextSteps, reference, link, orderedNextSteps = false}) => {\n return (\n <Banner type={type} marginY={1}>\n <Box>\n <TokenizedText item={headline} />\n </Box>\n\n {body && (\n <Box marginTop={1}>\n <TokenizedText item={body} />\n </Box>\n )}\n\n {nextSteps && (\n <Box marginTop={1}>\n <List title=\"Next steps\" items={nextSteps} ordered={orderedNextSteps} />\n </Box>\n )}\n\n {reference && (\n <Box marginTop={1}>\n <List title=\"Reference\" items={reference} />\n </Box>\n )}\n\n {link && (\n <Box marginTop={1}>\n <Link url={link.url} label={link.label} />\n </Box>\n )}\n </Banner>\n )\n}\n\nexport {Alert}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Alert } from './Alert.js';
|
|
2
|
+
import { unstyled } from '../../../../output.js';
|
|
3
|
+
import { describe, expect, test } from 'vitest';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { render } from 'ink-testing-library';
|
|
6
|
+
describe('Alert', async () => {
|
|
7
|
+
test('renders correctly with all the options', async () => {
|
|
8
|
+
const options = {
|
|
9
|
+
headline: [{ userInput: 'my-app' }, 'initialized and ready to build.'],
|
|
10
|
+
body: ['You can find the build files in the ', { filePath: 'dist' }, 'folder.'],
|
|
11
|
+
nextSteps: [
|
|
12
|
+
[
|
|
13
|
+
'Run',
|
|
14
|
+
{
|
|
15
|
+
command: 'cd santorini-goods',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
'To preview your project, run',
|
|
20
|
+
{
|
|
21
|
+
command: 'npm app dev',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
'To add extensions, run',
|
|
26
|
+
{
|
|
27
|
+
command: 'npm generate extension',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
],
|
|
31
|
+
reference: [
|
|
32
|
+
[
|
|
33
|
+
'Run',
|
|
34
|
+
{
|
|
35
|
+
command: 'npm shopify help',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
// testing link wrapping behavior
|
|
40
|
+
"Press 'return' to open the really amazing and clean",
|
|
41
|
+
{
|
|
42
|
+
link: {
|
|
43
|
+
label: 'dev docs',
|
|
44
|
+
url: 'https://shopify.dev',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
],
|
|
49
|
+
link: {
|
|
50
|
+
label: 'Link',
|
|
51
|
+
url: 'https://shopify.com',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
const { lastFrame } = render(React.createElement(Alert, { type: "info", ...options }));
|
|
55
|
+
expect(unstyled(lastFrame())).toMatchInlineSnapshot(`
|
|
56
|
+
"
|
|
57
|
+
╭─ info ───────────────────────────────────────────────────────────────────────╮
|
|
58
|
+
│ │
|
|
59
|
+
│ my-app initialized and ready to build. │
|
|
60
|
+
│ │
|
|
61
|
+
│ You can find the build files in the \\"dist\\" folder. │
|
|
62
|
+
│ │
|
|
63
|
+
│ Next steps │
|
|
64
|
+
│ • Run \`cd santorini-goods\` │
|
|
65
|
+
│ • To preview your project, run \`npm app dev\` │
|
|
66
|
+
│ • To add extensions, run \`npm generate extension\` │
|
|
67
|
+
│ │
|
|
68
|
+
│ Reference │
|
|
69
|
+
│ • Run \`npm shopify help\` │
|
|
70
|
+
│ • Press 'return' to open the really amazing and clean dev docs ( │
|
|
71
|
+
│ https://shopify.dev ) │
|
|
72
|
+
│ │
|
|
73
|
+
│ Link ( https://shopify.com ) │
|
|
74
|
+
│ │
|
|
75
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
76
|
+
"
|
|
77
|
+
`);
|
|
78
|
+
});
|
|
79
|
+
test('renders correctly with only required options', async () => {
|
|
80
|
+
const options = {
|
|
81
|
+
headline: 'Title',
|
|
82
|
+
};
|
|
83
|
+
const { lastFrame } = render(React.createElement(Alert, { type: "info", ...options }));
|
|
84
|
+
expect(unstyled(lastFrame())).toMatchInlineSnapshot(`
|
|
85
|
+
"
|
|
86
|
+
╭─ info ───────────────────────────────────────────────────────────────────────╮
|
|
87
|
+
│ │
|
|
88
|
+
│ Title │
|
|
89
|
+
│ │
|
|
90
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
91
|
+
"
|
|
92
|
+
`);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=Alert.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.test.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/components/Alert.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAA;AAE1C,QAAQ,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;IAC3B,IAAI,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,OAAO,GAAG;YACd,QAAQ,EAAE,CAAC,EAAC,SAAS,EAAE,QAAQ,EAAC,EAAE,iCAAiC,CAAC;YACpE,IAAI,EAAE,CAAC,sCAAsC,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,EAAE,SAAS,CAAC;YAC7E,SAAS,EAAE;gBACT;oBACE,KAAK;oBACL;wBACE,OAAO,EAAE,oBAAoB;qBAC9B;iBACF;gBACD;oBACE,8BAA8B;oBAC9B;wBACE,OAAO,EAAE,aAAa;qBACvB;iBACF;gBACD;oBACE,wBAAwB;oBACxB;wBACE,OAAO,EAAE,wBAAwB;qBAClC;iBACF;aACF;YACD,SAAS,EAAE;gBACT;oBACE,KAAK;oBACL;wBACE,OAAO,EAAE,kBAAkB;qBAC5B;iBACF;gBACD;oBACE,iCAAiC;oBACjC,qDAAqD;oBACrD;wBACE,IAAI,EAAE;4BACJ,KAAK,EAAE,UAAU;4BACjB,GAAG,EAAE,qBAAqB;yBAC3B;qBACF;iBACF;aACF;YACD,IAAI,EAAE;gBACJ,KAAK,EAAE,MAAM;gBACb,GAAG,EAAE,qBAAqB;aAC3B;SACF,CAAA;QAED,MAAM,EAAC,SAAS,EAAC,GAAG,MAAM,CAAC,oBAAC,KAAK,IAAC,IAAI,EAAC,MAAM,KAAK,OAAO,GAAI,CAAC,CAAA;QAE9D,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;KAsBpD,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC9D,MAAM,OAAO,GAAG;YACd,QAAQ,EAAE,OAAO;SAClB,CAAA;QAED,MAAM,EAAC,SAAS,EAAC,GAAG,MAAM,CAAC,oBAAC,KAAK,IAAC,IAAI,EAAC,MAAM,KAAK,OAAO,GAAI,CAAC,CAAA;QAE9D,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;KAQpD,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import {Alert} from './Alert.js'\nimport {unstyled} from '../../../../output.js'\nimport {describe, expect, test} from 'vitest'\nimport React from 'react'\nimport {render} from 'ink-testing-library'\n\ndescribe('Alert', async () => {\n test('renders correctly with all the options', async () => {\n const options = {\n headline: [{userInput: 'my-app'}, 'initialized and ready to build.'],\n body: ['You can find the build files in the ', {filePath: 'dist'}, 'folder.'],\n nextSteps: [\n [\n 'Run',\n {\n command: 'cd santorini-goods',\n },\n ],\n [\n 'To preview your project, run',\n {\n command: 'npm app dev',\n },\n ],\n [\n 'To add extensions, run',\n {\n command: 'npm generate extension',\n },\n ],\n ],\n reference: [\n [\n 'Run',\n {\n command: 'npm shopify help',\n },\n ],\n [\n // testing link wrapping behavior\n \"Press 'return' to open the really amazing and clean\",\n {\n link: {\n label: 'dev docs',\n url: 'https://shopify.dev',\n },\n },\n ],\n ],\n link: {\n label: 'Link',\n url: 'https://shopify.com',\n },\n }\n\n const {lastFrame} = render(<Alert type=\"info\" {...options} />)\n\n expect(unstyled(lastFrame()!)).toMatchInlineSnapshot(`\n \"\n ╭─ info ───────────────────────────────────────────────────────────────────────╮\n │ │\n │ my-app initialized and ready to build. │\n │ │\n │ You can find the build files in the \\\\\"dist\\\\\" folder. │\n │ │\n │ Next steps │\n │ • Run \\`cd santorini-goods\\` │\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 │ • Press 'return' to open the really amazing and clean dev docs ( │\n │ https://shopify.dev ) │\n │ │\n │ Link ( https://shopify.com ) │\n │ │\n ╰──────────────────────────────────────────────────────────────────────────────╯\n \"\n `)\n })\n\n test('renders correctly with only required options', async () => {\n const options = {\n headline: 'Title',\n }\n\n const {lastFrame} = render(<Alert type=\"info\" {...options} />)\n\n expect(unstyled(lastFrame()!)).toMatchInlineSnapshot(`\n \"\n ╭─ info ───────────────────────────────────────────────────────────────────────╮\n │ │\n │ Title │\n │ │\n ╰──────────────────────────────────────────────────────────────────────────────╯\n \"\n `)\n })\n})\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import useLayout from '../hooks/use-layout.js';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
function typeToColor(type) {
|
|
5
|
+
return {
|
|
6
|
+
success: 'green',
|
|
7
|
+
error: 'red',
|
|
8
|
+
warning: 'yellow',
|
|
9
|
+
info: 'dim',
|
|
10
|
+
external_error: 'red',
|
|
11
|
+
}[type];
|
|
12
|
+
}
|
|
13
|
+
const BoxWithBorder = ({ type, marginY, children }) => {
|
|
14
|
+
const { twoThirds } = useLayout();
|
|
15
|
+
return (React.createElement(Box, { width: twoThirds, paddingY: 1, paddingX: 2, marginY: marginY, borderStyle: "round", flexDirection: "column", borderColor: typeToColor(type) },
|
|
16
|
+
React.createElement(Box, { marginTop: -2, marginBottom: 1, marginLeft: -1 },
|
|
17
|
+
React.createElement(Text, null, ` ${type.replace(/_/g, ' ')} `)),
|
|
18
|
+
children));
|
|
19
|
+
};
|
|
20
|
+
const BoxWithTopBottomLines = ({ type, marginY, children }) => {
|
|
21
|
+
const { twoThirds } = useLayout();
|
|
22
|
+
return (React.createElement(Box, { marginY: marginY, flexDirection: "column" },
|
|
23
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
24
|
+
React.createElement(Text, null,
|
|
25
|
+
React.createElement(Text, { color: typeToColor(type) }, '─'.repeat(2)),
|
|
26
|
+
React.createElement(Text, null, ` ${type.replace(/_/g, ' ')} `),
|
|
27
|
+
React.createElement(Text, { color: typeToColor(type) }, '─'.repeat(twoThirds - 2 - type.length - 2)))),
|
|
28
|
+
children,
|
|
29
|
+
React.createElement(Box, { marginTop: 1 },
|
|
30
|
+
React.createElement(Text, { color: typeToColor(type) }, '─'.repeat(twoThirds)))));
|
|
31
|
+
};
|
|
32
|
+
const Banner = ({ children, ...props }) => {
|
|
33
|
+
if (props.type === 'external_error') {
|
|
34
|
+
return React.createElement(BoxWithTopBottomLines, props, children);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return React.createElement(BoxWithBorder, props, children);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
export { Banner };
|
|
41
|
+
//# sourceMappingURL=Banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/components/Banner.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,SAAS,WAAW,CAAC,IAAmB;IACtC,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,QAAQ;QACjB,IAAI,EAAE,KAAK;QACX,cAAc,EAAE,KAAK;KACtB,CAAC,IAAI,CAAC,CAAA;AACT,CAAC;AAED,MAAM,aAAa,GAAoB,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAC,EAAE,EAAE;IACnE,MAAM,EAAC,SAAS,EAAC,GAAG,SAAS,EAAE,CAAA;IAE/B,OAAO,CACL,oBAAC,GAAG,IACF,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,OAAO,EAChB,WAAW,EAAC,OAAO,EACnB,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC;QAE9B,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;YACjD,oBAAC,IAAI,QAAE,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAQ,CACzC;QACL,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAoB,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAC,EAAE,EAAE;IAC3E,MAAM,EAAC,SAAS,EAAC,GAAG,SAAS,EAAE,CAAA;IAE/B,OAAO,CACL,oBAAC,GAAG,IAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAC,QAAQ;QAC3C,oBAAC,GAAG,IAAC,YAAY,EAAE,CAAC;YAClB,oBAAC,IAAI;gBACH,oBAAC,IAAI,IAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,IAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAQ;gBACtD,oBAAC,IAAI,QAAE,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAQ;gBAE7C,oBAAC,IAAI,IAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,IAAG,GAAG,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAQ,CAC/E,CACH;QAEL,QAAQ;QAET,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,IAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAQ,CAC1D,CACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAoB,CAAC,EAAC,QAAQ,EAAE,GAAG,KAAK,EAAC,EAAE,EAAE;IACvD,IAAI,KAAK,CAAC,IAAI,KAAK,gBAAgB,EAAE;QACnC,OAAO,KAAK,CAAC,aAAa,CAAC,qBAAqB,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAA;KACnE;SAAM;QACL,OAAO,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAA;KAC3D;AACH,CAAC,CAAA;AAED,OAAO,EAAC,MAAM,EAAC,CAAA","sourcesContent":["import useLayout from '../hooks/use-layout.js'\nimport {Box, Text} from 'ink'\nimport React from 'react'\n\nexport type BannerType = 'success' | 'error' | 'warning' | 'info' | 'external_error'\n\ninterface Props {\n type: BannerType\n marginY?: number\n}\n\nfunction typeToColor(type: Props['type']) {\n return {\n success: 'green',\n error: 'red',\n warning: 'yellow',\n info: 'dim',\n external_error: 'red',\n }[type]\n}\n\nconst BoxWithBorder: React.FC<Props> = ({type, marginY, children}) => {\n const {twoThirds} = useLayout()\n\n return (\n <Box\n width={twoThirds}\n paddingY={1}\n paddingX={2}\n marginY={marginY}\n borderStyle=\"round\"\n flexDirection=\"column\"\n borderColor={typeToColor(type)}\n >\n <Box marginTop={-2} marginBottom={1} marginLeft={-1}>\n <Text>{` ${type.replace(/_/g, ' ')} `}</Text>\n </Box>\n {children}\n </Box>\n )\n}\n\nconst BoxWithTopBottomLines: React.FC<Props> = ({type, marginY, children}) => {\n const {twoThirds} = useLayout()\n\n return (\n <Box marginY={marginY} flexDirection=\"column\">\n <Box marginBottom={1}>\n <Text>\n <Text color={typeToColor(type)}>{'─'.repeat(2)}</Text>\n <Text>{` ${type.replace(/_/g, ' ')} `}</Text>\n {/* 2 initial dashes + 2 spaces surrounding the type */}\n <Text color={typeToColor(type)}>{'─'.repeat(twoThirds - 2 - type.length - 2)}</Text>\n </Text>\n </Box>\n\n {children}\n\n <Box marginTop={1}>\n <Text color={typeToColor(type)}>{'─'.repeat(twoThirds)}</Text>\n </Box>\n </Box>\n )\n}\n\nconst Banner: React.FC<Props> = ({children, ...props}) => {\n if (props.type === 'external_error') {\n return React.createElement(BoxWithTopBottomLines, props, children)\n } else {\n return React.createElement(BoxWithBorder, props, children)\n }\n}\n\nexport {Banner}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Banner } from './Banner.js';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { render } from 'ink-testing-library';
|
|
5
|
+
describe('Banner', async () => {
|
|
6
|
+
test('renders with a border for success', async () => {
|
|
7
|
+
const { lastFrame } = render(React.createElement(Banner, { type: "success" }));
|
|
8
|
+
expect(lastFrame()).toMatchInlineSnapshot(`
|
|
9
|
+
"[32m╭─[39m success [32m────────────────────────────────────────────────────────────────────╮[39m
|
|
10
|
+
[32m│[39m [32m│[39m
|
|
11
|
+
[32m│[39m [32m│[39m
|
|
12
|
+
[32m╰──────────────────────────────────────────────────────────────────────────────╯[39m"
|
|
13
|
+
`);
|
|
14
|
+
});
|
|
15
|
+
test('renders with a border for info', async () => {
|
|
16
|
+
const { lastFrame } = render(React.createElement(Banner, { type: "info" }));
|
|
17
|
+
expect(lastFrame()).toMatchInlineSnapshot(`
|
|
18
|
+
"[2m╭─[22m info [2m───────────────────────────────────────────────────────────────────────╮[22m
|
|
19
|
+
[2m│[22m [2m│[22m
|
|
20
|
+
[2m│[22m [2m│[22m
|
|
21
|
+
[2m╰──────────────────────────────────────────────────────────────────────────────╯[22m"
|
|
22
|
+
`);
|
|
23
|
+
});
|
|
24
|
+
test('renders with a border for warning', async () => {
|
|
25
|
+
const { lastFrame } = render(React.createElement(Banner, { type: "warning" }));
|
|
26
|
+
expect(lastFrame()).toMatchInlineSnapshot(`
|
|
27
|
+
"[33m╭─[39m warning [33m────────────────────────────────────────────────────────────────────╮[39m
|
|
28
|
+
[33m│[39m [33m│[39m
|
|
29
|
+
[33m│[39m [33m│[39m
|
|
30
|
+
[33m╰──────────────────────────────────────────────────────────────────────────────╯[39m"
|
|
31
|
+
`);
|
|
32
|
+
});
|
|
33
|
+
test('renders with a border for error', async () => {
|
|
34
|
+
const { lastFrame } = render(React.createElement(Banner, { type: "error" }));
|
|
35
|
+
expect(lastFrame()).toMatchInlineSnapshot(`
|
|
36
|
+
"[31m╭─[39m error [31m──────────────────────────────────────────────────────────────────────╮[39m
|
|
37
|
+
[31m│[39m [31m│[39m
|
|
38
|
+
[31m│[39m [31m│[39m
|
|
39
|
+
[31m╰──────────────────────────────────────────────────────────────────────────────╯[39m"
|
|
40
|
+
`);
|
|
41
|
+
});
|
|
42
|
+
test('renders with a top and bottom lines only for external errors', async () => {
|
|
43
|
+
const { lastFrame } = render(React.createElement(Banner, { type: "external_error" }));
|
|
44
|
+
expect(lastFrame()).toMatchInlineSnapshot(`
|
|
45
|
+
"[31m──[39m external error [31m──────────────────────────────────────────────────────────────[39m
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
[31m────────────────────────────────────────────────────────────────────────────────[39m"
|
|
49
|
+
`);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=Banner.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Banner.test.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/components/Banner.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAA;AAClC,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAA;AAE1C,QAAQ,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,IAAI,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,EAAC,SAAS,EAAC,GAAG,MAAM,CAAC,oBAAC,MAAM,IAAC,IAAI,EAAC,SAAS,GAAG,CAAC,CAAA;QAErD,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,qBAAqB,CAAC;;;;;KAKzC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,EAAC,SAAS,EAAC,GAAG,MAAM,CAAC,oBAAC,MAAM,IAAC,IAAI,EAAC,MAAM,GAAG,CAAC,CAAA;QAClD,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,qBAAqB,CAAC;;;;;KAKzC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,EAAC,SAAS,EAAC,GAAG,MAAM,CAAC,oBAAC,MAAM,IAAC,IAAI,EAAC,SAAS,GAAG,CAAC,CAAA;QACrD,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,qBAAqB,CAAC;;;;;KAKzC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,EAAC,SAAS,EAAC,GAAG,MAAM,CAAC,oBAAC,MAAM,IAAC,IAAI,EAAC,OAAO,GAAG,CAAC,CAAA;QACnD,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,qBAAqB,CAAC;;;;;KAKzC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,8DAA8D,EAAE,KAAK,IAAI,EAAE;QAC9E,MAAM,EAAC,SAAS,EAAC,GAAG,MAAM,CAAC,oBAAC,MAAM,IAAC,IAAI,EAAC,gBAAgB,GAAG,CAAC,CAAA;QAE5D,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,qBAAqB,CAAC;;;;;KAKzC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import {Banner} from './Banner.js'\nimport {describe, expect, test} from 'vitest'\nimport React from 'react'\nimport {render} from 'ink-testing-library'\n\ndescribe('Banner', async () => {\n test('renders with a border for success', async () => {\n const {lastFrame} = render(<Banner type=\"success\" />)\n\n expect(lastFrame()).toMatchInlineSnapshot(`\n \"\u001b[32m╭─\u001b[39m success \u001b[32m────────────────────────────────────────────────────────────────────╮\u001b[39m\n \u001b[32m│\u001b[39m \u001b[32m│\u001b[39m\n \u001b[32m│\u001b[39m \u001b[32m│\u001b[39m\n \u001b[32m╰──────────────────────────────────────────────────────────────────────────────╯\u001b[39m\"\n `)\n })\n\n test('renders with a border for info', async () => {\n const {lastFrame} = render(<Banner type=\"info\" />)\n expect(lastFrame()).toMatchInlineSnapshot(`\n \"\u001b[2m╭─\u001b[22m info \u001b[2m───────────────────────────────────────────────────────────────────────╮\u001b[22m\n \u001b[2m│\u001b[22m \u001b[2m│\u001b[22m\n \u001b[2m│\u001b[22m \u001b[2m│\u001b[22m\n \u001b[2m╰──────────────────────────────────────────────────────────────────────────────╯\u001b[22m\"\n `)\n })\n\n test('renders with a border for warning', async () => {\n const {lastFrame} = render(<Banner type=\"warning\" />)\n expect(lastFrame()).toMatchInlineSnapshot(`\n \"\u001b[33m╭─\u001b[39m warning \u001b[33m────────────────────────────────────────────────────────────────────╮\u001b[39m\n \u001b[33m│\u001b[39m \u001b[33m│\u001b[39m\n \u001b[33m│\u001b[39m \u001b[33m│\u001b[39m\n \u001b[33m╰──────────────────────────────────────────────────────────────────────────────╯\u001b[39m\"\n `)\n })\n\n test('renders with a border for error', async () => {\n const {lastFrame} = render(<Banner type=\"error\" />)\n expect(lastFrame()).toMatchInlineSnapshot(`\n \"\u001b[31m╭─\u001b[39m error \u001b[31m──────────────────────────────────────────────────────────────────────╮\u001b[39m\n \u001b[31m│\u001b[39m \u001b[31m│\u001b[39m\n \u001b[31m│\u001b[39m \u001b[31m│\u001b[39m\n \u001b[31m╰──────────────────────────────────────────────────────────────────────────────╯\u001b[39m\"\n `)\n })\n\n test('renders with a top and bottom lines only for external errors', async () => {\n const {lastFrame} = render(<Banner type=\"external_error\" />)\n\n expect(lastFrame()).toMatchInlineSnapshot(`\n \"\u001b[31m──\u001b[39m external error \u001b[31m──────────────────────────────────────────────────────────────\u001b[39m\n\n\n \u001b[31m────────────────────────────────────────────────────────────────────────────────\u001b[39m\"\n `)\n })\n})\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Text } from 'ink';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* `Command` displays a command as non-dimmed text.
|
|
5
|
+
*/
|
|
6
|
+
const Command = ({ command }) => {
|
|
7
|
+
return React.createElement(Text, null,
|
|
8
|
+
"`",
|
|
9
|
+
command,
|
|
10
|
+
"`");
|
|
11
|
+
};
|
|
12
|
+
export { Command };
|
|
13
|
+
//# sourceMappingURL=Command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Command.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/components/Command.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB;;GAEG;AACH,MAAM,OAAO,GAAoB,CAAC,EAAC,OAAO,EAAC,EAAe,EAAE;IAC1D,OAAO,oBAAC,IAAI;;QAAG,OAAO;YAAS,CAAA;AACjC,CAAC,CAAA;AAED,OAAO,EAAC,OAAO,EAAC,CAAA","sourcesContent":["import {Text} from 'ink'\nimport React from 'react'\n\ninterface Props {\n command: string\n}\n\n/**\n * `Command` displays a command as non-dimmed text.\n */\nconst Command: React.FC<Props> = ({command}): JSX.Element => {\n return <Text>`{command}`</Text>\n}\n\nexport {Command}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from './Command.js';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { render } from 'ink-testing-library';
|
|
5
|
+
describe('Command', async () => {
|
|
6
|
+
test('renders correctly', async () => {
|
|
7
|
+
const { lastFrame } = render(React.createElement(Command, { command: "npm install" }));
|
|
8
|
+
expect(lastFrame()).toMatchInlineSnapshot('"`npm install`"');
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=Command.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Command.test.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/components/Command.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAA;AACpC,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAA;AAE1C,QAAQ,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IAC7B,IAAI,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;QACnC,MAAM,EAAC,SAAS,EAAC,GAAG,MAAM,CAAC,oBAAC,OAAO,IAAC,OAAO,EAAC,aAAa,GAAG,CAAC,CAAA;QAE7D,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,CAAA;IAC9D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import {Command} from './Command.js'\nimport {describe, expect, test} from 'vitest'\nimport React from 'react'\nimport {render} from 'ink-testing-library'\n\ndescribe('Command', async () => {\n test('renders correctly', async () => {\n const {lastFrame} = render(<Command command=\"npm install\" />)\n\n expect(lastFrame()).toMatchInlineSnapshot('\"`npm install`\"')\n })\n})\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { OutputProcess } from '../../../../output.js';
|
|
3
|
+
import { AbortController } from '../../../../public/node/abort.js';
|
|
4
|
+
import { FunctionComponent } from 'react';
|
|
5
|
+
import { Writable } from 'stream';
|
|
6
|
+
export declare type WritableStream = (process: OutputProcess, index: number) => Writable;
|
|
7
|
+
interface Props {
|
|
8
|
+
processes: OutputProcess[];
|
|
9
|
+
abortController: AbortController;
|
|
10
|
+
showTimestamps?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Renders output from concurrent processes to the terminal.
|
|
14
|
+
* Output will be divided in a three column layout
|
|
15
|
+
* with the left column containing the timestamp,
|
|
16
|
+
* the right column containing the output,
|
|
17
|
+
* and the middle column containing the process prefix.
|
|
18
|
+
* Every process will be rendered with a different color, up to 4 colors.
|
|
19
|
+
*
|
|
20
|
+
* For example running `shopify app dev`:
|
|
21
|
+
*
|
|
22
|
+
* ```shell
|
|
23
|
+
* 2022-10-10 13:11:03 | backend | npm
|
|
24
|
+
* 2022-10-10 13:11:03 | backend | WARN ignoring workspace config at ...
|
|
25
|
+
* 2022-10-10 13:11:03 | backend |
|
|
26
|
+
* 2022-10-10 13:11:03 | backend |
|
|
27
|
+
* 2022-10-10 13:11:03 | backend | > shopify-app-template-node@0.1.0 dev
|
|
28
|
+
* 2022-10-10 13:11:03 | backend | > cross-env NODE_ENV=development nodemon backend/index.js --watch ./backend
|
|
29
|
+
* 2022-10-10 13:11:03 | backend |
|
|
30
|
+
* 2022-10-10 13:11:03 | backend |
|
|
31
|
+
* 2022-10-10 13:11:03 | frontend |
|
|
32
|
+
* 2022-10-10 13:11:03 | frontend | > starter-react-frontend-app@0.1.0 dev
|
|
33
|
+
* 2022-10-10 13:11:03 | frontend | > cross-env NODE_ENV=development node vite-server.js
|
|
34
|
+
* 2022-10-10 13:11:03 | frontend |
|
|
35
|
+
* 2022-10-10 13:11:03 | frontend |
|
|
36
|
+
* 2022-10-10 13:11:03 | backend | [nodemon] 2.0.19
|
|
37
|
+
* 2022-10-10 13:11:03 | backend |
|
|
38
|
+
* 2022-10-10 13:11:03 | backend | [nodemon] to restart at any time, enter `rs`
|
|
39
|
+
* 2022-10-10 13:11:03 | backend | [nodemon] watching path(s): backend/
|
|
40
|
+
* 2022-10-10 13:11:03 | backend | [nodemon] watching extensions: js,mjs,json
|
|
41
|
+
* 2022-10-10 13:11:03 | backend | [nodemon] starting `node backend/index.js`
|
|
42
|
+
* 2022-10-10 13:11:03 | backend |
|
|
43
|
+
*
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare const ConcurrentOutput: FunctionComponent<Props>;
|
|
47
|
+
export default ConcurrentOutput;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import useAsyncAndUnmount from '../hooks/use-async-and-unmount.js';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { Box, Static, Text } from 'ink';
|
|
4
|
+
import stripAnsi from 'strip-ansi';
|
|
5
|
+
import { Writable } from 'stream';
|
|
6
|
+
/**
|
|
7
|
+
* Renders output from concurrent processes to the terminal.
|
|
8
|
+
* Output will be divided in a three column layout
|
|
9
|
+
* with the left column containing the timestamp,
|
|
10
|
+
* the right column containing the output,
|
|
11
|
+
* and the middle column containing the process prefix.
|
|
12
|
+
* Every process will be rendered with a different color, up to 4 colors.
|
|
13
|
+
*
|
|
14
|
+
* For example running `shopify app dev`:
|
|
15
|
+
*
|
|
16
|
+
* ```shell
|
|
17
|
+
* 2022-10-10 13:11:03 | backend | npm
|
|
18
|
+
* 2022-10-10 13:11:03 | backend | WARN ignoring workspace config at ...
|
|
19
|
+
* 2022-10-10 13:11:03 | backend |
|
|
20
|
+
* 2022-10-10 13:11:03 | backend |
|
|
21
|
+
* 2022-10-10 13:11:03 | backend | > shopify-app-template-node@0.1.0 dev
|
|
22
|
+
* 2022-10-10 13:11:03 | backend | > cross-env NODE_ENV=development nodemon backend/index.js --watch ./backend
|
|
23
|
+
* 2022-10-10 13:11:03 | backend |
|
|
24
|
+
* 2022-10-10 13:11:03 | backend |
|
|
25
|
+
* 2022-10-10 13:11:03 | frontend |
|
|
26
|
+
* 2022-10-10 13:11:03 | frontend | > starter-react-frontend-app@0.1.0 dev
|
|
27
|
+
* 2022-10-10 13:11:03 | frontend | > cross-env NODE_ENV=development node vite-server.js
|
|
28
|
+
* 2022-10-10 13:11:03 | frontend |
|
|
29
|
+
* 2022-10-10 13:11:03 | frontend |
|
|
30
|
+
* 2022-10-10 13:11:03 | backend | [nodemon] 2.0.19
|
|
31
|
+
* 2022-10-10 13:11:03 | backend |
|
|
32
|
+
* 2022-10-10 13:11:03 | backend | [nodemon] to restart at any time, enter `rs`
|
|
33
|
+
* 2022-10-10 13:11:03 | backend | [nodemon] watching path(s): backend/
|
|
34
|
+
* 2022-10-10 13:11:03 | backend | [nodemon] watching extensions: js,mjs,json
|
|
35
|
+
* 2022-10-10 13:11:03 | backend | [nodemon] starting `node backend/index.js`
|
|
36
|
+
* 2022-10-10 13:11:03 | backend |
|
|
37
|
+
*
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
const ConcurrentOutput = ({ processes, abortController, showTimestamps = true }) => {
|
|
41
|
+
const [processOutput, setProcessOutput] = useState([]);
|
|
42
|
+
const concurrentColors = ['yellow', 'cyan', 'magenta', 'green', 'blue'];
|
|
43
|
+
const prefixColumnSize = Math.max(...processes.map((process) => process.prefix.length));
|
|
44
|
+
function lineColor(index) {
|
|
45
|
+
const colorIndex = index < concurrentColors.length ? index : index % concurrentColors.length;
|
|
46
|
+
return concurrentColors[colorIndex];
|
|
47
|
+
}
|
|
48
|
+
const writableStream = (process, index) => {
|
|
49
|
+
return new Writable({
|
|
50
|
+
write(chunk, _encoding, next) {
|
|
51
|
+
const lines = stripAnsi(chunk.toString('ascii').replace(/(\n)$/, '')).split(/\n/);
|
|
52
|
+
setProcessOutput((previousProcessOutput) => [
|
|
53
|
+
...previousProcessOutput,
|
|
54
|
+
{
|
|
55
|
+
color: lineColor(index),
|
|
56
|
+
prefix: process.prefix,
|
|
57
|
+
lines,
|
|
58
|
+
},
|
|
59
|
+
]);
|
|
60
|
+
next();
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const runProcesses = () => {
|
|
65
|
+
return Promise.all(processes.map(async (process, index) => {
|
|
66
|
+
const stdout = writableStream(process, index);
|
|
67
|
+
const stderr = writableStream(process, index);
|
|
68
|
+
await process.action(stdout, stderr, abortController.signal);
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
71
|
+
useAsyncAndUnmount(runProcesses, { onRejected: () => abortController.abort() });
|
|
72
|
+
return (React.createElement(Static, { items: processOutput }, (chunk, index) => {
|
|
73
|
+
return (React.createElement(Box, { flexDirection: "column", key: index }, chunk.lines.map((line, index) => (React.createElement(Box, { key: index, flexDirection: "row" },
|
|
74
|
+
showTimestamps && (React.createElement(Box, null,
|
|
75
|
+
React.createElement(Box, { marginRight: 1 },
|
|
76
|
+
React.createElement(Text, { color: chunk.color }, new Date().toISOString().replace(/T/, ' ').replace(/\..+/, ''))),
|
|
77
|
+
React.createElement(Text, { bold: true, color: chunk.color }, "|"))),
|
|
78
|
+
React.createElement(Box, { width: prefixColumnSize, marginX: 1 },
|
|
79
|
+
React.createElement(Text, { color: chunk.color }, chunk.prefix)),
|
|
80
|
+
React.createElement(Text, { bold: true, color: chunk.color }, "|"),
|
|
81
|
+
React.createElement(Box, { flexGrow: 1, paddingLeft: 1 },
|
|
82
|
+
React.createElement(Text, { color: chunk.color }, line)))))));
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
export default ConcurrentOutput;
|
|
86
|
+
//# sourceMappingURL=ConcurrentOutput.js.map
|