Skip to content

Commit 5ca98ae

Browse files
zgeistValeriyYustunykorocrmdeployerDariaHanzenkoanyt
authored
BB-25538: PNPM Package Manager (#41420)
* BB-25540: Create PNPM workspaces configuration and establishing assets build - add public hoist dependencies - update root gitignore - update webpack deps - update pnpm lock - update pnpm lock - update webpack config - init root PNPM - add PNPM workspaces - add sub deps for applications - update lock - add pnpm check - no-lockfile Co-authored-by: Valerii Yustyniuk <[email protected]> Co-authored-by: orocrmdeployer <[email protected]> Co-authored-by: Valerii Yustyniuk <[email protected]> Co-authored-by: Daria Hanzenko <[email protected]> Co-authored-by: Andrii Yatsenko <[email protected]>
1 parent 8c4dc97 commit 5ca98ae

File tree

21 files changed

+229
-68
lines changed

21 files changed

+229
-68
lines changed

backend/configuration/yaml/bundles-config.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,8 @@ The default configuration for extension with alias "oro_asset":
446446
# Path to NodeJs executable
447447
nodejs_path: ~
448448
449-
# Path to NPM executable
450-
npm_path: ~
449+
# Path to PNPM executable
450+
pnpm_path: ~
451451
452452
# Assets build timeout in seconds, null to disable timeout
453453
build_timeout: null

backend/setup/dev-environment/docker-and-symfony/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Set Up the Environment
2121

2222
**Development Stack**
2323

24-
- PHP, Composer, Node.js, and NPM should be installed locally for a better development experience.
24+
- PHP, Composer, Node.js, NPM and PNPM should be installed locally for a better development experience.
2525
- |Symfony Local Web Server| is used to make you more productive while
2626
developing applications. This server is not intended for production
2727
use. It supports HTTP/2, TLS/SSL, automatic generation of security

backend/setup/dev-environment/mac.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,26 @@ Environment Setup
2828
brew install [email protected] composer node
2929
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH" \nexport PATH="/usr/local/opt/[email protected]/sbin:$PATH" \nexport PATH="/usr/local/opt/node@20/bin:$PATH"' >> ~/.bash_profile
3030
31-
4. If you going to use an Enterprise Edition of the application, install and enable the mongodb php extension:
31+
4. Install PNPM 10 Using NPM:
32+
33+
.. code-block:: none
34+
35+
npm install -g pnpm@latest-10
36+
37+
5. If you are going to use an Enterprise Edition of the application, install and enable the mongodb php extension:
3238

3339
.. code-block:: none
3440
3541
pecl install mongodb
3642
echo "extension=\"mongodb.so\"" >> /usr/local/etc/php/8.4/php.ini
3743
38-
5. Configure PHP:
44+
6. Configure PHP:
3945

4046
.. code-block:: none
4147
4248
echo "memory_limit = 2048M \nmax_input_time = 600 \nmax_execution_time = 600 \nrealpath_cache_size=4096K \nrealpath_cache_ttl=600 \nopcache.enable=1 \nopcache.enable_cli=0 \nopcache.memory_consumption=512 \nopcache.interned_strings_buffer=32 \nopcache.max_accelerated_files=32531 \nopcache.save_comments=1" >> /usr/local/etc/php/8.4/php.ini
4349
44-
6. Install Symfony Server and enable TLS:
50+
7. Install Symfony Server and enable TLS:
4551

4652
.. code-block:: none
4753
@@ -50,7 +56,7 @@ Environment Setup
5056
source ~/.bash_profile
5157
symfony local:server:ca:install
5258
53-
7. Restart the terminal and web browser to get them ready.
59+
8. Restart the terminal and web browser to get them ready.
5460

5561
What's Next
5662
-----------

backend/setup/dev-environment/ubuntu.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ Environment Setup
4040
curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash -
4141
sudo apt -y install nodejs
4242
43-
4. Install Docker and Docker Compose:
43+
4. Install PNPM Using NPM:
44+
45+
.. code-block:: none
46+
47+
npm install -g pnpm@latest-10
48+
49+
5. Install Docker and Docker Compose:
4450

4551
.. code-block:: none
4652
@@ -62,15 +68,15 @@ Environment Setup
6268
6369
For more information, see |Docker installation|.
6470

65-
5. Install Composer v2:
71+
6. Install Composer v2:
6672

6773
.. code-block:: none
6874
6975
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php
7076
php -r "unlink('composer-setup.php');"
7177
sudo mv composer.phar /usr/bin/composer
7278
73-
6. Install Symfony Server and enable TLS:
79+
7. Install Symfony Server and enable TLS:
7480

7581
.. code-block:: none
7682
@@ -80,7 +86,7 @@ Environment Setup
8086
source ~/.bashrc
8187
symfony server:ca:install
8288
83-
7. Restart the terminal and web browser to get them ready.
89+
8. Restart the terminal and web browser to get them ready.
8490

8591

8692
.. admonition:: Business Tip

backend/setup/dev-environment/windows.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,21 @@ Environment Setup
8484
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
8585
sudo apt -y install nodejs
8686
87-
9. Install Composer:
87+
9. Install PNPM 10 Using NPM:
88+
89+
.. code-block:: none
90+
91+
npm install -g pnpm@latest-10
92+
93+
10. Install Composer:
8894

8995
.. code-block:: none
9096
9197
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php
9298
php -r "unlink('composer-setup.php');"
9399
sudo mv composer.phar /usr/bin/composer
94100
95-
10. Install Symfony Server:
101+
11. Install Symfony Server:
96102

97103
.. code-block:: none
98104
@@ -116,7 +122,7 @@ Environment Setup
116122
:alt: Importing certificate to Chrome
117123

118124

119-
11. Configure the network. WSL 2 changes the way networking is configured compared to WSL 1. You need to enable proxy of traffic to permit the traffic through the Windows firewall.
125+
12. Configure the network. WSL 2 changes the way networking is configured compared to WSL 1. You need to enable proxy of traffic to permit the traffic through the Windows firewall.
120126

121127
Run in Ubuntu ``ip addr | grep eth0`` to see the IP address of the WSL 2 virtual machine.
122128

@@ -145,7 +151,7 @@ Environment Setup
145151
.. image:: /img/backend/setup/wsl/firewall-6.png
146152
:alt: Configure Windows Defender Firewall step 6
147153

148-
12. Restart the terminal and the web browser to get them ready.
154+
13. Restart the terminal and the web browser to get them ready.
149155

150156
What's Next
151157
-----------

backend/setup/system-requirements/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Oro applications are compatible with most web servers with PHP support, but the
8787
| *Process Control* | * |Supervisor| or alternative |
8888
+-------------------+---------------------------------------------------+
8989
| *Assets* | * |Node.js| >=22 |
90-
| | * |NPM| >10 |
90+
| | * |PNPM| >10 |
9191
| | |
9292
| | Used for JS assets minification and SCSS assets |
9393
| | build. |

backend/setup/upgrade-source-code.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
.. _upgrade-to-6:
77

8-
Upgrade the Source Code to v6.1
8+
Upgrade the Source Code to v7.0
99
===============================
1010

11-
This guide covers the complete process of upgrading your codebase to OroCommerce v6.1, including dependency updates and code migration.
11+
This guide covers the complete process of upgrading your codebase to OroCommerce v7.0, including dependency updates and code migration.
1212

1313
.. tip:: If you are looking for instructions on upgrading the entire OroCommerce application rather than just the source code, please refer to our guide on :ref:`Upgrading the Application to the Next Version <upgrade-application>`.
1414

@@ -55,6 +55,7 @@ Next, run the following commands:
5555
5656
rm -rf var/cache/*
5757
rm -rf public/bundles/*
58+
rm -rf ./node_modules
5859
php bin/console assets:install
5960
php bin/console oro:theme:migrate
6061

backend/setup/upgrade-to-new-version.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,22 @@ To retrieve a new version and upgrade your Oro application instance, execute the
7070
7171
rm -rf var/cache/prod/
7272
73-
9. Set up your project source code with Composer.
73+
9. Remove old JS packages
74+
75+
.. code-block:: none
76+
77+
rm -rf ./node_modules
78+
79+
10. Set up your project source code with Composer.
7480

7581
.. code-block:: none
7682
7783
composer install --prefer-dist --no-dev
7884
79-
10. Refer to the ``UPGRADE.md`` and ``CHANGELOG.md`` files in the application repository for a list of changes in the code that
85+
11. Refer to the ``UPGRADE.md`` and ``CHANGELOG.md`` files in the application repository for a list of changes in the code that
8086
may affect the upgrade of some customizations.
8187

82-
11. Upgrade the platform.
88+
12. Upgrade the platform.
8389

8490
.. code-block:: none
8591
@@ -105,7 +111,7 @@ To retrieve a new version and upgrade your Oro application instance, execute the
105111

106112
* **For patch upgrades (minor updates within the same LTS):** While not mandatory, it is **highly recommended** to run search reindexation to ensure the Elasticsearch index structure remains correct.
107113

108-
12. Remove the caches.
114+
13. Remove the caches.
109115

110116
.. code-block:: none
111117
@@ -118,7 +124,7 @@ To retrieve a new version and upgrade your Oro application instance, execute the
118124
rm -rf var/cache/prod/
119125
php bin/console cache:warmup --env=prod
120126
121-
13. Enable cron.
127+
14. Enable cron.
122128

123129
.. code-block:: none
124130
@@ -130,13 +136,13 @@ To retrieve a new version and upgrade your Oro application instance, execute the
130136
131137
*/1 * * * * /usr/bin/php <application-root-folder>/bin/console --env=prod oro:cron >> /dev/null
132138
133-
14. Switch your application back to the normal mode from the maintenance mode.
139+
15. Switch your application back to the normal mode from the maintenance mode.
134140

135141
.. code-block:: none
136142
137143
php bin/console lexik:maintenance:unlock --env=prod
138144
139-
15. Run the consumer(s).
145+
16. Run the consumer(s).
140146

141147
.. code-block:: none
142148

bundles/platform/AssetBundle/commands.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ The assets can be build only for a specific theme if its name is provided as an
2222
2323
php bin/console oro:assets:build default
2424
25-
.. code-block:: none
26-
27-
php bin/console oro:assets:build blank
28-
2925
.. code-block:: none
3026
3127
php bin/console oro:assets:build admin.oro
@@ -84,11 +80,11 @@ The ``--force-warmup`` option can be used to warm up the asset-config.json cache
8480
8581
php bin/console oro:assets:build --force-warmup
8682
87-
The ``--npm-install`` option can be used to reinstall npm dependencies in vendor/oro/platform/build folder. It may be required when node_modules contents become corrupted:
83+
The ``--pnpm-install`` option can be used to reinstall npm dependencies in vendor/oro/platform/build folder. It may be required when `node_modules` contents become corrupted:
8884

8985
.. code-block:: none
9086
91-
php bin/console oro:assets:build --npm-install
87+
php bin/console oro:assets:build --pnpm-install
9288
9389
The ``--skip-css``, ``--skip-js``, ``--skip-babel``, ``--skip-sourcemap``, ``--skip-rtl`` and ``--skip-svg`` options allow to skip building CSS and JavaScript files, skip transpiling Javascript with Babel, skip building sourcemaps, skip building RTL styles and skip building SVG sprite respectively:
9490

@@ -161,7 +157,7 @@ You may run individual steps if necessary as follows:
161157
162158
.. code-block:: none
163159
164-
php bin/console oro:assets:build --npm-install
160+
php bin/console oro:assets:build --pnpm-install
165161
166162
The ``--force-debug`` option will launch the child commands in the debug mode (be default they are launched with ``--no-debug``):
167163

bundles/platform/AssetBundle/index.rst

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Detailed information about JS modules configuration is available in the :ref:`JS
203203
Configuration Reference
204204
-----------------------
205205

206-
AssetBundle defines the configuration for NodeJs and NPM executable.
206+
AssetBundle defines the configuration for NodeJs and PNPM executable.
207207

208208
All these options are configured under the `oro_asset` key in your application configuration.
209209

@@ -225,12 +225,12 @@ nodejs_path
225225

226226
Path to NodeJs executable.
227227

228-
npm_path
229-
^^^^^^^^
228+
pnpm_path
229+
^^^^^^^^^
230230

231231
**type: `string` required, default: found dynamically**
232232

233-
Path to NPM executable.
233+
Path to PNPM executable.
234234

235235
build_timeout
236236
^^^^^^^^^^^^^
@@ -239,12 +239,12 @@ build_timeout
239239

240240
Assets build timeout in seconds, null to disable the timeout.
241241

242-
npm_install_timeout
243-
^^^^^^^^^^^^^^^^^^^
242+
pnpm_install_timeout
243+
^^^^^^^^^^^^^^^^^^^^
244244

245245
**type: `integer` required, default: `null`**
246246

247-
Npm installation timeout in seconds, null to disable the timeout.
247+
PNPM installation timeout in seconds, null to disable the timeout.
248248

249249
webpack_dev_server
250250
^^^^^^^^^^^^^^^^^^
@@ -305,6 +305,20 @@ To fix the error, remove an application cache and warm it up:
305305
rm -rf var/cache/*
306306
php bin/console cache:warmup
307307
308+
**PNPM not found**
309+
310+
Appears after migration to `PNPM`.
311+
312+
To fix the error, install `pnpm`, remove the existing node modules and re-build the assets:
313+
314+
.. code-block:: none
315+
316+
npm install -g pnpm
317+
rm -rf ./node_modules
318+
php bin/console cache:clear
319+
php bin/console oro:assets:build
320+
321+
308322
**Error: "output" for "assets" group in theme "oro" is not defined**
309323

310324
Please follow |AssetBundle upgrade documentation| to update `assets.yml` files according to new requirements.

0 commit comments

Comments
 (0)