Skip to content

Commit 1bcfa44

Browse files
committed
Replace yarn with npm
1 parent a416dc5 commit 1bcfa44

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ jobs:
8181
run: |
8282
sudo rm -rf ~/.nvm && curl -sL "https://deb.nodesource.com/setup_16.x" | sudo -E bash -
8383
sudo apt-get install -y nodejs
84-
sudo npm install -g yarn
8584
sudo apt-get install xvfb
8685
8786
- name: Setup PHP
@@ -103,17 +102,17 @@ jobs:
103102
id: composer-cache
104103
run: echo "::set-output name=dir::$(composer config cache-dir)"
105104

106-
- name: Get yarn cache directory
107-
id: yarn-cache
108-
run: echo "::set-output name=dir::$(yarn cache dir)"
105+
- name: Get npm cache directory
106+
id: npm-cache
107+
run: echo "::set-output name=dir::$(npm config get cache)"
109108

110109
- name: Cache dependencies
111110
uses: actions/cache@v3
112111
with:
113112
path: |
114113
${{ steps.composer-cache.outputs.dir }}
115-
${{ steps.yarn-cache.outputs.dir }}
116-
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-${{ matrix.composer-flags }}-${{ hashFiles('**/yarn.lock') }}
114+
${{ steps.npm-cache.outputs.dir }}
115+
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-${{ matrix.composer-flags }}-${{ hashFiles('**/package-lock.json') }}
117116
restore-keys: composer-${{ runner.os }}-${{ matrix.php-version }}-
118117

119118
- name: Configure minimum stability
@@ -136,8 +135,8 @@ jobs:
136135
run: |
137136
composer update --no-interaction --no-progress ${{ matrix.composer-flags }}
138137
vendor/bin/bdi detect drivers
139-
yarn install
140-
yarn encore dev
138+
npm install
139+
npm run dev
141140
142141
- name: Fix Panther code
143142
if: matrix.coding-standards != true && matrix.analyze-dependencies != true && matrix.static-analysis != true

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ composer.lock
44
/composer-require-checker.phar
55
/drivers/
66
/node_modules/
7+
/package-lock.json
78
/tests/Functional/App/config/reference.php
89
/tests/Functional/App/public/build/
910
/tests/Functional/App/var/
1011
/vendor/
11-
yarn-error.log
12-
yarn.lock

doc/install.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Prérequis :
44
* Projet Symfony fonctionnel
55
* Entité utilisateur avec Doctrine
6-
* Yarn
6+
* NodeJS
77
* Webpack Encore
88
* Pour une compatibilité avec un maximum de navigateurs Internet, il est conseillé :
99
* De configurer Webpack Encore pour activer Babel et core-js
@@ -23,7 +23,7 @@ Installez le bundle avec Composer : A la racine de votre projet Symfony, éxécu
2323

2424
```bash
2525
$ composer require ecommit/crud-bundle:3.*@dev
26-
$ yarn add --dev @ecommit/crud-bundle@link:vendor/ecommit/crud-bundle/assets
26+
$ npm install --save-dev @ecommit/crud-bundle@file:vendor/ecommit/crud-bundle/assets
2727
```
2828

2929
Activez le bundle dans le fichier de configuration `config/bundles.php` de votre projet :
@@ -102,7 +102,7 @@ modalManager.defineEngine(modalEngine);
102102
Recompiliez avec Webpack Encore:
103103

104104
```bash
105-
yarn encore dev
105+
npm run dev
106106
```
107107

108108
Mettez à jour vos entités Doctrine :

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"devDependencies": {
33
"@babel/core": "^7.17.0",
44
"@babel/preset-env": "^7.16.0",
5-
"@ecommit/crud-bundle": "link:assets",
5+
"@ecommit/crud-bundle": "file:assets",
66
"@symfony/webpack-encore": "^5.0",
77
"core-js": "^3.38.0",
88
"eslint": "^9.0",
@@ -22,5 +22,11 @@
2222
"webpack-notifier": "^1.15.0",
2323
"whatwg-fetch": "^3.6.2"
2424
},
25+
"scripts": {
26+
"dev-server": "encore dev-server",
27+
"dev": "encore dev",
28+
"watch": "encore dev --watch",
29+
"build": "encore production --progress"
30+
},
2531
"private": true
2632
}

0 commit comments

Comments
 (0)