diff --git a/.gitattributes b/.gitattributes index b2dea06fd7..32f68e85b5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,6 +3,8 @@ /apps/accessibility/js/accessibility.js binary /apps/accessibility/js/accessibility.js.map binary +/apps/files_versions/js/files_versions.js binary +/apps/files_versions/js/files_versions.js.map binary /apps/oauth2/js/oauth2.js binary /apps/oauth2/js/oauth2.js.map binary /apps/twofactor_backupcodes/js/*.js binary diff --git a/apps/files_versions/.l10nignore b/apps/files_versions/.l10nignore index 8b832897e3..a5844cfefe 100644 --- a/apps/files_versions/.l10nignore +++ b/apps/files_versions/.l10nignore @@ -1,2 +1,3 @@ # compiled vue templates -js/templates.js +js/files_versions.js +src/templates.js diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php index 1ac7d40689..f28210553c 100644 --- a/apps/files_versions/appinfo/app.php +++ b/apps/files_versions/appinfo/app.php @@ -22,6 +22,4 @@ * */ -\OCP\Util::addStyle('files_versions', 'versions'); - \OCA\Files_Versions\Hooks::connectHooks(); diff --git a/apps/files_versions/js/files_versions.js b/apps/files_versions/js/files_versions.js new file mode 100644 index 0000000000..4405671a10 Binary files /dev/null and b/apps/files_versions/js/files_versions.js differ diff --git a/apps/files_versions/js/files_versions.js.map b/apps/files_versions/js/files_versions.js.map new file mode 100644 index 0000000000..ea95c34bf2 Binary files /dev/null and b/apps/files_versions/js/files_versions.js.map differ diff --git a/apps/files_versions/js/merged.json b/apps/files_versions/js/merged.json deleted file mode 100644 index 67ee60b385..0000000000 --- a/apps/files_versions/js/merged.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "versionmodel.js", - "templates.js", - "versioncollection.js", - "versionstabview.js", - "filesplugin.js" -] diff --git a/apps/files_versions/lib/Hooks.php b/apps/files_versions/lib/Hooks.php index 3c4049e213..4e2dcfa308 100644 --- a/apps/files_versions/lib/Hooks.php +++ b/apps/files_versions/lib/Hooks.php @@ -149,6 +149,6 @@ class Hooks { * Load additional scripts when the files app is visible */ public static function onLoadFilesAppScripts() { - \OCP\Util::addScript('files_versions', 'merged'); + \OCP\Util::addScript('files_versions', 'files_versions'); } } diff --git a/apps/files_versions/css/versions.css b/apps/files_versions/src/css/versions.css similarity index 100% rename from apps/files_versions/css/versions.css rename to apps/files_versions/src/css/versions.css diff --git a/apps/files_versions/src/files_versions.js b/apps/files_versions/src/files_versions.js new file mode 100644 index 0000000000..e9504e03ed --- /dev/null +++ b/apps/files_versions/src/files_versions.js @@ -0,0 +1,8 @@ +import './versionmodel' +import './templates' +import './versioncollection' +import './versionstabview' +import './filesplugin' +import './css/versions.css' + +window.OCA.Versions = OCA.Versions diff --git a/apps/files_versions/js/filesplugin.js b/apps/files_versions/src/filesplugin.js similarity index 100% rename from apps/files_versions/js/filesplugin.js rename to apps/files_versions/src/filesplugin.js diff --git a/apps/files_versions/js/templates.js b/apps/files_versions/src/templates.js similarity index 100% rename from apps/files_versions/js/templates.js rename to apps/files_versions/src/templates.js diff --git a/apps/files_versions/js/templates/item.handlebars b/apps/files_versions/src/templates/item.handlebars similarity index 100% rename from apps/files_versions/js/templates/item.handlebars rename to apps/files_versions/src/templates/item.handlebars diff --git a/apps/files_versions/js/templates/template.handlebars b/apps/files_versions/src/templates/template.handlebars similarity index 100% rename from apps/files_versions/js/templates/template.handlebars rename to apps/files_versions/src/templates/template.handlebars diff --git a/apps/files_versions/js/versioncollection.js b/apps/files_versions/src/versioncollection.js similarity index 100% rename from apps/files_versions/js/versioncollection.js rename to apps/files_versions/src/versioncollection.js diff --git a/apps/files_versions/js/versionmodel.js b/apps/files_versions/src/versionmodel.js similarity index 100% rename from apps/files_versions/js/versionmodel.js rename to apps/files_versions/src/versionmodel.js diff --git a/apps/files_versions/js/versionstabview.js b/apps/files_versions/src/versionstabview.js similarity index 100% rename from apps/files_versions/js/versionstabview.js rename to apps/files_versions/src/versionstabview.js diff --git a/apps/files_versions/webpack.js b/apps/files_versions/webpack.js new file mode 100644 index 0000000000..4b0f1e4f6b --- /dev/null +++ b/apps/files_versions/webpack.js @@ -0,0 +1,37 @@ +const path = require('path'); + +module.exports = { + entry: path.join(__dirname, 'src', 'files_versions.js'), + output: { + path: path.resolve(__dirname, 'js'), + publicPath: '/js/', + filename: 'files_versions.js' + }, + module: { + rules: [ + { + test: /\.css$/, + use: ['style-loader', 'css-loader'] + }, + { + test: /\.scss$/, + use: ['style-loader', 'css-loader', 'sass-loader'] + }, + { + test: /\.js$/, + loader: 'babel-loader', + exclude: /node_modules/ + }, + { + test: /\.(png|jpg|gif|svg)$/, + loader: 'file-loader', + options: { + name: '[name].[ext]?[hash]' + } + } + ] + }, + resolve: { + extensions: ['*', '.js'] + } +}; diff --git a/core/js/core.json b/core/js/core.json index 77aeffff10..5bf6512d6a 100644 --- a/core/js/core.json +++ b/core/js/core.json @@ -13,9 +13,7 @@ "sharedialoglinkshareview.js", "sharedialogresharerinfoview.js", "sharedialogshareelistview.js", - "contactsmenu_templates.js", "public/publicpage.js", - "multiselect.js", "oc-requesttoken.js", "setupchecks.js", "../search/js/search.js", diff --git a/tests/karma.config.js b/tests/karma.config.js index fe60de3bdb..7ffd5ad4e6 100644 --- a/tests/karma.config.js +++ b/tests/karma.config.js @@ -45,6 +45,7 @@ module.exports = function(config) { return [ 'files', 'files_trashbin', + 'files_versions', { name: 'files_sharing', srcFiles: [ @@ -74,17 +75,6 @@ module.exports = function(config) { ], testFiles: ['apps/files_external/tests/js/*.js'] }, - { - name: 'files_versions', - srcFiles: [ - // need to enforce loading order... - 'apps/files_versions/js/versionmodel.js', - 'apps/files_versions/js/templates.js', - 'apps/files_versions/js/versioncollection.js', - 'apps/files_versions/js/versionstabview.js' - ], - testFiles: ['apps/files_versions/tests/js/**/*.js'] - }, { name: 'comments', srcFiles: [ @@ -117,8 +107,7 @@ module.exports = function(config) { { name: 'settings', srcFiles: [ - 'settings/js/apps.js', - 'core/vendor/marked/marked.min.js' + 'settings/js/apps.js' ] } ]; diff --git a/webpack.common.js b/webpack.common.js index 9a117ba4b3..f6a0d0213a 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -1,5 +1,10 @@ const core = require('./core/webpack'); const files_trashbin = require('./apps/files_trashbin/webpack') +const files_versions = require('./apps/files_versions/webpack'); const oauth2 = require('./apps/oauth2/webpack') -module.exports = [].concat(core, files_trashbin, oauth2); +module.exports = [].concat( + core, + files_trashbin, + files_versions, + oauth2);