Welcome to PWA metapackage for Adobe Commerce extensions. As a metapackage for Adobe Commerce, this repo enables PWA extension developers to add any additional Adobe Commerce features they need to support their PWA modules.
To setup and develop your PWA extension modules locally, use the following instructions:
-
Clone and/or navigate to your
magento2git repository with Commerce and check out the latest develop branch, e.g.2.4-develop. You may also check out and use any2.4release tags.git clone git@github.com:magento/magento2.git cd magento2 -
Create an
extdirectory within the root of yourmagento2project:mkdir ext
-
Clone the
magento2-pwa-commercerepository into your vendor directory name:git clone git@github.com:magento-commerce/magento2-pwa-commerce.git ext/magento/magento2-pwa-commerce
-
Update the
magento2/composer.jsonsettings to create a better development workflow for your extension modules:-
Update the
minimum-stabilityfor packages todev. This allows for the installation of development modules:composer config minimum-stability dev
-
To work with
stablepackages, ensure that theprefer-stableproperty istrue. This property should already be included in thecomposer.jsonfile, right above theminimum-stabilitysetting. -
Configure
composerto find new extension modules. The following command configurescomposerto treat any extension code inside theextdirectory as a package and creates a symlink to thevendordirectory:composer config repositories.ext path "./ext/*/*/*"
-
-
Install the
pwa-commercemetapackage:composer require magento/pwa-commerce
At this point, you should see symlinks for all the pwa-commerce modules inside the vendor directory. These symlinks allow you to:
- Run a Magento installation with additional modules.
- Develop locally using the standard git workflow.
You may need to ensure that there are no Magento_PWA* modules listed as enabled when you run bin/magento module:status. If there are, follow the docs on how to enable modules.
To improve the developer experience even further, you can add these configurations as well:
-
Exclude all the
extdirectories in the project's.gitconfiguration:echo ext >> ./.git/info/exclude
-
Skip your project's root directory
composer.\*files to avoid committing them by mistake:git update-index --skip-worktree composer.json git update-index --skip-worktree composer.lock
NOTE: You can reverse this operation anytime as needed:
git update-index --no-skip-worktree composer.json git update-index --no-skip-worktree composer.lock
-
Add https://repo.magento.com as a composer repository by adding the following to your cloud instances
composer.jsonfile."repositories": { "repo": { "type": "composer", "url": "https://repo.magento.com" } },
-
Require in
magento/magento2-pwa-commerceextension by adding the following to your cloud instancescomposer.jsonfile."require": { "magento/magento2-pwa-commerce": "0.0.1" },
-
Ensure your
auth.jsonfile has valid credential forrepo.magento.com. -
Run
composer updateto update yourcomposer.lockfile. -
Push the changes and deploy your cloud instance.