Migrate to webpack v5

Signed-off-by: Louis Chemineau <louis@chmn.me>
pull/30020/head
Louis Chemineau 3 years ago committed by John Molakvoæ
parent f8f09bff04
commit adfb9010d4
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF

@ -93,7 +93,8 @@ export default {
/** /**
* Does the current share have a note * Does the current share have a note
* @returns {boolean} *
* @return {boolean}
*/ */
hasNote: { hasNote: {
get() { get() {
@ -143,7 +144,7 @@ export default {
* firing the request * firing the request
* *
* @param {Share} share the share to check * @param {Share} share the share to check
* @returns {Boolean} * @return {boolean}
*/ */
checkShare(share) { checkShare(share) {
if (share.password) { if (share.password) {
@ -187,7 +188,8 @@ export default {
/** /**
* Note changed, let's save it to a different key * Note changed, let's save it to a different key
* @param {String} note the share note *
* @param {string} note the share note
*/ */
onNoteChange(note) { onNoteChange(note) {
this.$set(this.share, 'newNote', note.trim()) this.$set(this.share, 'newNote', note.trim())
@ -241,7 +243,7 @@ export default {
// share api controller accepts // share api controller accepts
propertyNames.map(p => (properties[p] = this.share[p].toString())) propertyNames.map(p => (properties[p] = this.share[p].toString()))
this.updateQueue.add(async() => { this.updateQueue.add(async () => {
this.saving = true this.saving = true
this.errors = {} this.errors = {}
try { try {
@ -270,6 +272,7 @@ export default {
/** /**
* Manage sync errors * Manage sync errors
*
* @param {string} property the errored property, e.g. 'password' * @param {string} property the errored property, e.g. 'password'
* @param {string} message the error message * @param {string} message the error message
*/ */
@ -321,8 +324,9 @@ export default {
/** /**
* Returns which dates are disabled for the datepicker * Returns which dates are disabled for the datepicker
*
* @param {Date} date date to check * @param {Date} date date to check
* @returns {boolean} * @return {boolean}
*/ */
disabledDate(date) { disabledDate(date) {
const dateMoment = moment(date) const dateMoment = moment(date)

@ -25,7 +25,7 @@
</template> </template>
<script> <script>
import marked from 'marked' import { marked } from 'marked'
import dompurify from 'dompurify' import dompurify from 'dompurify'
export default { export default {

@ -99,7 +99,7 @@ class BeforeTemplateRenderedListener implements IEventListener {
return ['profileEnabled' => $this->isProfileEnabled($account)]; return ['profileEnabled' => $this->isProfileEnabled($account)];
}); });
\OCP\Util::addScript('user_status', 'user_status-menu'); \OCP\Util::addScript('user_status', 'menu');
\OCP\Util::addStyle('user_status', 'user-status-menu'); \OCP\Util::addStyle('user_status', 'user-status-menu');
} }
} }

@ -24,6 +24,7 @@
/* eslint-disable */ /* eslint-disable */
import $ from 'jquery' import $ from 'jquery'
import { filePath } from './routing' import { filePath } from './routing'
import { generateFilePath } from "@nextcloud/router"
/** /**
* Opens a popup with the setting for an app. * Opens a popup with the setting for an app.
@ -64,7 +65,7 @@ export const appSettings = args => {
popup.hide().remove() popup.hide().remove()
} else { } else {
const arrowclass = settings.hasClass('topright') ? 'up' : 'left' const arrowclass = settings.hasClass('topright') ? 'up' : 'left'
$.get(filePath(props.appid, '', props.scriptName), function(data) { $.get(generateFilePath(props.appid, '', props.scriptName), function(data) {
popup.html(data).ready(function() { popup.html(data).ready(function() {
popup.prepend('<span class="arrow ' + arrowclass + '"></span><h2>' + t('core', 'Settings') + '</h2><a class="close"></a>').show() popup.prepend('<span class="arrow ' + arrowclass + '"></span><h2>' + t('core', 'Settings') + '</h2><a class="close"></a>').show()
popup.find('.close').bind('click', function() { popup.find('.close').bind('click', function() {
@ -85,7 +86,7 @@ export const appSettings = args => {
if (props.cache) { if (props.cache) {
$.ajaxSetup({ cache: true }) $.ajaxSetup({ cache: true })
} }
$.getScript(filePath(props.appid, 'js', scriptname)) $.getScript(generateFilePath(props.appid, 'js', scriptname))
.fail(function(jqxhr, settings, e) { .fail(function(jqxhr, settings, e) {
throw e throw e
}) })

43244
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -47,6 +47,7 @@
"blueimp-md5": "^2.19.0", "blueimp-md5": "^2.19.0",
"bootstrap": "^4.6.0", "bootstrap": "^4.6.0",
"camelcase": "^6.3.0", "camelcase": "^6.3.0",
"circular-dependency-plugin": "^5.2.2",
"clipboard": "^2.0.8", "clipboard": "^2.0.8",
"core-js": "^3.20.1", "core-js": "^3.20.1",
"css-vars-ponyfill": "^2.4.7", "css-vars-ponyfill": "^2.4.7",
@ -69,10 +70,12 @@
"nextcloud-vue-collections": "^0.9.0", "nextcloud-vue-collections": "^0.9.0",
"p-limit": "^4.0.0", "p-limit": "^4.0.0",
"p-queue": "^7.1.0", "p-queue": "^7.1.0",
"path": "^0.12.7",
"query-string": "^7.0.1", "query-string": "^7.0.1",
"regenerator-runtime": "^0.13.9", "regenerator-runtime": "^0.13.9",
"select2": "3.5.1", "select2": "3.5.1",
"snap.js": "^2.0.9", "snap.js": "^2.0.9",
"stream-browserify": "^3.0.0",
"strengthify": "github:nextcloud/strengthify#0.5.9", "strengthify": "github:nextcloud/strengthify#0.5.9",
"underscore": "^1.12.0", "underscore": "^1.12.0",
"url-search-params-polyfill": "^8.1.1", "url-search-params-polyfill": "^8.1.1",
@ -90,7 +93,8 @@
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
"vuex": "^3.6.2", "vuex": "^3.6.2",
"vuex-router-sync": "^5.0.0", "vuex-router-sync": "^5.0.0",
"webdav": "^4.7.0" "webdav": "^4.7.0",
"webpack-bundle-analyzer": "^4.5.0"
}, },
"devDependencies": { "devDependencies": {
"@nextcloud/babel-config": "^1.0.0", "@nextcloud/babel-config": "^1.0.0",

@ -1,7 +1,7 @@
/* eslint-disable camelcase */ /* eslint-disable camelcase */
const { VueLoaderPlugin } = require('vue-loader') const { VueLoaderPlugin } = require('vue-loader')
const path = require('path') const path = require('path')
const CircularDependencyPlugin = require('circular-dependency-plugin')
const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except') const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except')
const ESLintPlugin = require('eslint-webpack-plugin') const ESLintPlugin = require('eslint-webpack-plugin')
@ -31,7 +31,7 @@ const modulesToBuild = () => {
throw new Error(`No module "${MODULE}" found`) throw new Error(`No module "${MODULE}" found`)
} }
return formatOutputFromModules({ return formatOutputFromModules({
[MODULE]: modules[MODULE] [MODULE]: modules[MODULE],
}) })
} }
@ -99,29 +99,32 @@ module.exports = {
{ {
test: /\.handlebars/, test: /\.handlebars/,
loader: 'handlebars-loader', loader: 'handlebars-loader',
query: {
extensions: '.handlebars',
},
}, },
], ],
}, },
optimization: { optimization: {
splitChunks: { splitChunks: false,
automaticNameDelimiter: '-', // {
cacheGroups: { // automaticNameDelimiter: '-',
vendors: { // cacheGroups: {
test: /[\\/]node_modules[\\/]/, // vendors: {
enforce: true, // test: /[\\/]node_modules[\\/]/,
name: 'nextcloud', // enforce: true,
chunks: 'all', // name: 'nextcloud',
}, // chunks: 'all',
}, // },
}, // },
// },
}, },
plugins: [new VueLoaderPlugin(), new ESLintPlugin()], plugins: [
new VueLoaderPlugin(),
new ESLintPlugin(),
new CircularDependencyPlugin({
}),
],
resolve: { resolve: {
alias: { alias: {
OC: path.resolve(__dirname, './core/src/OC'), OC: path.resolve(__dirname, './core/src/OC'),
@ -131,5 +134,8 @@ module.exports = {
}, },
extensions: ['*', '.js', '.vue'], extensions: ['*', '.js', '.vue'],
symlinks: false, symlinks: false,
fallback: {
stream: require.resolve('stream-browserify'),
},
}, },
} }

@ -73,19 +73,19 @@ module.exports = {
oauth2: path.join(__dirname, 'apps/oauth2/src', 'main.js'), oauth2: path.join(__dirname, 'apps/oauth2/src', 'main.js'),
}, },
settings: { settings: {
'settings-apps-users-management': path.join(__dirname, 'apps/settings/src', 'main-apps-users-management.js'), 'vue-settings-apps-users-management': path.join(__dirname, 'apps/settings/src', 'main-apps-users-management.js'),
'settings-admin-security': path.join(__dirname, 'apps/settings/src', 'main-admin-security.js'), 'vue-settings-admin-security': path.join(__dirname, 'apps/settings/src', 'main-admin-security.js'),
'settings-personal-security': path.join(__dirname, 'apps/settings/src', 'main-personal-security.js'), 'vue-settings-personal-security': path.join(__dirname, 'apps/settings/src', 'main-personal-security.js'),
'settings-personal-webauthn': path.join(__dirname, 'apps/settings/src', 'main-personal-webauth.js'), 'vue-settings-personal-webauthn': path.join(__dirname, 'apps/settings/src', 'main-personal-webauth.js'),
'settings-nextcloud-pdf': path.join(__dirname, 'apps/settings/src', 'main-nextcloud-pdf.js'), 'vue-settings-nextcloud-pdf': path.join(__dirname, 'apps/settings/src', 'main-nextcloud-pdf.js'),
'settings-personal-info': path.join(__dirname, 'apps/settings/src', 'main-personal-info.js'), 'vue-settings-personal-info': path.join(__dirname, 'apps/settings/src', 'main-personal-info.js'),
}, },
systemtags: { systemtags: {
systemtags: path.join(__dirname, 'apps/systemtags/src', 'systemtags.js'), systemtags: path.join(__dirname, 'apps/systemtags/src', 'systemtags.js'),
}, },
user_status: { user_status: {
'user_status-dashboard': path.join(__dirname, 'apps/user_status/src', 'dashboard.js'), dashboard: path.join(__dirname, 'apps/user_status/src', 'dashboard.js'),
'user_status-menu': path.join(__dirname, 'apps/user_status/src', 'main-user-status-menu.js'), menu: path.join(__dirname, 'apps/user_status/src', 'menu.js'),
}, },
weather_status: { weather_status: {
'weather-status': path.join(__dirname, 'apps/weather_status/src', 'weather-status.js'), 'weather-status': path.join(__dirname, 'apps/weather_status/src', 'weather-status.js'),

Loading…
Cancel
Save