use nextcloud webpack config with lint and all

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
This commit is contained in:
Julien Veyssier 2020-08-07 14:49:13 +02:00
Родитель 5fe62ec424
Коммит 461a600d2a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4141FEE162030638
9 изменённых файлов: 3163 добавлений и 99 удалений

Просмотреть файл

@ -77,7 +77,7 @@ class GithubWidget implements IWidget {
* @inheritDoc
*/
public function load(): void {
\OC_Util::addScript('github', 'dashboard');
\OC_Util::addScript('github', 'github-dashboard');
\OC_Util::addStyle('github', 'dashboard');
}
}

3135
package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -7,9 +7,13 @@
"test": "tests"
},
"scripts": {
"dev": "NODE_ENV=development npx webpack --config webpack.dev.js",
"watch": "NODE_ENV=development npx webpack --progress --watch --config webpack.dev.js",
"build": "NODE_ENV=production npx webpack --progress --hide-modules --config webpack.prod.js"
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.js",
"dev": "NODE_ENV=development webpack --progress --config webpack.js",
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.js",
"lint": "eslint --ext .js,.vue src",
"lint:fix": "eslint --ext .js,.vue src --fix",
"stylelint": "stylelint **/*.css **/*.scss **/*.vue",
"stylelint:fix": "stylelint **/*.css **/*.scss **/*.vue --fix"
},
"repository": {
"type": "git",
@ -31,6 +35,7 @@
"@nextcloud/router": "^1.1.0",
"@nextcloud/auth": "^1.3.0",
"@nextcloud/vue": "^2.2.1",
"@nextcloud/webpack-vue-config": "^1.1.0",
"@nextcloud/vue-dashboard": "^0.1.0",
"@nextcloud/axios": "^1.3.3",
"@nextcloud/dialogs": "^1.4.0",
@ -44,19 +49,34 @@
"vue-awesome-countdown": "^1.0.26"
},
"devDependencies": {
"@nextcloud/eslint-config": "^2.2.0",
"@nextcloud/eslint-plugin": "^1.4.0",
"@nextcloud/webpack-vue-config": "^1.1.0",
"stylelint-webpack-plugin": "^2.1.0",
"stylelint": "^13.6.1",
"webpack-merge": "^5.1.1",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"css-loader": "^3.6.0",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.1",
"eslint-import-resolver-webpack": "^0.12.2",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^6.2.2",
"@babel/core": "^7.10.5",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.10.4",
"babel-loader": "^8.1.0",
"vue-loader": "^15.9.1",
"vue-template-compiler": "^2.6.10",
"css-loader": "^3.4.2",
"node-sass": "^4.14.1",
"sass-loader": "^9.0.2",
"@nextcloud/browserslist-config": "^1.0.0",
"clean-webpack-plugin": "^3.0.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-merge": "^4.2.2"
"webpack-cli": "^3.3.12"
}
}

Просмотреть файл

@ -2,7 +2,7 @@
/** @var $l \OCP\IL10N */
/** @var $_ array */
script('github', 'adminSettings');
script('github', 'github-adminSettings');
?>
<div id="github_prefs"></div>

Просмотреть файл

@ -2,7 +2,7 @@
/** @var $l \OCP\IL10N */
/** @var $_ array */
script('github', 'personalSettings');
script('github', 'github-personalSettings');
?>
<div id="github_prefs"></div>

Просмотреть файл

@ -1,48 +0,0 @@
const path = require('path');
const webpack = require('webpack');
const { VueLoaderPlugin } = require('vue-loader');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
entry: {
personalSettings: path.join(__dirname, 'src', 'personalSettings.js'),
adminSettings: path.join(__dirname, 'src', 'adminSettings.js'),
dashboard: path.join(__dirname, 'src', 'dashboard.js'),
},
output: {
path: path.join(__dirname, 'js'),
publicPath: "/js/",
},
module: {
rules: [
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader'],
},
{
test: /\.scss$/,
use: ['vue-style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.(png|jpg|gif|svg|woff|woff2|eot|ttf)$/,
loader: 'url-loader',
},
],
},
plugins: [
new VueLoaderPlugin(),
new CleanWebpackPlugin(),
],
resolve: {
extensions: ['*', '.js', '.vue'],
},
}

Просмотреть файл

@ -1,7 +0,0 @@
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'development',
devtool: 'source-map',
});

25
webpack.js Normal file
Просмотреть файл

@ -0,0 +1,25 @@
const { merge } = require('webpack-merge')
const path = require('path')
const webpack = require('webpack')
const webpackConfig = require('@nextcloud/webpack-vue-config')
const config = {
entry: {
personalSettings: path.join(__dirname, 'src', 'personalSettings.js'),
adminSettings: path.join(__dirname, 'src', 'adminSettings.js'),
dashboard: path.join(__dirname, 'src', 'dashboard.js'),
},
module: {
rules: [
{
test: /\.(png|jpg|gif|svg|woff|woff2|eot|ttf)$/,
loader: 'url-loader',
},
],
},
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
],
}
module.exports = merge(config, webpackConfig)

Просмотреть файл

@ -1,7 +0,0 @@
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'production',
devtool: '#source-map',
});