mapomodule 1.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/defaults.js +38 -0
  2. package/module.js +31 -0
  3. package/package.json +27 -0
package/defaults.js ADDED
@@ -0,0 +1,38 @@
1
+ import vuetify from '@mapomodule/uikit/defaults'
2
+
3
+ export default {
4
+ store: true,
5
+ components: true,
6
+ router: {
7
+ base: process.env.PANEL_URL || '/',
8
+ },
9
+ head: {
10
+ titleTemplate: '%s - mapo',
11
+ title: '🥭 mapo',
12
+ meta: [
13
+ { charset: 'utf-8' },
14
+ { name: 'viewport', content: 'width=device-width, initial-scale=1' },
15
+ { hid: 'description', name: 'description', content: '' }
16
+ ],
17
+ link: [
18
+ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
19
+ ]
20
+ },
21
+ vuetify,
22
+ axios: {
23
+ baseURL: 'http://localhost:8000',
24
+ browserBaseURL: 'http://localhost:8000',
25
+ },
26
+
27
+ extendPlugins(plugins) {
28
+ const index = plugins.findIndex(
29
+ ({ src }) => src.endsWith('mapo/mapo.js')
30
+ )
31
+ const mapoPlugin = plugins[index]
32
+ if (mapoPlugin) {
33
+ plugins.splice(index, 1)
34
+ plugins.push(mapoPlugin)
35
+ }
36
+ return plugins
37
+ }
38
+ }
package/module.js ADDED
@@ -0,0 +1,31 @@
1
+ import mapoDefaults from './defaults'
2
+ const _mergeWith = require('lodash.mergewith')
3
+
4
+
5
+ function customMerger(objValue, srcValue, key) {
6
+ const isFunction = function (obj) {
7
+ return !!(obj && obj.constructor && obj.call && obj.apply);
8
+ }
9
+ if (key == 'extendPlugins' && isFunction(objValue) && isFunction(srcValue)) {
10
+ return plugins => objValue(srcValue(plugins))
11
+ }
12
+ if (typeof objValue !== 'object') {
13
+ return objValue
14
+ }
15
+ }
16
+
17
+ export default async function MapoModule(moduleOptions) {
18
+
19
+ const userModuleOptions = Object.keys(moduleOptions).length === 0 ? (this.options['mapo'] || {}) : moduleOptions
20
+
21
+ this.options = _mergeWith(this.options, mapoDefaults, customMerger)
22
+
23
+ await this.requireModule(['@nuxtjs/axios', (this.options && this.options.axios) || userModuleOptions.axios || mapoDefaults.axios || {}])
24
+ await this.requireModule(['@mapomodule/store'], userModuleOptions.store)
25
+ await this.requireModule(['@mapomodule/core'], userModuleOptions)
26
+ this.requireModule(['@mapomodule/uikit'], userModuleOptions.ui)
27
+ .then(() => this.requireModule(['@mapomodule/routemeta'], userModuleOptions.routemeta))
28
+
29
+ }
30
+
31
+ module.exports.meta = require('./package.json')
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "mapomodule",
3
+ "version": "1.0.0-alpha.0",
4
+ "description": "Mapo is a nuxt module that helps in the creation of Administration Panels.",
5
+ "author": "bnznamco <gabriele.baldi.01@gmail.com>",
6
+ "keywords": [
7
+ "mapo",
8
+ "nuxt",
9
+ "Admin",
10
+ "Panel"
11
+ ],
12
+ "license": "MIT",
13
+ "repository": "https://github.com/lotrekagency/mapo",
14
+ "main": "./module.js",
15
+ "dependencies": {
16
+ "@mapomodule/core": "^1.0.0-alpha.0",
17
+ "@mapomodule/routemeta": "^1.0.0-alpha.0",
18
+ "@mapomodule/store": "^1.0.0-alpha.0",
19
+ "@mapomodule/uikit": "^1.0.0-alpha.0",
20
+ "@nuxtjs/axios": "^5.13.6",
21
+ "lodash.mergewith": "^4.6.2"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "gitHead": "801fe7de298f06e335793291c4955abf62edd077"
27
+ }