Welcome to PWA metapackage for Magento Open Source extensions. As a metapackage for Magento Open Source, this repo enables PWA extension developers to add any additional Magento Open Source features they need to support their PWA modules.
-
Magento_ContactGraphQlPwa (magento/module-contact-graph-ql-pwa) — Provides GraphQl functionality for the contact-us form.
-
Magento_NewsletterGraphQlPwa (magento/module-newsletter-graph-ql-pwa) — Provides additional GraphQl functionality for the newsletter subscriptions in PWA.
To setup and develop your PWA extension modules locally, use the following instructions:
-
Clone and/or navigate to your
magento2git repository 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-pwarepository into your vendor directory name:git clone git@github.com:magento-commerce/magento2-pwa.git ext/magento/magento2-pwa
-
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
pwametapackage:composer require magento/pwa
At this point, you should see symlinks for all the pwa 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-pwaextension by adding the following to your cloud instancescomposer.jsonfile."require": { "magento/magento2-pwa": "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.