ScandiPWA
Create Magento AppCreate ScandiPWA AppUser ManualGitHub
  • Why Scandi
  • πŸš€Quick-start Guide
  • πŸ—ΊοΈRoadmap
  • Introduction to the Stack
    • CMA, CSA, and ScandiPWA
    • Challenges
  • Setting up Scandi
    • Storefront Mode Setup
      • Proxying requests to server
    • Magento Mode Setup
    • Existing Magento 2 setup
    • Magento Commerce Cloud setup
    • Updating to new releases
      • Storefront mode upgrade
      • Magento mode upgrade
      • CMA upgrade
      • CSA upgrade
      • Custom ScandiPWA composer dependency update
      • Local ScandiPWA Composer Package Setup
    • Docker Setup [deprecated]
      • Legacy Docker setup
      • Migrating to CMA & CSA
  • Developing with Scandi
    • Override Mechanism
      • Overriding JavaScript
        • Overriding classes
        • Overriding non-classes
      • Overriding Styles
      • Overriding the HTML / PHP
      • Parent Themes
    • Extensions
      • Creating an extension
      • Installing an extension
      • Migrating from 3.x to 4.x
      • Publishing an extension
      • Extension Terminology
    • Working With Magento
      • Magento troubleshooting
      • Working with Magento modules
      • Working with GraphQL
      • GraphQL Security
      • Working with "granular cache"
    • Developer Tools
      • Debugging in VSCode
      • ScandiPWA CLI
      • Configuring ESLint
      • CSA Commands
    • Deploying Your App
      • Build & Deploy Android app
      • Build & Deploy iOS app
  • Structure
    • Directory Structure
    • Building Blocks
      • Components
        • Styling Components
      • Routes
      • Redux Stores
      • GraphQL Queries
      • Global Styles
      • The Util Directory
      • Type Checking
    • Application assets
    • Code Style
      • JavaScript Code Style
      • SCSS Code Style
  • Tutorials
    • Customizing Your Theme
      • Styling
        • Customizing the Global Styles
        • Adding a New Font
        • Overriding a Components Styles
        • Extending a Component's Styles
      • Customizing JavaScript
        • Customizing the Footer Copyright
        • Adding a New Page
        • Adding a Section in My Account
        • Adding a Tab on the Product Page
        • Creating a New Redux Store
    • Payment Method Integration
      • Setting Up for Development
      • Redirecting to the Payment Provider
      • Handling the Customer's Return
    • Creating a Custom Widget
      • Scandi CMS System Overview
      • Creating a Magento Widget
      • Implementing the Rendering
    • Video Tutorials
      • #1 Setting up and talking theory
      • #2 Templating in React
      • #3 Overriding a file
      • #4 Styling the application
      • #5 Patterns of ScandiPWA
    • Dark Mode Extension
    • Deploying Native Apps
    • Product 3D Model Extension
      • Part 1: Magento 3D Model Uploads
      • Part 2: GraphQL API
      • Part 3: Scandi Frontend
    • Social Share, Full Extension Development
      • STEP-1 and 2 Creating Magento 2 Module
      • STEP-3 Backend Configurations Settings
      • STEP-4 Simple GraphQl and Resolver
      • STEP-5 Creating Extension, Base Redux Store
      • STEP-6 Extension plugins
      • STEP-7 GraphQL types, Helpers
      • STEP-8 Query Field and FieldList
      • STEP-9 render Plugins and MSTP Plugin, Component creation
      • STEP-10 SocialShare Component Development
      • STEP-11 SocialShare for CategoryPage
      • TASK-1 Changing LinkedIn to Twitter
      • STEP-12 Comments for Admin Users
      • STEP-13 Final, bugfixes
    • Accessing Magento 2 Controllers
      • STEP-1 Creating Magento 2 Module
      • STEP-2 - Create Magento 2 Frontend Route and Basic Controller
      • STEP-3 Accessing Magento 2 Controller, Bypassing ScandiPWA frontend
      • STEP-4 Creating ScandiPWA Extension with additional dependencies
      • STEP-5 Creating Plugin and Axios request
  • About
    • Support
    • Release notes
    • Technical Information
    • Data Analytics
    • Contributing
      • Installation from Fork
      • Repository structure
      • Code contribution process
      • Submitting an Issue
      • Publishing ScandiPWA
Powered by GitBook
On this page
  • Why
  • How To Install
  • How To Update
  • Version Configuration

Was this helpful?

  1. Setting up Scandi
  2. Updating to new releases

Local ScandiPWA Composer Package Setup

ScandiPWA Composer package installation and upgrade for the Core Team

PreviousCustom ScandiPWA composer dependency updateNextDocker Setup [deprecated]

Last updated 3 years ago

Was this helpful?

Why

Composer always is trying to install the latest possible version of a package. This means, that if your composer.json file has packages with version ^2.1.0, it matches 2.1.1 and 2.1.99.

But since ScandiPWA releases are backward incompatible and during the release cycle we can have multiple backend module releases, this can lead to an issue when a new ScandiPWA setup can install latest composer package that will crash the project.

To solve this issue a developer have to install the latest ScandiPWA frontend. But it may not be possible since it isn't released yet, or for some other reasons. Thus we decided to use strict composer package versions in order to lock changes for a specific ScandiPWA release.

But this leads to another issue for a ScandiPWA Core Team. Since we are developing composer packages locally, we used to specify a local package version to be greater than it is in the packagist.org. So the Composer would prefer the local version over the Packagist version. This will not happen when we lock the versions.

The solution for the Core Team is to use branch alias.

How To Install

In order to install the local package, first we should configure repository:

composer config repo.repo-name path path/to/repo

Then we should lookup the required version of the package in the theme's composer.json. Next is to launch the following command:

composer require "vendor/package dev-master as x.x.x"

For example, in order to install the scandipwa/catalog-graphql version 3.1.24 do the following:

composer require "scandipwa/catalog-graphql dev-master as 3.1.24"

This will add a package to the root composer.json and symlink the package in the vendor directory.

How To Update

In order to update ScandiPWA composer packages the Core Team can use the following command:

composer update "scandipwa/*"

But if a package, that is installed from local directory, has updated in the theme's composer.json, you will have an error like this:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires scandipwa/scandipwa ^0.0.1 -> satisfiable by scandipwa/scandipwa[0.0.1].
    - scandipwa/scandipwa 0.0.1 requires scandipwa/catalog-graphql 3.1.25 -> found scandipwa/catalog-graphql[dev-master] but it does not match the constraint.

In order to solve it, you have to head to the root composer.json and update the version manually. Then do the update command from the above.

Version Configuration

Please note that you don't have to edit the package composer.json and specify it's version. The dev-master is already the latest version you could have.

If you experiencing some issues with it, you might want to configure the root composer.json like this:

"minimum-stability": "dev",
"prefer-stable": false

When you switch the branches in the package while development, there shouldn't be any issue with the version you have installed, since the package directory is symlinked and will sync all changes to the vendor directory. But if you encounter any issue because you have a different branch, just change dev-master to dev-branch-name in the root composer.json.

Same issue will happen when you have a different default branch, like main instead of master.

In order to check whether the ScandiPWA package is symlinked, you can launch the following command:

ls -lF vendor/scandipwa

It will display all symlinks and their targets.

Why
How to install
How to update
Version configuration