Skip to content

Commit

Permalink
Merge pull request #884 from nextcloud/remove-bower
Browse files Browse the repository at this point in the history
Remove bower
  • Loading branch information
georgehrke authored Aug 15, 2018
2 parents 45aa98c + 599c8ac commit da65f66
Show file tree
Hide file tree
Showing 18 changed files with 121 additions and 74 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,5 @@ RCS/*

coverage/

js/vendor

js/public
css/public
3 changes: 1 addition & 2 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
filter:
excluded_paths:
- 'js/vendor/*'
- 'js/public/*'
- 'l10n/*'

Expand All @@ -16,4 +15,4 @@ tools:
build:
tests:
override:
- jshint-run --config js/.jshintrc
- jshint-run --config js/.jshintrc
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ before_script:

script:
- make
- phpunit --version
- make composer || true
- make test
- make dist
# Upload nightly
Expand Down
40 changes: 24 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
# build tools and additional package managers should be installed locally in
# your project, since this won't pollute people's global namespace.
#
# The following npm scripts in your package.json install and update the bower
# and npm dependencies and use gulp as build system (notice how everything is
# The following npm scripts in your package.json install and update the npm
# dependencies and use gulp as build system (notice how everything is
# run from the node_modules folder):
#
# "scripts": {
# "test": "node node_modules/gulp-cli/bin/gulp.js karma",
# "prebuild": "npm install && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update",
# "prebuild": "npm install",
# "build": "node node_modules/gulp-cli/bin/gulp.js"
# },

Expand All @@ -51,6 +51,10 @@ appstore_artifact_directory=$(CURDIR)/build/artifacts/appstore
appstore_package_name=$(appstore_artifact_directory)/$(app_name)
yarn=$(shell which yarn 2> /dev/null)
gcp=$(shell which gcp 2> /dev/null)
composer:=$(shell which composer 2> /dev/null)
ifeq (,$(composer))
composer:=php $(build_tools_directory)/composer.phar
endif

ifeq (, $(gcp))
copy_command=cp
Expand Down Expand Up @@ -85,6 +89,18 @@ all: build
build:
make yarn

# Installs and updates the composer dependencies. If composer is not installed
# a copy is fetched from the web
.PHONY: composer
composer:
ifeq (, $(shell which composer 2> /dev/null))
@echo "No composer command available, downloading a copy from the web"
mkdir -p $(build_tools_directory)
curl -sS https://getcomposer.org/installer | php
mv composer.phar $(build_tools_directory)
endif
$(composer) install --prefer-dist

# Installs yarn dependencies
.PHONY: yarn
yarn:
Expand All @@ -97,13 +113,11 @@ clean:
rm -rf css/public
rm -rf js/public

# Same as clean but also removes dependencies installed by composer, bower and
# npm
# Same as clean but also removes dependencies installed by composer and npm
.PHONY: distclean
distclean: clean
rm -rf vendor
rm -rf node_modules
rm -rf js/vendor
rm -rf js/node_modules

# Builds the source and appstore package
Expand Down Expand Up @@ -161,14 +175,8 @@ endif
# from the internet
.PHONY: test
test:
cd js && $(yarn) run test
ifeq (, $(shell which phpunit 2> /dev/null))
@echo "No phpunit command available, downloading a copy from the web"
mkdir -p $(build_tools_directory)
curl -sSL https://phar.phpunit.de/phpunit.phar -o $(build_tools_directory)/phpunit.phar
php $(build_tools_directory)/phpunit.phar -c phpunit.xml --coverage-clover coverage.clover
# php $(build_tools_directory)/phpunit.phar -c phpunit.integration.xml --coverage-clover build/php-integration.clover
else
phpunit -c phpunit.xml --coverage-clover coverage.clover
# phpunit -c phpunit.integration.xml --coverage-clover build/php-unit.clover
ifndef TRAVIS
make composer
endif
cd js && $(yarn) run test && cd ../
export PATH="$$PWD/vendor/bin:$$PATH" && phpunit -c phpunit.xml --coverage-clover coverage.clover
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require-dev": {
"phpunit/phpunit": "^6.5"
}
}
7 changes: 0 additions & 7 deletions js/.bowerrc

This file was deleted.

15 changes: 0 additions & 15 deletions js/bower.json

This file was deleted.

22 changes: 11 additions & 11 deletions js/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ const cssSources = [
'../css/app/*.scss'
];
const vendorSources = [
'vendor/angular/angular.js',
'vendor/angular-bootstrap/ui-bootstrap-tpls.js',
'vendor/fullcalendar/dist/fullcalendar.js',
'vendor/fullcalendar/dist/locale-all.js',
'node_modules/angular/angular.js',
'node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js',
'node_modules/fullcalendar/dist/fullcalendar.js',
'node_modules/fullcalendar/dist/locale-all.js',
'licenses/hsl_rgb_converter.js',
'vendor/hsl_rgb_converter/converter.js',
'vendor/ical.js/build/ical.js',
'vendor/jquery-timepicker/jquery.ui.timepicker.js',
'vendor/jstzdetect/dist/jstz.js',
'node_modules/hsl_rgb_converter/converter.js',
'node_modules/ical.js/build/ical.js',
'node_modules/jquery-timepicker/jquery.ui.timepicker.js',
'node_modules/jstzdetect/dist/jstz.js',
];
const vendorCssSources = [
'vendor/fullcalendar/dist/fullcalendar.css',
'vendor/angular/angular-csp.css',
'node_modules/fullcalendar/dist/fullcalendar.css',
'node_modules/angular/angular-csp.css',
'licenses/jquery.timepicker.css',
'vendor/jquery-timepicker/jquery.ui.timepicker.css'
'node_modules/jquery-timepicker/jquery.ui.timepicker.css'
];

const testSources = ['../tests/js/unit/**/*.js'];
Expand Down
13 changes: 11 additions & 2 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"homepage": "https://github.com/nextcloud/calendar",
"scripts": {
"test": "node node_modules/gulp-cli/bin/gulp.js karma",
"prebuild": "yarn && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update",
"prebuild": "yarn",
"build": "node node_modules/gulp-cli/bin/gulp.js"
},
"repository": {
Expand All @@ -16,10 +16,10 @@
"url": "https://github.com/nextcloud/calendar/issues"
},
"devDependencies": {
"angular-mocks": "^1.7.2",
"babel-core": "^6.26.3",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"bower": "^1.8.4",
"coveralls": "^3.0.2",
"gulp": "^3.9.1",
"gulp-babel": "^7.0.1",
Expand Down Expand Up @@ -51,5 +51,14 @@
},
"engines": {
"node": ">=6"
},
"dependencies": {
"angular": "^1.7.2",
"angular-ui-bootstrap": "^2.5.0",
"fullcalendar": "^3.9.0",
"hsl_rgb_converter": "kayellpeee/hsl_rgb_converter",
"ical.js": "^1.2.2",
"jquery-timepicker": "fgelinas/timepicker#883bb2cd94",
"jstzdetect": "georgehrke/jstimezonedetect"
}
}
47 changes: 43 additions & 4 deletions js/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ amqplib@^0.5.2:
readable-stream "1.x >=1.1.9"
safe-buffer "^5.0.1"

angular-mocks@^1.7.2:
version "1.7.2"
resolved "https://registry.yarnpkg.com/angular-mocks/-/angular-mocks-1.7.2.tgz#8a2bc7a7ce355697a48ab00e548b88e78f71fa52"

angular-ui-bootstrap@^2.5.0:
version "2.5.6"
resolved "https://registry.yarnpkg.com/angular-ui-bootstrap/-/angular-ui-bootstrap-2.5.6.tgz#23937322ec641a6fbee16498cc32452aa199e7c5"

angular@^1.7.2:
version "1.7.2"
resolved "https://registry.yarnpkg.com/angular/-/angular-1.7.2.tgz#687b955dbe5c533f8d73460461707af00360251f"

ansi-colors@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9"
Expand Down Expand Up @@ -856,10 +868,6 @@ boom@2.x.x:
dependencies:
hoek "2.x.x"

bower@^1.8.4:
version "1.8.4"
resolved "https://registry.yarnpkg.com/bower/-/bower-1.8.4.tgz#e7876a076deb8137f7d06525dc5e8c66db82f28a"

brace-expansion@^1.0.0, brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
Expand Down Expand Up @@ -2142,6 +2150,13 @@ ftp@~0.3.10:
readable-stream "1.1.x"
xregexp "2.0.0"

fullcalendar@^3.9.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/fullcalendar/-/fullcalendar-3.9.0.tgz#b608a9989f3416f0b1d526c6bdfeeaf2ac79eda5"
dependencies:
jquery "2 - 3"
moment "^2.20.1"

gauge@~2.7.3:
version "2.7.4"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
Expand Down Expand Up @@ -2712,6 +2727,10 @@ hosted-git-info@^2.1.4:
version "2.6.1"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.1.tgz#6e4cee78b01bb849dcf93527708c69fdbee410df"

hsl_rgb_converter@kayellpeee/hsl_rgb_converter:
version "1.0.0"
resolved "https://codeload.github.com/kayellpeee/hsl_rgb_converter/tar.gz/3936a3896dd2f45a5c66317aab6f9175c9fde9fb"

html-tags@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-2.0.0.tgz#10b30a386085f43cede353cc8fa7cb0deeea668b"
Expand Down Expand Up @@ -2795,6 +2814,10 @@ https-proxy-agent@^2.2.1:
agent-base "^4.1.0"
debug "^3.1.0"

ical.js@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/ical.js/-/ical.js-1.2.2.tgz#59b517362a8f61dce0342fe67deb7c20dd119f6e"

iconv-lite@0.4.15:
version "0.4.15"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb"
Expand Down Expand Up @@ -3231,6 +3254,14 @@ jasmine-core@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.1.0.tgz#a4785e135d5df65024dfc9224953df585bd2766c"

jquery-timepicker@fgelinas/timepicker#883bb2cd94:
version "0.0.0"
resolved "https://codeload.github.com/fgelinas/timepicker/tar.gz/883bb2cd94ce65bc2a0a707b0c5911baf6de4ad4"

"jquery@2 - 3":
version "3.3.1"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca"

js-base64@^2.1.9:
version "2.4.5"
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.5.tgz#e293cd3c7c82f070d700fc7a1ca0a2e69f101f92"
Expand Down Expand Up @@ -3325,6 +3356,10 @@ jsprim@^1.2.2:
json-schema "0.2.3"
verror "1.10.0"

jstzdetect@georgehrke/jstimezonedetect:
version "1.0.6"
resolved "https://codeload.github.com/georgehrke/jstimezonedetect/tar.gz/d90d861a98a30a802cb1f4c7864854fe3a583134"

karma-coverage@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/karma-coverage/-/karma-coverage-1.1.2.tgz#cc09dceb589a83101aca5fe70c287645ef387689"
Expand Down Expand Up @@ -3955,6 +3990,10 @@ mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1:
dependencies:
minimist "0.0.8"

moment@^2.20.1:
version "2.22.2"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66"

ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
\OC_App::loadApp('calendar');
}

if(!class_exists('PHPUnit_Framework_TestCase')) {
if(!class_exists('PHPUnit\Framework\TestCase')) {
require_once('PHPUnit/Autoload.php');
}

Expand Down
12 changes: 6 additions & 6 deletions tests/js/config/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ module.exports = function (config) {
'../../core/vendor/moment/min/moment-with-locales.js',
'../../core/vendor/moment/min/moment-with-locales.min.js',
'../../core/vendor/davclient.js/lib/client.js',
'js/vendor/jstzdetect/dist/jstz.min.js',
'js/vendor/fullcalendar/dist/fullcalendar.min.js',
'js/vendor/angular/angular.js',
'js/vendor/angular-mocks/angular-mocks.js',
'js/vendor/ical.js/build/ical.js',
'js/vendor/hsl_rgb_converter/converter.js',
'js/node_modules/jstzdetect/dist/jstz.min.js',
'js/node_modules/fullcalendar/dist/fullcalendar.min.js',
'js/node_modules/angular/angular.js',
'js/node_modules/angular-mocks/angular-mocks.js',
'js/node_modules/ical.js/build/ical.js',
'js/node_modules/hsl_rgb_converter/converter.js',
'tests/js/stubs/app.js',
'js/app/**/*.js',
'tests/js/unit/**/*.js'
Expand Down
4 changes: 3 additions & 1 deletion tests/php/controller/contactcontrollerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
*/
namespace OCA\Calendar\Controller;

class ContactControllerTest extends \PHPUnit_Framework_TestCase {
use PHPUnit\Framework\TestCase;

class ContactControllerTest extends TestCase {

private $appName;
private $request;
Expand Down
4 changes: 3 additions & 1 deletion tests/php/controller/emailcontrollerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
*/
namespace OCA\Calendar\Controller;

class EmailControllerTest extends \PHPUnit_Framework_TestCase {
use PHPUnit\Framework\TestCase;

class EmailControllerTest extends TestCase {

private $appName;
private $request;
Expand Down
3 changes: 2 additions & 1 deletion tests/php/controller/proxycontrollerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
*/
namespace OCA\Calendar\Controller;

use PHPUnit\Framework\TestCase;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\ConnectException;

class ProxyControllerTest extends \PHPUnit_Framework_TestCase {
class ProxyControllerTest extends TestCase {

private $appName;
private $request;
Expand Down
4 changes: 3 additions & 1 deletion tests/php/controller/settingscontrollerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
*/
namespace OCA\Calendar\Controller;

class SettingsControllerTest extends \PHPUnit_Framework_TestCase {
use PHPUnit\Framework\TestCase;

class SettingsControllerTest extends TestCase {

private $appName;
private $request;
Expand Down
4 changes: 3 additions & 1 deletion tests/php/controller/viewcontrollerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@

namespace OCA\Calendar\Controller;

class ViewControllerTest extends \PHPUnit_Framework_TestCase {
use PHPUnit\Framework\TestCase;

class ViewControllerTest extends TestCase {

private $appName;
private $request;
Expand Down
Loading

0 comments on commit da65f66

Please sign in to comment.