shopify-cli 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +11 -0
- data/Dockerfile +0 -2
- data/Gemfile.lock +22 -16
- data/Rakefile +7 -16
- data/bin/console +11 -0
- data/bin/shopify +15 -3
- data/dev.yml +3 -0
- data/ext/shopify-cli/extconf.rb +2 -0
- data/lib/project_types/extension/cli.rb +2 -0
- data/lib/project_types/extension/commands/build.rb +2 -1
- data/lib/project_types/extension/features/argo.rb +1 -1
- data/lib/project_types/extension/features/argo_serve.rb +1 -0
- data/lib/project_types/extension/models/development_server.rb +4 -0
- data/lib/project_types/extension/models/development_server_requirements.rb +1 -2
- data/lib/project_types/extension/models/specification_handlers/default.rb +4 -0
- data/lib/project_types/extension/tasks/converters/server_config_converter.rb +31 -0
- data/lib/project_types/extension/tasks/find_npm_packages.rb +2 -2
- data/lib/project_types/extension/tasks/load_server_config.rb +23 -0
- data/lib/project_types/extension/tasks/run_extension_command.rb +26 -10
- data/lib/project_types/node/commands/serve.rb +9 -1
- data/lib/project_types/node/messages/messages.rb +3 -0
- data/lib/project_types/script/cli.rb +4 -3
- data/lib/project_types/script/commands/create.rb +2 -0
- data/lib/project_types/script/config/extension_points.yml +30 -29
- data/lib/project_types/script/layers/application/create_script.rb +32 -12
- data/lib/project_types/script/layers/application/extension_points.rb +3 -3
- data/lib/project_types/script/layers/domain/extension_point.rb +13 -45
- data/lib/project_types/script/layers/infrastructure/api_clients/partners_proxy_api_client.rb +4 -2
- data/lib/project_types/script/layers/infrastructure/api_clients/script_service_api_client.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/errors.rb +5 -0
- data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb +10 -90
- data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +76 -11
- data/lib/project_types/script/layers/infrastructure/languages/task_runner.rb +1 -1
- data/lib/project_types/script/layers/infrastructure/languages/typescript_project_creator.rb +33 -0
- data/lib/project_types/script/layers/infrastructure/languages/typescript_task_runner.rb +105 -0
- data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +1 -1
- data/lib/project_types/script/messages/messages.rb +4 -0
- data/lib/project_types/script/ui/error_handler.rb +8 -0
- data/lib/shopify_cli/command/app_sub_command.rb +16 -0
- data/lib/shopify_cli/constants.rb +33 -5
- data/lib/shopify_cli/core/executor.rb +5 -1
- data/lib/shopify_cli/environment.rb +35 -4
- data/lib/shopify_cli/exception_reporter/permission_controller.rb +54 -0
- data/lib/shopify_cli/exception_reporter.rb +55 -0
- data/lib/shopify_cli/git.rb +30 -0
- data/lib/shopify_cli/messages/messages.rb +27 -1
- data/lib/shopify_cli/method_object.rb +11 -4
- data/lib/shopify_cli/migrator/migration.rb +27 -0
- data/lib/shopify_cli/migrator/migrations/1631709766_noop.rb +13 -0
- data/lib/shopify_cli/migrator.rb +48 -0
- data/lib/shopify_cli/version.rb +1 -1
- data/lib/shopify_cli.rb +11 -3
- data/shopify-cli.gemspec +9 -1
- data/utilities/docker.rb +47 -0
- data/utilities/utilities.rb +5 -0
- metadata +31 -6
- data/lib/project_types/script/layers/infrastructure/languages/rust_project_creator.rb +0 -73
- data/lib/project_types/script/layers/infrastructure/languages/rust_task_runner.rb +0 -60
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: shopify-cli
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2. | 
| 4 | 
            +
              version: 2.6.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Shopify
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2021- | 
| 11 | 
            +
            date: 2021-10-06 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -58,6 +58,20 @@ dependencies: | |
| 58 58 | 
             
                - - "~>"
         | 
| 59 59 | 
             
                  - !ruby/object:Gem::Version
         | 
| 60 60 | 
             
                    version: '5.0'
         | 
| 61 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 62 | 
            +
              name: bugsnag
         | 
| 63 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 64 | 
            +
                requirements:
         | 
| 65 | 
            +
                - - "~>"
         | 
| 66 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 67 | 
            +
                    version: '6.22'
         | 
| 68 | 
            +
              type: :runtime
         | 
| 69 | 
            +
              prerelease: false
         | 
| 70 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 71 | 
            +
                requirements:
         | 
| 72 | 
            +
                - - "~>"
         | 
| 73 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 74 | 
            +
                    version: '6.22'
         | 
| 61 75 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 62 76 | 
             
              name: listen
         | 
| 63 77 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -78,14 +92,14 @@ dependencies: | |
| 78 92 | 
             
                requirements:
         | 
| 79 93 | 
             
                - - "~>"
         | 
| 80 94 | 
             
                  - !ruby/object:Gem::Version
         | 
| 81 | 
            -
                    version: 1. | 
| 95 | 
            +
                    version: '1.7'
         | 
| 82 96 | 
             
              type: :runtime
         | 
| 83 97 | 
             
              prerelease: false
         | 
| 84 98 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 85 99 | 
             
                requirements:
         | 
| 86 100 | 
             
                - - "~>"
         | 
| 87 101 | 
             
                  - !ruby/object:Gem::Version
         | 
| 88 | 
            -
                    version: 1. | 
| 102 | 
            +
                    version: '1.7'
         | 
| 89 103 | 
             
            description: |
         | 
| 90 104 | 
             
              Shopify CLI helps you build Shopify apps faster. It quickly scaffolds Node.js
         | 
| 91 105 | 
             
              and Ruby on Rails embedded apps. It also automates many common tasks in the
         | 
| @@ -124,6 +138,7 @@ files: | |
| 124 138 | 
             
            - Rakefile
         | 
| 125 139 | 
             
            - SECURITY.md
         | 
| 126 140 | 
             
            - THEMEKIT_MIGRATION.md
         | 
| 141 | 
            +
            - bin/console
         | 
| 127 142 | 
             
            - bin/load_shopify.rb
         | 
| 128 143 | 
             
            - bin/shopify
         | 
| 129 144 | 
             
            - dev.yml
         | 
| @@ -229,6 +244,7 @@ files: | |
| 229 244 | 
             
            - lib/project_types/extension/tasks/converters/app_converter.rb
         | 
| 230 245 | 
             
            - lib/project_types/extension/tasks/converters/product_converter.rb
         | 
| 231 246 | 
             
            - lib/project_types/extension/tasks/converters/registration_converter.rb
         | 
| 247 | 
            +
            - lib/project_types/extension/tasks/converters/server_config_converter.rb
         | 
| 232 248 | 
             
            - lib/project_types/extension/tasks/converters/validation_error_converter.rb
         | 
| 233 249 | 
             
            - lib/project_types/extension/tasks/converters/version_converter.rb
         | 
| 234 250 | 
             
            - lib/project_types/extension/tasks/create_extension.rb
         | 
| @@ -238,6 +254,7 @@ files: | |
| 238 254 | 
             
            - lib/project_types/extension/tasks/get_apps.rb
         | 
| 239 255 | 
             
            - lib/project_types/extension/tasks/get_extensions.rb
         | 
| 240 256 | 
             
            - lib/project_types/extension/tasks/get_product.rb
         | 
| 257 | 
            +
            - lib/project_types/extension/tasks/load_server_config.rb
         | 
| 241 258 | 
             
            - lib/project_types/extension/tasks/run_extension_command.rb
         | 
| 242 259 | 
             
            - lib/project_types/extension/tasks/update_draft.rb
         | 
| 243 260 | 
             
            - lib/project_types/extension/tasks/user_errors.rb
         | 
| @@ -306,9 +323,9 @@ files: | |
| 306 323 | 
             
            - lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb
         | 
| 307 324 | 
             
            - lib/project_types/script/layers/infrastructure/languages/assemblyscript_task_runner.rb
         | 
| 308 325 | 
             
            - lib/project_types/script/layers/infrastructure/languages/project_creator.rb
         | 
| 309 | 
            -
            - lib/project_types/script/layers/infrastructure/languages/rust_project_creator.rb
         | 
| 310 | 
            -
            - lib/project_types/script/layers/infrastructure/languages/rust_task_runner.rb
         | 
| 311 326 | 
             
            - lib/project_types/script/layers/infrastructure/languages/task_runner.rb
         | 
| 327 | 
            +
            - lib/project_types/script/layers/infrastructure/languages/typescript_project_creator.rb
         | 
| 328 | 
            +
            - lib/project_types/script/layers/infrastructure/languages/typescript_task_runner.rb
         | 
| 312 329 | 
             
            - lib/project_types/script/layers/infrastructure/push_package_repository.rb
         | 
| 313 330 | 
             
            - lib/project_types/script/layers/infrastructure/script_project_repository.rb
         | 
| 314 331 | 
             
            - lib/project_types/script/layers/infrastructure/script_service.rb
         | 
| @@ -340,6 +357,7 @@ files: | |
| 340 357 | 
             
            - lib/shopify_cli/admin_api/schema.rb
         | 
| 341 358 | 
             
            - lib/shopify_cli/api.rb
         | 
| 342 359 | 
             
            - lib/shopify_cli/command.rb
         | 
| 360 | 
            +
            - lib/shopify_cli/command/app_sub_command.rb
         | 
| 343 361 | 
             
            - lib/shopify_cli/commands.rb
         | 
| 344 362 | 
             
            - lib/shopify_cli/commands/config.rb
         | 
| 345 363 | 
             
            - lib/shopify_cli/commands/help.rb
         | 
| @@ -365,6 +383,8 @@ files: | |
| 365 383 | 
             
            - lib/shopify_cli/core/monorail.rb
         | 
| 366 384 | 
             
            - lib/shopify_cli/db.rb
         | 
| 367 385 | 
             
            - lib/shopify_cli/environment.rb
         | 
| 386 | 
            +
            - lib/shopify_cli/exception_reporter.rb
         | 
| 387 | 
            +
            - lib/shopify_cli/exception_reporter/permission_controller.rb
         | 
| 368 388 | 
             
            - lib/shopify_cli/feature.rb
         | 
| 369 389 | 
             
            - lib/shopify_cli/form.rb
         | 
| 370 390 | 
             
            - lib/shopify_cli/git.rb
         | 
| @@ -379,6 +399,9 @@ files: | |
| 379 399 | 
             
            - lib/shopify_cli/lazy_delegator.rb
         | 
| 380 400 | 
             
            - lib/shopify_cli/messages/messages.rb
         | 
| 381 401 | 
             
            - lib/shopify_cli/method_object.rb
         | 
| 402 | 
            +
            - lib/shopify_cli/migrator.rb
         | 
| 403 | 
            +
            - lib/shopify_cli/migrator/migration.rb
         | 
| 404 | 
            +
            - lib/shopify_cli/migrator/migrations/1631709766_noop.rb
         | 
| 382 405 | 
             
            - lib/shopify_cli/options.rb
         | 
| 383 406 | 
             
            - lib/shopify_cli/packager.rb
         | 
| 384 407 | 
             
            - lib/shopify_cli/partners_api.rb
         | 
| @@ -427,6 +450,8 @@ files: | |
| 427 450 | 
             
            - shopify-cli.gemspec
         | 
| 428 451 | 
             
            - shopify.fish
         | 
| 429 452 | 
             
            - shopify.sh
         | 
| 453 | 
            +
            - utilities/docker.rb
         | 
| 454 | 
            +
            - utilities/utilities.rb
         | 
| 430 455 | 
             
            - vendor/deps/cli-kit/REVISION
         | 
| 431 456 | 
             
            - vendor/deps/cli-kit/lib/cli/kit.rb
         | 
| 432 457 | 
             
            - vendor/deps/cli-kit/lib/cli/kit/autocall.rb
         | 
| @@ -1,73 +0,0 @@ | |
| 1 | 
            -
            # frozen_string_literal: true
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            module Script
         | 
| 4 | 
            -
              module Layers
         | 
| 5 | 
            -
                module Infrastructure
         | 
| 6 | 
            -
                  module Languages
         | 
| 7 | 
            -
                    class RustProjectCreator
         | 
| 8 | 
            -
                      include SmartProperties
         | 
| 9 | 
            -
                      property! :ctx, accepts: ShopifyCLI::Context
         | 
| 10 | 
            -
                      property! :extension_point, accepts: Domain::ExtensionPoint
         | 
| 11 | 
            -
                      property! :script_name, accepts: String
         | 
| 12 | 
            -
                      property! :path_to_project, accepts: String
         | 
| 13 | 
            -
             | 
| 14 | 
            -
                      ORIGIN_BRANCH = "main"
         | 
| 15 | 
            -
                      SAMPLE_PATH = "default"
         | 
| 16 | 
            -
             | 
| 17 | 
            -
                      def setup_dependencies
         | 
| 18 | 
            -
                        git_init
         | 
| 19 | 
            -
                        setup_remote
         | 
| 20 | 
            -
                        setup_sparse_checkout
         | 
| 21 | 
            -
                        pull
         | 
| 22 | 
            -
                        clean
         | 
| 23 | 
            -
                        set_script_name
         | 
| 24 | 
            -
                      end
         | 
| 25 | 
            -
             | 
| 26 | 
            -
                      def bootstrap
         | 
| 27 | 
            -
                      end
         | 
| 28 | 
            -
             | 
| 29 | 
            -
                      private
         | 
| 30 | 
            -
             | 
| 31 | 
            -
                      def command_runner
         | 
| 32 | 
            -
                        @command_runner ||= CommandRunner.new(ctx: ctx)
         | 
| 33 | 
            -
                      end
         | 
| 34 | 
            -
             | 
| 35 | 
            -
                      def git_init
         | 
| 36 | 
            -
                        command_runner.call("git init")
         | 
| 37 | 
            -
                      end
         | 
| 38 | 
            -
             | 
| 39 | 
            -
                      def setup_remote
         | 
| 40 | 
            -
                        repo = extension_point.sdks.rust.package
         | 
| 41 | 
            -
                        command_runner.call("git remote add -f origin #{repo}")
         | 
| 42 | 
            -
                      end
         | 
| 43 | 
            -
             | 
| 44 | 
            -
                      def setup_sparse_checkout
         | 
| 45 | 
            -
                        type = extension_point.type
         | 
| 46 | 
            -
                        command_runner.call("git config core.sparsecheckout true")
         | 
| 47 | 
            -
                        command_runner.call("echo #{type}/#{SAMPLE_PATH} >> .git/info/sparse-checkout")
         | 
| 48 | 
            -
                      end
         | 
| 49 | 
            -
             | 
| 50 | 
            -
                      def pull
         | 
| 51 | 
            -
                        command_runner.call("git pull origin #{ORIGIN_BRANCH}")
         | 
| 52 | 
            -
                      end
         | 
| 53 | 
            -
             | 
| 54 | 
            -
                      def clean
         | 
| 55 | 
            -
                        type = extension_point.type
         | 
| 56 | 
            -
                        ctx.rm_rf(".git")
         | 
| 57 | 
            -
                        source = File.join(path_to_project, File.join(type, SAMPLE_PATH))
         | 
| 58 | 
            -
                        FileUtils.copy_entry(source, path_to_project)
         | 
| 59 | 
            -
                        ctx.rm_rf(type)
         | 
| 60 | 
            -
                      end
         | 
| 61 | 
            -
             | 
| 62 | 
            -
                      def set_script_name
         | 
| 63 | 
            -
                        config_file = "Cargo.toml"
         | 
| 64 | 
            -
                        upstream_name = "#{extension_point.type.gsub("_", "-")}-default"
         | 
| 65 | 
            -
                        contents = File.read(config_file)
         | 
| 66 | 
            -
                        new_contents = contents.sub(upstream_name, script_name)
         | 
| 67 | 
            -
                        File.write(config_file, new_contents)
         | 
| 68 | 
            -
                      end
         | 
| 69 | 
            -
                    end
         | 
| 70 | 
            -
                  end
         | 
| 71 | 
            -
                end
         | 
| 72 | 
            -
              end
         | 
| 73 | 
            -
            end
         | 
| @@ -1,60 +0,0 @@ | |
| 1 | 
            -
            # frozen_string_literal: true
         | 
| 2 | 
            -
            module Script
         | 
| 3 | 
            -
              module Layers
         | 
| 4 | 
            -
                module Infrastructure
         | 
| 5 | 
            -
                  module Languages
         | 
| 6 | 
            -
                    class RustTaskRunner
         | 
| 7 | 
            -
                      attr_reader :ctx
         | 
| 8 | 
            -
             | 
| 9 | 
            -
                      BUILD_TARGET = "wasm32-unknown-unknown"
         | 
| 10 | 
            -
                      METADATA_FILE = "build/metadata.json"
         | 
| 11 | 
            -
                      CARGO_BUILD_CMD = "cargo build --target=#{BUILD_TARGET} --release"
         | 
| 12 | 
            -
             | 
| 13 | 
            -
                      def initialize(ctx, _)
         | 
| 14 | 
            -
                        @ctx = ctx
         | 
| 15 | 
            -
                      end
         | 
| 16 | 
            -
             | 
| 17 | 
            -
                      def dependencies_installed?
         | 
| 18 | 
            -
                        true
         | 
| 19 | 
            -
                      end
         | 
| 20 | 
            -
             | 
| 21 | 
            -
                      def install_dependencies
         | 
| 22 | 
            -
                      end
         | 
| 23 | 
            -
             | 
| 24 | 
            -
                      def build
         | 
| 25 | 
            -
                        compile
         | 
| 26 | 
            -
                        bytecode
         | 
| 27 | 
            -
                      end
         | 
| 28 | 
            -
             | 
| 29 | 
            -
                      def compiled_type
         | 
| 30 | 
            -
                        "wasm"
         | 
| 31 | 
            -
                      end
         | 
| 32 | 
            -
             | 
| 33 | 
            -
                      def metadata
         | 
| 34 | 
            -
                        unless @ctx.file_exist?(METADATA_FILE)
         | 
| 35 | 
            -
                          msg = @ctx.message("script.error.metadata_not_found_cause", METADATA_FILE)
         | 
| 36 | 
            -
                          raise Domain::Errors::MetadataNotFoundError, msg
         | 
| 37 | 
            -
                        end
         | 
| 38 | 
            -
             | 
| 39 | 
            -
                        raw_contents = File.read(METADATA_FILE)
         | 
| 40 | 
            -
                        Domain::Metadata.create_from_json(@ctx, raw_contents)
         | 
| 41 | 
            -
                      end
         | 
| 42 | 
            -
             | 
| 43 | 
            -
                      private
         | 
| 44 | 
            -
             | 
| 45 | 
            -
                      def compile
         | 
| 46 | 
            -
                        CommandRunner.new(ctx: ctx).call(CARGO_BUILD_CMD)
         | 
| 47 | 
            -
                      end
         | 
| 48 | 
            -
             | 
| 49 | 
            -
                      def bytecode
         | 
| 50 | 
            -
                        binary_name = "script.wasm"
         | 
| 51 | 
            -
                        binary_path = "target/#{BUILD_TARGET}/release/#{binary_name}"
         | 
| 52 | 
            -
                        raise Errors::WebAssemblyBinaryNotFoundError unless ctx.file_exist?(binary_path)
         | 
| 53 | 
            -
             | 
| 54 | 
            -
                        ctx.binread(binary_path)
         | 
| 55 | 
            -
                      end
         | 
| 56 | 
            -
                    end
         | 
| 57 | 
            -
                  end
         | 
| 58 | 
            -
                end
         | 
| 59 | 
            -
              end
         | 
| 60 | 
            -
            end
         |