mirror of
https://github.com/chylex/Nextcloud-News.git
synced 2025-05-10 10:34:06 +02:00
Remove bower, install everything using npm (#197)
* Remove bower, install everything using npm Remove js-url and use a simple function to get the query param. * Bundle all js scripts in app.min.js * Move jquery to devDependencies * Remove es6-shim, most common browsers support es6 natively.
This commit is contained in:
parent
c32d85c119
commit
fd630242da
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,7 +2,6 @@
|
|||||||
composer.phar
|
composer.phar
|
||||||
node_modules/
|
node_modules/
|
||||||
vendor/
|
vendor/
|
||||||
js/vendor/
|
|
||||||
js/build
|
js/build
|
||||||
*.log
|
*.log
|
||||||
/build/
|
/build/
|
||||||
|
19
Makefile
19
Makefile
@ -29,13 +29,13 @@
|
|||||||
# build tools and additional package managers should be installed locally in
|
# build tools and additional package managers should be installed locally in
|
||||||
# your project, since this won't pollute people's global namespace.
|
# your project, since this won't pollute people's global namespace.
|
||||||
#
|
#
|
||||||
# The following npm scripts in your package.json install and update the bower
|
# The following npm scripts in your package.json install the npm dependencies
|
||||||
# and npm dependencies and use gulp as build system (notice how everything is
|
# and use gulp as build system (notice how everything is run from the
|
||||||
# run from the node_modules folder):
|
# node_modules folder):
|
||||||
#
|
#
|
||||||
# "scripts": {
|
# "scripts": {
|
||||||
# "test": "node node_modules/gulp-cli/bin/gulp.js karma",
|
# "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"
|
# "build": "node node_modules/gulp-cli/bin/gulp.js"
|
||||||
# },
|
# },
|
||||||
|
|
||||||
@ -104,13 +104,12 @@ npm:
|
|||||||
clean:
|
clean:
|
||||||
rm -rf ./build
|
rm -rf ./build
|
||||||
|
|
||||||
# Same as clean but also removes dependencies installed by composer, bower and
|
# Same as clean but also removes dependencies installed by composer and
|
||||||
# npm
|
# npm
|
||||||
.PHONY: distclean
|
.PHONY: distclean
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -rf vendor
|
rm -rf vendor
|
||||||
rm -rf node_modules
|
rm -rf node_modules
|
||||||
rm -rf js/vendor
|
|
||||||
rm -rf js/node_modules
|
rm -rf js/node_modules
|
||||||
|
|
||||||
# Builds the source and appstore package
|
# Builds the source and appstore package
|
||||||
@ -153,14 +152,6 @@ appstore:
|
|||||||
"COPYING" \
|
"COPYING" \
|
||||||
"AUTHORS.md" \
|
"AUTHORS.md" \
|
||||||
"CHANGELOG.md" \
|
"CHANGELOG.md" \
|
||||||
"js/vendor/js-url/url.min.js" \
|
|
||||||
"js/vendor/es6-shim/es6-shim.min.js" \
|
|
||||||
"js/vendor/angular/angular.min.js" \
|
|
||||||
"js/vendor/angular-animate/angular-animate.min.js" \
|
|
||||||
"js/vendor/angular-route/angular-route.min.js" \
|
|
||||||
"js/vendor/angular-sanitize/angular-sanitize.min.js" \
|
|
||||||
"js/vendor/moment/min/moment-with-locales.min.js" \
|
|
||||||
"js/vendor/masonry/dist/masonry.pkgd.min.js" \
|
|
||||||
"js/build/app.min.js" \
|
"js/build/app.min.js" \
|
||||||
"js/admin/Admin.js" \
|
"js/admin/Admin.js" \
|
||||||
$(appstore_build_directory)
|
$(appstore_build_directory)
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"directory": "vendor"
|
|
||||||
|
|
||||||
}
|
|
@ -1,3 +1,2 @@
|
|||||||
build/
|
build/
|
||||||
node_modules/
|
node_modules/
|
||||||
vendor/
|
|
||||||
|
@ -46,7 +46,6 @@
|
|||||||
"enumerate": true,
|
"enumerate": true,
|
||||||
"News": true,
|
"News": true,
|
||||||
"t": true,
|
"t": true,
|
||||||
"url": true,
|
|
||||||
"navigator": true,
|
"navigator": true,
|
||||||
"oc_requesttoken": true,
|
"oc_requesttoken": true,
|
||||||
"_": true
|
"_": true
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "nextcloud-news",
|
|
||||||
"homepage": "https://github.com/nextcloud/news",
|
|
||||||
"authors": [
|
|
||||||
"Bernhard Posselt <dev@bernhard-posselt.com>"
|
|
||||||
],
|
|
||||||
"description": "An RSS/Atom feed reader",
|
|
||||||
"keywords": [
|
|
||||||
"rss",
|
|
||||||
"atom",
|
|
||||||
"nextcloud",
|
|
||||||
"feed",
|
|
||||||
"reader",
|
|
||||||
"app"
|
|
||||||
],
|
|
||||||
"license": "AGPL-3.0",
|
|
||||||
"private": true,
|
|
||||||
"ignore": [
|
|
||||||
"**/.*",
|
|
||||||
"node_modules",
|
|
||||||
"vendor",
|
|
||||||
"tests"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "~1.6.0",
|
|
||||||
"angular-route": "~1.6.0",
|
|
||||||
"angular-mocks": "~1.6.0",
|
|
||||||
"angular-sanitize": "~1.6.0",
|
|
||||||
"angular-animate": "~1.6.0",
|
|
||||||
"jquery": "~2.2.0",
|
|
||||||
"moment": "~2.18",
|
|
||||||
"es6-shim": "~0.35.0",
|
|
||||||
"js-url": "~2.5.0",
|
|
||||||
"masonry": "~4.2.0"
|
|
||||||
}
|
|
||||||
}
|
|
@ -12,9 +12,22 @@
|
|||||||
* This prefills the add feed section if an external link has ?subsribe_to
|
* This prefills the add feed section if an external link has ?subsribe_to
|
||||||
* filled out
|
* filled out
|
||||||
*/
|
*/
|
||||||
(function (window, document, navigator, url, $, undefined) {
|
(function (window, document, navigator, $, undefined) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
function queryParam(param)
|
||||||
|
{
|
||||||
|
var query = window.location.search.substring(1);
|
||||||
|
var vars = query.split('&');
|
||||||
|
for (var i = 0; i < vars.length; i += 1) {
|
||||||
|
var pair = vars[i].split('=');
|
||||||
|
if(pair[0] === param) {
|
||||||
|
return decodeURIComponent(pair[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
|
||||||
// register reader as feed reader in firefox
|
// register reader as feed reader in firefox
|
||||||
var location = window.location;
|
var location = window.location;
|
||||||
var storage = window.localStorage;
|
var storage = window.localStorage;
|
||||||
@ -50,12 +63,13 @@
|
|||||||
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
var subscription = url('?subscribe_to');
|
var subscribeTo = queryParam('subscribe_to');
|
||||||
if (subscription && subscription !== 'undefined') {
|
|
||||||
|
if(subscribeTo && subscribeTo !== 'undefined') {
|
||||||
$('#new-feed').show();
|
$('#new-feed').show();
|
||||||
|
|
||||||
var input = $('input[ng-model="Navigation.feed.url"]');
|
var input = $('input[ng-model="Navigation.feed.url"]');
|
||||||
input.val(subscription);
|
input.val(subscribeTo);
|
||||||
input.trigger('input');
|
input.trigger('input');
|
||||||
|
|
||||||
// hacky way to focus because initial loading of a feed
|
// hacky way to focus because initial loading of a feed
|
||||||
@ -66,4 +80,4 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
})(window, document, navigator, url, $);
|
})(window, document, navigator, $);
|
||||||
|
@ -26,6 +26,12 @@ const phpunitConfig = __dirname + '/../phpunit.xml';
|
|||||||
const karmaConfig = __dirname + '/karma.conf.js';
|
const karmaConfig = __dirname + '/karma.conf.js';
|
||||||
const destinationFolder = __dirname + '/build/';
|
const destinationFolder = __dirname + '/build/';
|
||||||
const sources = [
|
const sources = [
|
||||||
|
'node_modules/angular/angular.min.js',
|
||||||
|
'node_modules/angular-animate/angular-animate.min.js',
|
||||||
|
'node_modules/angular-route/angular-route.min.js',
|
||||||
|
'node_modules/angular-sanitize/angular-sanitize.min.js',
|
||||||
|
'node_modules/moment/min/moment-with-locales.min.js',
|
||||||
|
'node_modules/masonry-layout/dist/masonry.pkgd.min.js',
|
||||||
'app/App.js', 'app/Config.js', 'app/Run.js',
|
'app/App.js', 'app/Config.js', 'app/Run.js',
|
||||||
'controller/**/*.js',
|
'controller/**/*.js',
|
||||||
'filter/**/*.js',
|
'filter/**/*.js',
|
||||||
|
@ -16,14 +16,12 @@ module.exports = function (config) {
|
|||||||
|
|
||||||
// list of files / patterns to load in the browser
|
// list of files / patterns to load in the browser
|
||||||
files: [
|
files: [
|
||||||
'vendor/js-url/url.min.js',
|
'node_modules/jquery/dist/jquery.js',
|
||||||
'vendor/es6-shim/es6-shim.min.js',
|
'node_modules/moment/min/moment-with-locales.js',
|
||||||
'vendor/jquery/dist/jquery.js',
|
'node_modules/angular/angular.js',
|
||||||
'vendor/moment/min/moment-with-locales.js',
|
'node_modules/angular-mocks/angular-mocks.js',
|
||||||
'vendor/angular/angular.js',
|
'node_modules/angular-route/angular-route.js',
|
||||||
'vendor/angular-mocks/angular-mocks.js',
|
'node_modules/angular-sanitize/angular-sanitize.js',
|
||||||
'vendor/angular-route/angular-route.js',
|
|
||||||
'vendor/angular-sanitize/angular-sanitize.js',
|
|
||||||
'tests/unit/stubs/App.js',
|
'tests/unit/stubs/App.js',
|
||||||
'tests/unit/stubs/OC.js',
|
'tests/unit/stubs/OC.js',
|
||||||
'controller/**/*.js',
|
'controller/**/*.js',
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"main": "build/app.min.js",
|
"main": "build/app.min.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node node_modules/gulp-cli/bin/gulp.js karma",
|
"test": "node node_modules/gulp-cli/bin/gulp.js karma",
|
||||||
"prebuild": "npm install && npm update && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update",
|
"prebuild": "npm install && npm update",
|
||||||
"build": "node node_modules/gulp-cli/bin/gulp.js"
|
"build": "node node_modules/gulp-cli/bin/gulp.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -30,7 +30,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://github.com/nextcloud/news",
|
"homepage": "https://github.com/nextcloud/news",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"bower": "^1.8.0",
|
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-cli": "^1.2.2",
|
"gulp-cli": "^1.2.2",
|
||||||
"gulp-concat": "^2.6.1",
|
"gulp-concat": "^2.6.1",
|
||||||
@ -40,6 +39,7 @@
|
|||||||
"gulp-sourcemaps": "^1.9.1",
|
"gulp-sourcemaps": "^1.9.1",
|
||||||
"gulp-uglify": "^2.0.0",
|
"gulp-uglify": "^2.0.0",
|
||||||
"jasmine-core": "^2.5.2",
|
"jasmine-core": "^2.5.2",
|
||||||
|
"jquery": "^2.2.4",
|
||||||
"jshint": "^2.9.4",
|
"jshint": "^2.9.4",
|
||||||
"karma": "^1.3.0",
|
"karma": "^1.3.0",
|
||||||
"karma-chrome-launcher": "^2.0.0",
|
"karma-chrome-launcher": "^2.0.0",
|
||||||
@ -47,5 +47,14 @@
|
|||||||
"karma-firefox-launcher": "^1.0.0",
|
"karma-firefox-launcher": "^1.0.0",
|
||||||
"karma-jasmine": "^1.1.0"
|
"karma-jasmine": "^1.1.0"
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"dependencies": {
|
||||||
|
"angular": "^1.6.4",
|
||||||
|
"angular-animate": "^1.6.4",
|
||||||
|
"angular-mocks": "^1.6.4",
|
||||||
|
"angular-route": "^1.6.4",
|
||||||
|
"angular-sanitize": "^1.6.4",
|
||||||
|
"debug": "^2.6.8",
|
||||||
|
"masonry-layout": "^4.2.0",
|
||||||
|
"moment": "^2.18.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,6 @@
|
|||||||
use OCA\News\Plugin\Client\Plugin;
|
use OCA\News\Plugin\Client\Plugin;
|
||||||
|
|
||||||
script('news', [
|
script('news', [
|
||||||
'vendor/js-url/url.min',
|
|
||||||
'vendor/es6-shim/es6-shim.min',
|
|
||||||
'vendor/angular/angular.min',
|
|
||||||
'vendor/angular-animate/angular-animate.min',
|
|
||||||
'vendor/angular-route/angular-route.min',
|
|
||||||
'vendor/angular-sanitize/angular-sanitize.min',
|
|
||||||
'vendor/moment/min/moment-with-locales.min',
|
|
||||||
'vendor/masonry/dist/masonry.pkgd.min',
|
|
||||||
'build/app.min',
|
'build/app.min',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user