diff --git a/.travis.yml b/.travis.yml index f11fbc5c434d43..9f6b5795d8371e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,6 @@ before_install: } - nvm install && nvm use - npm install npm -g - - npm install yarn -g branches: only: diff --git a/bin/install-node-nvm.sh b/bin/install-node-nvm.sh index 2d4f939189d8c6..0588704ee84f07 100755 --- a/bin/install-node-nvm.sh +++ b/bin/install-node-nvm.sh @@ -72,21 +72,6 @@ npm install # Make sure npm is up-to-date npm install npm -g -# Check if yarn is installed -if [ "$TRAVIS" != "true" ] && ! command_exists "yarn"; then - if ask "$(error_message "Yarn isn't installed, would you like to download and install it automatically?")" Y; then - echo -en $(status_message "Installing yarn..." ) - npm install -g yarn >/dev/null 2>&1 - echo ' done!' - else - echo -e $(error_message "") - echo -e $(error_message "Please install Yarn manually, then re-run the setup script to continue.") - echo -e $(error_message "Yarn installation instructions can be found here: $(action_format "https://yarnpkg.com/lang/en/docs/install/#install-via-npm")") - fi - - exit 1 -fi - # There was a bug in NPM that caused changes in package-lock.json. Handle that. if [ "$TRAVIS" != "true" ] && ! git diff --exit-code package-lock.json >/dev/null; then if ask "$(warning_message "Your package-lock.json changed, which may mean there's an issue with your NPM cache. Would you like to try and automatically clean it up?" )" N 10; then diff --git a/package-lock.json b/package-lock.json index b325cc394e67da..388c7fd19cc40a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21305,6 +21305,12 @@ "camelcase": "^4.1.0" } }, + "yarn": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/yarn/-/yarn-1.9.4.tgz", + "integrity": "sha1-O4LYRGtlJ3VyOQC0cNlmhhl2kks=", + "dev": true + }, "yauzl": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", diff --git a/package.json b/package.json index 50bc07c5c241b8..b84f9984c4c5d6 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,8 @@ "webpack": "4.8.3", "webpack-cli": "2.1.3", "webpack-livereload-plugin": "2.1.1", - "webpack-rtl-plugin": "github:yoavf/webpack-rtl-plugin#develop" + "webpack-rtl-plugin": "github:yoavf/webpack-rtl-plugin#develop", + "yarn": "1.9.4" }, "npmPackageJsonLintConfig": { "extends": "@wordpress/npm-package-json-lint-config", @@ -175,7 +176,10 @@ "lint-css": "stylelint '**/*.scss'", "lint-css:fix": "stylelint '**/*.scss' --fix", "package-plugin": "./bin/build-plugin-zip.sh", - "postinstall": "npm run check-licenses && npm run build:packages", + "mobile-submodule-update": "git submodule update --init --recursive", + "mobile-install": "npx yarn --cwd gutenberg-mobile install", + "preinstall": "npm run mobile-submodule-update && npm run mobile-install && npm run check-licenses && npm run build:packages", + "postinstall": "npx yarn --cwd gutenberg-mobile install && npm run check-licenses && npm run build:packages", "pot-to-php": "./bin/pot-to-php.js", "precommit": "lint-staged", "publish:check": "npm run build:packages && lerna updated", @@ -185,7 +189,7 @@ "pretest-e2e": "concurrently \"./bin/reset-e2e-tests.sh\" \"npm run build\"", "test-e2e": "cross-env JEST_PUPPETEER_CONFIG=test/e2e/puppeteer.config.js wp-scripts test-unit-js --config test/e2e/jest.config.json --runInBand", "test-e2e:watch": "npm run test-e2e -- --watch", - "test-mobile": "cd gutenberg-mobile; yarn test:inside-gb; cd ..;", + "test-mobile": "npx yarn --cwd gutenberg-mobile test:inside-gb", "test-php": "npm run lint-php && npm run test-unit-php", "test-unit": "wp-scripts test-unit-js --config test/unit/jest.config.json", "test-unit:coverage": "npm run test-unit -- --coverage",