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
magento2
git repository with Commerce and check out the latest develop branch, e.g.2.4-develop
. You may also check out and use any2.4
release tags.git clone git@github.com:magento/magento2.git cd magento2
-
Create an
ext
directory within the root of yourmagento2
project:mkdir ext
-
Clone the
magento2-pwa-commerce
repository 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.json
settings to create a better development workflow for your extension modules:-
Update the
minimum-stability
for packages todev
. This allows for the installation of development modules:composer config minimum-stability dev
-
To work with
stable
packages, ensure that theprefer-stable
property istrue
. This property should already be included in thecomposer.json
file, right above theminimum-stability
setting. -
Configure
composer
to find new extension modules. The following command configurescomposer
to treat any extension code inside theext
directory as a package and creates a symlink to thevendor
directory:composer config repositories.ext path "./ext/*/*/*"
-
-
Install the
pwa-commerce
metapackage: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
ext
directories in the project's.git
configuration: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.json
file."repositories": { "repo": { "type": "composer", "url": "https://repo.magento.com" } },
-
Require in
magento/magento2-pwa-commerce
extension by adding the following to your cloud instancescomposer.json
file."require": { "magento/magento2-pwa-commerce": "0.0.1" },
-
Ensure your
auth.json
file has valid credential forrepo.magento.com
. -
Run
composer update
to update yourcomposer.lock
file. -
Push the changes and deploy your cloud instance.