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

Feature/yarn stable10 #33665

Merged
merged 10 commits into from
Dec 4, 2018
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.
Jump to
Jump to file
Failed to load files.
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 @@ -64,19 +64,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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/apps/inc.php
/assets
/build/composer.phar
/build/dist
/build/phan.phar
/core/vendor

Expand Down Expand Up @@ -99,6 +100,7 @@ nbproject
/tests/phpunit.xml

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

# nodejs
Expand Down
48 changes: 18 additions & 30 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 @@ -70,10 +69,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 @@ -90,7 +89,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 @@ -153,31 +152,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 @@ -191,11 +178,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-acceptance-api
Expand Down Expand Up @@ -260,8 +247,9 @@ clean-docs:
# Build distribution
#
$(dist_dir)/owncloud: $(composer_deps) $(core_vendor) $(core_all_src)
cd $(NODE_PREFIX) && $(YARN) run clean-modules
rm -Rf $@; mkdir -p $@/config
cp -R $(core_all_src) $@
cp -RL $(core_all_src) $@
cp -R $(core_config_files) $@/config
find $@ -name .gitkeep -delete
find $@ -name .gitignore -delete
Expand Down
39 changes: 0 additions & 39 deletions bower.json

This file was deleted.

7 changes: 7 additions & 0 deletions build/modclean-patterns-owncloud/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* ModClean - ownCloud Patterns
* @author Thomas Müller
*/
"use strict";

module.exports = require('./patterns.json');
9 changes: 9 additions & 0 deletions build/modclean-patterns-owncloud/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "modclean-patterns-owncloud",
"version": "1.0.0",
"description": "ownCloud patterns for ModClean",
"main": "index.js",
"author": "Thomas Müller",
"license": "MIT",
"private": true
}
37 changes: 37 additions & 0 deletions build/modclean-patterns-owncloud/patterns.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$default": "basic",

"basic": {
"patterns": [
"*.coffee",
"*.ico",
"*.html",
"*.rb",
".babelrc",
".banner",
".bowerrc",
".github",
".jscs.json",
".mailmap",
".spmignore",
"AUTHORS*",
"benchmarks",
"data",
"data-scripts",
"docs",
"Gruntfile.js",
"karma.*.js",
"make",
"meteor",
"nuget",
"node_modules",
"scripts",
"tasks",
"test-infra",
"vendor"
],

"ignore": []
}

}