Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable10] Migrate to yarn #30026

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

14 changes: 3 additions & 11 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,11 @@ pipeline:
when:
event: [push, pull_request]

npm:
image: owncloudci/php:${PHP_VERSION}
pull: true
commands:
- ./tests/drone/npm-install.sh
when:
event: [push, pull_request]

bower:
image: owncloudci/php:${PHP_VERSION}
yarn:
image: owncloudci/nodejs:latest
pull: true
commands:
- ./tests/drone/bower-install.sh
- ./tests/drone/yarn-install.sh
when:
event: [push, pull_request]

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ nbproject
/tests/phpunit.xml

# Node Modules
/build/yarn-error.log
/build/node_modules/

# nodejs
Expand Down
53 changes: 20 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Requirements to run make here:
# - node
# - npm
# - yarn
#
# Both can be installed following e.g. the Debian/Ubuntu instructions at
# https://nodejs.org/en/download/package-manager/
Expand Down Expand Up @@ -32,15 +32,14 @@ NODE_PREFIX=build
SHELL=/bin/bash

#
# Define NPM and check if it is available on the system.
# Define YARN and check if it is available on the system.
#
NPM := $(shell command -v npm 2> /dev/null)
ifndef NPM
$(error npm is not available on your system, please install npm)
YARN := $(shell command -v yarn 2> /dev/null)
ifndef YARN
$(error yarn is not available on your system, please install yarn (npm install -g yarn))
endif

KARMA=$(NODE_PREFIX)/node_modules/.bin/karma
BOWER=$(NODE_PREFIX)/node_modules/bower/bin/bower
JSDOC=$(NODE_PREFIX)/node_modules/.bin/jsdoc
PHPUNIT="$(shell pwd)/lib/composer/phpunit/phpunit/phpunit"
COMPOSER_BIN=build/composer.phar
Expand Down Expand Up @@ -68,10 +67,10 @@ dist_dir=build/dist
# Catch-all rules
#
.PHONY: all
all: help-hint $(composer_dev_deps) $(core_vendor) $(nodejs_deps)
all: help-hint $(composer_dev_deps) $(nodejs_deps)

.PHONY: clean
clean: clean-composer-deps clean-nodejs-deps clean-js-deps clean-test clean-dist
clean: clean-composer-deps clean-nodejs-deps clean-test clean-dist

.PHONY: help-hint
help-hint:
Expand All @@ -88,7 +87,7 @@ help:
@echo -e "make clean\t\t\tclean everything"
@echo -e "make install-composer-deps\tinstall composer dependencies"
@echo -e "make update-composer\t\tupdate composer.lock"
@echo -e "make install-js-deps\t\tinstall Javascript dependencies"
@echo -e "make install-nodejs-deps\t\tinstall Node JS and Javascript dependencies"
@echo
@echo -e "Note that running 'make' without arguments already installs all required dependencies"
@echo
Expand Down Expand Up @@ -145,31 +144,19 @@ clean-composer-deps:
# Node JS dependencies for tools
#
$(nodejs_deps): build/package.json
$(NPM) install --prefix $(NODE_PREFIX)
touch $(nodejs_deps)
cd $(NODE_PREFIX) && $(YARN) install
touch $@

# alias for core deps
$(core_vendor): $(nodejs_deps)

.PHONY: install-nodejs-deps
install-nodejs-deps: $(nodejs_deps)

.PHONY: clean-nodejs-deps
clean-nodejs-deps:
rm -Rf $(nodejs_deps)

#
# ownCloud core JS dependencies
$(core_vendor): $(nodejs_deps) bower.json
$(BOWER) install

.PHONY: install-js-deps
install-js-deps: $(nodejs_deps)

.PHONY: update-js-deps
update-js-deps: $(nodejs_deps)
$(BOWER) update

.PHONY: clean-js-deps
clean-js-deps:
rm -Rf $(core_vendor)
rm -Rf $(nodejs_deps)

#
# Tests
Expand All @@ -183,11 +170,11 @@ test-external: $(composer_dev_deps)
PHPUNIT=$(PHPUNIT) build/autotest-external.sh $(TEST_DATABASE) $(TEST_EXTERNAL_ENV) $(TEST_PHP_SUITE)

.PHONY: test-js
test-js: $(nodejs_deps) $(js_deps) $(core_vendor)
test-js: $(nodejs_deps)
NODE_PATH='$(NODE_PREFIX)/node_modules' $(KARMA) start tests/karma.config.js --single-run

.PHONY: test-js-debug
test-js-debug: $(nodejs_deps) $(js_deps) $(core_vendor)
test-js-debug: $(nodejs_deps)
NODE_PATH='$(NODE_PREFIX)/node_modules' $(KARMA) start tests/karma.config.js

.PHONY: test-integration
Expand Down Expand Up @@ -233,9 +220,9 @@ clean-docs:
#
# Build distribution
#
$(dist_dir)/owncloud: $(composer_deps) $(core_vendor) $(core_all_src)
$(dist_dir)/owncloud: $(composer_deps) $(core_all_src)
rm -Rf $@; mkdir -p $@/config
cp -R $(core_all_src) $@
cp -RL $(core_all_src) $@
cp -R config/config.sample.php $@/config
rm -Rf $(dist_dir)/owncloud/apps/testing
find $@ -name .gitkeep -delete
Expand Down Expand Up @@ -284,9 +271,9 @@ clean-dist:
#
# Build qa distribution
#
$(dist_dir)/qa/owncloud: $(composer_dev_deps) $(core_vendor) $(core_all_src) $(core_test_dirs)
$(dist_dir)/qa/owncloud: $(composer_dev_deps) $(core_all_src) $(core_test_dirs)
rm -Rf $@; mkdir -p $@/config
cp -R $(core_all_src) $@
cp -RL $(core_all_src) $@
cp -R $(core_test_dirs) $@
cp -R config/config.sample.php $@/config
find $@ -name .gitkeep -delete
Expand Down
39 changes: 0 additions & 39 deletions bower.json

This file was deleted.

Loading