Browse Source

Move comments to webpack

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
tags/v16.0.0alpha1
Roeland Jago Douma 5 years ago
parent
commit
41ef3d860c
No account linked to committer's email address

+ 2
- 0
.gitattributes View File

@@ -3,6 +3,8 @@

/apps/accessibility/js/accessibility.js binary
/apps/accessibility/js/accessibility.js.map binary
/apps/comments/js/*.js binary
/apps/comments/js/*.js.map binary
/apps/files_sharing/js/additionalScripts.js binary
/apps/files_sharing/js/additionalScripts.js.map binary
/apps/files_versions/js/files_versions.js binary

+ 2
- 1
apps/comments/.l10nignore View File

@@ -1,2 +1,3 @@
# compiled vue templates
js/templates.js
src/templates.js
js/comments.js

+ 2
- 0
apps/comments/js/comments.js
File diff suppressed because it is too large
View File


+ 1
- 0
apps/comments/js/comments.js.map
File diff suppressed because it is too large
View File


+ 0
- 14
apps/comments/js/merged.json View File

@@ -1,14 +0,0 @@
[
"app.js",
"templates.js",
"commentmodel.js",
"commentcollection.js",
"commentsummarymodel.js",
"commentstabview.js",
"commentsmodifymenu.js",
"filesplugin.js",
"activitytabviewplugin.js",
"search.js",
"vendor/Caret.js/dist/jquery.caret.min.js",
"vendor/At.js/dist/js/jquery.atwho.min.js"
]

+ 1
- 3
apps/comments/lib/AppInfo/Application.php View File

@@ -61,9 +61,7 @@ class Application extends App {
$dispatcher->addListener(
'OCA\Files::loadAdditionalScripts',
function() {
Util::addScript('comments', 'merged');
Util::addStyle('comments', 'autocomplete');
Util::addStyle('comments', 'comments');
Util::addScript('comments', 'comments');
}
);
}

apps/comments/js/activitytabviewplugin.js → apps/comments/src/activitytabviewplugin.js View File


apps/comments/js/app.js → apps/comments/src/app.js View File


apps/comments/js/commentcollection.js → apps/comments/src/commentcollection.js View File


apps/comments/js/commentmodel.js → apps/comments/src/commentmodel.js View File


+ 18
- 0
apps/comments/src/comments.js View File

@@ -0,0 +1,18 @@
import './app'
import './templates'
import './commentmodel'
import './commentcollection'
import './commentsummarymodel'
import './commentstabview'
import './commentsmodifymenu'
import './filesplugin'
import './activitytabviewplugin'
import './search'

import './vendor/Caret.js/dist/jquery.caret.min'
import './vendor/At.js/dist/js/jquery.atwho.min'

import './style/autocomplete.scss'
import './style/comments.scss'

window.OCA.Comments = OCA.Comments;

apps/comments/js/commentsmodifymenu.js → apps/comments/src/commentsmodifymenu.js View File


apps/comments/js/commentstabview.js → apps/comments/src/commentstabview.js View File


apps/comments/js/commentsummarymodel.js → apps/comments/src/commentsummarymodel.js View File


apps/comments/js/filesplugin.js → apps/comments/src/filesplugin.js View File


apps/comments/js/search.js → apps/comments/src/search.js View File


apps/comments/css/autocomplete.scss → apps/comments/src/style/autocomplete.scss View File


apps/comments/css/comments.scss → apps/comments/src/style/comments.scss View File


apps/comments/js/templates.js → apps/comments/src/templates.js View File


apps/comments/js/templates/comment.handlebars → apps/comments/src/templates/comment.handlebars View File


apps/comments/js/templates/commentsmodifymenu.handlebars → apps/comments/src/templates/commentsmodifymenu.handlebars View File


apps/comments/js/templates/edit_comment.handlebars → apps/comments/src/templates/edit_comment.handlebars View File


apps/comments/js/templates/filesplugin.handlebars → apps/comments/src/templates/filesplugin.handlebars View File


apps/comments/js/templates/view.handlebars → apps/comments/src/templates/view.handlebars View File


apps/comments/js/vendor/At.js/dist/js/jquery.atwho.min.js → apps/comments/src/vendor/At.js/dist/js/jquery.atwho.min.js View File


apps/comments/js/vendor/Caret.js/dist/jquery.caret.min.js → apps/comments/src/vendor/Caret.js/dist/jquery.caret.min.js View File


+ 40
- 0
apps/comments/webpack.js View File

@@ -0,0 +1,40 @@
const path = require('path');

module.exports = {
entry: path.join(__dirname, 'src', 'comments.js'),
output: {
path: path.resolve(__dirname, './js'),
publicPath: '/js/',
filename: 'comments.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]'
}
}
]
},
externals: {
jquery: 'jQuery'
},
resolve: {
extensions: ['*', '.js']
}
};

+ 1
- 11
tests/karma.config.js View File

@@ -77,17 +77,7 @@ module.exports = function(config) {
{
name: 'comments',
srcFiles: [
// need to enforce loading order...
'apps/comments/js/app.js',
'apps/comments/js/templates.js',
'apps/comments/js/vendor/Caret.js/dist/jquery.caret.min.js',
'apps/comments/js/vendor/At.js/dist/js/jquery.atwho.min.js',
'apps/comments/js/commentmodel.js',
'apps/comments/js/commentcollection.js',
'apps/comments/js/commentsummarymodel.js',
'apps/comments/js/commentsmodifymenu.js',
'apps/comments/js/commentstabview.js',
'apps/comments/js/filesplugin.js'
'apps/comments/js/comments.js'
],
testFiles: ['apps/comments/tests/js/**/*.js']
},

+ 2
- 0
webpack.common.js View File

@@ -2,6 +2,7 @@ const core = require('./core/webpack')
const settings = require('./settings/webpack')

const accessibility = require('./apps/accessibility/webpack')
const comments = require('./apps/comments/webpack')
const files_sharing = require('./apps/files_sharing/webpack')
const files_trashbin = require('./apps/files_trashbin/webpack')
const files_versions = require('./apps/files_versions/webpack')
@@ -14,6 +15,7 @@ module.exports = [].concat(
core,
settings,
accessibility,
comments,
files_sharing,
files_trashbin,
files_versions,

Loading…
Cancel
Save