Skip to content

Commit cbe3215

Browse files
committed
Merge branch '6.3' into 6.4
* 6.3: Remove yarn commands in front-end docs
2 parents 160871b + 3e624f3 commit cbe3215

12 files changed

+23
-99
lines changed

.doctor-rst.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ rules:
6565
valid_use_statements: ~
6666
versionadded_directive_should_have_version: ~
6767
yaml_instead_of_yml_suffix: ~
68-
yarn_dev_option_at_the_end: ~
6968

7069
# master
7170
versionadded_directive_major_version:

frontend/create_ux_bundle.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,11 @@ In this case, the file located at ``[assets directory]/dist/controller.js`` will
110110
},
111111
};
112112
113-
3. Run either ``npm install`` or ``yarn install`` to install the new dependencies.
113+
3. Run ``npm install`` to install the new dependencies.
114114

115115
4. Write your Stimulus controller with TypeScript in ``src/controller.ts``.
116116

117-
5. Run ``npm run build`` or ``yarn run build`` to transpile your TypeScript
118-
controller into JavaScript.
117+
5. Run ``npm run build`` to transpile your TypeScript controller into JavaScript.
119118

120119
To use your controller in a template (e.g. one defined in your bundle) you can use it like this:
121120

frontend/encore/advanced-config.rst

-4
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ prefer to build configs separately, pass the ``--config-name`` option:
105105

106106
.. code-block:: terminal
107107
108-
# if you use the Yarn package manager
109-
$ yarn encore dev --config-name firstConfig
110-
111-
# if you use the npm package manager
112108
$ npm run dev -- --config-name firstConfig
113109
114110
Next, define the output directories of each build:

frontend/encore/bootstrap.rst

-9
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ First, to be able to customize things further, we'll install ``bootstrap``:
77

88
.. code-block:: terminal
99
10-
# if you use the Yarn package manager
11-
$ yarn add bootstrap --dev
12-
13-
# if you use the npm package manager
1410
$ npm install bootstrap --save-dev
1511
1612
Importing Bootstrap Styles
@@ -46,11 +42,6 @@ used in your application:
4642

4743
.. code-block:: terminal
4844
49-
# if you use the Yarn package manager
50-
# (jQuery is only required in versions prior to Bootstrap 5)
51-
$ yarn add jquery @popperjs/core --dev
52-
53-
# if you use the npm package manager
5445
# (jQuery is only required in versions prior to Bootstrap 5)
5546
$ npm install jquery @popperjs/core --save-dev
5647

frontend/encore/dev-server.rst

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
Using webpack-dev-server and HMR
22
================================
33

4-
While developing, instead of using ``yarn encore dev --watch``, you can use the
4+
While developing, instead of using ``npx encore dev --watch``, you can use the
55
`webpack-dev-server`_:
66

77
.. code-block:: terminal
88
9-
# if you use the Yarn package manager
10-
$ yarn encore dev-server
11-
12-
# if you use the npm package manager
139
$ npm run dev-server
1410
1511
This builds and serves the front-end assets from a new server. This server runs at
@@ -30,10 +26,6 @@ You can set these options via command line options:
3026

3127
.. code-block:: terminal
3228
33-
# if you use the Yarn package manager
34-
$ yarn encore dev-server --port 9000
35-
36-
# if you use the npm package manager
3729
$ npm run dev-server -- --port 9000
3830
3931
You can also set these options using the ``Encore.configureDevServerOptions()``
@@ -90,10 +82,6 @@ server SSL certificate:
9082

9183
.. code-block:: terminal
9284
93-
# if you use the Yarn package manager
94-
$ NODE_OPTIONS=--openssl-legacy-provider yarn encore dev-server
95-
96-
# if you use the npm package manager
9785
$ NODE_OPTIONS=--openssl-legacy-provider npm run dev-server
9886
9987
CORS Issues

frontend/encore/faq.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ and the built files. Your ``.gitignore`` file should include:
5353
# whatever path you're passing to Encore.setOutputPath()
5454
/public/build
5555
56-
You *should* commit all of your source asset files, ``package.json`` and ``yarn.lock`` or ``package-lock.json``.
56+
You *should* commit all of your source asset files, ``package.json`` and ``package-lock.json``.
5757

5858
My App Lives under a Subdirectory
5959
---------------------------------
@@ -105,8 +105,8 @@ file script tag is rendered automatically.
105105
This dependency was not found: some-module in ./path/to/file.js
106106
---------------------------------------------------------------
107107

108-
Usually, after you install a package via yarn or npm, you can require / import
109-
it to use it. For example, after running ``yarn add respond.js`` or ``npm install respond.js``,
108+
Usually, after you install a package via npm, you can require / import
109+
it to use it. For example, after running ``npm install respond.js``,
110110
you try to require that module:
111111

112112
.. code-block:: javascript
@@ -151,7 +151,7 @@ productive (for example by resolving aliases). However, you may face this error:
151151
calling Encore directly.
152152
153153
It fails because the Encore Runtime Environment is only configured when you are
154-
running it (e.g. when executing ``yarn encore dev``). Fix this issue calling to
154+
running it (e.g. when executing ``npx encore dev``). Fix this issue calling to
155155
``Encore.isRuntimeEnvironmentConfigured()`` and
156156
``Encore.configureRuntimeEnvironment()`` methods:
157157

frontend/encore/installation.rst

+6-21
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
Installing Encore
22
=================
33

4-
First, make sure you `install Node.js`_. Optionally you can also install the
5-
`Yarn package manager`_. In the next sections you will always see the commands
6-
for both ``npm`` and ``yarn``, but you only need to run one of them.
7-
8-
The following instructions depend on whether you are installing Encore in a
9-
Symfony application or not.
4+
First, make sure you `install Node.js`_. Then, follow the instructions below,
5+
which depend on whether you are installing Encore in a Symfony application or not.
106

117
Installing Encore in Symfony Applications
128
-----------------------------------------
@@ -17,11 +13,6 @@ project:
1713
.. code-block:: terminal
1814
1915
$ composer require symfony/webpack-encore-bundle
20-
21-
# if you use the Yarn package manager
22-
$ yarn install
23-
24-
# if you use the npm package manager
2516
$ npm install
2617
2718
If you are using :ref:`Symfony Flex <symfony-flex>`, this will install and enable
@@ -36,24 +27,19 @@ and files by yourself following the instructions shown in the next section.
3627
Installing Encore in non Symfony Applications
3728
---------------------------------------------
3829

39-
Install Encore into your project via Yarn:
30+
Install Encore into your project via npm:
4031

4132
.. code-block:: terminal
4233
43-
# if you use the Yarn package manager
44-
$ yarn add @symfony/webpack-encore --dev
45-
46-
# if you use the npm package manager
4734
$ npm install @symfony/webpack-encore --save-dev
4835
4936
This command creates (or modifies) a ``package.json`` file and downloads
50-
dependencies into a ``node_modules/`` directory. Yarn also creates/updates a
51-
``yarn.lock`` (called ``package-lock.json`` if you use npm).
37+
dependencies into a ``node_modules/`` directory.
5238

5339
.. tip::
5440

55-
You *should* commit ``package.json`` and ``yarn.lock`` (or ``package-lock.json``
56-
if using npm) to version control, but ignore ``node_modules/``.
41+
You *should* commit ``package.json`` and ``package-lock.json``
42+
to version control, but ignore ``node_modules/``.
5743

5844
Creating the webpack.config.js File
5945
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -223,5 +209,4 @@ on which features of Encore you have enabled.
223209
:doc:`split chunks </frontend/encore/split-chunks>`.
224210

225211
.. _`install Node.js`: https://nodejs.org/en/download/
226-
.. _`Yarn package manager`: https://yarnpkg.com/getting-started/install
227212
.. _`WebpackEncoreBundle`: https://github.com/symfony/webpack-encore-bundle

frontend/encore/postcss.rst

+1-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ Next, download any plugins you want, like ``autoprefixer``:
2323

2424
.. code-block:: terminal
2525
26-
# if you use the Yarn package manager
27-
$ yarn add autoprefixer --dev
28-
29-
# if you use the npm package manager
3026
$ npm install autoprefixer --save-dev
3127
3228
Next, create a ``postcss.config.js`` file at the root of your project:
@@ -36,7 +32,7 @@ Next, create a ``postcss.config.js`` file at the root of your project:
3632
module.exports = {
3733
plugins: {
3834
// include whatever plugins you want
39-
// but make sure you install these via yarn or npm!
35+
// but make sure you install these via npm!
4036
4137
// add browserslist config to package.json (see below)
4238
autoprefixer: {}

frontend/encore/reactjs.rst

+2-6
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@ Enabling React.js with Webpack Encore
99
.. tip::
1010

1111
Check out live demos of Symfony UX React component at `https://ux.symfony.com/react`_!
12-
13-
Using React? First add some dependencies with Yarn:
12+
13+
Using React? First add some dependencies with npm:
1414

1515
.. code-block:: terminal
1616
17-
# if you use the Yarn package manager
18-
$ yarn add react react-dom prop-types
19-
20-
# if you use the npm package manager
2117
$ npm install react react-dom prop-types --save
2218
2319
Enable react in your ``webpack.config.js``:

frontend/encore/simple-example.rst

+1-23
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,20 @@ together and - thanks to the first ``app`` argument - output final ``app.js`` an
5656

5757
.. _encore-build-assets:
5858

59-
To build the assets, run the following if you use the Yarn package manager:
59+
To build the assets, run the following if you use the npm package manager:
6060

6161
.. code-block:: terminal
6262
6363
# compile assets and automatically re-compile when files change
64-
$ yarn watch
65-
# or
6664
$ npm run watch
6765
6866
# or, run a dev-server that can sometimes update your code without refreshing the page
69-
$ yarn dev-server
70-
# or
7167
$ npm run dev-server
7268
7369
# compile assets once
74-
$ yarn dev
75-
# or
7670
$ npm run dev
7771
7872
# on deploy, create a production build
79-
$ yarn build
80-
# or
8173
$ npm run build
8274
8375
All of these commands - e.g. ``dev`` or ``watch`` - are shortcuts that are defined
@@ -186,10 +178,6 @@ We'll use jQuery to print this message on the page. Install it via:
186178

187179
.. code-block:: terminal
188180
189-
# if you use the Yarn package manager
190-
$ yarn add jquery --dev
191-
192-
# if you use the npm package manager
193181
$ npm install jquery --save-dev
194182
195183
Great! Use ``import`` to import ``jquery`` and ``greet.js``:
@@ -370,10 +358,6 @@ and restart Encore:
370358

371359
.. code-block:: terminal
372360
373-
# if you use the Yarn package manager
374-
$ yarn watch
375-
376-
# if you use the npm package manager
377361
$ npm run watch
378362
379363
Webpack will now output a new ``checkout.js`` file and a new ``account.js`` file
@@ -435,18 +419,12 @@ Encore. When you do, you'll see an error!
435419
.. code-block:: terminal
436420
437421
> Error: Install sass-loader & sass to use enableSassLoader()
438-
> yarn add sass-loader@^13.0.0 sass --dev
439422
440423
Encore supports many features. But, instead of forcing all of them on you, when
441424
you need a feature, Encore will tell you what you need to install. Run:
442425

443426
.. code-block:: terminal
444427
445-
# if you use the Yarn package manager
446-
$ yarn add sass-loader@^13.0.0 sass --dev
447-
$ yarn encore dev --watch
448-
449-
# if you use the npm package manager
450428
$ npm install sass-loader@^13.0.0 sass --save-dev
451429
$ npm run watch
452430

frontend/encore/vuejs.rst

-4
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ your Vue.js app update *without* a browser refresh! To activate it, use the
7373

7474
.. code-block:: terminal
7575
76-
# if you use the Yarn package manager
77-
$ yarn encore dev-server
78-
79-
# if you use the npm package manager
8076
$ npm run dev-server
8177
8278
That's it! Change one of your ``.vue`` files and watch your browser update. But

setup/symfony_server.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ server provides a ``run`` command to wrap them as follows:
288288
289289
# compile Webpack assets using Symfony Encore ... but do that in the
290290
# background to not block the terminal
291-
$ symfony run -d yarn encore dev --watch
291+
$ symfony run -d npx encore dev --watch
292292
293293
# continue working and running other commands...
294294
@@ -298,7 +298,7 @@ server provides a ``run`` command to wrap them as follows:
298298
# and you can also check if the command is still running
299299
$ symfony server:status
300300
Web server listening on ...
301-
Command "yarn ..." running with PID ...
301+
Command "npx ..." running with PID ...
302302
303303
# stop the web server (and all the associated commands) when you are finished
304304
$ symfony server:stop
@@ -351,9 +351,9 @@ If you like some processes to start automatically, along with the webserver
351351
# .symfony.local.yaml
352352
workers:
353353
# built-in command that builds and watches front-end assets
354-
# yarn_encore_watch:
355-
# cmd: ['yarn', 'encore', 'dev', '--watch']
356-
yarn_encore_watch: ~
354+
# npm_encore_watch:
355+
# cmd: ['npx', 'encore', 'dev', '--watch']
356+
npm_encore_watch: ~
357357
358358
# built-in command that starts messenger consumer
359359
# messenger_consume_async:
@@ -363,7 +363,7 @@ If you like some processes to start automatically, along with the webserver
363363
364364
# you can also add your own custom commands
365365
build_spa:
366-
cmd: ['yarn', '--cwd', './spa/', 'dev']
366+
cmd: ['npm', '--cwd', './spa/', 'dev']
367367
368368
# auto start Docker compose when starting server (available since Symfony CLI 5.7.0)
369369
docker_compose: ~

0 commit comments

Comments
 (0)