From 2c4ee89f0a04a201bc2549b61a0adc9eda00c9db Mon Sep 17 00:00:00 2001 From: markusfluer Date: Wed, 19 Jul 2017 20:07:23 +0200 Subject: [PATCH] Dev: updated instruction and gulp for adminpanel Added a readme and more gulp-commads also a list of possible commands for changes --- assets/packages/adminpanel/README.md | 28 +- .../packages/adminpanel/build/lsadminpanel.js | 723 ++++++++++-------- .../adminpanel/build/lsadminpanel.js.map | 1 + .../adminpanel/build/lsadminpanel.min.js | 2 +- assets/packages/adminpanel/gulpfile.js | 57 +- assets/packages/adminpanel/package.json | 13 +- .../adminpanel/src/components/loadingbar.vue | 21 + .../adminpanel/src/components/topbar.vue | 2 +- assets/packages/adminpanel/webpack.config.js | 1 + assets/packages/adminpanel/yarn.lock | 194 ++++- 10 files changed, 708 insertions(+), 334 deletions(-) create mode 100644 assets/packages/adminpanel/build/lsadminpanel.js.map diff --git a/assets/packages/adminpanel/README.md b/assets/packages/adminpanel/README.md index b5e14a8a1cd..be3df6337f9 100644 --- a/assets/packages/adminpanel/README.md +++ b/assets/packages/adminpanel/README.md @@ -1,4 +1,4 @@ -# new admin panel +# Admin panel ## whats new? @@ -46,17 +46,27 @@ All necessary packages will be installed. ### compiling assets -#### webpack +Compilation of assets is completely controllable by gulp. -Webpack compiles the javascript assets and the inline styles of the vue-components. +Here is a list of possible gulp commands: -It is run with the command `webpack` or `webpack --watch` for watching changes and automatically recompiling on change. +|Command | Description | +|--------------------------|------------------------------------------------------------| +|`gulp` | Just compile all assets into the build folder | +|`gulp compile` | Long version for `gulp` | +|`gulp compile:production` | Compile all assets into production ready minified versions | +|`gulp watch` | Compile all assets and then watch for changes | -#### gulp -Gulp is used for compiling the SCSS and compiling the production version of the javascript +Here are subcommands that are not neccessary normally -To compile the SCSS gun `gulp sass` or `gulp sass:watch` for watching changes and recompiling on change. - -To create a production ready version of the javascript files run `gulp compress`. +|Command | Description | +|--------------------------|------------------------------------------------------------| +|`gulp sass` | Only compile sass | +|`gulp sass:production` | Only compile sass for production | +|`gulp webpack:production` | Only compile js through webpack | +|`gulp webpack` | Only compile js through webpack for production | +|`gulp sass:watch` | Watch sass assets for change and compile on change | +|`gulp webpack:watch` | Watch js assets for change and compile on change | +|`gulp compress` | Compress assets to a minified version | diff --git a/assets/packages/adminpanel/build/lsadminpanel.js b/assets/packages/adminpanel/build/lsadminpanel.js index a1cf644cb32..8b49169a064 100644 --- a/assets/packages/adminpanel/build/lsadminpanel.js +++ b/assets/packages/adminpanel/build/lsadminpanel.js @@ -377,12 +377,12 @@ var config = ({ /** * Show production mode tip message on boot? */ - productionTip: "production" !== 'production', + productionTip: "undefined" !== 'production', /** * Whether to enable devtools */ - devtools: "production" !== 'production', + devtools: "undefined" !== 'production', /** * Whether to record perf @@ -492,7 +492,7 @@ var warn = noop; var tip = noop; var formatComponentName = (null); // work around flow check -if (false) { +if (true) { var hasConsole = typeof console !== 'undefined'; var classifyRE = /(?:^|[-_])(\w)/g; var classify = function (str) { return str @@ -585,7 +585,7 @@ function handleError (err, vm, info) { if (config.errorHandler) { config.errorHandler.call(null, err, vm, info); } else { - if (false) { + if (true) { warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); } /* istanbul ignore else */ @@ -1020,7 +1020,7 @@ function defineReactive$$1 ( return } /* eslint-enable no-self-compare */ - if (false) { + if ("undefined" !== 'production' && customSetter) { customSetter(); } if (setter) { @@ -1051,7 +1051,7 @@ function set (target, key, val) { } var ob = (target ).__ob__; if (target._isVue || (ob && ob.vmCount)) { - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( 'Avoid adding reactive properties to a Vue instance or its root $data ' + 'at runtime - declare it upfront in the data option.' ); @@ -1076,7 +1076,7 @@ function del (target, key) { } var ob = (target ).__ob__; if (target._isVue || (ob && ob.vmCount)) { - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( 'Avoid deleting properties on a Vue instance or its root $data ' + '- just set it to null.' ); @@ -1118,7 +1118,7 @@ var strats = config.optionMergeStrategies; /** * Options with restrictions */ -if (false) { +if (true) { strats.el = strats.propsData = function (parent, child, vm, key) { if (!vm) { warn( @@ -1164,7 +1164,7 @@ strats.data = function ( return parentVal } if (typeof childVal !== 'function') { - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( 'The "data" option should be a function ' + 'that returns a per-instance value in component ' + 'definitions.', @@ -1321,7 +1321,7 @@ function normalizeProps (options) { if (typeof val === 'string') { name = camelize(val); res[name] = { type: null }; - } else if (false) { + } else if (true) { warn('props must be strings when using array syntax.'); } } @@ -1361,7 +1361,7 @@ function mergeOptions ( child, vm ) { - if (false) { + if (true) { checkComponents(child); } @@ -1421,7 +1421,7 @@ function resolveAsset ( if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } // fallback to prototype chain var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; - if (false) { + if ("undefined" !== 'production' && warnMissing && !res) { warn( 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, options @@ -1459,7 +1459,7 @@ function validateProp ( observe(value); observerState.shouldConvert = prevShouldConvert; } - if (false) { + if (true) { assertProp(prop, key, value, vm, absent); } return value @@ -1475,7 +1475,7 @@ function getPropDefaultValue (vm, prop, key) { } var def = prop.default; // warn against non-factory defaults for Object & Array - if (false) { + if ("undefined" !== 'production' && isObject(def)) { warn( 'Invalid default value for prop "' + key + '": ' + 'Props with type Object/Array must use a factory function ' + @@ -1599,7 +1599,7 @@ function isType (type, fn) { var mark; var measure; -if (false) { +if (true) { var perf = inBrowser && window.performance; /* istanbul ignore if */ if ( @@ -1623,7 +1623,7 @@ if (false) { var initProxy; -if (false) { +if (true) { var allowedGlobals = makeMap( 'Infinity,undefined,NaN,isFinite,isNaN,' + 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + @@ -1824,7 +1824,7 @@ function updateListeners ( old = oldOn[name]; event = normalizeEvent(name); if (isUndef(cur)) { - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), vm ); @@ -1898,7 +1898,7 @@ function extractPropsFromVNodeData ( if (isDef(attrs) || isDef(props)) { for (var key in propOptions) { var altKey = hyphenate(key); - if (false) { + if (true) { var keyInLowerCase = key.toLowerCase(); if ( key !== keyInLowerCase && @@ -2073,7 +2073,7 @@ function resolveAsyncComponent ( }); var reject = once(function (reason) { - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( "Failed to resolve async component: " + (String(factory)) + (reason ? ("\nReason: " + reason) : '') ); @@ -2116,7 +2116,7 @@ function resolveAsyncComponent ( setTimeout(function () { if (isUndef(factory.resolved)) { reject( - false + true ? ("timeout (" + (res.timeout) + "ms)") : null ); @@ -2256,7 +2256,7 @@ function eventsMixin (Vue) { Vue.prototype.$emit = function (event) { var vm = this; - if (false) { + if (true) { var lowerCaseEvent = event.toLowerCase(); if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) { tip( @@ -2465,7 +2465,7 @@ function mountComponent ( vm.$el = el; if (!vm.$options.render) { vm.$options.render = createEmptyVNode; - if (false) { + if (true) { /* istanbul ignore if */ if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') || vm.$options.el || el) { @@ -2487,7 +2487,7 @@ function mountComponent ( var updateComponent; /* istanbul ignore if */ - if (false) { + if ("undefined" !== 'production' && config.performance && mark) { updateComponent = function () { var name = vm._name; var id = vm._uid; @@ -2548,7 +2548,7 @@ function updateChildComponent ( // update props if (propsData && vm.$options.props) { observerState.shouldConvert = false; - if (false) { + if (true) { observerState.isSettingProps = true; } var props = vm._props; @@ -2558,7 +2558,7 @@ function updateChildComponent ( props[key] = validateProp(key, vm.$options.props, propsData, vm); } observerState.shouldConvert = true; - if (false) { + if (true) { observerState.isSettingProps = false; } // keep a copy of raw propsData @@ -2653,7 +2653,7 @@ var index = 0; function resetSchedulerState () { index = queue.length = activatedChildren.length = 0; has = {}; - if (false) { + if (true) { circular = {}; } waiting = flushing = false; @@ -2684,7 +2684,7 @@ function flushSchedulerQueue () { has[id] = null; watcher.run(); // in dev build, check and stop circular updates. - if (false) { + if ("undefined" !== 'production' && has[id] != null) { circular[id] = (circular[id] || 0) + 1; if (circular[id] > MAX_UPDATE_COUNT) { warn( @@ -2808,7 +2808,7 @@ var Watcher = function Watcher ( this.newDeps = []; this.depIds = new _Set(); this.newDepIds = new _Set(); - this.expression = false + this.expression = true ? expOrFn.toString() : ''; // parse expression for getter @@ -2818,7 +2818,7 @@ var Watcher = function Watcher ( this.getter = parsePath(expOrFn); if (!this.getter) { this.getter = function () {}; - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( "Failed watching path: \"" + expOrFn + "\" " + 'Watcher only accepts simple dot-delimited paths. ' + 'For full control, use a function instead.', @@ -3068,7 +3068,7 @@ function initProps (vm, propsOptions) { keys.push(key); var value = validateProp(key, propsOptions, propsData, vm); /* istanbul ignore else */ - if (false) { + if (true) { if (isReservedProp[key] || config.isReservedAttr(key)) { warn( ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."), @@ -3108,7 +3108,7 @@ function initData (vm) { : data || {}; if (!isPlainObject(data)) { data = {}; - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( 'data functions should return an object:\n' + 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm @@ -3120,7 +3120,7 @@ function initData (vm) { var i = keys.length; while (i--) { if (props && hasOwn(props, keys[i])) { - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( "The data property \"" + (keys[i]) + "\" is already declared as a prop. " + "Use prop default value instead.", vm @@ -3150,7 +3150,7 @@ function initComputed (vm, computed) { for (var key in computed) { var userDef = computed[key]; var getter = typeof userDef === 'function' ? userDef : userDef.get; - if (false) { + if (true) { if (getter === undefined) { warn( ("No getter function has been defined for computed property \"" + key + "\"."), @@ -3167,7 +3167,7 @@ function initComputed (vm, computed) { // at instantiation here. if (!(key in vm)) { defineComputed(vm, key, userDef); - } else if (false) { + } else if (true) { if (key in vm.$data) { warn(("The computed property \"" + key + "\" is already defined in data."), vm); } else if (vm.$options.props && key in vm.$options.props) { @@ -3213,7 +3213,7 @@ function initMethods (vm, methods) { var props = vm.$options.props; for (var key in methods) { vm[key] = methods[key] == null ? noop : bind(methods[key], vm); - if (false) { + if (true) { if (methods[key] == null) { warn( "method \"" + key + "\" has an undefined value in the component definition. " + @@ -3264,7 +3264,7 @@ function stateMixin (Vue) { dataDef.get = function () { return this._data }; var propsDef = {}; propsDef.get = function () { return this._props }; - if (false) { + if (true) { dataDef.set = function (newData) { warn( 'Avoid replacing instance root $data. ' + @@ -3316,7 +3316,7 @@ function initInjections (vm) { if (result) { Object.keys(result).forEach(function (key) { /* istanbul ignore else */ - if (false) { + if (true) { defineReactive$$1(vm, key, result[key], function () { warn( "Avoid mutating an injected value directly since the changes will be " + @@ -3501,7 +3501,7 @@ function createComponent ( // if at this stage it's not a constructor or an async component factory, // reject. if (typeof Ctor !== 'function') { - if (false) { + if (true) { warn(("Invalid Component definition: " + (String(Ctor))), context); } return @@ -3654,7 +3654,7 @@ function _createElement ( normalizationType ) { if (isDef(data) && isDef((data).__ob__)) { - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" + 'Always create fresh vnode data objects in each render!', context @@ -3783,7 +3783,7 @@ function renderSlot ( } else { var slotNodes = this.$slots[name]; // warn duplicate slot usage - if (slotNodes && "production" !== 'production') { + if (slotNodes && "undefined" !== 'production') { slotNodes._rendered && warn( "Duplicate presence of slot \"" + name + "\" found in the same render tree " + "- this will likely cause render errors.", @@ -3835,7 +3835,7 @@ function bindObjectProps ( ) { if (value) { if (!isObject(value)) { - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( 'v-bind without argument expects an Object or Array value', this ); @@ -3976,7 +3976,7 @@ function renderMixin (Vue) { // return error render result, // or previous vnode to prevent render error causing blank component /* istanbul ignore else */ - if (false) { + if (true) { vnode = vm.$options.renderError ? vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e) : vm._vnode; @@ -3986,7 +3986,7 @@ function renderMixin (Vue) { } // return empty vnode in case the render function errored out if (!(vnode instanceof VNode)) { - if (false) { + if ("undefined" !== 'production' && Array.isArray(vnode)) { warn( 'Multiple root nodes returned from render function. Render function ' + 'should return a single root node.', @@ -4031,7 +4031,7 @@ function initMixin (Vue) { var startTag, endTag; /* istanbul ignore if */ - if (false) { + if ("undefined" !== 'production' && config.performance && mark) { startTag = "vue-perf-init:" + (vm._uid); endTag = "vue-perf-end:" + (vm._uid); mark(startTag); @@ -4053,7 +4053,7 @@ function initMixin (Vue) { ); } /* istanbul ignore else */ - if (false) { + if (true) { initProxy(vm); } else { vm._renderProxy = vm; @@ -4070,7 +4070,7 @@ function initMixin (Vue) { callHook(vm, 'created'); /* istanbul ignore if */ - if (false) { + if ("undefined" !== 'production' && config.performance && mark) { vm._name = formatComponentName(vm, false); mark(endTag); measure(((vm._name) + " init"), startTag, endTag); @@ -4157,7 +4157,8 @@ function dedupe (latest, extended, sealed) { } function Vue$3 (options) { - if (false + if ("undefined" !== 'production' && + !(this instanceof Vue$3) ) { warn('Vue is a constructor and should be called with the `new` keyword'); } @@ -4224,7 +4225,7 @@ function initExtend (Vue) { } var name = extendOptions.name || Super.options.name; - if (false) { + if (true) { if (!/^[a-zA-Z][\w-]*$/.test(name)) { warn( 'Invalid component name: "' + name + '". Component names ' + @@ -4313,7 +4314,7 @@ function initAssetRegisters (Vue) { return this.options[type + 's'][id] } else { /* istanbul ignore if */ - if (false) { + if (true) { if (type === 'component' && config.isReservedTag(id)) { warn( 'Do not use built-in or reserved HTML elements as component ' + @@ -4442,7 +4443,7 @@ function initGlobalAPI (Vue) { // config var configDef = {}; configDef.get = function () { return config; }; - if (false) { + if (true) { configDef.set = function () { warn( 'Do not replace the Vue.config object, set individual fields instead.' @@ -4693,7 +4694,7 @@ function query (el) { if (typeof el === 'string') { var selected = document.querySelector(el); if (!selected) { - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( 'Cannot find element: ' + el ); return document.createElement('div') @@ -4918,7 +4919,7 @@ function createPatchFunction (backend) { var children = vnode.children; var tag = vnode.tag; if (isDef(tag)) { - if (false) { + if (true) { if (data && data.pre) { inPre++; } @@ -4950,7 +4951,7 @@ function createPatchFunction (backend) { insert(parentElm, vnode.elm, refElm); } - if (false) { + if ("undefined" !== 'production' && data && data.pre) { inPre--; } } else if (isTrue(vnode.isComment)) { @@ -5195,7 +5196,7 @@ function createPatchFunction (backend) { } else { elmToMove = oldCh[idxInOld]; /* istanbul ignore if */ - if (false) { + if ("undefined" !== 'production' && !elmToMove) { warn( 'It seems there are duplicate keys that is causing an update error. ' + 'Make sure each v-for item has a unique key.' @@ -5289,7 +5290,7 @@ function createPatchFunction (backend) { // Note: this is a browser-only function so we can assume elms are DOM nodes. function hydrate (elm, vnode, insertedVnodeQueue) { - if (false) { + if (true) { if (!assertNodeMatch(elm, vnode)) { return false } @@ -5324,7 +5325,9 @@ function createPatchFunction (backend) { // if childNode is not null, it means the actual childNodes list is // longer than the virtual children list. if (!childrenMatch || childNode) { - if (false + if ("undefined" !== 'production' && + typeof console !== 'undefined' && + !bailed ) { bailed = true; console.warn('Parent: ', elm); @@ -5390,7 +5393,7 @@ function createPatchFunction (backend) { if (hydrate(oldVnode, vnode, insertedVnodeQueue)) { invokeInsertHook(vnode, insertedVnodeQueue, true); return oldVnode - } else if (false) { + } else if (true) { warn( 'The client-side rendered virtual DOM tree is not matching ' + 'server-rendered content. This is likely caused by incorrect ' + @@ -5813,7 +5816,8 @@ function addHandler ( // warn prevent and passive modifier /* istanbul ignore if */ if ( - false + "undefined" !== 'production' && warn && + modifiers && modifiers.prevent && modifiers.passive ) { warn( 'passive and prevent can\'t be used together. ' + @@ -6046,7 +6050,7 @@ function model ( var tag = el.tag; var type = el.attrsMap.type; - if (false) { + if (true) { var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type']; if (tag === 'input' && dynamicType) { warn$1( @@ -6076,7 +6080,7 @@ function model ( genComponentModel(el, value, modifiers); // component v-model doesn't need extra runtime return false - } else if (false) { + } else if (true) { warn$1( "<" + (el.tag) + " v-model=\"" + value + "\">: " + "v-model is not supported on this element type. " + @@ -6818,7 +6822,7 @@ function enter (vnode, toggleDisplay) { : duration ); - if (false) { + if ("undefined" !== 'production' && explicitEnterDuration != null) { checkDuration(explicitEnterDuration, 'enter', vnode); } @@ -6924,7 +6928,7 @@ function leave (vnode, rm) { : duration ); - if (false) { + if ("undefined" !== 'production' && isDef(explicitLeaveDuration)) { checkDuration(explicitLeaveDuration, 'leave', vnode); } @@ -7133,7 +7137,7 @@ function setSelected (el, binding, vm) { var value = binding.value; var isMultiple = el.multiple; if (isMultiple && !Array.isArray(value)) { - "production" !== 'production' && warn( + "undefined" !== 'production' && warn( "