Merge pull request #7720 from venyii/use-yarn

Replace NPM with Yarn package manager
This commit is contained in:
Paweł Jędrzejewski 2017-03-13 09:37:13 +01:00 committed by GitHub
commit 781dbf8c7b
9 changed files with 2552 additions and 10 deletions

View file

@ -10,7 +10,9 @@ matrix:
-
sudo: required
php: 7.1.0 # PHP 7.1.2 breaks our test suite because of https://bugs.php.net/bug.php?id=74157
env: SYLIUS_SUITE="application"
env:
- SYLIUS_SUITE="application"
- TRAVIS_NODE_VERSION="7.5"
services:
- memcached
-
@ -24,11 +26,14 @@ matrix:
-
sudo: required
php: 5.6
env: SYLIUS_SUITE="application"
env:
- SYLIUS_SUITE="application"
- TRAVIS_NODE_VERSION="7.5"
services:
- memcached
cache:
yarn: true
directories:
- ~/.composer/cache/files
- ~/.cache/pip

View file

@ -25,8 +25,8 @@ $ wget http://getcomposer.org/composer.phar
$ php composer.phar create-project -s beta sylius/sylius-standard project
$ cd project
$ php bin/console sylius:install
$ npm install
$ npm run gulp
$ yarn install
$ yarn run gulp
$ php bin/console server:start
$ open http://localhost:8000/
```

View file

@ -59,13 +59,13 @@ Having Node.js installed go to your project directory and run:
.. code-block:: bash
$ npm install
$ yarn install
And now you can use gulp for installing views, by just running a simple command:
.. code-block:: bash
$ npm run gulp
$ yarn run gulp
Although if you have Gulp installed globally then run just:

View file

@ -57,13 +57,13 @@ Having Node.js installed go to your project directory and run:
.. code-block:: bash
$ npm install
$ yarn install
And now you can use gulp for installing views, by just running a simple command:
.. code-block:: bash
$ npm run gulp
$ yarn run gulp
For the contributing process questions, please refer to the `Contributing Guide <http://docs.sylius.org/en/latest/contributing/index.html>`_ that comes up in the following chapters.

4
etc/bash/application.sh Normal file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Source nvm.sh to make the node command available
run_command "source ~/.nvm/nvm.sh"

View file

@ -1,6 +1,18 @@
#!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/application.sh"
print_header "Activating memcached extension" "Sylius"
run_command "echo \"extension = memcached.so\" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini" || exit $?
print_header "Installing Yarn" "Sylius"
# Install Node Version Manager to install newer node version
run_command "rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout \`git describe --abbrev=0 --tags\`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION" || exit $?
# Install Yarn globally
run_command "sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg"
run_command "echo \"deb http://dl.yarnpkg.com/debian/ stable main\" | sudo tee /etc/apt/sources.list.d/yarn.list"
run_command "sudo apt-get update -qq"
run_command "sudo apt-get install -y -qq yarn=0.21.3-1"

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/application.sh"
print_header "Setting the application up" "Sylius"
run_command "bin/console doctrine:database:create --env=test_cached -vvv" || exit $? # Have to be run with debug = true, to omit generating proxies before setting up the database
@ -9,4 +10,4 @@ run_command "bin/console doctrine:migrations:migrate --no-interaction --env=test
print_header "Setting the web assets up" "sylius"
run_command "bin/console assets:install --env=test_cached --no-debug -vvv" || exit $?
run_command "npm run gulp" || exit $?
run_command "yarn run gulp" || exit $?

View file

@ -1,10 +1,11 @@
#!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/application.sh"
print_header "Installing dependencies" "Sylius"
run_command "composer install --no-interaction --no-scripts --prefer-dist" || exit $?
run_command "npm install" || exit $?
print_header "Warming up dependencies" "Sylius"
run_command "composer run-script travis-build --no-interaction" || exit $?
run_command "yarn install" || exit $?

2519
yarn.lock Normal file

File diff suppressed because it is too large Load diff